mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
using metric types when the unit type enabled instead of using metric types
This commit is contained in:
parent
0734682faa
commit
e578432014
4 changed files with 7 additions and 14 deletions
|
|
@ -302,8 +302,10 @@ def reset_unit_scale():
|
|||
scene_scale = settings.get("unit_scale_settings",
|
||||
{}).get("scene_unit_scale")
|
||||
if scene_scale:
|
||||
rt.units.SystemType = rt.Name(scene_scale)
|
||||
|
||||
rt.units.DisplayType = rt.Name("Metric")
|
||||
rt.units.MetricType = rt.Name(scene_scale)
|
||||
else:
|
||||
rt.units.DisplayType = rt.Name("Generic")
|
||||
|
||||
def convert_unit_scale():
|
||||
"""Convert system unit scale in 3dsMax
|
||||
|
|
@ -313,15 +315,12 @@ def convert_unit_scale():
|
|||
str: unit scale
|
||||
"""
|
||||
unit_scale_dict = {
|
||||
"inches": "in",
|
||||
"feet": "ft",
|
||||
"miles": "mi",
|
||||
"millimeters": "mm",
|
||||
"centimeters": "cm",
|
||||
"meters": "m",
|
||||
"kilometers": "km"
|
||||
}
|
||||
current_unit_scale = rt.Execute("units.SystemType as string")
|
||||
current_unit_scale = rt.Execute("units.MetricType as string")
|
||||
return unit_scale_dict[current_unit_scale]
|
||||
|
||||
def set_context_setting():
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"unit_scale_settings": {
|
||||
"enabled": true,
|
||||
"scene_unit_scale": "Inches"
|
||||
"scene_unit_scale": "Meters"
|
||||
},
|
||||
"imageio": {
|
||||
"activate_host_color_management": true,
|
||||
|
|
|
|||
|
|
@ -25,9 +25,6 @@
|
|||
"multiselection": false,
|
||||
"defaults": "exr",
|
||||
"enum_items": [
|
||||
{"Inches": "in"},
|
||||
{"Feet": "ft"},
|
||||
{"Miles": "mi"},
|
||||
{"Millimeters": "mm"},
|
||||
{"Centimeters": "cm"},
|
||||
{"Meters": "m"},
|
||||
|
|
|
|||
|
|
@ -15,9 +15,6 @@ from .publishers import (
|
|||
def unit_scale_enum():
|
||||
"""Return enumerator for scene unit scale."""
|
||||
return [
|
||||
{"label": "in", "value": "Inches"},
|
||||
{"label": "ft", "value": "Feet"},
|
||||
{"label": "mi", "value": "Miles"},
|
||||
{"label": "mm", "value": "Millimeters"},
|
||||
{"label": "cm", "value": "Centimeters"},
|
||||
{"label": "m", "value": "Meters"},
|
||||
|
|
@ -74,7 +71,7 @@ class MaxSettings(BaseSettingsModel):
|
|||
DEFAULT_VALUES = {
|
||||
"unit_scale_settings": {
|
||||
"enabled": True,
|
||||
"scene_unit_scale": "cm"
|
||||
"scene_unit_scale": "m"
|
||||
},
|
||||
"RenderSettings": DEFAULT_RENDER_SETTINGS,
|
||||
"CreateReview": DEFAULT_CREATE_REVIEW_SETTINGS,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue