Exemplo n.º 1
0
def createParmTemplateFloat(vrayPlugin, jsonParm):
    pt = hou.FloatParmTemplate(
                            jsonParm["attr"],
                            jsonParm["attr"],
                            1,
                            default_value=( jsonParm["default"], ),
                            look=hou.parmLook.Regular,
                            naming_scheme=hou.parmNamingScheme.Base1,
                            help=jsonParm["desc"]
                        )

    adjustParmMinMax(pt, vrayPlugin, jsonParm)
    adjustParmUnits(pt, vrayPlugin, jsonParm)

    return pt
Exemplo n.º 2
0
def createParmTemplateAColor(vrayPlugin, jsonParm):
    defaultval = jsonParm["default"]
    defaultval = defaultval + [1]*(4-len(defaultval))
    pt = hou.FloatParmTemplate(
                            jsonParm["attr"],
                            jsonParm["attr"],
                            4,
                            default_value=defaultval,
                            look=hou.parmLook.ColorSquare,
                            naming_scheme=hou.parmNamingScheme.RGBA,
                            help=jsonParm["desc"]
                        )

    adjustParmMinMax(pt, vrayPlugin, jsonParm)

    return pt
Exemplo n.º 3
0
def createParmTemplateVector(vrayPlugin, jsonParm):
    defaultval = jsonParm["default"]
    defaultval = defaultval + [1]*(3-len(defaultval))
    pt = hou.FloatParmTemplate(
                            jsonParm["attr"],
                            jsonParm["attr"],
                            3,
                            default_value=defaultval,
                            look=hou.parmLook.Vector,
                            naming_scheme=hou.parmNamingScheme.XYZW,
                            help=jsonParm["desc"]
                        )

    adjustParmMinMax(pt, vrayPlugin, jsonParm)
    adjustParmUnits(pt, vrayPlugin, jsonParm)

    return pt
Exemplo n.º 4
0
def createParmTemplateTransform(vrayPlugin, jsonParm):
    isMatrix = ( jsonParm["type"].lower().find("matrix") > -1)

    ptf = hou.FolderParmTemplate(
                            jsonParm["attr"],
                            jsonParm["attr"],
                            folder_type = hou.folderType.Simple
                        )
    # transformation order
    pt = createParmTemplateXOrder()
    pt.setName("{}_{}".format( jsonParm["attr"], pt.name() ))
    ptf.addParmTemplate(pt)
    # rotation order
    pt = createParmTemplateROrder()
    pt.setName("{}_{}".format( jsonParm["attr"], pt.name() ))
    ptf.addParmTemplate(pt)
    # translation
    pt = hou.FloatParmTemplate(
                            "{}_trans".format(jsonParm["attr"]),
                            "Translate",
                            3,
                            look=hou.parmLook.Regular,
                            naming_scheme=hou.parmNamingScheme.Base1,
                            is_hidden=isMatrix,
                            help=jsonParm["desc"]
                        )
    ptf.addParmTemplate(pt)
    # rotation
    pt = hou.FloatParmTemplate(
                            "{}_rot".format(jsonParm["attr"]),
                            "Rotate",
                            3,
                            look=hou.parmLook.Angle,
                            naming_scheme=hou.parmNamingScheme.Base1,
                            help=jsonParm["desc"]
                        )
    ptf.addParmTemplate(pt)
    # scale
    pt = hou.FloatParmTemplate(
                            "{}_scale".format(jsonParm["attr"]),
                            "Scale",
                            3,
                            default_value=(1,1,1),
                            look=hou.parmLook.Regular,
                            naming_scheme=hou.parmNamingScheme.Base1,
                            help=jsonParm["desc"]
                        )
    ptf.addParmTemplate(pt)
    # pivot
    pt = hou.FloatParmTemplate(
                            "{}_pivot".format(jsonParm["attr"]),
                            "Pivot",
                            3,
                            look=hou.parmLook.Regular,
                            naming_scheme=hou.parmNamingScheme.Base1,
                            is_hidden=isMatrix,
                            help=jsonParm["desc"]
                        )
    ptf.addParmTemplate(pt)

    return ptf