# any addon or idea for on-off animation(or Fade in and out) of lots of objects?

I would like to use Blender for construction sequence animation. (Like this https://www.youtube.com/watch?v=g6sSbazsyLw)

Since the nature of construction sequence animation, I need to turn on and off(or fade in and out) in Visibility Option(Or Material Alpha) a lot.

I usually faces 3 types. Construct, Temporary and Demolition.

The Construct sequence is starting from Off and then On at specific keyframe.

The Temporary sequence is starting from Off and then On at specific keyframe and off at specific keyframe as well.

The Demolition sequence is starting from On and then Off at Specific keyframe.

I have been doing this by inserting keyframes manually but i got too many object. And to make fade in and out i need to separate material from original too many times.

If you know any good addon or function in Blender to make the process easy, please comment below.

Thank you!

• @Gorgious this is lovely idea! thank you for the information. I really appreciate. Jul 29 at 8:38

It's a complex topic and I think people underestimate the time it takes to make this kind of animation. Most of the time it's hand animated and it takes several weeks to do it, not even factoring in the modelling time.

That being said, with more recent versions you can use custom properties per-object to fade objects in and out. You then don't have to animate materials individually, but object properties.

Using an Attribute node set to Object, type in the name of the attribute (can be whatever you want).

Select the object, add a custom property. Edit it and rename it exactly like in your Attribute node.

Now you can have multiple objects that share the same material and animate the alpha individually.

If you have multiple materials in your scene (wood, steel, glass, PVC, etc.) you can turn it into a node group. Select the Attribute, Transparent and Mix Shader nodes and press CTRL + G or Node > Make Group to make a node group.

When inside the node group (you'll notice the backdrop has a green tint now), press TAB or click on the arrow in the top right to go back to the base shader.

Now you can just plug the new node group in every material just before the Material Output node and you'll be able to control the object's transparency with a custom property on the object itself.

If you want to create sub-groups with the same fade behavior, you can drive the custom properties easily :

If the custom property is animated using keyframes, you can link them by selecting your target objects and selecting the source object last, and using CTRL + L > Animation Data or Object > Link/Transfer Data > Animation Data.

Note : The cubes will now share the same animation data. In case you change the keyframes of one property, all the other objects with linked animation data will behave the same.

If after linking the Animation Data you want to make each object's animation independant, use F3 and search for "Make Single User", then check "Animation data" and click OK. You can also go Object > Relations > Make Single User > Animation Data. You can alternatively go into the outliner, expand the object properties, right click on the Action and choose "Make Single User".

• Hi Gorgious thank you for sharing the lovely idea and your kind explanation. I didn't know that i can use object attribute to material. One quick question, Do you have any idea that i can just copy the animation data to another but not link(cus it has problem like you mentioned in "Note"). Jul 29 at 8:56
• @DYLim thanks :) you can "make single user" on the animation data block, that means they lose their links to each user. I've added a paragraph to the end of the answer Jul 29 at 9:03
• thank you for the answer. Yes, "Make single user" can solve the problem of the link. However, In the middle of work, If i link the animation to another which already had keyframes, the action would remove the whole progress. Jul 29 at 9:11
• @DYLim You can copy and paste only certain keyframes from object to object. you can access them in the Timeline or graph editor Jul 29 at 9:55
• +1 ....but...where is the rotating screw animation...!? 😎 Jul 29 at 12:56

you could create a transparent shader like this so what will happen whenever the camera goes closer to the any object so the object will fade automatically which you can control ..... there will be many objects so you have to run a script which will apply this shader to every object in the scene

script

import bpy

#group = bpy.data.node_groups['your_node_group_name']
group = bpy.data.node_groups['1CameraBasedTransparency']

#get all non grease pencil materials
materials = [mat for mat in bpy.data.materials if mat.use_nodes and not mat.is_grease_pencil]
for mat in materials: #iterate over materials
node_tree = mat.node_tree #get node-tree of material

output_node = node_tree.nodes['Material Output'] #get output node of material
principled_node = node_tree.nodes['Principled BSDF'] #get Principled node of material

#add a group node in material