-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path__init__.py
168 lines (142 loc) · 5.36 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
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
# To make sure installed modules work
import os, sys
module_path = os.path.join(os.path.dirname(__file__), "python_modules")
sys.path.append(module_path) # Add a module path for this specific addon
import bpy
from bpy.props import (
PointerProperty,
BoolProperty,
IntProperty
)
from .install_deps import (
dependencies,
SFR_OT_CheckDependencies,
SFR_OT_InstallDependencies,
SFR_OT_OpenAddonPrefs,
)
from .SFR_Settings import SFR_Settings
from .SRF_Complimentary import SFR_Complimentary
from .Cycles.SFR_Benchmark_cy import SFR_Benchmark_cy
from .Utils.SFR_AnimationBenchmark import SFR_AnimationBenchmark
from .Cycles.SFR_Super_cy import SFR_Super_cy
from .Cycles.SFR_High_cy import SFR_High_cy
from .Cycles.SFR_Beauty_cy import SFR_Beauty_cy
from .SFR_Panel import SFR_PT_B_Panel, SFR_PT_RSO_Panel, SFR_PT_TO_Panel, SFR_PT_SOCIALS_Panel
from .Utils.SFR_TextureOptimizer import SFR_TextureOptimizer
from . import addon_updater_ops
bl_info = {
"name": "Super Fast Render (SFR)",
"author": "Kevin Lorengel, Chris Bond (Kamikaze)",
"version": (3, 1, 3),
"blender": (2, 92, 0),
"location": "Properties > Render > Super Fast Render",
"description": "SFR optimizes your scene, so you render faster!",
"warning": "IN DEV VERSION",
"wiki_url": "https://discord.gg/cnFdGQP",
"endpoint_url": "https://raw.githubusercontent.com/PidgeonTools/SAM-Endpoints/main/SuperFastRender.json",
"tracker_url": "https://github.com/PidgeonTools/SuperFastRender/issues",
"category": "Render",
}
class SIDPreferences(bpy.types.AddonPreferences):
bl_idname = __package__
# addon updater preferences
auto_check_update: BoolProperty(
name="Auto-check for Update",
description="If enabled, auto-check for updates using an interval",
default=True,
)
updater_intrval_months: IntProperty(
name='Months',
description="Number of months between checking for updates",
default=0,
min=0
)
updater_intrval_days: IntProperty(
name='Days',
description="Number of days between checking for updates",
default=7,
min=0,
max=31
)
updater_intrval_hours: IntProperty(
name='Hours',
description="Number of hours between checking for updates",
default=0,
min=0,
max=23
)
updater_intrval_minutes: IntProperty(
name='Minutes',
description="Number of minutes between checking for updates",
default=0,
min=0,
max=59
)
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
if not dependencies.checked or dependencies.needs_install:
if dependencies.error:
col.label(text="Installing dependencies failed.")
col.label(text="Check Blender's System Console or your terminal for errors.")
col.separator()
col = layout.column(align=True)
col.label(
text="Installation may take a few minutes, and Blender will " \
"stop responding during this time.")
col.label(text="If the Install Dependencies button is still visible after this process completes, please restart Blender.")
col.operator("initialise.sfr_install_dependencies")
else:
col.label(text="Dependencies installed!")
col.separator()
col = layout.column() # works best if a column, or even just self.layout
# updater draw function
# could also pass in col as third arg
addon_updater_ops.update_settings_ui(self, context, col)
# Alternate draw function, which is more condensed and can be
# placed within an existing draw function. Only contains:
# 1) check for update/update now buttons
# 2) toggle for auto-check (interval will be equal to what is set above)
# addon_updater_ops.update_settings_ui_condensed(self, context, col)
# Adding another column to help show the above condensed ui as one column
# col = mainrow.column()
# col.scale_y = 2
# col.operator("wm.url_open","Open webpage ").url=addon_updater_ops.updater.website
classes = (
SFR_Beauty_cy,
SFR_High_cy,
SFR_Super_cy,
SFR_Benchmark_cy,
SFR_Complimentary,
SFR_PT_B_Panel,
SFR_PT_RSO_Panel,
SFR_PT_TO_Panel,
SFR_PT_SOCIALS_Panel,
SFR_Settings,
SFR_OT_CheckDependencies,
SFR_OT_InstallDependencies,
SIDPreferences,
SFR_AnimationBenchmark,
SFR_OT_OpenAddonPrefs,
SFR_TextureOptimizer
)
def register():
# addon updater code and configurations
# in case of broken version, try to register the updater first
# so that users can revert back to a working version
addon_updater_ops.register(bl_info)
dependencies.check_dependencies()
# register the example panel, to show updater buttons
for cls in classes:
addon_updater_ops.make_annotations(
cls) # to avoid blender 2.8 warnings
bpy.utils.register_class(cls)
bpy.types.Scene.sfr_settings = PointerProperty(
type=SFR_Settings, options=set())
def unregister():
# addon updater unregister
addon_updater_ops.unregister()
del bpy.types.Scene.sfr_settings
# register the example panel, to show updater buttons
for cls in reversed(classes):
bpy.utils.unregister_class(cls)