Extracting Alembic Data

   14701   10   2
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Hi All,
One thing that has popped up onto my radar is when using Alembic data in your scene there is no transform / rotational data to hook into like FBX which has key framed values.
You can using the rivet sop which although nice is not really useful for pulling anything but transform data. So If I have a cube moving through a scene and rotating , what are people doing to pull out trans / rot data .

Rob
Gone fishing
User Avatar
Member
4956 posts
Joined: July 2007
Online
well, you can parent anything to Alembic Xform node
or
get any portion of its transform through origin() expression
or
use Object CHOP

EDIT:
but if you are talking about cached deforming meshes, not animated objects, then you are left with
Rivet Object
or
Extract Transform Object
or
custom VOP or python solution to extract transform from relative point movements
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Hi Tomas,
Another Gold answer


For those who don't know about grabbing xform values with chops, see attached. this system wont work with the current thread question but its great for getting values and using elsewhere.



Rob

Attachments:
rse_Xform_grab_data_Chops.hip (76.2 KB)

Gone fishing
User Avatar
Member
182 posts
Joined: Nov. 2008
Offline
You can also get transformations from alembic transform nodes with python: Node.worldTransform().
Aleksei Rusev
Fx Software Engineer @ Sony Imageworks
User Avatar
Member
1652 posts
Joined: Dec. 2006
Offline
hi!
I found that the easiest way is using the object chop, it grabs world position baked down from parents.
Also you can filter the transforms only from the alembic file when reading in.
daniel bukovec | senior fx td | weta digital
qLib – http://qlab.github.io/qLib/ [qlab.github.io]
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Hi Buki , that doesnt seem to work for me using a cached deformed mesh.

Rob
Gone fishing
User Avatar
Member
773 posts
Joined: April 2020
Offline
Hello Rob,

Could you not ask the people who create this cache for you to also write out some nulls / locators that might have been used in deforming the mesh?

You could then easily pick these up with an alembic xform.

Cheers,
Koen
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
That's what I ended up doing !

Rob
Gone fishing
User Avatar
Member
3 posts
Joined: Nov. 2013
Offline
hi there, i want to extract a transform data from alembic file but i only can export one object, so what i want to do i want to do for all object in alembic archive. i want to use alembic transform as template point to use with copysop .. any idea?
import _alembic_hom_extensions as abc
node = hou.pwd()
geo = node.geometry()
# Add code to modify contents of geo.
# Use drop down menu to select examples.
abcPath = "D:/thuy_max/00_max/export/OBJ/soleil/SOLEIL_LOCATION_thuy_00_export/test.abc"
objectPath = "/Plane001"
sampleTime = 1
abcXform = abc.getLocalXform(abcPath, objectPath, sampleTime)
geo.addAttrib(hou.attribType.Point, 'abcXform', abcXform[0])
User Avatar
Member
3 posts
Joined: Nov. 2013
Offline
well i got it but right now i don't know how to cenvert it into an orient attribute it's a quaternion data type and the data i got it is an matrix4

import _alembic_hom_extensions as abc
node = hou.pwd()
geo = node.geometry()
# Add code to modify contents of geo.
# Use drop down menu to select examples.
abcPath = "D:/thuy_max/00_max/export/OBJ/soleil/SOLEIL_LOCATION_thuy_00_export/test.abc"
sampleTime = 1
x4_attrib = geo.addAttrib(hou.attribType.Point, "m4", ( 0.0, 0.0, 0.0, 0.0,
                                                        0.0, 0.0, 0.0, 0.0,
                                                        0.0, 0.0, 0.0, 0.0,
                                                        0.0, 0.0, 0.0, 0.0))
x3_attrib = geo.addAttrib(hou.attribType.Point, "m3", ( 0.0, 0.0, 0.0,
                                                        0.0, 0.0, 0.0,
                                                        0.0, 0.0, 0.0 ))                                                            
ori_attrib = geo.addAttrib(hou.attribType.Point, "ori",(  0.0, 0.0, 0.0 ))
for prim, point in zip(geo.prims(), geo.points()):
    objectPath = prim.attribValue("path")
    abcXform = abc.getLocalXform(abcPath, objectPath, sampleTime)[0]
    x4 = hou.Matrix4(abcXform)
    x3 = x4.extractRotationMatrix3()
    srt = x4.explode(pivot = point.position())
    point.setAttribValue(x4_attrib, x4.asTuple())
    point.setAttribValue(ori_attrib, srt["rotate"])
    print srt["rotate"]
User Avatar
Member
3 posts
Joined: Nov. 2013
Offline
i got it, simple use wrangle node

//extract orient
matrix thuy = primintrinsic(0, “packedfulltransform”, @primnum);
@orient = quaternion(matrix3(thuy));
// get objs
string path;
getattribute(@OpInput1, path, “prim”, “path”, @ptnum, @vtxnum);
string objs = split(path, “.”);
// set instance path
s@instancefile = chs(“instance_Path”) + objs + “.obj”;
  • Quick Links