blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py

1360 lines
46 KiB
Python
Raw Normal View History

# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
2010-02-12 13:34:04 +00:00
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
from bpy.types import Menu, Panel
from bl_ui.properties_paint_common import UnifiedPaintPanel
from bl_ui.properties_paint_common import brush_texture_settings
from bl_ui.properties_paint_common import brush_mask_texture_settings
2011-06-24 03:30:50 +00:00
class View3DPanel():
bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS'
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
# **************** standard tool clusters ******************
# History/Repeat tools
def draw_repeat_tools(context, layout):
col = layout.column(align=True)
col.label(text="Repeat:")
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
col.operator("screen.repeat_last")
col.operator("screen.repeat_history", text="History...")
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
2011-02-04 09:27:25 +00:00
# Keyframing tools
def draw_keyframing_tools(context, layout):
col = layout.column(align=True)
col.label(text="Keyframes:")
row = col.row(align=True)
row.operator("anim.keyframe_insert_menu", text="Insert")
row.operator("anim.keyframe_delete_v3d", text="Remove")
2011-01-13 23:00:51 +00:00
2011-02-04 09:27:25 +00:00
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
# Grease Pencil tools
def draw_gpencil_tools(context, layout):
col = layout.column(align=True)
2011-01-13 23:00:51 +00:00
col.label(text="Grease Pencil:")
2011-01-13 23:00:51 +00:00
row = col.row(align=True)
row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
row = col.row(align=True)
row.operator("gpencil.draw", text="Poly").mode = 'DRAW_POLY'
row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
2011-01-13 23:00:51 +00:00
row = col.row(align=True)
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
row.prop(context.tool_settings, "use_grease_pencil_sessions")
col.operator("view3d.ruler")
2011-10-17 06:58:07 +00:00
# ********** default tools for object-mode ****************
class VIEW3D_PT_tools_objectmode(View3DPanel, Panel):
bl_context = "objectmode"
bl_label = "Object Tools"
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
col.label(text="Transform:")
col.operator("transform.translate")
col.operator("transform.rotate")
col.operator("transform.resize", text="Scale")
col = layout.column(align=True)
col.operator("object.origin_set", text="Origin")
col = layout.column(align=True)
col.label(text="Object:")
col.operator("object.duplicate_move")
col.operator("object.delete")
col.operator("object.join")
active_object = context.active_object
if active_object and active_object.type in {'MESH', 'CURVE', 'SURFACE'}:
col = layout.column(align=True)
col.label(text="Shading:")
row = col.row(align=True)
row.operator("object.shade_smooth", text="Smooth")
row.operator("object.shade_flat", text="Flat")
2011-02-04 09:27:25 +00:00
draw_keyframing_tools(context, layout)
2011-02-04 09:27:25 +00:00
col = layout.column(align=True)
col.label(text="Motion Paths:")
row = col.row(align=True)
row.operator("object.paths_calculate", text="Calculate")
row.operator("object.paths_clear", text="Clear")
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
draw_repeat_tools(context, layout)
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
draw_gpencil_tools(context, layout)
class VIEW3D_PT_tools_rigidbody(View3DPanel, Panel):
bl_context = "objectmode"
bl_label = "Rigid Body Tools"
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
col.label(text="Add/Remove:")
row = col.row(align=True)
row.operator("rigidbody.objects_add", text="Add Active").type = 'ACTIVE'
row.operator("rigidbody.objects_add", text="Add Passive").type = 'PASSIVE'
row = col.row(align=True)
row.operator("rigidbody.objects_remove", text="Remove")
col = layout.column(align=True)
col.label(text="Object Tools:")
col.operator("rigidbody.shape_change", text="Change Shape")
col.operator("rigidbody.mass_calculate", text="Calculate Mass")
col.operator("rigidbody.object_settings_copy", text="Copy from Active")
col.operator("object.visual_transform_apply", text="Apply Transformation")
col.operator("rigidbody.bake_to_keyframes", text="Bake To Keyframes")
col.label(text="Constraints:")
col.operator("rigidbody.connect", text="Connect")
# ********** default tools for editmode_mesh ****************
class VIEW3D_PT_tools_meshedit(View3DPanel, Panel):
bl_context = "mesh_edit"
bl_label = "Mesh Tools"
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
col.label(text="Transform:")
col.operator("transform.translate")
col.operator("transform.rotate")
col.operator("transform.resize", text="Scale")
col.operator("transform.shrink_fatten", text="Shrink/Fatten")
col.operator("transform.push_pull", text="Push/Pull")
col = layout.column(align=True)
col.label(text="Deform:")
row = col.row(align=True)
row.operator("transform.edge_slide", text="Slide Edge")
row.operator("transform.vert_slide", text="Vertex")
col.operator("mesh.noise")
col.operator("mesh.vertices_smooth")
col = layout.column(align=True)
col.label(text="Add:")
col.menu("VIEW3D_MT_edit_mesh_extrude")
col.operator("view3d.edit_mesh_extrude_move_normal", text="Extrude Region")
col.operator("view3d.edit_mesh_extrude_individual_move", text="Extrude Individual")
col.operator("mesh.subdivide")
col.operator("mesh.loopcut_slide")
col.operator("mesh.duplicate_move", text="Duplicate")
row = col.row(align=True)
row.operator("mesh.spin")
row.operator("mesh.screw")
row = col.row(align=True)
props = row.operator("mesh.knife_tool", text="Knife")
props.use_occlude_geometry = True
2012-05-06 13:41:27 +00:00
props.only_selected = False
props = row.operator("mesh.knife_tool", text="Select")
props.use_occlude_geometry = False
2012-05-06 13:41:27 +00:00
props.only_selected = True
col.operator("mesh.knife_project")
col.operator("mesh.bisect")
col = layout.column(align=True)
col.label(text="Remove:")
col.menu("VIEW3D_MT_edit_mesh_delete")
col.operator_menu_enum("mesh.merge", "type")
col.operator("mesh.remove_doubles")
col = layout.column(align=True)
col.label(text="Normals:")
col.operator("mesh.normals_make_consistent", text="Recalculate")
col.operator("mesh.flip_normals", text="Flip Direction")
col = layout.column(align=True)
col.label(text="UV Mapping:")
col.menu("VIEW3D_MT_uv_map", text="Unwrap")
col.operator("mesh.mark_seam").clear = False
col.operator("mesh.mark_seam", text="Clear Seam").clear = True
col = layout.column(align=True)
col.label(text="Shading:")
row = col.row(align=True)
row.operator("mesh.faces_shade_smooth", text="Smooth")
row.operator("mesh.faces_shade_flat", text="Flat")
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
draw_repeat_tools(context, layout)
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
draw_gpencil_tools(context, layout)
class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel):
bl_context = "mesh_edit"
bl_label = "Mesh Options"
@classmethod
def poll(cls, context):
return context.active_object
def draw(self, context):
layout = self.layout
2009-11-04 16:26:08 +00:00
ob = context.active_object
tool_settings = context.tool_settings
mesh = ob.data
col = layout.column(align=True)
col.prop(mesh, "use_mirror_x")
row = col.row(align=True)
row.active = ob.data.use_mirror_x
row.prop(mesh, "use_mirror_topology")
col = layout.column(align=True)
col.label("Edge Select Mode:")
col.prop(tool_settings, "edge_path_mode", text="")
col.prop(tool_settings, "edge_path_live_unwrap")
col.label("Double Threshold:")
col.prop(tool_settings, "double_threshold", text="")
if mesh.show_weight:
col.label("Show Zero Weights:")
col.row().prop(tool_settings, "vertex_group_user", expand=True)
# ********** default tools for editmode_curve ****************
class VIEW3D_PT_tools_curveedit(View3DPanel, Panel):
bl_context = "curve_edit"
bl_label = "Curve Tools"
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
col.label(text="Transform:")
col.operator("transform.translate")
col.operator("transform.rotate")
col.operator("transform.resize", text="Scale")
col = layout.column(align=True)
col.operator("transform.tilt", text="Tilt")
col.operator("transform.transform", text="Scale Feather").mode = 'CURVE_SHRINKFATTEN'
col = layout.column(align=True)
col.label(text="Curve:")
col.operator("curve.duplicate_move", text="Duplicate")
col.operator("curve.delete")
col.operator("curve.cyclic_toggle")
col.operator("curve.switch_direction")
col.operator("curve.spline_type_set")
col.operator("curve.radius_set")
col = layout.column(align=True)
col.label(text="Handles:")
row = col.row(align=True)
row.operator("curve.handle_type_set", text="Auto").type = 'AUTOMATIC'
row.operator("curve.handle_type_set", text="Vector").type = 'VECTOR'
row = col.row(align=True)
2010-12-14 13:56:10 +00:00
row.operator("curve.handle_type_set", text="Align").type = 'ALIGNED'
row.operator("curve.handle_type_set", text="Free").type = 'FREE_ALIGN'
col = layout.column(align=True)
col.label(text="Modeling:")
col.operator("curve.extrude_move", text="Extrude")
col.operator("curve.subdivide")
col.operator("curve.smooth")
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
draw_repeat_tools(context, layout)
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
draw_gpencil_tools(context, layout)
# ********** default tools for editmode_surface ****************
class VIEW3D_PT_tools_surfaceedit(View3DPanel, Panel):
bl_context = "surface_edit"
bl_label = "Surface Tools"
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
col.label(text="Transform:")
col.operator("transform.translate")
col.operator("transform.rotate")
col.operator("transform.resize", text="Scale")
col = layout.column(align=True)
col.label(text="Curve:")
col.operator("curve.duplicate_move", text="Duplicate")
col.operator("curve.delete")
col.operator("curve.cyclic_toggle")
col.operator("curve.switch_direction")
col = layout.column(align=True)
col.label(text="Modeling:")
col.operator("curve.extrude", text="Extrude")
col.operator("curve.subdivide")
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
draw_repeat_tools(context, layout)
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
draw_gpencil_tools(context, layout)
# ********** default tools for editmode_text ****************
class VIEW3D_PT_tools_textedit(View3DPanel, Panel):
bl_context = "text_edit"
bl_label = "Text Tools"
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
col.label(text="Text Edit:")
col.operator("font.text_copy", text="Copy")
col.operator("font.text_cut", text="Cut")
col.operator("font.text_paste", text="Paste")
col = layout.column(align=True)
col.label(text="Set Case:")
col.operator("font.case_set", text="To Upper").case = 'UPPER'
col.operator("font.case_set", text="To Lower").case = 'LOWER'
col = layout.column(align=True)
col.label(text="Style:")
col.operator("font.style_toggle", text="Bold").style = 'BOLD'
col.operator("font.style_toggle", text="Italic").style = 'ITALIC'
col.operator("font.style_toggle", text="Underline").style = 'UNDERLINE'
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
draw_repeat_tools(context, layout)
# ********** default tools for editmode_armature ****************
class VIEW3D_PT_tools_armatureedit(View3DPanel, Panel):
bl_context = "armature_edit"
bl_label = "Armature Tools"
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
col.label(text="Transform:")
col.operator("transform.translate")
col.operator("transform.rotate")
col.operator("transform.resize", text="Scale")
col = layout.column(align=True)
col.label(text="Bones:")
col.operator("armature.bone_primitive_add", text="Add")
col.operator("armature.duplicate_move", text="Duplicate")
col.operator("armature.delete", text="Delete")
col = layout.column(align=True)
col.label(text="Modeling:")
col.operator("armature.extrude_move")
col.operator("armature.subdivide", text="Subdivide")
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
draw_repeat_tools(context, layout)
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
draw_gpencil_tools(context, layout)
class VIEW3D_PT_tools_armatureedit_options(View3DPanel, Panel):
bl_context = "armature_edit"
bl_label = "Armature Options"
def draw(self, context):
arm = context.active_object.data
2011-04-01 21:37:40 +00:00
self.layout.prop(arm, "use_mirror_x")
# ********** default tools for editmode_mball ****************
class VIEW3D_PT_tools_mballedit(View3DPanel, Panel):
bl_context = "mball_edit"
bl_label = "Meta Tools"
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
col.label(text="Transform:")
col.operator("transform.translate")
col.operator("transform.rotate")
col.operator("transform.resize", text="Scale")
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
draw_repeat_tools(context, layout)
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
draw_gpencil_tools(context, layout)
# ********** default tools for editmode_lattice ****************
class VIEW3D_PT_tools_latticeedit(View3DPanel, Panel):
bl_context = "lattice_edit"
bl_label = "Lattice Tools"
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
col.label(text="Transform:")
col.operator("transform.translate")
col.operator("transform.rotate")
col.operator("transform.resize", text="Scale")
col = layout.column(align=True)
col.operator("lattice.make_regular")
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
draw_repeat_tools(context, layout)
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
draw_gpencil_tools(context, layout)
2011-10-17 06:58:07 +00:00
# ********** default tools for pose-mode ****************
class VIEW3D_PT_tools_posemode(View3DPanel, Panel):
bl_context = "posemode"
bl_label = "Pose Tools"
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
col.label(text="Transform:")
col.operator("transform.translate")
col.operator("transform.rotate")
col.operator("transform.resize", text="Scale")
col = layout.column(align=True)
col.label(text="In-Between:")
row = col.row(align=True)
row.operator("pose.push", text="Push")
row.operator("pose.relax", text="Relax")
col.operator("pose.breakdown", text="Breakdowner")
col = layout.column(align=True)
col.label(text="Pose:")
row = col.row(align=True)
row.operator("pose.copy", text="Copy")
row.operator("pose.paste", text="Paste")
col = layout.column(align=True)
col.operator("poselib.pose_add", text="Add To Library")
draw_keyframing_tools(context, layout)
2011-02-04 09:27:25 +00:00
col = layout.column(align=True)
col.label(text="Motion Paths:")
row = col.row(align=True)
row.operator("pose.paths_calculate", text="Calculate")
row.operator("pose.paths_clear", text="Clear")
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
draw_repeat_tools(context, layout)
Grease Pencil Todos: "Sketching Sessions" Due to popular request and usability considerations, this commit reintroduces functionality similar to 2.4's "Draw Mode" for Grease Pencil. In the toolbar under the Draw/Line/Eraser buttons, you can find the "Use Sketching Sessions" toggle, which enables this feature. This is a per-scene setting, and defaults to off, so that the current 2.5 behaviour is still the default (i.e. the Grease Pencil operator will only do a single stroke at a time). With this option enabled, drawing with Grease Pencil will enter a semi-modal state where you can draw multiple strokes without needing to keep holding the DKEY throughout (though you'll still need to do so to start the strokes, unless you use some toolbar buttons), while still being able to manipulate the viewport. Header help-text prints show the appropriate keybindings (i.e. press ESCKEY or ENTER to end the sketching session). Notes: - To aid maintainability of the 3D-View toolbar code, I've taken the liberty to factor out the groups of widgets which commonly occur in most of the toolbars into separate functions (namely "Repeat" and "Grease Pencil"). Perhaps it might make it slightly harder to newbies to the toolbar code to grasp, though the physics panels are far worse ;) - I've reshuffled some code in the Grease Pencil code to separate out the various states of operation again more clearly, though some more work is still needed there (TODO) - There can now be only one Grease Pencil operator running at a time - Redoing Grease Pencil operations where sketching sessions was enabled still needs work. Namely, a way of delimiting the set of points recorded into strokes is still needed (TODO) - Ultimately, it should be possible to switch tools midway through a session. Currently sessions are limited to only being able to be used with a single drawing mode (TODO) - After ending a drawing session, the titlebar contols may not work on Windows without manually making the main window lose focus and then regain (i.e. click on some other window in toolbar, then come back). This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
draw_gpencil_tools(context, layout)
class VIEW3D_PT_tools_posemode_options(View3DPanel, Panel):
bl_context = "posemode"
bl_label = "Pose Options"
def draw(self, context):
arm = context.active_object.data
2011-04-01 21:37:40 +00:00
self.layout.prop(arm, "use_auto_ik")
# ********** default tools for paint modes ****************
class View3DPaintPanel(UnifiedPaintPanel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS'
2012-01-17 17:57:20 +00:00
class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
bl_label = "Brush"
@classmethod
def poll(cls, context):
return cls.paint_settings(context)
def draw(self, context):
layout = self.layout
2012-01-17 17:57:20 +00:00
toolsettings = context.tool_settings
settings = self.paint_settings(context)
brush = settings.brush
if not context.particle_edit_object:
col = layout.split().column()
col.template_ID_preview(settings, "brush", new="brush.add", rows=3, cols=8)
# Particle Mode #
if context.particle_edit_object:
tool = settings.tool
layout.column().prop(settings, "tool", expand=True)
if tool != 'NONE':
col = layout.column()
col.prop(brush, "size", slider=True)
if tool != 'ADD':
col.prop(brush, "strength", slider=True)
if tool == 'ADD':
col.prop(brush, "count")
col = layout.column()
col.prop(settings, "use_default_interpolate")
sub = col.column(align=True)
sub.active = settings.use_default_interpolate
sub.prop(brush, "steps", slider=True)
sub.prop(settings, "default_key_count", slider=True)
elif tool == 'LENGTH':
layout.prop(brush, "length_mode", expand=True)
elif tool == 'PUFF':
layout.prop(brush, "puff_mode", expand=True)
layout.prop(brush, "use_puff_volume")
# Sculpt Mode #
elif context.sculpt_object and brush:
capabilities = brush.sculpt_capabilities
col = layout.column()
col.separator()
2009-12-29 00:04:57 +00:00
row = col.row(align=True)
2012-01-17 17:57:20 +00:00
ups = toolsettings.unified_paint_settings
2013-06-27 03:05:19 +00:00
if ((ups.use_unified_size and ups.use_locked_size) or
2012-10-08 08:28:05 +00:00
((not ups.use_unified_size) and brush.use_locked_size)):
self.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED')
self.prop_unified_size(row, context, brush, "unprojected_radius", slider=True, text="Radius")
else:
self.prop_unified_size(row, context, brush, "use_locked_size", icon='UNLOCKED')
self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
self.prop_unified_size(row, context, brush, "use_pressure_size")
# strength, use_strength_pressure, and use_strength_attenuation
if capabilities.has_strength:
col.separator()
row = col.row(align=True)
if capabilities.has_space_attenuation:
if brush.use_space_attenuation:
row.prop(brush, "use_space_attenuation", toggle=True, text="", icon='LOCKED')
else:
row.prop(brush, "use_space_attenuation", toggle=True, text="", icon='UNLOCKED')
self.prop_unified_strength(row, context, brush, "strength", text="Strength")
self.prop_unified_strength(row, context, brush, "use_pressure_strength")
# auto_smooth_factor and use_inverse_smooth_pressure
if capabilities.has_auto_smooth:
col.separator()
row = col.row(align=True)
2010-08-18 03:56:14 +00:00
row.prop(brush, "auto_smooth_factor", slider=True)
row.prop(brush, "use_inverse_smooth_pressure", toggle=True, text="")
# normal_weight
if capabilities.has_normal_weight:
col.separator()
row = col.row(align=True)
row.prop(brush, "normal_weight", slider=True)
# crease_pinch_factor
if capabilities.has_pinch_factor:
col.separator()
row = col.row(align=True)
row.prop(brush, "crease_pinch_factor", slider=True, text="Pinch")
# use_original_normal and sculpt_plane
if capabilities.has_sculpt_plane:
col.separator()
row = col.row(align=True)
if brush.use_original_normal:
row.prop(brush, "use_original_normal", toggle=True, text="", icon='LOCKED')
else:
row.prop(brush, "use_original_normal", toggle=True, text="", icon='UNLOCKED')
row.prop(brush, "sculpt_plane", text="")
if brush.sculpt_tool == 'MASK':
col.prop(brush, "mask_tool", text="")
# plane_offset, use_offset_pressure, use_plane_trim, plane_trim
if capabilities.has_plane_offset:
row = col.row(align=True)
row.prop(brush, "plane_offset", slider=True)
row.prop(brush, "use_offset_pressure", text="")
col.separator()
2010-09-07 15:17:42 +00:00
row = col.row()
row.prop(brush, "use_plane_trim", text="Trim")
2010-09-07 15:17:42 +00:00
row = col.row()
row.active = brush.use_plane_trim
row.prop(brush, "plane_trim", slider=True, text="Distance")
# height
if capabilities.has_height:
row = col.row()
row.prop(brush, "height", slider=True, text="Height")
# use_frontface
col.separator()
row = col.row()
row.prop(brush, "use_frontface", text="Front Faces Only")
# direction
col.separator()
col.row().prop(brush, "direction", expand=True)
# use_accumulate
if capabilities.has_accumulate:
col.separator()
col.prop(brush, "use_accumulate")
# use_persistent, set_persistent_base
if capabilities.has_persistence:
col.separator()
ob = context.sculpt_object
do_persistent = True
# not supported yet for this case
for md in ob.modifiers:
if md.type == 'MULTIRES':
do_persistent = False
break
if do_persistent:
col.prop(brush, "use_persistent")
col.operator("sculpt.set_persistent_base")
# Texture Paint Mode #
elif context.image_paint_object and brush:
col = layout.column()
if brush.image_tool == 'DRAW' and brush.blend not in ('ERASE_ALPHA', 'ADD_ALPHA'):
col.template_color_picker(brush, "color", value_slider=True)
col.prop(brush, "color", text="")
row = col.row(align=True)
self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
self.prop_unified_size(row, context, brush, "use_pressure_size")
row = col.row(align=True)
self.prop_unified_strength(row, context, brush, "strength", text="Strength")
self.prop_unified_strength(row, context, brush, "use_pressure_strength")
col.prop(brush, "blend", text="Blend")
col = layout.column()
col.active = (brush.blend not in {'ERASE_ALPHA', 'ADD_ALPHA'})
col.prop(brush, "use_alpha")
2010-04-04 14:52:15 +00:00
# Weight Paint Mode #
elif context.weight_paint_object and brush:
col = layout.column()
== Sculpt/Paint Fixes == * Fix: unify strength and size did work consistently with other paint modes * Fix: If [ and ] keys were used to resize a brush it was not possible to increase the size of the brush if it went under 10 pixels * Fix: Made interpretation of brush size consistent across all modes, Texture/Image paint interpreted brush size as the diameter while all the other modes interpret it as radius * Fix: The default spacing for vertex paint brushes was 3%, should be 10% * Fix: due to fixes to unified strength, re-enabled 'Unify Size' by default * Fix: Unified size and strength were stored in UserPrefs, moved this to ToolSettings * Fix: The setting of pressure sensitivity was not unified when strength or size were unified. Now the appropriate pressure sensitivity setting is also unified across all brushes when corresponding unification option is selected * Fix: When using [ and ] to resize the brush it didn't immediately redraw * Fix: fkey resizing/"re-strength-ing" was not working consistently accross all paint modes due to only sculpt mode having full support for unified size and strength, now it works properly. * Fix: other paint modes did expose the ability to have a custom brush colors, so I added the small bit of code to allow it. Note: I made all of the other paint mode brushes white. Note2: Actually, probably want to make the paint modes use the selected color for painting instead of a constant brush color. * I had removed OPTYPE_REGISTER from some Sculpt/Paint operators but in this commit I add them back. I'm not completely sure what this option does so I don't want to disturb it for now.
2010-07-22 18:56:46 +00:00
row = col.row(align=True)
self.prop_unified_weight(row, context, brush, "weight", slider=True, text="Weight")
row = col.row(align=True)
self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
self.prop_unified_size(row, context, brush, "use_pressure_size")
row = col.row(align=True)
self.prop_unified_strength(row, context, brush, "strength", text="Strength")
self.prop_unified_strength(row, context, brush, "use_pressure_strength")
col.prop(brush, "vertex_tool", text="Blend")
col = layout.column()
col.prop(toolsettings, "use_auto_normalize", text="Auto Normalize")
col.prop(toolsettings, "use_multipaint", text="Multi-Paint")
# Vertex Paint Mode #
elif context.vertex_paint_object and brush:
col = layout.column()
col.template_color_picker(brush, "color", value_slider=True)
col.prop(brush, "color", text="")
row = col.row(align=True)
self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
self.prop_unified_size(row, context, brush, "use_pressure_size")
row = col.row(align=True)
self.prop_unified_strength(row, context, brush, "strength", text="Strength")
self.prop_unified_strength(row, context, brush, "use_pressure_strength")
# XXX - TODO
#row = col.row(align=True)
#row.prop(brush, "jitter", slider=True)
2010-08-18 03:56:14 +00:00
#row.prop(brush, "use_pressure_jitter", toggle=True, text="")
col.prop(brush, "vertex_tool", text="Blend")
class VIEW3D_PT_tools_brush_overlay(Panel, View3DPaintPanel):
bl_label = "Overlay"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
settings = cls.paint_settings(context)
return (settings and
settings.brush and
(context.sculpt_object or
context.vertex_paint_object or
context.weight_paint_object or
context.image_paint_object))
def draw(self, context):
layout = self.layout
settings = self.paint_settings(context)
brush = settings.brush
tex_slot = brush.texture_slot
tex_slot_mask = brush.mask_texture_slot
col = layout.column()
col.label(text="Curve:")
row = col.row(align=True)
if brush.use_cursor_overlay:
row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
else:
row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
sub = row.row(align=True)
sub.prop(brush, "cursor_overlay_alpha", text="Alpha")
sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
col.active = brush.brush_capabilities.has_overlay
if context.image_paint_object or context.sculpt_object or context.vertex_paint_object:
col.label(text="Texture:")
row = col.row(align=True)
if tex_slot.map_mode != 'STENCIL':
if brush.use_primary_overlay:
row.prop(brush, "use_primary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
else:
row.prop(brush, "use_primary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
sub = row.row(align=True)
sub.prop(brush, "texture_overlay_alpha", text="Alpha")
sub.prop(brush, "use_primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
if context.image_paint_object:
col.label(text="Mask Texture:")
row = col.row(align=True)
if tex_slot_mask.map_mode != 'STENCIL':
if brush.use_secondary_overlay:
row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
else:
row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
2013-06-27 03:05:19 +00:00
sub = row.row(align=True)
sub.prop(brush, "mask_overlay_alpha", text="Alpha")
sub.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
bl_label = "Texture"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
settings = cls.paint_settings(context)
2012-10-08 08:28:05 +00:00
return (settings and settings.brush and
(context.sculpt_object or context.image_paint_object or context.vertex_paint_object))
def draw(self, context):
layout = self.layout
settings = self.paint_settings(context)
brush = settings.brush
tex_slot = brush.texture_slot
2010-01-31 14:46:28 +00:00
col = layout.column()
2010-01-31 14:46:28 +00:00
col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
2010-01-31 14:46:28 +00:00
brush_texture_settings(col, brush, context.sculpt_object)
2010-01-31 14:46:28 +00:00
class VIEW3D_PT_tools_mask_texture(View3DPanel, Panel):
bl_context = "imagepaint"
bl_label = "Texture Mask"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
brush = context.tool_settings.image_paint.brush
return (context.image_paint_object and brush)
def draw(self, context):
layout = self.layout
brush = context.tool_settings.image_paint.brush
tex_slot_alpha = brush.mask_texture_slot
col = layout.column()
col.template_ID_preview(brush, "mask_texture", new="texture.new", rows=3, cols=8)
brush_mask_texture_settings(col, brush)
2013-06-27 03:05:19 +00:00
class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
bl_label = "Stroke"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
settings = cls.paint_settings(context)
2012-10-08 08:28:05 +00:00
return (settings and
settings.brush and
(context.sculpt_object or
context.vertex_paint_object or
context.weight_paint_object or
context.image_paint_object))
def draw(self, context):
layout = self.layout
settings = self.paint_settings(context)
brush = settings.brush
col = layout.column()
col.label(text="Stroke Method:")
if context.sculpt_object:
col.prop(brush, "sculpt_stroke_method", text="")
else:
col.prop(brush, "stroke_method", text="")
if brush.use_anchor:
col.separator()
col.prop(brush, "use_edge_to_edge", "Edge To Edge")
if brush.use_airbrush:
col.separator()
col.prop(brush, "rate", text="Rate", slider=True)
if brush.use_space:
col.separator()
row = col.row(align=True)
row.active = brush.use_space
row.prop(brush, "spacing", text="Spacing")
row.prop(brush, "use_pressure_spacing", toggle=True, text="")
if context.sculpt_object:
if brush.sculpt_capabilities.has_jitter:
col.separator()
row = col.row(align=True)
if brush.use_relative_jitter:
row.prop(brush, "use_relative_jitter", text="", icon='LOCKED')
row.prop(brush, "jitter", slider=True)
else:
row.prop(brush, "use_relative_jitter", text="", icon='UNLOCKED')
row.prop(brush, "jitter_absolute")
2010-08-18 03:56:14 +00:00
row.prop(brush, "use_pressure_jitter", toggle=True, text="")
if brush.sculpt_capabilities.has_smooth_stroke:
col = layout.column()
col.separator()
col.prop(brush, "use_smooth_stroke")
sub = col.column()
sub.active = brush.use_smooth_stroke
sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
else:
col.separator()
row = col.row(align=True)
if brush.use_relative_jitter:
row.prop(brush, "use_relative_jitter", text="", icon='LOCKED')
row.prop(brush, "jitter", slider=True)
else:
row.prop(brush, "use_relative_jitter", text="", icon='UNLOCKED')
row.prop(brush, "jitter_absolute")
row.prop(brush, "use_pressure_jitter", toggle=True, text="")
col = layout.column()
col.separator()
col.prop(brush, "use_smooth_stroke")
sub = col.column()
sub.active = brush.use_smooth_stroke
sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
layout.prop(settings, "input_samples")
class VIEW3D_PT_tools_brush_curve(Panel, View3DPaintPanel):
bl_label = "Curve"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
settings = cls.paint_settings(context)
return (settings and settings.brush and settings.brush.curve)
def draw(self, context):
layout = self.layout
2010-08-09 08:18:49 +00:00
settings = self.paint_settings(context)
brush = settings.brush
layout.template_curve_mapping(brush, "curve", brush=True)
2010-03-14 23:26:17 +00:00
row = layout.row(align=True)
row.operator("brush.curve_preset", icon='SMOOTHCURVE', text="").shape = 'SMOOTH'
row.operator("brush.curve_preset", icon='SPHERECURVE', text="").shape = 'ROUND'
row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT'
row.operator("brush.curve_preset", icon='SHARPCURVE', text="").shape = 'SHARP'
row.operator("brush.curve_preset", icon='LINCURVE', text="").shape = 'LINE'
row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX'
2010-08-09 08:18:49 +00:00
class VIEW3D_PT_sculpt_topology(Panel, View3DPaintPanel):
bl_label = "Topology"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return (context.sculpt_object and context.tool_settings.sculpt)
def draw(self, context):
layout = self.layout
toolsettings = context.tool_settings
sculpt = toolsettings.sculpt
if context.sculpt_object.use_dynamic_topology_sculpting:
layout.operator("sculpt.dynamic_topology_toggle", icon='X', text="Disable Dynamic")
else:
layout.operator("sculpt.dynamic_topology_toggle", icon='SCULPT_DYNTOPO', text="Enable Dynamic")
col = layout.column()
col.active = context.sculpt_object.use_dynamic_topology_sculpting
col.prop(sculpt, "detail_size")
col.prop(sculpt, "use_smooth_shading")
col.prop(sculpt, "use_edge_collapse")
col.operator("sculpt.optimize")
col.separator()
col.prop(sculpt, "symmetrize_direction")
col.operator("sculpt.symmetrize")
class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
bl_label = "Options"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return (context.sculpt_object and context.tool_settings.sculpt)
def draw(self, context):
layout = self.layout
2012-01-17 17:57:20 +00:00
toolsettings = context.tool_settings
sculpt = toolsettings.sculpt
layout.label(text="Lock:")
row = layout.row(align=True)
row.prop(sculpt, "lock_x", text="X", toggle=True)
row.prop(sculpt, "lock_y", text="Y", toggle=True)
row.prop(sculpt, "lock_z", text="Z", toggle=True)
layout.prop(sculpt, "use_threaded", text="Threaded Sculpt")
layout.prop(sculpt, "show_low_resolution")
layout.prop(sculpt, "use_deform_only")
layout.prop(sculpt, "show_diffuse_color")
self.unified_paint_settings(layout, context)
2010-09-07 15:17:42 +00:00
class VIEW3D_PT_sculpt_symmetry(Panel, View3DPaintPanel):
bl_label = "Symmetry"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return (context.sculpt_object and context.tool_settings.sculpt)
def draw(self, context):
layout = self.layout
sculpt = context.tool_settings.sculpt
col = layout.column(align=True)
col.label(text="Mirror:")
row = col.row(align=True)
row.prop(sculpt, "use_symmetry_x", text="X", toggle=True)
row.prop(sculpt, "use_symmetry_y", text="Y", toggle=True)
row.prop(sculpt, "use_symmetry_z", text="Z", toggle=True)
layout.column().prop(sculpt, "radial_symmetry", text="Radial")
2011-04-01 21:37:40 +00:00
layout.prop(sculpt, "use_symmetry_feather", text="Feather")
2010-09-07 15:17:42 +00:00
class VIEW3D_PT_tools_brush_appearance(Panel, View3DPaintPanel):
bl_label = "Appearance"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
2012-01-17 17:57:20 +00:00
toolsettings = context.tool_settings
return ((context.sculpt_object and toolsettings.sculpt) or
(context.vertex_paint_object and toolsettings.vertex_paint) or
(context.weight_paint_object and toolsettings.weight_paint) or
(context.image_paint_object and toolsettings.image_paint))
def draw(self, context):
layout = self.layout
settings = self.paint_settings(context)
brush = settings.brush
if brush is None: # unlikely but can happen
layout.label(text="Brush Unset")
return
2010-09-07 15:17:42 +00:00
col = layout.column()
2013-06-27 03:05:19 +00:00
col.prop(settings, "show_brush")
col = col.column()
col.active = settings.show_brush
== Sculpt/Paint Fixes == * Fix: unify strength and size did work consistently with other paint modes * Fix: If [ and ] keys were used to resize a brush it was not possible to increase the size of the brush if it went under 10 pixels * Fix: Made interpretation of brush size consistent across all modes, Texture/Image paint interpreted brush size as the diameter while all the other modes interpret it as radius * Fix: The default spacing for vertex paint brushes was 3%, should be 10% * Fix: due to fixes to unified strength, re-enabled 'Unify Size' by default * Fix: Unified size and strength were stored in UserPrefs, moved this to ToolSettings * Fix: The setting of pressure sensitivity was not unified when strength or size were unified. Now the appropriate pressure sensitivity setting is also unified across all brushes when corresponding unification option is selected * Fix: When using [ and ] to resize the brush it didn't immediately redraw * Fix: fkey resizing/"re-strength-ing" was not working consistently accross all paint modes due to only sculpt mode having full support for unified size and strength, now it works properly. * Fix: other paint modes did expose the ability to have a custom brush colors, so I added the small bit of code to allow it. Note: I made all of the other paint mode brushes white. Note2: Actually, probably want to make the paint modes use the selected color for painting instead of a constant brush color. * I had removed OPTYPE_REGISTER from some Sculpt/Paint operators but in this commit I add them back. I'm not completely sure what this option does so I don't want to disturb it for now.
2010-07-22 18:56:46 +00:00
if context.sculpt_object and context.tool_settings.sculpt:
if brush.sculpt_capabilities.has_secondary_color:
col.row().prop(brush, "cursor_color_add", text="Add")
col.row().prop(brush, "cursor_color_subtract", text="Subtract")
else:
col.prop(brush, "cursor_color_add", text="")
== Sculpt/Paint Fixes == * Fix: unify strength and size did work consistently with other paint modes * Fix: If [ and ] keys were used to resize a brush it was not possible to increase the size of the brush if it went under 10 pixels * Fix: Made interpretation of brush size consistent across all modes, Texture/Image paint interpreted brush size as the diameter while all the other modes interpret it as radius * Fix: The default spacing for vertex paint brushes was 3%, should be 10% * Fix: due to fixes to unified strength, re-enabled 'Unify Size' by default * Fix: Unified size and strength were stored in UserPrefs, moved this to ToolSettings * Fix: The setting of pressure sensitivity was not unified when strength or size were unified. Now the appropriate pressure sensitivity setting is also unified across all brushes when corresponding unification option is selected * Fix: When using [ and ] to resize the brush it didn't immediately redraw * Fix: fkey resizing/"re-strength-ing" was not working consistently accross all paint modes due to only sculpt mode having full support for unified size and strength, now it works properly. * Fix: other paint modes did expose the ability to have a custom brush colors, so I added the small bit of code to allow it. Note: I made all of the other paint mode brushes white. Note2: Actually, probably want to make the paint modes use the selected color for painting instead of a constant brush color. * I had removed OPTYPE_REGISTER from some Sculpt/Paint operators but in this commit I add them back. I'm not completely sure what this option does so I don't want to disturb it for now.
2010-07-22 18:56:46 +00:00
else:
col.prop(brush, "cursor_color_add", text="")
layout.separator()
2011-11-02 15:58:56 +00:00
col = layout.column(align=True)
col.prop(brush, "use_custom_icon")
if brush.use_custom_icon:
2011-11-02 15:58:56 +00:00
col.prop(brush, "icon_filepath", text="")
2011-10-17 06:58:07 +00:00
# ********** default tools for weight-paint ****************
class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel):
bl_context = "weightpaint"
bl_label = "Weight Tools"
def draw(self, context):
layout = self.layout
2011-01-01 07:20:34 +00:00
col = layout.column()
col.operator("object.vertex_group_normalize_all", text="Normalize All")
col.operator("object.vertex_group_normalize", text="Normalize")
col.operator("object.vertex_group_mirror", text="Mirror")
col.operator("object.vertex_group_invert", text="Invert")
col.operator("object.vertex_group_clean", text="Clean")
col.operator("object.vertex_group_quantize", text="Quantize")
col.operator("object.vertex_group_levels", text="Levels")
col.operator("object.vertex_group_blend", text="Blend")
col.operator("object.vertex_group_transfer_weight", text="Transfer Weights")
col.operator("object.vertex_group_limit_total", text="Limit Total")
col.operator("object.vertex_group_fix", text="Fix Deforms")
col.operator("paint.weight_gradient")
class VIEW3D_PT_tools_weightpaint_options(Panel, View3DPaintPanel):
bl_context = "weightpaint"
bl_label = "Options"
def draw(self, context):
layout = self.layout
== Sculpt/Paint Fixes == * Fix: unify strength and size did work consistently with other paint modes * Fix: If [ and ] keys were used to resize a brush it was not possible to increase the size of the brush if it went under 10 pixels * Fix: Made interpretation of brush size consistent across all modes, Texture/Image paint interpreted brush size as the diameter while all the other modes interpret it as radius * Fix: The default spacing for vertex paint brushes was 3%, should be 10% * Fix: due to fixes to unified strength, re-enabled 'Unify Size' by default * Fix: Unified size and strength were stored in UserPrefs, moved this to ToolSettings * Fix: The setting of pressure sensitivity was not unified when strength or size were unified. Now the appropriate pressure sensitivity setting is also unified across all brushes when corresponding unification option is selected * Fix: When using [ and ] to resize the brush it didn't immediately redraw * Fix: fkey resizing/"re-strength-ing" was not working consistently accross all paint modes due to only sculpt mode having full support for unified size and strength, now it works properly. * Fix: other paint modes did expose the ability to have a custom brush colors, so I added the small bit of code to allow it. Note: I made all of the other paint mode brushes white. Note2: Actually, probably want to make the paint modes use the selected color for painting instead of a constant brush color. * I had removed OPTYPE_REGISTER from some Sculpt/Paint operators but in this commit I add them back. I'm not completely sure what this option does so I don't want to disturb it for now.
2010-07-22 18:56:46 +00:00
tool_settings = context.tool_settings
wpaint = tool_settings.weight_paint
col = layout.column()
row = col.row()
row.prop(wpaint, "use_all_faces")
row.prop(wpaint, "use_normal")
col = layout.column()
row = col.row()
row.prop(wpaint, "use_spray")
row.prop(wpaint, "use_group_restrict")
obj = context.weight_paint_object
if obj.type == 'MESH':
mesh = obj.data
col.prop(mesh, "use_mirror_x")
row = col.row()
row.active = mesh.use_mirror_x
row.prop(mesh, "use_mirror_topology")
col.label("Show Zero Weights:")
sub = col.row()
sub.active = (not tool_settings.use_multipaint)
sub.prop(tool_settings, "vertex_group_user", expand=True)
self.unified_paint_settings(col, context)
== Sculpt/Paint Fixes == * Fix: unify strength and size did work consistently with other paint modes * Fix: If [ and ] keys were used to resize a brush it was not possible to increase the size of the brush if it went under 10 pixels * Fix: Made interpretation of brush size consistent across all modes, Texture/Image paint interpreted brush size as the diameter while all the other modes interpret it as radius * Fix: The default spacing for vertex paint brushes was 3%, should be 10% * Fix: due to fixes to unified strength, re-enabled 'Unify Size' by default * Fix: Unified size and strength were stored in UserPrefs, moved this to ToolSettings * Fix: The setting of pressure sensitivity was not unified when strength or size were unified. Now the appropriate pressure sensitivity setting is also unified across all brushes when corresponding unification option is selected * Fix: When using [ and ] to resize the brush it didn't immediately redraw * Fix: fkey resizing/"re-strength-ing" was not working consistently accross all paint modes due to only sculpt mode having full support for unified size and strength, now it works properly. * Fix: other paint modes did expose the ability to have a custom brush colors, so I added the small bit of code to allow it. Note: I made all of the other paint mode brushes white. Note2: Actually, probably want to make the paint modes use the selected color for painting instead of a constant brush color. * I had removed OPTYPE_REGISTER from some Sculpt/Paint operators but in this commit I add them back. I'm not completely sure what this option does so I don't want to disturb it for now.
2010-07-22 18:56:46 +00:00
2011-10-17 06:58:07 +00:00
# ********** default tools for vertex-paint ****************
class VIEW3D_PT_tools_vertexpaint(Panel, View3DPaintPanel):
bl_context = "vertexpaint"
bl_label = "Options"
def draw(self, context):
layout = self.layout
2012-01-17 17:57:20 +00:00
toolsettings = context.tool_settings
vpaint = toolsettings.vertex_paint
col = layout.column()
row = col.row()
#col.prop(vpaint, "mode", text="")
row.prop(vpaint, "use_all_faces")
row.prop(vpaint, "use_normal")
col.prop(vpaint, "use_spray")
self.unified_paint_settings(col, context)
== Sculpt/Paint Fixes == * Fix: unify strength and size did work consistently with other paint modes * Fix: If [ and ] keys were used to resize a brush it was not possible to increase the size of the brush if it went under 10 pixels * Fix: Made interpretation of brush size consistent across all modes, Texture/Image paint interpreted brush size as the diameter while all the other modes interpret it as radius * Fix: The default spacing for vertex paint brushes was 3%, should be 10% * Fix: due to fixes to unified strength, re-enabled 'Unify Size' by default * Fix: Unified size and strength were stored in UserPrefs, moved this to ToolSettings * Fix: The setting of pressure sensitivity was not unified when strength or size were unified. Now the appropriate pressure sensitivity setting is also unified across all brushes when corresponding unification option is selected * Fix: When using [ and ] to resize the brush it didn't immediately redraw * Fix: fkey resizing/"re-strength-ing" was not working consistently accross all paint modes due to only sculpt mode having full support for unified size and strength, now it works properly. * Fix: other paint modes did expose the ability to have a custom brush colors, so I added the small bit of code to allow it. Note: I made all of the other paint mode brushes white. Note2: Actually, probably want to make the paint modes use the selected color for painting instead of a constant brush color. * I had removed OPTYPE_REGISTER from some Sculpt/Paint operators but in this commit I add them back. I'm not completely sure what this option does so I don't want to disturb it for now.
2010-07-22 18:56:46 +00:00
# Commented out because the Apply button isn't an operator yet, making these settings useless
#~ col.label(text="Gamma:")
#~ col.prop(vpaint, "gamma", text="")
#~ col.label(text="Multiply:")
#~ col.prop(vpaint, "mul", text="")
2011-10-17 06:58:07 +00:00
# ********** default tools for texture-paint ****************
class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel):
bl_context = "imagepaint"
bl_label = "Project Paint"
@classmethod
def poll(cls, context):
brush = context.tool_settings.image_paint.brush
return (brush is not None)
def draw(self, context):
layout = self.layout
2011-04-04 08:47:31 +00:00
ob = context.active_object
mesh = ob.data
2012-01-17 17:57:20 +00:00
toolsettings = context.tool_settings
ipaint = toolsettings.image_paint
settings = toolsettings.image_paint
col = layout.column()
col.prop(ipaint, "use_occlude")
col.prop(ipaint, "use_backface_culling")
row = layout.row()
row.prop(ipaint, "use_normal_falloff")
sub = row.row()
sub.active = (ipaint.use_normal_falloff)
sub.prop(ipaint, "normal_angle", text="")
split = layout.split()
split.prop(ipaint, "use_stencil_layer", text="Stencil")
row = split.row()
row.active = (ipaint.use_stencil_layer)
stencil_text = mesh.uv_texture_stencil.name if mesh.uv_texture_stencil else ""
row.menu("VIEW3D_MT_tools_projectpaint_stencil", text=stencil_text, translate=False)
row.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA')
col = layout.column()
col.active = (settings.brush.image_tool == 'CLONE')
col.prop(ipaint, "use_clone_layer", text="Clone from UV map")
clone_text = mesh.uv_texture_clone.name if mesh.uv_texture_clone else ""
col.menu("VIEW3D_MT_tools_projectpaint_clone", text=clone_text, translate=False)
layout.prop(ipaint, "seam_bleed")
col = layout.column()
col.label(text="External Editing:")
row = col.split(align=True, percentage=0.55)
row.operator("image.project_edit", text="Quick Edit")
row.operator("image.project_apply", text="Apply")
2010-03-14 23:26:17 +00:00
col.row().prop(ipaint, "screen_grab_size", text="")
2010-03-14 23:26:17 +00:00
col.operator("paint.project_image", text="Apply Camera Image")
col.operator("image.save_dirty", text="Save All Edited")
class VIEW3D_PT_imagepaint_options(View3DPaintPanel):
== Sculpt/Paint Fixes == * Fix: unify strength and size did work consistently with other paint modes * Fix: If [ and ] keys were used to resize a brush it was not possible to increase the size of the brush if it went under 10 pixels * Fix: Made interpretation of brush size consistent across all modes, Texture/Image paint interpreted brush size as the diameter while all the other modes interpret it as radius * Fix: The default spacing for vertex paint brushes was 3%, should be 10% * Fix: due to fixes to unified strength, re-enabled 'Unify Size' by default * Fix: Unified size and strength were stored in UserPrefs, moved this to ToolSettings * Fix: The setting of pressure sensitivity was not unified when strength or size were unified. Now the appropriate pressure sensitivity setting is also unified across all brushes when corresponding unification option is selected * Fix: When using [ and ] to resize the brush it didn't immediately redraw * Fix: fkey resizing/"re-strength-ing" was not working consistently accross all paint modes due to only sculpt mode having full support for unified size and strength, now it works properly. * Fix: other paint modes did expose the ability to have a custom brush colors, so I added the small bit of code to allow it. Note: I made all of the other paint mode brushes white. Note2: Actually, probably want to make the paint modes use the selected color for painting instead of a constant brush color. * I had removed OPTYPE_REGISTER from some Sculpt/Paint operators but in this commit I add them back. I'm not completely sure what this option does so I don't want to disturb it for now.
2010-07-22 18:56:46 +00:00
bl_label = "Options"
bl_options = {'DEFAULT_CLOSED'}
== Sculpt/Paint Fixes == * Fix: unify strength and size did work consistently with other paint modes * Fix: If [ and ] keys were used to resize a brush it was not possible to increase the size of the brush if it went under 10 pixels * Fix: Made interpretation of brush size consistent across all modes, Texture/Image paint interpreted brush size as the diameter while all the other modes interpret it as radius * Fix: The default spacing for vertex paint brushes was 3%, should be 10% * Fix: due to fixes to unified strength, re-enabled 'Unify Size' by default * Fix: Unified size and strength were stored in UserPrefs, moved this to ToolSettings * Fix: The setting of pressure sensitivity was not unified when strength or size were unified. Now the appropriate pressure sensitivity setting is also unified across all brushes when corresponding unification option is selected * Fix: When using [ and ] to resize the brush it didn't immediately redraw * Fix: fkey resizing/"re-strength-ing" was not working consistently accross all paint modes due to only sculpt mode having full support for unified size and strength, now it works properly. * Fix: other paint modes did expose the ability to have a custom brush colors, so I added the small bit of code to allow it. Note: I made all of the other paint mode brushes white. Note2: Actually, probably want to make the paint modes use the selected color for painting instead of a constant brush color. * I had removed OPTYPE_REGISTER from some Sculpt/Paint operators but in this commit I add them back. I'm not completely sure what this option does so I don't want to disturb it for now.
2010-07-22 18:56:46 +00:00
@classmethod
def poll(cls, context):
return (context.image_paint_object and context.tool_settings.image_paint)
== Sculpt/Paint Fixes == * Fix: unify strength and size did work consistently with other paint modes * Fix: If [ and ] keys were used to resize a brush it was not possible to increase the size of the brush if it went under 10 pixels * Fix: Made interpretation of brush size consistent across all modes, Texture/Image paint interpreted brush size as the diameter while all the other modes interpret it as radius * Fix: The default spacing for vertex paint brushes was 3%, should be 10% * Fix: due to fixes to unified strength, re-enabled 'Unify Size' by default * Fix: Unified size and strength were stored in UserPrefs, moved this to ToolSettings * Fix: The setting of pressure sensitivity was not unified when strength or size were unified. Now the appropriate pressure sensitivity setting is also unified across all brushes when corresponding unification option is selected * Fix: When using [ and ] to resize the brush it didn't immediately redraw * Fix: fkey resizing/"re-strength-ing" was not working consistently accross all paint modes due to only sculpt mode having full support for unified size and strength, now it works properly. * Fix: other paint modes did expose the ability to have a custom brush colors, so I added the small bit of code to allow it. Note: I made all of the other paint mode brushes white. Note2: Actually, probably want to make the paint modes use the selected color for painting instead of a constant brush color. * I had removed OPTYPE_REGISTER from some Sculpt/Paint operators but in this commit I add them back. I'm not completely sure what this option does so I don't want to disturb it for now.
2010-07-22 18:56:46 +00:00
def draw(self, context):
layout = self.layout
2011-04-04 22:42:43 +00:00
== Sculpt/Paint Fixes == * Fix: unify strength and size did work consistently with other paint modes * Fix: If [ and ] keys were used to resize a brush it was not possible to increase the size of the brush if it went under 10 pixels * Fix: Made interpretation of brush size consistent across all modes, Texture/Image paint interpreted brush size as the diameter while all the other modes interpret it as radius * Fix: The default spacing for vertex paint brushes was 3%, should be 10% * Fix: due to fixes to unified strength, re-enabled 'Unify Size' by default * Fix: Unified size and strength were stored in UserPrefs, moved this to ToolSettings * Fix: The setting of pressure sensitivity was not unified when strength or size were unified. Now the appropriate pressure sensitivity setting is also unified across all brushes when corresponding unification option is selected * Fix: When using [ and ] to resize the brush it didn't immediately redraw * Fix: fkey resizing/"re-strength-ing" was not working consistently accross all paint modes due to only sculpt mode having full support for unified size and strength, now it works properly. * Fix: other paint modes did expose the ability to have a custom brush colors, so I added the small bit of code to allow it. Note: I made all of the other paint mode brushes white. Note2: Actually, probably want to make the paint modes use the selected color for painting instead of a constant brush color. * I had removed OPTYPE_REGISTER from some Sculpt/Paint operators but in this commit I add them back. I'm not completely sure what this option does so I don't want to disturb it for now.
2010-07-22 18:56:46 +00:00
col = layout.column()
self.unified_paint_settings(col, context)
2010-09-07 15:17:42 +00:00
class VIEW3D_MT_tools_projectpaint_clone(Menu):
bl_label = "Clone Layer"
def draw(self, context):
layout = self.layout
2012-07-29 12:07:06 +00:00
for i, tex in enumerate(context.active_object.data.uv_textures):
props = layout.operator("wm.context_set_int", text=tex.name, translate=False)
props.data_path = "active_object.data.uv_texture_clone_index"
props.value = i
class VIEW3D_MT_tools_projectpaint_stencil(Menu):
bl_label = "Mask Layer"
def draw(self, context):
layout = self.layout
for i, tex in enumerate(context.active_object.data.uv_textures):
props = layout.operator("wm.context_set_int", text=tex.name, translate=False)
props.data_path = "active_object.data.uv_texture_stencil_index"
props.value = i
class VIEW3D_PT_tools_particlemode(View3DPanel, Panel):
"""Default tools for particle mode"""
bl_context = "particlemode"
bl_label = "Options"
def draw(self, context):
layout = self.layout
pe = context.tool_settings.particle_edit
ob = pe.object
layout.prop(pe, "type", text="")
ptcache = None
if pe.type == 'PARTICLES':
if ob.particle_systems:
if len(ob.particle_systems) > 1:
layout.template_list("UI_UL_list", "particle_systems", ob, "particle_systems",
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one). It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels! This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore! To make all this work, other changes were also necessary: * Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox. * DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not. * UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon. * UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews). Note: not sure whether we should add that one to all UILayout's prop funcs? Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
ob.particle_systems, "active_index", rows=2, maxrows=3)
ptcache = ob.particle_systems.active.point_cache
else:
for md in ob.modifiers:
if md.type == pe.type:
ptcache = md.point_cache
2010-08-18 08:26:18 +00:00
if ptcache and len(ptcache.point_caches) > 1:
layout.template_list("UI_UL_list", "particles_point_caches", ptcache, "point_caches",
ptcache.point_caches, "active_index", rows=2, maxrows=3)
2010-08-18 08:26:18 +00:00
if not pe.is_editable:
layout.label(text="Point cache must be baked")
layout.label(text="in memory to enable editing!")
col = layout.column(align=True)
2010-08-18 08:26:18 +00:00
if pe.is_hair:
col.active = pe.is_editable
col.prop(pe, "use_emitter_deflect", text="Deflect emitter")
sub = col.row(align=True)
sub.active = pe.use_emitter_deflect
sub.prop(pe, "emitter_distance", text="Distance")
col = layout.column(align=True)
2010-08-18 08:26:18 +00:00
col.active = pe.is_editable
col.label(text="Keep:")
col.prop(pe, "use_preserve_length", text="Lengths")
col.prop(pe, "use_preserve_root", text="Root")
2010-08-18 08:26:18 +00:00
if not pe.is_hair:
col.label(text="Correct:")
col.prop(pe, "use_auto_velocity", text="Velocity")
col.prop(ob.data, "use_mirror_x")
col = layout.column(align=True)
2010-08-18 08:26:18 +00:00
col.active = pe.is_editable
col.label(text="Draw:")
col.prop(pe, "draw_step", text="Path Steps")
2010-08-18 08:26:18 +00:00
if pe.is_hair:
col.prop(pe, "show_particles", text="Children")
else:
if pe.type == 'PARTICLES':
col.prop(pe, "show_particles", text="Particles")
col.prop(pe, "use_fade_time")
sub = col.row(align=True)
sub.active = pe.use_fade_time
sub.prop(pe, "fade_frames", slider=True)
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)