Community
Arnold for 3ds Max
Rendering with Arnold in 3ds Max using the MaxtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Query the camera about to be rendered

5 REPLIES 5
Reply
Message 1 of 6
forrest.brent
251 Views, 5 Replies

Query the camera about to be rendered

I've been scouring the internet for days trying to find the answer to this. To be clear, I don't need the list of renderable cameras, I need the camera which is about to be rendered - and I need to find it in batch mode for a prerender script. Can anyone help me with this? I'd really appreciate it.

Cheers

Tags (3)
Labels (3)
5 REPLIES 5
Message 2 of 6

What do you need to do?

I'm not seeing a way to get the camera pre-render. If there's multiple renderable cameras, the MtoA render command is looping over those and updating the in-memory Arnold scene representation, and that's not pre-render.



// Stephen Blair
// Arnold Renderer Support
Message 3 of 6

There is the Post Translation callback (Render Settings > System tab > Render Settings > Callbacks)

In that callback, you could get the camera using the Arnold API in Python.




// Stephen Blair
// Arnold Renderer Support
Message 4 of 6

I need to get the focal length of the camera and pipe it through a node network which drives the line thickness of aiToon shaders. If there's a way to do this without a direct connection (like the way you get the distance with an attribute called "R") i am all for it.

For pipeline reasons, After the render the node network needs to disconnect from the camera.

You mention using the Arnold api to get the camera. Could you give me one or two more guiding hints? I should mention that while I'm decent with python I'm retarded when it comes to Arnold and doubly so when it comes to rendering.


Message 5 of 6

Hmm, the thing is you won't get the focal length from the Arnold scene. The camera will have an fov value calculated from the focal length and other parameters in the Maya scene.

The python would be something like this

from arnold import *
o = AiNodeLookUpByName('options')
cam = AiNodeGetPtr( o, "camera" )
print AiNodeGetStr( cam, "name" )

https://arnoldsupport.com/2015/03/04/arnold-getting-started-with-the-arnold-python-api/



// Stephen Blair
// Arnold Renderer Support
Message 6 of 6

Thank you. I will give this a try when I get back to work on Monday. Where did you learn the Arnold python api?

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

Post to forums  

Autodesk Design & Make Report