Writing importer/exporter using Pymel

72 views
Skip to first unread message

Sreenivas Alapati

unread,
Dec 18, 2013, 4:48:39 AM12/18/13
to python_in...@googlegroups.com
Hi everyone,

I am in the middle of writing an exporter and importer for a proprietary animation format for maya.
I got the whole thing worked out in pymel but couldn't figure out the following...

# Is there any way I can open the file loader ui window using pymel, where the user can point to the file.

# How can I register the whole pymel script as a plugin with maya.

I was just starting out in pymel.. so, any help would be appreciated.
-sreenivas.

Andres Weber

unread,
Dec 19, 2013, 4:20:05 PM12/19/13
to python_in...@googlegroups.com
import pymel.core as pm
pm.fileDialog2 (or pm.fileDialog, but I'm pretty sure that's antiquated)

Writing a plugin is actually deceivingly simple.  There's TONS of tutorials online if you just google it.  First thing I googled (not necessarily the best at all):

http://volcore.limbic.com/2011/09/25/writing-maya-plugins/

Sreenivas Alapati

unread,
Dec 20, 2013, 9:17:54 AM12/20/13
to python_in...@googlegroups.com


On Friday, 20 December 2013 02:50:05 UTC+5:30, Andres Weber wrote:
import pymel.core as pm
pm.fileDialog2 (or pm.fileDialog, but I'm pretty sure that's antiquated)

This worked perfectly. Thanks.
Writing a plugin is actually deceivingly simple.  There's TONS of tutorials online if you just google it.  First thing I googled (not necessarily the best at all):

http://volcore.limbic.com/2011/09/25/writing-maya-plugins/


Well, after a bit of more googling found a way to register the script... and yes it is pretty simple.
here is what I did.
1. Copy the test.py file to scripts folder in the maya directory path
2. in the script editor do..
    import test
    test.ui()
This will be definitely helpful when deaing with scripts to use locally.
For now this will do...

But I am looking to integrate my importer to the maya default window.
Where the user can go to file > import and from the dropdown menu options choose the format.

I think attemting this will require a bit of more knowledge of openMaya, cmds and other stuff..
Will post here if I make any progress on that...
Thanks for your time.

Reply all
Reply to author
Forward
0 new messages