Skip to content

Parameters

lunazera edited this page Mar 27, 2024 · 10 revisions

Parameters in VNyan

Parameters in VNyan are names that can be assigned values. These values can then be accessed through the names by wrapping them in correct kind of brackets.

VNyan supports both numeric and text parameters. Most nodes in the application work only with specific type of parameters so pay attention to what parameter type you're supposed to use.

Most node input fields are able to take in parameters. For text fields (like parameter or blendshape names), use text parameters with angled brackets like this: <parameter>. You can also combine text strings with parameters within text fields (for example, if you wanted the id to be object[parameter]). For number fields, use number parameters with square brackets like this: [parameter].

Parameter Types

Numeric Parameters

The value of numeric parameters in VNyan can be accessed by putting the parameter name in square brackets like [example]. Numeric parameters default to value 0 so you'll be able to read parameter value even if it hasn't been initialized.

Timer Parameters

The value of active timers can be read with timer parameters. To access a timer's value you can use syntax like {example}. If the timer doesn't exist the parameter will return value of 0.

Text Parameters

Text or string parameters. The value of text parameters can be accessed with angle brackets like <example>.

If no parameter is set, then will return the name of the parameter when it is called elsewhere. For example, if the text parameter <text1> has no value set, then when you call it elsewhere it will return the text "<text1>".

Data Types

More complex data containers supporting multiple values. These will not appear in the Monitor.

Numeric Arrays

Arrays or lists with every entry being a numeric value.

Text Arrays

Arrays or lists with every entry being a text value.

Dictionaries

Container with key/value pairs. For instance, you could store chatter information by using the viewer's name as a key and store multiple values for relevant information for that chatter.

Converting Parameters

Certain Nodes allow conversion between parameter types. To convert text parameter to numeric parameter, the Set Parameter-node should be used. In a similar manner, Set Text Parameter-node can convert numeric parameter to text.

Built-in parameters

VNyan comes with various builtin parameters - some which contain value only when linked to a specific callback node. The help-file of each callback node contains information on which builtin parameters are supported.

  • [message] often contains numerical data related to the signalling callback node
  • [message2] may contain additional numerical data related to callback node
  • [message3] may contain additional numerical data related to callback node
  • [heartrate] contains the current heart rate
  • [heartpercent] percentage (0.0-1.0) of heart rate between 30-300
  • <username> contains user's name when signalled by twitch callback nodes
  • <message> contains text related to callback node. With Twitch nodes this is often the chat message
  • _gamepadrightx, _gamepadrighty contains x and y rotation of the Right Joystick
  • _gamepadleftx, _gamepadlefty contains x and y rotation of the Left Joystick
  • _righthandgesture, _lefthandgesture respond to different hand gestures (open hand, fist, thumbs up, pointy finger, gun, and rock-n-roll)

OSC Parameters

VNyan supports receiving parameters via OSC signals. You can send float (decimal) and string (text) parameters directly to VNyan from third party applications. The OSC receiver port can be set in Settings > Misc.

VNyan listens to either of these specific OSC-addresses:

  • /VNyan/Param/Float (name) (float value)
  • /VNyan/Param/String (name) (string value)

The first argument (name) will be the Parameter name that VNyan will store the value into. The second argument (value) will be the actual value stored in the parameter. The OSC-messages can also be bundled instead of being sent as individual messages. Note that the parameter name and value shouldn't be sent as part of the OSC-address, but as arguments.

VRChat OSC Parameters

VNyan will listen for incoming VRChat avater parameter through the OSC receiver, meaning many VRChat applications could be adapted to work with VNyan. This will occur automatically, and when working you should see these parameters show up in the monitor. This also will include sub-address hierarchies in the parameter name.

These OSC parameters would typically follow the following address formats:

  • /avatar/parameters/ParameterName (float value)
  • /avatar/parameters/sub-address/ParameterName (float value)

Hand Gestures

VNyan has hand gesture support that responds to your model's hands. It reads the local rotations of your left and right hands after tracking is applied, so it should be compatible across different types VR trackers. The detected gestures are stored in the builtin parameters _righthandgesture and _lefthandgesture.

Supported Hand Gestures

  • Open hand = 0
  • Fist = 1
  • Thumbs Up = 2
  • Finger Gun = 3
  • Pointy finger = 4
  • Rock-n-Roll/Devil horns = 5