Skip to content

Instantly share code, notes, and snippets.

@CGLion
Last active August 17, 2020 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CGLion/119b0deeeead369d4c97d0af11f05d22 to your computer and use it in GitHub Desktop.
Save CGLion/119b0deeeead369d4c97d0af11f05d22 to your computer and use it in GitHub Desktop.
Python for 3ds max - select object by type
from MaxPlus import SuperClassIds
from MaxPlus import SelectionManager
def scene_objects():
def list_children(node):
list = []
for c in node.Children:
list.append(c)
list = list + list_children(c)
return list
return list_children(MaxPlus.Core.GetRootNode())
for o in scene_objects():
obj = o.GetObject()
if obj.GetSuperClassID() == SuperClassIds.Light:
SelectionManager.SelectNode(o, False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment