Go to: Synopsis. Return value. Keywords. Flags. Python examples.

Synopsis

mayaDpiSetting([mode=uint], [realScaleValue=boolean], [scaleValue=float], [systemDpi=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

mayaDpiSetting is NOT undoable, queryable, and NOT editable.

Provide Maya interface scaling based on system DPI or custom scale setting or no scaling. Please note that the change will only take effect after relaunching Maya.

Return value

string[]

In query mode, return type is based on queried flag.

Keywords

mayaDpiSetting, dpi

Flags

mode, realScaleValue, scaleValue, systemDpi
Long name (short name) Argument types Properties
mode(m) uint createquery
Specifies the interface scaling mode:
  • 0 - System Dpi Based Scaling
  • 1 - Custom Scaling (Must provide the custom scale value with flag "-scaleValue")
  • 2 - No Scaling
realScaleValue(rsv) boolean query
This is a query mode only flag which returns the real scale value depending on current scaling mode and defined scale value:
  • mode 0 - Return the current real scale value which is the ratio of current system dpi to default system dpi
  • mode 1 - Return the current real scale value which is the product of the defined scale value and the ratio of current system dpi to default system dpi
  • mode 2 - Always return 1.0 which indicates real scale is 100% when the scaling mode is no scaling.
scaleValue(sv) float createquery
Specifies the custom scale of the interface if scaling mode is 1. The allowed values are [1.0, 1.25, 1.5, 2.0]. In query mode, return the scale value depend on current scaling mode:
  • mode 0 - Always return 1.0 which indicates 100% scaling
  • mode 1 - Return the custom scale value used
  • mode 2 - Always return 1.0 which indicates no custom scaling
systemDpi(sd) boolean query
This is a query mode only flag which returns the current system dpi value.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

# Set the scale mode to system dpi based scaling.
cmds.mayaDpiSetting( mode=0 )
# Set the interface scaling to 150% custom scaling.
cmds.mayaDpiSetting( mode=1, scaleValue=1.5 )
# Disable the interface scaling.
cmds.mayaDpiSetting( mode=2 )
# Query the current scaling mode.
cmds.mayaDpiSetting( query=True, mode=True )
# Query the current scale value.
cmds.mayaDpiSetting( query=True, scaleValue=True )
# Query the system dpi value.
cmds.mayaDpiSetting( query=True, systemDpi=True )
# Query the current real scale value.
cmds.mayaDpiSetting( query=True, realScaleValue=True )