def run(self, stepDict):
        """Run method.

            i.e:  stepDict["mgearRun"].global_ctl  gets the global_ctl from
                    shifter rig build bas
            i.e:  stepDict["mgearRun"].components["control_C0"].ctl  gets the
                    ctl from shifter component called control_C0
            i.e:  stepDict["otherCustomStepName"].ctlMesh  gets the ctlMesh
                    from a previous custom step called "otherCustomStepName"
        Arguments:
            stepDict (dict): Dictionary containing the objects from
                the previous steps

        Returns:
            None: None
        """

        file_path = os.path.join(stepDict["paths"].custom_steps_base_path,
                                 "chara", "_shared", "data", "biped.pkr")
        pkr_data = file_handlers.read_data_file(file_path)
        node = picker_node.DataNode()
        node.create()
        node.write_data(data=pkr_data)
        node.read_data()
        pm.parent(node, "rig")
        pm.setAttr("PICKER_DATAS.picker_datas_file", file_path, type="string")
        pm.rename(node, "PICKER_DATA_BIPED")
Esempio n. 2
0
    def new_picker_node(self, data, namespace):
        name, ok = QtWidgets.QInputDialog.getText(self,
                                                  self.tr("New character"),
                                                  self.tr('Node name'),
                                                  QtWidgets.QLineEdit.Normal,
                                                  self.tr('PICKER_DATA'))
        if not (ok and name):
            return

        # Create new data node
        if namespace != "Root" and cmds.namespace(ex=namespace):
            name = "{}:{}".format(namespace, name)
        data_node = picker_node.DataNode(name=unicode(name))
        data_node.create()
        data_node.write_data(data=data)
        data_node.read_data()
        self.parent().refresh()
        self.hide()