I have a problem. I have a complex scene where are over 10 objects which all should get a transparency fade at the same time. They all have different cycle materials.
Is there a way to fade them all at the same time to a special value?
I started to write a Python script to help me with that but it seems I have to add transparency to every single material.
Any ideas how i can manage this? I don’t want to use the compositor.
It would be great if i could get a custom property from the parent object where all other objects are in.
hacked a lil script together which adds a given property to all children objects.
simply get the property in cycles.
import bpy
def get_children(parent):
allchildren = []
for each in parent.children:
allchildren.append(each)
for eachsub in each.children:
allchildren.append(eachsub)
for eachsubsub in eachsub.children:
allchildren.append(eachsubsub)
for eachsubsubsub in eachsubsub.children:
allchildren.append(eachsubsubsub)
print(allchildren)
return allchildren
def inherit_property(children,property,value):
for each in children:
each[property] = value
def delete_property(children,property):
for each in children:
del each[property]
# get all children till third generation
children = get_children(bpy.data.objects['main'])
# set the property
inherit_property(children,'alpha',bpy.data.objects['main']['alpha'])
# delete_property(children,'alpha')
The simpliest way is to use NodeGroup. Create a node group to mix the final material with a TransparencyShader, and add this nodegroup to all your materials. Then you can animate the mix factor inside the node group, and all the material with that node group will reflect the changes.
I’ve set up a Node Group to use to fade multiple materials too, but have a problem. Once the keyed value is inside a Node Group, it no longer updates in the view port in Materials mode. However, it renders correctly. This makes it so I have to render out my animations in order to see if they are correct; Not ideal.
Attached is a blend file showing the problem. If there is something I’m doing wrong or a fix for this, please advise.
I’m using the latest; 2.74. I tried re-installing 2.73a but found the same problem (perhaps it didn’t replace some of the blender libraries back to 2.73a?)
Here is a screenshot of the problem found in my attached .blend file:
This view shows that while changing the fac in the edited Node Group, the view port shows the change in transparency.
I tried that and it didn’t work before. But I’ve done an overhaul of the scenes and materials with many changes… and now it does work in the viewport using Rendered. Your response made me check it again. Thanks for your help.