-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterface.py
More file actions
230 lines (179 loc) · 6.79 KB
/
Copy pathinterface.py
File metadata and controls
230 lines (179 loc) · 6.79 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
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
import bpy
import mathutils
import math
import os
import cProfile
import bgl
# serialize data to json
_OBJECT_PT_constraints = None
class ScenePanel(bpy.types.Panel):
bl_label = "Avango-Blender"
bl_idname = "SCENE_PT_b4a"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "scene"
def draw(self, context):
layout = self.layout
scene = context.scene
if scene:
row = layout.row()
row.prop(scene, "enable_ssao", text="Enable SSAO")
row = layout.row()
row.prop(scene, "enable_god_rays", text="Enable God Rays")
row = layout.row()
row.prop(scene, "enable_bloom", text="Enable Bloom")
row = layout.row()
row.prop(scene, "enable_fog", text="Enable Fog")
row = layout.row()
row.prop(scene, "enable_vignette", text="Enable Vignette")
row = layout.row()
row.prop(scene, "enable_hdr", text="Enable HDR")
row = layout.row()
row.prop(scene, "enable_preview_display", text="Enable Preview Display")
row = layout.row()
row.prop(scene, "enable_fps_display", text="Enable FPS Display")
row = layout.row()
row.prop(scene, "enable_ray_display", text="Enable Ray Display")
row = layout.row()
row.prop(scene, "enable_bbox_display", text="Enable bbox Display")
row = layout.row()
row.prop(scene, "enable_wire_frame", text="Enable Wire Frame")
row = layout.row()
row.prop(scene, "enable_FXAA", text="Enable FXAA")
row = layout.row()
row.prop(scene, "enable_frustum_culling", text="Enable Frustum Culling")
row = layout.row()
row.prop(scene, "enable_backface_culling", text="Enable Backface Culling")
row = layout.row()
row.prop(scene, "near_clip", text="Near Clip")
row = layout.row()
row.prop(scene, "far_clip", text="Far Clip")
split = layout.split()
col = split.column()
class WorldPanel(bpy.types.Panel):
bl_label = "Avango-Blender"
bl_idname = "WORLD_PT_b4a"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "world"
def draw(self, context):
layout = self.layout
world = context.world
if world:
ssao = world.ssao_settings
row = layout.row()
box = row.box()
col = box.column()
col.label("SSAO Settings:")
row = col.row()
row.prop(ssao, "radius", text="Radius")
row = col.row()
row.prop(ssao, "intensity", text="Intensity")
row = col.row()
row.prop(ssao, "falloff", text="Falloff")
bloom = world.bloom_settings
row = layout.row()
box = row.box()
col = box.column()
col.label("Bloom settings:")
row = col.row()
row.prop(bloom, "radius", text="Radius")
row = col.row()
row.prop(bloom, "threshold", text="Threshold")
row = col.row()
row.prop(bloom, "intensity", text="Intensity")
fog = world.fog_settings
row = layout.row()
box = row.box()
col = box.column()
col.label("Fog settings:")
row = col.row()
row.prop(fog, "start", text="Start")
row = col.row()
row.prop(fog, "end", text="End")
row = col.row()
row.prop(fog, "texture", text="Texture")
row = col.row()
row.prop(fog, "color", text="Color")
background = world.background_settings
row = layout.row()
box = row.box()
col = box.column()
col.label("Background settings:")
row = col.row()
row.prop(background, "mode", text="Mode")
row = col.row()
row.prop(background, "texture", text="Texture")
row = col.row()
row.prop(background, "color", text="Color")
vignette = world.vignette_settings
row = layout.row()
box = row.box()
col = box.column()
col.label("Vignette settings:")
row = col.row()
row.prop(vignette, "color", text="Color")
row = col.row()
row.prop(vignette, "coverage", text="Coverage")
row = col.row()
row.prop(vignette, "softness", text="Softness")
hdr = world.hdr_settings
row = layout.row()
box = row.box()
col = box.column()
col.label("HDR settings:")
row = col.row()
row.prop(hdr, "key", text="Key")
class DataPanel(bpy.types.Panel):
bl_label = "Avango-Blender"
bl_idname = "DATA_PT_b4a"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "data"
def draw(self, context):
layout = self.layout
cam = context.camera
if cam:
row = layout.row(align=True)
row.prop(cam, "ms_style", text="Mono/Sterio")
class CustomConstraintsPanel(bpy.types.OBJECT_PT_constraints):
def draw_constraint(self, context, con):
if con.type == "LOCKED_TRACK":
layout = self.layout
box = layout.box()
box.label("LOCKED_TRACK constraint reserved for " + con.name)
else:
global _OBJECT_PT_constraints
_OBJECT_PT_constraints.draw_constraint(self, context, con)
def add_remove_refl_plane(obj):
if obj.reflective:
#add reflection plane
bpy.ops.object.constraint_add(type="LOCKED_TRACK")
lods = obj.lods
index = len(lods)
obj.refl_plane_index = index
cons = get_locked_track_constraint(obj, index)
cons.name = "REFLECTION PLANE"
# disable fake LOCKED_TRACK constraint
cons.mute = True
else:
#remove reflection plane
index = obj.refl_plane_index
if index >= 0:
cons = get_locked_track_constraint(obj, index)
obj.constraints.remove(cons)
def register():
global _OBJECT_PT_constraints
bpy.utils.register_class(ScenePanel)
bpy.utils.register_class(WorldPanel)
bpy.utils.register_class(DataPanel)
_OBJECT_PT_constraints = bpy.types.OBJECT_PT_constraints
bpy.utils.unregister_class(bpy.types.OBJECT_PT_constraints)
bpy.utils.register_class(CustomConstraintsPanel)
def unregister():
global _OBJECT_PT_constraints
bpy.utils.unregister_class(ScenePanel)
bpy.utils.unregister_class(WorldPanel)
bpy.utils.unregister_class(DataPanel)
bpy.utils.unregister_class(CustomConstraintsPanel)
bpy.utils.register_class(_OBJECT_PT_constraints)