diff options
author | Jacques Lucke <mail@jlucke.com> | 2018-10-03 11:20:16 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2018-10-03 11:20:16 +0300 |
commit | 2d21eb79ad48485bc7b3385d6df5c2c25fd88ee0 (patch) | |
tree | 57d18e1020c8acc2d46110bd43c0721dc30b7d76 /release/scripts/startup/bl_ui/properties_scene.py | |
parent | 1c3411ac899d1ae8dfd790249a53054698bdd1e8 (diff) |
Units: Support for fixed units
Users can select the main unit they want to use now.
Previously the displayed unit always depended on the magnitude of the value.
The old behavior can be restored by switching to the "Adaptive" mode for length, mass and time units.
Meters, kilograms and seconds are the default units for new and old scenes.
The selected unit is also the default unit for user input.
E.g. if cm is selected, whenever the user inputs a unitless number into a field of type length, it will be interpreted as cm.
Reviewer: brecht
Differential: https://developer.blender.org/D3740
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_scene.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_scene.py | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py index 8e3bfd63726..2cabefe905e 100644 --- a/release/scripts/startup/bl_ui/properties_scene.py +++ b/release/scripts/startup/bl_ui/properties_scene.py @@ -33,14 +33,6 @@ from .properties_physics_common import ( ) -class SCENE_PT_units_length_presets(PresetMenu): - """Unit of measure for properties that use length values""" - bl_label = "Unit Presets" - preset_subdir = "units_length" - preset_operator = "script.execute_preset" - preset_add_operator = "scene.units_length_preset_add" - - class SCENE_UL_keying_set_paths(UIList): def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): # assert(isinstance(item, bpy.types.KeyingSetPath) @@ -84,9 +76,6 @@ class SCENE_PT_unit(SceneButtonsPanel, Panel): bl_label = "Units" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'} - def draw_header_preset(self, context): - SCENE_PT_units_length_presets.draw_panel_header(self.layout) - def draw(self, context): layout = self.layout @@ -95,17 +84,21 @@ class SCENE_PT_unit(SceneButtonsPanel, Panel): layout.use_property_split = True layout.use_property_decorate = False - flow = layout.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=True) - - col = flow.column() - col.prop(unit, "system") - col.prop(unit, "system_rotation") + layout.prop(unit, "system") - col = flow.column() + col = layout.column() col.enabled = unit.system != 'NONE' col.prop(unit, "scale_length") col.prop(unit, "use_separate") + col = layout.column() + col.prop(unit, "system_rotation", text="Rotation") + subcol = col.column() + subcol.enabled = unit.system != 'NONE' + subcol.prop(unit, "length_unit", text="Length") + subcol.prop(unit, "mass_unit", text="Mass") + subcol.prop(unit, "time_unit", text="Time") + class SceneKeyingSetsPanel: @@ -607,7 +600,6 @@ class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, Panel): classes = ( - SCENE_PT_units_length_presets, SCENE_UL_keying_set_paths, SCENE_PT_scene, SCENE_PT_unit, |