kiryha Posted February 13, 2019 Share Posted February 13, 2019 (edited) Hi, guys I need to exchange camera animation between scenes and I guess that Alembic is a good option for this. I can import the alembic camera: OBJ = hou.node('/obj/') CAM = OBJ.createNode('alembicarchive', 'CAM') CAM.parm('fileName').set('C:/temp/cam.abc') CAM.parm('buildHierarchy').pressButton() Now I need to figure out how can I export the camera from my scene... I can export camera with Alembic ROP but maybe there is a more elegant solution? sceneRoot = hou.node('/obj/') # Get camera object camera = hou.node('obj/{}'.format(cameraName)) # Get Camera parent nodes listCameraNodes = '{}'.format(camera.name()) for i in camera.inputAncestors(): listCameraNodes += ' {}'.format(i.name()) # Create ROP network ROP = sceneRoot.createNode('ropnet') ABC = ROP.createNode('alembic') ABC.parm('trange').set(1) ABC.parm('filename').set('C:/temp/camera_001.abc') ABC.parm('objects').set(listCameraNodes) ABC.parm('execute').pressButton() ROP.destroy() cameraExportImportABC_001.hiplc Edited February 13, 2019 by kiryha Quote Link to comment Share on other sites More sharing options...
alexnet Posted February 14, 2019 Share Posted February 14, 2019 To import a camera through alembic, a good solution is not to use the Build Hierarchy every time, but read the parameters directly from it using the module. >>> import _alembic_hom_extensions as abc http://www.sidefx.com/docs/houdini/hom/abc_extensions.html From it you can pull out all the transformations and some data on the camera. For export, it is better to have a HDA in which you could indicate the path to the camera where all its parameters would be read, after that the camera would be baked and then exported to Alembic. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.