def joint_resize(*args):
    """
    Resizes scenes joints
    """
    # Get values from interface
    joint_size = joint_slider.getValue()
    # Apply values to command
    pm.jointDisplayScale(joint_size)
Exemple #2
0
def joint_resize(*args):
    '''
    Resizes scenes joints
    '''
    # Get values from interface
    joint_size = joint_slider.getValue()
    # Apply values to command
    pm.jointDisplayScale(joint_size)
import pymel.core as pm

curSel = pm.ls(sl=True,type='transform')[0]

bBox = pm.xform(curSel,ws=1,q=1,bb=1)
sizeX = abs(bBox[0]-bBox[3])
sizeY = abs(bBox[1]-bBox[4])
sizeZ = abs(bBox[2]-bBox[5])
curPvt = [(bBox[0]+sizeX/2),(bBox[1]+sizeY/2),(bBox[2]+sizeZ/2)]

ccUD = pm.circle(n='circle_rotUpDown',r=sizeY/2,nr=(1,0,0))
pm.move(ccUD[0],curPvt)

ccLR = pm.circle(n='circle_rotLeftRight',r=sizeX/2,nr=(0,1,0))
pm.move(ccLR[0],curPvt)

pm.select(d=1)
pm.jointDisplayScale(0.1)
pm.joint(p=(0,bBox[1],bBox[2]),n='joint_base')
pm.joint(p=(pm.xform(ccUD,ws=1,q=1,rp=1)),n='joint_rotUpDown')
pm.joint(p=(pm.xform(ccLR,ws=1,q=1,rp=1)),n='joint_rotLeftRight')
Exemple #4
0
def jointSize(sizer):
	pm.jointDisplayScale(sizer)
def changeJointScale(newScale):
    pm.jointDisplayScale(newScale)
Exemple #6
0
 def update_joints_display_size(self):
     pm.jointDisplayScale(self.dsp_joints_display_size.value())
Exemple #7
0
    def initUI(self):
        """Initializes the widget UI"""

        # Color vars

        # Icons

        self.solutionNewIcon = icons.getIconByName("solutionNew_16x16.png")
        self.solutionRemoveIcon = icons.getIconByName("solutionRemove_16x16.png")

        self.solutionFitIcon = self.solution_manager.get_solution_goal_icon("fit")
        self.solutionDeformIcon = self.solution_manager.get_solution_goal_icon("deform")
        self.solutionAnimIcon = self.solution_manager.get_solution_goal_icon("anim")

        self.solutionImportIcon = icons.getIconByName("solutionImport_16x16.png")
        self.solutionExportIcon = icons.getIconByName("solutionExport_16x16.png")

        # Load UI file

        self.ui = ui.loadUiWidgetFromPyFile(__file__, parent=self)

        # Layout

        self.setLayout(QtGui.QVBoxLayout())
        self.layout().addWidget(self.ui)
        self.layout().setSpacing(0)
        self.layout().setContentsMargins(2, 2, 2, 2)

        # ------------------------------------------
        # SOLUTIONS TAB

        # Solutions UI init.

        self.tab_solutions_spliter = ui.get_child(self.ui, "sp_splitter")
        self.tab_solutions_spliter.setSizes([400, 250])

        ui.get_child(self.ui, "pb_solutions_new").setIcon(self.solutionNewIcon)
        ui.get_child(self.ui, "pb_solutions_delete").setIcon(self.solutionRemoveIcon)

        ui.get_child(self.ui, "pb_solutions_fit").setIcon(self.solutionFitIcon)
        ui.get_child(self.ui, "pb_solutions_deform").setIcon(self.solutionDeformIcon)
        ui.get_child(self.ui, "pb_solutions_anim").setIcon(self.solutionAnimIcon)

        ui.get_child(self.ui, "pb_solutions_import_preset").setIcon(self.solutionImportIcon)
        ui.get_child(self.ui, "pb_solutions_export_preset").setIcon(self.solutionExportIcon)

        self.solution_trees = ui.get_child(self.ui, "tr_solutions")

        self.header_labels = ["Name"] + self.solution_manager.get_solution_goals()
        self.solution_trees.setColumnCount(len(self.header_labels))
        self.solution_trees.setHeaderLabels(self.header_labels)
        # self.solution_trees.setColumnHidden(2, True)
        # self.solution_trees.setColumnWidth(0,200)
        self.solution_trees.header().setResizeMode(0, QtGui.QHeaderView.Stretch)

        self.solution_description = ui.get_child(self.ui, "lb_solution_desc")
        self.solution_widget_layout = ui.get_child(self.ui, "wi_solution_widget").layout()
        self.solution_channel_box_layout = ui.get_child(self.ui, "wi_channel_box").layout()

        # Fills the solution trees in the UI.
        self.fill_solution_trees()

        # Solutions UI signals.

        # self.solution_trees.itemSelectionChanged.connect(self.fix_solution_trees_selection)
        self.solution_trees.itemSelectionChanged.connect(self.select_solutions_nodes)
        self.solution_trees.itemSelectionChanged.connect(self.load_selected_solution_ui)

        self.solution_trees.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        self.solution_trees.customContextMenuRequested.connect(self.solution_trees_menu)
        # ------------------------------------------

        # ------------------------------------------
        # UTILS TAB

        # Utils UI init.

        self.dsp_joints_display_size = ui.get_child(self.ui, "dsp_joints_display_size")
        self.dsp_joints_display_size.setValue(pm.jointDisplayScale(q=True))

        # Utils UI signals.

        self.dsp_joints_display_size.valueChanged.connect(self.update_joints_display_size)