Esempio n. 1
0
    def mover(self, mover):
        # remove existing mover
        if self.mover:
            attributes.removeLink(self.root, self.mover, ZIVA_ANIMATION_MOVER)

        # set new mover
        if mover:
            attributes.createLink(self.root, mover, ZIVA_ANIMATION_MOVER)
Esempio n. 2
0
    def container(self, container):
        # remove existing container
        if self.container:
            attributes.removeLink(self.root, self.container,
                                  ZIVA_ANIMATION_CONTAINER)

        # set new container
        if container:
            attributes.createLink(self.root, container,
                                  ZIVA_ANIMATION_CONTAINER)

        self._updateAnimationData()
Esempio n. 3
0
    def _createSolverParent(self):
        """
        Create and tag the solver parent node. If the solver already exists
        no new solver will be created. As the solver is to be exported it
        will be parented underneath the root node.
        """
        # validate solver
        if self.solver:
            return

        # create solver node
        parent = cmds.createNode("transform",
                                 name="solver_parent",
                                 skipSelect=True)
        parent = cmds.parent(parent, self.root)[0]

        # create link
        attributes.createLink(self.root, parent, ZIVA_SOLVER_PARENT)
    def __init__(self, root, character=None, animation=None, solver=None):
        super(MusclesAnimationImport, self).__init__(root, character)

        # validate animation
        if not animation and not self.animation:
            raise RuntimeError("Declare the 'animation' variable!")

        # validate solver
        if not solver and not self.solver:
            raise RuntimeError("Declare the 'solver' variable!")

        # set animation if declared
        if animation:
            attributes.createLink(self.root, animation, ZIVA_MUSCLES_ANIMATION)

        # set solver if declared
        if solver:
            attributes.createLink(self.root, solver, ZIVA_SOLVER)