Repository navigation
Expand file tree
/
Copy path__init__.py
More file actions
86 lines (71 loc) · 2.35 KB
/
Copy path__init__.py
File metadata and controls
86 lines (71 loc) · 2.35 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
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This file is part of the Blender addon "Renderlayer Manager".
#
# The addon "Renderlayer Manager" is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation version 3 of the License or
# any later version.
#
# The addon "Renderlayer Manager" is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the addon. If not, see <http://www.gnu.org/licenses/>.
#
# ##### END GPL LICENSE BLOCK #####
import bpy
from bpy.app.handlers import persistent
from . import preferences
preferences.register()
from . import operators
from . import properties
from . import ui
from . import utils
if "bpy" in locals():
import importlib
if 'preferences' in locals():
importlib.reload(preferences)
if 'operators' in locals():
importlib.reload(operators)
if 'properties' in locals():
importlib.reload(properties)
if 'ui' in locals():
importlib.reload(ui)
if 'utils' in locals():
importlib.reload(utils)
@persistent
def load_post_func(dummy):
context = bpy.context
# normalize viewlayer order
utils.normalize_viewlayer_order()
# update viewlayer settings
utils.get_viewlayer_settings(context, utils.VIEWLAYER_SETTINGS)
# get ocio settings
utils.get_ocio_settings()
@persistent
def change_frame_func(dummy):
context = bpy.context
if context.scene.rlm.auto_update_paths:
utils.set_output_paths(context, selection=False)
classes = ()
def register():
bpy.app.handlers.load_post.append(load_post_func)
bpy.app.handlers.frame_change_post.append(change_frame_func)
properties.register()
ui.register()
operators.register()
for cls in classes:
bpy.utils.register_class(cls)
def unregister():
for cls in classes:
bpy.utils.unregister_class(cls)
operators.unregister()
ui.unregister()
properties.unregister()
bpy.app.handlers.frame_change_post.remove(change_frame_func)
bpy.app.handlers.load_post.remove(load_post_func)
if __name__ == '__main__':
register()