Jump to content
Ankit Sinha

Alembic camera export with camera scale value.

Recommended Posts

I was trying to export camera from maya (via alembic), that camera had camera scaled value of 1.5. Then i discovered in Houdini that camera got exported with wrong camera scale, as in render from the cam in houdini wasn't matching the render in maya. Then i re-exported the cam, this time with camera scale value on 1/1.5(i.e 0.666) and the render in houdini was matching with render render from maya with camera scale of 1.5.

 

My problem got fixed, but just wanted to know if this is standard thing with alembic or just my file? 

Share this post


Link to post
Share on other sites

I would try to avoid ever scaling a camera, houdini tries to help you out with this by default by hiding any scale parameters and only letting you change the icon size, however if you do have a bad export from maya where the camera is scaled it will definitely mess up your renders. this can be fixed rather easily with a chop network and a fresh camera.

 

-Create a new camera, lets say its called 'happy_cam'

-Create a Chop Network

--in chops--

-create an object node

-Set the target object to the alembic camera (The geo node inside the alembic subnet)

-Set compute to Full transform

-Create an export node and connect the output of the object node to the left input of the export node

-Set the 'Node' parm on the export node to point to 'happy_cam' (The new fresh camera we created)

-Set path to: tx ty tz rx ry rz

-Now happy_cam is happy

 

:D

 

Hope this helped

 

-Nathan

Share this post


Link to post
Share on other sites

Hey Nathan,

I tried your method to extract motion from an alembic camera, but when I set the target object in chops with compute full transform, the motion view show flat curves, while my object is translating/rotating. 
It works fine with objects that I have transformed/animated in Houdini with keyframes, but I can't get it to work with alembic cameras...
Any idea what could be wrong ?

Share this post


Link to post
Share on other sites

Did you set the channel range to use full animation range? for a camera I also use a fetch node to grab attributes from the alembic for: resx resy fstop focus aspect aperture focal, but a standard object node, pointed at the camera transform in the target object and set to compute transform with the channel range set to full animation should give you you're curves. 

 

If you can post your file and alembic camera I'll look at it.

 

-N

Share this post


Link to post
Share on other sites

Another thing to note, as I'm sure you and many others have noticed, is that sometimes chops decides to not cook, if you make this python code into a shelf tool it will force cook whatever node or subnetwork you select:

 

nodes = hou.selectedNodes()
cookNodes = []
for node in nodes:
    cookNodes.append(node)
    for child in node.allSubChildren():
        cookNodes.append(child)
for x in cookNodes:
    x.cook(force=True)

Share this post


Link to post
Share on other sites

Hey Nathan, thanks for your replies. 
Here are my hip and abc files.

alembic_to_cam.hip

cam.abc

By the way, in this hip, the range is not set to full animation.  If I set it to full range I correctly see my curves, but they don't seem to get transferred to my camera.

Edited by br1

Share this post


Link to post
Share on other sites

quick update, it seems to work if I put these expressions in the camera translate and rotate :

chop("../chopnet1/object1/tx"),chop("../chopnet1/object1/ty"),chop("../chopnet1/object1/tz").. etc ...
So I guess I do something wrong trying to export from the chop to the camera.

Share this post


Link to post
Share on other sites

if you don´t like the CHOP route (the cleanest for HDAs but not necesarily for "manual" fixes) I do a similar thing with a simple Blend Node at OBJ level.

Let´s say I´m using the classic "parent to a Master null" to scale a full scene.

 

-You have one MASTER Null and the "sad camera" and any other geometry/lights parented to it (I like this new happy/sad terminology we just came up with) .

-Connect a Blend node to (under) the "sad camera" and a "happy camera" to the Blend

- On the Blend OBJ Mask1 parameter UNcheck the three scale buttons (SX,SY,SZ)

- Now you can freely scale your scene from your MASTER and render with your happy camera without any fears. Scaled cameras are well know to show render problems, specially with voxels involved.

 

Edited by Netvudu

Share this post


Link to post
Share on other sites
On 4/19/2016 at 1:33 AM, br1 said:

Hey Nathan, thanks for your replies. 
Here are my hip and abc files.

alembic_to_cam.hip

cam.abc

By the way, in this hip, the range is not set to full animation.  If I set it to full range I correctly see my curves, but they don't seem to get transferred to my camera.

Hey Bruno, you set it up correctly, you just didn't have the export flag ticked on the export node :P (The orange one) Tick that on and it will override the channels of the camera node you are pointing to.

Edited by narbuckl

Share this post


Link to post
Share on other sites
On 4/19/2016 at 9:54 AM, michael said:

you should really check out the Alembic extension functions 

http://www.sidefx.com/docs/houdini15.0/hom/abc_extensions

Thanks Michael, I know the alembic python functions could accomplish what we are setting out to do as well, however when it comes to read speed, debugging and stability, I've found that having a system to create something clean from within houdini and transfer information one part at a time in a way that allows you to lock or bake the data seems to work better, or allow for a more thorough debug if there is a problem. For example, at our studio i've created a camera import hda that grabs the alembic camera and constructs clean curves regardless the scene scale parameters (since more often then not layout or animation artists will scale the camera, simply to achieve something faster, not understanding the problems that it can cause in an export to another department). 

I completely see your point though, the functions within the alembic extensions module can definitely access and control the same attributes. 

 

-N

Share this post


Link to post
Share on other sites

yeah - some kind of camera import system is essential

I'm a fan of building a camera rig - that way people can animate etc on top of what the incoming data gives...

Share this post


Link to post
Share on other sites
Guest tar
7 hours ago, michael said:

I'm a fan of building a camera rig - that way people can animate etc on top of what the incoming data gives...

It would be very cool to get this camera rig into H16, maybe as an example in the help files.

Share this post


Link to post
Share on other sites
On 4/20/2016 at 9:03 PM, narbuckl said:

Hey Bruno, you set it up correctly, you just didn't have the export flag ticked on the export node :P (The orange one) Tick that on and it will override the channels of the camera node you are pointing to.

Ah, ok Nathan... shows my current level in Chops ! I works much better indeed with export toggled ! Thanks !

Share this post


Link to post
Share on other sites
On 4/21/2016 at 9:42 PM, marty said:

It would be very cool to get this camera rig into H16, maybe as an example in the help files.

yeah, i think the alembic import file menu has a lot of people instantly going down the absolutely wrong route for utilizing alembic files in houdini.  it's 1000% better to use a camera rig than to import a camera into your file.  same with geometry -- the alembic sop is generally more useful than importing.  the alembic xform node can pull matrices right from the abc file.  wrapping up all these in a better suite of tools would make alembics way more useful than they might appear to people using the import menu.

also, they should expose some means to unload an abc file.  right now, you can crash houdini by overwriting the abc (or it'll be locked if on windows).  you have to quit houdini or jump thru some cache clearing hoops to release it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×