mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #3381 from pypeclub/vrayDeviceAspectFix
Maya: vray device aspect ratio fix
This commit is contained in:
commit
3178b4bfb9
1 changed files with 4 additions and 1 deletions
|
|
@ -2126,9 +2126,11 @@ def set_scene_resolution(width, height, pixelAspect):
|
|||
|
||||
control_node = "defaultResolution"
|
||||
current_renderer = cmds.getAttr("defaultRenderGlobals.currentRenderer")
|
||||
aspect_ratio_attr = "deviceAspectRatio"
|
||||
|
||||
# Give VRay a helping hand as it is slightly different from the rest
|
||||
if current_renderer == "vray":
|
||||
aspect_ratio_attr = "aspectRatio"
|
||||
vray_node = "vraySettings"
|
||||
if cmds.objExists(vray_node):
|
||||
control_node = vray_node
|
||||
|
|
@ -2141,7 +2143,8 @@ def set_scene_resolution(width, height, pixelAspect):
|
|||
cmds.setAttr("%s.height" % control_node, height)
|
||||
|
||||
deviceAspectRatio = ((float(width) / float(height)) * float(pixelAspect))
|
||||
cmds.setAttr("%s.deviceAspectRatio" % control_node, deviceAspectRatio)
|
||||
cmds.setAttr(
|
||||
"{}.{}".format(control_node, aspect_ratio_attr), deviceAspectRatio)
|
||||
cmds.setAttr("%s.pixelAspect" % control_node, pixelAspect)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue