Ejemplo n.º 1
0
def findNamaSpaces():
    cmds.namespace(setNamespace=":")
    namespaces = cmds.namespaceInfo(listOnlyNamespaces=True)

    for namespace in namespaces:
        if cmds.objExists(namespace + ":*"):
            # create a tab
            widgets[(namespace + "_tab")] = cmds.columnLayout(
                w=400, h=600, parent=widgets["tabLayout"])

            # create attr field grps for translate rotate and scale
            cmds.separator(h=10, style="none")
            widgets[(namespace + "_attrFG_T")] = cmds.attrFieldGrp(
                attribute=(namespace + ":null.translate"))
            widgets[(namespace + "_attrFG_R")] = cmds.attrFieldGrp(
                attribute=(namespace + ":null.rotate"))
            widgets[(namespace + "_attrFG_S")] = cmds.attrFieldGrp(
                attribute=(namespace + ":null.scale"))

            cmds.separator(h=10, style="none")

            widgets[(namespace + "_attrEOM_Vis")] = cmds.attrEnumOptionMenu(
                label="Test", attribute=(namespace + ":null.Test"))

            # edit the tab name
            cmds.tabLayout(widgets["tabLayout"],
                           edit=True,
                           tabLabel=(widgets[(namespace + "_tab")], namespace))
Ejemplo n.º 2
0
 def uvcoordsNew(self, attrName):
     cmds.setUITemplate('attributeEditorPresetsTemplate', pushTemplate=True)
     enabled = True
     if len(cmds.getAttr('%s.uvset' % attrName.split('.')[0])) > 0:
         enabled = False
     cmds.attrFieldGrp('aiImageUVCoords', label='UV Coords', enable=enabled, attribute=attrName)
     cmds.setUITemplate(popTemplate=True)
Ejemplo n.º 3
0
 def uvcoordsReplace(self, attrName):
     try:
         enabled = True
         if len(cmds.getAttr('%s.uvset' % attrName.split('.')[0])) > 0:
             enabled = False
         cmds.attrFieldGrp('aiImageUVCoords', edit=True, enable=enabled, attribute=attrName)
     except:
         pass
Ejemplo n.º 4
0
 def uvcoordsNew(self, attrName):
     cmds.setUITemplate('attributeEditorPresetsTemplate', pushTemplate=True)
     enabled = True
     if len(cmds.getAttr('%s.uvset' % attrName.split('.')[0])) > 0:
         enabled = False
     cmds.attrFieldGrp('aiImageUVCoords',
                       label='UV Coords',
                       enable=enabled,
                       attribute=attrName)
     cmds.setUITemplate(popTemplate=True)
Ejemplo n.º 5
0
 def editUVSet(newValue):
     try:
         if len(newValue) > 0:
             cmds.attrFieldGrp('aiImageUVCoords', edit=True, enable=False)
         else:
             cmds.attrFieldGrp('aiImageUVCoords', edit=True, enable=True)
         mel.eval('refreshAE')
     except:
         import traceback, sys
         traceback.print_exc(file=sys.__stderr__)
Ejemplo n.º 6
0
 def editUVSet(newValue):
     try:
         if len(newValue) > 0:
             cmds.attrFieldGrp('aiImageUVCoords', edit=True, enable=False)
         else:
             cmds.attrFieldGrp('aiImageUVCoords', edit=True, enable=True)
         mel.eval('refreshAE')
     except:
         import traceback, sys
         traceback.print_exc(file=sys.__stderr__)
Ejemplo n.º 7
0
 def uvcoordsReplace(self, attrName):
     try:
         enabled = True
         if len(cmds.getAttr('%s.uvset' % attrName.split('.')[0])) > 0:
             enabled = False
         cmds.attrFieldGrp('aiImageUVCoords',
                           edit=True,
                           enable=enabled,
                           attribute=attrName)
     except:
         pass
Ejemplo n.º 8
0
    def __init__(self, node):

        super(AE_mila_scatter_template, self).__init__(node)

        if cmds.frameLayout(label="Front Scatter", collapsable=True):
            if cmds.columnLayout(adj=True):
                self.addControl(
                    "front_tint",
                    cmds.attrColorSliderGrp(attribute=self.attr("front_tint"),
                                            label="Tint",
                                            columnWidth=columnWidthData),
                    cmds.attrColorSliderGrp)
                self.addControl(
                    "front_weight",
                    cmds.attrFieldSliderGrp(
                        attribute=self.attr("front_weight"),
                        label="Weight",
                        columnWidth=columnWidthData), cmds.attrFieldSliderGrp)
                self.addControl(
                    "front_radius",
                    cmds.attrFieldGrp(attribute=self.attr("front_radius"),
                                      label="Radius",
                                      columnWidth=columnWidthData3),
                    cmds.attrFieldGrp)
                self.addControl(
                    "front_radius_mod",
                    cmds.attrColorSliderGrp(
                        attribute=self.attr("front_radius_mod"),
                        label="Radius Mod",
                        columnWidth=columnWidthData), cmds.attrColorSliderGrp)
            cmds.setParent("..")
        cmds.setParent("..")

        if cmds.frameLayout(label="Back Scatter", collapsable=True):
            if cmds.columnLayout(adj=True):
                self.addControl(
                    "back_tint",
                    cmds.attrColorSliderGrp(attribute=self.attr("back_tint"),
                                            label="Tint",
                                            columnWidth=columnWidthData),
                    cmds.attrColorSliderGrp)
                self.addControl(
                    "back_weight",
                    cmds.attrFieldSliderGrp(attribute=self.attr("back_weight"),
                                            label="Weight",
                                            columnWidth=columnWidthData),
                    cmds.attrFieldSliderGrp)
                self.addControl(
                    "back_radius",
                    cmds.attrFieldGrp(attribute=self.attr("back_radius"),
                                      label="Radius",
                                      columnWidth=columnWidthData3),
                    cmds.attrFieldGrp)
                self.addControl(
                    "back_radius_mod",
                    cmds.attrColorSliderGrp(
                        attribute=self.attr("back_radius_mod"),
                        label="Radius Mod",
                        columnWidth=columnWidthData), cmds.attrColorSliderGrp)
                self.addControl(
                    "back_depth",
                    cmds.attrFieldSliderGrp(attribute=self.attr("back_depth"),
                                            label="Depth",
                                            columnWidth=columnWidthData),
                    cmds.attrFieldSliderGrp)
            cmds.setParent("..")
        cmds.setParent("..")

        if cmds.frameLayout(label="Storage And Optimization",
                            collapsable=True):
            if cmds.columnLayout(adj=True):

                self.addControl(
                    "scale_conversion",
                    cmds.attrFieldSliderGrp(
                        attribute=self.attr("scale_conversion"),
                        label="Scale",
                        columnWidth=columnWidthData), cmds.attrFieldSliderGrp)
                self.addControl(
                    "sampling_radius_mult",
                    cmds.attrFieldSliderGrp(
                        attribute=self.attr("sampling_radius_mult"),
                        label="Sampling Factor",
                        columnWidth=columnWidthData), cmds.attrFieldSliderGrp)

                self.addControl(
                    "resolution",
                    cmds.attrEnumOptionMenuGrp(
                        attribute=self.attr("resolution"),
                        label='Resolution',
                        columnWidth=columnWidthData3,
                        ei=[(0, "2 x Image"), (1, "1 x Image"),
                            (2, "1/2 x Image"), (3, "1/3 x Image"),
                            (4, "1/4 x Image"), (5, "1/5 x Image")]),
                    cmds.attrEnumOptionMenuGrp)

                self.addControl(
                    "light_storage_gamma",
                    cmds.attrFieldSliderGrp(
                        attribute=self.attr("light_storage_gamma"),
                        label="Gamma",
                        columnWidth=columnWidthData), cmds.attrFieldSliderGrp)
            cmds.setParent("..")
        cmds.setParent("..")

        self.controls += AE_contribution_template(node)