1 # ##### BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # ##### END GPL LICENSE BLOCK #####
24 bl_space_type = 'VIEW_3D'
25 bl_region_type = 'TOOLS'
28 # ********** default tools for objectmode ****************
31 class VIEW3D_PT_tools_objectmode(View3DPanel, bpy.types.Panel):
32 bl_context = "objectmode"
33 bl_label = "Object Tools"
35 def draw(self, context):
38 col = layout.column(align=True)
39 col.label(text="Transform:")
40 col.operator("transform.translate")
41 col.operator("transform.rotate")
42 col.operator("transform.resize", text="Scale")
44 col = layout.column(align=True)
45 col.operator("object.origin_set", text="Origin")
47 col = layout.column(align=True)
48 col.label(text="Object:")
49 col.operator("object.duplicate_move")
50 col.operator("object.delete")
51 col.operator("object.join")
53 active_object = context.active_object
54 if active_object and active_object.type == 'MESH':
56 col = layout.column(align=True)
57 col.label(text="Shading:")
58 col.operator("object.shade_smooth", text="Smooth")
59 col.operator("object.shade_flat", text="Flat")
61 col = layout.column(align=True)
62 col.label(text="Keyframes:")
63 col.operator("anim.keyframe_insert_menu", text="Insert")
64 col.operator("anim.keyframe_delete_v3d", text="Remove")
66 col = layout.column(align=True)
67 col.label(text="Repeat:")
68 col.operator("screen.repeat_last")
69 col.operator("screen.repeat_history", text="History...")
71 col = layout.column(align=True)
72 col.label(text="Grease Pencil:")
74 row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
75 row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
76 row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
78 # ********** default tools for editmode_mesh ****************
81 class VIEW3D_PT_tools_meshedit(View3DPanel, bpy.types.Panel):
82 bl_context = "mesh_edit"
83 bl_label = "Mesh Tools"
85 def draw(self, context):
88 col = layout.column(align=True)
89 col.label(text="Transform:")
90 col.operator("transform.translate")
91 col.operator("transform.rotate")
92 col.operator("transform.resize", text="Scale")
93 col.operator("transform.shrink_fatten", text="Along Normal")
96 col = layout.column(align=True)
97 col.label(text="Deform:")
98 col.operator("transform.edge_slide")
99 col.operator("mesh.rip_move")
100 col.operator("mesh.vertices_smooth")
103 col = layout.column(align=True)
104 col.label(text="Add:")
105 col.operator("view3d.edit_mesh_extrude_move_normal", text="Extrude Region")
106 col.operator("view3d.edit_mesh_extrude_individual_move", text="Extrude Individual")
107 col.operator("mesh.subdivide")
108 col.operator("mesh.loopcut_slide")
109 col.operator("mesh.duplicate_move", text="Duplicate")
110 col.operator("mesh.spin")
111 col.operator("mesh.screw")
113 col = layout.column(align=True)
114 col.label(text="Remove:")
115 col.operator("mesh.delete")
116 col.operator("mesh.merge")
117 col.operator("mesh.remove_doubles")
119 col = layout.column(align=True)
120 col.label(text="Normals:")
121 col.operator("mesh.normals_make_consistent", text="Recalculate")
122 col.operator("mesh.flip_normals", text="Flip Direction")
124 col = layout.column(align=True)
125 col.label(text="UV Mapping:")
126 col.operator("wm.call_menu", text="Unwrap").name = "VIEW3D_MT_uv_map"
127 col.operator("mesh.mark_seam")
128 col.operator("mesh.mark_seam", text="Clear Seam").clear = True
131 col = layout.column(align=True)
132 col.label(text="Shading:")
133 col.operator("mesh.faces_shade_smooth", text="Smooth")
134 col.operator("mesh.faces_shade_flat", text="Flat")
136 col = layout.column(align=True)
137 col.label(text="Repeat:")
138 col.operator("screen.repeat_last")
139 col.operator("screen.repeat_history", text="History...")
141 col = layout.column(align=True)
142 col.label(text="Grease Pencil:")
144 row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
145 row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
146 row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
149 class VIEW3D_PT_tools_meshedit_options(View3DPanel, bpy.types.Panel):
150 bl_context = "mesh_edit"
151 bl_label = "Mesh Options"
153 def draw(self, context):
156 ob = context.active_object
159 mesh = context.active_object.data
160 col = layout.column(align=True)
161 col.prop(mesh, "use_mirror_x")
162 col.prop(mesh, "use_mirror_topology")
163 col.prop(context.tool_settings, "edge_path_mode")
165 # ********** default tools for editmode_curve ****************
168 class VIEW3D_PT_tools_curveedit(View3DPanel, bpy.types.Panel):
169 bl_context = "curve_edit"
170 bl_label = "Curve Tools"
172 def draw(self, context):
175 col = layout.column(align=True)
176 col.label(text="Transform:")
177 col.operator("transform.translate")
178 col.operator("transform.rotate")
179 col.operator("transform.resize", text="Scale")
181 col = layout.column(align=True)
182 col.operator("transform.transform", text="Tilt").mode = 'TILT'
183 col.operator("transform.transform", text="Shrink/Fatten").mode = 'CURVE_SHRINKFATTEN'
185 col = layout.column(align=True)
186 col.label(text="Curve:")
187 col.operator("curve.duplicate")
188 col.operator("curve.delete")
189 col.operator("curve.cyclic_toggle")
190 col.operator("curve.switch_direction")
191 col.operator("curve.spline_type_set")
193 col = layout.column(align=True)
194 col.label(text="Handles:")
196 row.operator("curve.handle_type_set", text="Auto").type = 'AUTOMATIC'
197 row.operator("curve.handle_type_set", text="Vector").type = 'VECTOR'
199 row.operator("curve.handle_type_set", text="Align").type = 'ALIGN'
200 row.operator("curve.handle_type_set", text="Free").type = 'FREE_ALIGN'
202 col = layout.column(align=True)
203 col.label(text="Modeling:")
204 col.operator("curve.extrude")
205 col.operator("curve.subdivide")
207 col = layout.column(align=True)
208 col.label(text="Repeat:")
209 col.operator("screen.repeat_last")
210 col.operator("screen.repeat_history", text="History...")
212 col = layout.column(align=True)
213 col.label(text="Grease Pencil:")
215 row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
216 row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
217 row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
219 # ********** default tools for editmode_surface ****************
222 class VIEW3D_PT_tools_surfaceedit(View3DPanel, bpy.types.Panel):
223 bl_context = "surface_edit"
224 bl_label = "Surface Tools"
226 def draw(self, context):
229 col = layout.column(align=True)
230 col.label(text="Transform:")
231 col.operator("transform.translate")
232 col.operator("transform.rotate")
233 col.operator("transform.resize", text="Scale")
235 col = layout.column(align=True)
236 col.label(text="Curve:")
237 col.operator("curve.duplicate")
238 col.operator("curve.delete")
239 col.operator("curve.cyclic_toggle")
240 col.operator("curve.switch_direction")
242 col = layout.column(align=True)
243 col.label(text="Modeling:")
244 col.operator("curve.extrude")
245 col.operator("curve.subdivide")
247 col = layout.column(align=True)
248 col.label(text="Repeat:")
249 col.operator("screen.repeat_last")
250 col.operator("screen.repeat_history", text="History...")
252 col = layout.column(align=True)
253 col.label(text="Grease Pencil:")
255 row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
256 row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
257 row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
259 # ********** default tools for editmode_text ****************
262 class VIEW3D_PT_tools_textedit(View3DPanel, bpy.types.Panel):
263 bl_context = "text_edit"
264 bl_label = "Text Tools"
266 def draw(self, context):
269 col = layout.column(align=True)
270 col.label(text="Text Edit:")
271 col.operator("font.text_copy", text="Copy")
272 col.operator("font.text_cut", text="Cut")
273 col.operator("font.text_paste", text="Paste")
275 col = layout.column(align=True)
276 col.label(text="Set Case:")
277 col.operator("font.case_set", text="To Upper").case = 'UPPER'
278 col.operator("font.case_set", text="To Lower").case = 'LOWER'
280 col = layout.column(align=True)
281 col.label(text="Style:")
282 col.operator("font.style_toggle", text="Bold").style = 'BOLD'
283 col.operator("font.style_toggle", text="Italic").style = 'ITALIC'
284 col.operator("font.style_toggle", text="Underline").style = 'UNDERLINE'
286 col = layout.column(align=True)
287 col.label(text="Repeat:")
288 col.operator("screen.repeat_last")
289 col.operator("screen.repeat_history", text="History...")
292 # ********** default tools for editmode_armature ****************
295 class VIEW3D_PT_tools_armatureedit(View3DPanel, bpy.types.Panel):
296 bl_context = "armature_edit"
297 bl_label = "Armature Tools"
299 def draw(self, context):
302 col = layout.column(align=True)
303 col.label(text="Transform:")
304 col.operator("transform.translate")
305 col.operator("transform.rotate")
306 col.operator("transform.resize", text="Scale")
308 col = layout.column(align=True)
309 col.label(text="Bones:")
310 col.operator("armature.bone_primitive_add", text="Add")
311 col.operator("armature.duplicate_move", text="Duplicate")
312 col.operator("armature.delete", text="Delete")
314 col = layout.column(align=True)
315 col.label(text="Modeling:")
316 col.operator("armature.extrude_move")
317 col.operator("armature.subdivide_multi", text="Subdivide")
319 col = layout.column(align=True)
320 col.label(text="Repeat:")
321 col.operator("screen.repeat_last")
322 col.operator("screen.repeat_history", text="History...")
324 col = layout.column(align=True)
325 col.label(text="Grease Pencil:")
327 row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
328 row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
329 row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
332 class VIEW3D_PT_tools_armatureedit_options(View3DPanel, bpy.types.Panel):
333 bl_context = "armature_edit"
334 bl_label = "Armature Options"
336 def draw(self, context):
339 arm = context.active_object.data
341 col = layout.column(align=True)
342 col.prop(arm, "x_axis_mirror")
344 # ********** default tools for editmode_mball ****************
347 class VIEW3D_PT_tools_mballedit(View3DPanel, bpy.types.Panel):
348 bl_context = "mball_edit"
349 bl_label = "Meta Tools"
351 def draw(self, context):
354 col = layout.column(align=True)
355 col.label(text="Transform:")
356 col.operator("transform.translate")
357 col.operator("transform.rotate")
358 col.operator("transform.resize", text="Scale")
360 col = layout.column(align=True)
361 col.label(text="Repeat:")
362 col.operator("screen.repeat_last")
363 col.operator("screen.repeat_history", text="History...")
365 col = layout.column(align=True)
366 col.label(text="Grease Pencil:")
368 row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
369 row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
370 row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
372 # ********** default tools for editmode_lattice ****************
375 class VIEW3D_PT_tools_latticeedit(View3DPanel, bpy.types.Panel):
376 bl_context = "lattice_edit"
377 bl_label = "Lattice Tools"
379 def draw(self, context):
382 col = layout.column(align=True)
383 col.label(text="Transform:")
384 col.operator("transform.translate")
385 col.operator("transform.rotate")
386 col.operator("transform.resize", text="Scale")
388 col = layout.column(align=True)
389 col.operator("lattice.make_regular")
391 col = layout.column(align=True)
392 col.label(text="Repeat:")
393 col.operator("screen.repeat_last")
394 col.operator("screen.repeat_history", text="History...")
396 col = layout.column(align=True)
397 col.label(text="Grease Pencil:")
399 row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
400 row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
401 row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
404 # ********** default tools for posemode ****************
407 class VIEW3D_PT_tools_posemode(View3DPanel, bpy.types.Panel):
408 bl_context = "posemode"
409 bl_label = "Pose Tools"
411 def draw(self, context):
414 col = layout.column(align=True)
415 col.label(text="Transform:")
416 col.operator("transform.translate")
417 col.operator("transform.rotate")
418 col.operator("transform.resize", text="Scale")
420 col = layout.column(align=True)
421 col.label(text="In-Between:")
423 row.operator("pose.push", text="Push")
424 row.operator("pose.relax", text="Relax")
425 col.operator("pose.breakdown", text="Breakdowner")
427 col = layout.column(align=True)
428 col.label(text="Pose:")
430 row.operator("pose.copy", text="Copy")
431 row.operator("pose.paste", text="Paste")
433 col = layout.column(align=True)
434 col.operator("poselib.pose_add", text="Add To Library")
436 col = layout.column(align=True)
437 col.label(text="Keyframes:")
439 col.operator("anim.keyframe_insert_menu", text="Insert")
440 col.operator("anim.keyframe_delete_v3d", text="Remove")
442 col = layout.column(align=True)
443 col.label(text="Repeat:")
444 col.operator("screen.repeat_last")
445 col.operator("screen.repeat_history", text="History...")
447 col = layout.column(align=True)
448 col.label(text="Grease Pencil:")
450 row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
451 row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
452 row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
455 class VIEW3D_PT_tools_posemode_options(View3DPanel, bpy.types.Panel):
456 bl_context = "posemode"
457 bl_label = "Pose Options"
459 def draw(self, context):
462 arm = context.active_object.data
464 col = layout.column(align=True)
465 col.prop(arm, "x_axis_mirror")
466 col.prop(arm, "auto_ik")
468 # ********** default tools for paint modes ****************
472 bl_space_type = 'VIEW_3D'
473 bl_region_type = 'TOOLS'
476 def paint_settings(context):
477 ts = context.tool_settings
479 if context.sculpt_object:
481 elif context.vertex_paint_object:
482 return ts.vertex_paint
483 elif context.weight_paint_object:
484 return ts.weight_paint
485 elif context.texture_paint_object:
486 return ts.image_paint
487 elif context.particle_edit_object:
488 return ts.particle_edit
493 class VIEW3D_PT_tools_brush(PaintPanel, bpy.types.Panel):
497 def poll(cls, context):
498 return cls.paint_settings(context)
500 def draw(self, context):
503 settings = __class__.paint_settings(context)
504 brush = settings.brush
506 if not context.particle_edit_object:
507 col = layout.split().column()
508 col.template_ID_preview(settings, "brush", new="brush.add", rows=3, cols=8)
512 # XXX This needs a check if psys is editable.
513 if context.particle_edit_object:
514 # XXX Select Particle System
515 layout.column().prop(settings, "tool", expand=True)
517 if settings.tool != 'NONE':
518 col = layout.column()
519 col.prop(brush, "size", slider=True)
520 if settings.tool != 'ADD':
521 col.prop(brush, "strength", slider=True)
523 if settings.tool == 'ADD':
524 col.prop(brush, "count")
525 col = layout.column()
526 col.prop(settings, "add_interpolate")
527 sub = col.column(align=True)
528 sub.active = settings.add_interpolate
529 sub.prop(brush, "steps", slider=True)
530 sub.prop(settings, "add_keys", slider=True)
531 elif settings.tool == 'LENGTH':
532 layout.prop(brush, "length_mode", expand=True)
533 elif settings.tool == 'PUFF':
534 layout.prop(brush, "puff_mode", expand=True)
535 layout.prop(brush, "use_puff_volume")
539 elif context.sculpt_object and brush:
541 col = layout.column()
546 row = col.row(align=True)
548 if brush.use_locked_size:
549 row.prop(brush, "use_locked_size", toggle=True, text="", icon='LOCKED')
550 row.prop(brush, "unprojected_radius", text="Radius", slider=True)
552 row.prop(brush, "use_locked_size", toggle=True, text="", icon='UNLOCKED')
553 row.prop(brush, "size", text="Radius", slider=True)
555 row.prop(brush, "use_size_pressure", toggle=True, text="")
558 if brush.sculpt_tool not in ('SNAKE_HOOK', 'GRAB', 'ROTATE'):
561 row = col.row(align=True)
563 if brush.use_space and brush.sculpt_tool not in ('SMOOTH'):
564 if brush.use_space_atten:
565 row.prop(brush, "use_space_atten", toggle=True, text="", icon='LOCKED')
567 row.prop(brush, "use_space_atten", toggle=True, text="", icon='UNLOCKED')
569 row.prop(brush, "strength", text="Strength", slider=True)
570 row.prop(brush, "use_strength_pressure", text="")
574 if brush.sculpt_tool not in ('SMOOTH'):
577 row = col.row(align=True)
578 row.prop(brush, "autosmooth_factor", slider=True)
579 row.prop(brush, "use_inverse_smooth_pressure", toggle=True, text="")
583 if brush.sculpt_tool in ('GRAB', 'SNAKE_HOOK'):
586 row = col.row(align=True)
587 row.prop(brush, "normal_weight", slider=True)
591 if brush.sculpt_tool in ('CREASE', 'BLOB'):
594 row = col.row(align=True)
595 row.prop(brush, "crease_pinch_factor", slider=True, text="Pinch")
597 if brush.sculpt_tool not in ('PINCH', 'INFLATE', 'SMOOTH'):
598 row = col.row(align=True)
602 if brush.use_original_normal:
603 row.prop(brush, "use_original_normal", toggle=True, text="", icon='LOCKED')
605 row.prop(brush, "use_original_normal", toggle=True, text="", icon='UNLOCKED')
607 row.prop(brush, "sculpt_plane", text="")
609 #if brush.sculpt_tool in ('CLAY', 'CLAY_TUBES', 'FLATTEN', 'FILL', 'SCRAPE'):
610 if brush.sculpt_tool in ('CLAY', 'FLATTEN', 'FILL', 'SCRAPE'):
611 row = col.row(align=True)
612 row.prop(brush, "plane_offset", slider=True)
613 row.prop(brush, "use_offset_pressure", text="")
618 row.prop(brush, "use_plane_trim", text="Trim")
620 row.active=brush.use_plane_trim
621 row.prop(brush, "plane_trim", slider=True, text="Distance")
626 row.prop(brush, "use_frontface", text="Front Faces Only")
629 col.row().prop(brush, "direction", expand=True)
631 if brush.sculpt_tool in ('DRAW', 'CREASE', 'BLOB', 'INFLATE', 'LAYER', 'CLAY'):
634 col.prop(brush, "use_accumulate")
638 if brush.sculpt_tool == 'LAYER':
641 ob = context.sculpt_object
644 # not supported yet for this case
645 for md in ob.modifiers:
646 if md.type == 'MULTIRES':
647 do_persistent = False
650 col.prop(brush, "use_persistent")
651 col.operator("sculpt.set_persistent_base")
653 # Texture Paint Mode #
655 elif context.texture_paint_object and brush:
656 col = layout.column()
657 col.template_color_wheel(brush, "color", value_slider=True)
658 col.prop(brush, "color", text="")
660 row = col.row(align=True)
661 row.prop(brush, "size", text="Radius", slider=True)
662 row.prop(brush, "use_size_pressure", toggle=True, text="")
664 row = col.row(align=True)
665 row.prop(brush, "strength", text="Strength", slider=True)
666 row.prop(brush, "use_strength_pressure", toggle=True, text="")
668 row = col.row(align=True)
669 row.prop(brush, "jitter", slider=True)
670 row.prop(brush, "use_jitter_pressure", toggle=True, text="")
672 col.prop(brush, "blend", text="Blend")
674 col = layout.column()
675 col.active = (brush.blend not in ('ERASE_ALPHA', 'ADD_ALPHA'))
676 col.prop(brush, "use_alpha")
679 # Weight Paint Mode #
681 elif context.weight_paint_object and brush:
682 layout.prop(context.tool_settings, "vertex_group_weight", text="Weight", slider=True)
683 layout.prop(context.tool_settings, "auto_normalize", text="Auto Normalize")
685 col = layout.column()
687 row = col.row(align=True)
688 row.prop(brush, "size", text="Radius", slider=True)
689 row.prop(brush, "use_size_pressure", toggle=True, text="")
691 row = col.row(align=True)
692 row.prop(brush, "strength", text="Strength", slider=True)
693 row.prop(brush, "use_strength_pressure", toggle=True, text="")
695 row = col.row(align=True)
696 row.prop(brush, "jitter", slider=True)
697 row.prop(brush, "use_jitter_pressure", toggle=True, text="")
699 # Vertex Paint Mode #
701 elif context.vertex_paint_object and brush:
702 col = layout.column()
703 col.template_color_wheel(brush, "color", value_slider=True)
704 col.prop(brush, "color", text="")
706 row = col.row(align=True)
707 row.prop(brush, "size", text="Radius", slider=True)
708 row.prop(brush, "use_size_pressure", toggle=True, text="")
710 row = col.row(align=True)
711 row.prop(brush, "strength", text="Strength", slider=True)
712 row.prop(brush, "use_strength_pressure", toggle=True, text="")
715 #row = col.row(align=True)
716 #row.prop(brush, "jitter", slider=True)
717 #row.prop(brush, "use_jitter_pressure", toggle=True, text="")
720 class VIEW3D_PT_tools_brush_texture(PaintPanel, bpy.types.Panel):
722 bl_default_closed = True
725 def poll(cls, context):
726 settings = cls.paint_settings(context)
727 return (settings and settings.brush and (context.sculpt_object or
728 context.texture_paint_object))
730 def draw(self, context):
733 settings = __class__.paint_settings(context)
734 brush = settings.brush
735 tex_slot = brush.texture_slot
737 col = layout.column()
739 col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
741 if context.sculpt_object:
742 #XXX duplicated from properties_texture.py
749 col.label(text="Brush Mapping:")
750 row = col.row(align=True)
751 row.prop(tex_slot, "map_mode", expand=True)
755 col = layout.column()
756 col.active = tex_slot.map_mode in ('FIXED')
757 col.label(text="Angle:")
759 col = layout.column()
760 if not brush.use_anchor and brush.sculpt_tool not in ('GRAB', 'SNAKE_HOOK', 'THUMB', 'ROTATE') and tex_slot.map_mode in ('FIXED'):
761 col.prop(brush, "texture_angle_source", text="")
763 col.prop(brush, "texture_angle_source_no_random", text="")
765 #row = col.row(align=True)
766 #row.label(text="Angle:")
767 #row.active = tex_slot.map_mode in ('FIXED', 'TILED')
769 #row = col.row(align=True)
772 #col.active = tex_slot.map_mode in ('FIXED')
773 #col.prop(brush, "use_rake", toggle=True, icon='PARTICLEMODE', text="")
775 col = layout.column()
776 col.prop(tex_slot, "angle", text="")
777 col.active = tex_slot.map_mode in ('FIXED', 'TILED')
779 #col = layout.column()
780 #col.prop(brush, "use_random_rotation")
781 #col.active = (not brush.use_rake) and (not brush.use_anchor) and brush.sculpt_tool not in ('GRAB', 'SNAKE_HOOK', 'THUMB', 'ROTATE') and tex_slot.map_mode in ('FIXED')
783 split = layout.split()
786 col.prop(tex_slot, "offset")
790 col.prop(tex_slot, "size")
792 col = layout.column()
794 row = col.row(align=True)
795 row.label(text="Sample Bias:")
796 row = col.row(align=True)
797 row.prop(brush, "texture_sample_bias", slider=True, text="")
799 row = col.row(align=True)
800 row.label(text="Overlay:")
801 row.active = tex_slot.map_mode in ('FIXED', 'TILED')
803 row = col.row(align=True)
807 if brush.use_texture_overlay:
808 col.prop(brush, "use_texture_overlay", toggle=True, text="", icon='MUTE_IPO_OFF')
810 col.prop(brush, "use_texture_overlay", toggle=True, text="", icon='MUTE_IPO_ON')
812 col.active = tex_slot.map_mode in ('FIXED', 'TILED')
815 col.prop(brush, "texture_overlay_alpha", text="Alpha")
816 col.active = tex_slot.map_mode in ('FIXED', 'TILED') and brush.use_texture_overlay
819 class VIEW3D_PT_tools_brush_tool(PaintPanel, bpy.types.Panel):
821 bl_default_closed = True
824 def poll(cls, context):
825 settings = cls.paint_settings(context)
826 return (settings and settings.brush and
827 (context.sculpt_object or context.texture_paint_object or
828 context.vertex_paint_object or context.weight_paint_object))
830 def draw(self, context):
833 settings = __class__.paint_settings(context)
834 brush = settings.brush
835 texture_paint = context.texture_paint_object
836 sculpt = context.sculpt_object
838 col = layout.column(align=True)
840 if context.sculpt_object:
841 col.prop(brush, "sculpt_tool", expand=False, text="")
842 col.operator("brush.reset")
843 elif context.texture_paint_object:
844 col.prop(brush, "imagepaint_tool", expand=False, text="")
845 elif context.vertex_paint_object or context.weight_paint_object:
846 col.prop(brush, "vertexpaint_tool", expand=False, text="")
848 row = layout.row(align=True)
849 row.prop(brush, "use_paint_sculpt", text="", icon='SCULPTMODE_HLT')
850 row.prop(brush, "use_paint_vertex", text="", icon='VPAINT_HLT')
851 row.prop(brush, "use_paint_weight", text="", icon='WPAINT_HLT')
852 row.prop(brush, "use_paint_texture", text="", icon='TPAINT_HLT')
855 class VIEW3D_PT_tools_brush_stroke(PaintPanel, bpy.types.Panel):
857 bl_default_closed = True
860 def poll(cls, context):
861 settings = cls.paint_settings(context)
862 return (settings and settings.brush and (context.sculpt_object or
863 context.vertex_paint_object or
864 context.weight_paint_object or
865 context.texture_paint_object))
867 def draw(self, context):
870 settings = __class__.paint_settings(context)
871 brush = settings.brush
872 texture_paint = context.texture_paint_object
874 col = layout.column()
876 if context.sculpt_object:
877 col.label(text="Stroke Method:")
878 col.prop(brush, "stroke_method", text="")
883 row.prop(brush, "edge_to_edge", "Edge To Edge")
885 if brush.use_airbrush:
888 row.prop(brush, "rate", text="Rate", slider=True)
893 row.active = brush.use_space
894 row.prop(brush, "spacing", text="Spacing")
896 if brush.sculpt_tool not in ('GRAB', 'THUMB', 'SNAKE_HOOK', 'ROTATE') and (not brush.use_anchor) and (not brush.restore_mesh):
897 col = layout.column()
900 col.prop(brush, "use_smooth_stroke")
903 sub.active = brush.use_smooth_stroke
904 sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
905 sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
909 row = col.row(align=True)
910 row.prop(brush, "jitter", slider=True)
911 row.prop(brush, "use_jitter_pressure", toggle=True, text="")
915 row.prop(brush, "use_airbrush")
918 row.active = brush.use_airbrush and (not brush.use_space) and (not brush.use_anchor)
919 row.prop(brush, "rate", slider=True)
923 if not texture_paint:
925 row.prop(brush, "use_smooth_stroke")
927 col = layout.column()
928 col.active = brush.use_smooth_stroke
929 col.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
930 col.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
934 col = layout.column()
935 col.active = (not brush.use_anchor) and (brush.sculpt_tool not in ('GRAB', 'THUMB', 'ROTATE', 'SNAKE_HOOK'))
938 row.prop(brush, "use_space")
941 row.active = brush.use_space
942 row.prop(brush, "spacing", text="Spacing")
944 #col.prop(brush, "use_space_atten", text="Adaptive Strength")
945 #col.prop(brush, "use_adaptive_space", text="Adaptive Spacing")
950 # row.prop(brush, "use_spacing_pressure", toggle=True, text="")
953 class VIEW3D_PT_tools_brush_curve(PaintPanel, bpy.types.Panel):
955 bl_default_closed = True
958 def poll(cls, context):
959 settings = cls.paint_settings(context)
960 return (settings and settings.brush and settings.brush.curve)
962 def draw(self, context):
965 settings = self.paint_settings(context)
966 brush = settings.brush
968 layout.template_curve_mapping(brush, "curve", brush=True)
970 row = layout.row(align=True)
971 row.operator("brush.curve_preset", icon="SMOOTHCURVE", text="").shape = 'SMOOTH'
972 row.operator("brush.curve_preset", icon="SPHERECURVE", text="").shape = 'ROUND'
973 row.operator("brush.curve_preset", icon="ROOTCURVE", text="").shape = 'ROOT'
974 row.operator("brush.curve_preset", icon="SHARPCURVE", text="").shape = 'SHARP'
975 row.operator("brush.curve_preset", icon="LINCURVE", text="").shape = 'LINE'
976 row.operator("brush.curve_preset", icon="NOCURVE", text="").shape = 'MAX'
979 class VIEW3D_PT_sculpt_options(PaintPanel, bpy.types.Panel):
981 bl_default_closed = True
984 def poll(cls, context):
985 return (context.sculpt_object and context.tool_settings.sculpt)
987 def draw(self, context):
991 tool_settings = context.tool_settings
992 sculpt = tool_settings.sculpt
993 settings = __class__.paint_settings(context)
994 brush = settings.brush
996 split = layout.split()
1000 col.prop(sculpt, "use_openmp", text="Threaded Sculpt")
1001 col.prop(sculpt, "fast_navigate")
1002 col.prop(sculpt, "show_brush")
1004 col.label(text="Unified Settings:")
1005 col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size")
1006 col.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength")
1008 col = split.column()
1010 col.label(text="Lock:")
1011 row = col.row(align=True)
1012 row.prop(sculpt, "lock_x", text="X", toggle=True)
1013 row.prop(sculpt, "lock_y", text="Y", toggle=True)
1014 row.prop(sculpt, "lock_z", text="Z", toggle=True)
1018 class VIEW3D_PT_sculpt_symmetry(PaintPanel, bpy.types.Panel):
1019 bl_label = "Symmetry"
1020 bl_default_closed = True
1023 def poll(cls, context):
1024 return (context.sculpt_object and context.tool_settings.sculpt)
1026 def draw(self, context):
1028 layout = self.layout
1030 sculpt = context.tool_settings.sculpt
1031 settings = __class__.paint_settings(context)
1032 brush = settings.brush
1034 split = layout.split()
1036 col = split.column()
1038 col.label(text="Mirror:")
1039 col.prop(sculpt, "symmetry_x", text="X")
1040 col.prop(sculpt, "symmetry_y", text="Y")
1041 col.prop(sculpt, "symmetry_z", text="Z")
1043 col = split.column()
1045 col.prop(sculpt, "radial_symm", text="Radial")
1047 col = layout.column()
1051 col.prop(sculpt, "use_symmetry_feather", text="Feather")
1053 class VIEW3D_PT_tools_brush_appearance(PaintPanel, bpy.types.Panel):
1054 bl_label = "Appearance"
1055 bl_default_closed = True
1058 def poll(cls, context):
1059 return (context.sculpt_object and context.tool_settings.sculpt) or (context.vertex_paint_object and context.tool_settings.vertex_paint) or (context.weight_paint_object and context.tool_settings.weight_paint) or (context.texture_paint_object and context.tool_settings.image_paint)
1061 def draw(self, context):
1062 layout = self.layout
1064 sculpt = context.tool_settings.sculpt
1065 settings = __class__.paint_settings(context)
1066 brush = settings.brush
1068 col = layout.column();
1070 if context.sculpt_object and context.tool_settings.sculpt:
1071 #if brush.sculpt_tool in ('DRAW', 'INFLATE', 'CLAY', 'PINCH', 'CREASE', 'BLOB', 'FLATTEN', 'FILL', 'SCRAPE', 'CLAY_TUBES'):
1072 if brush.sculpt_tool in ('DRAW', 'INFLATE', 'CLAY', 'PINCH', 'CREASE', 'BLOB', 'FLATTEN', 'FILL', 'SCRAPE'):
1073 col.prop(brush, "add_col", text="Add Color")
1074 col.prop(brush, "sub_col", text="Subtract Color")
1076 col.prop(brush, "add_col", text="Color")
1078 col.prop(brush, "add_col", text="Color")
1080 col = layout.column()
1081 col.label(text="Icon:")
1083 row = col.row(align=True)
1084 row.prop(brush, "use_custom_icon")
1085 if brush.use_custom_icon:
1086 row = col.row(align=True)
1087 row.prop(brush, "icon_filepath", text="")
1089 # ********** default tools for weightpaint ****************
1092 class VIEW3D_PT_tools_weightpaint(View3DPanel, bpy.types.Panel):
1093 bl_context = "weightpaint"
1094 bl_label = "Weight Tools"
1096 def draw(self, context):
1097 layout = self.layout
1099 col = layout.column()
1100 col.operator("object.vertex_group_normalize_all", text="Normalize All")
1101 col.operator("object.vertex_group_normalize", text="Normalize")
1102 col.operator("object.vertex_group_invert", text="Invert")
1103 col.operator("object.vertex_group_clean", text="Clean")
1104 col.operator("object.vertex_group_levels", text="Levels")
1107 class VIEW3D_PT_tools_weightpaint_options(View3DPanel, bpy.types.Panel):
1108 bl_context = "weightpaint"
1109 bl_label = "Options"
1111 def draw(self, context):
1112 layout = self.layout
1114 tool_settings = context.tool_settings
1115 wpaint = tool_settings.weight_paint
1117 col = layout.column()
1118 col.prop(wpaint, "all_faces")
1119 col.prop(wpaint, "normals")
1120 col.prop(wpaint, "spray")
1122 obj = context.weight_paint_object
1123 if obj.type == 'MESH':
1125 col.prop(mesh, "use_mirror_x")
1126 col.prop(mesh, "use_mirror_topology")
1128 col.label(text="Unified Settings:")
1129 col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size")
1130 col.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength")
1132 # Commented out because the Apply button isn't an operator yet, making these settings useless
1133 # col.label(text="Gamma:")
1134 # col.prop(wpaint, "gamma", text="")
1135 # col.label(text="Multiply:")
1136 # col.prop(wpaint, "mul", text="")
1139 # Soft, Vgroup, X-Mirror and "Clear" Operator.
1141 # ********** default tools for vertexpaint ****************
1144 class VIEW3D_PT_tools_vertexpaint(View3DPanel, bpy.types.Panel):
1145 bl_context = "vertexpaint"
1146 bl_label = "Options"
1148 def draw(self, context):
1149 layout = self.layout
1151 tool_settings = context.tool_settings
1152 vpaint = tool_settings.vertex_paint
1154 col = layout.column()
1155 #col.prop(vpaint, "mode", text="")
1156 col.prop(vpaint, "all_faces")
1157 col.prop(vpaint, "normals")
1158 col.prop(vpaint, "spray")
1160 col.label(text="Unified Settings:")
1161 col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size")
1162 col.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength")
1164 # Commented out because the Apply button isn't an operator yet, making these settings useless
1165 # col.label(text="Gamma:")
1166 # col.prop(vpaint, "gamma", text="")
1167 # col.label(text="Multiply:")
1168 # col.prop(vpaint, "mul", text="")
1170 # ********** default tools for texturepaint ****************
1173 class VIEW3D_PT_tools_projectpaint(View3DPanel, bpy.types.Panel):
1174 bl_context = "texturepaint"
1175 bl_label = "Project Paint"
1178 def poll(cls, context):
1179 brush = context.tool_settings.image_paint.brush
1180 return (brush and brush.imagepaint_tool != 'SMEAR')
1182 def draw_header(self, context):
1183 ipaint = context.tool_settings.image_paint
1185 self.layout.prop(ipaint, "use_projection", text="")
1187 def draw(self, context):
1188 layout = self.layout
1190 ipaint = context.tool_settings.image_paint
1191 settings = context.tool_settings.image_paint
1192 use_projection = ipaint.use_projection
1194 col = layout.column()
1196 sub.active = use_projection
1197 sub.prop(ipaint, "use_occlude")
1198 sub.prop(ipaint, "use_backface_cull")
1200 split = layout.split()
1202 col = split.column()
1203 col.active = (use_projection)
1204 col.prop(ipaint, "use_normal_falloff")
1206 col = split.column()
1207 col.active = (ipaint.use_normal_falloff and use_projection)
1208 col.prop(ipaint, "normal_angle", text="")
1210 col = layout.column(align=False)
1212 row.active = (use_projection)
1213 row.prop(ipaint, "use_stencil_layer", text="Stencil")
1215 row2 = row.row(align=False)
1216 row2.active = (use_projection and ipaint.use_stencil_layer)
1217 row2.menu("VIEW3D_MT_tools_projectpaint_stencil", text=context.active_object.data.uv_texture_stencil.name)
1218 row2.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA')
1220 col = layout.column()
1223 row.active = (settings.brush.imagepaint_tool == 'CLONE')
1225 row.prop(ipaint, "use_clone_layer", text="Layer")
1226 row.menu("VIEW3D_MT_tools_projectpaint_clone", text=context.active_object.data.uv_texture_clone.name)
1229 sub.prop(ipaint, "seam_bleed")
1231 col.label(text="External Editing")
1232 row = col.split(align=True, percentage=0.55)
1233 row.operator("image.project_edit", text="Quick Edit")
1234 row.operator("image.project_apply", text="Apply")
1235 row = col.row(align=True)
1236 row.prop(ipaint, "screen_grab_size", text="")
1239 sub.operator("paint.project_image", text="Apply Camera Image")
1241 sub.operator("image.save_dirty", text="Save All Edited")
1244 class VIEW3D_PT_imagepaint_options(PaintPanel):
1245 bl_label = "Options"
1246 bl_default_closed = True
1249 def poll(cls, context):
1250 return (context.texture_paint_object and context.tool_settings.image_paint)
1252 def draw(self, context):
1253 layout = self.layout
1255 col = layout.column()
1257 tool_settings = context.tool_settings
1258 col.label(text="Unified Settings:")
1259 col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size")
1260 col.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength")
1262 class VIEW3D_MT_tools_projectpaint_clone(bpy.types.Menu):
1263 bl_label = "Clone Layer"
1265 def draw(self, context):
1266 layout = self.layout
1267 for i, tex in enumerate(context.active_object.data.uv_textures):
1268 prop = layout.operator("wm.context_set_int", text=tex.name)
1269 prop.data_path = "active_object.data.uv_texture_clone_index"
1273 class VIEW3D_MT_tools_projectpaint_stencil(bpy.types.Menu):
1274 bl_label = "Mask Layer"
1276 def draw(self, context):
1277 layout = self.layout
1278 for i, tex in enumerate(context.active_object.data.uv_textures):
1279 prop = layout.operator("wm.context_set_int", text=tex.name)
1280 prop.data_path = "active_object.data.uv_texture_stencil_index"
1284 class VIEW3D_PT_tools_particlemode(View3DPanel, bpy.types.Panel):
1285 '''default tools for particle mode'''
1286 bl_context = "particlemode"
1287 bl_label = "Options"
1289 def draw(self, context):
1290 layout = self.layout
1292 pe = context.tool_settings.particle_edit
1295 layout.prop(pe, "type", text="")
1299 if pe.type == 'PARTICLES':
1300 if ob.particle_systems:
1301 if len(ob.particle_systems) > 1:
1302 layout.template_list(ob, "particle_systems", ob, "active_particle_system_index", type='ICONS')
1304 ptcache = ob.particle_systems[ob.active_particle_system_index].point_cache
1306 for md in ob.modifiers:
1307 if md.type == pe.type:
1308 ptcache = md.point_cache
1310 if ptcache and len(ptcache.point_cache_list) > 1:
1311 layout.template_list(ptcache, "point_cache_list", ptcache, "active_point_cache_index", type='ICONS')
1315 layout.label(text="Point cache must be baked")
1316 layout.label(text="to enable editing!")
1318 col = layout.column(align=True)
1320 col.active = pe.editable
1321 col.prop(pe, "emitter_deflect", text="Deflect emitter")
1323 sub.active = pe.emitter_deflect
1324 sub.prop(pe, "emitter_distance", text="Distance")
1326 col = layout.column(align=True)
1327 col.active = pe.editable
1328 col.label(text="Keep:")
1329 col.prop(pe, "keep_lengths", text="Lengths")
1330 col.prop(pe, "keep_root", text="Root")
1332 col.label(text="Correct:")
1333 col.prop(pe, "auto_velocity", text="Velocity")
1334 col.prop(ob.data, "use_mirror_x")
1336 col = layout.column(align=True)
1337 col.active = pe.editable
1338 col.label(text="Draw:")
1339 col.prop(pe, "draw_step", text="Path Steps")
1341 col.prop(pe, "draw_particles", text="Children")
1343 if pe.type == 'PARTICLES':
1344 col.prop(pe, "draw_particles", text="Particles")
1345 col.prop(pe, "fade_time")
1347 sub.active = pe.fade_time
1348 sub.prop(pe, "fade_frames", slider=True)
1358 if __name__ == "__main__":