-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy path__init__.py
executable file
·84 lines (73 loc) · 2.55 KB
/
__init__.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
# This Addon for Blender implements realtime OSC controls in the viewport
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
# Copyright (C) 2018 maybites <https://github.com/maybites/>
#
# Copyright (C) 2017 AG6GR <https://github.com/AG6GR/>
#
# Copyright (C) 2015 JPfeP <http://www.jpfep.net/>
#
# This program 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, either version 3 of the License, or
# (at your option) any later version.
#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
#
# ***** END GPL LICENCE BLOCK *****
# TODO:
#
# pbm not set to None du modal timer when opening a new blend file
bl_info = {
"name": "NodeOSC",
"author": "maybites",
"version": (2, 3, 2),
"blender": (2, 80, 0),
"location": "View3D > Tools > NodeOSC",
"description": "Realtime control of Blender using OSC data protocol",
"wiki_url": "https://github.com/maybites/blender.NodeOSC/wiki",
"tracker_url": "https://github.com/maybites/blender.NodeOSC/issues",
"support": "COMMUNITY",
"category": "System"}
import bpy
from bpy.app.handlers import persistent
#Restore saved settings
@persistent
def nodeosc_handler(scene):
if bpy.context.scene.nodeosc_envars.autorun == True:
if bpy.context.scene.nodeosc_envars.isServerRunning == False:
preferences = bpy.context.preferences
addon_prefs = preferences.addons[__package__].preferences
if addon_prefs.usePyLiblo == False:
bpy.ops.nodeosc.oscpy_operator()
else:
bpy.ops.nodeosc.pythonosc_operator()
from . import preferences
from .server import server, operators
from .ui import panels
from .nodes import nodes
from .utils import keys
def register():
preferences.register()
keys.register()
operators.register()
panels.register()
server.register()
nodes.register()
bpy.app.handlers.load_post.append(nodeosc_handler)
def unregister():
nodes.unregister()
server.unregister()
panels.unregister()
operators.unregister()
keys.unregister()
preferences.unregister()
if __name__ == "__main__":
register()