I was wondering if anyone else has been able to make
an MPxParticleAttributeMapperNode in a python plugin... or perhaps have
someone else verify that it isn't working.
I boiled down the script to the bare minimum:
import maya.OpenMaya as om
import maya.OpenMayaMPx as mpx
class ParticleAttributeMapperNode(mpx.MPxParticleAttributeMapperNode):
id = om.MTypeId(0x870350)
def initialize():
pass
def creator():
return mpx.asMPxPtr( ParticleAttributeMapperNode() )
def initializePlugin(mobject):
mplugin = mpx.MFnPlugin(mobject)
mplugin.registerNode( 'dummyParticleAttr',
ParticleAttributeMapperNode.id,
creator,
initialize )
def uninitializePlugin(mobject):
mplugin = mpx.MFnPlugin(mobject)
mplugin.deregisterNode( ParticleAttributeMapperNode.id )
... and it still isn't working. It will import fine, but if you try to
actually create an instance of such a node, it fails:
if not cmds.pluginInfo(plugin, loaded=1, q=1):
cmds.loadPlugin(plugin)
cmds.createNode('dummyParticleAttr')
Note that this script will work with pretty much ANY other MPxNode type -
just swap out the MPxParticleAttributeMapperNode for, say, an
MPxSurfaceShape, or MPxDeformerNode, and it can create one.
Anyone else have any success with this, or at least want to confirm if it is
/ isn't working for them?
Thanks,
- Paul
--
http://groups.google.com/group/python_inside_maya