Ejemplo n.º 1
0
    def run(self, *args, **kwargs):

        uid  = self.fetch('uid', None)
        node = self.fetch('nodeName', None)

        if not uid:
            self.puts(
                success=False,
                error=True,
                message='Invalid or missing UID')
            return

        if node and TrackSceneUtils.checkNodeUidMatch(uid, node):
            self.puts(
                success=True,
                nodeName=node,
                props=TrackSceneUtils.getTrackProps(node))
            return

        node = TrackSceneUtils.getTrackNode(uid)
        if node:
            self.puts(
                success=True,
                nodeName=node,
                props=TrackSceneUtils.getTrackProps(node))
            return

        self.response.puts(success=False)
Ejemplo n.º 2
0
    def run(self, *args, **kwargs):
        uid   = self.fetch('uid', None)
        node  = self.fetch('nodeName', None)
        props = self.fetch('props', dict())

        if not uid:
            self.puts(
                success=False, error=True, message='Invalid or missing UID')
            return

        if node and TrackSceneUtils.checkNodeUidMatch(uid, node):
            TrackSceneUtils.setTrackProps(node, props)
            self.puts(success=True, nodeName=node)
            return

        trackSetNode = TrackSceneUtils.getTrackSetNode()
        if not trackSetNode:
            self.puts(
                success=False,
                error=True,
                message='Scene not initialized for Cadence')
            return

        for node in cmds.sets(trackSetNode, query=True):
            if not cmds.hasAttr(node + '.' + TrackPropEnum.UID.maya):
                continue
            if uid == cmds.getAttr(node + '.' + TrackPropEnum.UID.maya):
                TrackSceneUtils.setTrackProps(node, props)
                self.puts(success=True, nodeName=node)
                return

        self.response.puts(success=False)