Last active
September 27, 2016 13:53
-
-
Save baku89/527bfee8d2575846319e to your computer and use it in GitHub Desktop.
C4D: Make only nth child object visible
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add User Data (ID=1) as Integer | |
# In python tag | |
def main(): | |
b = op.GetObject() | |
idx = b[c4d.ID_USERDATA,1] | |
children = b.GetChildren() | |
for i, c in enumerate(children): | |
v = 2 if idx == i else 1 | |
c[c4d.ID_BASEOBJECT_VISIBILITY_EDITOR] = v | |
c[c4d.ID_BASEOBJECT_VISIBILITY_RENDER] = v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment