Skip to content

Instantly share code, notes, and snippets.

@baku89
Last active September 27, 2016 13:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baku89/527bfee8d2575846319e to your computer and use it in GitHub Desktop.
Save baku89/527bfee8d2575846319e to your computer and use it in GitHub Desktop.
C4D: Make only nth child object visible
# 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