Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_object.py
| Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
| class OBJECT_PT_transform(ObjectButtonsPanel, Panel): | class OBJECT_PT_transform(ObjectButtonsPanel, Panel): | ||||
| bl_label = "Transform" | bl_label = "Transform" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False) | |||||
| ob = context.object | ob = context.object | ||||
| col = flow.column() | col = layout.column() | ||||
| row = col.row(align=True) | sub = col.row(align=True) | ||||
| row.prop(ob, "location") | sub.prop(ob, "location") | ||||
| row.use_property_decorate = False | sub.prop(ob, "lock_location", text="") | ||||
| row.prop(ob, "lock_location", text="", emboss=False, icon='DECORATE_UNLOCKED') | |||||
| rotation_mode = ob.rotation_mode | rotation_mode = ob.rotation_mode | ||||
| if rotation_mode == 'QUATERNION': | if rotation_mode == 'QUATERNION': | ||||
| col = flow.column() | sub = col.row(align=True) | ||||
| row = col.row(align=True) | sub.prop(ob, "rotation_quaternion", text="Rotation") | ||||
| row.prop(ob, "rotation_quaternion", text="Rotation") | subsub = sub.column(align=True) | ||||
| sub = row.column(align=True) | subsub.prop(ob, "lock_rotation_w", text="") | ||||
| sub.use_property_decorate = False | subsub.prop(ob, "lock_rotation", text="") | ||||
| sub.prop(ob, "lock_rotation_w", text="", emboss=False, icon='DECORATE_UNLOCKED') | |||||
| sub.prop(ob, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED') | |||||
| elif rotation_mode == 'AXIS_ANGLE': | elif rotation_mode == 'AXIS_ANGLE': | ||||
| col = flow.column() | sub = col.row(align=True) | ||||
| row = col.row(align=True) | sub.prop(ob, "rotation_axis_angle", text="Rotation") | ||||
| row.prop(ob, "rotation_axis_angle", text="Rotation") | subsub = sub.column(align=True) | ||||
| subsub.prop(ob, "lock_rotation_w", text="") | |||||
| sub = row.column(align=True) | subsub.prop(ob, "lock_rotation", text="") | ||||
| sub.use_property_decorate = False | |||||
| sub.prop(ob, "lock_rotation_w", text="", emboss=False, icon='DECORATE_UNLOCKED') | |||||
| sub.prop(ob, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED') | |||||
| else: | else: | ||||
| col = flow.column() | sub = col.row(align=True) | ||||
| row = col.row(align=True) | sub.prop(ob, "rotation_euler", text="Rotation") | ||||
| row.prop(ob, "rotation_euler", text="Rotation") | sub.prop(ob, "lock_rotation", text="") | ||||
| row.use_property_decorate = False | |||||
| row.prop(ob, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED') | |||||
| col = flow.column() | col = layout.column() | ||||
| row = col.row(align=True) | col.prop(ob, "rotation_mode") | ||||
| row.prop(ob, "scale") | |||||
| row.use_property_decorate = False | |||||
| row.prop(ob, "lock_scale", text="", emboss=False, icon='DECORATE_UNLOCKED') | |||||
| row = layout.row(align=True) | col = layout.column() | ||||
| row.prop(ob, "rotation_mode") | sub = col.row(align=True) | ||||
| row.label(text="", icon='BLANK1') | sub.prop(ob, "scale") | ||||
| sub.prop(ob, "lock_scale", text="") | |||||
| row.label(text="", icon='BLANK1') | |||||
| class OBJECT_PT_delta_transform(ObjectButtonsPanel, Panel): | class OBJECT_PT_delta_transform(ObjectButtonsPanel, Panel): | ||||
| bl_label = "Delta Transform" | bl_label = "Delta Transform" | ||||
| bl_parent_id = "OBJECT_PT_transform" | bl_parent_id = "OBJECT_PT_transform" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| ▲ Show 20 Lines • Show All 323 Lines • Show Last 20 Lines | |||||