Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Exporting Camera (with Shake Enabled) possible?

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
nick.guth
5900 Views, 7 Replies

Exporting Camera (with Shake Enabled) possible?

Hi there. I've run into an issue trying to export a camera from Maya to Nuke. The camera inside Maya has "Shake" enabled and is running a MEL script like this:

 

camera_lay_v003Shape.horizontalShake = noise(frame/20)/1000;

cam_lay_v003Shape.verticalShake = noise(frame/15)/1000;

 

The problem is when I export the camera it seems to ignore the shake and the two do not line up. However, my renders from Maya DO include the shake. I've tried all sorts of things to get it to bake out properly, but nothing is working.

 

Any insight on how to export the camera properly with all the shake properties too? 

7 REPLIES 7
Message 2 of 8
sean.heasley
in reply to: nick.guth

Hi @nick.guth and welcome to the community!

 

This may be more of an issue on Nukes end but I found this video that may help!

 

 

Its a bit dated but please let me know if it helps or if you need any more assistance!

 

 

If one or more of these posts helped answer your question, please click Accept as Solution on the posts that helped you so others in the community can find them easily.

 

 

 

Kudos are greatly appreciated. Everyone likes a thumbs up!

 

 

Message 3 of 8
sean.heasley
in reply to: sean.heasley

Hi @nick.guth

 

I'm just checking in again to see if you need more help with this. Did the suggestion I provided yesterday work for you?

If so, please click Accept as Solution on the posts that helped you so others in the community can find them easily.

Message 4 of 8
nick.guth
in reply to: sean.heasley

The solution we came up with worked, but it has to do with both NUKE and MAYA. Here's what we did:

 

INSIDE MAYA

The default shake expressions are applied to a parameter called 'verticalShake' and 'horizontalShake'. Unfortunately, nuke can not read that. 

 

camera1Shape.verticalShake = noise(frame/15);

camera1Shape.horizontalShake = noise(frame/20);

 

However, it CAN read it if it's applied to the filmback (and the maya documentation explains these properties are identical in nature). So we copied those expressions and applied them to the film offset parameter in maya. 

 

camera1Shape.verticalFilmOffset = noise(frame/15);

camera1Shape.horizontalFilmOffset = noise(frame/20);

 

We then baked those two channels (and disabled the checkbox for Shake). Exported it out as FBX and brought it into nuke. 

 

INSIDE NUKE

Here is where things get a little tricky. Nuke and Maya use two different measurements (inches vs mm) for film backs as well as where it places the center of the offsets. Nuke uses NDC coordinates (-1 < 0 < +1) where the center of frame is 0 in both x&y. Maya does not.

 

To alleviate the issue we have to do a little math inside of nuke for the camera to match perfectly.

  1. Import the camera into nuke and uncheck 'read from file'.
  2. Create a 2D position user knob called 'mayaFilmOffset' and copy the values from U and V to this new knob.
  3. Then delete the U and V keyframes.
  4. Then apply this expression to the U & V window offset values.
    • U: (2/haperture)*(mayaFilmOffset.x*25.4)
    • (((root.format.h/root.format.w)*2)/vaperture)*(mayaFilmOffset.y*25.4)

Once all that is done the camera will match perfectly to the camera that was inside of Maya!

 

Message 5 of 8
spyder_f
in reply to: nick.guth

Hello,

 

This solution didn't solve the problem for me. I baked the camera, baked the channels, exported and nothing. And it's almost as if it's a fake channel bake, when I turn off the "shake enabled" attribute it still actually turns it off and the shake disappears. I'm using Maya 2020. Any more ideas?

Message 6 of 8
timdevlin.td
in reply to: spyder_f

Hi 

 

Just to say I have values in win_translate for both U & V in nuke after exporting as alembic from Maya, using film offset expression to achive camera shake. 

 

I haven't managed to achive the second bit though for exact match.

hope that helps.

cheers

Message 7 of 8
gdeind24
in reply to: nick.guth

Yes it is possible. The solution is within maya itself.

Step. 1 - select camera go to node editor. You can see vertical and horizontal shake there. Simply break the connections and take those node in free space so we can create new setup. Now uncheck/disable shake enable in camera attribute.

 

Step. 2 - crate a group on camera so we can transfer values on rotation x and y. (Make center pivot of the group)

 

Step 3 - create multiply devide node. Connect verticalshake output to multiply devide nodes input 1x, then connect horizontalshake output to inputY.

 

Step. 4 - connect multiply devide nodes output x to camera group (which we have created) rotateX and then connect another output y to rotateY. (It will create unit coversion node automatically).

 

Step. 5 last step. To multiply camera shake till you achieve the results. Click on multiply devide node. You will see attribute where you can put value to multiply. Type values in input 2 for multiplying vertical shake and input 2 y for multiplying horizontal shake. (In my case it was x = 42 and y = -39.) Note - refer first frame too match position. You can create image sequence before doing this process so later you can match the result by applying this in image plane...... Mail me if you need any help regarding this. At gdeind24@gmail.com

 

Message 8 of 8
timdevlin.td
in reply to: gdeind24

Thank you!
I'll check this out properly sometime.
Appreciate the indeeph answer.
Best,
Tim

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report