Page 2 of 2

Re: Get transformation from alembic?

PostPosted: Thu Jan 26, 2017 9:35 am
by gardeler
That sounds great Roeland, but I have no idea how to do that. How would I setup the time control? And can I pinpoint a specific object in the alembic file, or do I need to do like in this script, export a specific object with that motion?

Sorry for not knowing anything about lua, or programming in general!

Re: Get transformation from alembic?

PostPosted: Fri Oct 19, 2018 6:57 pm
by ToxicAngel
Hi guys,

Forum noobie here asking probably a really stupid question, but...

Since sometimes alembic caches gets huge and heavy, and they are cumbersome at best when you are dealing with heavy geometry rigid objects that don't have any vertex animations etc. , i was wondering if a similar script like cameraTransform.orbx by calus could be written for getting the animation data (rotation,position etc) of an object inside the .abc file.

Introducing a scenario :
Let's say that we have sci-fi alembic scene which has a camera animation but also animation data for some spaceship objects that are moving around the scene.

What i'd like to do - instead of waiting several hours to get HUGE alembic scene exported, i could use dummy objects (like cube or null etc), to tell where the spaceships are and how they are flying around, and later in Octane standalone i would be able to link their animation data to various .obj files that contains the actual hi-poly mesh of the spaceships.
This would also enable the same scene to be used with different types of vessels to be rendered without having to re-export the heavy and cumbersome scene out again.

So - in a nutshell - my question, is this possible - personally i don't know enough about lua / alembic to even get started with this, but if somebody out there has already invented this "wheel", i'd be interested to test it :)!

Cheers, and thanks for the cameraTransform - it already helped me to solve one issue that i kept having :)

Re: Get transformation from alembic?

PostPosted: Mon Oct 22, 2018 10:49 pm
by roeland
Exporting and importing huge geometry objects is fast in Alembic, the slow part is actually exporting and importing all the transforms.

You can inspect nodes in an geometry archive like in any other node graph. But that is quite complex, Alembic can store arbitrary geometry node structures.

The easiest way (I think) is to copy the contents of the Alembic archive to a new node graph and then replace the data in the copied mesh nodes. But I don’t have a script which does this.

alembicArchive is assumed to be the imported Alembic archive. For an automated script an easy way to get a specific archive in a scene is to find it by name:

Code: Select all
local alembicArchive = octane.project.getSceneGraph():findItemsByName("name.abc")[1]


Then make the copy and find the mesh nodes in that copy

Code: Select all
local g = octane.nodegraph.create{ name = "New graph" }
g:copyFromGraph(alembicArchive)
local meshList = g:findNodes(octane.NT_MESH)


What to do with this list of mesh nodes heavily depends on your use case. Eg. you can iterate over that list and load new data:

Code: Select all
for _, node in ipairs(meshList) do
    local obj = ....
    node:setAttribute("filename", obj)
end