Changeset View
Changeset View
Standalone View
Standalone View
space_view3d_spacebar_menu.py
| Context not available. | |||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return (context.active_object is not None) | return context.active_object is not None | ||||
| def execute(self, context): | def execute(self, context): | ||||
| bpy.ops.object.editmode_toggle() | bpy.ops.object.editmode_toggle() | ||||
| Context not available. | |||||
| flow = layout.column_flow(columns=3) | flow = layout.column_flow(columns=3) | ||||
| for brsh in bpy.data.brushes: | for brsh in bpy.data.brushes: | ||||
| if (context.sculpt_object and brsh.use_paint_sculpt): | if context.sculpt_object and brsh.use_paint_sculpt: | ||||
| props = flow.operator("wm.context_set_id", text=brsh.name, | props = flow.operator("wm.context_set_id", text=brsh.name, | ||||
| icon_value=layout.icon(brsh)) | icon_value=layout.icon(brsh)) | ||||
| props.data_path = "tool_settings.sculpt.brush" | props.data_path = "tool_settings.sculpt.brush" | ||||
| props.value = brsh.name | props.value = brsh.name | ||||
| elif (context.image_paint_object and brsh.use_paint_image): | elif context.image_paint_object and brsh.use_paint_image: | ||||
| props = flow.operator("wm.context_set_id", text=brsh.name, | props = flow.operator("wm.context_set_id", text=brsh.name, | ||||
| icon_value=layout.icon(brsh)) | icon_value=layout.icon(brsh)) | ||||
| props.data_path = "tool_settings.image_paint.brush" | props.data_path = "tool_settings.image_paint.brush" | ||||
| props.value = brsh.name | props.value = brsh.name | ||||
| elif (context.vertex_paint_object and brsh.use_paint_vertex): | elif context.vertex_paint_object and brsh.use_paint_vertex: | ||||
| props = flow.operator("wm.context_set_id", text=brsh.name, | props = flow.operator("wm.context_set_id", text=brsh.name, | ||||
| icon_value=layout.icon(brsh)) | icon_value=layout.icon(brsh)) | ||||
| props.data_path = "tool_settings.vertex_paint.brush" | props.data_path = "tool_settings.vertex_paint.brush" | ||||
| props.value = brsh.name | props.value = brsh.name | ||||
| elif (context.weight_paint_object and brsh.use_paint_weight): | elif context.weight_paint_object and brsh.use_paint_weight: | ||||
| props = flow.operator("wm.context_set_id", text=brsh.name, | props = flow.operator("wm.context_set_id", text=brsh.name, | ||||
| icon_value=layout.icon(brsh)) | icon_value=layout.icon(brsh)) | ||||
| props.data_path = "tool_settings.weight_paint.brush" | props.data_path = "tool_settings.weight_paint.brush" | ||||
| Context not available. | |||||
| if context.sculpt_object.use_dynamic_topology_sculpting: | if context.sculpt_object.use_dynamic_topology_sculpting: | ||||
| layout.operator("sculpt.dynamic_topology_toggle", icon='X', text="Disable Dyntopo") | layout.operator("sculpt.dynamic_topology_toggle", icon='X', text="Disable Dyntopo") | ||||
| UseSeparator(self, context) | UseSeparator(self, context) | ||||
| if (settings.sculpt.detail_type_method == 'CONSTANT'): | if settings.sculpt.detail_type_method == 'CONSTANT': | ||||
| layout.prop(settings.sculpt, "constant_detail", text="Const.") | layout.prop(settings.sculpt, "constant_detail", text="Const.") | ||||
| layout.operator("sculpt.sample_detail_size", text="", icon='EYEDROPPER') | layout.operator("sculpt.sample_detail_size", text="", icon='EYEDROPPER') | ||||
| else: | else: | ||||
| Context not available. | |||||
| layout.prop(settings.sculpt, "symmetrize_direction", "") | layout.prop(settings.sculpt, "symmetrize_direction", "") | ||||
| UseSeparator(self, context) | UseSeparator(self, context) | ||||
| layout.operator("sculpt.optimize") | layout.operator("sculpt.optimize") | ||||
| if (settings.sculpt.detail_type_method == 'CONSTANT'): | if settings.sculpt.detail_type_method == 'CONSTANT': | ||||
| layout.operator("sculpt.detail_flood_fill") | layout.operator("sculpt.detail_flood_fill") | ||||
| layout.menu("view3d.set_brush_dyntopo") | layout.menu("view3d.set_brush_dyntopo") | ||||
| Context not available. | |||||
| UseSeparator(self, context) | UseSeparator(self, context) | ||||
| if context.active_object: | if context.active_object: | ||||
| if(context.mode == 'EDIT_MESH'): | if context.mode == 'EDIT_MESH': | ||||
| layout.operator("MESH_OT_faces_shade_smooth") | layout.operator("MESH_OT_faces_shade_smooth") | ||||
| layout.operator("MESH_OT_faces_shade_flat") | layout.operator("MESH_OT_faces_shade_flat") | ||||
| else: | else: | ||||
| Context not available. | |||||
| obj = context.active_object | obj = context.active_object | ||||
| if (obj.type != "MESH"): | if obj.type != "MESH": | ||||
| operator.report({'ERROR'}, "Object must be a mesh") | operator.report({'ERROR'}, "Object must be a mesh") | ||||
| return None | return None | ||||
| Context not available. | |||||
| mode = bpy.props.StringProperty(name="Interactive mode", default="OBJECT") | mode = bpy.props.StringProperty(name="Interactive mode", default="OBJECT") | ||||
| def execute(self, context): | def execute(self, context): | ||||
| if (context.active_object): | if context.active_object: | ||||
| try: | try: | ||||
| bpy.ops.object.mode_set(mode=self.mode) | bpy.ops.object.mode_set(mode=self.mode) | ||||
| except TypeError: | except TypeError: | ||||
| Context not available. | |||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return (context.mode == "OBJECT") | return context.mode == "OBJECT" | ||||
| def execute(self, context): | def execute(self, context): | ||||
| context.space_data.cursor_location = (0, 0, 0) | context.space_data.cursor_location = (0, 0, 0) | ||||
| Context not available. | |||||