Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_object.py
| Context not available. | |||||
| obj_type = obj.type | obj_type = obj.type | ||||
| is_geometry = (obj_type in {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT', 'VOLUME', 'CURVES', 'POINTCLOUD'}) | is_geometry = (obj_type in {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT', 'VOLUME', 'CURVES', 'POINTCLOUD'}) | ||||
| has_bounds = (is_geometry or obj_type in {'LATTICE', 'ARMATURE'}) | has_bounds = (is_geometry or obj_type in {'LATTICE', 'ARMATURE'}) | ||||
| is_wire = (obj_type in {'CAMERA', 'EMPTY'}) | is_wire = (obj_type in {'CAMERA', 'EMPTY', 'LIGHT', 'SPEAKER', 'LIGHT_PROBE'}) | ||||
| is_empty_image = (obj_type == 'EMPTY' and obj.empty_display_type == 'IMAGE') | is_empty_image = (obj_type == 'EMPTY' and obj.empty_display_type == 'IMAGE') | ||||
| is_dupli = (obj.instance_type != 'NONE') | is_dupli = (obj.instance_type != 'NONE') | ||||
| is_gpencil = (obj_type == 'GPENCIL') | is_gpencil = (obj_type == 'GPENCIL') | ||||
| Context not available. | |||||
| col.prop(obj, "show_in_front", text="In Front") | col.prop(obj, "show_in_front", text="In Front") | ||||
| # if obj_type == 'MESH' or is_empty_image: | # if obj_type == 'MESH' or is_empty_image: | ||||
| # col.prop(obj, "show_transparent", text="Transparency") | # col.prop(obj, "show_transparent", text="Transparency") | ||||
| sub = layout.column() | sub = layout.column() | ||||
| if is_wire: | if is_wire: | ||||
| # wire objects only use the max. display type for duplis | # wire objects only use the max. display type for duplis | ||||
| sub.active = is_dupli | sub.active = is_dupli | ||||
| sub.prop(obj, "display_type", text="Display As") | sub.prop(obj, "display_type", text="Display As") | ||||
| if is_geometry or is_dupli or is_empty_image or is_gpencil: | if is_geometry or is_dupli or is_empty_image or is_gpencil or is_wire: | ||||
| # Only useful with object having faces/materials... | # Only useful with object having faces/materials... | ||||
| col.prop(obj, "color") | if is_wire: | ||||
| row = col.row(align=True, heading="Wire Color") | |||||
| row.prop(obj, "use_custom_wire_color", text="") | |||||
| row.prop(obj, "color", text="") | |||||
| else: | |||||
| row = col.row() | |||||
| row.prop(obj, "color", text="Color") | |||||
| if has_bounds: | if has_bounds: | ||||
| col = layout.column(align=False, heading="Bounds") | col = layout.column(align=False, heading="Bounds") | ||||
| Context not available. | |||||