Jump to content

Loading Alembic camera


Recommended Posts

Hi everyone,

Can you please share your most efficient way of loading an alembic camera?

I'm working with 2 alembic files (animated object and camera) and I'm trying to Object merge them in a new Geometry node so I can use the Timeshift node to offset their animations. I can see that it's working in the viewport(I'm seeing the camera and objects move at my specified time) , but I can't think of a way to look through the "camera" from the object merge. The goal is to control the time offset of many assets using 1 node.

 I guess I'm generally asking for the best practices while working with alembic cameras. I'm currently learning Houdini and I realize my questions can be disoriented,but any help would be appreciated, there's not much about alembic cameras in the documentation.

Cheers! :) 

Link to comment
Share on other sites

  • 1 year later...

actually, i was wondering about doing the same thing not too long ago, when I needed to do a camera timewarp. see the hip file bellow.

in short, you need to extract a camera transform into an oriented point (with N, up, and all that jazz), and then use rivet_SOP to drive other objects around with this point transform. works quite well for me.

cheers.

camera_timewarp.hiplc

  • Like 2
Link to comment
Share on other sites

Hi all,

I recently did a discussion about this for The Rookies | Rebelway FX challenge. I used a Python SOP to extract some useful data from the alembic cameras provided with the scene.

 


alembicCamScript.py
#add this code to a python sop to extract transform data from an amembic cam

#extract the world transform of the alembic xform node & mult the 4x4 matrix by a origin vector
#note --> the .node("path") is an absolute ref to the target alembic node
camPos = hou.Vector3(0,0,0) * hou.node('/obj/alembicArchive/alembicXform').worldTransform()

#creating a look nml by offseting the vec (-1 along the z-axis)
camLookPos = hou.Vector3(0,0,-1) * hou.node('/obj/alembicArchive/alembicXform').worldTransform()
camLookDir = (camLookPos - camPos).normalized()
#binding data to geo 
#.pwd() is a method for getting the active directory
geo = hou.pwd() 

#setting detail attribs onto the geo
#creating two detail attribs (camPos & lookDir)
geo.addAttrib(hou.attribType.Global, "camPos", camPos)
geo.addAttrib(hou.attribType.Global, "lookDir", lookDir)

#alternivivley uncommment this code to add a point attrib
#pnt = geo.createPoint()
#pnt.setPosition(camPos)
#pnt.setAttributeVAlue('N', lookDir)

 

Edited by voxelfox
updated link
  • Like 2
Link to comment
Share on other sites

On 15.4.2021 at 1:36 PM, davpe said:

to make this info a bit more complete, you can also time offset alembics directly on alembic node by having an expression in Frame parameter. for instance $F + 10, or so...
 

I'm not talking about alembic, that's quite simple, I'm talking about animated, nested null objects they are exported from another program into an fbx file on obj level.

this is the "krishna avril" method mention above.

fbx_offset.hip

Link to comment
Share on other sites

5 hours ago, y81r said:

I'm not talking about alembic, that's quite simple, I'm talking about animated, nested null objects they are exported from another program into an fbx file on obj level.

this is the "krishna avril" method mention above.

fbx_offset.hip

I was answering Petko Ganev's original question that was about time shifting alembic camera.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...