def addNode(self, node): coral.Node.addNode(self, node) if "CoralMayaNode" in node.classNames(): # we have to call updateCoralAttributeMap here because doing so in a CoralMayaNode contructor we would be wrong (the CoralMayaNode wouldn't be under its parent yet). cmds.coralMayaCmd("updateCoralAttributeMap", self._mayaNode) for attr in node.inputAttributes(): if hasattr(attr, "mayaAttribute"): # this will guarantee things are up to date from the start cmds.dgdirty(attr.mayaNode() + "." + attr.mayaAttribute())
def addNode(self, node): coral.Node.addNode(self, node) if "CoralMayaNode" in node.classNames(): # we have to call updateCoralAttributeMap here because doing so in a CoralMayaNode contructor we would be wrong (the CoralMayaNode wouldn't be under its parent yet). cmds.coralMayaCmd("updateCoralAttributeMap", self._mayaNode) for attr in node.inputAttributes(): if hasattr(attr, "mayaAttribute"): # this will guarantee things are up to date from the start cmds.dgdirty(attr.mayaNode() + "." + attr.mayaAttribute())
def deleteIt(self): mayaNode = self.parent().mayaNode() cmds.lockNode(mayaNode, lock = False) if self.isValid(): for attr in self.attributes(): if hasattr(attr, "mayaAttribute"): cmds.deleteAttr(attr.mayaNode() + "." + attr.mayaAttribute()) cmds.coralMayaCmd("updateCoralAttributeMap", self.parent().mayaNode()) coral.Node.deleteIt(self) cmds.lockNode(mayaNode, lock = True)
def deleteIt(self): mayaNode = self.parent().mayaNode() cmds.lockNode(mayaNode, lock=False) if self.isValid(): for attr in self.attributes(): if hasattr(attr, "mayaAttribute"): cmds.deleteAttr(attr.mayaNode() + "." + attr.mayaAttribute()) cmds.coralMayaCmd("updateCoralAttributeMap", self.parent().mayaNode()) coral.Node.deleteIt(self) cmds.lockNode(mayaNode, lock=True)