Isotropix Forums

Saving custom properties with Alembic

Clarisse Scripting related topics

Saving custom properties with Alembic

Unread postby tsn » Tue Jun 16, 2020 5:56 pm

I've successfully created custom attributes for a particle cloud and I'm also able to save my particles to Alembic with various export options. The only thing I couldn't find out is how to save these properties with the Alembic files. If I recall correctly, it wasn't possible to save custom properties to Alembics because of a limitation with older Clarisse versions, but now it should be feasible. I'm a right?

Thanks for any help.
tsn
 
Posts: 29
Joined: Tue Mar 31, 2015 5:04 pm

Re: Saving custom properties with Alembic

Unread postby mdkai » Wed Jun 17, 2020 2:29 am

Yes, select the desired context, then in the menu hit File> Export > Context as alembic
https://www.clarissewiki.com/4.0/exporting-alembic.html

Cheers
Kai
Join us at the Discord https://discord.gg/G5cJj9A
mdkai
 
Posts: 351
Joined: Tue Oct 07, 2014 7:24 pm

Re: Saving custom properties with Alembic

Unread postby tsn » Wed Jun 17, 2020 8:23 am

Thank you so much for your helpful tip Kai. I should have been more clearly on the fact that I'm looking for a scripted solution. There's a very good Python example in the forum about exporting Alembics with various options which I was using as a basis, but unfortunately it doesn't cover the export of custom properties and the SDK is also not very specific. Hence my question here ;)
tsn
 
Posts: 29
Joined: Tue Mar 31, 2015 5:04 pm

Re: Saving custom properties with Alembic

Unread postby tsn » Wed Jun 17, 2020 2:05 pm

Maybe one of the developers has a solution for saving custom properties with Alembics through a Python script?

EDIT: HAS BEEN ANSWERED ON DISCORD IN THE MEANTIME
tsn
 
Posts: 29
Joined: Tue Mar 31, 2015 5:04 pm

Re: Saving custom properties with Alembic

Unread postby anemoff » Wed Jun 17, 2020 4:07 pm

For posterity, here is the solution to properly initialize the export options for properties:

python code

options = ix.api.AbcExportOptions(ix.application)

# init export options
...

# now, to ensure properties are exported, init property export options

# by default it's already on True if not specified, so this line isn't really needed
options.export_properties = True

# Property compatiblity modes
# 0 = None (Default, intented for reading back the exported result in Clarisse)
# 1 = Houdini
# 2 = Houdini and Katana
compatibility_mode = 1
options.fill_sparse_properties = ix.api.AbcExportOptions.get_fill_sparse_properties(compatibility_mode)
options.promote_to_geometry_parameter = ix.api.AbcExportOptions.get_promote_to_geometry_parameter(compatibility_mode)
options.bake_indexed_properties = ix.api.AbcExportOptions.get_bake_indexed_properties(compatibility_mode)

# do the export
if ix.api.IOHelpers.export_to_alembic(options):
ix.log_info("Export succeeded!")
else:
ix.log_error("Export failed!")


Cheers,
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 367
Joined: Wed Jan 13, 2016 10:10 am


Return to Scripting