示例#1
0
def addParameters(prop):

    # Path Parameter for the Synoptic
    path = os.path.join(plu.getPluginPath("gear_Synoptic"), "tabs", "_common",
                        "horse_body", "horse_body.htm")
    par.createOrReturnParameters3(prop, "horse_body_path", c.siString, path,
                                  None, None, False, False)

    # Selection control parameters
    par.createOrReturnParameters3(prop, "controlers_01_grp", c.siBool, True,
                                  None, None, False, False)
    par.createOrReturnParameters3(prop, "controlers_slider_grp", c.siBool,
                                  False, None, None, False, False)
    par.createOrReturnParameters3(prop, "controlers_facial_grp", c.siBool,
                                  False, None, None, False, False)

    par.createOrReturnParameters3(prop, "quicksel_A", c.siString, "", None,
                                  None, False, False)
    par.createOrReturnParameters3(prop, "quicksel_B", c.siString, "", None,
                                  None, False, False)
    par.createOrReturnParameters3(prop, "quicksel_C", c.siString, "", None,
                                  None, False, False)
    par.createOrReturnParameters3(prop, "quicksel_D", c.siString, "", None,
                                  None, False, False)
    par.createOrReturnParameters3(prop, "quicksel_E", c.siString, "", None,
                                  None, False, False)
    par.createOrReturnParameters3(prop, "quicksel_F", c.siString, "", None,
                                  None, False, False)
示例#2
0
文件: layout.py 项目: hnegadi/GEAR_mc
def addLayout(layout, prop):

    # Buttons ----------------------
    layout.AddRow()
    item = layout.AddItem("controlers_slidersFace_grp", "", "dscontrol")
    item.SetAttribute("class", "button")
    item.SetAttribute(c.siUICaption, "Sliders")
    item.SetAttribute(c.siUIStyle, 0x00001003)
    item.SetAttribute(c.siUINoLabel, True)
    item = layout.AddItem("controlers_upperFace_grp", "", "dscontrol")
    item.SetAttribute("class", "button")
    item.SetAttribute(c.siUICaption, "Upper Face")
    item.SetAttribute(c.siUIStyle, 0x00001003)
    item.SetAttribute(c.siUINoLabel, True)
    item = layout.AddItem("controlers_lowerFace_grp", "", "dscontrol")
    item.SetAttribute("class", "button")
    item.SetAttribute(c.siUICaption, "Lower Face")
    item.SetAttribute(c.siUIStyle, 0x00001003)
    item.SetAttribute(c.siUINoLabel, True)
    layout.EndRow()

    # HTML Page ---------------------
    path = os.path.join(plu.getPluginPath("gear_Synoptic"), "tabs", "_common",
                        "human_face", "human_face.htm")
    prop.Parameters("human_face_path").Value = path
    item = layout.AddItem("human_face_path", "", c.siControlSynoptic)
    item.SetAttribute(c.siUINoLabel, True)
    item.SetAttribute(c.siUICX, 308)
示例#3
0
def addLayout(layout, prop):

    # Buttons ----------------------
    layout.AddRow()
    item = layout.AddItem("controlers_01_grp", "", "dscontrol")
    item.SetAttribute("class", "button")
    item.SetAttribute(c.siUICaption, "Primary")
    item.SetAttribute(c.siUIStyle, 0x00001003)
    item.SetAttribute(c.siUINoLabel, True)
    item = layout.AddItem("controlers_slider_grp", "", "dscontrol")
    item.SetAttribute("class", "button")
    item.SetAttribute(c.siUICaption, "Slider")
    item.SetAttribute(c.siUIStyle, 0x00001003)
    item.SetAttribute(c.siUINoLabel, True)
    item = layout.AddItem("controlers_facial_grp", "", "dscontrol")
    item.SetAttribute("class", "button")
    item.SetAttribute(c.siUICaption, "Facial")
    item.SetAttribute(c.siUIStyle, 0x00001003)
    item.SetAttribute(c.siUINoLabel, True)
    layout.EndRow()

    # HTML Page ---------------------
    path = os.path.join(plu.getPluginPath("gear_Synoptic"), "tabs", "_common", "biped_body", "biped_body.htm")
    prop.Parameters("biped_body_path").Value = path
    item = layout.AddItem("biped_body_path", "", c.siControlSynoptic)
    item.SetAttribute(c.siUINoLabel, True)
    item.SetAttribute(c.siUICX, 308)
示例#4
0
文件: layout.py 项目: hnegadi/GEAR_mc
def addLayout(layout, prop):

    # Buttons ----------------------
    layout.AddRow()
    item = layout.AddItem("controlers_slidersFace_grp", "", "dscontrol")
    item.SetAttribute("class", "button")
    item.SetAttribute(c.siUICaption, "Sliders")
    item.SetAttribute(c.siUIStyle, 0x00001003)
    item.SetAttribute(c.siUINoLabel, True)
    item = layout.AddItem("controlers_upperFace_grp", "", "dscontrol")
    item.SetAttribute("class", "button")
    item.SetAttribute(c.siUICaption, "Upper Face")
    item.SetAttribute(c.siUIStyle, 0x00001003)
    item.SetAttribute(c.siUINoLabel, True)
    item = layout.AddItem("controlers_lowerFace_grp", "", "dscontrol")
    item.SetAttribute("class", "button")
    item.SetAttribute(c.siUICaption, "Lower Face")
    item.SetAttribute(c.siUIStyle, 0x00001003)
    item.SetAttribute(c.siUINoLabel, True)
    layout.EndRow()

    # HTML Page ---------------------
    path = os.path.join(plu.getPluginPath("gear_Synoptic"), "tabs", "_common", "human_face", "human_face.htm")
    prop.Parameters("human_face_path").Value = path
    item = layout.AddItem("human_face_path", "", c.siControlSynoptic)
    item.SetAttribute(c.siUINoLabel, True)
    item.SetAttribute(c.siUICX, 308)
示例#5
0
文件: layout.py 项目: UIKit0/Gear
def addLayout(layout, prop):

    # HTML Page ---------------------
    path = os.path.join(plu.getPluginPath("gear_Synoptic"), "tabs", "_common", "bird_feet", "bird_feet.htm")
    prop.Parameters("bird_feet_path").Value = path
    item = layout.AddItem("bird_feet_path", "", c.siControlSynoptic)
    item.SetAttribute(c.siUINoLabel, True)
    item.SetAttribute(c.siUICX, 308)
示例#6
0
def addLayout(layout, prop):

    # HTML Page ---------------------
    path = os.path.join(plu.getPluginPath("gear_Synoptic"), "tabs", "_common", "hands", "hands.htm")
    prop.Parameters("hands_path").Value = path
    item = layout.AddItem("hands_path", "", c.siControlSynoptic)
    item.SetAttribute(c.siUINoLabel, True)
    item.SetAttribute(c.siUICX, 308)
示例#7
0
文件: parameters.py 项目: UIKit0/Gear
def addParameters(prop):

   # Path Parameter for the Synoptic
   path = os.path.join(plu.getPluginPath("gear_Synoptic"), "tabs", "_common", "hands_feet", "hands_feet.htm")
   par.createOrReturnParameters3(prop, "hands_feet_path", c.siString, path, None, None, False, False)

   par.createOrReturnParameters3(prop, "quicksel_A", c.siString, "", None, None, False, False)
   par.createOrReturnParameters3(prop, "quicksel_B", c.siString, "", None, None, False, False)
   par.createOrReturnParameters3(prop, "quicksel_C", c.siString, "", None, None, False, False)
   par.createOrReturnParameters3(prop, "quicksel_D", c.siString, "", None, None, False, False)
   par.createOrReturnParameters3(prop, "quicksel_E", c.siString, "", None, None, False, False)
   par.createOrReturnParameters3(prop, "quicksel_F", c.siString, "", None, None, False, False)
示例#8
0
def addParameters(prop):

    # Path Parameter for the Synoptic
    path = os.path.join(plu.getPluginPath("gear_Synoptic"), "tabs", "_common", "chicken_body", "chicken_body.htm")
    par.createOrReturnParameters3(prop, "chicken_body_path", c.siString, path, None, None, False, False)

    # Selection control parameters
    par.createOrReturnParameters3(prop, "controlers_01_grp", c.siBool, True, None, None, False, False)
    par.createOrReturnParameters3(prop, "controlers_slider_grp", c.siBool, False, None, None, False, False)
    par.createOrReturnParameters3(prop, "controlers_facial_grp", c.siBool, False, None, None, False, False)

    par.createOrReturnParameters3(prop, "quicksel_A", c.siString, "", None, None, False, False)
    par.createOrReturnParameters3(prop, "quicksel_B", c.siString, "", None, None, False, False)
    par.createOrReturnParameters3(prop, "quicksel_C", c.siString, "", None, None, False, False)
    par.createOrReturnParameters3(prop, "quicksel_D", c.siString, "", None, None, False, False)
    par.createOrReturnParameters3(prop, "quicksel_E", c.siString, "", None, None, False, False)
    par.createOrReturnParameters3(prop, "quicksel_F", c.siString, "", None, None, False, False)
示例#9
0
def gear_Wireframe_OnInit():

    # Get Property
    prop = PPG.Inspected(0)
    layout = PPG.PPGLayout
    layout.Clear()


    # HTML Page ---------------------
    path = os.path.join(plu.getPluginPath("gear_Wireframe"), "wireSyn.htm")
    prop.Parameters("colorPicker").Value = path
    layout.AddGroup("Wireframe colors")
    layout.AddGroup("Color presets")
    item = layout.AddItem("colorPicker", "", c.siControlSynoptic)
    item.SetAttribute(c.siUINoLabel, True)
    item.SetAttribute(c.siUICX, 308)
    layout.EndGroup()

    # Other param --------------
    layout.AddGroup("Color Range")
    item = layout.addColor("A_Color_r", "")
    item.SetAttribute(c.siUINoLabel, True)

    item = layout.addColor("B_Color_r", "")
    item.SetAttribute(c.siUINoLabel, True)

    item = layout.AddButton("colorRange", "Apply Color in Range")
    item.SetAttribute(c.siUICX, 270)
    item.SetAttribute(c.siUICY, 40)
    layout.EndGroup()
    layout.AddGroup("Color utils")
    layout.AddRow()
    item = layout.AddButton("colorRandom", "Random Color")
    item.SetAttribute(c.siUICX, 135)
    item.SetAttribute(c.siUICY, 40)
    item = layout.AddButton("colorCopy", "Copy Color")
    item.SetAttribute(c.siUICX, 135)
    item.SetAttribute(c.siUICY, 40)
    layout.EndRow()
    layout.EndGroup()

    layout.EndGroup()


    PPG.Refresh()
示例#10
0
def gear_Wireframe_OnInit():

    # Get Property
    prop = PPG.Inspected(0)
    layout = PPG.PPGLayout
    layout.Clear()

    # HTML Page ---------------------
    path = os.path.join(plu.getPluginPath("gear_Wireframe"), "wireSyn.htm")
    prop.Parameters("colorPicker").Value = path
    layout.AddGroup("Wireframe colors")
    layout.AddGroup("Color presets")
    item = layout.AddItem("colorPicker", "", c.siControlSynoptic)
    item.SetAttribute(c.siUINoLabel, True)
    item.SetAttribute(c.siUICX, 308)
    layout.EndGroup()

    # Other param --------------
    layout.AddGroup("Color Range")
    item = layout.addColor("A_Color_r", "")
    item.SetAttribute(c.siUINoLabel, True)

    item = layout.addColor("B_Color_r", "")
    item.SetAttribute(c.siUINoLabel, True)

    item = layout.AddButton("colorRange", "Apply Color in Range")
    item.SetAttribute(c.siUICX, 270)
    item.SetAttribute(c.siUICY, 40)
    layout.EndGroup()
    layout.AddGroup("Color utils")
    layout.AddRow()
    item = layout.AddButton("colorRandom", "Random Color")
    item.SetAttribute(c.siUICX, 135)
    item.SetAttribute(c.siUICY, 40)
    item = layout.AddButton("colorCopy", "Copy Color")
    item.SetAttribute(c.siUICX, 135)
    item.SetAttribute(c.siUICY, 40)
    layout.EndRow()
    layout.EndGroup()

    layout.EndGroup()

    PPG.Refresh()
示例#11
0
def addParameters(prop):

    # Path Parameter for the Synoptic
    path = os.path.join(plu.getPluginPath("gear_Synoptic"), "tabs", "_common",
                        "hands_feet", "hands_feet.htm")
    par.createOrReturnParameters3(prop, "hands_feet_path", c.siString, path,
                                  None, None, False, False)

    par.createOrReturnParameters3(prop, "quicksel_A", c.siString, "", None,
                                  None, False, False)
    par.createOrReturnParameters3(prop, "quicksel_B", c.siString, "", None,
                                  None, False, False)
    par.createOrReturnParameters3(prop, "quicksel_C", c.siString, "", None,
                                  None, False, False)
    par.createOrReturnParameters3(prop, "quicksel_D", c.siString, "", None,
                                  None, False, False)
    par.createOrReturnParameters3(prop, "quicksel_E", c.siString, "", None,
                                  None, False, False)
    par.createOrReturnParameters3(prop, "quicksel_F", c.siString, "", None,
                                  None, False, False)
示例#12
0
'''

## @package gear.xsi.rig.logic
# @author Jeremie Passerin
#

##########################################################
# GLOBAL
##########################################################
import os

from gear.xsi import xsi, c
import gear.xsi.plugin as plu

SYNOPTIC_TABS_PATH = os.path.join(plu.getPluginPath("gear_synoptic"), "tabs")


##########################################################
# GET ITEMS
##########################################################
# ========================================================
## Get all components settings of the guide model
def getInspectItems(model):

    inspect_items = []
    children = {}
    for child in model.FindChildren():
        if child.Properties("settings"):
            children[child.Name[:-5]] = child.Properties("settings").FullName
示例#13
0
文件: logic.py 项目: UIKit0/Gear
'''

## @package gear.xsi.rig.logic
# @author Jeremie Passerin
#

##########################################################
# GLOBAL
##########################################################
import os

from gear.xsi import xsi, c
import gear.xsi.plugin as plu


SYNOPTIC_TABS_PATH = os.path.join(plu.getPluginPath("gear_synoptic"), "tabs")

##########################################################
# GET ITEMS
##########################################################
# ========================================================
## Get all components settings of the guide model
def getInspectItems(model):
    
    inspect_items = []
    children = {}
    for child in model.FindChildren():
        if child.Properties("settings"):
            children[child.Name[:-5]] = child.Properties("settings").FullName

    for name in sorted(children.keys()):
示例#14
0
def gear_Synoptic_OnInit():

    # Get Property
    prop = PPG.Inspected(0)
    layout = PPG.PPGLayout
    layout.Clear()

    # Plugin Folder Path
    path = plu.getPluginPath("gear_Synoptic")

    # Get Active Model -----------------------------
    model_items = getRigModels()

    if model_items and PPG.Model.Value not in model_items:
        PPG.Model.Value = model_items[1]

    # Common Logic
    file = open(plu.getPluginFullPath("gear_Synoptic"))
    layout.Logic = file.read()

    # Default Layout
    if not PPG.Model.Value:
        layout.AddString("No valid model in the scene")
        layout.AddButton("RefreshModelList", "Refresh")
        return

    # Parse Tabs -----------------------------------
    model = xsi.ActiveSceneRoot.FindChild(PPG.Model.Value, c.siModelType)
    model_prop = model.Properties("info")

    tab_names = model_prop.Parameters("synoptic").Value
    if not tab_names:
        layout.AddTab("Default Tab")

        layout.AddGroup("Active Model")
        layout.AddRow()
        item = layout.AddEnumControl("Model", model_items, "Model", c.siControlCombo)
        item.SetAttribute(c.siUINoLabel, True)
        item = layout.AddButton("RefreshModelList", "Refresh")
        item = layout.AddButton("Highlight", "Highlight")
        layout.EndRow()
        layout.EndGroup()

        layout.AddGroup("")
        layout.AddStaticText("No tab in this model")
        layout.EndGroup()

    else:
        for tab in tab_names.split(","):

            tab_path = os.path.join(path, "tabs", tab)
            if not tab or not os.path.exists(tab_path):
                continue

            param_path  = os.path.join(tab_path, "parameters.py")
            logic_path  = os.path.join(tab_path, "logic.py")
            layout_path  = os.path.join(tab_path, "layout.py")

            # Parameters -------------
            if os.path.exists(param_path):
                xsi.ExecuteScript(param_path, "Python", "addParameters", [prop])

            # Logic ------------------
            if os.path.exists(logic_path):
                file = open(logic_path)
                layout.Logic += file.read()

            # Layout -----------------
            if os.path.exists(layout_path):
                layout.AddTab(tab[tab.find("/")+1:])

                layout.AddGroup("Active Model")
                layout.AddRow()
                item = layout.AddEnumControl("Model", model_items, "Model", c.siControlCombo)
                item.SetAttribute(c.siUINoLabel, True)
                item = layout.AddButton("RefreshModelList", "Refresh")
                item = layout.AddButton("Highlight", "Highlight")
                layout.EndRow()
                layout.EndGroup()

                layout.AddGroup("")
                xsi.ExecuteScript(layout_path, "Python", "addLayout", [layout, prop])
                layout.EndGroup()

    PPG.Refresh()