AETemplate not getting sourced for custom locator (python api 2.0)

79 views
Skip to first unread message

Nico Sanghrajka

unread,
Apr 10, 2019, 5:24:37 PM4/10/19
to Python Programming for Autodesk Maya
I have been banging my head on this for a while now:

I am working on a custom locator node with maya python api 2.0
and am stuck with creating a AETemplate for it.

Following Chad Vernons example I was able
to create a AETemplate for a ramp attribute on a dependency node (MPxNode), both in api 1.0 and api 2.0
but not for a MPxLocatorNode. Shouldn`t that work the same way?

When I create my plugin, I get a shape and transform node (as expected for locators)
the shape node is called xformOnCurveLocatorShape1 and holds my custom node
attributes including the ramp attr and the transform node is called xformOnCurveLocator1
The nodeType is: xformOnCurveLocator

Shouldn`t the global proc for the AETemplate then be called
global proc AExformOnCurveLocatorTemplate( string $nodeName )

For some reason that does not work and the proc does not run.
I tried a lot of different things and name variations, in both python api 1.0 and python api 2.0
and nothing seems to work.

Any ideas what I am doing wrong?

thanks
Nico.

Marcus Ottosson

unread,
Apr 11, 2019, 2:15:50 AM4/11/19
to python_in...@googlegroups.com

Yes, it should work like that. Make sure the file name is AE{nodeName}.mel i.e. AExformOnCurveLocator.mel, as Maya will look for a filename matching that pattern the first time the node type is displayed in the AE. And also note it’ll only show when you actually look at the shape in the AE, not the transform. And also note that it’ll only look once, then if you change it or add one later you’ll need to restart Maya. There’s a command to make it re-discover templates, but I can’t recall what it was.

There's one more example here, though it's also an MPxNode.

https://github.com/mottosso/Qt.py/issues/53#issuecomment-280085508


--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/41600704-91c7-41ca-b6ba-47c55cfdfb14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nico Sanghrajka

unread,
Apr 12, 2019, 11:00:56 AM4/12/19
to Python Programming for Autodesk Maya
Thank you!
I had not restarted Maya - duh!
I thought just resourcing the global proc inside Maya and reopening the AttrEditor would be enough to update it. Apparently not.
Reply all
Reply to author
Forward
0 new messages