Guest User

Untitled

a guest
Jun 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. import MaxPlus
  2.  
  3. def get_scene_nodes():
  4. """
  5. Return all nodes in current scene
  6. :return: generator<INode>
  7. """
  8.  
  9. stack = [MaxPlus.Core.GetRootNode()]
  10. while stack:
  11. node = stack.pop()
  12. if node != MaxPlus.Core.GetRootNode():
  13. yield node
  14. if len(list(node.Children)) > 0:
  15. for child in node.Children:
  16. stack.append(child)
  17.  
  18.  
  19. def find_modifier_dependants(modifier):
  20. """
  21. Return dependants nodes of a given modifier
  22. :param modifier: MaxPlus.Modifier
  23. :return: generator<INode>
  24. """
  25.  
  26. objs = list()
  27. mod_handle = modifier.GetAnimHandle()
  28. scene_node = node.get_scene_nodes()
  29. for n in scene_node:
  30. for m in n.Modifiers:
  31. if m.GetAnimHandle() == mod_handle:
  32. yield n
Add Comment
Please, Sign In to add comment