PDA

View Full Version : expression not working on camera zoom channel



stib
09-25-2006, 01:37 AM
I was doing the old move-the-camera-back-while-zooming-in trick, and I was going to use an expression on the zoom factor channel to do it all automatically, but it didn't seem to work. No matter what the result of the expression (it even graphed properly in the graph editor) the zoom factor just followed the keyframes and the keyframes only. Just me, or a bug?

meshpig
09-25-2006, 03:01 AM
Stib

-you don't need an expression, just graph the focal length/zoom and camera position.

-You can also get some nasty kind of video artifacts where the zoom/camera position shift scale meets the rendered frame-rate: Depending on the length of the scene and the distances involved, you should go 30 fps to begin with.

Check it out because you may need to go 30+ fps.

-What happens is that for every increment of enveloped zoom to reverse camera motion there is a point where you might have a frame deficit- where the assigned vectors cancel each other out sort of thing. Where you have the zoom length and the camera coordinates occupying the same position in the same frame.

This sort of thing looks like pile of S**t. Especially if you exporting to a lower frame rate.



M:)

dpont
09-25-2006, 05:29 AM
I was doing the old move-the-camera-back-while-zooming-in trick, and I was going to use an expression on the zoom factor channel to do it all automatically, but it didn't seem to work...

Don't know if you are speaking of the same zoom expression,
but the expression I'm using is relative to a reference object,
may be this object has been removed or replaced and
its name has not been updated in the expression.
Hope that help.

Denis.

stib
09-25-2006, 05:50 AM
meshpig: not quite sure what you're talking about there. I render at 25fps because I'm outputting PAL, nutting I can do about that except get some clients from NTSC land. I can't quite see why doing it with a keyframe is going to produce different results than with an expression. It's not the effect that I'm having trouble with, it's just the strange behaviour of the camera. I like using expressions where I can, I'd rather the computer do the number crunching than have to rely on my brain. It means that if I move the camera somewhere else in the scene I don't have to remember and recaculate each keyframe.

Denis: thanks for the tip, but the expression is just one I made myself. The weird thing was that in the graph editor it graphed out the channel for the focal length as it should have been according to my expression, but the actual focal length didn't follow the graphed line, only the keyframes.

dpont
09-25-2006, 07:04 AM
Expressions work only with evaluated keyed envelope,
so if you move your Camera, the expression is still
evaluating the envelope, not the camera moved by
user in the layout.
To see the expression result, you should only move
the cursor on the time line.

Denis.

stib
09-25-2006, 07:33 AM
I don't think you understand what I'm saying. I've got a keyed envelope on the camera movement, and it tracks the distance to a null and uses that to determine the zoom factor. All really simple stuff, I didn't even use trigonometry, just made some observations and used a multiplier.

So the expression was something like
vmag([Camera.Position]-[interest.Position])*0.10
Now this expression works fine if I apply it to any other channels: does exactly what you'd expect it to do. But when I apply it to the zoom factor channel on a camera it doesn't. In fact no expression works on the camera zoom factor.

To test it, I tried out something that has nothing to do with any keys or objects like
sin(Time)which shoudl have produced a stomach-churning in-and-out zoom effect. In the graph editor the zoom factor channel is forming a nice sine wave as you'd expect, but looking through the camera.. nada.

I think it's a bug.

dpont
09-25-2006, 08:01 AM
(Sorry, was in 8.5)
Confirmed, in fact, expression is not really applied,
if you save your scene and reload it, expression
is no more attached to the zoom channel,
It is a 9.0 bug, this doesn't occur in 8.5.

Denis.

Phil
09-25-2006, 08:19 AM
Relativity might be your friend here, unless they *really* broke things. Check the channel modifier dropdown under 9.0 for the channel modifier plugin.

Relativity stomps all over LW's expression system. I long for the day that they deprecate the inbuilt expressions to a legacy system.

stib
09-25-2006, 08:47 AM
Oh good, looks like I'm going to be forced to find out about relativity. That's a good thing.

dpont
09-25-2006, 09:33 AM
If you have applied a zoomfactor expression in 8.5,
it works in 9.0, but you can't remove it,
it seems this was broken when they add the multi camera
system, since they must access to the same envelope.

ZoomFactor (envelope)
{ Envelope
1
Key 0 0 0 0 0 0 0 0 0
Behaviors 1 1
//Here are the missing line, that you could add in the scene file///
{ ChannelHandler
".EnvExprLink"
0
1
"Expr 1"//Name of your expression described at the end of the scene
}
/////////////////////////
}

Denis.

Phil
09-25-2006, 09:54 AM
Wow. Now that's just braindead. Way to go, NewTek! Hopefully Relativity will help; it's definitely worth learning (not hard, really; I couldn't tell if stib was unimpressed with the suggestion :D)

dpont
09-25-2006, 10:40 AM
If you add your simple expression in Relativity Channeler,
"sin(t)" to Camera.ZoomFactor, this still doesn't work,
you need to add it to Camera..ZoomLegacyFactor
envelope, it is hidden in Graph Editor, but this is the envelope
Lightwave use to store zoomfactor for multi-Cameras.

Denis.

Jarno
09-25-2006, 02:05 PM
It turns out that this is due to a more general problem: expressions aren't copied when an envelope is copied.

---JvdL---

meshpig
09-26-2006, 01:08 AM
Sorry Stib, misread your question!

M

stib
09-26-2006, 08:22 AM
no worries mate. Hey, what are you doing rendering in 30fps? You should be Doing PAL renders too..

meshpig
09-27-2006, 12:58 AM
Thanks Stib!

-My camera is NTSC so I use 30 whenever... Don't do a lot of that these days anyway since I'm losing my eyesight slowly due to some exceeding rare genetic disorder.

No big deal: I'm so happy that I can still work... I'd be having a hard time drawing without CGI as it is!

-Hopefully will pull a few games together before I have to do something else.

:) M