Use MFnVectorArrayData oData = plug.data() fnData = OpenMaya.MFnVectorArrayData(oData) vectorArray = fnData.array()
Any none simple types like matrix arrays, point arrays, vector arrays, double arrays, etc, have a corresponding MFn*Data class. Chad On Tue, Aug 11, 2009 at 5:16 AM, Ozgur <[email protected]> wrote: > > I'm trying to write an MPxLocatorNode which uses an MVectorArray > attribute to hold some data that it needs to use while drawing the > shape of the locator, I mean the shape of the locator depends on to > the data inside this attribute... > > My problem is the draw method doesn't have access to dataBlock which > is only valid through compute method, so I need to figure out some way > to access the MVectorArray without using the dataBlock, for simple > variables like float, int, MDistance etc. I can use the MPlug derived > from thisMObject like: > > thisNode = self.thisMObject() > plug = OpenMaya.MPlug( thisNode, self.aTPos ) # aTPos is the attribute > someFloat = plug.asFloat() > someInt = plug.asInt() > someDistance = plug.asMDistance() > > etc... > > but I can't get an MVectorArray this way... > > I tried to store the data in a class variable in compute, because it > doesn't run the compute() as it tries to draw it, it didn't work... > > So, any idea ??? > > > > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/python_inside_maya -~----------~----~----~----~------~----~------~--~---
