I have the script to export an Alembic from Maya with MEL :
AbcExport(-frameRange 31 41 -writeVisibility -dataFormat ogawa -root |myChar:char|myChar:GEOchar -file E:/test.abc)
I would like to do the same with Python. Something like :
cmds.AbcExport(...)
I can't find any documentation about it... Any idea?
Thank you a lot!
You can run this command on Python using the jobArg flag:
import maya.cmds as cmd
start = 0
end = 120
root = "-root pSphere1 -root pCube1"
save_name = "c:\documents\maya\project\default\cache\alembicTest.abc"
command = "-frameRange " + start + " " + end +" -uvWrite -worldSpace " + root + " -file " + save_name
cmd.AbcExport ( j = command )
Just tested this with Maya 2016.5, and it works for me.
Like you, I could not find any official documentation showing this, only unofficial sources like these:
http://www.wenie.net/notes/alembic-cache-script-via-python (where I found the example code)
http://forums.cgsociety.org/archive/index.php?t-1156807.html (the python format is used on the bottom post, which means this exists back to Maya 2015, if one is still using it)
You can find help for cmds.AbcExport and cmds.AbcImport by instantiating them with the h arg set to True. The following commands will print help docs:
maya.cmds.AbcExport(h=True)
maya.cmds.AbcImport(h=True)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With