1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
|
import bpy
class View3DPanel(bpy.types.Panel):
__space_type__ = "VIEW_3D"
__region_type__ = "TOOLS"
# ********** default tools for objectmode ****************
class VIEW3D_PT_tools_objectmode(View3DPanel):
__context__ = "objectmode"
__label__ = "Object Tools"
def draw(self, context):
layout = self.layout
layout.itemL(text="Transform:")
col = layout.column(align=True)
col.itemO("tfm.translate")
col.itemO("tfm.rotate")
col.itemO("tfm.resize", text="Scale")
layout.itemL(text="Object:")
col = layout.column(align=True)
col.itemO("object.duplicate")
col.itemO("object.delete")
active_object= context.active_object
if active_object and active_object.type == 'MESH':
layout.itemL(text="Shading:")
col = layout.column(align=True)
col.itemO("object.shade_smooth", text="Smooth")
col.itemO("object.shade_flat", text="Flat")
layout.itemL(text="Keyframes:")
col = layout.column(align=True)
col.itemO("anim.insert_keyframe_menu", text="Insert")
col.itemO("anim.delete_keyframe_v3d", text="Remove")
# ********** default tools for editmode_mesh ****************
class VIEW3D_PT_tools_meshedit(View3DPanel):
__context__ = "mesh_edit"
__label__ = "Mesh Tools"
def draw(self, context):
layout = self.layout
layout.itemL(text="Transform:")
col = layout.column(align=True)
col.itemO("tfm.translate")
col.itemO("tfm.rotate")
col.itemO("tfm.resize", text="Scale")
layout.itemL(text="Mesh:")
col = layout.column(align=True)
col.itemO("mesh.duplicate")
col.itemO("mesh.delete")
layout.itemL(text="Modeling:")
col = layout.column(align=True)
col.itemO("mesh.extrude")
col.itemO("mesh.subdivide")
col.itemO("mesh.spin")
col.itemO("mesh.screw")
layout.itemL(text="Shading:")
col = layout.column(align=True)
col.itemO("mesh.faces_shade_smooth", text="Smooth")
col.itemO("mesh.faces_shade_flat", text="Flat")
layout.itemL(text="UV Mapping:")
col = layout.column(align=True)
col.itemO("uv.mapping_menu", text="Unwrap")
col.itemO("mesh.uvs_rotate")
col.itemO("mesh.uvs_mirror")
# ********** default tools for editmode_curve ****************
class VIEW3D_PT_tools_curveedit(View3DPanel):
__context__ = "curve_edit"
__label__ = "Curve Tools"
def draw(self, context):
layout = self.layout
layout.itemL(text="Transform:")
col = layout.column(align=True)
col.itemO("tfm.translate")
col.itemO("tfm.rotate")
col.itemO("tfm.resize", text="Scale")
layout.itemL(text="Curve:")
col = layout.column(align=True)
col.itemO("curve.duplicate")
col.itemO("curve.delete")
col.itemO("curve.cyclic_toggle")
col.itemO("curve.switch_direction")
layout.itemL(text="Modeling:")
col = layout.column(align=True)
col.itemO("curve.extrude")
col.itemO("curve.subdivide")
# ********** default tools for editmode_surface ****************
class VIEW3D_PT_tools_surfaceedit(View3DPanel):
__context__ = "surface_edit"
__label__ = "Surface Tools"
def draw(self, context):
layout = self.layout
layout.itemL(text="Transform:")
col = layout.column(align=True)
col.itemO("tfm.translate")
col.itemO("tfm.rotate")
col.itemO("tfm.resize", text="Scale")
layout.itemL(text="Curve:")
col = layout.column(align=True)
col.itemO("curve.duplicate")
col.itemO("curve.delete")
col.itemO("curve.cyclic_toggle")
col.itemO("curve.switch_direction")
layout.itemL(text="Modeling:")
col = layout.column(align=True)
col.itemO("curve.extrude")
col.itemO("curve.subdivide")
# ********** default tools for editmode_text ****************
class VIEW3D_PT_tools_textedit(View3DPanel):
__context__ = "text_edit"
__label__ = "Text Tools"
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
col.itemO("font.text_copy", text="Copy")
col.itemO("font.text_paste", text="Paste")
col = layout.column()
col.itemO("font.case_set")
col.itemO("font.style_toggle")
# ********** default tools for editmode_armature ****************
class VIEW3D_PT_tools_armatureedit(View3DPanel):
__context__ = "armature_edit"
__label__ = "Armature Tools"
def draw(self, context):
layout = self.layout
layout.itemL(text="Transform:")
col = layout.column(align=True)
col.itemO("tfm.translate")
col.itemO("tfm.rotate")
col.itemO("tfm.resize", text="Scale")
layout.itemL(text="Bones:")
col = layout.column(align=True)
col.itemO("armature.bone_primitive_add", text="Add")
col.itemO("armature.duplicate", text="Duplicate")
col.itemO("armature.delete", text="Delete")
layout.itemL(text="Modeling:")
layout.itemO("armature.extrude")
# ********** default tools for editmode_mball ****************
class VIEW3D_PT_tools_mballedit(View3DPanel):
__context__ = "mball_edit"
__label__ = "Meta Tools"
def draw(self, context):
layout = self.layout
layout.itemL(text="Transform:")
col = layout.column(align=True)
col.itemO("tfm.translate")
col.itemO("tfm.rotate")
col.itemO("tfm.resize", text="Scale")
# ********** default tools for editmode_lattice ****************
class VIEW3D_PT_tools_latticeedit(View3DPanel):
__context__ = "lattice_edit"
__label__ = "Lattice Tools"
def draw(self, context):
layout = self.layout
layout.itemL(text="Transform:")
col = layout.column(align=True)
col.itemO("tfm.translate")
col.itemO("tfm.rotate")
col.itemO("tfm.resize", text="Scale")
# ********** default tools for posemode ****************
class VIEW3D_PT_tools_posemode(View3DPanel):
__context__ = "posemode"
__label__ = "Pose Tools"
def draw(self, context):
layout = self.layout
layout.itemL(text="Transform:")
col = layout.column(align=True)
col.itemO("tfm.translate")
col.itemO("tfm.rotate")
col.itemO("tfm.resize", text="Scale")
layout.itemL(text="Bones:")
col = layout.column(align=True)
col.itemO("pose.hide", text="Hide")
col.itemO("pose.reveal", text="Reveal")
layout.itemL(text="Keyframes:")
col = layout.column(align=True)
col.itemO("anim.insert_keyframe_menu", text="Insert")
col.itemO("anim.delete_keyframe_v3d", text="Remove")
layout.itemL(text="Pose:")
col = layout.column(align=True)
col.itemO("pose.copy", text="Copy")
col.itemO("pose.paste", text="Paste")
layout.itemL(text="Library:")
col = layout.column(align=True)
col.itemO("poselib.pose_add", text="Add")
col.itemO("poselib.pose_remove", text="Remove")
# ********** default tools for paint modes ****************
class PaintPanel(bpy.types.Panel):
__space_type__ = "VIEW_3D"
__region_type__ = "TOOLS"
def paint_settings(self, context):
ts = context.tool_settings
if context.sculpt_object:
return ts.sculpt
elif context.vertex_paint_object:
return ts.vertex_paint
elif context.weight_paint_object:
return ts.weight_paint
elif context.texture_paint_object:
return ts.image_paint
elif context.particle_edit_object:
return ts.particle_edit
return False
class VIEW3D_PT_tools_brush(PaintPanel):
__label__ = "Brush"
def poll(self, context):
return self.paint_settings(context)
def draw(self, context):
layout = self.layout
settings = self.paint_settings(context)
brush = settings.brush
if not context.particle_edit_object:
col = layout.split().column()
row = col.row()
row.template_list(settings, "brushes", settings, "active_brush_index", rows=2)
col.template_ID(settings, "brush", new="brush.add")
# Particle Mode #
# XXX This needs a check if psys is editable.
if context.particle_edit_object:
# XXX Select Particle System
layout.column().itemR(settings, "tool", expand=True)
if settings.tool != 'NONE':
col = layout.column()
col.itemR(brush, "size", slider=True)
col.itemR(brush, "strength", slider=True)
if settings.tool == 'ADD':
col = layout.column()
col.itemR(settings, "add_interpolate")
sub = col.column(align=True)
sub.active = settings.add_interpolate
sub.itemR(brush, "steps", slider=True)
sub.itemR(settings, "add_keys", slider=True)
elif settings.tool == 'LENGTH':
layout.itemR(brush, "length_mode", expand=True)
elif settings.tool == 'PUFF':
layout.itemR(brush, "puff_mode", expand=True)
# Sculpt Mode #
elif context.sculpt_object and settings.brush:
col = layout.column()
col.itemS()
row = col.row(align=True)
row.itemR(brush, "size", slider=True)
row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
if brush.sculpt_tool != 'GRAB':
row = col.row(align=True)
row.itemR(brush, "strength", slider=True)
row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
col = layout.column()
if brush.sculpt_tool != 'LAYER':
col.itemR(brush, "anchored")
if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'):
col.itemR(brush, "flip_direction")
if brush.sculpt_tool == 'LAYER':
col.itemR(brush, "persistent")
col.itemO("sculpt.set_persistent_base")
col.itemR(brush, "rake")
col.itemR(brush, "sculpt_tool")
# Texture Paint Mode #
elif context.texture_paint_object:
col = layout.column(align=True)
col.item_enumR(settings, "tool", 'DRAW')
col.item_enumR(settings, "tool", 'SOFTEN')
if settings.use_projection:
col.item_enumR(settings, "tool", 'CLONE')
else:
col.item_enumR(settings, "tool", 'SMEAR')
col = layout.column()
col.itemR(brush, "color", text="")
row = col.row(align=True)
row.itemR(brush, "size", slider=True)
row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
row = col.row(align=True)
row.itemR(brush, "strength", slider=True)
row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
row = col.row(align=True)
row.itemR(brush, "falloff", slider=True)
row.itemR(brush, "falloff_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
row = col.row(align=True)
row.itemR(brush, "space", text="")
rowsub = row.row(align=True)
rowsub.active = brush.space
rowsub.itemR(brush, "spacing", text="Spacing", slider=True)
rowsub.itemR(brush, "spacing_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
col = layout.column()
col.itemR(brush, "airbrush")
sub = col.column()
sub.active = brush.airbrush
sub.itemR(brush, "rate")
# Weight Paint Mode #
elif context.weight_paint_object:
layout.itemR(context.tool_settings, "vertex_group_weight", text="Weight", slider=True)
col = layout.column()
row = col.row(align=True)
row.itemR(brush, "size", slider=True)
row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
row = col.row(align=True)
row.itemR(brush, "strength", slider=True)
row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
# Vertex Paint Mode #
elif context.vertex_paint_object:
col = layout.column()
col.itemR(brush, "color", text="")
row = col.row(align=True)
row.itemR(brush, "size", slider=True)
row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
row = col.row(align=True)
row.itemR(brush, "strength", slider=True)
row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
class VIEW3D_PT_tools_brush_stroke(PaintPanel):
__label__ = "Stroke"
__default_closed__ = True
def poll(self, context):
settings = self.paint_settings(context)
return (settings and settings.brush and context.sculpt_object)
def draw(self, context):
settings = self.paint_settings(context)
brush = settings.brush
layout = self.layout
layout.itemR(brush, "smooth_stroke")
col = layout.column()
col.active = brush.smooth_stroke
col.itemR(brush, "smooth_stroke_radius", text="Radius", slider=True)
col.itemR(brush, "smooth_stroke_factor", text="Factor", slider=True)
layout.itemR(brush, "space")
col = layout.column()
col.active = brush.space
col.itemR(brush, "spacing", text="Distance", slider=True)
class VIEW3D_PT_tools_brush_curve(PaintPanel):
__label__ = "Curve"
__default_closed__ = True
def poll(self, context):
settings = self.paint_settings(context)
return (settings and settings.brush and settings.brush.curve)
def draw(self, context):
settings = self.paint_settings(context)
brush = settings.brush
layout = self.layout
layout.template_curve_mapping(brush.curve)
layout.item_menu_enumO("brush.curve_preset", property="shape")
class VIEW3D_PT_sculpt_options(PaintPanel):
__label__ = "Options"
def poll(self, context):
return context.sculpt_object
def draw(self, context):
layout = self.layout
sculpt = context.tool_settings.sculpt
col = layout.column()
col.itemR(sculpt, "partial_redraw", text="Partial Refresh")
col.itemR(sculpt, "show_brush")
split = self.layout.split()
col = split.column()
col.itemL(text="Symmetry:")
col.itemR(sculpt, "symmetry_x", text="X")
col.itemR(sculpt, "symmetry_y", text="Y")
col.itemR(sculpt, "symmetry_z", text="Z")
col = split.column()
col.itemL(text="Lock:")
col.itemR(sculpt, "lock_x", text="X")
col.itemR(sculpt, "lock_y", text="Y")
col.itemR(sculpt, "lock_z", text="Z")
# ********** default tools for weightpaint ****************
class VIEW3D_PT_tools_weightpaint(View3DPanel):
__context__ = "weightpaint"
__label__ = "Options"
def draw(self, context):
layout = self.layout
wpaint = context.tool_settings.weight_paint
col = layout.column()
col.itemL(text="Blend:")
col.itemR(wpaint, "mode", text="")
col.itemR(wpaint, "all_faces")
col.itemR(wpaint, "normals")
col.itemR(wpaint, "spray")
col.itemR(wpaint, "vertex_dist", text="Distance")
# Commented out because the Apply button isn't an operator yet, making these settings useless
# col.itemL(text="Gamma:")
# col.itemR(wpaint, "gamma", text="")
# col.itemL(text="Multiply:")
# col.itemR(wpaint, "mul", text="")
# Also missing now:
# Soft, Vgroup, X-Mirror and "Clear" Operator.
# ********** default tools for vertexpaint ****************
class VIEW3D_PT_tools_vertexpaint(View3DPanel):
__context__ = "vertexpaint"
__label__ = "Options"
def draw(self, context):
layout = self.layout
vpaint = context.tool_settings.vertex_paint
col = layout.column()
col.itemL(text="Blend:")
col.itemR(vpaint, "mode", text="")
col.itemR(vpaint, "all_faces")
col.itemR(vpaint, "normals")
col.itemR(vpaint, "spray")
col.itemR(vpaint, "vertex_dist", text="Distance")
# Commented out because the Apply button isn't an operator yet, making these settings useless
# col.itemL(text="Gamma:")
# col.itemR(vpaint, "gamma", text="")
# col.itemL(text="Multiply:")
# col.itemR(vpaint, "mul", text="")
# ********** default tools for texturepaint ****************
class VIEW3D_PT_tools_texturepaint(View3DPanel):
__context__ = "texturepaint"
__label__ = "Options"
def draw(self, context):
layout = self.layout
ipaint = context.tool_settings.image_paint
settings = context.tool_settings.image_paint
use_projection= ipaint.use_projection
col = layout.column()
col.itemR(ipaint, "use_projection")
sub = col.column()
sub.active = use_projection
sub.itemR(ipaint, "use_occlude")
sub.itemR(ipaint, "use_backface_cull")
split = layout.split()
col = split.column()
col.active = (use_projection)
col.itemR(ipaint, "use_normal_falloff")
col = split.column()
col.active = (ipaint.use_normal_falloff and use_projection)
col.itemR(ipaint, "normal_angle", text="")
split = layout.split(percentage=0.7)
col = split.column(align=False)
col.active = (use_projection)
col.itemR(ipaint, "use_stencil_layer")
col = split.column(align=False)
col.active = (use_projection and ipaint.use_stencil_layer)
col.itemR(ipaint, "invert_stencil", text="Inv")
col = layout.column()
sub = col.column()
sub.active = (settings.tool == 'CLONE')
sub.itemR(ipaint, "use_clone_layer")
sub = col.column()
sub.itemR(ipaint, "seam_bleed")
# ********** default tools for particle mode ****************
class VIEW3D_PT_tools_particlemode(View3DPanel):
__context__ = "particlemode"
__label__ = "Options"
def draw(self, context):
layout = self.layout
pe = context.tool_settings.particle_edit
col = layout.column(align=True)
col.itemR(pe, "emitter_deflect", text="Deflect")
sub = col.row()
sub.active = pe.emitter_deflect
sub.itemR(pe, "emitter_distance", text="Distance")
col = layout.column(align=True)
col.itemL(text="Keep:")
col.itemR(pe, "keep_lengths", text="Lenghts")
col.itemR(pe, "keep_root", text="Root")
col = layout.column(align=True)
col.itemL(text="Display:")
col.itemR(pe, "show_time", text="Time")
col.itemR(pe, "show_children", text="Children")
bpy.types.register(VIEW3D_PT_tools_objectmode)
bpy.types.register(VIEW3D_PT_tools_meshedit)
bpy.types.register(VIEW3D_PT_tools_curveedit)
bpy.types.register(VIEW3D_PT_tools_surfaceedit)
bpy.types.register(VIEW3D_PT_tools_textedit)
bpy.types.register(VIEW3D_PT_tools_armatureedit)
bpy.types.register(VIEW3D_PT_tools_mballedit)
bpy.types.register(VIEW3D_PT_tools_latticeedit)
bpy.types.register(VIEW3D_PT_tools_posemode)
bpy.types.register(VIEW3D_PT_tools_brush)
bpy.types.register(VIEW3D_PT_tools_brush_stroke)
bpy.types.register(VIEW3D_PT_tools_brush_curve)
bpy.types.register(VIEW3D_PT_sculpt_options)
bpy.types.register(VIEW3D_PT_tools_vertexpaint)
bpy.types.register(VIEW3D_PT_tools_weightpaint)
bpy.types.register(VIEW3D_PT_tools_texturepaint)
bpy.types.register(VIEW3D_PT_tools_particlemode)
|