Exemplo n.º 1
0
    def initialize():
        """
        Defines the set of attributes for this node. The attributes declared in this function are assigned
        as static members to MeshController class. Instances of MeshController will use these attributes to create plugs
        for use in the compute() method.
        """
        tAttr = om2.MFnTypedAttribute()
        nAttr = om2.MFnNumericAttribute()

        MeshController.inIndexList = tAttr.create("indexList", "index",
                                                  om2.MFnData.kString)
        INPUT_ATTR(tAttr)

        MeshController.inOffset = nAttr.create("offset", "offset",
                                               om2.MFnNumericData.kFloat, 0.0)
        INPUT_ATTR(nAttr)

        MeshController.inMesh = tAttr.create("controlMesh", "controlMesh",
                                             om2.MFnData.kMesh)
        INPUT_ATTR(tAttr)

        MeshController.inColor = nAttr.createColor("color", "color")
        nAttr.default = (1.0, 0.455, 0.086)
        INPUT_ATTR(nAttr)

        MeshController.addAttribute(MeshController.inIndexList)
        MeshController.addAttribute(MeshController.inOffset)
        MeshController.addAttribute(MeshController.inMesh)
        MeshController.addAttribute(MeshController.inColor)
Exemplo n.º 2
0
    def initialize():
        """
        Defines the set of attributes for this node. The attributes declared in this function are assigned
        as static members to DistributeAlongSurface class. Instances of DistributeAlongSurface will use these attributes to create plugs
        for use in the compute() method.
        """
        tAttr = om2.MFnTypedAttribute()
        nAttr = om2.MFnNumericAttribute()
        uAttr = om2.MFnUnitAttribute()

        FindParamFromLength.inCurve = tAttr.create("inputCurve", "icrv",
                                                   om2.MFnData.kNurbsCurve)
        INPUT_ATTR(tAttr)

        FindParamFromLength.inArcLength = uAttr.create(
            "arcLength", "length", om2.MFnUnitAttribute.kDistance, 0.0)
        INPUT_ATTR(uAttr)

        FindParamFromLength.outParam = nAttr.create("outParam", "param",
                                                    om2.MFnNumericData.kFloat,
                                                    0.0)
        OUTPUT_ATTR(nAttr)

        FindParamFromLength.addAttribute(FindParamFromLength.inCurve)
        FindParamFromLength.addAttribute(FindParamFromLength.inArcLength)
        FindParamFromLength.addAttribute(FindParamFromLength.outParam)
        FindParamFromLength.attributeAffects(FindParamFromLength.inCurve,
                                             FindParamFromLength.outParam)
        FindParamFromLength.attributeAffects(FindParamFromLength.inArcLength,
                                             FindParamFromLength.outParam)
Exemplo n.º 3
0
    def initialize():
        """
        Defines the set of attributes for this node. The attributes declared in this function are assigned
        as static members to DistributeAlongSurface class. Instances of DistributeAlongSurface will use these attributes to create plugs
        for use in the compute() method.
        """
        tAttr = om2.MFnTypedAttribute()
        eAttr = om2.MFnEnumAttribute()
        nAttr = om2.MFnNumericAttribute()
        mAttr = om2.MFnMatrixAttribute()

        DistributeAlongSurface.inSurface = tAttr.create("inputSurface", "isurf", om2.MFnData.kNurbsSurface)
        INPUT_ATTR(tAttr)

        DistributeAlongSurface.inDistributeAlong = eAttr.create("distributeAlong", "da", 0)
        eAttr.addField("U", 0)
        eAttr.addField("V", 1)
        INPUT_ATTR(eAttr)

        DistributeAlongSurface.inDisplace = nAttr.create("displaceTangent", "dtan", om2.MFnNumericData.kFloat, 0.0)
        nAttr.setMin(0.0)
        nAttr.setMax(1.0)
        INPUT_ATTR(nAttr)

        DistributeAlongSurface.inAlwaysUniform = nAttr.create("alwaysUniform", "auni", om2.MFnNumericData.kBoolean, False)
        INPUT_ATTR(nAttr)

        DistributeAlongSurface.outTransform = mAttr.create("outputTransform", "ot", om2.MFnMatrixAttribute.kDouble)
        mAttr.array = True
        OUTPUT_ATTR(mAttr)

        DistributeAlongSurface.addAttribute(DistributeAlongSurface.inSurface)
        DistributeAlongSurface.addAttribute(DistributeAlongSurface.inDistributeAlong)
        DistributeAlongSurface.addAttribute(DistributeAlongSurface.inDisplace)
        DistributeAlongSurface.addAttribute(DistributeAlongSurface.inAlwaysUniform)
        DistributeAlongSurface.addAttribute(DistributeAlongSurface.outTransform)
        DistributeAlongSurface.attributeAffects(DistributeAlongSurface.inSurface, DistributeAlongSurface.outTransform)
        DistributeAlongSurface.attributeAffects(DistributeAlongSurface.inDistributeAlong, DistributeAlongSurface.outTransform)
        DistributeAlongSurface.attributeAffects(DistributeAlongSurface.inDisplace, DistributeAlongSurface.outTransform)
        DistributeAlongSurface.attributeAffects(DistributeAlongSurface.inAlwaysUniform, DistributeAlongSurface.outTransform)
Exemplo n.º 4
0
    def initialize():
        """
        Defines the set of attributes for this node. The attributes declared in this function are assigned
        as static members to QuadraticCurve class. Instances of QuadraticCurve will use these attributes to create plugs
        for use in the compute() method.
        """
        mAttr = om2.MFnMatrixAttribute()
        nAttr = om2.MFnNumericAttribute()
        uAttr = om2.MFnUnitAttribute()
        tAttr = om2.MFnTypedAttribute()

        QuadraticCurve.inControlPoints = mAttr.create(
            "controlPoints", "cp", om2.MFnMatrixAttribute.kDouble)
        mAttr.array = True
        INPUT_ATTR(mAttr)

        QuadraticCurve.inEnableTwist = nAttr.create(
            "enableTwist", "etw", om2.MFnNumericData.kBoolean, False)
        INPUT_ATTR(nAttr)

        QuadraticCurve.inStartUpObj = mAttr.create(
            "startUpObjectMatrix", "suom", om2.MFnMatrixAttribute.kFloat)
        INPUT_ATTR(mAttr)

        QuadraticCurve.inEndUpObj = mAttr.create("endUpObjectMatrix", "euom",
                                                 om2.MFnMatrixAttribute.kFloat)
        INPUT_ATTR(mAttr)

        QuadraticCurve.inLockLength = nAttr.create("lockLength", "locklen",
                                                   om2.MFnNumericData.kFloat,
                                                   0.0)
        nAttr.setMin(0.0)
        nAttr.setMax(1.0)
        INPUT_ATTR(nAttr)

        QuadraticCurve.inRestLength = nAttr.create("restLength", "rlength",
                                                   om2.MFnNumericData.kFloat,
                                                   0.0)
        nAttr.setMin(0.0)
        INPUT_ATTR(nAttr)

        QuadraticCurve.inSlide = nAttr.create("slide", "slide",
                                              om2.MFnNumericData.kFloat, 0.0)
        nAttr.setMin(0.0)
        nAttr.setMax(1.0)
        INPUT_ATTR(nAttr)

        QuadraticCurve.inPreferredAngle = uAttr.create(
            "preferredAngle", "pangle", om2.MFnUnitAttribute.kAngle)
        uAttr.setMin(0.0)
        uAttr.setMax(om2.MAngle(360.0, om2.MAngle.kDegrees).asRadians())
        INPUT_ATTR(uAttr)

        QuadraticCurve.outTransforms = mAttr.create(
            "outTransforms", "otrans", om2.MFnMatrixAttribute.kDouble)
        mAttr.array = True
        OUTPUT_ATTR(mAttr)

        QuadraticCurve.outCurve = tAttr.create("outCurve", "ocrv",
                                               om2.MFnData.kNurbsCurve)
        OUTPUT_ATTR(tAttr)

        QuadraticCurve.addAttribute(QuadraticCurve.inControlPoints)
        QuadraticCurve.addAttribute(QuadraticCurve.inEnableTwist)
        QuadraticCurve.addAttribute(QuadraticCurve.inStartUpObj)
        QuadraticCurve.addAttribute(QuadraticCurve.inEndUpObj)
        QuadraticCurve.addAttribute(QuadraticCurve.inLockLength)
        QuadraticCurve.addAttribute(QuadraticCurve.inRestLength)
        QuadraticCurve.addAttribute(QuadraticCurve.inSlide)
        QuadraticCurve.addAttribute(QuadraticCurve.inPreferredAngle)
        QuadraticCurve.addAttribute(QuadraticCurve.outTransforms)
        QuadraticCurve.addAttribute(QuadraticCurve.outCurve)
        QuadraticCurve.attributeAffects(QuadraticCurve.inControlPoints,
                                        QuadraticCurve.outCurve)
        QuadraticCurve.attributeAffects(QuadraticCurve.inControlPoints,
                                        QuadraticCurve.outTransforms)
        QuadraticCurve.attributeAffects(QuadraticCurve.inEnableTwist,
                                        QuadraticCurve.outTransforms)
        QuadraticCurve.attributeAffects(QuadraticCurve.inStartUpObj,
                                        QuadraticCurve.outTransforms)
        QuadraticCurve.attributeAffects(QuadraticCurve.inEndUpObj,
                                        QuadraticCurve.outTransforms)
        QuadraticCurve.attributeAffects(QuadraticCurve.inLockLength,
                                        QuadraticCurve.outTransforms)
        QuadraticCurve.attributeAffects(QuadraticCurve.inRestLength,
                                        QuadraticCurve.outTransforms)
        QuadraticCurve.attributeAffects(QuadraticCurve.inSlide,
                                        QuadraticCurve.outTransforms)
        QuadraticCurve.attributeAffects(QuadraticCurve.inPreferredAngle,
                                        QuadraticCurve.outTransforms)