-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
106 lines (98 loc) · 3.83 KB
/
Copy path__init__.py
File metadata and controls
106 lines (98 loc) · 3.83 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
"""Render Queue Manager X - Blender extension entry point."""
__version__ = "2.2.0"
# --- Hot reload support ---
import importlib, sys
_submods = [
'.rqm.utils', '.rqm.properties', '.rqm.jobs', '.rqm.comp',
'.rqm.operators_queue', '.rqm.operators_outputs', '.rqm.ui', '.rqm.handlers'
]
_pkg_name = __name__
if any(m.startswith(_pkg_name + '.rqm') for m in list(sys.modules.keys())):
for rel in _submods:
full = _pkg_name + rel[1:]
mod = sys.modules.get(full)
if mod:
try:
importlib.reload(mod)
except Exception:
pass
from .rqm.properties import (
RQM_ViewLayerItem, RQM_CompOutput, RQM_EncodingSettings,
RQM_Job, RQM_RenderStat, RQM_State, RQM_Tag, RQM_Template,
)
from .rqm.operators_queue import (
RQM_OT_AddFromCurrent, RQM_OT_AddCamerasInScene, RQM_OT_RemoveJob, RQM_OT_ClearQueue,
RQM_OT_MoveJob, RQM_OT_StartQueue, RQM_OT_StopQueue,
RQM_OT_DuplicateJob, RQM_OT_EnableAll, RQM_OT_DisableAll,
RQM_OT_OpenOutputFolder, RQM_OT_CreateFolders,
RQM_OT_SyncStereoTags, RQM_OT_ToggleIndirectOnly, RQM_OT_ToggleIndirectOnlyAll,
RQM_OT_CopyPath, RQM_OT_ViewLayerSelectAll, RQM_OT_ViewLayerDeselectAll,
RQM_OT_RefreshViewLayers, RQM_OT_SaveTemplate, RQM_OT_LoadTemplate,
RQM_OT_DeleteTemplate, RQM_OT_ToggleIndirectSelect,
)
from .rqm.operators_outputs import (
RQM_OT_Output_Add, RQM_OT_Output_Remove, RQM_OT_Output_Move,
RQM_OT_PickFileOutputNode, RQM_OT_Output_AddAll,
)
from .rqm.ui import RQM_UL_Queue, RQM_UL_Outputs, RQM_UL_Tags, RQM_UL_ViewLayers, RQM_PT_Panel
from .rqm import comp # ensure compositor logic packaged
from .rqm import handlers # ensure handlers module present (for reload)
import bpy # type: ignore
from bpy.props import PointerProperty # type: ignore
classes = (
RQM_ViewLayerItem, RQM_Tag, RQM_EncodingSettings, RQM_CompOutput, RQM_RenderStat,
RQM_Template, RQM_Job, RQM_State,
RQM_OT_AddFromCurrent, RQM_OT_AddCamerasInScene, RQM_OT_RemoveJob, RQM_OT_ClearQueue,
RQM_OT_MoveJob, RQM_OT_StartQueue, RQM_OT_StopQueue,
RQM_OT_DuplicateJob, RQM_OT_EnableAll, RQM_OT_DisableAll,
RQM_OT_OpenOutputFolder, RQM_OT_CreateFolders,
RQM_OT_SyncStereoTags, RQM_OT_ToggleIndirectOnly, RQM_OT_ToggleIndirectOnlyAll,
RQM_OT_CopyPath, RQM_OT_ViewLayerSelectAll, RQM_OT_ViewLayerDeselectAll,
RQM_OT_RefreshViewLayers, RQM_OT_SaveTemplate, RQM_OT_LoadTemplate,
RQM_OT_DeleteTemplate, RQM_OT_ToggleIndirectSelect,
RQM_OT_Output_Add, RQM_OT_Output_Remove, RQM_OT_Output_Move,
RQM_OT_PickFileOutputNode, RQM_OT_Output_AddAll,
RQM_UL_Queue, RQM_UL_Outputs, RQM_UL_Tags, RQM_UL_ViewLayers, RQM_PT_Panel,
)
def register():
# Robust (re)registration: if a class is already registered, unregister then register
for c in classes:
try:
bpy.utils.register_class(c)
except ValueError:
try:
bpy.utils.unregister_class(c)
except Exception:
pass
try:
bpy.utils.register_class(c)
except Exception:
pass
# Always re-assign to pick up new/updated property definitions on hot-reload
bpy.types.Scene.rqm_state = PointerProperty(type=RQM_State)
# (Re)register handlers each time register() runs
try:
handlers.unregister_handlers()
except Exception:
pass
try:
handlers.register_handlers()
except Exception:
pass
def unregister():
try:
handlers.unregister_handlers()
except Exception:
pass
if hasattr(bpy.types.Scene, 'rqm_state'):
try:
del bpy.types.Scene.rqm_state
except Exception:
pass
for c in reversed(classes):
try:
bpy.utils.unregister_class(c)
except Exception:
pass
if __name__ == '__main__':
register()