PDA

View Full Version : .chan export from camera motion



cyphyr
11-30-2008, 09:01 AM
I'm trying to create a .chan file which can be naively output from Maya and Nuke, (both of which I don't have:() for inporting into Terragen 2. Terragen 2's animation tool set is very limited and relies on importing a .chan motion file to get complex movement into the scene.

The .chan format goes thus: x y z h p b scalex scaley scalez fov (I think, please correct me if I'm wrong) space separated on a frame by frame basis. All this info is visible on a frame by frame basis in the bottom left info box but I cant seem to get the info through the .scn file or the .mot file. I've even key-framed each and every frame but I guess I must be mising something. For a 15sec anim I would have to copy out 2700 numbers and add in the scalex scaley scalez fov (these will remain constant), far too much trouble and the possibility of creating errors is huge.

Any ideas how I can get at this data, just as a simple text file would do? I can re-format the data easily enough.

cyphyr

MooseDog
11-30-2008, 09:14 AM
i've wanted to do this as well. if i had even the foggiest notion of how to write something with lscript, i think it would be very possible. i know folks have used lscript to write to external files before, so it's possible.

frame x y z p h b fov

is what would be printed to each line, space delimited should any lscript capable 'waver wander through here :).

evolross
01-18-2012, 01:07 PM
Was searching the forums for a way to do this too.

MentalFish wrote an lscript that does exactly this:
http://mentalfish.com/2009/12/lw-2-nk/

Apparently you can also use FBX and COLLADA to get your camera and object nulls into Nuke, but I haven't tried those methods. I just needed the camera and the above script works awesome.

I use Nuke's 3D camera node to easily generate motion blur in comp. You do this by running the camera node output into a MotionBlur3D node into a VectorBlur node. Then plug your footage into the other input on the MotionBlur3D node, adjust the distance and multiply inputs on the two nodes and BLAM!, instant in-comp motion blur.

NOTE: This method only blurs objects relative to camera movement. If your objects move too, you'll need motion vector passes for them as well. You can do the same trick if you track a VFX plate in Synth Eyes (or other program). Just export a Nuke camera and use the same above node setup and you'll instantly get camera-relative motion blur. It's great for shots with still or barely-moving objects.

stiff paper
01-18-2012, 01:30 PM
Petter Sundnes on Vimeo:
http://vimeo.com/mentalfish/videos/sort:date
He has instructional vids there for a lot of his lscripts, including his .chan import/export.

evolross
02-08-2012, 04:17 PM
As a follow up, the MentalFish script works, but it seems to not export focal length information when using it on a camera. Which is important if you have keyframed your focal length in the graph editor with smooth curves. Hmm... still currently looking for a way to bring my LW camera into Nuke with full translation, rotation, and FOV.

I haven't been able to get FBX or COLLADA to work yet. Using LW10.1.