Hello everyone.

I have a problem with Mplug.

I try to create inputs in MFnNumericsAttribute array 
in connectionMade function of my MPxNode.

--------------------------------------------------------------------------------------------------

#   Function when connection made in node
def connectionMade(self, plug, otherPlug, asSrc):

    if not asSrc and plug == self.aSourceGeometry:
        self.add_weights_attributes(plug)

    return OpenMayaMPx.MPxNode.connectionMade(self, plug, otherPlug, asSrc)

#   Add weights attributes from source geometry cvs
def add_weights_attributes(self, plug):

    #   Plug Datas
    sourceGeometryHandle = OpenMaya.MPlug(self.thisMObject(), 
self.aSourceGeometry)
    sourceGeometryObject = sourceGeometryHandle.asMObject()

    weightsHandle = OpenMaya.MPlug(self.thisMObject(), self.aInputWeights)

    #   Curve
    mfnCurve = OpenMaya.MFnNurbsCurve(sourceGeometryObject)
    numCVs = mfnCurve.numCVs()

    #   Set Num of weights element
    weightsHandle.setNumElements(numCVs)

--------------------------------------------------------------------------------------------------

I wish that when I connect a geometry in my node It adds as many inputs in 
my MFnNumericAttribut there points.

I thought it was this command "setNumElements" but nothing happens ...

Someone an idea? 

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/dc7e0d30-950e-4706-b405-d3483ccd2215%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to