res-avatar-unity/Assets/_PoiyomiShaders/Scripts/ThryEditor/docs.html

640 lines
28 KiB
HTML
Raw Normal View History

2023-07-16 02:51:23 +00:00
<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 ("&lt;color =#ff0000ff>❤&lt;/color> &lt;color =#000000ff>Poiyomi Toon Shader V4.0&lt;/color> &lt;color =#ff0000ff>❤&lt;/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::&lt;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_&lt;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_&lt;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_&lt;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_&lt;string></td>
<td>ends a dropdown menu that has been started with m_start_&lt;string></td>
<td>No</td>
<td>[HideInInspector] m_end_Alpha ("", Float) = 0</td>
</tr>
<tr>
<td>g_start_&lt;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_&lt;string></td>
<td>ends a group that has been started with g_start_&lt;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>&lt;PropertyName>(&lt;Comparator>&lt;value>)?</td>
<td>{type:PROPERTY_BOOL,data:_ForceOpaque}<br />or {type:PROPERTY_BOOL,data:_ForceOpaque==0}</td>
</tr>
<tr>
<td>EDITOR_VERSION</td>
<td>&lt;Comparator>&lt;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>&lt;Comparator>&lt;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>&lt;PropertyName></td>
<td>{type:TEXTURE_SET,data:_ToonRamp} #checks if texture _ToonRamp is set</td>
</tr>
<tr>
<td>DROPDOWN</td>
<td>&lt;PropertyName>&lt;Comparator>&lt;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>