Camera shake inputed from the mouse

Hello everybody.

I was asked at my job if it´s possible to have a camera shake inputed from the mouse movement and record this to timeline inside Maya?

Anyone have any idea about where do I start or a path to follow?

I´m starting right now to search for informations about this, and if I find something I´ll post here too.

Thank you guys.

Cya.

Hey Sergio,

This might not be the best solution, but at least the first solution that struck my mind. Although I didn’t get it to work exactly how it first was intended. (freezes playback during drag)

If you don’t like the result maybe it at least can work as a push in one possible direction.

You would also probably want to constrain a camera aim to something to make it a bit more interesting than just translations.

Anyways, run the script and it will let you drag/click during playback a new keyed position for the selected camera.
Remove last line if you want to start playback manually.

global proc myContextDrag()
{
    string $selCamera[] = `ls -sl`;
    float $pos[] = `draggerContext -q -dragPoint myContext`;
    print ("DragPos: " + $pos[0] + " " + $pos[1] + " " + $pos[2] + "
");
    move $pos[0] $pos[1] $pos[2] $selCamera;
    setKeyframe ($selCamera[0] + ".tx");
    setKeyframe ($selCamera[0] + ".ty");
    setKeyframe ($selCamera[0] + ".tz");
}

if (`draggerContext -exists myContext`)
    deleteUI myContext;

    draggerContext -cursor "hand"
                   -dragCommand "myContextDrag"
                   -space "world"
                   myContext;

    setToolTo myContext;
    changeToolIcon;
    
playButtonForward;

Have fun : )

Hello Emil, thank you for the answer.

I´m just starting my adventures in the RnD, and I have just a little knowledge of programing.

I´ll look at your code and try to understand all that you used, for sure you already helped me. I was having dificulty to find what to use.

Any news I´ll post here.

Thanks again!

Cya.