dimanche 29 novembre 2015

Unlimited Camera Transition



http://www.nukepedia.com/gizmos/3d/fusioncam

This is actually the first interesting script I've done in nuke.
I wanted to improve the common expression used to make a camera transition :

1-sliderValue*Camera1.translate + sliderValue*Camera2.translate

In order to use it with an unlimited amount of camera, I modified a switch node : easy way to have an unlimited number of input branches.

Then the expression goes like this (gizmo is the created switch node) :

(1 - sliderValue - int(sliderValue)) * gizmo.input(int(sliderValue)).translate +
(sliderValue - int(sliderValue)) * gizmo.input(int(sliderValue) + 1).translate

Substracting the sliderValue converted in int conforms the sliderValue between 0 and 1, then the expression works the same but instead of Camera1 and Camera2, we have Camera(int(sliderValue)) et Camera(int(sliderValue) + 1) 

This expression doesn't work when sliderValue = int(sliderValue) so I had to add an exception :
if sliderValue == int(sliderValue) : gizmo.input(int(sliderValue)).translate

I'm not using the real nuke tcl syntax in order to explain it. You can find the full expression in the gizmo.

If you have any trouble installing, using or understanding this tool, please ask. I'll be very happy to help !

2 commentaires:

  1. I have problems with this script. The resulting motion camera looks randomly, especially when the values are integers. Almost always the camera one frame jumps into one of the positions. And there is a feeling that the frame is pretty random

    RépondreSupprimer
  2. Hello !

    Thx for you comment.
    The tcl expressions can be a bit random sometime... It's not refreshing super smoothly. Are you using nuke 8 ? It can be better with nuke 9.

    Baking the animation can also be a solution ! :)
    Let me know how it goes :)

    RépondreSupprimer