Smooth Camera Morphing

   1241   7   2
User Avatar
Member
4 posts
Joined: Dec. 2009
Offline
I have a scene where there are many baked ( unalterable ) animated cameras. I want to create a new camera that can smoothly morph between the already existing cameras. There also needs to be a way to weight a specific cameras influence on the resulting morph. Cinema4D's Camera Morph tag is similar to what I'm trying to achieve.

I've tried the Blend node, but it only does PSR blending. I need to blend the focal length too.

I've also tried with expressions. But it quickly becomes unmanageable with so much code on a single line for each PSR component and focal length. And I don't think its possible to make it dynamic enough to accept an arbitrary number of cameras.

Would it be possible to create a new custom camera node that allows you to specify other cameras to blend its attributes between? The interface would be similar to the Blend Shapes SOP where you can animate the weights of individual cameras.

If this is possible could I get some pointers on how to do it? I'm just not sure where to start. Thanks.
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Maybe you could use chops to read in all the cameras and create a new one that uses the chop data

Rob
Edited by circusmonkey - July 7, 2016 22:16:48
Gone fishing
User Avatar
Staff
2638 posts
Joined: July 2005
Offline
yep - CHOPs is your friend for this kind of thing.
Michael Goldfarb | www.odforce.net
Senior Technical Director
SideFX
www.sidefx.com
User Avatar
Member
4 posts
Joined: Dec. 2009
Offline
Thanks Rob and Michael,

I've made some headway with CHOPs, but I'm running into some roadblocks.

I started off with just a simple Switch CHOP which essentially recreates the Camera Switcher object. It works, but doesn't blend between cameras obviously.

I figured a VOP CHOP network would be best to do the blending. But I can't get it to work with objects/channels that are animated.

Also, I got the Fetch CHOP to bring in all camera channels using a glob. But I couldn't really find any material on how to use channels in this combined fashion.

I've attached an annotated project that shows where I'm currently at. Any more pointers with this would be greatly appreciated. Thanks again.
Edited by fusepilot - July 8, 2016 03:34:24

Attachments:
camera_morph.hiplc (154.1 KB)

User Avatar
Member
113 posts
Joined: April 2009
Offline
You can either use the blend chop with weight channels or the interpolate chop + filter chop if you simply want to blend them all without control. Both “morph” between all the channels you fetch ( e.g. transform, rotation and focal ).
Edited by blackpixel - July 8, 2016 05:54:00

Attachments:
camera_blend.hip (173.4 KB)

Mariusz Wesierski
User Avatar
Member
4 posts
Joined: Dec. 2009
Offline
Thanks Mariusz!

This is excellent. I've learned a lot about chops by going through your project.

I was able to change fetch_weight's channels to just “weight*”. Is there a way to have the blend accept a single fetch with globbing, e.g. “/obj/source_cam_*”, instead of having to set up one fetch per camera? Then I think adding more cameras would just a be a matter of adding more weight* parameters to cam_blended and following the source_cam_* naming convention.

Also, some of the baked cameras have parents. I failed to mention that earlier as I didn't realize then that it would be an issue. So is there a way to send chops the world coordinates instead of its local coordinates?

Thanks again!

User Avatar
Member
230 posts
Joined: June 2014
Offline
@fusepilot, thanks for that last question about globbing, I had never thought of that and as it turns out the fetch CHOP will accept a globbing pattern in the ‘node’ parameter!

You may have discovered that already yourself, oooof, I'm slightly worried how excited I am about finding that out…

The Pre-Transform bit is a little trickier. Would the parenting actually pose a problem though in this instance? If you're blending ‘pose to pose’ so to speak, do you need the world-space transform?

EDIT: sorry, you didn't actually say anything about pre-transforms, just my own internal tranlator
Edited by friedasparagus - July 9, 2016 05:10:43
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Hi, If some cameras are parented all you need to do is use a Fetch SOP > tunnel in to the camera shape location , after that drop a blend SOP , and turn off scaling ( if your using a scaled camera.) Attach your new camera and grab the focal parameters etc . Then you can get all your cameras into chops.

I use the above technique all the time with abc cameras.

Rob

Gone fishing
  • Quick Links