コード例 #1
0
def _explodeClicked():
    from coral.coralUi.nodeEditor.nodeEditor import NodeEditor
    from coral import coralApp
    
    sel = NodeEditor.selectedNodes()
    if sel:
        coralApp.executeCommand("ExplodeCollapsedNode", collapsedNode = sel[0].fullName())
コード例 #2
0
def _explodeClicked():
    from coral.coralUi.nodeEditor.nodeEditor import NodeEditor
    from coral import coralApp
    
    sel = NodeEditor.selectedNodes()
    if sel:
        coralApp.executeCommand("ExplodeCollapsedNode", collapsedNode = sel[0].fullName())
コード例 #3
0
ファイル: nodeBox.py プロジェクト: achayan/coraline
    def _createFromItemData(itemData):
        from nodeEditor import nodeEditor
        
        sceneItem = None
        className = itemData["data"]["className"]
        parentNode = nodeEditor.NodeEditor.focusedInstance().currentNode().fullName()
        
        if itemData["type"] == "attributeClassName":
            name = "input"
            if itemData["data"]["output"]:
                name = "output"
            
            newAttributeName = coralApp.executeCommand("CreateAttribute", 
                className = className, 
                name = name, 
                parentNode = parentNode, 
                input = itemData["data"]["input"], output = itemData["data"]["output"])

            if newAttributeName:
                newAttribute = coralApp.findAttribute(newAttributeName)
                attributeUi = nodeEditor.NodeEditor.findAttributeUi(newAttribute.id())
                if attributeUi.proxy():
                    sceneItem = attributeUi.proxy()

        elif itemData["type"] == "nodeClassName":
            newNodeName = coralApp.executeCommand("CreateNode",
                                                className = className,
                                                name = className,
                                                parentNode = parentNode)
            if newNodeName:
                newNode = coralApp.findNode(newNodeName)
                sceneItem = nodeEditor.NodeEditor.findNodeUi(newNode.id())
        
        return sceneItem
コード例 #4
0
 def addOutput(self, name, attClass, specs):
     """ Adds a new output attribute to the node, and connects it to the inputs """
     coralApp.executeCommand("CreateAttribute", className=attClass.__name__,
                             name=name, parentNode=self.fullName(), output=True)
     attr = self.findAttribute(name)
     self._setAttributeAllowedSpecializations(attr, specs)
     for inAtt in self.inputAttributes():
         self._setAttributeAffect(inAtt, attr)
コード例 #5
0
def _collapseClicked():
    from coral.coralUi.nodeEditor.nodeEditor import NodeEditor
    from coral import coralApp
    
    nodesName = []
    for node in NodeEditor.selectedNodes():
        nodesName.append(node.fullName())
    
    if nodesName:
        coralApp.executeCommand("CollapseNodes", nodes = nodesName)
コード例 #6
0
def _collapseClicked():
    from coral.coralUi.nodeEditor.nodeEditor import NodeEditor
    from coral import coralApp

    nodesName = []
    for node in NodeEditor.selectedNodes():
        nodesName.append(node.fullName())

    if nodesName:
        coralApp.executeCommand("CollapseNodes", nodes=nodesName)
コード例 #7
0
    def _createFromItemData(itemData):
        from nodeEditor import nodeEditor

        sceneItem = None
        className = itemData["data"]["className"]
        parentNode = nodeEditor.NodeEditor.focusedInstance().currentNode(
        ).fullName()

        if itemData["type"] == "attributeClassName":
            name = "input"
            if itemData["data"]["output"]:
                name = "output"

            newAttributeName = coralApp.executeCommand(
                "CreateAttribute",
                className=className,
                name=name,
                parentNode=parentNode,
                input=itemData["data"]["input"],
                output=itemData["data"]["output"])

            if newAttributeName:
                newAttribute = coralApp.findAttribute(newAttributeName)
                attributeUi = nodeEditor.NodeEditor.findAttributeUi(
                    newAttribute.id())
                if attributeUi.proxy():
                    sceneItem = attributeUi.proxy()

        elif itemData["type"] == "nodeClassName":
            newNodeName = coralApp.executeCommand("CreateNode",
                                                  className=className,
                                                  name=className,
                                                  parentNode=parentNode)
            if newNodeName:
                newNode = coralApp.findNode(newNodeName)
                sceneItem = nodeEditor.NodeEditor.findNodeUi(newNode.id())

        return sceneItem