Bake packed geo animation to keyframes

   2469   7   2
User Avatar
Member
388 posts
Joined: July 2018
Offline
I have animated my packed prims using MOPs, can i bake my animation to keyframes?
Edited by papsphilip - Oct. 27, 2022 18:10:41
User Avatar
Member
405 posts
Joined: April 2017
Offline
If you're trying to export to a game engine or something similar, you can use the ROP FBX Output SOP to write your animation to FBX; this will bake down any MOPs animation of transforms down to keyframes.

Otherwise, it's a bit tricky. The problem is that the packed transforms themselves don't have channels that you can keyframe in the way you'd expect; translate/rotate/scale are encoded as matrices, not T/R/S channels. Can I ask what you're intending to do with the baked keys?
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
User Avatar
Member
388 posts
Joined: July 2018
Offline
i was trying to export a glb file for an AR project, so i had to do the baking through Blender OR Cinema4D eventually. Had to bake everything down to keyframes otherwise the animation was messed up after export.

Exporting to fbx simply didn't work, i don't know why. After exporting a frame range when i import back there is no animation.
I was also wondering about not having any channels to bake but.
Here is a file i am using as an example scene.

Attachments:
bake.rar (173.4 KB)

User Avatar
Member
405 posts
Joined: April 2017
Offline
You can get this to write to baked keyframes via FBX if you provide a path attribute on the FBX ROP.

You could create this easily with a prim wrangle:
s@path = sprintf("piece%g", @primnum);

Then enable "Build Hierarchy from Path Attribute" on the ROP. If you load it into Blender or C4D you should see your boxes animated as transforms.
Edited by toadstorm - Oct. 28, 2022 19:16:27
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
User Avatar
Member
388 posts
Joined: July 2018
Offline
you are absolutely right! when i used the file SOP in Houdini to import the fbx back in nothing was moving and thought it didn't work. Blender reads it just fine though why is that?

i had to use the Labs FBX archive import to see the result. This way GLB export from Houdini also worked but resulted in way bigger file sizes than Blenders.

FBX export from Houdini --> import in Blender and export GLB was 11mb
FBX export from Houdini --> import back in and export again as GLB was 70mb
User Avatar
Member
405 posts
Joined: April 2017
Offline
Houdini isn't great with the GLTF/GLB format in general... I'm not sure exactly what data is being encoded there that's causing the file size bloat but I'd recommend just writing FBX from Houdini and then doing the final conversion to GLTF in Blender.
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
User Avatar
Member
388 posts
Joined: July 2018
Offline
toadstorm
Houdini isn't great with the GLTF/GLB format in general... I'm not sure exactly what data is being encoded there that's causing the file size bloat but I'd recommend just writing FBX from Houdini and then doing the final conversion to GLTF in Blender.

thanks a lot toadstorm, this is a lot clearer for me now.
One last question for you, MOPs related! Since you are the creator of this awesome toolset. Did you manage to get a look at my file? What did you think about the hierarchical nesting and MOPs falloff use after every unpack? Wasn't sure if this was the best way to approach this, wondering whether you have any tips
User Avatar
Member
405 posts
Joined: April 2017
Offline
I think your packing setup is pretty slick! Using the Pack SOP like that is a great way to build a hierarchy of pivots. The only thing I'd change is your use of Attribute Randomize and MOPs Falloff from Attribute... there's nothing special at all about MOPs falloffs, they're just a float-type point attribute. You could generate whatever random (or not random) values you want, and just bind the result to `mops_falloff`, or just tell downstream MOPs nodes to use your random attribute in place of the default. It'd make your node network a little lighter and easier to read.
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
  • Quick Links