Is it possible to create an Alembic Layer export using Python?

Sett 112 ganger
Hopp til første uleste melding

paul hormis

ulest,
12. aug. 2022, 17:19:0612.08.2022
til alembic-discussion
I have an issue where I am given a large VrayProxies that  is loading an Alembic.

I created a tool that checks which objects are within the camera frustum of the shot and I want to animate the visibility of them using an Alembic Layer in the VrayProxy.

This is in 3ds Max.  I am using Python and not C++ for this work.

Is it possible?

Lucas Miller

ulest,
12. aug. 2022, 17:31:0312.08.2022
til alembic-d...@googlegroups.com
Yes, I think all you need to do is sparsely create the hierarchy as OObjects, and then use alembic.AbcGeom.CreateVisibilityProperty  on the OObject where you want to create the property that will be animated.

Lucas

--
You received this message because you are subscribed to the Google Groups "alembic-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alembic-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/alembic-discussion/04a4be3b-a4a7-4f65-8373-2dce32f6d6a6n%40googlegroups.com.

paul hormis

ulest,
12. aug. 2022, 17:49:3212.08.2022
til alembic-discussion
Could you possibly point me into the direction of documentation or examples of this?  I am new to the Alembic API.

paul hormis

ulest,
12. aug. 2022, 17:49:5612.08.2022
til alembic-discussion
Thank you for the very quick reply.

Lucas Miller

ulest,
12. aug. 2022, 18:27:5212.08.2022
til alembic-d...@googlegroups.com
I couldnt find a relevant test in the python binding, so instead I whipped up this example:

import alembic arch = alembic.Abc.OArchive('/tmp/vislayer.abc')

# lets sparsely set visibility on /foo/bar/baz 
fooObj = alembic.Abc.OObject(arch.getTop(), 'foo')
barObj = alembic.Abc.OObject(fooObj, 'bar')
bazObj = alembic.Abc.OObject(barObj, 'baz')

# assuming 24 fps, have a sample for every frame that starts at frame 101 
ts = alembic.AbcCoreAbstract.TimeSampling(1.0/24.0, 101.0/24.0) 
visProp = alembic.AbcGeom.CreateVisibilityProperty(bazObj, ts) 

 # -1 means deferred visibility, which is implicitly visible unless an ancestor marks it as invisible.
 # 0 means invisible 
visProp.setValue(-1) # frame 101 
visProp.setValue(0)  # frame 102 
visProp.setValue(0)  # frame 103 
visProp.setValue(-1) # frame 104 
visProp.setValue(0)  # frame 105

Lucas

Svar alle
Svar til forfatter
Videresend
0 nye meldinger