3. Editor DLC - PiPuProductions/VBridger-Documentation GitHub Wiki
The Editor DLC replaces the center panel with the editor. The top left has the name of the file being edited, and the bottom middle of the program shows where the file is located on your PC.
Basic Use
Parameters created in VBridger allow you to modify Input data to create new Outputs. This is done through equations and logic, all the supported functions can be found in the Supported Mathematical Functions section. Parameters in the Editor can be moved around by dragging the grey tab on the left of the box, and Opened by clicking the arrow.
Click a parameter to select it in order to edit it's output modifiers and curve. The modifiers are explained in [E. Modifiers]
Create a new parameter by clicking the Add New Output button. It will be automatically selected.
You may use the search box at the top to search for any parameter names. Hit the X to clear it.
The Equation Editor
The basics of entering equations is to type in the input parameters, math, operators, or numbers you want to use and click outside or hit enter. If the equation is not valid, the space will turn red. Valid Parameters will turn green, operators turn red, and functions remain as blue. see here for more details on VBridger Math
Vector Mode
This parameter mode is specifically for VMC Support which requires 3D Vectors for some parameters. These parameters can still be accessed for use as Parameters as well as sent to VTS. Their format is the Parameter name plus X, Y, and Z. so if a parameter was named Body, the 3 outputs would be BodyX, BodyY, and BodyZ. Modifiers will effect all outputs created by Vector Mode parameters the same.
Supported Mathematical Functions
Mathmatical symbols supported
- + add
- - subtract
- * multiply
- /divide
- ^ exponent
- () parentheses
- '' single quotes
Algebraic Mathmatical functions
The following are normal algebraic functions that work about how you'd expect
- sin(x) - sine function
- cos(x) - cosine function
- tan(x) - tangent function
- asin(x) - arcsine function
- acos(x) - arccosine function
- atan(x) - arctangent function
- atan2(x,y) - alternative arctangent function
- sinh(x) - hyperbolic sine function
- cosh(x) - hyperbolic cosine function
- tanh(x) - hyperbolic tangent function
- abs(x) - absolute value
- sqrt(x) - square root of x
- log(x) - natural logarithm of x
- log10(x) - base 10 logarithm of x
- exp(x) - e raised to the power of x
Other Math Functions
The following are useful helper math functions
- round(x) - rounds x to the nearest whole number
- floor(x) - rounds x down to the nearest whole number
- ceil(x) - rounds x up to the nearest whole number
- sign(x) - returns the sign of x as: positive 1, negative -1, or 0
- min(x,y) - returns the smaller value between x and y
- max(x,y) - returns the larger value between x and y
- clamp(x,l,h) - clamps x to the range of low l to high h.
- approx(x,y,d) - finds if x and y are approximatly within delta d of each other. returns 1 if true and 0 if false
- lerp(x,y,t) - linear interpolation between x and y using t
Other Functions
- rand(x,y) - pseudo random number between the range of x and y
- time(i,m) - at the moment, time(i,m) is a counter that increments from 0 to max m in steps of increment i at 60fps before resetting. not an accurate time function. Subject to change.
- if(c,t,f) - logical if. conditional c should be inside single quotes ''. if c is true returns t, if c is false returns f. Supports complex conditionals with && and ||\ It is best to put individual conditions inside parenthesis like
((cheekPuff-0.1)>0.5)&&(mouthClose>0.8)
optional: if t or f are in single quotes '', they will not be processed until after the conditions are checked. subject to change.