-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathui.py
64 lines (57 loc) · 2.45 KB
/
ui.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
import bpy
class WATEREDITOR_PT_VIEW_PANEL(bpy.types.Panel):
bl_label = "Water Editor"
bl_idname = "WATEREDITOR_PT_VIEW_PANEL"
bl_category = "WaterEditor"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_order = 0
def draw(self, context):
layout = self.layout
row = layout.row()
row.operator("watereditor.open_filebrowser")
row = layout.row()
row.operator("watereditor.export_waterxml")
row = layout.row()
row.label(text="Liked the addon? Consider supporting me")
row = layout.row()
url_btn = row.operator('wm.url_open',
text='Donate',
icon='URL')
url_btn.url = 'https://ko-fi.com/ultrahacx'
class WATEREDITOR_PT_OBJECT_PANEL(bpy.types.Panel):
bl_label = "Water Editor"
bl_idname = "WATEREDITOR_PT_OBJECT_PANEL"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "object"
bl_options = {"DEFAULT_CLOSED"}
def draw(self, context):
layout = self.layout
layout.use_property_split = True
obj = context.active_object
row = layout.row()
row.enabled = False
if not obj:
layout.label(
text="No sollumz objects in scene selected.", icon="ERROR")
else:
if obj.gta_quadtype == 'water':
layout = self.layout
layout.prop(obj.waterProperties, 'water_type')
layout.prop(obj.waterProperties, 'water_is_invisible')
layout.prop(obj.waterProperties, 'water_has_limited_depth')
if obj.waterProperties.water_has_limited_depth == True:
layout.prop(obj.waterProperties, 'water_limited_depth')
layout.prop(obj.waterProperties, 'water_z')
layout.prop(obj.waterProperties, 'water_a1')
layout.prop(obj.waterProperties, 'water_a2')
layout.prop(obj.waterProperties, 'water_a3')
layout.prop(obj.waterProperties, 'water_a4')
layout.prop(obj.waterProperties, 'water_no_stencil')
elif obj.gta_quadtype == 'calming':
layout.prop(obj.waterProperties, 'water_fDampening')
elif obj.gta_quadtype == 'wave':
layout.prop(obj.waterProperties, 'water_amplitude')
layout.prop(obj.waterProperties, 'water_xDirection')
layout.prop(obj.waterProperties, 'water_yDirection')