-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathdocs.html
639 lines (633 loc) · 27.8 KB
/
docs.html
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
<html>
<head>
<title>Thry Editor Documentation</title>
<style>
body {
font-family: Verdana;
}
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, tr, td {
padding: 7px;
}
h2 {
text-decoration: underline;
}
div {
border: 1px solid black;
border-collapse: collapse;
padding: 7px;
}
.noborder{
border: 0px solid black;
}
</style>
<head>
<body>
<h2>Editor Properties</h2>
<table>
<tr>
<th>Name</th>
<th>Effect</th>
<th>Required</th>
<th>Example</th>
</tr>
<tr>
<td>shader_master_label</td>
<td>Display name customizes the gui header</td>
<td>No</td>
<td>[HideInInspector] shader_master_label ("<color =#ff0000ff>❤</color> <color =#000000ff>Poiyomi Toon Shader V4.0</color> <color =#ff0000ff>❤</color>", Float) = 0</td>
</tr>
<tr>
<td>shader_properties_label_file</td>
<td>If specified the editor tries to load property's display names out of this file</td>
<td>No</td>
<td>[HideInInspector] shader_properties_label_file ("poiToonLabels", Float) = 0</td>
</tr>
<tr>
<td>shader_properties_locale</td>
<td>Is used to specify a locale file and locale selector. Specify "locale::<string>" anywhere to load a string from the locale file.</td>
<td>No</td>
<td>[HideInInspector] shader_properties_locale ("locale::locale--{file_name:locale_file_name}", Float) = 0</td>
</tr>
<tr>
<td>shader_on_swap_to</td>
<td>Is used to specify actions to be executed when the material is switched to this shader.</td>
<td>No</td>
<td>[HideInInspector] shader_on_swap_to ("--{actions:[{type:SET_PROPERTY,data:_ZWrite=1},{type:SET_PROPERTY,data:_CullBack=0}]}", Float) = 0</td>
</tr>
<tr>
<td>footer_<string></td>
<td>Adds a footer button to the bottom of the ui. Multiple footers can be added to one shader. The displayname has to be a ButtonData object</td>
<td>No</td>
<td>
[HideInInspector] footer_github ("{text:Github,action:{type:URL,data:https://github.com/thryrallo/thryeditor}}", Float) = 0<br />
[HideInInspector] footer_discord ("{texture:{name:discord-icon,height:40},action:{type:URL,data:https://discord.gg}}", Float) = 0
</td>
</tr>
<tr class="noborder"><td class="noborder"></td></tr>
<tr>
<td>DSGI</td>
<td>add this property for double sided illumination settings to be shown</td>
<td>No</td>
<td>[HideInInspector] DSGI ("", Float) = 0</td>
</tr>
<tr>
<td>Instancing</td>
<td>add this property for instancing variants settings to be shown</td>
<td>No</td>
<td>[HideInInspector] Instancing ("", Float) = 0</td>
</tr>
<tr>
<td>LightmapFlags</td>
<td>add this property for lightmap flags settings to be shown</td>
<td>No</td>
<td>[HideInInspector] LightmapFlags ("", Float) = 0</td>
</tr>
<tr class="noborder"><td class="noborder"></td></tr>
<tr>
<td>m_<string></td>
<td>starts a dropdown menu. all properties underneath, till the next menu is specified, are in this menu</td>
<td>No</td>
<td>[HideInInspector] m_mainOptions ("Main", Float) = 0</td>
</tr>
<tr>
<td>m_start_<string></td>
<td>starts a dropdown menu. all properties underneath, till this menu's end is specified, are in this menu. use if you want to layer menus.</td>
<td>No</td>
<td>[HideInInspector] m_start_Alpha ("Alpha Options", Float) = 0</td>
</tr>
<tr>
<td>m_end_<string></td>
<td>ends a dropdown menu that has been started with m_start_<string></td>
<td>No</td>
<td>[HideInInspector] m_end_Alpha ("", Float) = 0</td>
</tr>
<tr>
<td>g_start_<string></td>
<td>starts a group. properties are grouped together. not visible to the user. can be used to hide multiple properties with one condition specification.</td>
<td>No</td>
<td>[HideInInspector] g_start_blending ("--{condition_show:{type:PROPERTY_BOOL,data:_DisplayBlending}}", Float) = 0</td>
</tr>
<tr>
<td>g_end_<string></td>
<td>ends a group that has been started with g_start_<string></td>
<td>No</td>
<td>[HideInInspector] g_start_blending ("", Float) = 0</td>
</tr>
</table>
<h3>Suggestions:</h3>
<table>
<tr>
<th>Name</th>
<th>Description</th>
<th>Example</th>
</tr>
<tr>
<td>Variant Selector</td>
<td>Use a commbination of Enum and on_value_actions to create a varian selector</td>
<td>
[Enum(Cutout,0,Transparent,1)]variant_selector("Variant--{on_value_actions:[{value:0,actions:[{type:SET_PROPERTY,data:_ZWrite=1},{type:SET_SHADER,data:Thry/Example 1}]},{value:1,actions:[{type:SET_PROPERTY,data:_ZWrite=0},{type:SET_SHADER,data:Thry/Example 2}]}]}",Float) = 0
</td>
</tr>
</table>
<h2>Drawers</h2>
<table>
<tr>
<th>Drawer Name</th>
<th>Effect</th>
<th>Extra Property Options</th>
<th>Example</th>
</tr>
<tr>
<td>[SmallTexture]</td>
<td>Creates a texture field that will always be small</td>
<td></td>
<td>[SmallTexture]_MainTex("Main Texture",2D)= "white" { }</td>
</tr>
<tr>
<td>[BigTexture]</td>
<td>Creates a texture field that will always be big</td>
<td></td>
<td>[BigTexture]_MainTex("Main Texture",2D)= "white" { }</td>
</tr>
<tr>
<td>[StylizedBigTexture]</td>
<td>Creates a texture field that will always be big but stylized differently</td>
<td></td>
<td>[StylizedBigTexture]_MainTex("Main Texture",2D)= "white" { }</td>
</tr>
<tr>
<td>[Gradient]</td>
<td>
Creates a texture field with a gradient field next to it.
<br /> Gradient is automatically converted to texture.
</td>
<td></td>
<td>[Gradient]_ColorRamp("Color Ramp",2D)= "white" { }</td>
</tr>
<tr>
<td>[MultiSlider]</td>
<td>
Creates a slider for a range.
<br />Is used with a vector property.
<br />x and y are the slider values. z is slider minimum. w is slider maximum.
</td>
<td></td>
<td>[MultiSlider]_Slider("Multi Slider",Vector)= (0.1,0.9,0,1)</td>
</tr>
<tr>
<td>[TextureArray]</td>
<td>Creates field that accepts Texture Arrays</td>
<td></td>
<td>[TextureArray]_FlipbookTexArray ("Texture Array", 2DArray) = "" {}</td>
</tr>
<tr>
<td>[Vector2]</td>
<td>Creates a Vector 2 field</td>
<td></td>
<td>[Vector2]_Vector("Vector with 2 values",Vector)= (0,0,0,0)</td>
</tr>
<tr>
<td>[Vector3]</td>
<td>Creates Vector 3 field</td>
<td></td>
<td>[Vector3]_Vector("Vector with 3 values",Vector)= (0,0,0,0)</td>
</tr>
<tr>
<td>[Curve]</td>
<td>Creates a curve field</td>
<td></td>
<td>[Curve]_ColorCurve("Curve",2D)= "white" { }</td>
</tr>
<tr>
<td>[Helpbox]</td>
<td>Creates an info box</td>
<td></td>
<td>[Helpbox]_MainHelpbox("This is the text inside the info box",Float)= 0</td>
</tr>
</table>
<h2>Supported Default Unity Flags</h2>
<table>
<tr>
<th>Name</th>
<th>Effect</th>
</tr>
<tr>
<td>[NoScaleOffset]</td>
<td></td>
</tr>
<tr>
<td>[Normal]</td>
<td></td>
</tr>
<tr>
<td>[Space]</td>
<td></td>
</tr>
<tr>
<td>[Space(Int)]</td>
<td></td>
</tr>
<tr>
<td>[Toggle()]</td>
<td></td>
</tr>
</table>
<h2>Property Options</h2>
<b>
None of the poperty options are required.<br />
Options are defined in the display name of a property inside curly brackets and after "--":<br />
In practice:
</b><br /> _Tex("Texture--{Put all your options in here}",2D) = "white" { }<br />
_Tex("Texture--{offet:2,hover:read this on hover,altClick{type:URL,data:http://thryrallo.de}}",2D) = "white" { }<br />
<font color="red">
Use json syntax instead to future proof your properties!<br />
You can use '' instead of " inside property display names
</font><br />
Example:<br />
{''text'':''Youtube'',''action'':{''type'':''URL'',''data'':''https://www.youtube.com/''}
<table>
<tr>
<th>Name</th>
<th>Value Type</th>
<th>Effect</th>
<th>Drawer Specific</th>
<th>Example</th>
</tr>
<tr>
<td>offset</td>
<td>int</td>
<td>adds an extra x-offset to the property</td>
<td>No</td>
<td>_Tex("Texture--{offset:1}",2D) = "white" { }</td>
</tr>
<tr>
<td>tooltip</td>
<td>string</td>
<td>text that is shown when hovering above property</td>
<td>No</td>
<td>_Tex("Texture--{tooltip:use this texture for albedo}",2D) = "white" { }</td>
</tr>
<tr>
<td>altClick</td>
<td>Action</td>
<td>performs an action when holding alt down and clicking on property</td>
<td>No</td>
<td>_Tex("Texture--{altClick:{type:URL,data:http://thryrallo.de}}",2D) = "white" { }</td>
</tr>
<tr>
<td>condition_show</td>
<td>Condition</td>
<td>let's you define a condition that has to be true for this property to be shown in the ui</td>
<td>No</td>
<td>_Tex("Texture--{condition_show:{type:PROPERTY_BOOL,data:_ForceOpaque==1}}",2D) = "white" { }</td>
</tr>
<tr>
<td>condition_enable</td>
<td>Condition</td>
<td>let's you define a condition that has to be true for this property to be enabled</td>
<td>No</td>
<td>_Tex("Texture--{condition_enable:{type:PROPERTY_BOOL,data:_ForceOpaque==1}}",2D) = "white" { }</td>
</tr>
<tr>
<td>on_value_actions</td>
<td>PropertyValueAction[]</td>
<td>let's you define a actions that happen if this property is set to a specfiic value.</td>
<td>No</td>
<td>
[Enum(Cutout,0,Transparent,1)]variant_selector("Variant--{on_value_actions:[{value:0,actions:[{type:SET_PROPERTY,data:_ZWrite=1},{type:SET_SHADER,data:Thry/Example 1}]},{value:1,actions:[{type:SET_PROPERTY,data:_ZWrite=0},{type:SET_SHADER,data:Thry/Example 2}]}]}",Float) = 0
</td>
</tr>
<tr>
<td>button_right</td>
<td>Button</td>
<td>let's you define a button that is shown on the side of a dropdown header</td>
<td>Yes, only headers</td>
<td>_Tex("Texture--{button_right:{text:Test Button,action:{type:URL,data:https://github.com/Thryrallo/thryeditor},hover:hover text,condition_show:{type:PROPERTY_BOOL,data:_ShowButtonOnMenus}}}",2D) = "white" { }</td>
</tr>
<tr>
<td>texture</td>
<td>TextureData</td>
<td>Defines the texture settings for created textures.</td>
<td>[Gradient],[Curve]</td>
<td>[Gradient]_ColorRamp ("Gradient --{texture:{width:256,height:16,filterMode:Point,wrapMode:Clamp}}", 2D) = "white" { }<br />[Curve]_MainTex ("Texture --{image:{width:256,height:16,channel:b}}", 2D) = "white" { }</td>
</tr>
<tr>
<td>force_texture_options</td>
<td>bool</td>
<td>Default: false. Set this to true to hide the texture options and force your defined texture settings.</td>
<td>[Gradient]</td>
<td>[Gradient]_ColorRamp ("Gradient --{texture:{width:256,height:16,filterMode:Point,wrapMode:Clamp},force_texture_options:true}", 2D) = "white" { }</td>
</tr>
<tr>
<td>hide_in_inspector</td>
<td>bool</td>
<td>Default: false. Set this to true to hide the property in ThryEditor, but not the unity default inspector. Usefull if you already display the options in a texture dropdown or Foldout Header.</td>
<td>No</td>
<td>_Toogle ("Gradient Lighting--{texture:{hide_in_inspector:true}}", Int) = 0</td>
</tr>
<tr>
<td>reference_properties</td>
<td>string[]</td>
<td>Default: null. specified properties will be drawn in texture foldout menu</td>
<td>Texture</td>
<td>_Texture("Panning Texture --{reference_properties:[_PanSpeed,_PanUV]}", 2D) = "white" { }</td>
</tr>
<tr>
<td>reference_property</td>
<td>string</td>
<td>Specifies a property by it's name. </br>
If defined on a menu header, it will create a toggle linked with the referenced property. </br>
If defined on a TextureArray it will fill this float property with the texture array depth (frame count) after creating an array from a gif or multiple images.</br>
If defined on a texture property it will draw this property next to the texture property (for example for a color field)</td>
<td>[TextureArray],Texture,MenuHeader</td>
<td>Light and Shadow--{reference_property:_EnableLighting}<br />[TextureArray]_Texture("Animated Texture --{reference_property:_FrameCount}", 2DArray) = { }</td>
</tr>
<tr>
<td>is_hideable</td>
<td>bool</td>
<td>If set to true, property will be able to be hidden using the little eye icon in the top right of the inspector.</td>
<td>MenuHeaders</td>
<td>[HideInInspector] m_vertex("Vertex Options--{button_right:{text:Tutorial,action:{type:URL,data:https://www.youtube.com/watch?v=FO-bxI5znI0},hover:YouTube},is_hideable:true}", Float) = 0</td>
</tr>
<tr>
<td>is_hidden_default</td>
<td>bool</td>
<td>If set to true and property is hideable, the property will be hidden by default.</td>
<td>MenuHeaders</td>
<td>[HideInInspector] m_vertex("Vertex Options--{button_right:{text:Tutorial,action:{type:URL,data:https://www.youtube.com/watch?v=FO-bxI5znI0},hover:YouTube},is_hideable:true,is_hidden_default:true}", Float) = 0</td>
</tr>
</table>
<h2>Data Structures</h2>
<div>
<h3>Button</h3>
Variables:
<table>
<tr>
<th>Name</th>
<th>Value Type</th>
<th>required</th>
<th>default</th>
</tr>
<tr>
<td>text</td>
<td>string</td>
<td>text or texture</td>
<td></td>
</tr>
<tr>
<td>texture</td>
<td>TextureData</td>
<td>text or texture</td>
<td></td>
</tr>
<tr>
<td>hover</td>
<td>string</td>
<td>no</td>
<td></td>
</tr>
<tr>
<td>action</td>
<td>Action</td>
<td>kinda</td>
<td></td>
</tr>
<tr>
<td>condition_show</td>
<td>Condition</td>
<td>no</td>
<td></td>
</tr>
</table>
</div>
<div>
<h3>PropertyValueAction</h3>
Variables:
<table>
<tr>
<th>Name</th>
<th>Value Type</th>
<th>required</th>
</tr>
<tr>
<td>value</td>
<td>string</td>
<td>Yes</td>
</tr>
<tr>
<td>actions</td>
<td>Action[]</td>
<td>Yes</td>
</tr>
</table>
<h3>Action</h3>
Variables:
<table>
<tr>
<th>Name</th>
<th>Value Type</th>
<th>required</th>
</tr>
<tr>
<td>type</td>
<td>ActionType</td>
<td>Yes</td>
</tr>
<tr>
<td>data</td>
<td>string</td>
<td>Yes</td>
</tr>
</table>
<h3>Enum: ActionType</h3>
States:
<table>
<tr>
<th>Value</th>
<th>Effect</th>
<td>Example</td>
</tr>
<tr>
<td>URL</td>
<td>Opens the url in browser</td>
<td>{type:URL,data:https://github.com/Thryrallo/thryeditor}</td>
</tr>
<tr>
<td>SET_PROPERTY</td>
<td>Sets the value of a specified property.</td>
<td>{type:SET_PROPERTY,data:_ZWrite=1}</td>
</tr>
<tr>
<td>SET_SHADER</td>
<td>Changes the shader of the material.</td>
<td>{type:SET_SHADER,data:Thry/Example 1}</td>
</tr>
</table>
</div>
<div>
<h3>TextureData</h3>
Variables:
<table>
<tr>
<th>Name</th>
<th>Value Type</th>
<th>required</th>
<th>default</th>
<th>Explanation</th>
</tr>
<tr>
<td>name</td>
<td>string</td>
<td>no</td>
<td></td>
<td>File name of image</td>
</tr>
<tr>
<td>width</td>
<td>int</td>
<td>no</td>
<td>128</td>
<td></td>
</tr>
<tr>
<td>height</td>
<td>int</td>
<td>no</td>
<td>128</td>
<td></td>
</tr>
<tr>
<td>channel</td>
<td>char</td>
<td>no</td>
<td>r</td>
</tr>
<tr>
<td>ansioLevel</td>
<td>int</td>
<td>no</td>
<td>1</td>
<td></td>
</tr>
<tr>
<td>filterMode</td>
<td>Enum(FilterMode)</td>
<td>no</td>
<td>Bilinear</td>
<td>EnumValues: Bilinear,Point,Trilinear</td>
</tr>
<tr>
<td>wrapMode</td>
<td>Enum(TextureWrapMode)</td>
<td>no</td>
<td>Repeat</td>
<td>EnumValues: Clamp,Mirror,MirrorOnce,Repeat</td>
</tr>
</table>
</div>
<div>
<h3>Condition</h3>
Variables:
<table>
<tr>
<th>Name</th>
<th>Value Type</th>
<th>required</th>
<th>default</th>
</tr>
<tr>
<td>type</td>
<td>ConditionType</td>
<td>Yes</td>
<td>None</td>
</tr>
<tr>
<td>data</td>
<td>string</td>
<td>If type!=AND && type!=OR yes</td>
<td></td>
</tr>
<tr>
<td>condition1</td>
<td>Condition</td>
<td>if type==AND || type==OR yes</td>
<td>null</td>
</tr>
<tr>
<td>condition2</td>
<td>Condition</td>
<td>if type==AND || type==OR yes</td>
<td>null</td>
</tr>
</table>
Data will have different meanings depending on type<br />
<br />
<b>Data</b><br />
Useable Comparators: ==,!=,>,<
<table>
<tr>
<th>type</th>
<th>data value</th>
<th>example</th>
</tr>
<tr>
<td>PROPERTY_BOOL</td>
<td><PropertyName>(<Comparator><value>)?</td>
<td>{type:PROPERTY_BOOL,data:_ForceOpaque}<br />or {type:PROPERTY_BOOL,data:_ForceOpaque==0}</td>
</tr>
<tr>
<td>EDITOR_VERSION</td>
<td><Comparator><value></td>
<td>{type:EDITOR_VERSION,data:>0.17} #checks if installed editor version > 0.17</td>
</tr>
<tr>
<td>VRC_SDK_VERSION</td>
<td><Comparator><value></td>
<td>{type:VRC_SDK_VERSION,data:>0.17} #checks if installed vrc sdk version > 0.17</td>
</tr>
<tr>
<td>TEXTURE_SET</td>
<td><PropertyName></td>
<td>{type:TEXTURE_SET,data:_ToonRamp} #checks if texture _ToonRamp is set</td>
</tr>
<tr>
<td>DROPDOWN</td>
<td><PropertyName><Comparator><value></td>
<td>{type:DROPDOWN,data:_LightingType==2} #checks if property _LightingType has enum 2 selected</td>
</tr>
</table>
<h3>Enum: ConditionType</h3>
States:
<table>
<tr>
<th>Value</th>
<th>Effect</th>
</tr>
<tr>
<td>AND</td>
<td>Combines two conditions with &&</td>
</tr>
<tr>
<td>OR</td>
<td>Combines two conditions with ||</td>
</tr>
<tr>
<td>PROPERTY_BOOL</td>
<td>checks agains the float value of a property</td>
</tr>
<tr>
<td>EDITOR_VERSION</td>
<td>checks agains the version number of ThryEditor</td>
</tr>
<tr>
<td>VRC_SDK_VERSION</td>
<td>checks agains the version number of the VRC SDK</td>
</tr>
</table>
</div>
</body>
</html>