Alembic export with variables in Python?


#1

edit: got it working.

I think ABCExport only has a MEL command line interface so I’m trying to use this command to export Alembic but it’s not working. The command line spits this out for the manual export of selected (the node listed as “test” in the command):

AbcExport -j "-frameRange 1 15 -noNormals -uvWrite -root test -file /Users/beige/Desktop/test3.abc";

but it gives an error for this setup that should produce the same output:

mel.eval('AbcExport -j "-frameRange 1 15 -noNormals -uvWrite -file -root '+mySelection[0]+' '+(projPath + "MariMe/" + meshID[0]+ ".abc")+'"')

// Warning: Ignoring unsupported flag: pSphere1 //
// Warning: Ignoring unsupported flag: /Volumes/lackey/WORK/PAINTING/LANDSCAPE_SERIES/BOOK_OF_JJ_QUAKE/MariMe/happy.abc //


#2

never used abcexport, but intead of jumping in and out of qoutes so you can add python vars in, it might be easier to use python string formatting, with the .format() method. More clean way to put python variables in a string.

maybe like this

from maya.mel import eval
  eval('AbcExport -j "-framerange 1 15 -uvWrite -root test -file {0}{1}MariMe/{3}.abc"'.format(mySel[0], projPath, meshID[0]))

PS
This fourm really needs to get syntax highlighting for the code tag, bitch to read bits like yours without atleast highlighting on the strings.


#3

In python it will give this :

command = "-frameRange" + " " + str(int(f1)) + " " + str(int(f2)) + " "+ "-uvWrite" + str(myRoot) + " -file " + str(Outpoutpath)#only a string as command to pass all args
 				
 cmds.AbcExport(j= command)

@CMCPasserby : what other way to export Alembic ? I’m curious.


#4

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.