-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path__init__.py
More file actions
1004 lines (920 loc) · 35.6 KB
/
Copy path__init__.py
File metadata and controls
1004 lines (920 loc) · 35.6 KB
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
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# ruff: noqa: I001 — import order is intentional here: thematic grouping,
# and the .operators.modifiers descriptor import sequence defines the
# REGISTRY (grid icon) order. Do not auto-sort.
import bpy
import json
import os
from .operators.hotkeys.load_hotkeys import (
IOPS_OT_LoadUserHotkeys,
IOPS_OT_LoadDefaultHotkeys,
)
from .operators.hotkeys.save_hotkeys import IOPS_OT_SaveUserHotkeys
from .operators.preferences.io_addon_preferences import (
IOPS_OT_SaveAddonPreferences,
IOPS_OT_LoadAddonPreferences,
)
from .operators.preferences.io_theme import (
IOPS_OT_ThemeSaveAs,
IOPS_OT_ThemeSave,
IOPS_OT_ThemeDelete,
IOPS_OT_ThemeOpenFolder,
ensure_default_presets as _ensure_default_theme_presets,
)
from .operators.align_origin_to_normal import IOPS_OT_AlignOriginToNormal
from .operators.mouseover_fill_select import IOPS_MouseoverFillSelect
from .operators.materials_from_textures import IOPS_OT_MaterialsFromTextures
from .operators.cursor_origin.mesh import IOPS_OT_CursorOrigin_Mesh
from .operators.curve_spline_type import IOPS_OT_CurveSplineType
from .operators.curve_subdivide import IOPS_OT_CurveSubdivide
from .operators.grid_from_active import IOPS_OT_ToGridFromActive
from .operators.iops import IOPS_OT_Main
from .operators.library_reload import IOPS_OT_Reload_Libraries
from .operators.instance_collection_append import (
IOPS_OT_Instance_Collection_Append,
IOPS_OT_Scan_Source_Collections,
IOPS_UL_SourceCollectionsList,
IOPS_OT_Select_All_Collections,
)
from .operators.image_reload import IOPS_OT_Reload_Images
from .operators.maya_isolate import IOPS_OT_MayaIsolate
from .operators.split_screen_area import IOPS_OT_SwitchScreenArea
from .operators.outliner_collection_ops import (
IOPS_OT_Collections_Include,
IOPS_OT_Collections_Exclude,
IOPS_OT_Collections_Remove_Keep_Objects,
)
if bpy.app.version[0] < 3:
from .operators.split_screen_area import IOPS_OT_SplitScreenArea
else:
from .operators.split_screen_area_new import IOPS_OT_SplitScreenArea
from .operators.mesh_convert_selection import (
IOPS_OT_ToEdges,
IOPS_OT_ToFaces,
IOPS_OT_ToVerts,
)
from .operators.modes import (
IOPS_OT_ESC,
IOPS_OT_F1,
IOPS_OT_F2,
IOPS_OT_F3,
IOPS_OT_F4,
IOPS_OT_F5,
)
from .operators.ui_toggles import (
IOPS_OT_HelpToggleMarker,
IOPS_OT_HudParamsToggleMarker,
)
from .operators.object_align_to_face import IOPS_OT_AlignObjectToFace
from .operators.object_match_transform_active import IOPS_OT_MatchTransformActive
from .operators.mesh_to_grid import IOPS_OT_mesh_to_grid
from .operators.mesh_copy_edges_length import IOPS_MESH_OT_CopyEdgesLength
from .operators.mesh_copy_edges_angle import IOPS_MESH_OT_CopyEdgesAngle
from .operators.drag_snap import IOPS_OT_DragSnap
from .operators.drag_snap_uv import IOPS_OT_DragSnapUV
from .operators.uv_info import IOPS_OT_UVInfoRect
from .operators.uv_visual_cursor import IOPS_OT_VisualCursorUV
from .operators.drag_snap_cursor import IOPS_OT_DragSnapCursor
from .operators.object_normalize import IOPS_OT_object_normalize
from .operators.object_replace import IOPS_OT_Object_Replace
from .operators.object_rotate import (
IOPS_OT_object_rotate_MX,
IOPS_OT_object_rotate_MY,
IOPS_OT_object_rotate_MZ,
IOPS_OT_object_rotate_X,
IOPS_OT_object_rotate_Y,
IOPS_OT_object_rotate_Z,
)
from .operators.object_auto_smooth import IOPS_OT_AutoSmooth, IOPS_OT_ClearCustomNormals
from .operators.object_change_scale import IOPS_OT_ChangeScale
from .operators.object_three_point_rotation import IOPS_OT_ThreePointRotation
from .operators.object_visual_origin import IOPS_OT_VisualOrigin
from .operators.mesh_quick_snap import IOPS_OT_Mesh_QuickSnap
from .operators.save_load_space_data import IOPS_OT_LoadSpaceData, IOPS_OT_SaveSpaceData
from .prefs.addon_preferences import IOPS_AddonPreferences
from .prefs.theme import classes as _theme_classes
from .prefs.addon_properties import IOPS_AddonProperties
from .prefs.addon_properties import IOPS_SceneProperties, IOPS_CollectionItem, IOPS_ExecutorScriptItem, IOPS_WidgetListItem, IOPS_RenameSettings, IOPS_WidgetDataKV, IOPS_WidgetDataBlock
from .operators.assign_vertex_color import (
IOPS_OT_VertexColorAssign,
IOPS_OT_VertexColorAlphaAssign,
IOPS_OT_VertexColorChannel,
)
from .operators.object_color import (
IOPS_OT_ObjectColor_Apply,
IOPS_OT_ObjectColor_CopyFromActive,
IOPS_OT_ObjectColor_ApplyRecent,
)
from .ui.iops_object_color_panel import IOPS_PT_Object_Color_Panel
from .ui.iops_uv_panel import IOPS_PT_UV_Panel
from .operators.object_drop_it import IOPS_OT_Drop_It
from .operators.object_kitbash_grid import IOPS_OT_KitBash_Grid
from .operators.align_between_two import IOPS_OT_Align_between_two
from .ui.iops_tm_panel import (
IOPS_OT_edit_origin,
IOPS_OT_transform_orientation_create,
IOPS_OT_transform_orientation_cleanup,
IOPS_OT_transform_orientation_delete,
IOPS_OT_homonize_uvmaps_names,
IOPS_OT_uvmaps_cleanup,
IOPS_PT_TPS_Panel,
IOPS_PT_TM_Panel,
IOPS_OT_Call_TPS_Panel,
IOPS_OT_Call_TM_Panel,
IOPS_PT_Collection_Append_Panel,
IOPS_OT_Call_Collection_Append_Panel,
IOPS_PT_VCol_Panel,
)
from .ui.iops_data_panel import IOPS_PT_DATA_Panel, IOPS_OT_Call_Data_Panel
from .ui.iops_mod_window import IOPS_OT_Modifier_Window
from .ui.iops_modifiers_panel import (
IOPS_PT_Modifiers_Panel,
IOPS_OT_Call_Modifiers_Panel,
)
# iOps Modifiers module: descriptor files register themselves into
# iops_mod_registry.REGISTRY on import; tool modules carry the operators.
from .operators.modifiers import (
iops_mod_registry,
iops_mod_bevel, iops_mod_boolean, iops_mod_mirror, iops_mod_array, # noqa: F401
iops_mod_solidify, iops_mod_subsurf, iops_mod_screw, iops_mod_weld, # noqa: F401
iops_mod_triangulate, iops_mod_decimate, iops_mod_remesh, # noqa: F401
iops_mod_wireframe, iops_mod_curve, iops_mod_lattice, # noqa: F401
iops_mod_simple_deform, iops_mod_displace, iops_mod_shrinkwrap, # noqa: F401
iops_mod_weighted_normal, # noqa: F401
iops_mod_stack, iops_mod_sort, iops_mod_cleanup, iops_mod_sync_vis,
iops_mod_pick_target, iops_mod_select_users,
iops_mod_safe_apply, iops_mod_list, iops_mod_defaults,
iops_mod_adaptive_decimate, iops_mod_collapse_stack,
)
_modifiers_classes = (
iops_mod_list.IOPS_MT_ModGridAdd,
iops_mod_list.IOPS_OT_ModGridListAdd,
iops_mod_list.IOPS_OT_ModGridListAction,
iops_mod_list.IOPS_MT_ModSaveDefaultSlot,
iops_mod_list.IOPS_OT_ModSaveSlotDefault,
iops_mod_registry.IOPS_OT_ModGridClick,
iops_mod_stack.IOPS_OT_ModStackAction,
iops_mod_stack.IOPS_OT_ModGroupToggle,
iops_mod_sort.IOPS_OT_ModSortStack,
iops_mod_sort.IOPS_MT_ModSortAddHead,
iops_mod_sort.IOPS_MT_ModSortAddTail,
iops_mod_sort.IOPS_OT_ModSortListAdd,
iops_mod_sort.IOPS_OT_ModSortListAction,
iops_mod_cleanup.IOPS_OT_ModCleanup,
iops_mod_sync_vis.IOPS_OT_ModSyncVis,
iops_mod_select_users.IOPS_OT_ModSelectTargetUsers,
iops_mod_pick_target.IOPS_OT_ModPickTarget,
iops_mod_safe_apply.IOPS_OT_ModSafeApplyTransform,
iops_mod_adaptive_decimate.IOPS_OT_ModAdaptiveDecimate,
iops_mod_collapse_stack.IOPS_OT_ModCollapseStack,
)
from .ui.iops_pie_split import (
IOPS_OT_Split_Area_Pie_1,
IOPS_OT_Split_Area_Pie_2,
IOPS_OT_Split_Area_Pie_3,
IOPS_OT_Split_Area_Pie_4,
IOPS_OT_Split_Area_Pie_6,
IOPS_OT_Split_Area_Pie_7,
IOPS_OT_Split_Area_Pie_8,
IOPS_OT_Split_Area_Pie_9,
IOPS_MT_Pie_Split,
IOPS_OT_Call_Pie_Split,
)
from .ui.iops_pie_shading import (
IOPS_OT_Apply_Shading_Preset,
IOPS_MT_Pie_Shading,
IOPS_OT_Call_Pie_Shading,
)
from .ui.iops_pie_menu import IOPS_MT_Pie_Menu, IOPS_OT_Call_Pie_Menu
from .operators.open_asset_in_current_blender import IOPS_OT_OpenAssetInCurrentBlender
# IOPS Library (ported asset-library workflow)
from .operators.library.library_refresh import (
IOPS_OT_LibraryFindMaster,
IOPS_OT_LibraryRefresh,
)
from .operators.library.library_insert import IOPS_OT_LibraryInsertAsset
from .operators.library.library_remove import IOPS_OT_LibraryRemoveAsset
from .operators.library.library_publish import IOPS_OT_LibraryPublish
from .operators.library.library_popup import IOPS_OT_LibraryPopup
from .ui.iops_pie_edit import (
IOPS_MT_Pie_Edit,
IOPS_OT_Call_Pie_Edit,
IOPS_MT_Pie_Edit_Modes,
IOPS_OT_Set_Empty_Size,
IOPS_OT_Set_Empty_Display,
IOPS_OT_Copy_Empty_Size_From_Active,
IOPS_OT_ReloadEmptyReferenceImage,
IOPS_OT_Reload_Instance_Library,
IOPS_OT_EditPieOperatorSearch,
)
from .operators.z_ops import (
Z_OT_GrowLoop,
Z_OT_ShrinkLoop,
Z_OT_GrowRing,
Z_OT_ShrinkRing,
Z_OT_SelectBoundedLoop,
Z_OT_SelectBoundedRing,
Z_OT_EdgeEq,
Z_OT_EdgeLineUp,
Z_OT_ContextDelete,
Z_OT_PutOn,
Z_OT_Mirror,
Z_OT_EdgeConnect,
)
from .operators.easy_mod_curve import IOPS_OT_Easy_Mod_Curve
from .operators.easy_mod_array import (
IOPS_OT_Easy_Mod_Array_Caps,
IOPS_OT_Easy_Mod_Array_Curve,
)
from .operators.object_radial_array import IOPS_OT_Object_Radial_Array
from .operators.object_mirror_rotate import IOPS_OT_Object_Mirror_Rotate
from .operators.object_aligner import IOPS_OT_Object_Aligner
from .operators.easy_mod_shwarp import IOPS_OT_Easy_Mod_Shwarp
from .operators.bevel_edge_data import (
IOPS_OT_BevelEdgeDataFix,
IOPS_OT_PinUnwrapBevel,
)
from .operators.object_name_from_active import IOPS_OT_Object_Name_From_Active, IOPS_OT_Object_Name_From_Active_Apply
from .operators.object_select_similar_name import IOPS_OT_SelectSimilarName
from .operators.object_uvmaps_cleaner import (
IOPS_OT_Clean_UVMap_0,
IOPS_OT_Clean_UVMap_1,
IOPS_OT_Clean_UVMap_2,
IOPS_OT_Clean_UVMap_3,
IOPS_OT_Clean_UVMap_4,
IOPS_OT_Clean_UVMap_5,
IOPS_OT_Clean_UVMap_6,
IOPS_OT_Clean_UVMap_7,
)
from .operators.object_uvmaps_add_remove import (
IOPS_OT_Add_UVMap,
IOPS_OT_Remove_UVMap_by_Active_Name,
IOPS_OT_Active_UVMap_by_Active,
IOPS_OT_Active_UVMap_by_Active_Name,
IOPS_OT_Sort_UVMaps_by_Name,
)
from .operators.executor import (
IOPS_OT_Executor,
IOPS_PT_ExecuteList,
IOPS_OT_Call_MT_Executor,
)
from .operators.widgets_panel import classes as _widgets_panel_classes
from .operators.uv_image_slots import classes as _uv_image_slots_classes
from .operators.purge_widget_data import classes as _purge_widget_data_classes
from .operators.render_asset_thumbnail import IOPS_OT_RenderAssetThumbnail
from .operators.run_text import IOPS_OT_RunText
from .operators.ui_prop_switch import (
IOPS_OT_ActiveObject_Scroll_UP,
IOPS_OT_ActiveObject_Scroll_DOWN,
)
from .operators.snap_combos import IOPS_OT_SetSnapCombo
from .utils.functions import (register_keymaps, unregister_keymaps,
fix_old_keymaps, merge_missing_defaults,
build_bindable_defaults,
register_ui_toggle_keymaps)
# Hotkeys
from .prefs.hotkeys_default import keys_default as keys_default
# Preferences
from .operators.preferences.io_addon_preferences import load_iops_preferences
# IOPS Statistics
from .utils.draw_stats import draw_iops_statistics
# IOPS UV Channel Hop
from .operators.mesh_uv_channel_hop import IOPS_OT_Mesh_UV_Channel_Hop
# IOPS Cursor rotate
from .operators.cursor_rotate import IOPS_OT_Cursor_Rotate
# IOPS Edge bisect with cursor
from .operators.mesh_cursor_bisect import IOPS_OT_Mesh_Cursor_Bisect
from .operators.mesh_quick_connect import IOPS_OT_Mesh_Quick_Connect
from .operators.mesh_to_tris_to_quad import IOPS_OT_MeshToTrisToQuads
from .operators.mesh_straight_bevel import IOPS_OT_straight_bevel
from .operators.mesh_smart_inset import IOPS_OT_smart_inset
from .operators.mesh_shear import IOPS_OT_mesh_shear
from .operators.mesh_hinge import IOPS_OT_mesh_hinge
from .operators.mesh_converge import IOPS_OT_mesh_converge
from .operators.mesh_vert_fuse import IOPS_OT_mesh_vert_fuse
from .operators.mesh_snapshot import IOPS_OT_mesh_snapshot
from .operators.mesh_extrude_attrs import (IOPS_OT_extrude_attr_fix,
IOPS_OT_extrude_attr_fix_post,
IOPS_OT_mesh_extrude_ex_macro,
IOPS_OT_mesh_extrude_ex_normals,
IOPS_OT_mesh_extrude_ex_indiv,
IOPS_OT_mesh_extrude_ex,
define_extrude_macro,
draw_extrude_menu)
# from .operators.mesh_polygon_bevel import IOPS_OT_polygon_bevel # WIP
from .operators.mesh_selection_sets import (
IOPS_SS_ObjectRef,
IOPS_SS_SceneSet,
IOPS_OT_SSNew,
IOPS_OT_SSRecall,
IOPS_OT_SSReplace,
IOPS_OT_SSDelete,
IOPS_OT_SSDeleteAll,
IOPS_OT_SSUnion,
IOPS_OT_SSDifference,
IOPS_OT_SSRename,
IOPS_OT_SSBool,
)
from .ui.iops_selection_sets_panel import (
IOPS_SS_MirrorItem,
IOPS_OT_SSRefresh,
IOPS_OT_SSPreview,
IOPS_OT_SSPreviewAll,
IOPS_UL_SelectionSets,
IOPS_PT_SelectionSets_Panel,
draw_iops_ss_header,
register_selection_sets_ui,
unregister_selection_sets_ui,
)
from .operators.mesh_visual_uv import IOPS_OT_MeshVisualUV
from .operators.mesh_nonplanar_overlay import IOPS_OT_MeshNonPlanarOverlay
from .operators.mesh_uv_shortest_mark import IOPS_OT_Mesh_UV_Shortest_Mark
from .operators.open_asset_in_new_blender import IOPS_OT_OpenAssetInNewBlender
from .operators.draw_theme_preview import (IOPS_OT_DrawThemePreview,
IOPS_OT_StopThemePreview)
# GPU Widget framework (persistent clickable viewport panels)
from .ui import widgets as ui_widgets
from .prefs.widget_composer import classes as _widget_composer_classes
from .operators.preferences.io_widgets import classes as _io_widgets_classes
# Concrete GPU widget definitions (widgets/edge_data.py, ...). Optional —
# the framework registers fine without it while the package lands.
try:
from . import widgets as iops_widgets
except ModuleNotFoundError:
iops_widgets = None
print("IOPS: concrete widgets package not found, framework only")
# Asset Management
from .operators.assets_management import (
IOPS_OT_AssetClear,
IOPS_OT_AssetCreateCatalog,
IOPS_OT_AssetDeleteCatalog,
IOPS_OT_AssetDeleteEmptyCatalogs,
IOPS_OT_AssetMark,
IOPS_OT_AssetMoveToCatalog,
IOPS_OT_AssetSearchDeleteCatalog,
IOPS_OT_AssetSearchMoveToCatalog,
IOPS_OT_Call_Pie_Assets,
IOPS_OT_ClearAssetBrowserFilter,
IOPS_OT_ExpandInstanceCollection,
IOPS_OT_RefreshAssetBrowser,
IOPS_OT_SelectInAssetBrowser,
IOPS_OT_SetAssetLibrary,
register_pool_menus,
unregister_pool_menus,
)
# Material Override
from .operators.material_override import (
IOPS_MaterialOverrideSettings,
IOPS_OT_Call_Material_Override_Panel,
IOPS_OT_Material_Override_Apply,
IOPS_OT_Material_Override_Clear,
IOPS_OT_Material_Override_Clear_Rendering_Flag,
IOPS_OT_Material_Override_Generate_Previews,
IOPS_OT_Material_Override_Refresh_Previews,
IOPS_PT_Material_Override_Panel,
)
from .ui.iops_pie_assets import (
IOPS_MT_AssetDeleteCatalogsSub,
IOPS_MT_AssetMarkSub,
IOPS_MT_CatalogBrowseActive,
IOPS_MT_LibraryPublishSub,
IOPS_MT_Pie_Assets,
)
from .ui.iops_library_panel import IOPS_PT_Library
bl_info = {
"name": "iOps",
"authors": "Titus, Cyrill, Aleksey",
"version": (7, 7, 7),
"blender": (5, 0, 0),
"location": "View3D > Toolbar and View3D",
"description": "iOPS - Boost your Blender Interactivity :p",
"warning": "",
"wiki_url": "https://interactionops-docs.readthedocs.io/en/latest/index.html",
"tracker_url": "https://github.com/TitusLVR/InteractionOps/issues",
"category": "Tools",
}
# Classes for reg and unreg
classes = (
*_theme_classes,
*_widget_composer_classes, # PropertyGroups before IOPS_AddonPreferences
*iops_mod_defaults.DEFAULTS_CLASSES, # same rule — per-type defaults
iops_mod_list.IOPS_ModGridItem, # after the defaults it points to
iops_mod_sort.IOPS_ModSortItem,
IOPS_AddonPreferences,
*_io_widgets_classes,
IOPS_OT_DrawThemePreview,
IOPS_OT_StopThemePreview,
IOPS_CollectionItem,
IOPS_ExecutorScriptItem,
IOPS_AddonProperties,
IOPS_WidgetListItem,
IOPS_RenameSettings, # PointerProperty target — must register before IOPS_SceneProperties
IOPS_WidgetDataKV, # CollectionProperty targets — same rule
IOPS_WidgetDataBlock,
IOPS_SceneProperties,
IOPS_OT_Collections_Include,
IOPS_OT_Collections_Exclude,
IOPS_OT_Collections_Remove_Keep_Objects,
IOPS_OT_Main,
IOPS_OT_F1,
IOPS_OT_F2,
IOPS_OT_F3,
IOPS_OT_F4,
IOPS_OT_F5,
IOPS_OT_ESC,
IOPS_OT_HelpToggleMarker,
IOPS_OT_HudParamsToggleMarker,
IOPS_OT_CursorOrigin_Mesh,
IOPS_OT_CurveSubdivide,
IOPS_OT_CurveSplineType,
IOPS_OT_ToFaces,
IOPS_OT_ToEdges,
IOPS_OT_ToVerts,
IOPS_OT_AlignObjectToFace,
IOPS_OT_Align_between_two,
IOPS_OT_VisualOrigin,
IOPS_OT_AutoSmooth,
IOPS_OT_ClearCustomNormals,
IOPS_OT_ChangeScale,
IOPS_OT_object_rotate_Z,
IOPS_OT_object_rotate_MZ,
IOPS_OT_object_rotate_Y,
IOPS_OT_object_rotate_MY,
IOPS_OT_object_rotate_X,
IOPS_OT_object_rotate_MX,
IOPS_OT_object_normalize,
IOPS_OT_Object_Replace,
IOPS_OT_ToGridFromActive,
IOPS_OT_transform_orientation_create,
IOPS_OT_transform_orientation_delete,
IOPS_OT_transform_orientation_cleanup,
IOPS_OT_homonize_uvmaps_names,
IOPS_OT_uvmaps_cleanup,
IOPS_OT_edit_origin,
IOPS_OT_mesh_to_grid,
IOPS_OT_ThreePointRotation,
IOPS_OT_AlignOriginToNormal,
IOPS_OT_MatchTransformActive,
IOPS_PT_TM_Panel,
IOPS_OT_Call_TM_Panel,
IOPS_PT_Collection_Append_Panel,
IOPS_OT_Call_Collection_Append_Panel,
IOPS_PT_TPS_Panel,
IOPS_OT_Call_TPS_Panel,
IOPS_MT_Pie_Menu,
IOPS_OT_Call_Pie_Menu,
IOPS_MT_Pie_Edit,
IOPS_MT_Pie_Edit_Modes,
IOPS_OT_Set_Empty_Size,
IOPS_OT_Set_Empty_Display,
IOPS_OT_Copy_Empty_Size_From_Active,
IOPS_OT_ReloadEmptyReferenceImage,
IOPS_OT_Reload_Instance_Library,
IOPS_OT_EditPieOperatorSearch,
IOPS_OT_OpenAssetInNewBlender,
IOPS_OT_Split_Area_Pie_1,
IOPS_OT_Split_Area_Pie_2,
IOPS_OT_Split_Area_Pie_3,
IOPS_OT_Split_Area_Pie_4,
IOPS_OT_Split_Area_Pie_6,
IOPS_OT_Split_Area_Pie_7,
IOPS_OT_Split_Area_Pie_8,
IOPS_OT_Split_Area_Pie_9,
IOPS_OT_Call_Pie_Edit,
IOPS_MT_Pie_Split,
IOPS_OT_Call_Pie_Split,
IOPS_OT_Apply_Shading_Preset,
IOPS_MT_Pie_Shading,
IOPS_OT_Call_Pie_Shading,
IOPS_PT_DATA_Panel,
IOPS_OT_Call_Data_Panel,
IOPS_OT_Easy_Mod_Curve,
IOPS_OT_Executor,
IOPS_PT_ExecuteList,
IOPS_OT_Call_MT_Executor,
IOPS_OT_Easy_Mod_Array_Caps,
IOPS_OT_Easy_Mod_Array_Curve,
IOPS_OT_Object_Radial_Array,
IOPS_OT_Object_Mirror_Rotate,
IOPS_OT_Object_Aligner,
IOPS_OT_Easy_Mod_Shwarp,
IOPS_OT_BevelEdgeDataFix,
IOPS_OT_PinUnwrapBevel,
IOPS_OT_Mesh_QuickSnap,
IOPS_OT_LoadDefaultHotkeys,
IOPS_OT_LoadUserHotkeys,
IOPS_OT_SaveUserHotkeys,
IOPS_OT_SaveAddonPreferences,
IOPS_OT_LoadAddonPreferences,
IOPS_OT_ThemeSaveAs,
IOPS_OT_ThemeSave,
IOPS_OT_ThemeDelete,
IOPS_OT_ThemeOpenFolder,
IOPS_OT_RenderAssetThumbnail,
IOPS_OT_RunText,
IOPS_OT_MayaIsolate,
IOPS_OT_Mesh_Cursor_Bisect,
IOPS_OT_Mesh_Quick_Connect,
IOPS_OT_DragSnap,
IOPS_OT_DragSnapUV,
IOPS_OT_UVInfoRect,
IOPS_OT_VisualCursorUV,
IOPS_OT_DragSnapCursor,
IOPS_OT_ActiveObject_Scroll_UP,
IOPS_OT_ActiveObject_Scroll_DOWN,
IOPS_OT_VertexColorAssign,
IOPS_OT_VertexColorAlphaAssign,
IOPS_OT_VertexColorChannel,
IOPS_PT_VCol_Panel,
IOPS_OT_ObjectColor_Apply,
IOPS_OT_ObjectColor_CopyFromActive,
IOPS_OT_ObjectColor_ApplyRecent,
IOPS_PT_Object_Color_Panel,
IOPS_PT_UV_Panel,
IOPS_OT_SplitScreenArea,
IOPS_OT_SwitchScreenArea,
IOPS_OT_SaveSpaceData,
IOPS_OT_LoadSpaceData,
IOPS_OT_MaterialsFromTextures,
IOPS_OT_Drop_It,
IOPS_OT_KitBash_Grid,
IOPS_OT_Clean_UVMap_0,
IOPS_OT_Clean_UVMap_1,
IOPS_OT_Clean_UVMap_2,
IOPS_OT_Clean_UVMap_3,
IOPS_OT_Clean_UVMap_4,
IOPS_OT_Clean_UVMap_5,
IOPS_OT_Clean_UVMap_6,
IOPS_OT_Clean_UVMap_7,
IOPS_OT_Add_UVMap,
IOPS_OT_Remove_UVMap_by_Active_Name,
IOPS_OT_Active_UVMap_by_Active,
IOPS_OT_Active_UVMap_by_Active_Name,
IOPS_OT_Sort_UVMaps_by_Name,
IOPS_OT_Mesh_UV_Channel_Hop,
IOPS_OT_Object_Name_From_Active,
IOPS_OT_Object_Name_From_Active_Apply,
IOPS_OT_SelectSimilarName,
IOPS_MouseoverFillSelect,
IOPS_MESH_OT_CopyEdgesLength,
IOPS_MESH_OT_CopyEdgesAngle,
IOPS_OT_SetSnapCombo,
IOPS_OT_Reload_Libraries,
IOPS_OT_Scan_Source_Collections,
IOPS_OT_Instance_Collection_Append,
IOPS_OT_Select_All_Collections,
IOPS_UL_SourceCollectionsList,
IOPS_OT_Reload_Images,
IOPS_OT_Cursor_Rotate,
Z_OT_GrowLoop,
Z_OT_ShrinkLoop,
Z_OT_GrowRing,
Z_OT_ShrinkRing,
Z_OT_SelectBoundedLoop,
Z_OT_SelectBoundedRing,
Z_OT_EdgeEq,
Z_OT_EdgeLineUp,
Z_OT_ContextDelete,
Z_OT_PutOn,
Z_OT_Mirror,
Z_OT_EdgeConnect,
IOPS_OT_OpenAssetInCurrentBlender,
IOPS_OT_AssetMoveToCatalog,
IOPS_OT_AssetCreateCatalog,
IOPS_OT_AssetDeleteCatalog,
IOPS_OT_AssetDeleteEmptyCatalogs,
IOPS_OT_AssetSearchMoveToCatalog,
IOPS_OT_AssetSearchDeleteCatalog,
IOPS_OT_AssetMark,
IOPS_OT_AssetClear,
IOPS_OT_SetAssetLibrary,
IOPS_MT_AssetMarkSub,
IOPS_MT_LibraryPublishSub,
IOPS_MT_CatalogBrowseActive,
IOPS_MT_AssetDeleteCatalogsSub,
IOPS_MT_Pie_Assets,
IOPS_OT_SelectInAssetBrowser,
IOPS_OT_ClearAssetBrowserFilter,
IOPS_OT_RefreshAssetBrowser,
IOPS_OT_ExpandInstanceCollection,
IOPS_OT_Call_Pie_Assets,
IOPS_OT_LibraryFindMaster,
IOPS_OT_LibraryRefresh,
IOPS_OT_LibraryInsertAsset,
IOPS_OT_LibraryRemoveAsset,
IOPS_OT_LibraryPublish,
IOPS_OT_LibraryPopup,
IOPS_PT_Library,
IOPS_OT_Modifier_Window,
*_modifiers_classes,
IOPS_PT_Modifiers_Panel,
IOPS_OT_Call_Modifiers_Panel,
IOPS_OT_MeshToTrisToQuads,
IOPS_OT_straight_bevel,
IOPS_OT_smart_inset,
IOPS_OT_mesh_shear,
IOPS_OT_mesh_hinge,
IOPS_OT_mesh_converge,
IOPS_OT_mesh_vert_fuse,
IOPS_OT_mesh_snapshot,
IOPS_SS_ObjectRef, # CollectionProperty target — must register before IOPS_SS_SceneSet
IOPS_SS_SceneSet, # CollectionProperty target — must register before Scene.iops_selection_sets
IOPS_OT_SSNew,
IOPS_OT_SSRecall,
IOPS_OT_SSReplace,
IOPS_OT_SSDelete,
IOPS_OT_SSDeleteAll,
IOPS_OT_SSUnion,
IOPS_OT_SSDifference,
IOPS_OT_SSRename,
IOPS_OT_SSBool,
IOPS_SS_MirrorItem, # CollectionProperty target — before rest of the UI classes
IOPS_OT_SSRefresh,
IOPS_OT_SSPreview,
IOPS_OT_SSPreviewAll,
IOPS_UL_SelectionSets,
IOPS_PT_SelectionSets_Panel,
IOPS_OT_extrude_attr_fix,
IOPS_OT_extrude_attr_fix_post,
IOPS_OT_mesh_extrude_ex_macro,
IOPS_OT_mesh_extrude_ex_normals,
IOPS_OT_mesh_extrude_ex_indiv,
IOPS_OT_mesh_extrude_ex,
IOPS_OT_MeshVisualUV,
IOPS_OT_MeshNonPlanarOverlay,
IOPS_OT_Mesh_UV_Shortest_Mark,
# IOPS_OT_polygon_bevel, # WIP
IOPS_MaterialOverrideSettings,
IOPS_OT_Material_Override_Clear_Rendering_Flag,
IOPS_OT_Material_Override_Refresh_Previews,
IOPS_OT_Material_Override_Generate_Previews,
IOPS_OT_Material_Override_Apply,
IOPS_OT_Material_Override_Clear,
IOPS_PT_Material_Override_Panel,
IOPS_OT_Call_Material_Override_Panel,
# GPU widget operators (iops.widget_toggle / iops.widget_interact)
*ui_widgets.classes,
*_widgets_panel_classes,
*_uv_image_slots_classes,
*_purge_widget_data_classes,
)
reg_cls, unreg_cls = bpy.utils.register_classes_factory(classes)
# def draw_iops_hud():
# # set_drawing_dpi(get_dpi())
# # dpi_factor = get_dpi_factor()
# # if addon.preference().color.Hops_display_logo:
# draw_logo_hops()
draw_handler = None
def keymap_registration():
path = bpy.utils.script_path_user()
user_hotkeys_file = os.path.join(path, "presets", "IOPS", "iops_hotkeys_user.py")
fix_old_keymaps()
if os.path.exists(user_hotkeys_file):
try:
with open(user_hotkeys_file, encoding='utf-8') as f:
keys_user = json.load(f)
if not isinstance(keys_user, list):
print("IOPS: Invalid hotkeys file format, using defaults")
keys_user = keys_default
# Merge in any defaults the saved file predates, so operators added
# since the user last saved become bindable (in-memory only).
register_keymaps(merge_missing_defaults(keys_user))
except Exception as e:
print(f"IOPS: Error loading user hotkeys - {e}, using defaults")
register_keymaps(build_bindable_defaults())
else:
register_keymaps(build_bindable_defaults())
register_ui_toggle_keymaps()
bpy.context.window_manager.keyconfigs.update()
def _sync_hud_from_blender_theme_if_pristine():
"""First-install convenience: if the user hasn't touched any of the
HUD color/panel prefs (all still equal to their hardcoded defaults),
seed them from Blender's current theme so the HUD blends with the
rest of the UI out of the box. Skipped silently if the user has
customised any of those prefs."""
try:
prefs = bpy.context.preferences.addons["InteractionOps"].preferences
t = prefs.iops_theme
except (KeyError, AttributeError):
return
watched = ("color_hud_header", "color_hud_key",
"color_hud_active_value", "color_hud_label",
"color_hud_label_inactive", "color_hud_stats_error",
"panel_bg_color")
if any(t.is_property_set(p) for p in watched):
return
try:
bpy.ops.iops.theme_use_blender_hud_colors()
except (RuntimeError, AttributeError) as e:
print(f"IOPS: initial HUD theme sync skipped: {e}")
def register():
reg_cls()
define_extrude_macro()
register_pool_menus()
try:
_ensure_default_theme_presets()
except Exception as e:
print(f"IOPS: ensure_default_theme_presets failed: {e}")
try:
_sync_hud_from_blender_theme_if_pristine()
except Exception as e:
print(f"IOPS: HUD theme sync failed: {e}")
bpy.types.WindowManager.IOPS_AddonProperties = bpy.props.PointerProperty(
type=IOPS_AddonProperties
)
from .operators.library import props as library_props
library_props.register_wm_properties()
from .operators.uv_image_slots import register_slot_props
register_slot_props()
register_selection_sets_ui()
from .ui.iops_pie_edit import register_empty_size_prop
register_empty_size_prop()
bpy.types.Scene.IOPS = bpy.props.PointerProperty(type=IOPS_SceneProperties)
bpy.types.Scene.iops_material_override_settings = bpy.props.PointerProperty(type=IOPS_MaterialOverrideSettings)
bpy.types.Scene.iops_selection_sets = bpy.props.CollectionProperty(
type=IOPS_SS_SceneSet
)
try:
bpy.types.MESH_MT_CopyFaceSettings.append(add_copy_edge_length_item)
bpy.types.VIEW3D_MT_copypopup.append(object_copy_match_dimensions)
bpy.types.VIEW3D_MT_edit_mesh_select_similar.append(select_interior_faces)
except Exception:
print(
"MESH_MT_CopyFaceSettings not found, enable the Copy 'Attributes Menu' addon"
)
bpy.types.OUTLINER_MT_collection.append(outliner_collection_ops)
bpy.types.ASSETBROWSER_MT_context_menu.append(open_asset_in_current_blender)
bpy.types.VIEW3D_MT_object_apply.append(object_apply_change_scale)
bpy.types.VIEW3D_MT_editor_menus.append(draw_iops_ss_header)
bpy.types.VIEW3D_MT_edit_mesh_extrude.append(draw_extrude_menu)
register_select_similar_name_menu()
# Register the draw handler if the statistics are enabled and disable the statistics if they are not
if bpy.context.preferences.addons["InteractionOps"].preferences.iops_stat:
global draw_handler
from .ui.draw import safe_handler_add
draw_handler = safe_handler_add(
bpy.types.SpaceView3D,
draw_iops_statistics, (), "WINDOW", "POST_PIXEL",
)
print("IOPS Statistics Registered!")
else:
print("IOPS Statistics Disabled!")
load_iops_preferences()
keymap_registration()
# Seed the modifiers grid list with the curated set on first run.
# Deferred to a timer: prefs can't be written from register() while
# Blender is still starting up (restricted context).
bpy.app.timers.register(iops_mod_list.seed_grid_list_if_empty,
first_interval=0.1)
# GPU widget framework: app handlers + persisted widget state + the
# LEFTMOUSE interact keymap entry. Must run after the operator classes
# are registered and after load_iops_preferences().
ui_widgets.register()
if iops_widgets is not None and hasattr(iops_widgets, "register"):
iops_widgets.register()
# Composed (JSON) widgets + the prefs Widgets-tab mirror
try:
from .widgets import composed
from .prefs import widget_composer
problems = composed.load_all()
for fn, errors in problems.items():
print(f"IOPS widgets: {fn}: {'; '.join(errors)}")
widget_composer.sync_from_files()
except Exception as e:
print(f"IOPS widgets: composed widget load failed: {e}")
print("IOPS Registered!")
def unregister():
if bpy.app.timers.is_registered(iops_mod_list.seed_grid_list_if_empty):
bpy.app.timers.unregister(iops_mod_list.seed_grid_list_if_empty)
unregister_selection_sets_ui()
# GPU widget teardown first (reverse of register): concrete widgets,
# then the framework — saves widget state to prefs, removes ONLY its
# own keymap entry and app/draw handlers. Guarded so a failure here
# never blocks the rest of the addon's unregister.
try:
if iops_widgets is not None and hasattr(iops_widgets, "unregister"):
iops_widgets.unregister()
ui_widgets.unregister()
except Exception as e:
print("IOPS: widget system unregister failed:", e)
# Persist the current prefs (incl. the full Theme snapshot — preset
# name, colors, font sizes, HUD placement) before anything is torn
# down, so manual tweaks survive addon reloads without requiring an
# explicit Save click or a userpref.blend write.
try:
from .operators.preferences.io_addon_preferences import save_iops_preferences
save_iops_preferences()
except Exception as e:
print("IOPS: prefs autosave on unregister failed:", e)
# Kill any running theme-preview install before classes go away, so
# the draw handlers + 60fps timer don't outlive the operator class.
try:
from .operators.draw_theme_preview import cleanup_live_installs
cleanup_live_installs()
except Exception as e:
print("IOPS: theme-preview cleanup failed:", e)
# Kill the non-planar overlay's draw + app handlers before classes go
# away. Removes only this addon's handlers.
try:
from .operators.mesh_nonplanar_overlay import disable_overlay
disable_overlay()
except Exception as e:
print("IOPS: non-planar overlay cleanup failed:", e)
try:
from .operators.library import library_popup as _library_popup
from .operators.library import common as _library_common
from .operators.library import props as _library_props
from .operators.library import worker_session as _library_worker_session
_library_worker_session.shutdown_session()
_library_popup.shutdown()
_library_common.reset_overlay_textures()
_library_props.unregister_wm_properties()
except Exception as e:
print("IOPS: library unregister failed:", e)
try:
bpy.types.MESH_MT_CopyFaceSettings.remove(add_copy_edge_length_item)
bpy.types.VIEW3D_MT_copypopup.remove(object_copy_match_dimensions)
bpy.types.OUTLINER_MT_collection.remove(outliner_collection_ops)
bpy.types.VIEW3D_MT_edit_mesh_select_similar.remove(select_interior_faces)
bpy.types.ASSETBROWSER_MT_context_menu.remove(open_asset_in_current_blender)
bpy.types.VIEW3D_MT_object_apply.remove(object_apply_change_scale)
except Exception as e:
print(e)
try:
bpy.types.VIEW3D_MT_editor_menus.remove(draw_iops_ss_header)
except Exception:
pass
try:
bpy.types.VIEW3D_MT_edit_mesh_extrude.remove(draw_extrude_menu)
except Exception:
pass
unregister_select_similar_name_menu()
unregister_pool_menus()
unreg_cls()
del bpy.types.Scene.IOPS
del bpy.types.Scene.iops_material_override_settings
try:
del bpy.types.Scene.iops_selection_sets
except AttributeError:
pass
try:
from .operators.uv_image_slots import unregister_slot_props
unregister_slot_props()
except Exception as e:
print("IOPS: UV image slot props unregister failed:", e)
try:
from .ui.iops_pie_edit import unregister_empty_size_prop
unregister_empty_size_prop()
except Exception as e:
print("IOPS: empty size prop unregister failed:", e)
del bpy.types.WindowManager.IOPS_AddonProperties
unregister_keymaps()
# Unregister the draw handler
global draw_handler
if draw_handler is not None:
from .ui.draw import safe_handler_remove
safe_handler_remove(draw_handler, bpy.types.SpaceView3D, "WINDOW")
draw_handler = None
print("IOPS Unregistered!")
def add_copy_edge_length_item(self, context):
self.layout.operator(IOPS_MESH_OT_CopyEdgesLength.bl_idname)
self.layout.operator(IOPS_MESH_OT_CopyEdgesAngle.bl_idname)
def open_asset_in_current_blender(self, context):
self.layout.operator(IOPS_OT_OpenAssetInCurrentBlender.bl_idname)
self.layout.separator()
self.layout.operator(IOPS_OT_RenderAssetThumbnail.bl_idname, text="Render Asset Thumbnail")
self.layout.operator(IOPS_OT_Call_Pie_Assets.bl_idname, text="Move Asset to Catalog")
def outliner_collection_ops(self, context):
self.layout.separator()
self.layout.operator(IOPS_OT_Collections_Include.bl_idname)
self.layout.operator(IOPS_OT_Collections_Exclude.bl_idname)
self.layout.separator()
self.layout.operator(IOPS_OT_Collections_Remove_Keep_Objects.bl_idname, icon="TRASH")
def select_interior_faces(self, context):
self.layout.operator("mesh.select_interior_faces")
def object_apply_change_scale(self, context):
self.layout.separator()
self.layout.operator(IOPS_OT_ChangeScale.bl_idname)
def object_copy_match_dimensions(self, context):
# Appended to the Copy Attributes Menu addon's object Ctrl+C popup.
self.layout.operator(IOPS_OT_MatchTransformActive.bl_idname,
text="Match Object's Dimensions")
def select_grouped_similar_name(self, context):
self.layout.operator(IOPS_OT_SelectSimilarName.bl_idname)
def register_select_similar_name_menu():
"""Register Select Similar Name to View3D Select menu and HOPS menu if available."""
bpy.types.VIEW3D_MT_select_object.append(select_grouped_similar_name)
if hasattr(bpy.types, "HOPS_MT_SelectGrouped"):
bpy.types.HOPS_MT_SelectGrouped.append(select_grouped_similar_name)
def unregister_select_similar_name_menu():
"""Unregister Select Similar Name from menus."""
try:
bpy.types.VIEW3D_MT_select_object.remove(select_grouped_similar_name)
except Exception:
pass
if hasattr(bpy.types, "HOPS_MT_SelectGrouped"):
try:
bpy.types.HOPS_MT_SelectGrouped.remove(select_grouped_similar_name)
except Exception:
pass