Created
September 29, 2013 16:41
-
-
Save NiklasRosenstein/6754141 to your computer and use it in GitHub Desktop.
@rosensteinn #c4dpytask #beginner How can you apply a Cinema 4D command to each selected object individually?
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
# @rosensteinn #c4dpytask #beginner How can you apply a Cinema 4D | |
# command to each selected object individually? | |
import c4d | |
# The ID of the Command which should be executed for each object. | |
# In this case, I chose the "Group Objects" command. | |
COMMAND_ID = 100004772 | |
def main(): | |
objects = doc.GetActiveObjects(c4d.GETACTIVEOBJECTS_CHILDREN) | |
for obj in objects: | |
doc.SetActiveObject(obj) | |
c4d.CallCommand(COMMAND_ID) | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment