예제 #1
0
    def __init__(self,
                 group_top='',
                 group_model='',
                 group_joint='',
                 group_controls='',
                 group_nodes='',
                 group_world='',
                 parent='',
                 scale=1.0,
                 **kwargs):
        for register_type in self.REGISTER_TYPES:
            setattr(self, register_type, list())
        self.nom = nomenclate.Nom(**kwargs)

        self.group_top = forge.registry.Transform.factory(group_top)
        self.group_model = forge.registry.Transform.factory(group_model)
        self.group_joint = forge.registry.Transform.factory(group_joint)
        self.group_controls = forge.registry.Transform.factory(group_controls)
        self.group_nodes = forge.registry.Transform.factory(group_nodes)
        self.group_world = forge.registry.Transform.factory(group_world)
        self.scale = scale

        self.register_nodes([
            'group_top', 'group_model', 'group_joint', 'group_nodes',
            'group_world', 'group_controls'
        ],
                            node_type=forge.settings.HIERARCHY_TYPE)
        self.register_nodes(['scale'], node_type=forge.settings.METADATA_TYPE)

        self.parent(parent)
예제 #2
0
파일: node.py 프로젝트: AndresMWeber/Forge
 def __init__(self, node_dag='', **kwargs):
     self.LOG.debug(
         'Initializing a node <%s> with node_dag %r and kwargs %s' %
         (self.__class__.__name__, node_dag, kwargs))
     self.nom = nomenclate.Nom()
     self.validate_node(node_dag)
     self._dag_path = node_dag
예제 #3
0
    def __init__(self,
                 layout_joints=None,
                 parent=None,
                 top_node=None,
                 name_tokens=None,
                 meta_data=None,
                 **kwargs):
        self.hierarchy = Map()
        self.root = top_node
        self.layout_joints = layout_joints
        self.build_joints = None
        self.build_kwargs = MetaData(kwargs)
        self.name_tokens = self.BUILT_IN_NAME_TOKENS.merge(name_tokens,
                                                           new=True)
        self.meta_data = self.BUILT_IN_META_DATA.merge(meta_data, new=True)

        self._nomenclate = nomenclate.Nom(self.name_tokens.data)
        self.chain_nomenclate = nomenclate.Nom()

        for namer in [self._nomenclate, self.chain_nomenclate]:
            namer.format = cfg.RIG_FORMAT
            namer.var.case = cfg.UPPER

        self.parent(parent)
예제 #4
0
import nomenclate
from . import transformation

nom = nomenclate.Nom()


def listHierarchy(topJoint, withEndJoints=True):
    """ list joint hierarchy starting with top joint
    :param topJoint: str, joint to get listed with its joint hierarchy
    :param withEndJoints: bool, list hierarchy including end joints
    :return: list( str ), listed joints starting with top joint
                        (if empty, returns full list of children joints)
    """
    listedJoints = pm.listRelatives(topJoint, type='joint', ad=True)
    listedJoints.append(topJoint)
    listedJoints.reverse()

    completeJoints = listedJoints[:]

    if not withEndJoints:
        completeJoints = [
            j for j in listedJoints if pm.listRelatives(j, c=1, type='joint')
        ]

    return completeJoints


def get_chain(startJoint, endJoint=False):
    '''Takes two joints as inputs and then returns the children joints in between the two inputs.
    Args:
        startJoint (pm.PyNode): the starting joint of the chain
예제 #5
0
from functools import wraps

os.environ['ANVIL_MODE'] = 'TEST'
os.environ['A_SAVE_PREFIX'] = 'test_results'
os.environ['A_SAVE_PATH'] = os.path.expanduser(os.path.join('~', '.anvil'))

from logging import getLogger, CRITICAL
from collections import Iterable
from anvil.utils.scene import sanitize_scene
from contextlib import contextmanager
import nomenclate
import anvil
import anvil.runtime as rt
from anvil.log import obtain_logger

NOMENCLATE = nomenclate.Nom()


class TestBase(unittest2.TestCase):
    LOG = obtain_logger('testing')
    getLogger('pymel.core.nodetypes').setLevel(CRITICAL)
    LOG.setLevel(CRITICAL)

    APOSE = 'APOSE'
    TPOSE = 'TPOSE'
    FOOT = 'FOOT'
    EXTERNALA = 'EXTERNALA'
    HAND_MERC = "HAND_MERC"
    FOOT_WITH_LEG = 'FOOT_WITH_LEG'
    FOOT_WITH_LEG_AND_SOLES = 'FOOT_WITH_LEG_AND_SOLES'
    TEMPLATE_FILES = {APOSE: 'test_skeleton_a_pose.ma',