PyMaxExplorer/maxDataModels.py
2 Data model for 3ds Max node.
4 from pymxs
import runtime
as rt
6 class mxTreeNode(object):
7 def __init__(self, name ,parent=None):
11 if self._parent
and self
not in self._parent._children :
12 self._parent._children.append(self)
17 def setName(self, nm):
20 name = property(getName, setName)
23 obj = rt.getNodeByName(self._name)
27 return str(rt.classOf(self._node))
31 return self._parent._children.index(self)
37 def child(self, indx):
38 if self._children
and indx >= 0
and indx < self.numChildren():
39 return self._children[indx]
42 def numChildren(self):
43 return len(self._children)
45 def addChild(self, child):
46 self._children.append(child)
48 def insertChild(self, node, pos):
49 if pos >= 0
and pos < self.numChildren():
50 self._children.insert(pos, node)
55 def popChild(self, pos):
56 if pos >= 0
and pos < self.numChildren():
57 child = self._children.pop(pos)