change Renderable Camera ?

897 views
Skip to first unread message

Nitin Singh

unread,
Feb 10, 2018, 11:01:58 AM2/10/18
to Python Programming for Autodesk Maya
Hi Guys,

I am looking to change Renderable camera in with Python. I tried all I can but failed finding a command for doing so. Can someone please tell the quick way for doing so.



thanks
nitin
Auto Generated Inline Image 1

AK Eric

unread,
Feb 10, 2018, 12:26:25 PM2/10/18
to Python Programming for Autodesk Maya
When I can't figure these out, I save one version of the file as an ma, then make the change and save a different version as an ma, then diff the files:  This usually exposes the setAttr line that does the change, and you'er good to go.

Chris Gardner

unread,
Feb 10, 2018, 3:08:04 PM2/10/18
to Python Programming for Autodesk Maya
Hi there,

Look for an attribute on each camera called “renderable” ( I think - not in front of maya atm). 

Like so many things in renderglobals, those controls aren’t doing what you think....

Cheers,
Chrisg


From: python_in...@googlegroups.com <python_in...@googlegroups.com> on behalf of Nitin Singh <nitinc...@gmail.com>
Sent: Sunday, February 11, 2018 3:01:57 AM
To: Python Programming for Autodesk Maya
Subject: [Maya-Python] change Renderable Camera ?
 
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/2c6e931d-f087-4a49-aa84-8cd146c10d9f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

nitin singh

unread,
Feb 15, 2018, 4:00:42 AM2/15/18
to python_in...@googlegroups.com
If anybody comes over looking for solution than here it is.

cmds.setAttr("frontShape.renderable", False)
cmds.setAttr("perspShape.renderable", False)
cmds.setAttr("sideShape.renderable", False)
cmds.setAttr("topShape.renderable", False)
cmds.setAttr('light_cameraShape.renderable', True)

On Sun, Feb 11, 2018 at 6:07 AM, Chris Gardner <chrisg....@gmail.com> wrote:
Hi there,

Look for an attribute on each camera called “renderable” ( I think - not in front of maya atm). 

Like so many things in renderglobals, those controls aren’t doing what you think....

Cheers,
Chrisg



Sent: Sunday, February 11, 2018 3:01:57 AM
To: Python Programming for Autodesk Maya
Subject: [Maya-Python] change Renderable Camera ?
Hi Guys,

I am looking to change Renderable camera in with Python. I tried all I can but failed finding a command for doing so. Can someone please tell the quick way for doing so.



thanks
nitin

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/RDswOKvqz4I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/BY1PR03MB13728EC13D40A16A94C6BACAFDF10%40BY1PR03MB1372.namprd03.prod.outlook.com.

ablayebald...@gmail.com

unread,
Feb 26, 2018, 9:10:16 PM2/26/18
to Python Programming for Autodesk Maya
Le samedi 10 février 2018 16:01:58 UTC, Nitin Singh a écrit :
> Hi Guys,
>
> I am looking to change Renderable camera in with Python. I tried all I can but failed finding a command for doing so. Can someone please tell the quick way for doing so.
>
>
>
> thanks
> nitin

Nitin Singh

unread,
Mar 5, 2018, 5:03:43 AM3/5/18
to Python Programming for Autodesk Maya
to switch your camera in render setting you need to first turn off other cameras renderable option and then set the same renderable option ON for the camera you want to set in maya render settings window.

# turning off on default maya cameras
cmds.setAttr("frontShape.renderable", False)
cmds.setAttr("perspShape.renderable", False)
cmds.setAttr("sideShape.renderable", False)
cmds.setAttr("topShape.renderable", False)

# turning on the camera which I want to set in maya render settings. You need  camera shape node.

cmds.setAttr('light_cameraShape.renderable', True)
Reply all
Reply to author
Forward
0 new messages