-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path__init__.py
85 lines (75 loc) · 2.69 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
85
# Copyright (C) 2019 Christopher Gearhart
# chris@bblanimation.com
# http://bblanimation.com/
#
# 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/>.
bl_info = {
"name" : "Background Processing",
"author" : "Christopher Gearhart <chris@bblanimation.com>",
"version" : (1, 0, 0),
"blender" : (2, 80, 0),
"description" : "Process in the background with a separate instance of Blender",
"location" : "View3D > Tools > Bricker",
"warning" : "", # used for warning icon and text in addons panel
"wiki_url" : "",
"tracker_url" : "",
"category" : "Object"}
# Blender imports
import bpy
from bpy.types import Scene
# Addon imports
from .classes import *
from .ui import *
from .functions.common import *
classes = (
SCENE_OT_add_job,
SCENE_OT_kill_job,
VIEW3D_PT_background_processing_tests,
VIEW3D_PT_background_processing_info,
)
def register():
for cls in classes:
make_annotations(cls)
bpy.utils.register_class(cls)
def update_max_workers(self, context):
job_manager = JobManager.get_instance(-1)
job_manager.max_workers = context.scene.backproc_max_workers
Scene.backproc_max_workers = IntProperty(
name="Maximum Workers",
description="Maximum number of Blender instances to run in the background",
min=0, max=100,
update=update_max_workers,
default=5,
)
Scene.backproc_manager_index = IntProperty(
name="JobManager Index",
description="Index for the desired JobManager instance",
default=-1,
)
Scene.backproc_job_type = EnumProperty(
name="Job Type",
description="Show info for jobs with this status",
items=(("ALL", "All", ""),
("QUEUED", "Queued", ""),
("ACTIVE", "Active", ""),
("COMPLETED", "Completed", ""),
("DROPPED", "Dropped", ""),),
default="ALL",
)
def unregister():
del Scene.backproc_job_type
del Scene.backproc_manager_index
del Scene.backproc_max_workers
for cls in reversed(classes):
bpy.utils.unregister_class(cls)