Use AbcExport plugin externally to convert obj to abc

796 views
Skip to first unread message

likage

unread,
May 5, 2017, 7:38:48 PM5/5/17
to Python Programming for Autodesk Maya
Hi all, I am trying to convert objects (.obj) into alembics (.abc)

While I am able to perform this by importing my objs into a maya scene and export it as alembic, is there a way in which I can run it externally out of Maya session? 
Such that I can try running it as a command line or somewhat, by making use of the AbcExport plugin within Maya?

Paul Molodowitch

unread,
May 5, 2017, 9:52:38 PM5/5/17
to Python Programming for Autodesk Maya
you can just use mayapy, then invoke the AbcExport plugin from there.


--
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/2c21c9fc-eb98-4482-91ba-c56e263bca09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nicolas Chaverou

unread,
May 9, 2017, 2:17:13 PM5/9/17
to python_in...@googlegroups.com
Alembic also has a Python interface.
Pretty sure you can do it without requiring any Maya license
On Sat, May 6, 2017 at 3:52 AM, Paul Molodowitch <elro...@gmail.com> wrote:
you can just use mayapy, then invoke the AbcExport plugin from there.
On Fri, May 5, 2017 at 4:38 PM likage <dissid...@gmail.com> wrote:
Hi all, I am trying to convert objects (.obj) into alembics (.abc)

While I am able to perform this by importing my objs into a maya scene and export it as alembic, is there a way in which I can run it externally out of Maya session? 
Such that I can try running it as a command line or somewhat, by making use of the AbcExport plugin within Maya?

--
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_maya+unsub...@googlegroups.com.

--
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_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAAssL7a_Aa7TRgPHPQ2CY3%3D6Nf_Hhdhu_XOWZRJq6O%3D5J%3DA3mw%40mail.gmail.com.

Paul Molodowitch

unread,
May 10, 2017, 9:29:03 PM5/10/17
to python_in...@googlegroups.com
Yeah, but then you'd also need to write the code to parse the OBJ file, too. Which, if all you care about is basic stuff (vert positions, maybe normals), isn't that bad... the problem is that there isn't really a firm standard once things get fancier.

Also, the python api is significantly more complex than just invoking the abcExport command.  Cask simplifies things... but if he wasn't aware of mayapy, I'm guessing it's still going to be more complicated than he's looking for.

On Tue, May 9, 2017 at 11:17 AM Nicolas Chaverou <nicolas....@golaem.com> wrote:
Alembic also has a Python interface.
Pretty sure you can do it without requiring any Maya license
On Sat, May 6, 2017 at 3:52 AM, Paul Molodowitch <elro...@gmail.com> wrote:
you can just use mayapy, then invoke the AbcExport plugin from there.
On Fri, May 5, 2017 at 4:38 PM likage <dissid...@gmail.com> wrote:
Hi all, I am trying to convert objects (.obj) into alembics (.abc)

While I am able to perform this by importing my objs into a maya scene and export it as alembic, is there a way in which I can run it externally out of Maya session? 
Such that I can try running it as a command line or somewhat, by making use of the AbcExport plugin within Maya?

--
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.

--
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.
--
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/CAFS5DCZTKa%3DCfmorZksPgJaQASH9DSZGR3LmLBm_4f1gj2c4Nw%40mail.gmail.com.

likage

unread,
May 15, 2017, 2:29:48 PM5/15/17
to Python Programming for Autodesk Maya
Hi everyone,

sorry for the delay in reply.

Yes I am pretty much unaware of mayapy, first time hearing this. Trying to search for some tutorials online that may guide me through this.
But if you have any links, please do share it with me :)

Currently I am not sure what is the ideal way to proceed this, as mentioned in my first post - all I have been doing is import obj into scene and export it as abc.
I am trying to achieve this first before implementing any other factors into it. Pretty noob in this aspect.

@Nicholas: I do not even know how to access the python side for alembic!


likage

unread,
May 15, 2017, 5:41:40 PM5/15/17
to Python Programming for Autodesk Maya
I keep getting the following error:

ERROR, imageIsFile, can't read `/user_data/custom_scripts/'. Is a directory

File read in  0.024 seconds.
Error: Failed to open IFF file for reading : /user_data/.tmp//maya108600x7fff97d2ea00.iff

Despite loading in the obj plugin, the error ensues.. Not sure why it keeps calling for this .iff file

This is my code:
import os
import maya.standalone
from sys import argv
maya.standalone.initialize()
 
import maya.cmds as cmds
 
def main():   
    obj_file_path = argv[1]
    print obj_file_path

    # Check for path validity
    check_open_path = os.path.isfile(obj_file_path)
    if not check_open_path:
        raise IOError('Input file path does not exists. Please check or make sure that full path is used.')
        return

    cmds.loadPlugin('objExport.so')
    cmds.file(obj_file_path, i=True, type='OBJ')

if __name__ == "__main__":
    main()


Reply all
Reply to author
Forward
0 new messages