So I'm making an animation where I want about a dozen or so objects which all look the same to change their color, but with each object doing it at a different point, making a kind of swipe color change effect. But I don't want to make a bunch of different materials and animate each individual one. Help Please?
1 Answer
(01) (Difficult the first time) A color texture influence driver can be used ... with a numeric [custom property] .. 24, 48, 72 and so on ... on the objects ... object data. This would not be a lengthy script. You must locate the target of the script in the outliner datablocks view with great care as depicted below. This requires effort because it is deep hierarchy . Most people I suspect have rarely used the datablocks view. The Blender UI debug info will not behave as desired. Object location x, y, z scripts have better debug info. If you attempt to write a texture driver from the properties window it will fail. Blender will not give warning. Note the driver is located on the Cube object not its material. Below I typed a distinctive numeric value of .678, not 0 or 1,into the field to help me locate it in the datablock view. Note the absence of the driver in the texture panel.
The final render will be correct. Code
frame > 20

(02) Special case .. if the objects are static and identical with simple color... you may be able to join them and UV Map them together. Use a single texture that is an [image sequence] to slide the color across them. Your image sequence may need to be structured as twelve logical strips or color.
(03) Materials and textures are not the same .. I would consider 12 textures ... perhaps copying colors ... and keyframe the color influence of the texture. I am assuming you will not have more than 12. (I am supposed to avoid asking for clarification according to the yellow box text). This would avoid a lengthy script.
(04) The more objects you have the more utility of the driver or script.
- $\begingroup$ Ok so I tried your animated texture method, and it worked just fine. thanks! I also want to try your first one, the pseudo code? where would I type that in? $\endgroup$DragonHeart– DragonHeart2014-10-01 16:35:16 +00:00Commented Oct 1, 2014 at 16:35
- $\begingroup$ RMB Right Mouse Button the property and select one of the following options. Add Drivers. ... Blender Link wiki.blender.org/index.php/Doc:2.6/Manual/Animation/Basics/… .. See a video site for newer Blender driver video. ... I suggest you first modify only something simple like the x position of object. (frame * .02) code. The material drivers are not working as expected at this time today. I may post a question here at this site. A new topic might be better. $\endgroup$atomicbezierslinger– atomicbezierslinger2014-10-01 17:07:19 +00:00Commented Oct 1, 2014 at 17:07
- $\begingroup$ I am still investigating material driver updates. There are differences from simple position of an object. So (01) of the answer will be updated when I have a clear statement. $\endgroup$atomicbezierslinger– atomicbezierslinger2014-10-01 18:07:44 +00:00Commented Oct 1, 2014 at 18:07
- $\begingroup$ @DragonHeart So above is the driver for a material texture color influence. That is not necessarily a recommendation to use it. $\endgroup$atomicbezierslinger– atomicbezierslinger2014-10-01 21:21:25 +00:00Commented Oct 1, 2014 at 21:21
- $\begingroup$ Oh wow! thank you so much for your advice! It helps a TON! Thanks! $\endgroup$DragonHeart– DragonHeart2014-10-01 23:21:17 +00:00Commented Oct 1, 2014 at 23:21
obj = bpy.context.active_objecton the line before the error.... this defines the name obj .... perhaps you missed copying a line. This is only to address your syntax error. $\endgroup$