Hi, I'm trying to debug, whats probably a simple  issue, but I'm not very good with the python API, 
I usually stick to c++. 

This code previously worked in maya 2014  and broke in 2015
its from the  (now) open source  Nimble tools unInstancer tool that I took over from the orig author.

I have a couple of lines of code  as follows,


  def fromParticle( self, oParticle, deepCopy=False ):
fParticle = MFnParticleSystem( oParticle )
pIdMapping = nsm.DG.getPlug( node=oParticle, attrName="idMapping" )
pSortedId = pIdMapping.child( fParticle.attribute( "sortedId" ) )
pIdIndex = pIdMapping.child( fParticle.attribute( "idIndex" ) )
pParticleId = nsm.DG.getPlug( node=oParticle, attrName="particleId" )
fSortedId = MFnIntArrayData( pSortedId.asMObject() )
fIdIndex = MFnIntArrayData( pIdIndex.asMObject() )

and I get an error on the   second to the last line as follows:

RuntimeError:  kInvalidParameter:  object is incompatible with this method

 I've put in some debug prints to find out that the  pSortedId  is indeed a   MIntArray, and such.
I'm assuming this is some slight  change in the API.  or python.

any suggestions?  I'd appreciate it :-)

thanks in advance


Quote 0 0
i don't think the id array is of type integer, but double one.
Quote 0 0
Figured this out wiht the help of a co-worker.   another python plugin was patching some functions of the API weirdly  and  blocking it from working correctly.



Quote 0 0

Add a Website Forum to your website.