Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Reynish <billrey@me.com>2019-09-04 19:37:33 +0300
committerWilliam Reynish <billrey@me.com>2019-09-04 19:37:33 +0300
commit82fc9d778eecca16f867fd6e3aa3a2c04d86df4a (patch)
tree2f0764d10461f5a32d6db9348b13f8a17c1468a0 /release
parent23564583a4988778b4c43496fd21818b286f6ba1 (diff)
UI: Add Dimensions to Object Transform panel
This makes the Transform panel complete, so you don't need to open the Sidebar for such a basic concept. Differential Revision: https://developer.blender.org/D5577 Reviewers: Brecht, Pablo Vazquez
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/properties_object.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index d2ba047e07e..9d9436f28d7 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -97,6 +97,26 @@ class OBJECT_PT_transform(ObjectButtonsPanel, Panel):
row.prop(ob, "lock_scale", text="", emboss=False, icon='DECORATE_UNLOCKED')
+class OBJECT_PT_transform_dimensions(ObjectButtonsPanel, Panel):
+ bl_label = "Dimensions"
+ bl_parent_id = "OBJECT_PT_transform"
+ bl_options = {'DEFAULT_CLOSED'}
+
+ @classmethod
+ def poll(cls, context):
+ ob = context.object
+ obj_type = ob.type
+ return obj_type in {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT', 'ARMATURE', 'LATTICE'}
+
+ def draw(self, context):
+ layout = self.layout
+ layout.use_property_split = True
+
+ ob = context.object
+
+ layout.prop(ob, "dimensions", text=" ")
+
+
class OBJECT_PT_delta_transform(ObjectButtonsPanel, Panel):
bl_label = "Delta Transform"
bl_parent_id = "OBJECT_PT_transform"
@@ -407,6 +427,7 @@ class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel, Panel):
classes = (
OBJECT_PT_context_object,
OBJECT_PT_transform,
+ OBJECT_PT_transform_dimensions,
OBJECT_PT_delta_transform,
OBJECT_PT_relations,
COLLECTION_MT_context_menu,