2009-11-01 15:21:20 +00:00
# ##### 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.
2009-11-03 07:23:02 +00:00
#
2009-11-01 15:21:20 +00:00
# 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.
2009-11-03 07:23:02 +00:00
#
2009-11-01 15:21:20 +00:00
# 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.
2009-11-01 15:21:20 +00:00
#
# ##### END GPL LICENSE BLOCK #####
2009-10-31 20:16:59 +00:00
2009-10-31 23:35:56 +00:00
# <pep8 compliant>
2009-07-02 11:24:27 +00:00
import bpy
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class View3DPanel ( ) :
2009-10-31 19:31:45 +00:00
bl_space_type = ' VIEW_3D '
bl_region_type = ' TOOLS '
2009-08-15 19:40:09 +00:00
2009-10-31 23:35:56 +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
# **************** standard tool clusters ******************
# History/Repeat tools
def draw_repeat_tools ( context , layout ) :
col = layout . column ( align = True )
col . label ( text = " Repeat: " )
col . operator ( " screen.repeat_last " )
col . operator ( " screen.repeat_history " , text = " History... " )
2011-02-04 09:27:25 +00:00
2011-01-26 06:41:44 +00:00
# Keyframing tools
def draw_keyframing_tools ( context , layout ) :
col = layout . column ( align = True )
col . label ( text = " Keyframes: " )
row = col . row ( )
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
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 . label ( text = " Grease Pencil: " )
2011-01-13 23:00:51 +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
row = col . row ( )
row . operator ( " gpencil.draw " , text = " Draw " ) . mode = ' DRAW '
row . operator ( " gpencil.draw " , text = " Line " ) . mode = ' DRAW_STRAIGHT '
row . operator ( " gpencil.draw " , text = " Erase " ) . mode = ' ERASER '
2011-01-13 23:00:51 +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
row = col . row ( )
row . prop ( context . tool_settings , " use_grease_pencil_sessions " )
2009-08-15 19:40:09 +00:00
# ********** default tools for objectmode ****************
2009-07-02 11:24:27 +00:00
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_objectmode ( View3DPanel , bpy . types . Panel ) :
2009-10-31 19:31:45 +00:00
bl_context = " objectmode "
bl_label = " Object Tools "
def draw ( self , context ) :
layout = self . layout
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Transform: " )
2009-12-10 10:36:32 +00:00
col . operator ( " transform.translate " )
col . operator ( " transform.rotate " )
col . operator ( " transform.resize " , text = " Scale " )
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2010-06-22 00:08:05 +00:00
col . operator ( " object.origin_set " , text = " Origin " )
2010-07-05 22:22:22 +00:00
2010-06-22 00:08:05 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Object: " )
col . operator ( " object.duplicate_move " )
col . operator ( " object.delete " )
col . operator ( " object.join " )
2009-10-31 19:31:45 +00:00
2009-10-31 23:35:56 +00:00
active_object = context . active_object
2009-10-31 19:31:45 +00:00
if active_object and active_object . type == ' MESH ' :
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Shading: " )
col . operator ( " object.shade_smooth " , text = " Smooth " )
col . operator ( " object.shade_flat " , text = " Flat " )
2011-02-04 09:27:25 +00:00
2011-01-26 06:41:44 +00:00
draw_keyframing_tools ( context , layout )
2011-02-04 09:27:25 +00:00
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2011-01-26 06:41:44 +00:00
col . label ( text = " Motion Paths: " )
col . operator ( " object.paths_calculate " , text = " Calculate Paths " )
col . operator ( " object.paths_clear " , text = " Clear Paths " )
2009-10-31 19:31:45 +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
draw_repeat_tools ( context , layout )
2009-10-31 19:31:45 +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
draw_gpencil_tools ( context , layout )
2009-07-02 11:24:27 +00:00
# ********** default tools for editmode_mesh ****************
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_meshedit ( View3DPanel , bpy . types . Panel ) :
2009-10-31 19:31:45 +00:00
bl_context = " mesh_edit "
bl_label = " Mesh Tools "
def draw ( self , context ) :
layout = self . layout
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Transform: " )
2009-12-10 10:36:32 +00:00
col . operator ( " transform.translate " )
col . operator ( " transform.rotate " )
col . operator ( " transform.resize " , text = " Scale " )
col . operator ( " transform.shrink_fatten " , text = " Along Normal " )
2009-11-21 00:05:43 +00:00
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Deform: " )
2009-12-10 10:36:32 +00:00
col . operator ( " transform.edge_slide " )
2010-11-07 03:56:58 +00:00
col . operator ( " mesh.noise " )
2009-11-23 00:27:30 +00:00
col . operator ( " mesh.vertices_smooth " )
2009-11-21 00:05:43 +00:00
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Add: " )
2010-02-17 09:33:58 +00:00
col . operator ( " view3d.edit_mesh_extrude_move_normal " , text = " Extrude Region " )
col . operator ( " view3d.edit_mesh_extrude_individual_move " , text = " Extrude Individual " )
2009-11-23 00:27:30 +00:00
col . operator ( " mesh.subdivide " )
2009-11-29 02:14:34 +00:00
col . operator ( " mesh.loopcut_slide " )
2009-11-30 18:26:53 +00:00
col . operator ( " mesh.duplicate_move " , text = " Duplicate " )
2009-11-23 00:27:30 +00:00
col . operator ( " mesh.spin " )
col . operator ( " mesh.screw " )
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Remove: " )
col . operator ( " mesh.delete " )
col . operator ( " mesh.merge " )
col . operator ( " mesh.remove_doubles " )
2009-11-21 00:05:43 +00:00
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Normals: " )
col . operator ( " mesh.normals_make_consistent " , text = " Recalculate " )
col . operator ( " mesh.flip_normals " , text = " Flip Direction " )
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " UV Mapping: " )
2009-11-23 11:43:38 +00:00
col . operator ( " wm.call_menu " , text = " Unwrap " ) . name = " VIEW3D_MT_uv_map "
2009-11-23 00:27:30 +00:00
col . operator ( " mesh.mark_seam " )
2009-11-23 11:43:38 +00:00
col . operator ( " mesh.mark_seam " , text = " Clear Seam " ) . clear = True
2009-11-21 00:05:43 +00:00
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Shading: " )
col . operator ( " mesh.faces_shade_smooth " , text = " Smooth " )
col . operator ( " mesh.faces_shade_flat " , text = " Flat " )
2009-10-31 19:31:45 +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
draw_repeat_tools ( context , layout )
2009-10-31 19:31:45 +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
draw_gpencil_tools ( context , layout )
2009-10-31 19:31:45 +00:00
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_meshedit_options ( View3DPanel , bpy . types . Panel ) :
2009-10-31 19:31:45 +00:00
bl_context = " mesh_edit "
bl_label = " Mesh Options "
def draw ( self , context ) :
layout = self . layout
2009-11-04 16:26:08 +00:00
ob = context . active_object
2009-10-19 13:24:18 +00:00
2009-11-04 16:26:08 +00:00
if ob :
2011-04-04 08:47:31 +00:00
mesh = ob . data
2009-11-04 16:26:08 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . prop ( mesh , " use_mirror_x " )
2011-03-15 09:04:26 +00:00
sub = col . column ( )
sub . active = ob . data . use_mirror_x
sub . prop ( mesh , " use_mirror_topology " )
2011-03-10 05:52:16 +00:00
ts = context . tool_settings
col . label ( " Edge Select Mode " )
col . prop ( ts , " edge_path_mode " , text = " " )
col . prop ( context . tool_settings , " edge_path_live_unwrap " )
2009-07-02 11:24:27 +00:00
# ********** default tools for editmode_curve ****************
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_curveedit ( View3DPanel , bpy . types . Panel ) :
2009-10-31 19:31:45 +00:00
bl_context = " curve_edit "
bl_label = " Curve Tools "
def draw ( self , context ) :
layout = self . layout
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Transform: " )
2009-12-10 10:36:32 +00:00
col . operator ( " transform.translate " )
col . operator ( " transform.rotate " )
col . operator ( " transform.resize " , text = " Scale " )
2009-11-28 23:37:56 +00:00
2009-11-21 13:01:28 +00:00
col = layout . column ( align = True )
2009-12-10 10:36:32 +00:00
col . operator ( " transform.transform " , text = " Tilt " ) . mode = ' TILT '
col . operator ( " transform.transform " , text = " Shrink/Fatten " ) . mode = ' CURVE_SHRINKFATTEN '
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Curve: " )
col . operator ( " curve.duplicate " )
col . operator ( " curve.delete " )
col . operator ( " curve.cyclic_toggle " )
col . operator ( " curve.switch_direction " )
col . operator ( " curve.spline_type_set " )
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Handles: " )
2009-11-21 13:01:28 +00:00
row = col . row ( )
2009-11-23 11:43:38 +00:00
row . operator ( " curve.handle_type_set " , text = " Auto " ) . type = ' AUTOMATIC '
2009-11-28 11:32:09 +00:00
row . operator ( " curve.handle_type_set " , text = " Vector " ) . type = ' VECTOR '
2009-11-21 13:01:28 +00:00
row = col . row ( )
2010-12-14 13:56:10 +00:00
row . operator ( " curve.handle_type_set " , text = " Align " ) . type = ' ALIGNED '
2009-11-23 11:43:38 +00:00
row . operator ( " curve.handle_type_set " , text = " Free " ) . type = ' FREE_ALIGN '
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Modeling: " )
col . operator ( " curve.extrude " )
col . operator ( " curve.subdivide " )
2009-10-31 19:31:45 +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
draw_repeat_tools ( context , layout )
2009-10-31 19:31:45 +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
draw_gpencil_tools ( context , layout )
2009-07-02 11:24:27 +00:00
# ********** default tools for editmode_surface ****************
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_surfaceedit ( View3DPanel , bpy . types . Panel ) :
2009-10-31 19:31:45 +00:00
bl_context = " surface_edit "
bl_label = " Surface Tools "
def draw ( self , context ) :
layout = self . layout
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Transform: " )
2009-12-10 10:36:32 +00:00
col . operator ( " transform.translate " )
col . operator ( " transform.rotate " )
col . operator ( " transform.resize " , text = " Scale " )
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Curve: " )
col . operator ( " curve.duplicate " )
col . operator ( " curve.delete " )
col . operator ( " curve.cyclic_toggle " )
col . operator ( " curve.switch_direction " )
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Modeling: " )
col . operator ( " curve.extrude " )
col . operator ( " curve.subdivide " )
2009-10-31 19:31:45 +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
draw_repeat_tools ( context , layout )
2009-10-31 19:31:45 +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
draw_gpencil_tools ( context , layout )
2009-07-02 11:24:27 +00:00
# ********** default tools for editmode_text ****************
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_textedit ( View3DPanel , bpy . types . Panel ) :
2009-10-31 19:31:45 +00:00
bl_context = " text_edit "
bl_label = " Text Tools "
def draw ( self , context ) :
layout = self . layout
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
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 " )
2009-11-21 00:05:43 +00:00
2009-11-17 12:59:55 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Set Case: " )
2009-11-23 11:43:38 +00:00
col . operator ( " font.case_set " , text = " To Upper " ) . case = ' UPPER '
col . operator ( " font.case_set " , text = " To Lower " ) . case = ' LOWER '
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Style: " )
2009-11-28 11:32:09 +00:00
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 '
2009-10-31 19:31:45 +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
draw_repeat_tools ( context , layout )
2009-11-17 12:59:55 +00:00
2009-07-02 11:24:27 +00:00
# ********** default tools for editmode_armature ****************
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_armatureedit ( View3DPanel , bpy . types . Panel ) :
2009-10-31 19:31:45 +00:00
bl_context = " armature_edit "
bl_label = " Armature Tools "
def draw ( self , context ) :
layout = self . layout
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Transform: " )
2009-12-10 10:36:32 +00:00
col . operator ( " transform.translate " )
col . operator ( " transform.rotate " )
col . operator ( " transform.resize " , text = " Scale " )
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
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 " )
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Modeling: " )
col . operator ( " armature.extrude_move " )
2010-10-15 03:24:47 +00:00
col . operator ( " armature.subdivide " , text = " Subdivide " )
2009-10-31 19:31:45 +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
draw_repeat_tools ( context , layout )
2009-10-31 19:31:45 +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
draw_gpencil_tools ( context , layout )
2009-10-31 19:31:45 +00:00
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_armatureedit_options ( View3DPanel , bpy . types . Panel ) :
2009-10-31 19:31:45 +00:00
bl_context = " armature_edit "
bl_label = " Armature Options "
def draw ( self , context ) :
arm = context . active_object . data
2009-10-27 12:46:20 +00:00
2011-04-01 21:37:40 +00:00
self . layout . prop ( arm , " use_mirror_x " )
2009-07-24 21:01:41 +00:00
2009-07-02 11:24:27 +00:00
# ********** default tools for editmode_mball ****************
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_mballedit ( View3DPanel , bpy . types . Panel ) :
2009-10-31 19:31:45 +00:00
bl_context = " mball_edit "
bl_label = " Meta Tools "
def draw ( self , context ) :
layout = self . layout
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Transform: " )
2009-12-10 10:36:32 +00:00
col . operator ( " transform.translate " )
col . operator ( " transform.rotate " )
col . operator ( " transform.resize " , text = " Scale " )
2009-10-31 19:31:45 +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
draw_repeat_tools ( context , layout )
2009-10-31 19:31:45 +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
draw_gpencil_tools ( context , layout )
2009-07-02 11:24:27 +00:00
# ********** default tools for editmode_lattice ****************
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_latticeedit ( View3DPanel , bpy . types . Panel ) :
2009-10-31 19:31:45 +00:00
bl_context = " lattice_edit "
bl_label = " Lattice Tools "
def draw ( self , context ) :
layout = self . layout
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Transform: " )
2009-12-10 10:36:32 +00:00
col . operator ( " transform.translate " )
col . operator ( " transform.rotate " )
col . operator ( " transform.resize " , text = " Scale " )
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . operator ( " lattice.make_regular " )
2009-10-31 19:31:45 +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
draw_repeat_tools ( context , layout )
2009-11-21 00:05:43 +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
draw_gpencil_tools ( context , layout )
2009-11-17 12:59:55 +00:00
2009-07-02 11:24:27 +00:00
# ********** default tools for posemode ****************
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_posemode ( View3DPanel , bpy . types . Panel ) :
2009-10-31 19:31:45 +00:00
bl_context = " posemode "
bl_label = " Pose Tools "
def draw ( self , context ) :
layout = self . layout
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Transform: " )
2009-12-10 10:36:32 +00:00
col . operator ( " transform.translate " )
col . operator ( " transform.rotate " )
col . operator ( " transform.resize " , text = " Scale " )
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " In-Between: " )
2009-11-17 22:46:42 +00:00
row = col . row ( )
2009-11-23 00:27:30 +00:00
row . operator ( " pose.push " , text = " Push " )
row . operator ( " pose.relax " , text = " Relax " )
col . operator ( " pose.breakdown " , text = " Breakdowner " )
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Pose: " )
2009-11-17 12:59:55 +00:00
row = col . row ( )
2009-11-23 00:27:30 +00:00
row . operator ( " pose.copy " , text = " Copy " )
row . operator ( " pose.paste " , text = " Paste " )
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2009-11-23 00:27:30 +00:00
col . operator ( " poselib.pose_add " , text = " Add To Library " )
2009-10-31 19:31:45 +00:00
2011-01-26 06:41:44 +00:00
draw_keyframing_tools ( context , layout )
2011-02-04 09:27:25 +00:00
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2011-01-26 06:41:44 +00:00
col . label ( text = " Motion Paths: " )
col . operator ( " pose.paths_calculate " , text = " Calculate Paths " )
col . operator ( " pose.paths_clear " , text = " Clear Paths " )
2009-10-31 19:31:45 +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
draw_repeat_tools ( context , layout )
2009-10-31 19:31:45 +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
draw_gpencil_tools ( context , layout )
2009-10-31 19:31:45 +00:00
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_posemode_options ( View3DPanel , bpy . types . Panel ) :
2009-10-31 19:31:45 +00:00
bl_context = " posemode "
bl_label = " Pose Options "
def draw ( self , context ) :
arm = context . active_object . data
2009-10-19 13:24:18 +00:00
2011-04-01 21:37:40 +00:00
self . layout . prop ( arm , " use_auto_ik " )
2009-07-02 11:24:27 +00:00
2009-07-24 11:14:59 +00:00
# ********** default tools for paint modes ****************
2009-07-02 11:24:27 +00:00
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class PaintPanel ( ) :
2009-10-31 19:31:45 +00:00
bl_space_type = ' VIEW_3D '
bl_region_type = ' TOOLS '
2009-07-20 16:39:16 +00:00
2010-08-05 16:05:30 +00:00
@staticmethod
def paint_settings ( context ) :
2009-10-31 19:31:45 +00:00
ts = context . tool_settings
2009-07-25 22:31:02 +00:00
2009-10-31 19:31:45 +00:00
if context . sculpt_object :
return ts . sculpt
elif context . vertex_paint_object :
return ts . vertex_paint
elif context . weight_paint_object :
return ts . weight_paint
2011-04-01 04:22:30 +00:00
elif context . image_paint_object :
2009-10-31 19:31:45 +00:00
return ts . image_paint
elif context . particle_edit_object :
return ts . particle_edit
2009-07-25 22:31:02 +00:00
2010-08-10 18:21:33 +00:00
return None
2009-07-20 16:39:16 +00:00
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_brush ( PaintPanel , bpy . types . Panel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Brush "
2010-08-09 01:37:09 +00:00
@classmethod
def poll ( cls , context ) :
return cls . paint_settings ( context )
2009-10-31 19:31:45 +00:00
def draw ( self , context ) :
layout = self . layout
2010-08-05 16:05:30 +00:00
settings = __class__ . paint_settings ( context )
2009-10-31 19:31:45 +00:00
brush = settings . brush
if not context . particle_edit_object :
col = layout . split ( ) . column ( )
2010-08-04 12:18:07 +00:00
col . template_ID_preview ( settings , " brush " , new = " brush.add " , rows = 3 , cols = 8 )
2009-10-31 19:31:45 +00:00
# Particle Mode #
# XXX This needs a check if psys is editable.
if context . particle_edit_object :
# XXX Select Particle System
2009-11-23 00:27:30 +00:00
layout . column ( ) . prop ( settings , " tool " , expand = True )
2009-10-31 19:31:45 +00:00
if settings . tool != ' NONE ' :
col = layout . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( brush , " size " , slider = True )
2010-03-22 17:12:08 +00:00
if settings . tool != ' ADD ' :
col . prop ( brush , " strength " , slider = True )
2009-10-31 19:31:45 +00:00
if settings . tool == ' ADD ' :
2010-03-22 17:12:08 +00:00
col . prop ( brush , " count " )
2009-10-31 19:31:45 +00:00
col = layout . column ( )
2010-08-20 06:09:58 +00:00
col . prop ( settings , " use_default_interpolate " )
2009-10-31 19:31:45 +00:00
sub = col . column ( align = True )
2010-08-20 06:09:58 +00:00
sub . active = settings . use_default_interpolate
2009-11-23 00:27:30 +00:00
sub . prop ( brush , " steps " , slider = True )
2010-08-20 06:09:58 +00:00
sub . prop ( settings , " default_key_count " , slider = True )
2009-10-31 19:31:45 +00:00
elif settings . tool == ' LENGTH ' :
2009-11-23 00:27:30 +00:00
layout . prop ( brush , " length_mode " , expand = True )
2009-10-31 19:31:45 +00:00
elif settings . tool == ' PUFF ' :
2009-11-23 00:27:30 +00:00
layout . prop ( brush , " puff_mode " , expand = True )
2010-01-12 16:35:34 +00:00
layout . prop ( brush , " use_puff_volume " )
2009-10-31 19:31:45 +00:00
# Sculpt Mode #
elif context . sculpt_object and brush :
2010-07-14 14:11:03 +00:00
2009-10-31 19:31:45 +00:00
col = layout . column ( )
2010-07-14 14:11:03 +00:00
2009-11-23 00:27:30 +00:00
col . separator ( )
2009-12-29 00:04:57 +00:00
2009-10-31 19:31:45 +00:00
row = col . row ( align = True )
2010-07-22 18:56:46 +00:00
if brush . use_locked_size :
row . prop ( brush , " use_locked_size " , toggle = True , text = " " , icon = ' LOCKED ' )
row . prop ( brush , " unprojected_radius " , text = " Radius " , slider = True )
2010-07-14 14:11:03 +00:00
else :
2010-07-22 18:56:46 +00:00
row . prop ( brush , " use_locked_size " , toggle = True , text = " " , icon = ' UNLOCKED ' )
2011-04-01 20:36:27 +00:00
row . prop ( brush , " size " , slider = True )
2010-07-14 14:11:03 +00:00
2010-08-18 03:56:14 +00:00
row . prop ( brush , " use_pressure_size " , toggle = True , text = " " )
2010-07-14 14:11:03 +00:00
2011-03-07 13:23:45 +00:00
if brush . sculpt_tool not in { ' SNAKE_HOOK ' , ' GRAB ' , ' ROTATE ' } :
2010-07-14 14:11:03 +00:00
col . separator ( )
2010-01-04 16:53:32 +00:00
2009-10-31 19:31:45 +00:00
row = col . row ( align = True )
2010-07-14 14:11:03 +00:00
2011-03-07 13:23:45 +00:00
if brush . use_space and brush . sculpt_tool not in { ' SMOOTH ' } :
2010-07-14 14:11:03 +00:00
if brush . use_space_atten :
row . prop ( brush , " use_space_atten " , toggle = True , text = " " , icon = ' LOCKED ' )
else :
row . prop ( brush , " use_space_atten " , toggle = True , text = " " , icon = ' UNLOCKED ' )
2010-07-22 18:56:46 +00:00
row . prop ( brush , " strength " , text = " Strength " , slider = True )
2010-08-18 03:56:14 +00:00
row . prop ( brush , " use_pressure_strength " , text = " " )
2009-10-31 19:31:45 +00:00
2011-03-07 13:23:45 +00:00
if brush . sculpt_tool not in { ' SMOOTH ' } :
2010-07-14 14:11:03 +00:00
col . separator ( )
row = col . row ( align = True )
2010-08-18 03:56:14 +00:00
row . prop ( brush , " auto_smooth_factor " , slider = True )
2010-07-14 14:11:03 +00:00
row . prop ( brush , " use_inverse_smooth_pressure " , toggle = True , text = " " )
2011-03-07 13:23:45 +00:00
if brush . sculpt_tool in { ' GRAB ' , ' SNAKE_HOOK ' } :
2010-07-14 14:11:03 +00:00
col . separator ( )
row = col . row ( align = True )
row . prop ( brush , " normal_weight " , slider = True )
2011-03-07 13:23:45 +00:00
if brush . sculpt_tool in { ' CREASE ' , ' BLOB ' } :
2010-07-14 14:11:03 +00:00
col . separator ( )
row = col . row ( align = True )
row . prop ( brush , " crease_pinch_factor " , slider = True , text = " Pinch " )
2011-03-07 13:23:45 +00:00
if brush . sculpt_tool not in { ' PINCH ' , ' INFLATE ' , ' SMOOTH ' } :
2010-07-14 14:11:03 +00:00
row = col . row ( align = True )
col . separator ( )
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 = " " )
2011-03-07 13:23:45 +00:00
#if brush.sculpt_tool in {'CLAY', 'CLAY_TUBES', 'FLATTEN', 'FILL', 'SCRAPE'}:
if brush . sculpt_tool in { ' CLAY ' , ' FLATTEN ' , ' FILL ' , ' SCRAPE ' } :
2010-07-14 14:11:03 +00:00
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 ( )
2010-07-14 14:11:03 +00:00
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
2010-07-14 14:11:03 +00:00
row . prop ( brush , " plane_trim " , slider = True , text = " Distance " )
2011-02-25 16:54:09 +00:00
if brush . sculpt_tool == ' LAYER ' :
row = col . row ( )
row . prop ( brush , " height " , slider = True , text = " Height " )
2010-07-14 14:11:03 +00:00
col . separator ( )
2010-09-07 15:17:42 +00:00
row = col . row ( )
2010-07-14 14:11:03 +00:00
row . prop ( brush , " use_frontface " , text = " Front Faces Only " )
2010-07-26 05:25:09 +00:00
col . separator ( )
col . row ( ) . prop ( brush , " direction " , expand = True )
2010-07-14 14:11:03 +00:00
2011-03-07 13:23:45 +00:00
if brush . sculpt_tool in { ' DRAW ' , ' CREASE ' , ' BLOB ' , ' INFLATE ' , ' LAYER ' , ' CLAY ' } :
2010-07-14 14:11:03 +00:00
col . separator ( )
2009-10-31 19:31:45 +00:00
2010-07-14 14:11:03 +00:00
col . prop ( brush , " use_accumulate " )
2009-11-06 16:46:35 +00:00
2010-07-14 14:11:03 +00:00
if brush . sculpt_tool == ' LAYER ' :
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
if do_persistent :
col . prop ( brush , " use_persistent " )
col . operator ( " sculpt.set_persistent_base " )
2009-10-31 19:31:45 +00:00
# Texture Paint Mode #
2011-04-01 04:22:30 +00:00
elif context . image_paint_object and brush :
2009-10-31 19:31:45 +00:00
col = layout . column ( )
2010-01-07 09:55:11 +00:00
col . template_color_wheel ( brush , " color " , value_slider = True )
2009-11-23 00:27:30 +00:00
col . prop ( brush , " color " , text = " " )
2009-10-31 19:31:45 +00:00
row = col . row ( align = True )
2011-04-01 20:36:27 +00:00
row . prop ( brush , " size " , slider = True )
2010-08-18 03:56:14 +00:00
row . prop ( brush , " use_pressure_size " , toggle = True , text = " " )
2009-10-31 19:31:45 +00:00
row = col . row ( align = True )
2010-07-22 18:56:46 +00:00
row . prop ( brush , " strength " , text = " Strength " , slider = True )
2010-08-18 03:56:14 +00:00
row . prop ( brush , " use_pressure_strength " , toggle = True , text = " " )
2009-10-31 19:31:45 +00:00
row = col . row ( align = True )
2009-11-23 00:27:30 +00:00
row . prop ( brush , " jitter " , slider = True )
2010-08-18 03:56:14 +00:00
row . prop ( brush , " use_pressure_jitter " , toggle = True , text = " " )
2009-10-31 19:31:45 +00:00
2009-11-23 00:27:30 +00:00
col . prop ( brush , " blend " , text = " Blend " )
2009-10-31 19:31:45 +00:00
2010-03-16 18:05:53 +00:00
col = layout . column ( )
2011-03-07 13:23:45 +00:00
col . active = ( brush . blend not in { ' ERASE_ALPHA ' , ' ADD_ALPHA ' } )
2010-03-16 18:05:53 +00:00
col . prop ( brush , " use_alpha " )
2010-04-04 14:52:15 +00:00
2009-10-31 19:31:45 +00:00
# Weight Paint Mode #
elif context . weight_paint_object and brush :
2009-11-23 00:27:30 +00:00
layout . prop ( context . tool_settings , " vertex_group_weight " , text = " Weight " , slider = True )
2010-08-18 03:24:52 +00:00
layout . prop ( context . tool_settings , " use_auto_normalize " , text = " Auto Normalize " )
2009-10-31 19:31:45 +00:00
col = layout . column ( )
2010-07-22 18:56:46 +00:00
2009-10-31 19:31:45 +00:00
row = col . row ( align = True )
2011-04-01 20:36:27 +00:00
row . prop ( brush , " size " , slider = True )
2010-08-18 03:56:14 +00:00
row . prop ( brush , " use_pressure_size " , toggle = True , text = " " )
2009-10-31 19:31:45 +00:00
row = col . row ( align = True )
2010-07-22 18:56:46 +00:00
row . prop ( brush , " strength " , text = " Strength " , slider = True )
2010-08-18 03:56:14 +00:00
row . prop ( brush , " use_pressure_strength " , toggle = True , text = " " )
2009-10-31 19:31:45 +00:00
row = col . row ( align = True )
2009-11-23 00:27:30 +00:00
row . prop ( brush , " jitter " , slider = True )
2010-08-18 03:56:14 +00:00
row . prop ( brush , " use_pressure_jitter " , toggle = True , text = " " )
2009-10-31 19:31:45 +00:00
# Vertex Paint Mode #
elif context . vertex_paint_object and brush :
col = layout . column ( )
2010-01-07 09:55:11 +00:00
col . template_color_wheel ( brush , " color " , value_slider = True )
2009-11-23 00:27:30 +00:00
col . prop ( brush , " color " , text = " " )
2009-10-31 19:31:45 +00:00
row = col . row ( align = True )
2011-04-01 20:36:27 +00:00
row . prop ( brush , " size " , slider = True )
2010-08-18 03:56:14 +00:00
row . prop ( brush , " use_pressure_size " , toggle = True , text = " " )
2009-10-31 19:31:45 +00:00
row = col . row ( align = True )
2010-07-22 18:56:46 +00:00
row . prop ( brush , " strength " , text = " Strength " , slider = True )
2010-08-18 03:56:14 +00:00
row . prop ( brush , " use_pressure_strength " , toggle = True , text = " " )
2009-10-31 19:31:45 +00:00
2009-11-14 13:35:44 +00:00
# XXX - TODO
#row = col.row(align=True)
2009-11-23 00:27:30 +00:00
#row.prop(brush, "jitter", slider=True)
2010-08-18 03:56:14 +00:00
#row.prop(brush, "use_pressure_jitter", toggle=True, text="")
2009-07-25 22:31:02 +00:00
2010-01-03 08:37:18 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_brush_texture ( PaintPanel , bpy . types . Panel ) :
2010-01-03 08:37:18 +00:00
bl_label = " Texture "
2010-08-26 01:05:37 +00:00
bl_options = { ' DEFAULT_CLOSED ' }
2010-01-03 08:37:18 +00:00
2010-08-09 01:37:09 +00:00
@classmethod
def poll ( cls , context ) :
settings = cls . paint_settings ( context )
2010-01-03 08:37:18 +00:00
return ( settings and settings . brush and ( context . sculpt_object or
2011-04-01 04:22:30 +00:00
context . image_paint_object ) )
2010-01-03 08:37:18 +00:00
def draw ( self , context ) :
layout = self . layout
2010-08-05 16:05:30 +00:00
settings = __class__ . paint_settings ( context )
2010-01-03 08:37:18 +00:00
brush = settings . brush
tex_slot = brush . texture_slot
2010-01-31 14:46:28 +00:00
2010-01-03 08:37:18 +00:00
col = layout . column ( )
2010-01-31 14:46:28 +00:00
2010-07-14 14:11:03 +00:00
col . template_ID_preview ( brush , " texture " , new = " texture.new " , rows = 3 , cols = 8 )
2011-04-01 04:22:30 +00:00
if brush . use_paint_image :
2011-03-01 17:58:12 +00:00
col . prop ( brush , " use_fixed_texture " )
2010-01-31 14:46:28 +00:00
2010-04-06 05:52:52 +00:00
if context . sculpt_object :
2010-07-14 14:11:03 +00:00
#XXX duplicated from properties_texture.py
col . separator ( )
col . label ( text = " Brush Mapping: " )
row = col . row ( align = True )
row . prop ( tex_slot , " map_mode " , expand = True )
col . separator ( )
col = layout . column ( )
2011-03-07 13:23:45 +00:00
col . active = tex_slot . map_mode in { ' FIXED ' }
2010-07-14 14:11:03 +00:00
col . label ( text = " Angle: " )
2010-09-07 15:17:42 +00:00
2010-07-14 14:11:03 +00:00
col = layout . column ( )
2011-03-07 13:23:45 +00:00
if not brush . use_anchor and brush . sculpt_tool not in { ' GRAB ' , ' SNAKE_HOOK ' , ' THUMB ' , ' ROTATE ' } and tex_slot . map_mode in { ' FIXED ' } :
2010-08-18 03:56:14 +00:00
col . prop ( brush , " texture_angle_source_random " , text = " " )
2010-07-14 14:11:03 +00:00
else :
col . prop ( brush , " texture_angle_source_no_random " , text = " " )
#row = col.row(align=True)
#row.label(text="Angle:")
2011-03-07 13:23:45 +00:00
#row.active = tex_slot.map_mode in {'FIXED', 'TILED'}
2010-07-14 14:11:03 +00:00
#row = col.row(align=True)
#col = row.column()
2011-03-07 13:23:45 +00:00
#col.active = tex_slot.map_mode in {'FIXED'}
2010-07-14 14:11:03 +00:00
#col.prop(brush, "use_rake", toggle=True, icon='PARTICLEMODE', text="")
col = layout . column ( )
col . prop ( tex_slot , " angle " , text = " " )
2011-03-07 13:23:45 +00:00
col . active = tex_slot . map_mode in { ' FIXED ' , ' TILED ' }
2010-07-14 14:11:03 +00:00
#col = layout.column()
#col.prop(brush, "use_random_rotation")
2011-03-07 13:23:45 +00:00
#col.active = (not brush.use_rake) and (not brush.use_anchor) and (brush.sculpt_tool not in {'GRAB', 'SNAKE_HOOK', 'THUMB', 'ROTATE'}) and tex_slot.map_mode in {'FIXED'}
2010-07-14 14:11:03 +00:00
split = layout . split ( )
col = split . column ( )
col . prop ( tex_slot , " offset " )
2010-08-06 15:17:44 +00:00
col = split . column ( )
2010-07-14 14:11:03 +00:00
2010-09-23 12:50:45 +00:00
col . prop ( tex_slot , " scale " )
2010-07-14 14:11:03 +00:00
col = layout . column ( )
row = col . row ( align = True )
row . label ( text = " Sample Bias: " )
row = col . row ( align = True )
row . prop ( brush , " texture_sample_bias " , slider = True , text = " " )
row = col . row ( align = True )
row . label ( text = " Overlay: " )
2011-03-07 13:23:45 +00:00
row . active = tex_slot . map_mode in { ' FIXED ' , ' TILED ' }
2010-07-14 14:11:03 +00:00
row = col . row ( align = True )
col = row . column ( )
if brush . use_texture_overlay :
col . prop ( brush , " use_texture_overlay " , toggle = True , text = " " , icon = ' MUTE_IPO_OFF ' )
else :
col . prop ( brush , " use_texture_overlay " , toggle = True , text = " " , icon = ' MUTE_IPO_ON ' )
2011-03-07 13:23:45 +00:00
col . active = tex_slot . map_mode in { ' FIXED ' , ' TILED ' }
2010-07-14 14:11:03 +00:00
col = row . column ( )
col . prop ( brush , " texture_overlay_alpha " , text = " Alpha " )
2011-03-07 13:23:45 +00:00
col . active = tex_slot . map_mode in { ' FIXED ' , ' TILED ' } and brush . use_texture_overlay
2010-01-31 14:46:28 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_brush_tool ( PaintPanel , bpy . types . Panel ) :
Change to the way brush/tool selection works, as discussed a while ago
Now, there are preset brushes made for each tool type (eg. for sculpt mode, Grab,
Draw, Inflate, etc), and the recommended method for changing sculpt tools is to
change between Brushes. The shortcut keys for changing between tools have
now been changed to change between named brushes - the G key in sculpt
mode now changes to any brush named 'Grab'.
The advantages of this are:
* Changing between brushes remembers the strength/size/texture etc settings for
each brush. This means that for example, you can draw with a strong textured
Clay brush, but then switch quickly to a weaker, untextured Smooth brush,
without having to re-do your settings each time.
* You can now add your own custom shortcut keys to your own custom brushes -
just add a keymap entry similar to the existing ones, that references your own
custom brush names.
To bring over these new default brushes to an existing B.blend setup, just
append them in from the new B.blend in svn.
2009-12-28 01:27:05 +00:00
bl_label = " Tool "
2010-08-26 01:05:37 +00:00
bl_options = { ' DEFAULT_CLOSED ' }
Change to the way brush/tool selection works, as discussed a while ago
Now, there are preset brushes made for each tool type (eg. for sculpt mode, Grab,
Draw, Inflate, etc), and the recommended method for changing sculpt tools is to
change between Brushes. The shortcut keys for changing between tools have
now been changed to change between named brushes - the G key in sculpt
mode now changes to any brush named 'Grab'.
The advantages of this are:
* Changing between brushes remembers the strength/size/texture etc settings for
each brush. This means that for example, you can draw with a strong textured
Clay brush, but then switch quickly to a weaker, untextured Smooth brush,
without having to re-do your settings each time.
* You can now add your own custom shortcut keys to your own custom brushes -
just add a keymap entry similar to the existing ones, that references your own
custom brush names.
To bring over these new default brushes to an existing B.blend setup, just
append them in from the new B.blend in svn.
2009-12-28 01:27:05 +00:00
2010-08-09 01:37:09 +00:00
@classmethod
def poll ( cls , context ) :
settings = cls . paint_settings ( context )
2010-01-20 08:30:40 +00:00
return ( settings and settings . brush and
2011-04-01 04:22:30 +00:00
( context . sculpt_object or context . image_paint_object or
2010-01-20 08:30:40 +00:00
context . vertex_paint_object or context . weight_paint_object ) )
Change to the way brush/tool selection works, as discussed a while ago
Now, there are preset brushes made for each tool type (eg. for sculpt mode, Grab,
Draw, Inflate, etc), and the recommended method for changing sculpt tools is to
change between Brushes. The shortcut keys for changing between tools have
now been changed to change between named brushes - the G key in sculpt
mode now changes to any brush named 'Grab'.
The advantages of this are:
* Changing between brushes remembers the strength/size/texture etc settings for
each brush. This means that for example, you can draw with a strong textured
Clay brush, but then switch quickly to a weaker, untextured Smooth brush,
without having to re-do your settings each time.
* You can now add your own custom shortcut keys to your own custom brushes -
just add a keymap entry similar to the existing ones, that references your own
custom brush names.
To bring over these new default brushes to an existing B.blend setup, just
append them in from the new B.blend in svn.
2009-12-28 01:27:05 +00:00
def draw ( self , context ) :
layout = self . layout
2010-08-05 16:05:30 +00:00
settings = __class__ . paint_settings ( context )
Change to the way brush/tool selection works, as discussed a while ago
Now, there are preset brushes made for each tool type (eg. for sculpt mode, Grab,
Draw, Inflate, etc), and the recommended method for changing sculpt tools is to
change between Brushes. The shortcut keys for changing between tools have
now been changed to change between named brushes - the G key in sculpt
mode now changes to any brush named 'Grab'.
The advantages of this are:
* Changing between brushes remembers the strength/size/texture etc settings for
each brush. This means that for example, you can draw with a strong textured
Clay brush, but then switch quickly to a weaker, untextured Smooth brush,
without having to re-do your settings each time.
* You can now add your own custom shortcut keys to your own custom brushes -
just add a keymap entry similar to the existing ones, that references your own
custom brush names.
To bring over these new default brushes to an existing B.blend setup, just
append them in from the new B.blend in svn.
2009-12-28 01:27:05 +00:00
brush = settings . brush
col = layout . column ( align = True )
2009-12-29 00:04:57 +00:00
Change to the way brush/tool selection works, as discussed a while ago
Now, there are preset brushes made for each tool type (eg. for sculpt mode, Grab,
Draw, Inflate, etc), and the recommended method for changing sculpt tools is to
change between Brushes. The shortcut keys for changing between tools have
now been changed to change between named brushes - the G key in sculpt
mode now changes to any brush named 'Grab'.
The advantages of this are:
* Changing between brushes remembers the strength/size/texture etc settings for
each brush. This means that for example, you can draw with a strong textured
Clay brush, but then switch quickly to a weaker, untextured Smooth brush,
without having to re-do your settings each time.
* You can now add your own custom shortcut keys to your own custom brushes -
just add a keymap entry similar to the existing ones, that references your own
custom brush names.
To bring over these new default brushes to an existing B.blend setup, just
append them in from the new B.blend in svn.
2009-12-28 01:27:05 +00:00
if context . sculpt_object :
2010-07-14 14:11:03 +00:00
col . prop ( brush , " sculpt_tool " , expand = False , text = " " )
2010-07-27 16:09:02 +00:00
col . operator ( " brush.reset " )
2011-04-01 04:22:30 +00:00
elif context . image_paint_object :
col . prop ( brush , " image_tool " , expand = False , text = " " )
2010-01-20 08:30:40 +00:00
elif context . vertex_paint_object or context . weight_paint_object :
2011-04-01 04:22:30 +00:00
col . prop ( brush , " vertex_tool " , expand = False , text = " " )
Change to the way brush/tool selection works, as discussed a while ago
Now, there are preset brushes made for each tool type (eg. for sculpt mode, Grab,
Draw, Inflate, etc), and the recommended method for changing sculpt tools is to
change between Brushes. The shortcut keys for changing between tools have
now been changed to change between named brushes - the G key in sculpt
mode now changes to any brush named 'Grab'.
The advantages of this are:
* Changing between brushes remembers the strength/size/texture etc settings for
each brush. This means that for example, you can draw with a strong textured
Clay brush, but then switch quickly to a weaker, untextured Smooth brush,
without having to re-do your settings each time.
* You can now add your own custom shortcut keys to your own custom brushes -
just add a keymap entry similar to the existing ones, that references your own
custom brush names.
To bring over these new default brushes to an existing B.blend setup, just
append them in from the new B.blend in svn.
2009-12-28 01:27:05 +00:00
2010-08-04 12:18:07 +00:00
row = layout . row ( align = True )
row . prop ( brush , " use_paint_sculpt " , text = " " , icon = ' SCULPTMODE_HLT ' )
row . prop ( brush , " use_paint_vertex " , text = " " , icon = ' VPAINT_HLT ' )
row . prop ( brush , " use_paint_weight " , text = " " , icon = ' WPAINT_HLT ' )
2011-04-01 04:22:30 +00:00
row . prop ( brush , " use_paint_image " , text = " " , icon = ' TPAINT_HLT ' )
2010-08-04 12:18:07 +00:00
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_brush_stroke ( PaintPanel , bpy . types . Panel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Stroke "
2010-08-26 01:05:37 +00:00
bl_options = { ' DEFAULT_CLOSED ' }
2009-10-31 19:31:45 +00:00
2010-08-09 01:37:09 +00:00
@classmethod
def poll ( cls , context ) :
settings = cls . paint_settings ( context )
2009-10-31 19:31:45 +00:00
return ( settings and settings . brush and ( context . sculpt_object or
context . vertex_paint_object or
context . weight_paint_object or
2011-04-01 04:22:30 +00:00
context . image_paint_object ) )
2009-10-31 19:31:45 +00:00
def draw ( self , context ) :
layout = self . layout
2010-08-05 16:05:30 +00:00
settings = __class__ . paint_settings ( context )
2009-10-31 19:31:45 +00:00
brush = settings . brush
2011-04-01 04:22:30 +00:00
image_paint = context . image_paint_object
2009-10-31 19:31:45 +00:00
2010-07-14 14:11:03 +00:00
col = layout . column ( )
2009-10-31 19:31:45 +00:00
if context . sculpt_object :
2010-07-14 14:11:03 +00:00
col . label ( text = " Stroke Method: " )
col . prop ( brush , " stroke_method " , text = " " )
if brush . use_anchor :
col . separator ( )
row = col . row ( )
2010-08-18 03:56:14 +00:00
row . prop ( brush , " use_edge_to_edge " , " Edge To Edge " )
2010-07-14 14:11:03 +00:00
if brush . use_airbrush :
col . separator ( )
row = col . row ( )
row . prop ( brush , " rate " , text = " Rate " , slider = True )
if brush . use_space :
col . separator ( )
row = col . row ( )
row . active = brush . use_space
row . prop ( brush , " spacing " , text = " Spacing " )
2011-03-07 13:23:45 +00:00
if ( brush . sculpt_tool not in { ' GRAB ' , ' THUMB ' , ' SNAKE_HOOK ' , ' ROTATE ' } ) and ( not brush . use_anchor ) and ( not brush . use_restore_mesh ) :
2010-07-14 14:11:03 +00:00
col = layout . column ( )
col . separator ( )
2009-10-31 19:31:45 +00:00
2010-07-14 14:11:03 +00:00
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 )
col . separator ( )
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 = " " )
2010-07-14 14:11:03 +00:00
else :
row = col . row ( )
row . prop ( brush , " use_airbrush " )
row = col . row ( )
row . active = brush . use_airbrush and ( not brush . use_space ) and ( not brush . use_anchor )
row . prop ( brush , " rate " , slider = True )
col . separator ( )
2011-04-01 04:22:30 +00:00
if not image_paint :
2010-07-14 14:11:03 +00:00
row = col . row ( )
row . prop ( brush , " use_smooth_stroke " )
col = layout . column ( )
col . active = brush . use_smooth_stroke
col . prop ( brush , " smooth_stroke_radius " , text = " Radius " , slider = True )
col . prop ( brush , " smooth_stroke_factor " , text = " Factor " , slider = True )
col . separator ( )
2009-10-31 19:31:45 +00:00
col = layout . column ( )
2011-03-07 13:23:45 +00:00
col . active = ( not brush . use_anchor ) and ( brush . sculpt_tool not in { ' GRAB ' , ' THUMB ' , ' ROTATE ' , ' SNAKE_HOOK ' } )
2009-10-31 19:31:45 +00:00
2010-07-14 14:11:03 +00:00
row = col . row ( )
row . prop ( brush , " use_space " )
row = col . row ( )
row . active = brush . use_space
row . prop ( brush , " spacing " , text = " Spacing " )
#col.prop(brush, "use_space_atten", text="Adaptive Strength")
#col.prop(brush, "use_adaptive_space", text="Adaptive Spacing")
#col.separator()
2011-04-01 04:22:30 +00:00
#if image_paint:
2010-08-18 03:56:14 +00:00
# row.prop(brush, "use_pressure_spacing", toggle=True, text="")
2009-08-21 00:46:36 +00:00
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_brush_curve ( PaintPanel , bpy . types . Panel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Curve "
2010-08-26 01:05:37 +00:00
bl_options = { ' DEFAULT_CLOSED ' }
2009-10-31 19:31:45 +00:00
2010-08-09 01:37:09 +00:00
@classmethod
def poll ( cls , context ) :
settings = cls . paint_settings ( context )
2009-10-31 19:31:45 +00:00
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 )
2010-08-10 18:21:33 +00:00
2009-10-31 19:31:45 +00:00
brush = settings . brush
2010-01-04 17:28:37 +00:00
layout . template_curve_mapping ( brush , " curve " , brush = True )
2010-03-14 23:26:17 +00:00
2010-03-14 13:07:13 +00:00
row = layout . row ( align = True )
2010-07-14 14:11:03 +00:00
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 '
2009-10-31 23:35:56 +00:00
2010-08-09 08:18:49 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_sculpt_options ( PaintPanel , bpy . types . Panel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Options "
2010-08-26 01:05:37 +00:00
bl_options = { ' DEFAULT_CLOSED ' }
2009-10-31 19:31:45 +00:00
2010-08-09 01:37:09 +00:00
@classmethod
def poll ( cls , context ) :
2009-12-23 15:51:39 +00:00
return ( context . sculpt_object and context . tool_settings . sculpt )
2009-10-31 19:31:45 +00:00
def draw ( self , context ) :
layout = self . layout
2010-07-22 18:56:46 +00:00
tool_settings = context . tool_settings
sculpt = tool_settings . sculpt
2010-08-05 16:05:30 +00:00
settings = __class__ . paint_settings ( context )
2009-10-31 19:31:45 +00:00
2011-05-04 13:15:42 +00:00
layout . label ( text = " Lock: " )
row = layout . row ( align = True )
2010-07-14 14:11:03 +00:00
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 )
2009-10-31 19:31:45 +00:00
2011-05-04 13:15:42 +00:00
layout . prop ( sculpt , " use_threaded " , text = " Threaded Sculpt " )
layout . prop ( sculpt , " show_low_resolution " )
layout . prop ( sculpt , " show_brush " )
layout . prop ( sculpt , " use_deform_only " )
layout . label ( text = " Unified Settings: " )
layout . prop ( tool_settings , " sculpt_paint_use_unified_size " , text = " Size " )
layout . prop ( tool_settings , " sculpt_paint_use_unified_strength " , text = " Strength " )
2010-09-07 15:17:42 +00:00
2010-08-04 15:56:18 +00:00
class VIEW3D_PT_sculpt_symmetry ( PaintPanel , bpy . types . Panel ) :
2010-07-14 14:11:03 +00:00
bl_label = " Symmetry "
2010-08-26 01:05:37 +00:00
bl_options = { ' DEFAULT_CLOSED ' }
2010-07-14 14:11:03 +00:00
2010-08-09 01:37:09 +00:00
@classmethod
def poll ( cls , context ) :
2010-07-14 14:11:03 +00:00
return ( context . sculpt_object and context . tool_settings . sculpt )
def draw ( self , context ) :
layout = self . layout
sculpt = context . tool_settings . sculpt
2010-08-05 16:05:30 +00:00
settings = __class__ . paint_settings ( context )
2010-07-14 14:11:03 +00:00
split = layout . split ( )
2009-10-31 19:31:45 +00:00
col = split . column ( )
2010-07-14 14:11:03 +00:00
col . label ( text = " Mirror: " )
2010-08-19 17:46:00 +00:00
col . prop ( sculpt , " use_symmetry_x " , text = " X " )
col . prop ( sculpt , " use_symmetry_y " , text = " Y " )
col . prop ( sculpt , " use_symmetry_z " , text = " Z " )
2009-10-31 19:31:45 +00:00
2011-04-01 21:37:40 +00:00
split . prop ( sculpt , " radial_symmetry " , text = " Radial " )
2010-07-14 14:11:03 +00:00
2011-04-01 21:37:40 +00:00
layout . separator ( )
2010-07-14 14:11:03 +00:00
2011-04-01 21:37:40 +00:00
layout . prop ( sculpt , " use_symmetry_feather " , text = " Feather " )
2010-07-14 14:11:03 +00:00
2010-09-07 15:17:42 +00:00
2010-08-04 15:56:18 +00:00
class VIEW3D_PT_tools_brush_appearance ( PaintPanel , bpy . types . Panel ) :
2010-07-14 14:11:03 +00:00
bl_label = " Appearance "
2010-08-26 01:05:37 +00:00
bl_options = { ' DEFAULT_CLOSED ' }
2010-07-14 14:11:03 +00:00
2010-08-09 01:37:09 +00:00
@classmethod
def poll ( cls , context ) :
2011-04-01 04:22:30 +00:00
return ( context . sculpt_object and context . tool_settings . sculpt ) or ( context . vertex_paint_object and context . tool_settings . vertex_paint ) or ( context . weight_paint_object and context . tool_settings . weight_paint ) or ( context . image_paint_object and context . tool_settings . image_paint )
2010-07-14 14:11:03 +00:00
def draw ( self , context ) :
layout = self . layout
2010-08-05 16:05:30 +00:00
settings = __class__ . paint_settings ( context )
2010-07-14 14:11:03 +00:00
brush = settings . brush
2010-09-07 15:17:42 +00:00
col = layout . column ( )
2010-07-21 11:58:23 +00:00
2010-07-22 18:56:46 +00:00
if context . sculpt_object and context . tool_settings . sculpt :
2011-03-07 13:23:45 +00:00
#if brush.sculpt_tool in {'DRAW', 'INFLATE', 'CLAY', 'PINCH', 'CREASE', 'BLOB', 'FLATTEN', 'FILL', 'SCRAPE', 'CLAY_TUBES'}:
if brush . sculpt_tool in { ' DRAW ' , ' INFLATE ' , ' CLAY ' , ' PINCH ' , ' CREASE ' , ' BLOB ' , ' FLATTEN ' , ' FILL ' , ' SCRAPE ' } :
2010-08-18 03:56:14 +00:00
col . prop ( brush , " cursor_color_add " , text = " Add Color " )
col . prop ( brush , " cursor_color_subtract " , text = " Subtract Color " )
2010-07-14 14:11:03 +00:00
else :
2010-08-18 03:56:14 +00:00
col . prop ( brush , " cursor_color_add " , text = " Color " )
2010-07-22 18:56:46 +00:00
else :
2010-08-18 03:56:14 +00:00
col . prop ( brush , " cursor_color_add " , text = " Color " )
2010-07-14 14:11:03 +00:00
col = layout . column ( )
col . label ( text = " Icon: " )
2010-07-20 02:18:10 +00:00
row = col . row ( align = True )
2010-07-26 04:00:09 +00:00
row . prop ( brush , " use_custom_icon " )
if brush . use_custom_icon :
row = col . row ( align = True )
row . prop ( brush , " icon_filepath " , text = " " )
2009-07-24 21:01:41 +00:00
2009-07-02 11:24:27 +00:00
# ********** default tools for weightpaint ****************
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_weightpaint ( View3DPanel , bpy . types . Panel ) :
2009-10-31 19:31:45 +00:00
bl_context = " weightpaint "
bl_label = " Weight Tools "
def draw ( self , context ) :
layout = self . layout
2011-01-01 07:20:34 +00:00
2010-12-17 16:02:55 +00:00
ob = context . active_object
2011-01-01 07:20:34 +00:00
2009-10-31 19:31:45 +00:00
col = layout . column ( )
2010-12-17 16:02:55 +00:00
col . active = ob . vertex_groups . active != None
2009-11-23 00:27:30 +00:00
col . operator ( " object.vertex_group_normalize_all " , text = " Normalize All " )
col . operator ( " object.vertex_group_normalize " , text = " Normalize " )
col . operator ( " object.vertex_group_invert " , text = " Invert " )
col . operator ( " object.vertex_group_clean " , text = " Clean " )
col . operator ( " object.vertex_group_levels " , text = " Levels " )
2009-10-20 13:59:26 +00:00
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_weightpaint_options ( View3DPanel , bpy . types . Panel ) :
2009-10-31 19:31:45 +00:00
bl_context = " weightpaint "
bl_label = " Options "
def draw ( self , context ) :
layout = self . layout
2010-07-22 18:56:46 +00:00
tool_settings = context . tool_settings
wpaint = tool_settings . weight_paint
2009-10-31 19:31:45 +00:00
col = layout . column ( )
2010-08-20 06:09:58 +00:00
col . prop ( wpaint , " use_all_faces " )
2010-08-22 06:31:26 +00:00
col . prop ( wpaint , " use_normal " )
2010-08-20 06:09:58 +00:00
col . prop ( wpaint , " use_spray " )
2009-10-31 19:31:45 +00:00
2010-01-10 10:20:44 +00:00
obj = context . weight_paint_object
if obj . type == ' MESH ' :
2010-02-17 19:50:42 +00:00
mesh = obj . data
col . prop ( mesh , " use_mirror_x " )
col . prop ( mesh , " use_mirror_topology " )
2009-07-24 11:14:59 +00:00
2010-07-22 18:56:46 +00:00
col . label ( text = " Unified Settings: " )
col . prop ( tool_settings , " sculpt_paint_use_unified_size " , text = " Size " )
col . prop ( tool_settings , " sculpt_paint_use_unified_strength " , text = " Strength " )
2009-07-24 11:14:59 +00:00
# Commented out because the Apply button isn't an operator yet, making these settings useless
2009-11-23 00:27:30 +00:00
# col.label(text="Gamma:")
# col.prop(wpaint, "gamma", text="")
# col.label(text="Multiply:")
# col.prop(wpaint, "mul", text="")
2009-07-02 11:24:27 +00:00
2009-08-02 16:44:32 +00:00
# Also missing now:
# Soft, Vgroup, X-Mirror and "Clear" Operator.
2009-07-02 11:24:27 +00:00
# ********** default tools for vertexpaint ****************
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_vertexpaint ( View3DPanel , bpy . types . Panel ) :
2009-10-31 19:31:45 +00:00
bl_context = " vertexpaint "
bl_label = " Options "
def draw ( self , context ) :
layout = self . layout
2010-07-22 18:56:46 +00:00
tool_settings = context . tool_settings
vpaint = tool_settings . vertex_paint
2009-10-31 19:31:45 +00:00
col = layout . column ( )
2010-01-20 08:30:40 +00:00
#col.prop(vpaint, "mode", text="")
2010-08-20 06:09:58 +00:00
col . prop ( vpaint , " use_all_faces " )
2010-08-21 04:51:00 +00:00
col . prop ( vpaint , " use_normal " )
2010-08-20 06:09:58 +00:00
col . prop ( vpaint , " use_spray " )
2009-11-20 01:39:27 +00:00
2010-07-22 18:56:46 +00:00
col . label ( text = " Unified Settings: " )
col . prop ( tool_settings , " sculpt_paint_use_unified_size " , text = " Size " )
col . prop ( tool_settings , " sculpt_paint_use_unified_strength " , text = " Strength " )
2009-07-24 11:14:59 +00:00
# Commented out because the Apply button isn't an operator yet, making these settings useless
2009-11-23 00:27:30 +00:00
# col.label(text="Gamma:")
# col.prop(vpaint, "gamma", text="")
# col.label(text="Multiply:")
# col.prop(vpaint, "mul", text="")
2009-07-24 21:01:41 +00:00
2009-08-29 15:20:36 +00:00
# ********** default tools for texturepaint ****************
2009-07-02 11:24:27 +00:00
2009-10-31 23:35:56 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_projectpaint ( View3DPanel , bpy . types . Panel ) :
2011-04-01 04:22:30 +00:00
bl_context = " imagepaint "
2009-10-31 19:31:45 +00:00
bl_label = " Project Paint "
2010-08-09 01:37:09 +00:00
@classmethod
def poll ( cls , context ) :
2010-08-04 12:18:07 +00:00
brush = context . tool_settings . image_paint . brush
2011-04-01 04:22:30 +00:00
return ( brush and brush . image_tool != ' SOFTEN ' )
2009-10-31 19:31:45 +00:00
def draw_header ( self , context ) :
ipaint = context . tool_settings . image_paint
2009-11-23 00:27:30 +00:00
self . layout . prop ( ipaint , " use_projection " , text = " " )
2009-10-31 19:31:45 +00:00
def draw ( self , context ) :
layout = self . layout
2011-04-04 08:47:31 +00:00
ob = context . active_object
mesh = ob . data
2009-10-31 19:31:45 +00:00
ipaint = context . tool_settings . image_paint
settings = context . tool_settings . image_paint
2009-10-31 23:35:56 +00:00
use_projection = ipaint . use_projection
2009-10-31 19:31:45 +00:00
col = layout . column ( )
sub = col . column ( )
sub . active = use_projection
2009-11-23 00:27:30 +00:00
sub . prop ( ipaint , " use_occlude " )
2010-08-19 17:46:00 +00:00
sub . prop ( ipaint , " use_backface_culling " )
2009-10-31 19:31:45 +00:00
split = layout . split ( )
col = split . column ( )
col . active = ( use_projection )
2009-11-23 00:27:30 +00:00
col . prop ( ipaint , " use_normal_falloff " )
2009-10-31 19:31:45 +00:00
col = split . column ( )
col . active = ( ipaint . use_normal_falloff and use_projection )
2009-11-23 00:27:30 +00:00
col . prop ( ipaint , " normal_angle " , text = " " )
2009-10-31 19:31:45 +00:00
2009-12-22 10:48:13 +00:00
col = layout . column ( align = False )
row = col . row ( )
row . active = ( use_projection )
row . prop ( ipaint , " use_stencil_layer " , text = " Stencil " )
2009-10-31 19:31:45 +00:00
2009-12-22 10:48:13 +00:00
row2 = row . row ( align = False )
row2 . active = ( use_projection and ipaint . use_stencil_layer )
2011-04-04 08:47:31 +00:00
row2 . menu ( " VIEW3D_MT_tools_projectpaint_stencil " , text = mesh . uv_texture_stencil . name )
2009-12-22 10:48:13 +00:00
row2 . prop ( ipaint , " invert_stencil " , text = " " , icon = ' IMAGE_ALPHA ' )
2009-10-31 19:31:45 +00:00
col = layout . column ( )
sub = col . column ( )
2009-12-22 10:48:13 +00:00
row = sub . row ( )
2011-04-01 04:22:30 +00:00
row . active = ( settings . brush . image_tool == ' CLONE ' )
2009-12-26 09:36:50 +00:00
2010-02-09 19:22:57 +00:00
row . prop ( ipaint , " use_clone_layer " , text = " Layer " )
2011-04-04 08:47:31 +00:00
row . menu ( " VIEW3D_MT_tools_projectpaint_clone " , text = mesh . uv_texture_clone . name )
2009-10-31 19:31:45 +00:00
sub = col . column ( )
2009-11-23 00:27:30 +00:00
sub . prop ( ipaint , " seam_bleed " )
2010-03-14 23:26:17 +00:00
2010-03-16 17:45:01 +00:00
col . label ( text = " External Editing " )
row = col . split ( align = True , percentage = 0.55 )
row . operator ( " image.project_edit " , text = " Quick Edit " )
2010-03-06 21:47:16 +00:00
row . operator ( " image.project_apply " , text = " Apply " )
2010-03-16 17:45:01 +00:00
row = col . row ( align = True )
row . prop ( ipaint , " screen_grab_size " , text = " " )
2010-03-14 23:26:17 +00:00
2010-03-05 18:19:32 +00:00
sub = col . column ( )
2010-03-16 17:45:01 +00:00
sub . operator ( " paint.project_image " , text = " Apply Camera Image " )
2010-03-14 23:26:17 +00:00
2010-03-16 17:45:01 +00:00
sub . operator ( " image.save_dirty " , text = " Save All Edited " )
2009-10-31 19:31:45 +00:00
2009-12-22 10:48:13 +00:00
2010-07-22 18:56:46 +00:00
class VIEW3D_PT_imagepaint_options ( PaintPanel ) :
bl_label = " Options "
2010-08-26 01:05:37 +00:00
bl_options = { ' DEFAULT_CLOSED ' }
2010-07-22 18:56:46 +00:00
2010-08-09 01:37:09 +00:00
@classmethod
def poll ( cls , context ) :
2011-04-01 04:22:30 +00:00
return ( context . image_paint_object and context . tool_settings . image_paint )
2010-07-22 18:56:46 +00:00
def draw ( self , context ) :
layout = self . layout
2011-04-04 22:42:43 +00:00
2011-04-01 21:37:40 +00:00
tool_settings = context . tool_settings
2010-07-22 18:56:46 +00:00
col = layout . column ( )
col . label ( text = " Unified Settings: " )
col . prop ( tool_settings , " sculpt_paint_use_unified_size " , text = " Size " )
col . prop ( tool_settings , " sculpt_paint_use_unified_strength " , text = " Strength " )
2010-09-07 15:17:42 +00:00
2010-02-14 11:21:21 +00:00
class VIEW3D_MT_tools_projectpaint_clone ( bpy . types . Menu ) :
bl_label = " Clone Layer "
def draw ( self , context ) :
layout = self . layout
for i , tex in enumerate ( context . active_object . data . uv_textures ) :
prop = layout . operator ( " wm.context_set_int " , text = tex . name )
2010-06-14 03:52:10 +00:00
prop . data_path = " active_object.data.uv_texture_clone_index "
2010-02-14 11:21:21 +00:00
prop . value = i
2009-12-22 10:48:13 +00:00
2010-02-14 11:21:21 +00:00
class VIEW3D_MT_tools_projectpaint_stencil ( bpy . types . Menu ) :
bl_label = " Mask Layer "
2009-12-22 10:48:13 +00:00
2010-02-14 11:21:21 +00:00
def draw ( self , context ) :
layout = self . layout
for i , tex in enumerate ( context . active_object . data . uv_textures ) :
prop = layout . operator ( " wm.context_set_int " , text = tex . name )
2010-06-14 03:52:10 +00:00
prop . data_path = " active_object.data.uv_texture_stencil_index "
2010-02-14 11:21:21 +00:00
prop . value = i
2009-12-22 10:48:13 +00:00
2009-07-25 22:31:02 +00:00
2010-08-02 02:55:12 +00:00
class VIEW3D_PT_tools_particlemode ( View3DPanel , bpy . types . Panel ) :
2009-10-31 23:35:56 +00:00
''' default tools for particle mode '''
2009-10-31 19:31:45 +00:00
bl_context = " particlemode "
bl_label = " Options "
def draw ( self , context ) :
layout = self . layout
pe = context . tool_settings . particle_edit
ob = pe . object
2009-11-23 00:27:30 +00:00
layout . prop ( pe , " type " , text = " " )
2009-10-31 19:31:45 +00:00
2009-11-06 12:27:28 +00:00
ptcache = None
2009-10-31 19:31:45 +00:00
if pe . type == ' PARTICLES ' :
if ob . particle_systems :
if len ( ob . particle_systems ) > 1 :
2011-05-20 17:08:09 +00:00
layout . template_list ( ob , " particle_systems " , ob . particle_systems , " active_index " , rows = 2 , maxrows = 3 )
2009-10-31 19:31:45 +00:00
2010-08-24 04:02:50 +00:00
ptcache = ob . particle_systems . active . point_cache
2009-10-31 19:31:45 +00:00
else :
for md in ob . modifiers :
2009-10-31 23:35:56 +00:00
if md . type == pe . type :
2009-10-31 19:31:45 +00:00
ptcache = md . point_cache
2010-08-18 08:26:18 +00:00
if ptcache and len ( ptcache . point_caches ) > 1 :
2011-05-20 17:08:09 +00:00
layout . template_list ( ptcache , " point_caches " , ptcache . point_caches , " active_index " , rows = 2 , maxrows = 3 )
2009-10-31 19:31:45 +00:00
2010-08-18 08:26:18 +00:00
if not pe . is_editable :
2009-11-23 00:27:30 +00:00
layout . label ( text = " Point cache must be baked " )
2010-12-21 20:25:37 +00:00
layout . label ( text = " in memory to enable editing! " )
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2010-08-18 08:26:18 +00:00
if pe . is_hair :
col . active = pe . is_editable
2010-08-20 06:09:58 +00:00
col . prop ( pe , " use_emitter_deflect " , text = " Deflect emitter " )
2009-10-31 19:31:45 +00:00
sub = col . row ( )
2010-08-20 06:09:58 +00:00
sub . active = pe . use_emitter_deflect
2009-11-23 00:27:30 +00:00
sub . prop ( pe , " emitter_distance " , text = " Distance " )
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2010-08-18 08:26:18 +00:00
col . active = pe . is_editable
2009-11-23 00:27:30 +00:00
col . label ( text = " Keep: " )
2010-08-20 06:09:58 +00:00
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 :
2009-11-23 00:27:30 +00:00
col . label ( text = " Correct: " )
2010-08-20 06:09:58 +00:00
col . prop ( pe , " use_auto_velocity " , text = " Velocity " )
2010-01-05 15:23:09 +00:00
col . prop ( ob . data , " use_mirror_x " )
2009-10-31 19:31:45 +00:00
col = layout . column ( align = True )
2010-08-18 08:26:18 +00:00
col . active = pe . is_editable
2009-11-23 00:27:30 +00:00
col . label ( text = " Draw: " )
col . prop ( pe , " draw_step " , text = " Path Steps " )
2010-08-18 08:26:18 +00:00
if pe . is_hair :
2010-08-17 17:03:52 +00:00
col . prop ( pe , " show_particles " , text = " Children " )
2010-03-22 19:38:40 +00:00
else :
if pe . type == ' PARTICLES ' :
2010-08-17 17:03:52 +00:00
col . prop ( pe , " show_particles " , text = " Particles " )
2010-08-20 06:09:58 +00:00
col . prop ( pe , " use_fade_time " )
2010-03-22 19:38:40 +00:00
sub = col . row ( )
2010-08-20 06:09:58 +00:00
sub . active = pe . use_fade_time
2010-03-22 19:38:40 +00:00
sub . prop ( pe , " fade_frames " , slider = True )
2011-04-04 10:13:04 +00:00
if __name__ == " __main__ " : # only for live edit.
bpy . utils . register_module ( __name__ )