Isotropix Forums

exporting alembic files

Clarisse Scripting related topics

exporting alembic files

Unread postby megavotch » Tue Nov 07, 2017 4:20 am

I'm getting a crash when trying to export alembic files in a loop using python.

I'm creating an alembic export object and setting the options. And then executing ix.api.IOHelpers.export_to_alembic(options).

This works great for the first object exported in the loop.
But when exporting the next object Clarisse crashes with this error...

error: Cannot create a new instance of AbcInputArchiveManager: there is already one.

Any Idea what could be causing this?
megavotch
 
Posts: 132
Joined: Mon Nov 18, 2013 9:20 pm

Re: exporting alembic files

Unread postby bvaldes » Tue Nov 07, 2017 11:07 am

Hi,

You should maybe use the export button of your Alembic export item instead of using the IOHelper function:

python code

exporter = CreateObject("alembic_export", "ProcessAlembicExport") # Create the item
# Here set all the options like you probably did
exporter.call_action("run_process") # Click on the Run Process button

That should avoid your issues. Regards
Benoit VALDES
Isotropix
Clarisse QA
User avatar
bvaldes
 
Posts: 160
Joined: Mon Sep 26, 2016 11:44 am

Re: exporting alembic files

Unread postby megavotch » Sat Nov 11, 2017 3:07 am

I'm not able to make this work, when I create a ProcessAlembicExport node I'm not able to set the attrs.

Interestingly the node that is created is grayed out and I'm not able to manually set the attrs either. What am I missing?
megavotch
 
Posts: 132
Joined: Mon Nov 18, 2013 9:20 pm

Re: exporting alembic files

Unread postby bvaldes » Mon Nov 13, 2017 11:52 am

Hi,

I am really sorry for my previous post. Indeed this object doesn't exist so you can't use it.
I made a simple test to export some ABC and I didn't get any error.

python code

options = ix.api.AbcExportOptions(ix.application)
for item in ["box", "sphere", "cylinder"]:
ix.selection.select("project://"+item)

options.export_mode = ix.api.AbcExportOptions.EXPORT_MODE_SELECTION
options.filename = ix.api.CoreString("/Users/bvaldes/Desktop/Bazard/" + item + ".abc")
ix.api.IOHelpers.export_to_alembic(options)

To make the test working I created 3 geo in the work context and set the export mode to selection. In the loop i simply select the item that I want to export. If you are working in context mode, you can do the same thing and set the current context in the loop (don't forget to set the export mode to EXPORT_MODE_CONTEXT)

I hope that can solve your issue. Once again sorry for the previous post. Regards
Benoit VALDES
Isotropix
Clarisse QA
User avatar
bvaldes
 
Posts: 160
Joined: Mon Sep 26, 2016 11:44 am

Re: exporting alembic files

Unread postby megavotch » Tue Nov 14, 2017 1:00 am

Thank you for clarifying Benoit,

I'm still getting the crash. I suspect it's because I have a much more complex setup. I'll try and reproduce the crash in a simple scene.
megavotch
 
Posts: 132
Joined: Mon Nov 18, 2013 9:20 pm


Return to Scripting