THX Daniel. Indeed I try with arrayBuilder and it works
Le lundi 11 janvier 2016 17:23:52 UTC+1, Rémi Deletrain a écrit : > > 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/9c1fa874-65c3-4f57-90ad-6218717f78b2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
