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
|
2014-07-21 10:02:05 +00:00
|
|
|
from bpy.types import Menu, Panel, UIList
|
2014-02-24 19:53:37 +00:00
|
|
|
from bl_ui.properties_grease_pencil_common import GreasePencilPanel
|
2013-12-03 12:45:38 +00:00
|
|
|
from bl_ui.properties_paint_common import (
|
|
|
|
UnifiedPaintPanel,
|
|
|
|
brush_texture_settings,
|
2014-07-21 10:02:05 +00:00
|
|
|
brush_texpaint_common,
|
2013-12-03 12:45:38 +00:00
|
|
|
brush_mask_texture_settings,
|
|
|
|
)
|
2009-07-02 11:24:27 +00:00
|
|
|
|
2011-06-24 03:30:50 +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 ******************
|
|
|
|
|
2011-01-26 06:41:44 +00:00
|
|
|
# Keyframing tools
|
|
|
|
def draw_keyframing_tools(context, layout):
|
|
|
|
col = layout.column(align=True)
|
2011-09-21 15:18:38 +00:00
|
|
|
col.label(text="Keyframes:")
|
2013-08-23 20:41:21 +00:00
|
|
|
row = col.row(align=True)
|
2011-09-21 15:18:38 +00:00
|
|
|
row.operator("anim.keyframe_insert_menu", text="Insert")
|
|
|
|
row.operator("anim.keyframe_delete_v3d", text="Remove")
|
2011-01-13 23:00:51 +00:00
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2011-10-17 06:58:07 +00:00
|
|
|
# ********** default tools for object-mode ****************
|
2009-07-02 11:24:27 +00:00
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-02-02 17:00:01 +00:00
|
|
|
class VIEW3D_PT_tools_transform(View3DPanel, Panel):
|
|
|
|
bl_category = "Tools"
|
|
|
|
bl_context = "objectmode"
|
|
|
|
bl_label = "Transform"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
|
|
|
col.operator("transform.translate")
|
|
|
|
col.operator("transform.rotate")
|
|
|
|
col.operator("transform.resize", text="Scale")
|
|
|
|
|
2014-02-28 06:37:49 +00:00
|
|
|
col = layout.column(align=True)
|
|
|
|
col.operator("transform.mirror", text="Mirror")
|
2014-02-02 17:00:01 +00:00
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-02-02 17:00:01 +00:00
|
|
|
class VIEW3D_PT_tools_object(View3DPanel, Panel):
|
|
|
|
bl_category = "Tools"
|
|
|
|
bl_context = "objectmode"
|
|
|
|
bl_label = "Edit"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
|
|
|
col.operator("object.duplicate_move", text="Duplicate")
|
|
|
|
col.operator("object.duplicate_move_linked", text="Duplicate Linked")
|
|
|
|
|
|
|
|
col.operator("object.delete")
|
|
|
|
|
2014-02-28 06:37:49 +00:00
|
|
|
obj = context.active_object
|
|
|
|
if obj:
|
|
|
|
obj_type = obj.type
|
|
|
|
|
|
|
|
if obj_type in {'MESH', 'CURVE', 'SURFACE', 'ARMATURE'}:
|
|
|
|
col = layout.column(align=True)
|
|
|
|
col.operator("object.join")
|
2014-02-02 17:00:01 +00:00
|
|
|
|
2014-02-28 06:37:49 +00:00
|
|
|
if obj_type in {'MESH', 'CURVE', 'SURFACE', 'ARMATURE', 'FONT', 'LATTICE'}:
|
|
|
|
col = layout.column(align=True)
|
|
|
|
col.operator_menu_enum("object.origin_set", "type", text="Set Origin")
|
2014-02-02 17:00:01 +00:00
|
|
|
|
2014-02-28 06:37:49 +00:00
|
|
|
if obj_type in {'MESH', 'CURVE', 'SURFACE'}:
|
|
|
|
col = layout.column(align=True)
|
|
|
|
col.label(text="Shading:")
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.operator("object.shade_smooth", text="Smooth")
|
|
|
|
row.operator("object.shade_flat", text="Flat")
|
2014-02-02 17:00:01 +00:00
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-03-19 14:32:44 +00:00
|
|
|
class VIEW3D_PT_tools_add_object(View3DPanel, Panel):
|
2013-12-31 19:24:40 +00:00
|
|
|
bl_category = "Create"
|
|
|
|
bl_context = "objectmode"
|
2014-01-03 20:55:05 +00:00
|
|
|
bl_label = "Add Primitive"
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-03-19 14:32:44 +00:00
|
|
|
@staticmethod
|
|
|
|
def draw_add_mesh(layout, label=False):
|
|
|
|
if label:
|
|
|
|
layout.label(text="Primitives:")
|
|
|
|
layout.operator("mesh.primitive_plane_add", text="Plane", icon='MESH_PLANE')
|
|
|
|
layout.operator("mesh.primitive_cube_add", text="Cube", icon='MESH_CUBE')
|
|
|
|
layout.operator("mesh.primitive_circle_add", text="Circle", icon='MESH_CIRCLE')
|
|
|
|
layout.operator("mesh.primitive_uv_sphere_add", text="UV Sphere", icon='MESH_UVSPHERE')
|
|
|
|
layout.operator("mesh.primitive_ico_sphere_add", text="Ico Sphere", icon='MESH_ICOSPHERE')
|
|
|
|
layout.operator("mesh.primitive_cylinder_add", text="Cylinder", icon='MESH_CYLINDER')
|
|
|
|
layout.operator("mesh.primitive_cone_add", text="Cone", icon='MESH_CONE')
|
|
|
|
layout.operator("mesh.primitive_torus_add", text="Torus", icon='MESH_TORUS')
|
|
|
|
|
|
|
|
if label:
|
|
|
|
layout.label(text="Special:")
|
|
|
|
else:
|
|
|
|
layout.separator()
|
|
|
|
layout.operator("mesh.primitive_grid_add", text="Grid", icon='MESH_GRID')
|
|
|
|
layout.operator("mesh.primitive_monkey_add", text="Monkey", icon='MESH_MONKEY')
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def draw_add_curve(layout, label=False):
|
|
|
|
if label:
|
|
|
|
layout.label(text="Bezier:")
|
|
|
|
layout.operator("curve.primitive_bezier_curve_add", text="Bezier", icon='CURVE_BEZCURVE')
|
|
|
|
layout.operator("curve.primitive_bezier_circle_add", text="Circle", icon='CURVE_BEZCIRCLE')
|
|
|
|
|
|
|
|
if label:
|
|
|
|
layout.label(text="Nurbs:")
|
|
|
|
else:
|
|
|
|
layout.separator()
|
|
|
|
layout.operator("curve.primitive_nurbs_curve_add", text="Nurbs Curve", icon='CURVE_NCURVE')
|
|
|
|
layout.operator("curve.primitive_nurbs_circle_add", text="Nurbs Circle", icon='CURVE_NCIRCLE')
|
|
|
|
layout.operator("curve.primitive_nurbs_path_add", text="Path", icon='CURVE_PATH')
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def draw_add_surface(layout):
|
|
|
|
layout.operator("surface.primitive_nurbs_surface_curve_add", text="Nurbs Curve", icon='SURFACE_NCURVE')
|
|
|
|
layout.operator("surface.primitive_nurbs_surface_circle_add", text="Nurbs Circle", icon='SURFACE_NCIRCLE')
|
|
|
|
layout.operator("surface.primitive_nurbs_surface_surface_add", text="Nurbs Surface", icon='SURFACE_NSURFACE')
|
|
|
|
layout.operator("surface.primitive_nurbs_surface_cylinder_add", text="Nurbs Cylinder", icon='SURFACE_NCYLINDER')
|
|
|
|
layout.operator("surface.primitive_nurbs_surface_sphere_add", text="Nurbs Sphere", icon='SURFACE_NSPHERE')
|
|
|
|
layout.operator("surface.primitive_nurbs_surface_torus_add", text="Nurbs Torus", icon='SURFACE_NTORUS')
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def draw_add_mball(layout):
|
|
|
|
layout.operator_enum("object.metaball_add", "type")
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def draw_add_lamp(layout):
|
|
|
|
layout.operator_enum("object.lamp_add", "type")
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def draw_add_other(layout):
|
|
|
|
layout.operator("object.text_add", text="Text", icon='OUTLINER_OB_FONT')
|
|
|
|
layout.operator("object.armature_add", text="Armature", icon='OUTLINER_OB_ARMATURE')
|
|
|
|
layout.operator("object.add", text="Lattice", icon='OUTLINER_OB_LATTICE').type = 'LATTICE'
|
|
|
|
layout.operator("object.empty_add", text="Empty", icon='OUTLINER_OB_EMPTY').type = 'PLAIN_AXES'
|
2014-05-18 07:55:47 +00:00
|
|
|
layout.operator("object.speaker_add", text="Speaker", icon='OUTLINER_OB_SPEAKER')
|
2014-03-19 14:32:44 +00:00
|
|
|
layout.operator("object.camera_add", text="Camera", icon='OUTLINER_OB_CAMERA')
|
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
def draw(self, context):
|
2013-12-31 19:24:40 +00:00
|
|
|
layout = self.layout
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2013-12-31 19:24:40 +00:00
|
|
|
col = layout.column(align=True)
|
2014-01-03 20:55:05 +00:00
|
|
|
col.label(text="Mesh:")
|
2014-03-19 14:32:44 +00:00
|
|
|
self.draw_add_mesh(col)
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2013-12-31 19:24:40 +00:00
|
|
|
col = layout.column(align=True)
|
2014-01-03 20:55:05 +00:00
|
|
|
col.label(text="Curve:")
|
2014-03-19 14:32:44 +00:00
|
|
|
self.draw_add_curve(col)
|
|
|
|
|
|
|
|
# not used here:
|
|
|
|
# draw_add_surface
|
|
|
|
# draw_add_mball
|
2014-01-02 23:27:37 +00:00
|
|
|
|
2014-03-19 14:32:44 +00:00
|
|
|
col = layout.column(align=True)
|
2014-01-03 20:55:05 +00:00
|
|
|
col.label(text="Lamp:")
|
2014-03-19 14:32:44 +00:00
|
|
|
self.draw_add_lamp(col)
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-03-19 14:32:44 +00:00
|
|
|
col = layout.column(align=True)
|
2014-01-03 20:55:05 +00:00
|
|
|
col.label(text="Other:")
|
2014-03-19 14:32:44 +00:00
|
|
|
self.draw_add_other(col)
|
2013-12-31 19:24:40 +00:00
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-01-03 03:27:15 +00:00
|
|
|
class VIEW3D_PT_tools_relations(View3DPanel, Panel):
|
|
|
|
bl_category = "Relations"
|
|
|
|
bl_context = "objectmode"
|
|
|
|
bl_label = "Relations"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
|
|
|
|
2014-01-03 21:11:43 +00:00
|
|
|
col.label(text="Group:")
|
2014-01-03 21:08:33 +00:00
|
|
|
col.operator("group.create", text="New Group")
|
|
|
|
col.operator("group.objects_add_active", text="Add to Active")
|
|
|
|
col.operator("group.objects_remove", text="Remove from Group")
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-01-03 21:13:07 +00:00
|
|
|
col.separator()
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-01-03 21:11:43 +00:00
|
|
|
col.label(text="Parent:")
|
2014-01-03 03:27:15 +00:00
|
|
|
row = col.row(align=True)
|
2014-01-03 21:11:43 +00:00
|
|
|
row.operator("object.parent_set", text="Set")
|
|
|
|
row.operator("object.parent_clear", text="Clear")
|
2014-01-03 03:27:15 +00:00
|
|
|
|
|
|
|
col.separator()
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-01-03 21:02:24 +00:00
|
|
|
col.label(text="Object Data:")
|
2014-01-03 03:27:15 +00:00
|
|
|
col.operator("object.make_links_data")
|
|
|
|
col.operator("object.make_single_user")
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-01-03 03:27:15 +00:00
|
|
|
col.separator()
|
|
|
|
|
|
|
|
col.label(text="Linked Objects:")
|
|
|
|
col.operator("object.make_local")
|
|
|
|
col.operator("object.proxy_make")
|
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2013-12-22 23:13:29 +00:00
|
|
|
class VIEW3D_PT_tools_animation(View3DPanel, Panel):
|
|
|
|
bl_category = "Animation"
|
|
|
|
bl_context = "objectmode"
|
|
|
|
bl_label = "Animation"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
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-09-21 15:18:38 +00:00
|
|
|
col.label(text="Motion Paths:")
|
2013-03-08 18:17:12 +00:00
|
|
|
row = col.row(align=True)
|
|
|
|
row.operator("object.paths_calculate", text="Calculate")
|
|
|
|
row.operator("object.paths_clear", text="Clear")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2014-01-03 03:31:28 +00:00
|
|
|
col.separator()
|
2014-01-03 03:40:06 +00:00
|
|
|
|
2014-01-03 03:31:28 +00:00
|
|
|
col.label(text="Action:")
|
|
|
|
col.operator("nla.bake", text="Bake Action")
|
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-02-25 09:59:05 +00:00
|
|
|
class VIEW3D_PT_tools_rigid_body(View3DPanel, Panel):
|
2013-12-22 23:13:29 +00:00
|
|
|
bl_category = "Physics"
|
2013-01-23 05:56:44 +00:00
|
|
|
bl_context = "objectmode"
|
2013-01-27 18:14:24 +00:00
|
|
|
bl_label = "Rigid Body Tools"
|
2013-01-23 05:56:44 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
|
|
|
col.label(text="Add/Remove:")
|
2013-08-23 20:41:21 +00:00
|
|
|
row = col.row(align=True)
|
2013-01-23 05:56:44 +00:00
|
|
|
row.operator("rigidbody.objects_add", text="Add Active").type = 'ACTIVE'
|
|
|
|
row.operator("rigidbody.objects_add", text="Add Passive").type = 'PASSIVE'
|
2013-08-23 20:41:21 +00:00
|
|
|
row = col.row(align=True)
|
2013-01-23 05:56:44 +00:00
|
|
|
row.operator("rigidbody.objects_remove", text="Remove")
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
|
|
|
col.label(text="Object Tools:")
|
|
|
|
col.operator("rigidbody.shape_change", text="Change Shape")
|
|
|
|
col.operator("rigidbody.mass_calculate", text="Calculate Mass")
|
2013-01-23 05:56:49 +00:00
|
|
|
col.operator("rigidbody.object_settings_copy", text="Copy from Active")
|
2013-10-25 11:54:10 +00:00
|
|
|
col.operator("object.visual_transform_apply", text="Apply Transformation")
|
2013-01-23 05:56:49 +00:00
|
|
|
col.operator("rigidbody.bake_to_keyframes", text="Bake To Keyframes")
|
2013-01-23 05:56:56 +00:00
|
|
|
col.label(text="Constraints:")
|
|
|
|
col.operator("rigidbody.connect", text="Connect")
|
2009-07-02 11:24:27 +00:00
|
|
|
|
2013-12-22 23:13:29 +00:00
|
|
|
|
|
|
|
# ********** default tools for editmode_mesh ****************
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2014-01-29 15:53:20 +00:00
|
|
|
class VIEW3D_PT_tools_transform_mesh(View3DPanel, Panel):
|
2014-02-02 17:00:01 +00:00
|
|
|
bl_category = "Tools"
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_context = "mesh_edit"
|
2014-01-29 15:53:20 +00:00
|
|
|
bl_label = "Transform"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
2009-12-10 10:36:32 +00:00
|
|
|
col.operator("transform.translate")
|
|
|
|
col.operator("transform.rotate")
|
|
|
|
col.operator("transform.resize", text="Scale")
|
2011-09-21 15:18:38 +00:00
|
|
|
col.operator("transform.shrink_fatten", text="Shrink/Fatten")
|
|
|
|
col.operator("transform.push_pull", text="Push/Pull")
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-01-29 15:53:20 +00:00
|
|
|
class VIEW3D_PT_tools_meshedit(View3DPanel, Panel):
|
2014-02-02 17:00:01 +00:00
|
|
|
bl_category = "Tools"
|
2014-01-29 15:53:20 +00:00
|
|
|
bl_context = "mesh_edit"
|
|
|
|
bl_label = "Mesh Tools"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
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:")
|
2013-06-02 17:32:45 +00:00
|
|
|
row = col.row(align=True)
|
|
|
|
row.operator("transform.edge_slide", text="Slide Edge")
|
|
|
|
row.operator("transform.vert_slide", text="Vertex")
|
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")
|
2014-03-31 03:56:43 +00:00
|
|
|
col.operator("object.vertex_random")
|
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:")
|
2013-06-01 05:26:37 +00:00
|
|
|
|
|
|
|
col.menu("VIEW3D_MT_edit_mesh_extrude")
|
2013-06-02 17:32:45 +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")
|
2013-08-29 18:45:04 +00:00
|
|
|
row = col.row(align=True)
|
|
|
|
row.operator("mesh.spin")
|
|
|
|
row.operator("mesh.screw")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2012-04-20 10:52:13 +00:00
|
|
|
row = col.row(align=True)
|
|
|
|
props = row.operator("mesh.knife_tool", text="Knife")
|
|
|
|
props.use_occlude_geometry = True
|
2012-05-06 13:41:27 +00:00
|
|
|
props.only_selected = False
|
2012-04-20 10:52:13 +00:00
|
|
|
props = row.operator("mesh.knife_tool", text="Select")
|
|
|
|
props.use_occlude_geometry = False
|
2012-05-06 13:41:27 +00:00
|
|
|
props.only_selected = True
|
2013-03-20 16:03:34 +00:00
|
|
|
col.operator("mesh.knife_project")
|
2013-08-29 18:45:04 +00:00
|
|
|
col.operator("mesh.bisect")
|
2012-04-20 10:52:13 +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="Remove:")
|
2012-04-05 01:55:49 +00:00
|
|
|
col.menu("VIEW3D_MT_edit_mesh_delete")
|
2013-06-02 17:32:45 +00:00
|
|
|
col.operator_menu_enum("mesh.merge", "type")
|
2009-11-23 00:27:30 +00:00
|
|
|
col.operator("mesh.remove_doubles")
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2014-07-21 10:02:05 +00:00
|
|
|
|
2014-06-14 13:18:46 +00:00
|
|
|
class VIEW3D_PT_tools_meshweight(View3DPanel, Panel):
|
|
|
|
bl_category = "Tools"
|
|
|
|
bl_context = "mesh_edit"
|
|
|
|
bl_label = "Weight Tools"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
# Used for Weight-Paint mode and Edit-Mode
|
|
|
|
@staticmethod
|
|
|
|
def draw_generic(layout):
|
|
|
|
col = layout.column()
|
|
|
|
col.operator("object.vertex_group_normalize_all", text="Normalize All")
|
|
|
|
col.operator("object.vertex_group_normalize", text="Normalize")
|
|
|
|
col.operator("object.vertex_group_mirror", text="Mirror")
|
|
|
|
col.operator("object.vertex_group_invert", text="Invert")
|
|
|
|
col.operator("object.vertex_group_clean", text="Clean")
|
|
|
|
col.operator("object.vertex_group_quantize", text="Quantize")
|
|
|
|
col.operator("object.vertex_group_levels", text="Levels")
|
|
|
|
col.operator("object.vertex_group_blend", text="Blend")
|
|
|
|
col.operator("object.vertex_group_limit_total", text="Limit Total")
|
|
|
|
col.operator("object.vertex_group_fix", text="Fix Deforms")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
self.draw_generic(layout)
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-07-21 10:02:05 +00:00
|
|
|
|
2014-02-02 17:00:01 +00:00
|
|
|
class VIEW3D_PT_tools_add_mesh_edit(View3DPanel, Panel):
|
|
|
|
bl_category = "Create"
|
|
|
|
bl_context = "mesh_edit"
|
|
|
|
bl_label = "Add Meshes"
|
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
def draw(self, context):
|
2014-02-02 17:00:01 +00:00
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
|
|
|
|
2014-03-19 14:32:44 +00:00
|
|
|
VIEW3D_PT_tools_add_object.draw_add_mesh(col, label=True)
|
2014-01-29 15:53:20 +00:00
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-01-29 15:53:20 +00:00
|
|
|
class VIEW3D_PT_tools_shading(View3DPanel, Panel):
|
|
|
|
bl_category = "Shading / UVs"
|
|
|
|
bl_context = "mesh_edit"
|
|
|
|
bl_label = "Shading"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
2014-04-16 13:18:14 +00:00
|
|
|
col.label(text="Faces:")
|
2014-01-29 15:53:20 +00:00
|
|
|
row = col.row(align=True)
|
|
|
|
row.operator("mesh.faces_shade_smooth", text="Smooth")
|
|
|
|
row.operator("mesh.faces_shade_flat", text="Flat")
|
2014-04-16 13:18:14 +00:00
|
|
|
col.label(text="Edges:")
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.operator("mesh.mark_sharp", text="Smooth").clear = True
|
|
|
|
row.operator("mesh.mark_sharp", text="Sharp")
|
|
|
|
col.label(text="Vertices:")
|
|
|
|
row = col.row(align=True)
|
|
|
|
op = row.operator("mesh.mark_sharp", text="Smooth")
|
|
|
|
op.use_verts = True
|
|
|
|
op.clear = True
|
|
|
|
row.operator("mesh.mark_sharp", text="Sharp").use_verts = True
|
2014-01-29 15:53:20 +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
|
|
|
|
2014-01-29 15:53:20 +00:00
|
|
|
|
|
|
|
class VIEW3D_PT_tools_uvs(View3DPanel, Panel):
|
|
|
|
bl_category = "Shading / UVs"
|
|
|
|
bl_context = "mesh_edit"
|
|
|
|
bl_label = "UVs"
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-01-29 15:53:20 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
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:")
|
2013-06-01 05:26:37 +00:00
|
|
|
col.menu("VIEW3D_MT_uv_map", text="Unwrap")
|
2012-01-14 06:30:27 +00:00
|
|
|
col.operator("mesh.mark_seam").clear = False
|
2009-11-23 11:43:38 +00:00
|
|
|
col.operator("mesh.mark_seam", text="Clear Seam").clear = True
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel):
|
2014-01-03 22:21:52 +00:00
|
|
|
bl_category = "Options"
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_context = "mesh_edit"
|
|
|
|
bl_label = "Mesh Options"
|
2011-11-08 01:32:34 +00:00
|
|
|
|
2011-11-05 10:34:29 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return context.active_object
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
2011-11-05 10:34:29 +00:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
mesh = ob.data
|
2011-11-05 10:19:36 +00:00
|
|
|
|
2011-11-05 10:34:29 +00:00
|
|
|
col = layout.column(align=True)
|
|
|
|
col.prop(mesh, "use_mirror_x")
|
2011-03-10 05:52:16 +00:00
|
|
|
|
2013-08-23 20:41:21 +00:00
|
|
|
row = col.row(align=True)
|
2011-11-05 10:34:29 +00:00
|
|
|
row.active = ob.data.use_mirror_x
|
|
|
|
row.prop(mesh, "use_mirror_topology")
|
2011-03-10 05:52:16 +00:00
|
|
|
|
2011-11-05 10:34:29 +00:00
|
|
|
col = layout.column(align=True)
|
|
|
|
col.label("Edge Select Mode:")
|
|
|
|
col.prop(tool_settings, "edge_path_mode", text="")
|
|
|
|
col.prop(tool_settings, "edge_path_live_unwrap")
|
2012-04-10 01:45:22 +00:00
|
|
|
col.label("Double Threshold:")
|
|
|
|
col.prop(tool_settings, "double_threshold", text="")
|
2009-07-02 11:24:27 +00:00
|
|
|
|
2013-04-13 22:12:55 +00:00
|
|
|
if mesh.show_weight:
|
|
|
|
col.label("Show Zero Weights:")
|
2013-04-13 22:52:28 +00:00
|
|
|
col.row().prop(tool_settings, "vertex_group_user", expand=True)
|
2013-04-13 22:12:55 +00:00
|
|
|
|
2009-07-02 11:24:27 +00:00
|
|
|
# ********** default tools for editmode_curve ****************
|
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-02-02 17:31:24 +00:00
|
|
|
class VIEW3D_PT_tools_transform_curve(View3DPanel, Panel):
|
|
|
|
bl_category = "Tools"
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_context = "curve_edit"
|
2014-02-02 17:31:24 +00:00
|
|
|
bl_label = "Transform"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
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)
|
2011-11-01 11:00:08 +00:00
|
|
|
col.operator("transform.tilt", text="Tilt")
|
2014-02-13 08:21:35 +00:00
|
|
|
col.operator("transform.transform", text="Shrink/Fatten").mode = 'CURVE_SHRINKFATTEN'
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-02-02 17:31:24 +00:00
|
|
|
class VIEW3D_PT_tools_curveedit(View3DPanel, Panel):
|
|
|
|
bl_category = "Tools"
|
|
|
|
bl_context = "curve_edit"
|
|
|
|
bl_label = "Curve Tools"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
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:")
|
2012-05-13 09:13:47 +00:00
|
|
|
col.operator("curve.duplicate_move", text="Duplicate")
|
2009-11-23 00:27:30 +00:00
|
|
|
col.operator("curve.delete")
|
|
|
|
col.operator("curve.cyclic_toggle")
|
|
|
|
col.operator("curve.switch_direction")
|
|
|
|
col.operator("curve.spline_type_set")
|
2013-02-22 02:10:41 +00:00
|
|
|
col.operator("curve.radius_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:")
|
2013-08-23 20:41:21 +00:00
|
|
|
row = col.row(align=True)
|
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'
|
2013-08-23 20:41:21 +00:00
|
|
|
row = col.row(align=True)
|
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
|
|
|
|
2013-12-13 15:32:48 +00:00
|
|
|
col = layout.column(align=True)
|
|
|
|
col.operator("curve.normals_make_consistent")
|
|
|
|
|
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:")
|
2012-05-13 09:13:47 +00:00
|
|
|
col.operator("curve.extrude_move", text="Extrude")
|
2009-11-23 00:27:30 +00:00
|
|
|
col.operator("curve.subdivide")
|
2013-02-22 02:10:41 +00:00
|
|
|
col.operator("curve.smooth")
|
2014-03-31 03:56:43 +00:00
|
|
|
col.operator("object.vertex_random")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-02-02 18:05:13 +00:00
|
|
|
class VIEW3D_PT_tools_add_curve_edit(View3DPanel, Panel):
|
|
|
|
bl_category = "Create"
|
|
|
|
bl_context = "curve_edit"
|
|
|
|
bl_label = "Add Curves"
|
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
def draw(self, context):
|
2014-02-02 18:05:13 +00:00
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
|
|
|
|
2014-03-19 14:32:44 +00:00
|
|
|
VIEW3D_PT_tools_add_object.draw_add_curve(col, label=True)
|
2009-07-02 11:24:27 +00:00
|
|
|
|
|
|
|
# ********** default tools for editmode_surface ****************
|
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-02-02 17:31:24 +00:00
|
|
|
class VIEW3D_PT_tools_transform_surface(View3DPanel, Panel):
|
|
|
|
bl_category = "Tools"
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_context = "surface_edit"
|
2014-02-02 17:31:24 +00:00
|
|
|
bl_label = "Transform"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
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
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-02-02 17:31:24 +00:00
|
|
|
class VIEW3D_PT_tools_surfaceedit(View3DPanel, Panel):
|
|
|
|
bl_category = "Tools"
|
|
|
|
bl_context = "surface_edit"
|
|
|
|
bl_label = "Surface Tools"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
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:")
|
2012-05-13 09:13:47 +00:00
|
|
|
col.operator("curve.duplicate_move", text="Duplicate")
|
2009-11-23 00:27:30 +00:00
|
|
|
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:")
|
2012-05-13 09:13:47 +00:00
|
|
|
col.operator("curve.extrude", text="Extrude")
|
2009-11-23 00:27:30 +00:00
|
|
|
col.operator("curve.subdivide")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2014-03-31 03:56:43 +00:00
|
|
|
col = layout.column(align=True)
|
|
|
|
col.label(text="Deform:")
|
|
|
|
col.operator("object.vertex_random")
|
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-02-02 18:05:13 +00:00
|
|
|
class VIEW3D_PT_tools_add_surface_edit(View3DPanel, Panel):
|
|
|
|
bl_category = "Create"
|
|
|
|
bl_context = "surface_edit"
|
|
|
|
bl_label = "Add Surfaces"
|
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
def draw(self, context):
|
2014-02-02 18:05:13 +00:00
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
|
|
|
|
2014-03-19 14:32:44 +00:00
|
|
|
VIEW3D_PT_tools_add_object.draw_add_surface(col)
|
2014-02-02 18:05:13 +00:00
|
|
|
|
|
|
|
|
2009-07-02 11:24:27 +00:00
|
|
|
# ********** default tools for editmode_text ****************
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class VIEW3D_PT_tools_textedit(View3DPanel, Panel):
|
2014-02-02 17:31:24 +00:00
|
|
|
bl_category = "Tools"
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_context = "text_edit"
|
|
|
|
bl_label = "Text Tools"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
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
|
|
|
|
2009-07-02 11:24:27 +00:00
|
|
|
|
|
|
|
# ********** default tools for editmode_armature ****************
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2014-04-17 12:50:06 +00:00
|
|
|
class VIEW3D_PT_tools_armatureedit_transform(View3DPanel, Panel):
|
|
|
|
bl_category = "Tools"
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_context = "armature_edit"
|
2014-04-17 12:50:06 +00:00
|
|
|
bl_label = "Transform"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
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
|
|
|
|
2014-04-17 12:50:06 +00:00
|
|
|
|
|
|
|
class VIEW3D_PT_tools_armatureedit(View3DPanel, Panel):
|
|
|
|
bl_category = "Tools"
|
|
|
|
bl_context = "armature_edit"
|
|
|
|
bl_label = "Armature Tools"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
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
|
|
|
|
2014-03-31 03:56:43 +00:00
|
|
|
col = layout.column(align=True)
|
|
|
|
col.label(text="Deform:")
|
|
|
|
col.operator("object.vertex_random")
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class VIEW3D_PT_tools_armatureedit_options(View3DPanel, Panel):
|
2014-04-17 12:50:06 +00:00
|
|
|
bl_category = "Options"
|
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
|
|
|
|
2014-04-17 12:50:06 +00:00
|
|
|
|
2009-07-02 11:24:27 +00:00
|
|
|
# ********** default tools for editmode_mball ****************
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class VIEW3D_PT_tools_mballedit(View3DPanel, Panel):
|
2014-02-02 17:31:24 +00:00
|
|
|
bl_category = "Tools"
|
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
|
|
|
|
2014-03-31 03:56:43 +00:00
|
|
|
col = layout.column(align=True)
|
|
|
|
col.label(text="Deform:")
|
|
|
|
col.operator("object.vertex_random")
|
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-02-02 18:27:26 +00:00
|
|
|
class VIEW3D_PT_tools_add_mball_edit(View3DPanel, Panel):
|
|
|
|
bl_category = "Create"
|
|
|
|
bl_context = "mball_edit"
|
|
|
|
bl_label = "Add Metaball"
|
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
def draw(self, context):
|
2014-02-02 18:27:26 +00:00
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
|
|
|
|
2014-03-19 14:32:44 +00:00
|
|
|
VIEW3D_PT_tools_add_object.draw_add_mball(col)
|
2014-02-02 18:27:26 +00:00
|
|
|
|
|
|
|
|
2009-07-02 11:24:27 +00:00
|
|
|
# ********** default tools for editmode_lattice ****************
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class VIEW3D_PT_tools_latticeedit(View3DPanel, Panel):
|
2014-02-02 17:31:24 +00:00
|
|
|
bl_category = "Tools"
|
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
|
|
|
|
2014-03-31 03:56:43 +00:00
|
|
|
col = layout.column(align=True)
|
|
|
|
col.label(text="Deform:")
|
|
|
|
col.operator("object.vertex_random")
|
|
|
|
|
2009-07-02 11:24:27 +00:00
|
|
|
|
2011-10-17 06:58:07 +00:00
|
|
|
# ********** default tools for pose-mode ****************
|
2009-07-02 11:24:27 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class VIEW3D_PT_tools_posemode(View3DPanel, Panel):
|
2014-02-02 17:31:24 +00:00
|
|
|
bl_category = "Tools"
|
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:")
|
2013-08-23 20:41:21 +00:00
|
|
|
row = col.row(align=True)
|
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:")
|
2013-08-23 20:41:21 +00:00
|
|
|
row = col.row(align=True)
|
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:")
|
2013-03-16 05:58:59 +00:00
|
|
|
row = col.row(align=True)
|
|
|
|
row.operator("pose.paths_calculate", text="Calculate")
|
|
|
|
row.operator("pose.paths_clear", text="Clear")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class VIEW3D_PT_tools_posemode_options(View3DPanel, Panel):
|
2014-02-02 17:31:24 +00:00
|
|
|
bl_category = "Options"
|
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
|
|
|
|
2012-01-18 05:54:19 +00:00
|
|
|
class View3DPaintPanel(UnifiedPaintPanel):
|
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
|
|
|
|
2014-10-06 13:12:06 +00:00
|
|
|
class VIEW3D_PT_imapaint_tools_missing(Panel, View3DPaintPanel):
|
|
|
|
bl_category = "Tools"
|
|
|
|
bl_label = "Missing Data"
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
toolsettings = context.tool_settings.image_paint
|
|
|
|
return context.image_paint_object and not toolsettings.detect_data()
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
toolsettings = context.tool_settings.image_paint
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.label("Missing Data", icon='ERROR')
|
|
|
|
if toolsettings.missing_uvs:
|
|
|
|
col.separator()
|
|
|
|
col.label("Missing UVs", icon='INFO')
|
|
|
|
col.label("Unwrap the mesh in edit mode or generate a simple UVs")
|
2014-10-31 13:37:36 +00:00
|
|
|
col.operator("paint.add_simple_uvs")
|
2014-10-06 13:12:06 +00:00
|
|
|
|
|
|
|
if toolsettings.mode == 'MATERIAL':
|
|
|
|
if toolsettings.missing_materials:
|
|
|
|
col.separator()
|
|
|
|
col.label("Missing Materials", icon='INFO')
|
|
|
|
col.label("Add a material and paint slot below")
|
|
|
|
col.operator_menu_enum("paint.add_texture_paint_slot", "type", text="Add Paint Slot")
|
|
|
|
|
|
|
|
elif toolsettings.missing_texture:
|
|
|
|
ob = context.active_object
|
|
|
|
mat = ob.active_material
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
if mat:
|
|
|
|
col.label("Missing Texture Slots", icon='INFO')
|
|
|
|
col.label("Add a paint slot below")
|
|
|
|
col.operator_menu_enum("paint.add_texture_paint_slot", "type", text="Add Paint Slot")
|
|
|
|
else:
|
|
|
|
col.label("Missing Materials", icon='INFO')
|
|
|
|
col.label("Add a material and paint slot below")
|
|
|
|
col.operator_menu_enum("paint.add_texture_paint_slot", "type", text="Add Paint Slot")
|
|
|
|
|
|
|
|
|
|
|
|
elif toolsettings.mode == 'IMAGE':
|
|
|
|
if toolsettings.missing_texture:
|
|
|
|
col.separator()
|
|
|
|
col.label("Missing Canvas", icon='INFO')
|
|
|
|
col.label("Add or assign a canvas image below")
|
|
|
|
col.label("Canvas Image")
|
|
|
|
col.template_ID(toolsettings, "canvas")
|
|
|
|
col.operator("image.new", text="New").gen_context = 'PAINT_CANVAS'
|
|
|
|
|
|
|
|
if toolsettings.missing_stencil:
|
|
|
|
col.separator()
|
|
|
|
col.label("Missing Stencil", icon='INFO')
|
|
|
|
col.label("Add or assign a stencil image below")
|
|
|
|
col.label("Stencil Image")
|
|
|
|
col.template_ID(toolsettings, "stencil_image")
|
|
|
|
col.operator("image.new", text="New").gen_context = 'PAINT_STENCIL'
|
2012-01-17 17:57:20 +00:00
|
|
|
|
2012-01-18 05:54:19 +00:00
|
|
|
class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
|
2014-02-10 17:48:24 +00:00
|
|
|
bl_category = "Tools"
|
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
|
|
|
|
|
2012-01-17 17:57:20 +00:00
|
|
|
toolsettings = context.tool_settings
|
2011-07-11 05:50:49 +00:00
|
|
|
settings = self.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 #
|
|
|
|
if context.particle_edit_object:
|
2011-10-12 00:47:50 +00:00
|
|
|
tool = settings.tool
|
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.column().prop(settings, "tool", expand=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-10-12 00:47:50 +00:00
|
|
|
if tool != 'NONE':
|
2009-10-31 19:31:45 +00:00
|
|
|
col = layout.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(brush, "size", slider=True)
|
2011-10-12 00:47:50 +00:00
|
|
|
if tool != 'ADD':
|
2010-03-22 17:12:08 +00:00
|
|
|
col.prop(brush, "strength", slider=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-10-12 00:47:50 +00:00
|
|
|
if 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)
|
2011-10-12 00:47:50 +00:00
|
|
|
elif tool == 'LENGTH':
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(brush, "length_mode", expand=True)
|
2011-10-12 00:47:50 +00:00
|
|
|
elif 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:
|
2012-03-15 09:11:16 +00:00
|
|
|
capabilities = brush.sculpt_capabilities
|
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)
|
|
|
|
|
2012-01-17 17:57:20 +00:00
|
|
|
ups = toolsettings.unified_paint_settings
|
2013-06-27 03:05:19 +00:00
|
|
|
if ((ups.use_unified_size and ups.use_locked_size) or
|
2012-10-08 08:28:05 +00:00
|
|
|
((not ups.use_unified_size) and brush.use_locked_size)):
|
2012-01-12 21:48:08 +00:00
|
|
|
self.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED')
|
2012-01-14 23:54:51 +00:00
|
|
|
self.prop_unified_size(row, context, brush, "unprojected_radius", slider=True, text="Radius")
|
2010-07-14 14:11:03 +00:00
|
|
|
else:
|
2012-01-12 21:48:08 +00:00
|
|
|
self.prop_unified_size(row, context, brush, "use_locked_size", icon='UNLOCKED')
|
2012-01-14 23:54:51 +00:00
|
|
|
self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2012-01-12 21:48:08 +00:00
|
|
|
self.prop_unified_size(row, context, brush, "use_pressure_size")
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2012-03-15 09:11:16 +00:00
|
|
|
# strength, use_strength_pressure, and use_strength_attenuation
|
2014-10-03 11:14:10 +00:00
|
|
|
col.separator()
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
|
|
|
if capabilities.has_space_attenuation:
|
|
|
|
row.prop(brush, "use_space_attenuation", toggle=True, icon_only=True)
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2014-10-03 11:14:10 +00:00
|
|
|
self.prop_unified_strength(row, context, brush, "strength", text="Strength")
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2014-10-03 11:14:10 +00:00
|
|
|
if capabilities.has_strength_pressure:
|
2012-01-12 21:48:08 +00:00
|
|
|
self.prop_unified_strength(row, context, brush, "use_pressure_strength")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2012-03-15 09:11:16 +00:00
|
|
|
# auto_smooth_factor and use_inverse_smooth_pressure
|
|
|
|
if capabilities.has_auto_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="")
|
|
|
|
|
2012-03-15 09:11:16 +00:00
|
|
|
# normal_weight
|
|
|
|
if capabilities.has_normal_weight:
|
2010-07-14 14:11:03 +00:00
|
|
|
col.separator()
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop(brush, "normal_weight", slider=True)
|
|
|
|
|
2012-03-15 09:11:16 +00:00
|
|
|
# crease_pinch_factor
|
|
|
|
if capabilities.has_pinch_factor:
|
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")
|
|
|
|
|
2012-03-15 09:11:16 +00:00
|
|
|
# use_original_normal and sculpt_plane
|
|
|
|
if capabilities.has_sculpt_plane:
|
2010-07-14 14:11:03 +00:00
|
|
|
col.separator()
|
2013-08-23 20:41:21 +00:00
|
|
|
row = col.row(align=True)
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2014-01-30 05:24:51 +00:00
|
|
|
row.prop(brush, "use_original_normal", toggle=True, icon_only=True)
|
2010-07-14 14:11:03 +00:00
|
|
|
|
|
|
|
row.prop(brush, "sculpt_plane", text="")
|
|
|
|
|
2012-05-10 20:35:32 +00:00
|
|
|
if brush.sculpt_tool == 'MASK':
|
|
|
|
col.prop(brush, "mask_tool", text="")
|
|
|
|
|
2012-03-15 09:11:16 +00:00
|
|
|
# plane_offset, use_offset_pressure, use_plane_trim, plane_trim
|
|
|
|
if capabilities.has_plane_offset:
|
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")
|
|
|
|
|
2012-03-15 09:11:16 +00:00
|
|
|
# height
|
|
|
|
if capabilities.has_height:
|
2011-02-25 16:54:09 +00:00
|
|
|
row = col.row()
|
|
|
|
row.prop(brush, "height", slider=True, text="Height")
|
|
|
|
|
2012-03-15 09:11:16 +00:00
|
|
|
# use_frontface
|
2013-09-16 02:24:41 +00:00
|
|
|
col.separator()
|
|
|
|
row = col.row()
|
|
|
|
row.prop(brush, "use_frontface", text="Front Faces Only")
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2012-03-15 09:11:16 +00:00
|
|
|
# direction
|
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
|
|
|
|
2012-03-15 09:11:16 +00:00
|
|
|
# use_accumulate
|
|
|
|
if capabilities.has_accumulate:
|
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
|
|
|
|
2012-03-15 09:11:16 +00:00
|
|
|
# use_persistent, set_persistent_base
|
|
|
|
if capabilities.has_persistence:
|
2010-07-14 14:11:03 +00:00
|
|
|
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
|
2013-04-20 13:23:53 +00:00
|
|
|
break
|
2010-07-14 14:11:03 +00:00
|
|
|
|
|
|
|
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:
|
2014-07-21 17:24:03 +00:00
|
|
|
brush_texpaint_common(self, context, layout, brush, settings, True)
|
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:
|
|
|
|
|
|
|
|
col = layout.column()
|
2010-07-22 18:56:46 +00:00
|
|
|
|
2012-04-29 20:04:25 +00:00
|
|
|
row = col.row(align=True)
|
|
|
|
self.prop_unified_weight(row, context, brush, "weight", slider=True, text="Weight")
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
row = col.row(align=True)
|
2012-01-14 23:54:51 +00:00
|
|
|
self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
|
2012-01-12 21:48:08 +00:00
|
|
|
self.prop_unified_size(row, context, brush, "use_pressure_size")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = col.row(align=True)
|
2012-01-19 18:22:55 +00:00
|
|
|
self.prop_unified_strength(row, context, brush, "strength", text="Strength")
|
2012-01-12 21:48:08 +00:00
|
|
|
self.prop_unified_strength(row, context, brush, "use_pressure_strength")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2012-06-20 09:34:26 +00:00
|
|
|
col.prop(brush, "vertex_tool", text="Blend")
|
|
|
|
|
2013-06-28 17:10:25 +00:00
|
|
|
col = layout.column()
|
|
|
|
col.prop(toolsettings, "use_auto_normalize", text="Auto Normalize")
|
|
|
|
col.prop(toolsettings, "use_multipaint", text="Multi-Paint")
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
# Vertex Paint Mode #
|
|
|
|
elif context.vertex_paint_object and brush:
|
|
|
|
col = layout.column()
|
2014-07-21 10:02:05 +00:00
|
|
|
self.prop_unified_color_picker(col, context, brush, "color", value_slider=True)
|
|
|
|
if settings.palette:
|
|
|
|
col.template_palette(settings, "palette", color=True)
|
|
|
|
self.prop_unified_color(col, context, brush, "color", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2014-07-21 10:02:05 +00:00
|
|
|
col.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
row = col.row(align=True)
|
2012-01-14 23:54:51 +00:00
|
|
|
self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
|
2012-01-12 21:48:08 +00:00
|
|
|
self.prop_unified_size(row, context, brush, "use_pressure_size")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = col.row(align=True)
|
2012-01-19 18:22:55 +00:00
|
|
|
self.prop_unified_strength(row, context, brush, "strength", text="Strength")
|
2012-01-12 21:48:08 +00:00
|
|
|
self.prop_unified_strength(row, context, brush, "use_pressure_strength")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-14 13:35:44 +00:00
|
|
|
# XXX - TODO
|
2014-07-21 10:02:05 +00:00
|
|
|
# row = col.row(align=True)
|
|
|
|
# row.prop(brush, "jitter", slider=True)
|
|
|
|
# row.prop(brush, "use_pressure_jitter", toggle=True, text="")
|
|
|
|
col.separator()
|
2012-06-20 09:34:26 +00:00
|
|
|
col.prop(brush, "vertex_tool", text="Blend")
|
|
|
|
|
2014-07-21 10:02:05 +00:00
|
|
|
col.separator()
|
|
|
|
col.template_ID(settings, "palette", new="palette.new")
|
|
|
|
|
|
|
|
|
|
|
|
class TEXTURE_UL_texpaintslots(UIList):
|
|
|
|
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
|
2014-08-28 13:48:26 +00:00
|
|
|
mat = data
|
2014-07-21 10:02:05 +00:00
|
|
|
|
|
|
|
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
2014-07-24 09:05:37 +00:00
|
|
|
layout.prop(item, "name", text="", emboss=False, icon_value=icon)
|
2014-10-23 11:39:45 +00:00
|
|
|
if (not mat.use_nodes) and context.scene.render.engine in {'BLENDER_RENDER', 'BLENDER_GAME'}:
|
2014-08-28 13:48:26 +00:00
|
|
|
mtex_index = mat.texture_paint_slots[index].index
|
|
|
|
layout.prop(mat, "use_textures", text="", index=mtex_index)
|
2014-07-21 10:02:05 +00:00
|
|
|
elif self.layout_type in {'GRID'}:
|
|
|
|
layout.alignment = 'CENTER'
|
|
|
|
layout.label(text="")
|
|
|
|
|
2014-09-20 22:29:50 +00:00
|
|
|
class VIEW3D_MT_tools_projectpaint_uvlayer(Menu):
|
|
|
|
bl_label = "Clone Layer"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
for i, tex in enumerate(context.active_object.data.uv_textures):
|
|
|
|
props = layout.operator("wm.context_set_int", text=tex.name, translate=False)
|
|
|
|
props.data_path = "active_object.data.uv_textures.active_index"
|
|
|
|
props.value = i
|
|
|
|
|
2014-07-21 10:02:05 +00:00
|
|
|
|
|
|
|
class VIEW3D_PT_slots_projectpaint(View3DPanel, Panel):
|
|
|
|
bl_context = "imagepaint"
|
|
|
|
bl_label = "Slots"
|
2014-07-24 13:18:49 +00:00
|
|
|
bl_category = "Slots"
|
2014-07-21 10:02:05 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
brush = context.tool_settings.image_paint.brush
|
|
|
|
ob = context.active_object
|
|
|
|
return (brush is not None and ob is not None)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
settings = context.tool_settings.image_paint
|
2014-07-22 02:03:15 +00:00
|
|
|
# brush = settings.brush
|
2014-07-21 10:02:05 +00:00
|
|
|
|
|
|
|
ob = context.active_object
|
|
|
|
col = layout.column()
|
|
|
|
|
2014-08-28 14:40:38 +00:00
|
|
|
col.label("Painting Mode")
|
2014-09-17 08:36:17 +00:00
|
|
|
col.prop(settings, "mode", text="")
|
2014-08-28 14:40:38 +00:00
|
|
|
col.separator()
|
2014-07-21 10:02:05 +00:00
|
|
|
|
2014-08-28 14:40:38 +00:00
|
|
|
if settings.mode == 'MATERIAL':
|
|
|
|
if len(ob.material_slots) > 1:
|
|
|
|
col.label("Materials")
|
|
|
|
col.template_list("MATERIAL_UL_matslots", "layers",
|
|
|
|
ob, "material_slots",
|
|
|
|
ob, "active_material_index", rows=2)
|
|
|
|
|
|
|
|
mat = ob.active_material
|
|
|
|
if mat:
|
|
|
|
col.label("Available Paint Slots")
|
|
|
|
col.template_list("TEXTURE_UL_texpaintslots", "",
|
|
|
|
mat, "texture_paint_images",
|
|
|
|
mat, "paint_active_slot", rows=2)
|
2014-07-21 10:02:05 +00:00
|
|
|
|
2014-10-23 11:39:45 +00:00
|
|
|
if (not mat.use_nodes) and context.scene.render.engine in {'BLENDER_RENDER', 'BLENDER_GAME'}:
|
2014-08-28 14:40:38 +00:00
|
|
|
row = col.row(align=True)
|
|
|
|
row.operator_menu_enum("paint.add_texture_paint_slot", "type")
|
|
|
|
row.operator("paint.delete_texture_paint_slot", text="", icon='X')
|
2014-08-26 17:00:25 +00:00
|
|
|
|
2014-08-28 14:40:38 +00:00
|
|
|
if mat.texture_paint_slots:
|
|
|
|
slot = mat.texture_paint_slots[mat.paint_active_slot]
|
|
|
|
|
|
|
|
col.prop(mat.texture_slots[slot.index], "blend_type")
|
|
|
|
col.separator()
|
|
|
|
col.label("UV Map")
|
|
|
|
col.prop_search(slot, "uv_layer", ob.data, "uv_textures", text="")
|
|
|
|
|
|
|
|
elif settings.mode == 'IMAGE':
|
2014-09-20 22:29:50 +00:00
|
|
|
mesh = ob.data
|
|
|
|
uv_text = mesh.uv_textures.active.name if mesh.uv_textures.active else ""
|
2014-10-06 13:12:06 +00:00
|
|
|
col.label("Canvas Image")
|
2014-08-28 14:40:38 +00:00
|
|
|
col.template_ID(settings, "canvas")
|
2014-10-06 13:12:06 +00:00
|
|
|
col.operator("image.new", text="New").gen_context = 'PAINT_CANVAS'
|
2014-09-20 22:29:50 +00:00
|
|
|
col.label("UV Map")
|
|
|
|
col.menu("VIEW3D_MT_tools_projectpaint_uvlayer", text=uv_text, translate=False)
|
2014-07-23 18:06:29 +00:00
|
|
|
|
2014-08-24 22:15:43 +00:00
|
|
|
col.separator()
|
|
|
|
col.operator("image.save_dirty", text="Save All Images")
|
|
|
|
|
2013-11-19 16:38:18 +00:00
|
|
|
|
2014-07-24 10:41:39 +00:00
|
|
|
class VIEW3D_PT_stencil_projectpaint(View3DPanel, Panel):
|
|
|
|
bl_context = "imagepaint"
|
2014-09-20 23:00:38 +00:00
|
|
|
bl_label = "Mask"
|
2014-07-24 13:18:49 +00:00
|
|
|
bl_category = "Slots"
|
2014-07-24 10:41:39 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
brush = context.tool_settings.image_paint.brush
|
|
|
|
ob = context.active_object
|
|
|
|
return (brush is not None and ob is not None)
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
ipaint = context.tool_settings.image_paint
|
|
|
|
self.layout.prop(ipaint, "use_stencil_layer", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
toolsettings = context.tool_settings
|
|
|
|
ipaint = toolsettings.image_paint
|
|
|
|
ob = context.active_object
|
|
|
|
mesh = ob.data
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.active = ipaint.use_stencil_layer
|
|
|
|
|
|
|
|
stencil_text = mesh.uv_texture_stencil.name if mesh.uv_texture_stencil else ""
|
|
|
|
col.label("UV Map")
|
|
|
|
col.menu("VIEW3D_MT_tools_projectpaint_stencil", text=stencil_text, translate=False)
|
|
|
|
|
2014-10-06 13:12:06 +00:00
|
|
|
col.label("Stencil Image")
|
|
|
|
col.template_ID(ipaint, "stencil_image")
|
|
|
|
col.operator("image.new", text="New").gen_context = 'PAINT_STENCIL'
|
|
|
|
|
2014-07-24 10:41:39 +00:00
|
|
|
|
|
|
|
col.label("Visualization")
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop(ipaint, "stencil_color", text="")
|
|
|
|
row.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA')
|
|
|
|
|
|
|
|
|
2013-10-09 15:21:49 +00:00
|
|
|
class VIEW3D_PT_tools_brush_overlay(Panel, View3DPaintPanel):
|
2014-02-10 17:48:24 +00:00
|
|
|
bl_category = "Options"
|
2013-10-09 14:57:48 +00:00
|
|
|
bl_label = "Overlay"
|
2013-04-22 20:46:18 +00:00
|
|
|
|
2013-10-12 11:18:38 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
settings = cls.paint_settings(context)
|
|
|
|
return (settings and
|
|
|
|
settings.brush and
|
|
|
|
(context.sculpt_object or
|
|
|
|
context.vertex_paint_object or
|
|
|
|
context.weight_paint_object or
|
|
|
|
context.image_paint_object))
|
2013-11-19 16:38:18 +00:00
|
|
|
|
2013-10-09 14:57:48 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2013-10-09 15:07:48 +00:00
|
|
|
settings = self.paint_settings(context)
|
|
|
|
brush = settings.brush
|
2013-10-09 14:57:48 +00:00
|
|
|
tex_slot = brush.texture_slot
|
|
|
|
tex_slot_mask = brush.mask_texture_slot
|
|
|
|
|
|
|
|
col = layout.column()
|
2013-11-19 16:38:18 +00:00
|
|
|
|
2013-10-09 14:57:48 +00:00
|
|
|
col.label(text="Curve:")
|
|
|
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
if brush.use_cursor_overlay:
|
|
|
|
row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
|
|
|
|
else:
|
|
|
|
row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
|
|
|
|
|
|
|
|
sub = row.row(align=True)
|
|
|
|
sub.prop(brush, "cursor_overlay_alpha", text="Alpha")
|
|
|
|
sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
|
|
|
|
|
|
|
|
col.active = brush.brush_capabilities.has_overlay
|
2013-11-19 16:38:18 +00:00
|
|
|
|
2013-10-09 15:21:49 +00:00
|
|
|
if context.image_paint_object or context.sculpt_object or context.vertex_paint_object:
|
|
|
|
col.label(text="Texture:")
|
|
|
|
row = col.row(align=True)
|
|
|
|
if tex_slot.map_mode != 'STENCIL':
|
|
|
|
if brush.use_primary_overlay:
|
|
|
|
row.prop(brush, "use_primary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
|
|
|
|
else:
|
|
|
|
row.prop(brush, "use_primary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
|
2013-10-09 14:57:48 +00:00
|
|
|
|
2013-10-09 15:21:49 +00:00
|
|
|
sub = row.row(align=True)
|
|
|
|
sub.prop(brush, "texture_overlay_alpha", text="Alpha")
|
|
|
|
sub.prop(brush, "use_primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
|
2013-10-09 14:57:48 +00:00
|
|
|
|
|
|
|
if context.image_paint_object:
|
|
|
|
col.label(text="Mask Texture:")
|
|
|
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
if tex_slot_mask.map_mode != 'STENCIL':
|
|
|
|
if brush.use_secondary_overlay:
|
|
|
|
row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
|
|
|
|
else:
|
|
|
|
row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
|
2013-06-27 03:05:19 +00:00
|
|
|
|
2013-08-23 20:41:21 +00:00
|
|
|
sub = row.row(align=True)
|
2013-10-09 14:57:48 +00:00
|
|
|
sub.prop(brush, "mask_overlay_alpha", text="Alpha")
|
|
|
|
sub.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
|
2013-04-22 20:46:18 +00:00
|
|
|
|
2010-01-03 08:37:18 +00:00
|
|
|
|
2012-01-18 05:54:19 +00:00
|
|
|
class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
|
2014-02-10 17:48:24 +00:00
|
|
|
bl_category = "Tools"
|
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)
|
2012-10-08 08:28:05 +00:00
|
|
|
return (settings and settings.brush and
|
2013-03-14 03:42:17 +00:00
|
|
|
(context.sculpt_object or context.image_paint_object or context.vertex_paint_object))
|
2010-01-03 08:37:18 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2011-07-11 05:50:49 +00:00
|
|
|
settings = self.paint_settings(context)
|
2010-01-03 08:37:18 +00:00
|
|
|
brush = settings.brush
|
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)
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2013-01-16 12:57:35 +00:00
|
|
|
brush_texture_settings(col, brush, context.sculpt_object)
|
2011-10-31 01:50:04 +00:00
|
|
|
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2014-10-10 10:33:02 +00:00
|
|
|
class VIEW3D_PT_tools_mask_texture(Panel, View3DPaintPanel):
|
2014-02-10 17:48:24 +00:00
|
|
|
bl_category = "Tools"
|
2013-03-25 01:00:16 +00:00
|
|
|
bl_context = "imagepaint"
|
|
|
|
bl_label = "Texture Mask"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2014-10-06 13:12:06 +00:00
|
|
|
settings = cls.paint_settings(context)
|
2014-10-10 10:33:02 +00:00
|
|
|
return (settings and settings.brush and context.image_paint_object)
|
2013-03-25 01:00:16 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
brush = context.tool_settings.image_paint.brush
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
col.template_ID_preview(brush, "mask_texture", new="texture.new", rows=3, cols=8)
|
|
|
|
|
|
|
|
brush_mask_texture_settings(col, brush)
|
2013-06-27 03:05:19 +00:00
|
|
|
|
2013-03-25 01:00:16 +00:00
|
|
|
|
2012-01-18 05:54:19 +00:00
|
|
|
class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
|
2014-02-10 17:48:24 +00:00
|
|
|
bl_category = "Tools"
|
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)
|
2012-10-08 08:28:05 +00:00
|
|
|
return (settings and
|
|
|
|
settings.brush and
|
|
|
|
(context.sculpt_object or
|
|
|
|
context.vertex_paint_object or
|
|
|
|
context.weight_paint_object or
|
|
|
|
context.image_paint_object))
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2011-07-11 05:50:49 +00:00
|
|
|
settings = self.paint_settings(context)
|
2009-10-31 19:31:45 +00:00
|
|
|
brush = settings.brush
|
|
|
|
|
2010-07-14 14:11:03 +00:00
|
|
|
col = layout.column()
|
|
|
|
|
2013-03-30 11:40:09 +00:00
|
|
|
col.label(text="Stroke Method:")
|
2013-04-07 01:38:03 +00:00
|
|
|
|
2014-03-26 22:04:40 +00:00
|
|
|
col.prop(brush, "stroke_method", text="")
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2013-03-30 11:40:09 +00:00
|
|
|
if brush.use_anchor:
|
|
|
|
col.separator()
|
|
|
|
col.prop(brush, "use_edge_to_edge", "Edge To Edge")
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2013-03-30 11:40:09 +00:00
|
|
|
if brush.use_airbrush:
|
|
|
|
col.separator()
|
|
|
|
col.prop(brush, "rate", text="Rate", slider=True)
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2013-03-30 11:40:09 +00:00
|
|
|
if brush.use_space:
|
|
|
|
col.separator()
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop(brush, "spacing", text="Spacing")
|
|
|
|
row.prop(brush, "use_pressure_spacing", toggle=True, text="")
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2014-07-21 10:02:05 +00:00
|
|
|
if brush.use_line or brush.use_curve:
|
|
|
|
col.separator()
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop(brush, "spacing", text="Spacing")
|
|
|
|
|
|
|
|
if brush.use_curve:
|
|
|
|
col.separator()
|
|
|
|
col.template_ID(brush, "paint_curve", new="paintcurve.new")
|
|
|
|
col.operator("paintcurve.draw")
|
|
|
|
|
2013-03-30 11:40:09 +00:00
|
|
|
if context.sculpt_object:
|
2012-03-15 09:11:16 +00:00
|
|
|
if brush.sculpt_capabilities.has_jitter:
|
2010-07-14 14:11:03 +00:00
|
|
|
col.separator()
|
|
|
|
|
|
|
|
row = col.row(align=True)
|
2014-01-30 05:24:51 +00:00
|
|
|
row.prop(brush, "use_relative_jitter", icon_only=True)
|
2013-03-30 11:40:09 +00:00
|
|
|
if brush.use_relative_jitter:
|
2013-03-10 20:05:18 +00:00
|
|
|
row.prop(brush, "jitter", slider=True)
|
2013-03-11 01:46:22 +00:00
|
|
|
else:
|
|
|
|
row.prop(brush, "jitter_absolute")
|
2010-08-18 03:56:14 +00:00
|
|
|
row.prop(brush, "use_pressure_jitter", toggle=True, text="")
|
2013-09-12 19:51:31 +00:00
|
|
|
|
2013-03-31 16:17:18 +00:00
|
|
|
if brush.sculpt_capabilities.has_smooth_stroke:
|
|
|
|
col = layout.column()
|
|
|
|
col.separator()
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2013-03-31 16:17:18 +00:00
|
|
|
col.prop(brush, "use_smooth_stroke")
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2013-03-31 16:17:18 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = brush.use_smooth_stroke
|
|
|
|
sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
|
|
|
|
sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
|
|
|
|
else:
|
2010-07-14 14:11:03 +00:00
|
|
|
col.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2013-03-10 00:58:09 +00:00
|
|
|
row = col.row(align=True)
|
2014-01-30 05:24:51 +00:00
|
|
|
row.prop(brush, "use_relative_jitter", icon_only=True)
|
2013-03-30 11:40:09 +00:00
|
|
|
if brush.use_relative_jitter:
|
|
|
|
row.prop(brush, "jitter", slider=True)
|
|
|
|
else:
|
|
|
|
row.prop(brush, "jitter_absolute")
|
|
|
|
row.prop(brush, "use_pressure_jitter", toggle=True, text="")
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2013-03-31 16:17:18 +00:00
|
|
|
col = layout.column()
|
|
|
|
col.separator()
|
|
|
|
|
2014-07-21 10:02:05 +00:00
|
|
|
if brush.brush_capabilities.has_smooth_stroke:
|
|
|
|
col.prop(brush, "use_smooth_stroke")
|
2013-03-31 16:17:18 +00:00
|
|
|
|
2014-07-21 10:02:05 +00:00
|
|
|
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)
|
2013-09-05 13:15:29 +00:00
|
|
|
|
2013-09-12 19:51:31 +00:00
|
|
|
layout.prop(settings, "input_samples")
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2013-04-07 01:38:03 +00:00
|
|
|
|
2012-01-18 05:54:19 +00:00
|
|
|
class VIEW3D_PT_tools_brush_curve(Panel, View3DPaintPanel):
|
2014-02-10 17:48:24 +00:00
|
|
|
bl_category = "Tools"
|
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
|
|
|
|
2014-07-21 10:02:05 +00:00
|
|
|
col = layout.column(align=True)
|
|
|
|
row = col.row(align=True)
|
2011-11-08 01:32:34 +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
|
|
|
|
2014-03-24 21:17:01 +00:00
|
|
|
class VIEW3D_PT_sculpt_dyntopo(Panel, View3DPaintPanel):
|
2014-02-10 17:48:24 +00:00
|
|
|
bl_category = "Tools"
|
2014-03-24 21:17:01 +00:00
|
|
|
bl_label = "Dyntopo"
|
2012-12-30 18:31:17 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return (context.sculpt_object and context.tool_settings.sculpt)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
toolsettings = context.tool_settings
|
|
|
|
sculpt = toolsettings.sculpt
|
2013-11-19 20:55:46 +00:00
|
|
|
settings = self.paint_settings(context)
|
|
|
|
brush = settings.brush
|
2012-12-30 18:31:17 +00:00
|
|
|
|
|
|
|
if context.sculpt_object.use_dynamic_topology_sculpting:
|
2014-03-24 21:17:01 +00:00
|
|
|
layout.operator("sculpt.dynamic_topology_toggle", icon='X', text="Disable Dyntopo")
|
2012-12-30 18:31:17 +00:00
|
|
|
else:
|
2014-03-24 21:17:01 +00:00
|
|
|
layout.operator("sculpt.dynamic_topology_toggle", icon='SCULPT_DYNTOPO', text="Enable Dyntopo")
|
2012-12-30 18:31:17 +00:00
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.active = context.sculpt_object.use_dynamic_topology_sculpting
|
2013-11-19 20:55:46 +00:00
|
|
|
sub = col.column(align=True)
|
2014-06-12 12:00:26 +00:00
|
|
|
sub.active = (brush and brush.sculpt_tool != 'MASK')
|
2014-03-22 15:47:18 +00:00
|
|
|
if (sculpt.detail_type_method == 'CONSTANT'):
|
2014-03-22 22:01:46 +00:00
|
|
|
row = sub.row(align=True)
|
|
|
|
row.prop(sculpt, "constant_detail")
|
2014-08-14 14:26:16 +00:00
|
|
|
row.operator("sculpt.sample_detail_size", text="", icon='EYEDROPPER')
|
2014-03-22 15:47:18 +00:00
|
|
|
else:
|
2014-03-31 17:01:28 +00:00
|
|
|
sub.prop(sculpt, "detail_size")
|
2013-11-19 20:55:46 +00:00
|
|
|
sub.prop(sculpt, "detail_refine_method", text="")
|
2014-03-06 18:04:57 +00:00
|
|
|
sub.prop(sculpt, "detail_type_method", text="")
|
2013-11-19 20:55:46 +00:00
|
|
|
col.separator()
|
2012-12-30 18:31:17 +00:00
|
|
|
col.prop(sculpt, "use_smooth_shading")
|
|
|
|
col.operator("sculpt.optimize")
|
2014-03-22 15:47:18 +00:00
|
|
|
if (sculpt.detail_type_method == 'CONSTANT'):
|
2014-04-02 22:24:09 +00:00
|
|
|
col.operator("sculpt.detail_flood_fill")
|
2012-12-30 18:31:17 +00:00
|
|
|
col.separator()
|
|
|
|
col.prop(sculpt, "symmetrize_direction")
|
|
|
|
col.operator("sculpt.symmetrize")
|
|
|
|
|
|
|
|
|
2012-01-18 05:54:19 +00:00
|
|
|
class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
|
2014-02-10 17:48:24 +00:00
|
|
|
bl_category = "Options"
|
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
|
2014-07-22 02:03:15 +00:00
|
|
|
# scene = context.scene
|
2014-03-31 21:30:24 +00:00
|
|
|
|
2012-01-17 17:57:20 +00:00
|
|
|
toolsettings = context.tool_settings
|
|
|
|
sculpt = toolsettings.sculpt
|
2013-12-12 17:01:11 +00:00
|
|
|
capabilities = sculpt.brush.sculpt_capabilities
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
|
|
|
col.active = capabilities.has_gravity
|
|
|
|
col.label(text="Gravity:")
|
|
|
|
col.prop(sculpt, "gravity", slider=True, text="Factor")
|
|
|
|
col.prop(sculpt, "gravity_object")
|
2014-03-31 11:51:40 +00:00
|
|
|
col.separator()
|
2014-04-02 22:24:09 +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, "use_deform_only")
|
2012-10-22 17:33:53 +00:00
|
|
|
layout.prop(sculpt, "show_diffuse_color")
|
2011-05-04 13:15:42 +00:00
|
|
|
|
2012-01-12 17:22:32 +00:00
|
|
|
self.unified_paint_settings(layout, context)
|
2011-05-04 13:15:42 +00:00
|
|
|
|
2010-09-07 15:17:42 +00:00
|
|
|
|
2012-01-18 05:54:19 +00:00
|
|
|
class VIEW3D_PT_sculpt_symmetry(Panel, View3DPaintPanel):
|
2014-02-10 17:48:24 +00:00
|
|
|
bl_category = "Tools"
|
2014-02-22 12:49:40 +00:00
|
|
|
bl_label = "Symmetry / Lock"
|
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
|
|
|
|
|
2011-10-31 00:03:18 +00:00
|
|
|
col = layout.column(align=True)
|
2010-07-14 14:11:03 +00:00
|
|
|
col.label(text="Mirror:")
|
2013-08-23 20:41:21 +00:00
|
|
|
row = col.row(align=True)
|
2011-10-31 00:03:18 +00:00
|
|
|
row.prop(sculpt, "use_symmetry_x", text="X", toggle=True)
|
|
|
|
row.prop(sculpt, "use_symmetry_y", text="Y", toggle=True)
|
|
|
|
row.prop(sculpt, "use_symmetry_z", text="Z", toggle=True)
|
2011-10-31 01:50:04 +00:00
|
|
|
|
2011-10-31 00:03:18 +00:00
|
|
|
layout.column().prop(sculpt, "radial_symmetry", text="Radial")
|
2011-04-01 21:37:40 +00:00
|
|
|
layout.prop(sculpt, "use_symmetry_feather", text="Feather")
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2014-02-12 15:04:39 +00:00
|
|
|
layout.label(text="Lock:")
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-02-12 15:04:39 +00:00
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(sculpt, "lock_x", text="X", toggle=True)
|
|
|
|
row.prop(sculpt, "lock_y", text="Y", toggle=True)
|
|
|
|
row.prop(sculpt, "lock_z", text="Z", toggle=True)
|
2010-09-07 15:17:42 +00:00
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2012-01-18 05:54:19 +00:00
|
|
|
class VIEW3D_PT_tools_brush_appearance(Panel, View3DPaintPanel):
|
2014-02-10 17:48:24 +00:00
|
|
|
bl_category = "Options"
|
2010-07-14 14:11:03 +00:00
|
|
|
bl_label = "Appearance"
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2014-10-06 13:12:06 +00:00
|
|
|
settings = cls.paint_settings(context)
|
|
|
|
return settings
|
2010-07-14 14:11:03 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2011-07-11 05:50:49 +00:00
|
|
|
settings = self.paint_settings(context)
|
2010-07-14 14:11:03 +00:00
|
|
|
brush = settings.brush
|
|
|
|
|
2011-06-27 03:36:14 +00:00
|
|
|
if brush is None: # unlikely but can happen
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.label(text="Brush Unset")
|
2011-06-27 03:36:14 +00:00
|
|
|
return
|
|
|
|
|
2010-09-07 15:17:42 +00:00
|
|
|
col = layout.column()
|
2013-06-27 03:05:19 +00:00
|
|
|
col.prop(settings, "show_brush")
|
2013-05-01 15:28:56 +00:00
|
|
|
|
2014-02-24 20:13:05 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = settings.show_brush
|
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:
|
2012-03-15 09:11:16 +00:00
|
|
|
if brush.sculpt_capabilities.has_secondary_color:
|
2014-02-24 20:13:05 +00:00
|
|
|
sub.row().prop(brush, "cursor_color_add", text="Add")
|
|
|
|
sub.row().prop(brush, "cursor_color_subtract", text="Subtract")
|
2010-07-14 14:11:03 +00:00
|
|
|
else:
|
2014-02-24 20:13:05 +00:00
|
|
|
sub.prop(brush, "cursor_color_add", text="")
|
2010-07-22 18:56:46 +00:00
|
|
|
else:
|
2014-02-24 20:13:05 +00:00
|
|
|
sub.prop(brush, "cursor_color_add", text="")
|
2013-05-01 15:28:56 +00:00
|
|
|
|
2014-02-24 20:13:05 +00:00
|
|
|
col.separator()
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2014-02-24 20:13:05 +00:00
|
|
|
col = col.column(align=True)
|
2011-11-02 15:58:56 +00:00
|
|
|
col.prop(brush, "use_custom_icon")
|
2014-02-24 20:13:05 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = brush.use_custom_icon
|
|
|
|
sub.prop(brush, "icon_filepath", text="")
|
2009-07-24 21:01:41 +00:00
|
|
|
|
2011-10-17 06:58:07 +00:00
|
|
|
# ********** default tools for weight-paint ****************
|
2009-07-02 11:24:27 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel):
|
2014-02-10 17:48:24 +00:00
|
|
|
bl_category = "Tools"
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_context = "weightpaint"
|
|
|
|
bl_label = "Weight Tools"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2014-06-14 13:18:46 +00:00
|
|
|
VIEW3D_PT_tools_meshweight.draw_generic(layout)
|
2011-01-01 07:20:34 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
col = layout.column()
|
2012-12-22 08:19:27 +00:00
|
|
|
col.operator("paint.weight_gradient")
|
2014-06-14 13:18:46 +00:00
|
|
|
col.operator("object.vertex_group_transfer_weight", text="Transfer Weights")
|
2009-10-20 13:59:26 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2012-01-18 05:54:19 +00:00
|
|
|
class VIEW3D_PT_tools_weightpaint_options(Panel, View3DPaintPanel):
|
2014-02-10 17:48:24 +00:00
|
|
|
bl_category = "Options"
|
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()
|
2013-09-05 13:15:29 +00:00
|
|
|
row = col.row()
|
2012-01-15 13:23:57 +00:00
|
|
|
|
2013-09-05 13:15:29 +00:00
|
|
|
row.prop(wpaint, "use_normal")
|
|
|
|
col = layout.column()
|
|
|
|
row = col.row()
|
|
|
|
row.prop(wpaint, "use_spray")
|
|
|
|
row.prop(wpaint, "use_group_restrict")
|
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")
|
2013-06-28 17:13:09 +00:00
|
|
|
row = col.row()
|
|
|
|
row.active = mesh.use_mirror_x
|
|
|
|
row.prop(mesh, "use_mirror_topology")
|
2009-07-24 11:14:59 +00:00
|
|
|
|
2013-02-22 04:09:04 +00:00
|
|
|
col.label("Show Zero Weights:")
|
2013-04-13 22:52:28 +00:00
|
|
|
sub = col.row()
|
|
|
|
sub.active = (not tool_settings.use_multipaint)
|
|
|
|
sub.prop(tool_settings, "vertex_group_user", expand=True)
|
2013-02-22 04:09:04 +00:00
|
|
|
|
2012-01-12 17:22:32 +00:00
|
|
|
self.unified_paint_settings(col, context)
|
2010-07-22 18:56:46 +00:00
|
|
|
|
2011-10-17 06:58:07 +00:00
|
|
|
# ********** default tools for vertex-paint ****************
|
2009-07-02 11:24:27 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2012-01-18 05:54:19 +00:00
|
|
|
class VIEW3D_PT_tools_vertexpaint(Panel, View3DPaintPanel):
|
2014-02-10 17:48:24 +00:00
|
|
|
bl_category = "Options"
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_context = "vertexpaint"
|
|
|
|
bl_label = "Options"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2012-01-17 17:57:20 +00:00
|
|
|
toolsettings = context.tool_settings
|
|
|
|
vpaint = toolsettings.vertex_paint
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = layout.column()
|
2013-09-05 13:15:29 +00:00
|
|
|
row = col.row()
|
2014-07-21 10:02:05 +00:00
|
|
|
# col.prop(vpaint, "mode", text="")
|
2013-09-05 13:15:29 +00:00
|
|
|
row.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
|
|
|
|
2012-01-12 17:22:32 +00:00
|
|
|
self.unified_paint_settings(col, context)
|
2010-07-22 18:56:46 +00:00
|
|
|
|
2009-07-24 11:14:59 +00:00
|
|
|
# Commented out because the Apply button isn't an operator yet, making these settings useless
|
2012-02-08 04:37:37 +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
|
|
|
|
2011-10-17 06:58:07 +00:00
|
|
|
# ********** default tools for texture-paint ****************
|
2009-07-02 11:24:27 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2014-06-03 02:05:47 +00:00
|
|
|
class VIEW3D_PT_tools_imagepaint_external(Panel, View3DPaintPanel):
|
|
|
|
bl_category = "Tools"
|
|
|
|
bl_context = "imagepaint"
|
|
|
|
bl_label = "External"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
toolsettings = context.tool_settings
|
|
|
|
ipaint = toolsettings.image_paint
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
row = col.split(align=True, percentage=0.55)
|
|
|
|
row.operator("image.project_edit", text="Quick Edit")
|
|
|
|
row.operator("image.project_apply", text="Apply")
|
|
|
|
|
|
|
|
col.row().prop(ipaint, "screen_grab_size", text="")
|
|
|
|
|
|
|
|
col.operator("paint.project_image", text="Apply Camera Image")
|
|
|
|
|
|
|
|
|
2014-07-21 10:02:05 +00:00
|
|
|
class VIEW3D_PT_tools_projectpaint(View3DPaintPanel, Panel):
|
2014-02-10 17:48:24 +00:00
|
|
|
bl_category = "Options"
|
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
|
2012-11-06 09:19:51 +00:00
|
|
|
return (brush is not None)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2012-01-17 17:57:20 +00:00
|
|
|
toolsettings = context.tool_settings
|
|
|
|
ipaint = toolsettings.image_paint
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = layout.column()
|
2014-07-21 10:02:05 +00:00
|
|
|
|
2011-11-02 16:19:57 +00:00
|
|
|
col.prop(ipaint, "use_occlude")
|
|
|
|
col.prop(ipaint, "use_backface_culling")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-11-02 16:19:57 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.prop(ipaint, "use_normal_falloff")
|
2013-09-12 19:51:31 +00:00
|
|
|
|
2011-11-02 16:19:57 +00:00
|
|
|
sub = row.row()
|
|
|
|
sub.active = (ipaint.use_normal_falloff)
|
|
|
|
sub.prop(ipaint, "normal_angle", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-11-02 16:19:57 +00:00
|
|
|
layout.prop(ipaint, "seam_bleed")
|
2014-07-21 10:02:05 +00:00
|
|
|
self.unified_paint_settings(layout, context)
|
2011-11-04 15:21:34 +00:00
|
|
|
|
2009-12-22 10:48:13 +00:00
|
|
|
|
2012-01-18 05:54:19 +00:00
|
|
|
class VIEW3D_PT_imagepaint_options(View3DPaintPanel):
|
2014-02-10 17:48:24 +00:00
|
|
|
bl_category = "Options"
|
2010-07-22 18:56:46 +00:00
|
|
|
bl_label = "Options"
|
|
|
|
|
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
|
|
|
|
2010-07-22 18:56:46 +00:00
|
|
|
col = layout.column()
|
2012-01-12 17:22:32 +00:00
|
|
|
self.unified_paint_settings(col, context)
|
2010-09-07 15:17:42 +00:00
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class VIEW3D_MT_tools_projectpaint_stencil(Menu):
|
2010-02-14 11:21:21 +00:00
|
|
|
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):
|
2013-02-08 16:41:02 +00:00
|
|
|
props = layout.operator("wm.context_set_int", text=tex.name, translate=False)
|
2012-01-01 13:09:58 +00:00
|
|
|
props.data_path = "active_object.data.uv_texture_stencil_index"
|
|
|
|
props.value = i
|
2009-12-22 10:48:13 +00:00
|
|
|
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class VIEW3D_PT_tools_particlemode(View3DPanel, Panel):
|
2013-03-10 17:42:08 +00:00
|
|
|
"""Default tools for particle mode"""
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_context = "particlemode"
|
|
|
|
bl_label = "Options"
|
2014-03-03 09:37:27 +00:00
|
|
|
bl_category = "Tools"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
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:
|
2013-02-18 13:30:40 +00:00
|
|
|
layout.template_list("UI_UL_list", "particle_systems", ob, "particle_systems",
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
ob.particle_systems, "active_index", rows=2, maxrows=3)
|
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:
|
2013-02-18 13:30:40 +00:00
|
|
|
layout.template_list("UI_UL_list", "particles_point_caches", 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")
|
2013-08-23 20:41:21 +00:00
|
|
|
sub = col.row(align=True)
|
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")
|
2013-08-23 20:41:21 +00:00
|
|
|
sub = col.row(align=True)
|
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
|
|
|
|
2014-02-12 21:51:33 +00:00
|
|
|
|
2014-01-29 15:53:20 +00:00
|
|
|
# Grease Pencil tools
|
2014-02-24 19:53:37 +00:00
|
|
|
class VIEW3D_PT_tools_grease_pencil(GreasePencilPanel, Panel):
|
|
|
|
bl_space_type = 'VIEW_3D'
|
|
|
|
bl_region_type = 'TOOLS'
|
2014-01-29 15:53:20 +00:00
|
|
|
bl_category = "Grease Pencil"
|
|
|
|
|
|
|
|
|
2014-08-26 13:41:12 +00:00
|
|
|
# Note: moved here so that it's always in last position in 'Tools' panels!
|
|
|
|
class VIEW3D_PT_tools_history(View3DPanel, Panel):
|
|
|
|
bl_category = "Tools"
|
|
|
|
# No bl_context, we are always available!
|
|
|
|
bl_label = "History"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
obj = context.object
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.operator("ed.undo")
|
|
|
|
row.operator("ed.redo")
|
|
|
|
if obj is None or obj.mode not in {'SCULPT'}:
|
|
|
|
# Sculpt mode does not generate an undo menu it seems...
|
|
|
|
col.operator("ed.undo_history")
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
|
|
|
col.label(text="Repeat:")
|
|
|
|
col.operator("screen.repeat_last")
|
|
|
|
col.operator("screen.repeat_history", text="History...")
|
|
|
|
|
|
|
|
|
2011-04-04 10:13:04 +00:00
|
|
|
if __name__ == "__main__": # only for live edit.
|
|
|
|
bpy.utils.register_module(__name__)
|