Resolution scale in mantra with python

   3575   4   2
User Avatar
Member
257 posts
Joined: Nov. 2010
Offline
May I ask which command to set the resolution scale in mantra?

Been using set() and setExpression() up until i came across a menu parameter, I tried menuType and menuParmTemplate which are probably not it. Any hints?

eitht.
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
You are talking about the image resolution right?

If so, there are a couple ways off the top of my head:

1. Set the final resolution using the Render Properties.
Simply enable the override_camerares “Override Camera Resolution” toggle on the Output driver which will expose the resolution override parameters.
Then set the res_overridex and res_overridey parameters to your desired resolution.

2. Set the final resolution from the Mantra command line.
You can use the following Mantra Command line option to change the image resolution in the Main tab of the output driver:
mantra -I resolution=1280x1024
This will force mantra to render with this given resolution.
There's at least one school like the old school!
User Avatar
Member
257 posts
Joined: Nov. 2010
Offline
Yes, my bad for not being clear - i'm creating a tool using python, i am able to enable “override camera resolution” but both pieces of code below doesn't change “resolution scale” to 1/2 resolution.

The tool didn't prompt any error message when executed.

Thank you for replying, 2. was useful for me!

resFract = mantra.parm(“res_fraction”)
resFract.set(“0.5”)

or

resFract = mantra.parm(“res_fraction”).set(“0.5”)


eitht.

Attachments:
mantra_res_scale.png (18.2 KB)

User Avatar
Member
257 posts
Joined: Nov. 2010
Offline
The tool is working fine now after switching to a different workstation from last night, curious why this is happening!

eitht.
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Very bizarre but glad it's working.
There's at least one school like the old school!
  • Quick Links