AETemplates in Python

52 views
Skip to first unread message

q2on

unread,
Mar 20, 2009, 5:54:44 PM3/20/09
to python_inside_maya
Is it possible? I can't get Maya to use my AETemplate.py... only .mel.
Thanks


Ravi Jagannadhan

unread,
Mar 20, 2009, 6:00:17 PM3/20/09
to python_in...@googlegroups.com
I don't think it's possible in 2009.

On Fri, Mar 20, 2009 at 2:54 PM, q2on <kos...@gmail.com> wrote:
>
> Is it possible? I can't get Maya to use my AETemplate.py... only .mel.
> Thanks
>
>
>
> >
>



--
Where we have strong emotions, we're liable to fool ourselves - Carl Sagan

Chad Dombrova

unread,
Mar 20, 2009, 6:00:23 PM3/20/09
to python_in...@googlegroups.com
i've bugged autodesk about this before.  file a bug report so that they get the message loud and clear. 

Hradec

unread,
Mar 20, 2009, 8:10:49 PM3/20/09
to python_in...@googlegroups.com

its possible with some hacking...

in python, you can register a mel proc for the AETemplate (yes, an AETemplate can be sourced dinamically, it doesn't necessarely need to have a AETemplate.mel file)...

I'm doing it in my slum project... check it out the __init__ code for my AETemplate python class in this code:

    http://code.google.com/p/slum/source/browse/trunk/python/slumMaya/shaderBase.py

I'm using this AETemplate class to dynamically create and register AETemplates mel procs for nodes ... I'm relying on mel, but making mel call a static method in my python AETemplate class, where then I can do all the code in python.

There's one BUT in this method... if you need custom UI (as I need in my code), you need to, again, rely on mel to define the procs for the custom UI... (also demonstrated in my code)

The good thing in this approach is that you can define you AETemplate in the same script were your plugin classes are defined, making it being evaluated every time the plugin loads...

In my code, you will see the AETemplate defined in the same source file were the actual node code is, keeping all related things toguether... easier to maintain, at least for me... 

I hope this helps...

-H

--
-Hradec



--
-Hradec
Reply all
Reply to author
Forward
0 new messages