Saving rest transform to Alembic

   2690   5   2
User Avatar
Member
87 posts
Joined: Nov. 2017
Offline
Hi guys,

I've been using alembic a lot in recent projects, and very comfortable with the ROPs based lighting pipeline around it, with Mantra and V-Ray. Not done much with managing the transforms in it though, usually just loading in SOP. I know the way forward is USD/Solaris, but while we're waiting for renderers to catch up, would be great to address some current limitations with Alembic too.

Consider transforming, not deforming geometry. It's very useful to have access to a reset pose of animated assets. That seems not trivial to extract from animated asset - match size does a great job for the translations, but the rotations seem difficult. If I have a rest pose - at zero with no rotations, it would be easy to do some work on it and reapply the animation to the new geometry.

It would be best if this rest transform can be saved in the animation's alembic - not another file, so the transport of files is simpler. Seems like Alembic has sophisticated transforms management, but I'm not finding a way to do that. Checking out layered alembics too, but the examples in the reference are saving layers to separate files, and not several things in a file. In the Alembic ROP's layering tab, I can pick objects but I can't tell it to use shape from one object and transform from another. And it would be best if I don't save two shapes, one at rest and one animated, because this would double the file size

Any ideas? Thanks!
User Avatar
Member
9236 posts
Joined: July 2007
Online
You can get transform matrix of any packed primitive (including packed alembic) from "packedfulltransform" intrinsic attribute
For example
4@xform = primintrinsic(0, "packedfulltransform", @primnum);

Then do with it what you need, like access during render time or you can append Transform By Attribute SOP (Invert Transformation) to transform your prims to rest
Edited by tamte - Sept. 11, 2021 22:20:33
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
87 posts
Joined: Nov. 2017
Offline
OK so if I've transformed it from rest, inverting the packedfulltransform should get it back to rest - I'll try that, thanks!
User Avatar
Member
87 posts
Joined: Nov. 2017
Offline
Looks like it's working - it's putting the centroid at zero unlike the original rest that lines up y min to zero, but that shouldn't be much of a problem. Thanks!
User Avatar
Member
9236 posts
Joined: July 2007
Online
HristoVelev
it's putting the centroid at zero unlike the original rest that lines up y min to zero, but that shouldn't be much of a problem. Thanks!
there is also "transform", "packedlocaltransform" and "pivot" intrinsics that come into play if you need to recover exact pivot placement
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
87 posts
Joined: Nov. 2017
Offline
Is there a good place to read about how these all work? There are some cases where my current setup is breaking, so it would be great to learn more

Thanks!
  • Quick Links