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) | row = col.row(align=True) | ||||
| row.prop(ob, "location") | row.prop(ob, "location") | ||||
| row.use_property_decorate = False | row.use_property_decorate = False | ||||
| row.prop(ob, "lock_location", text="", emboss=False, icon='DECORATE_UNLOCKED') | 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() | col = layout.column() | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| row.prop(ob, "rotation_quaternion", text="Rotation") | row.prop(ob, "rotation_quaternion", text="Rotation") | ||||
| sub = row.column(align=True) | sub = row.column(align=True) | ||||
| sub.use_property_decorate = False | sub.use_property_decorate = False | ||||
| sub.prop(ob, "lock_rotation_w", text="", emboss=False, icon='DECORATE_UNLOCKED') | sub.prop(ob, "lock_rotation_w", text="", emboss=False, icon='DECORATE_UNLOCKED') | ||||
| sub.prop(ob, "lock_rotation", 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() | col = layout.column() | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| row.prop(ob, "rotation_axis_angle", text="Rotation") | row.prop(ob, "rotation_axis_angle", text="Rotation") | ||||
| sub = row.column(align=True) | sub = row.column(align=True) | ||||
| sub.use_property_decorate = False | sub.use_property_decorate = False | ||||
| sub.prop(ob, "lock_rotation_w", text="", emboss=False, icon='DECORATE_UNLOCKED') | sub.prop(ob, "lock_rotation_w", text="", emboss=False, icon='DECORATE_UNLOCKED') | ||||
| sub.prop(ob, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED') | sub.prop(ob, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED') | ||||
| else: | else: | ||||
| col = flow.column() | col = layout.column() | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| row.prop(ob, "rotation_euler", text="Rotation") | row.prop(ob, "rotation_euler", text="Rotation") | ||||
| row.use_property_decorate = False | row.use_property_decorate = False | ||||
| row.prop(ob, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED') | row.prop(ob, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED') | ||||
| row = layout.row(align=True) | |||||
| row.prop(ob, "rotation_mode") | |||||
| row.label(text="", icon='BLANK1') | |||||
| col = flow.column() | col = layout.column() | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| row.prop(ob, "scale") | row.prop(ob, "scale") | ||||
| row.use_property_decorate = False | row.use_property_decorate = False | ||||
| row.prop(ob, "lock_scale", text="", emboss=False, icon='DECORATE_UNLOCKED') | row.prop(ob, "lock_scale", text="", emboss=False, icon='DECORATE_UNLOCKED') | ||||
| row = layout.row(align=True) | |||||
| row.prop(ob, "rotation_mode") | |||||
| 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 | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| ▲ Show 20 Lines • Show All 322 Lines • Show Last 20 Lines | |||||