redpawfx
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.
https://github.com/redpawfx/uninstancer/blob/master/python/ns/maya/ParticleUtil.py

I have a couple of lines of code  as follows,

Code:

  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

johnc


Quote 0 0
pshipkov
i don't think the id array is of type integer, but double one.
Quote 0 0
redpawfx
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.

thanks

-johnc

Quote 0 0

Add a Website Forum to your website.