def __init__(self, uiinfo):
        # Get our joint lists from a json file.
        data_path = os.environ["AR_DATA"] + 'data/rig/head.json'
        # Use our readJson function
        data = utils.readJson(data_path)
        # Load the json into a dictionary
        self.module_info = json.loads( data )
        
        # Make a new dictionary to store information about the arm rig.
        self.rig_info = {}

        # Here we will see if we have a selection to get new positions from.
        if len(cmds.ls(sl=True, type='joint')) == numjnts :
            self.rig_info['seljnts']=cmds.ls(sl=True, type='joint')
            positions = []
            for s in self.rig_info['seljnts']:
                positions.append(cmds.xform(s, q=True, ws=True, t=True))
            self.rig_info['positions']=positions

            # Get the joint orientations
            self.rig_info['parent'] = cmds.listRelatives(self.rig_info['seljnts'][0], p=True)[0]
            cmds.parent(self.rig_info['seljnts'][0], w=True)
            orients = []
            for j in self.rig_info['seljnts']:
                orients.append(cmds.getAttr("%s.jointOrient" % j))
            self.rig_info['orients'] = orients
            cmds.parent(self.rig_info['seljnts'][0], self.rig_info['parent'])

        else:
            self.rig_info['positions']=self.module_info['positions']

        self.instance = uiinfo[0]

        # Run rig_arm function
        self.install()
    def __init__(self):
        # Get our joint lists from a json file.
        print os.environ["RDOJO_DATA"]
        data_path = os.environ["RDOJO_DATA"] + 'data/rig/arm.json'
        # Use our readJson function
        data = utils.readJson(data_path)
        # Load the json into a dictionary
        self.module_info = json.loads( data )
        """ NOTE: If we wanted to build our arm from some set of joints
        in the scene, we could overwrite self.module_info['positions']"""
        # Make a new dictionary to store information about the arm rig.
        self.rig_info = {}

        # Here we will see if we have a selection to get new positions from.
        if len(cmds.ls(sl=True, type='joint')) == numjnts :
            sel=cmds.ls(sl=True, type='joint')
            positions = []
            for s in sel:
                positions.append(cmds.xform(s, q=True, ws=True, t=True))
            self.rig_info['positions']=positions

        else:
            self.rig_info['positions']=self.module_info['positions']

        """ Instead of the else:, we could just return a message that the selection
        does not meet requirements for an arm. """


        """ What if we want a left and a right arm?  For now we will set
        a temporary variable to override the name, but later we will build
        this into the UI """
        self.instance = '_L_'

        # Run rig_arm function
        self.rig_arm()
Beispiel #3
0
    def __init__(self):
        #Get our joint lists from a json file.
        print os.environ["LBS_DATA"]
        data_path = os.environ["LBS_DATA"] + 'data/arm_data.json'
        #Use our readJson function
        data = utils.readJson(data_path)
        #Load the json into a dictionary
        self.module_info = json.loads(data)
        """ NOTE: If we wanted to build our arm from some set of joints
		in the scene, we could overwrite self.module_info['positions']"""

        # Make a new dictionary to store information about the arg rig (layout rig)
        self.rig_info = {}

        # Here we will see if we have a selection to get new positions from.
        if len(cmds.ls(sl=True, type='joint')) == numberJNTS:
            sel = cmds.ls(sl=True, type='joint')
            position = []
            for s in sel:
                position.append(cmds.xform(s, q=True, ws=True, t=True))
            self.rig_info['position'] = position

        else:
            self.rig_info['position'] = self.module_info['position']
        """ Instead of the else:, we could just return a message that the selection
		does not meet the requirements for an arm. """
        """ what if we want a LF and a RT arm/leg? For now we will set
		a temp variable to override the name, but later we will build
		this into the UI. """

        self.instance = 'LF_'

        #Run rig_arm function
        self.rig_arm()
Beispiel #4
0
    def __init__(self, uiinfo):
        # Get our joint lists from a json file.
        data_path = os.environ["AR_DATA"] + 'data/rig/leg.json'
        # Use our readJson function
        data = utils.readJson(data_path)
        # Load the json into a dictionary
        self.module_info = json.loads( data )
        
        # Make a new dictionary to store information about the rig.
        self.rig_info = {}

        # Here we will see if we have a selection to get new positions from.
        if len(cmds.ls(sl=True, type='joint')) == numjnts :
            self.rig_info['seljnts']=cmds.ls(sl=True, type='joint')
            positions = []
            for s in self.rig_info['seljnts']:
                positions.append(cmds.xform(s, q=True, ws=True, t=True))
            self.rig_info['positions']=positions

            # Get the joint orientations
            self.rig_info['parent'] = cmds.listRelatives(self.rig_info['seljnts'][0], p=True)[0]
            cmds.parent(self.rig_info['seljnts'][0], w=True)
            orients = []
            for j in self.rig_info['seljnts']:
                orients.append(cmds.getAttr("%s.jointOrient" % j))
            self.rig_info['orients'] = orients
            cmds.parent(self.rig_info['seljnts'][0], self.rig_info['parent'])

        else:
            self.rig_info['positions']=self.module_info['positions']

        self.instance = uiinfo[0]

        # Run rig_arm function
        self.install()
    def __init__(self, uiinfo):
        # Get our joint lists from a json file.
        data_path = os.environ["RDOJO_DATA"] + 'data/rig/arm.json'
        # Use our readJson function
        data = utils.readJson(data_path)
        # Load the json into a dictionary
        self.module_info = json.loads( data )
        # Make a new dictionary to store information about the arm rig.
        self.rig_info = {}

        # Here we will see if we have a selection to get new positions from.
        if len(cmds.ls(sl=True, type='joint')) == numjnts :
            sel=cmds.ls(sl=True, type='joint')
            positions = []
            for s in sel:
                positions.append(cmds.xform(s, q=True, ws=True, t=True))
            self.rig_info['positions']=positions

        else:
            self.rig_info['positions']=self.module_info['positions']

        self.instance = uiinfo[0]

        # Run rig_arm function
        self.install()
Beispiel #6
0
	def __init__(self):
		#Get our joint lists from a json file.
		print os.environ["LBS_DATA"]
		data_path = os.environ["LBS_DATA"] + 'arm_data.json'
		#Use our readJson function
		data = utils.readJson(data_path)
		#Load the json into a dictionary
		self.module_info = json.loads(data)
		""" NOTE: If we wanted to build our arm from some set of joints
Beispiel #7
0
    def __init__(self, uiinfo):
        self.wristFingersList = {}
        self.wristJoint = ""
        self.thumbJointList = None
        self.wristControl = ""
        self.metacarpalsPresent = False
        self.handed = uiinfo[0].replace("_", "")

        # Get our joint lists from a json file.
        data_path = os.environ["AR_DATA"] + 'data/rig/hand.json'
        # Use our readJson function
        data = utils.readJson(data_path)
        # Load the json into a dictionary
        self.moduleInfo = json.loads(data)