forked from RadiatorSyrup/SplatoonImageGenerator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsplt_panel.py
170 lines (144 loc) · 5.95 KB
/
splt_panel.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
import bpy
class SPLT_PT_Panel_1(bpy.types.Panel):
# bl_idname = "splatoonpanel"
bl_label = "Basic settings"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Wiki Tools"
def draw(self, context):
layout = self.layout
box1 = layout.box()
box1.label(text="Game")
box1.prop(context.window_manager, "game_type", text="")
box2 = layout.box()
box2.label(text="Base armature")
box2.prop(context.window_manager, "objectselection_props", text="")
box3 = layout.row()
box3.label(text="Category")
box3.prop(context.window_manager, "wiki_language", text="")
class SPLT_PT_Panel_2(bpy.types.Panel):
# bl_idname = "splatoonpanel"
bl_label = "3D model"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Wiki Tools"
def draw(self, context):
layout = self.layout
class SPLT_PT_Panel_2_1(bpy.types.Panel):
# bl_idname = "splatoonpanel"
bl_parent_id = "SPLT_PT_Panel_2"
bl_label = "Mesh"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Wiki Tools"
bl_collapsed = False
def draw(self, context):
layout = self.layout
layout.operator("object.rotate_and_scale", icon = "DRIVER_ROTATIONAL_DIFFERENCE")
layout.operator("object.position_model", icon = "RESTRICT_SELECT_OFF")
class SPLT_PT_Panel_2_2(bpy.types.Panel):
# bl_idname = "splatoonpanel"
bl_parent_id = "SPLT_PT_Panel_2"
bl_label = "Textures"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Wiki Tools"
bl_collapsed = False
def draw(self, context):
layout = self.layout
layout.operator("object.fix_faces", icon = "MODIFIER_DATA")
class SPLT_PT_Panel_3(bpy.types.Panel):
# bl_idname = "splatoonpanel"
bl_label = "Camera"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Wiki Tools"
def draw(self, context):
layout = self.layout
layout.operator("object.position_camera", icon = "OUTLINER_OB_CAMERA")
box1 = layout.box()
box1.label(text="Model rotation")
box1.prop(context.window_manager, "x_rotations", text="Rotations by lap")
layout.operator("object.check_rotation", icon = "ORIENTATION_GIMBAL")
box2 = layout.box()
box2.label(text="File resolution")
row2 = box2.row()
row2.prop(context.window_manager, "x_resolution")
row2.prop(context.window_manager, "y_resolution")
class SPLT_PT_Panel_4(bpy.types.Panel):
# bl_idname = "splatoonpanel"
bl_label = "Environment"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Wiki Tools"
def draw(self, context):
layout = self.layout
layout.operator("object.add_hdri", icon = "MAT_SPHERE_SKY")
layout.operator("object.fix_lights", icon = "OUTLINER_OB_LIGHT")
class SPLT_PT_Panel_5(bpy.types.Panel):
# bl_idname = "splatoonpanel"
bl_label = "Output"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Wiki Tools"
def draw(self, context):
layout = self.layout
box1 = layout.box()
box1.label(text="Output folder")
box1.prop(context.window_manager, "output_folder", text="")
box2 = layout.box()
box2.label(text="Output format")
box2.prop(context.window_manager, "output_format", text="")
layout.operator("object.render_wiki", icon = "IMAGE_DATA")
class SPLT_PT_Panel_5_1(bpy.types.Panel):
# bl_idname = "splatoonpanel"
bl_parent_id = "SPLT_PT_Panel_5"
bl_label = "Advanced"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Wiki Tools"
bl_collapsed = True
def draw(self, context):
layout = self.layout
row1 = layout.row();
row1.prop(context.window_manager, "overwrite_files" , text="Overwrite files with number")
row1.prop(context.window_manager, "number_overwrite", text="")
layout.prop(context.window_manager, "delete_preview", text="Save preview image")
layout.prop(context.window_manager, "delete_tmp", text="Save temporary files")
class SPLT_PT_Panel_6(bpy.types.Panel):
# bl_idname = "splatoonpanel"
bl_label = "Manual"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Wiki Tools"
bl_collapsed = True
def draw(self, context):
layout = self.layout
layout.operator("wm.url_open", text="Manual",
icon='HELP', emboss=True).url = "https://splatoonwiki.org/wiki/Inkipedia:3D_Models"
class SPLT_PT_warning_panel(bpy.types.Panel):
bl_label = "Install Dependencies"
bl_category = "Wiki Tools"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
@classmethod
def poll(self, context):
return not context.window_manager.dependencies_installed
def draw(self, context):
layout = self.layout
lines = [f"Please install the missing dependencies for the PIL and numpy add-ons.",
f"1. Open the preferences (Edit > Preferences > Add-ons).",
f"2. Search for the Splatoon add-on.",
f"3. Open the details section of the add-on.",
f"4. Click on the Install button.",
f" This will download and install the missing Python packages, if Blender has the required",
f" permissions.",
f"",
f"If you're attempting to run the add-on from the text editor, you won't see the options described",
f"above. Please install the add-on properly through the preferences.",
f"1. Open the add-on preferences (Edit > Preferences > Add-ons).",
f"2. Press the \"Install\" button.",
f"3. Search for the add-on file.",
f"4. Confirm the selection by pressing the \"Install Add-on\" button in the file blayoutser."]
for line in lines:
layout.label(text=line)