-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path__init__.py
180 lines (149 loc) · 4.79 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
169
170
171
172
173
174
175
176
177
178
179
180
bl_info = {
"name": "Super Image Denoiser (SID)",
"author": "Kevin Lorengel",
"version": (4, 0, 0),
"blender": (3, 6, 0),
"location": "Properties > Render > Create Super Denoiser",
"description": "SID denoises your renders near-perfectly, with only one click!",
"warning": "",
"wiki_url": "https://discord.gg/cnFdGQP",
"endpoint_url": "https://raw.githubusercontent.com/PidgeonTools/SAM-Endpoints/main/SuperImageDenoiser.json",
"tracker_url": "https://github.com/PidgeonTools/SuperImageDenoiser/issues",
"category": "Compositor",
}
import bpy
from bpy.app.handlers import persistent
from bpy.props import (
PointerProperty,
)
from .SuperImageDenoiser import (
SID_Create
)
from .SID_Settings import (
SID_DenoiseRenderStatus,
SID_Settings,
SID_TemporalDenoiserStatus
)
from .SID_Panel import (
SID_PT_SID_Panel,
SID_PT_SOCIALS_Panel
)
from .SID_Temporal import (
TD_OT_Render,
TD_OT_StopRender,
TD_OT_Denoise,
TD_OT_StopDenoise
)
from .Temporal.SID_Render_Denoise_Temporal_FG import (
SIDT_OT_RenderFG,
SIDT_OT_StopRender,
SIDT_OT_DenoiseFG,
SIDT_OT_StopDenoise
)
from .Temporal.SID_Render_Denoise_Temporal_BG import (
SIDT_OT_RenderBG,
SIDT_OT_DenoiseBG
)
from . import addon_updater_ops
class DemoPreferences(bpy.types.AddonPreferences):
bl_idname = __package__
# addon updater preferences
auto_check_update: bpy.props.BoolProperty(
name="Auto-check for Update",
description="If enabled, auto-check for updates using an interval",
default=True,
)
updater_intrval_months: bpy.props.IntProperty(
name='Months',
description="Number of months between checking for updates",
default=0,
min=0
)
updater_intrval_days: bpy.props.IntProperty(
name='Days',
description="Number of days between checking for updates",
default=7,
min=0,
max=31
)
updater_intrval_hours: bpy.props.IntProperty(
name='Hours',
description="Number of hours between checking for updates",
default=0,
min=0,
max=23
)
updater_intrval_minutes: bpy.props.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() # works best if a column, or even just self.layout
mainrow = layout.row()
col = mainrow.column()
# updater draw function
# could also pass in col as third arg
addon_updater_ops.update_settings_ui(self, context)
# 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 = (
SID_DenoiseRenderStatus,
SID_TemporalDenoiserStatus,
SID_Settings,
SID_PT_SID_Panel,
SID_PT_SOCIALS_Panel,
SID_Create,
SIDT_OT_RenderFG,
SIDT_OT_RenderBG,
SIDT_OT_StopRender,
SIDT_OT_DenoiseFG,
SIDT_OT_DenoiseBG,
SIDT_OT_StopDenoise,
TD_OT_Render,
TD_OT_StopRender,
TD_OT_Denoise,
TD_OT_StopDenoise,
DemoPreferences
)
@persistent
def load_handler(dummy):
try:
bpy.context.scene.sid_settings.denoise_render_status.is_rendering = False
except:
pass
try:
bpy.context.scene.sid_settings.temporal_denoiser_status.is_denoising = False
except:
pass
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)
# 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.sid_settings = PointerProperty(type=SID_Settings, options=set())
bpy.app.handlers.load_post.append(load_handler)
def unregister():
# addon updater unregister
addon_updater_ops.unregister()
# register the example panel, to show updater buttons
from bpy.utils import unregister_class
del bpy.types.Scene.sid_settings
for cls in reversed(classes):
unregister_class(cls)
if __name__ == "__main__":
register()