Last active
August 17, 2020 10:13
-
-
Save CGLion/119b0deeeead369d4c97d0af11f05d22 to your computer and use it in GitHub Desktop.
Python for 3ds max - select object by type
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
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