-
Notifications
You must be signed in to change notification settings - Fork 0
/
ToolBox.py
693 lines (511 loc) · 23.3 KB
/
ToolBox.py
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
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
bl_info = {
"name": "Tool Collection (ToolBox)",
"author": "ZoZo Zoe",
"version": (2, 0),
"blender": (2, 80, 0),
"location": "View 3D > Tool Shelf > Tool Collection",
"description": "A collection of simple but handy tools",
"warning": "",
"wiki_url": "",
"category": "Tools",
}
import bpy
from bpy.types import (
Operator,
AddonPreferences,
Panel,
PropertyGroup,
)
from bpy.props import(StringProperty)
#----------------------------------------------
# ToolBox Properties
#----------------------------------------------
class ToolBoxMeshGroup(bpy.types.PropertyGroup):
Armature: bpy.props.PointerProperty(type=bpy.types.Object)
Mesh: bpy.props.PointerProperty(type=bpy.types.Object)
class ToolBoxWeightpaintGroup(bpy.types.PropertyGroup):
Armature: bpy.props.PointerProperty(type=bpy.types.Object)
Mesh: bpy.props.PointerProperty(type=bpy.types.Object)
SecondMesh: bpy.props.PointerProperty(type=bpy.types.Object)
Bone: bpy.props.StringProperty()
#----------------------------------------------
# Main Panel
#----------------------------------------------
class ToolboxMainMenu(bpy.types.Panel):
bl_label = "Tool Box"
bl_idname = "SCENE_PT_main_menu"
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = "Tool Collection"
bl_option = {'REGISTER', 'UNDO'}
def draw(self, context):
layout = self.layout
#---------------------------------------------- Shapekey tools ----------------------------------------------
#----------------------------------------------
# Shapekey tools
#----------------------------------------------
class ShapekeyTools(bpy.types.Panel):
bl_label = "Shapekey Tools"
bl_idname = "SCENE_PT_shapekey_tools"
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = "Tool Collection"
bl_parent_id= 'SCENE_PT_main_menu'
bl_option = {'REGISTER', 'UNDO'}
def draw(self, context):
layout = self.layout
row = layout.row()
box = layout.box()
col = box.column(align=True)
row = layout.row()
split = col.row(align=True)
row = split.row(align=True)
row.scale_y = 1.5
row.operator("object.shapekeyop", icon='VERTEXSEL')
split = col.row(align=True)
row = split.row(align=True)
row.scale_y = 1.5
row.operator("object.returnshapeop", icon='SHAPEKEY_DATA')
split = col.row(align=True)
row = split.row(align=True)
row.scale_y = 1.5
row.operator("object.removeshapekeyop", icon='SHAPEKEY_DATA')
#----------------------------------------------
# Select shapekey
#----------------------------------------------
class OBJECT_OT_shapekeyOp(Operator):
bl_label = "Select shapekey verts"
bl_idname = "object.shapekeyop"
bl_option = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
return context.object.select_get() and context.object.type == 'MESH'
def execute(self, context):
tolerance = 1e-5
obj = bpy.context.object
shape_keys = obj.data.shape_keys.key_blocks
current_selected = obj.active_shape_key_index
sk1_data = shape_keys[current_selected].data
skb_data = shape_keys['Basis'].data
bpy.ops.object.mode_set(mode="EDIT")
bpy.ops.mesh.select_all(action="DESELECT")
bpy.ops.mesh.select_mode(type="VERT")
bpy.ops.object.mode_set(mode="OBJECT")
for i, (x, y) in enumerate(zip(sk1_data, skb_data)):
if (x.co - y.co).length > tolerance:
obj.data.vertices[i].select = True
bpy.ops.object.mode_set(mode="EDIT")
return {"FINISHED"}
#----------------------------------------------
# Select vert shapekey
#----------------------------------------------
class OBJECT_OT_returnshapeOp(Operator):
bl_label = "Return selection to Basis"
bl_idname = "object.returnshapeop"
bl_option = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
return context.object.select_get() and context.object.type == 'MESH'
def draw(self, context):
layout = self.layout
layout.label(text="WARNING: This process will take a")
layout.label(text="long time and blender will freeze")
layout.label(text="Depending on the amount of shapekeys and")
layout.label(text="hardware allow blender to take up to 5 min")
def execute(self, context):
o = bpy.context.view_layer.objects.active
s = o.data.shape_keys.key_blocks.keys()
if "Basis" in s:
s.remove('Basis')
for i in s:
index = o.data.shape_keys.key_blocks.find(i)
bpy.context.object.active_shape_key_index = index
bpy.ops.mesh.blend_from_shape(shape='Basis', add=False)
return {"FINISHED"}
def invoke(self, context, event):
return context.window_manager.invoke_props_dialog(self)
#----------------------------------------------
# Remove Empty Shapekeys
#----------------------------------------------
class OBJECT_OT_removeshapeOp(Operator):
bl_label = "Remove empty shapekeys"
bl_idname = "object.removeshapekeyop"
bl_option = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
return context.object.select_get() and context.object.type == 'MESH'
def execute(self, context):
tolerance = 1e-5
obj = bpy.context.object
shape_keys = obj.data.shape_keys.key_blocks
skb_data = shape_keys['Basis'].data
removelist = []
shapelist = shape_keys.keys()
if "Basis" in shapelist:
shapelist.remove('Basis')
for shape in shapelist:
sk1_data = shape_keys[obj.data.shape_keys.key_blocks.find(shape)].data
bpy.ops.object.mode_set(mode="EDIT")
bpy.ops.mesh.select_all(action="DESELECT")
bpy.ops.object.mode_set(mode="OBJECT")
for i, (x, y) in enumerate(zip(sk1_data, skb_data)):
if (x.co - y.co).length > tolerance:
obj.data.vertices[i].select = True
vertcount = len([v for v in bpy.context.active_object.data.vertices if v.select])
print(shape)
print(vertcount)
if vertcount == 0:
removelist.append(shape)
print(removelist)
for shape in removelist:
bpy.context.object.active_shape_key_index = obj.data.shape_keys.key_blocks.find(shape)
bpy.ops.object.shape_key_remove()
return {"FINISHED"}
#---------------------------------------------- Weightpaint Tools ----------------------------------------------
#----------------------------------------------
# Weightpaint tools
#----------------------------------------------
class WeightpaintingTools(bpy.types.Panel):
bl_label = "Weightpaint Tools"
bl_idname = "SCENE_PT_weightpaint_tools"
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = "Tool Collection"
bl_parent_id= 'SCENE_PT_main_menu'
bl_option = {'REGISTER', 'UNDO'}
def draw(self, context):
layout = self.layout
row = layout.row()
box = layout.box()
col = box.column(align=True)
split = col.row(align=True)
row = split.row(align=True)
row.scale_y = 1
row.label(text="Update object:")
row.operator("object.isselweightbone", text="", icon='SELECT_SET')
row.operator("object.isselweightmesh", text="", icon='SELECT_SET')
row.operator("object.isselweightsecmesh", text="", icon='SELECT_SET')
split = col.row(align=True)
row = split.row(align=True)
row.scale_y = 1
row.label(text="")
row.operator("object.selweightbone", text="", icon='BONE_DATA')
row.operator("object.selweightmesh", text="", icon='SHAPEKEY_DATA')
row.operator("object.selweightsecmesh", text="", icon='SHAPEKEY_DATA')
split = col.row(align=True)
row = split.row(align=True)
row.scale_y = 1.5
row.label(text="Transfer weights from:")
split = col.row(align=True)
row = split.row(align=True)
row.scale_y = 1.5
row.operator("object.transweight",text="Mesh", icon='MOD_VERTEX_WEIGHT')
row.operator("object.transweightsingle",text="Bone", icon='BONE_DATA')
#----------------------------------------------
# Transfer Weights
#----------------------------------------------
class OBJECT_OT_transweights(Operator):
bl_label = "Transfer Weights"
bl_idname = "object.transweight"
bl_option = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
return bpy.context.scene.ToolBoxWeight.Mesh and bpy.context.scene.ToolBoxWeight.SecondMesh
def execute(self, context):
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
bpy.ops.object.select_all(action='DESELECT')
bpy.context.scene.ToolBoxWeight.Mesh.select_set(True)
bpy.context.scene.ToolBoxWeight.SecondMesh.select = True
bpy.context.view_layer.objects.active = bpy.context.scene.ToolBoxWeight.SecondMesh
bpy.ops.object.mode_set(mode='WEIGHT_PAINT', toggle=False)
bpy.ops.object.data_transfer(use_reverse_transfer=True, data_type='VGROUP_WEIGHTS', layers_select_src='NAME', layers_select_dst='ALL')
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
return {"FINISHED"}
#----------------------------------------------
# Transfer Weights Single
#----------------------------------------------
class OBJECT_OT_transweightsSingle(Operator):
bl_label = "Transfer Weights Single"
bl_idname = "object.transweightsingle"
bl_option = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
return bpy.context.scene.ToolBoxWeight.Mesh and bpy.context.scene.ToolBoxWeight.SecondMesh
def execute(self, context):
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
bpy.ops.object.select_all(action='DESELECT')
bpy.context.view_layer.objects.active = bpy.context.scene.ToolBoxWeight.Armature
bpy.context.scene.ToolBoxWeight.Armature.select = True
bpy.ops.object.mode_set(mode='POSE', toggle=False)
for i in bpy.context.selected_pose_bones:
bpy.context.object.data.bones[i.name].select = False
bpy.context.object.data.bones[bpy.context.scene.ToolBoxWeight.Bone].select = True
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
bpy.context.scene.ToolBoxWeight.Mesh.select_set(True)
bpy.context.scene.ToolBoxWeight.SecondMesh.select = True
bpy.context.view_layer.objects.active = bpy.context.scene.ToolBoxWeight.SecondMesh
bpy.ops.object.mode_set(mode='WEIGHT_PAINT', toggle=False)
bpy.ops.object.data_transfer(use_reverse_transfer=True, data_type='VGROUP_WEIGHTS', layers_select_src='NAME', layers_select_dst='BONE_SELECT', mix_mode='REPLACE')
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
bpy.ops.object.select_all(action='DESELECT')
return {"FINISHED"}
#---------------------------------------------- Mesh tools ----------------------------------------------
#----------------------------------------------
# Mesh Tools
#----------------------------------------------
class MeshMenu(bpy.types.Panel):
bl_label = "Mesh Tools"
bl_idname = "SCENE_PT_mesh_menu"
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = "Tool Collection"
bl_parent_id= 'SCENE_PT_main_menu'
bl_option = {'REGISTER', 'UNDO', 'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
row = layout.row()
box = layout.box()
col = box.column(align=True)
split = col.row(align=True)
row = split.row(align=True)
row.scale_y = 1.5
row.label(text="Object Shading:")
split = col.row(align=True)
row = split.row(align=True)
row.scale_y = 1.5
row.operator("object.shade_smooth")
row.operator("object.shade_flat")
row = layout.row()
box = layout.box()
col = box.column(align=True)
split = col.row(align=True)
row = split.row(align=True)
row.scale_y = 1.5
row.label(text="Delete non existing vetex groups:")
split = col.row(align=True)
row = split.row(align=True)
row.scale_y = 1
row.label(text="Selector:")
row.operator("object.isselmesharmature", text="", icon='SELECT_SET')
row.operator("object.isselmeshmesh", text="", icon='SELECT_SET')
split = col.row(align=True)
row = split.row(align=True)
row.scale_y = 1
row.label(text="")
row.operator("object.selmesharmature", text="", icon='MESH_DATA')
row.operator("object.selmeshmesh", text="", icon='SHAPEKEY_DATA')
split = col.row(align=True)
row = split.row(align=True)
row.scale_y = 1.5
row.operator("object.remvertgroups", icon='OUTLINER_DATA_MESH')
#----------------------------------------------
# Remove Vertex Groups
#----------------------------------------------
class OBJECT_OT_RemoveVertexGroupsOp(Operator):
bl_label = "Remove Vertex Groups"
bl_idname = "object.remvertgroups"
bl_option = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
return bpy.context.scene.ToolBoxMesh.Armature and bpy.context.scene.ToolBoxMesh.Mesh
def execute(self, context):
Arma = bpy.context.scene.ToolBoxMesh.Armature
Mesh = bpy.context.scene.ToolBoxMesh.Mesh
VertexKeys = Mesh.vertex_groups.keys()
BoneKeys = Arma.data.bones.keys()
for key in VertexKeys:
print("checking " + key)
if not key in BoneKeys:
RemoveVertexGroup = Mesh.vertex_groups.get(key)
Mesh.vertex_groups.remove(RemoveVertexGroup)
print("removed " + key)
return {"FINISHED"}
#---------------------------------------------- Selection updates ----------------------------------------------
#---------------------------------------------- Mesh ----------------------------------------------
#----------------------------------------------
# Update Armature
#----------------------------------------------
class OBJECT_OT_SelectMeshArmatureOp(Operator):
bl_label = "Select Armature"
bl_idname = "object.selmesharmature"
bl_option = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
return context.object.select_get() and context.object.type == 'ARMATURE'
def execute(self, context):
ob = bpy.context.object
bpy.context.scene.ToolBoxMesh.Armature = ob
return {"FINISHED"}
class OBJECT_OT_ISSelectMeshArmatureOp(Operator):
bl_label = "Select Armature"
bl_idname = "object.isselmesharmature"
bl_option = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
return bpy.context.scene.ToolBoxMesh.Armature
def execute(self, context):
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
bpy.ops.object.select_all(action='DESELECT')
bpy.context.scene.ToolBoxMesh.Armature.select_set(True)
return {"FINISHED"}
#----------------------------------------------
# Update Mesh
#----------------------------------------------
class OBJECT_OT_SelectMeshOp(Operator):
bl_label = "Select Mesh"
bl_idname = "object.selmeshmesh"
bl_option = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
return context.object.select_get() and context.object.type == 'MESH'
def execute(self, context):
ob = bpy.context.object
bpy.context.scene.ToolBoxMesh.Mesh = ob
return {"FINISHED"}
class OBJECT_OT_ISSelectMeshOp(Operator):
bl_label = "Select Mesh"
bl_idname = "object.isselmeshmesh"
bl_option = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
return bpy.context.scene.ToolBoxMesh.Mesh
def execute(self, context):
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
bpy.ops.object.select_all(action='DESELECT')
bpy.context.scene.ToolBoxMesh.Mesh.select_set(True)
return {"FINISHED"}
#---------------------------------------------- Weights ----------------------------------------------
#----------------------------------------------
# Update Mesh
#----------------------------------------------
class OBJECT_OT_SelectWeightMeshOp(Operator):
bl_label = "Source Mesh"
bl_idname = "object.selweightmesh"
bl_option = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
return context.object.select_get() and context.object.type == 'MESH'
def execute(self, context):
ob = bpy.context.object
bpy.context.scene.ToolBoxWeight.Mesh = ob
return {"FINISHED"}
class OBJECT_OT_ISMeshWeightSelectMeshOp(Operator):
bl_label = "Select Source Mesh"
bl_idname = "object.isselweightmesh"
bl_option = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
return bpy.context.scene.ToolBoxWeight.Mesh
def execute(self, context):
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
bpy.ops.object.select_all(action='DESELECT')
bpy.context.scene.ToolBoxWeight.Mesh.select_set(True)
return {"FINISHED"}
#----------------------------------------------
# Secondary Mesh
#----------------------------------------------
class OBJECT_OT_SelectWeightSecondMeshOp(Operator):
bl_label = "Destination Mesh"
bl_idname = "object.selweightsecmesh"
bl_option = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
return context.object.select_get() and context.object.type == 'MESH'
def execute(self, context):
ob = bpy.context.object
bpy.context.scene.ToolBoxWeight.SecondMesh = ob
return {"FINISHED"}
class OBJECT_OT_ISSelectWeightSecondMeshOp(Operator):
bl_label = "Select Destination Mesh"
bl_idname = "object.isselweightsecmesh"
bl_option = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
return bpy.context.scene.ToolBoxWeight.SecondMesh
def execute(self, context):
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
bpy.ops.object.select_all(action='DESELECT')
bpy.context.scene.ToolBoxWeight.SecondMesh.select_set(True)
return {"FINISHED"}
#----------------------------------------------
# Select Bone
#----------------------------------------------
class OBJECT_OT_SelectWeightBoneOp(Operator):
bl_label = "Select Bone"
bl_idname = "object.selweightbone"
bl_option = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
return context.object.select_get() and context.object.type == 'ARMATURE' and bpy.context.object.mode == 'EDIT' or bpy.context.object.mode == 'POSE'
def execute(self, context):
if bpy.context.object.mode == 'EDIT':
if len(bpy.context.selected_bones) !=0:
bpy.context.scene.ToolBoxWeight.Armature = bpy.context.object
bpy.context.scene.ToolBoxWeight.Bone = bpy.context.selected_bones[0].name
else:
self.report({"WARNING"}, "No bone was selected, please select one")
if len(bpy.context.selected_bones) > 1:
self.report({"INFO"}, "Multiple bones selected. The first bone was selected: " + bpy.context.scene.ToolBoxWeight.Bone)
if bpy.context.object.mode == 'POSE':
if len(bpy.context.selected_pose_bones) != 0:
bpy.context.scene.ToolBoxWeight.Armature = bpy.context.object
bpy.context.scene.ToolBoxWeight.Bone = bpy.context.selected_pose_bones[0].name
else:
self.report({"WARNING"}, "No bone was selected, please select one")
if len(bpy.context.selected_pose_bones) > 1:
self.report({"INFO"}, "Multiple bones selected. The first bone was selected: " + bpy.context.scene.ToolBoxWeight.Bone)
return {"FINISHED"}
class OBJECT_OT_ISSelectWeightBoneOp(Operator):
bl_label = "Select Bone"
bl_idname = "object.isselweightbone"
bl_option = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
return bpy.context.scene.ToolBoxWeight.Bone
def execute(self, context):
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
bpy.ops.object.select_all(action='DESELECT')
bpy.context.view_layer.objects.active = bpy.context.scene.ToolBoxWeight.Armature
bpy.context.scene.ToolBoxWeight.Armature.select = True
bpy.ops.object.mode_set(mode='POSE', toggle=False)
for i in bpy.context.selected_pose_bones:
bpy.context.object.data.bones[i.name].select = False
bpy.context.object.data.bones[bpy.context.scene.ToolBoxWeight.Bone].select = True
return {"FINISHED"}
#----------------------------------------------
# Registering panel
#----------------------------------------------
classes = (
ToolBoxMeshGroup,
ToolBoxWeightpaintGroup,
ToolboxMainMenu,
MeshMenu,
ShapekeyTools,
WeightpaintingTools,
OBJECT_OT_shapekeyOp,
OBJECT_OT_returnshapeOp,
OBJECT_OT_transweights,
OBJECT_OT_transweightsSingle,
OBJECT_OT_RemoveVertexGroupsOp,
OBJECT_OT_removeshapeOp,
OBJECT_OT_SelectMeshOp,
OBJECT_OT_ISSelectMeshOp,
OBJECT_OT_SelectMeshArmatureOp,
OBJECT_OT_ISSelectMeshArmatureOp,
OBJECT_OT_SelectWeightMeshOp,
OBJECT_OT_ISMeshWeightSelectMeshOp,
OBJECT_OT_SelectWeightSecondMeshOp,
OBJECT_OT_ISSelectWeightSecondMeshOp,
OBJECT_OT_SelectWeightBoneOp,
OBJECT_OT_ISSelectWeightBoneOp,
)
def register():
for cls in classes:
bpy.utils.register_class(cls)
bpy.types.Scene.ToolBoxMesh = bpy.props.PointerProperty(type=ToolBoxMeshGroup)
bpy.types.Scene.ToolBoxWeight = bpy.props.PointerProperty(type=ToolBoxWeightpaintGroup)
def unregister():
for cls in classes:
bpy.utils.unregister_class(cls)
if __name__ == "__main__":
register()