VNyan SDK - NeocortexVT/VNyanDocFork GitHub Wiki

The VNyan SDK is used to turn your Unity projects into assets for VNyan. With the SDK, you can create props, worlds, plugins, and more. The VNyan SDK can also be used to convert VRM avatars to vsfavatar files. The VNyan SDK furthermore contains components needed for certain assets, and special components that give you additional control over your assets while using VNyan.

You can find the VNyan SDK under downloads on our Itch page. Once downloaded and extracted, you can add the SDK to your unity project by importing the .unitypackage file. When using the VNyan SDK, it is recommended to work in Unity version: Unity 2020.3.48 with UniVRM 0.104. Issues may arise when the VNyan SDK is used with other versions of Unity or uniVRM.

Converting Custom Assets for VNyan

Droppable items are items that can be dropped onto your avatar. These can be used to set up toggles, redeems or other effects, so that a specified number of these objects drop onto your avatar when triggered. Droppable objects can be configured to trigger other effects on collision. VNyan droppable items are .vndrop files.

To convert a Unity GameObject to a VNyan droppable object, first import the VNyan SDK to your Unity project. Then, you must make sure the GameObject you want to convert is placed in a new, empty GameObject. Next, attach a VNyan Droppable Object component, as well as a Unity Rigid Body component to the top-level, empty GameObject. Then select the top-level GameObject, open the VNyan SDK dropdown menu in the menu bar at the top of the screen and select Export Droppable.

If you want the object to collide with your avatar or other objects, you must also add a collider component (either a Box or Capsule collider). You will need to set a Physic Material for the collider as well. If you want audio to play upon collision, you can add an Audio Source. You can set a separate game object to render on collision, allowing you to set up particle effects. You can also set whether the object should be sticky and whether they will destroy when colliding with your avatar or another object.

Droppable objects can collide with each other, meaning that they can pile up on top of each other over time. When making a droppable object, don't include other conflicting scripts on the object (like the Throwable Object script), otherwise collision with other dropped items might not function properly.

Throwable items are items that can be thrown at your avatar. These can be used to set up toggles, redeems or other effects, so that a specified number of these objects are thrown at your avatar when triggered. Throwable items can be configured to trigger other effects on collision. VNyan throwable items are .vnthrow files.

To convert a Unity GameObject to a VNyan throwable object, first import the VNyan SDK to your Unity project. Then, you must make sure the GameObject you want to convert is placed in a new, empty GameObject. Next, attach a VNyan Throwable Object component, as well as a Unity Rigid Body component and a collider component (either a Box or Capsule collider) to the top-level, empty GameObject. Then select the top-level GameObject, open the VNyan SDK dropdown menu in the menu bar at the top of the screen and select Export Throwable.

If you want audio to play upon collision, you can add an Audio Source. You can set a separate game object to render on collision, allowing you to set up particle effects. You can also set whether the object should be sticky and whether they will destroy when colliding with your avatar or another object.

Throwable objects can collide with each other do not collide with each other by default due to the way these items spawn. Throwable items can be made to collide with other items by adding a Set Layer component to the object with the layer set to 10 (Droppable).

Edible items are items that can be eaten by your avatar. The item is eaten when it is made to collide with your avatar's mouth collider. Edible items can be configured to trigger other effects on consumption. VNyan edible items are .vnnom files.

To convert a Unity GameObject to a VNyan edible item, first import the VNyan SDK to your Unity project. Then, you must make sure the GameObject you want to convert is placed in a new, empty GameObject. Next, attach a VNyan Edible Item component, as well as a collider component (either a Box or Capsule collider) to the top-level, empty GameObject. Then select the top-level GameObject, open the VNyan SDK dropdown menu in the menu bar at the top of the screen and select Export Edible.

If you want audio to play upon eating the item, you can add an Audio Source. You can set a separate game object to render on consumpion, allowing you to set up particle effects.

Community Note: This section requires expansion.

Props are objects that are linked to one of your avatar's bones. These could, for example, be glasses for your avatar that can be toggled on and off. VNyan props are .vnprop files.

To convert a Unity GameObject to a VNyan prop item, first import the VNyan SDK to your Unity project. Then, you must make sure the GameObject you want to convert is placed in a new, empty GameObject. Then select the top-level GameObject, open the VNyan SDK dropdown menu in the menu bar at the top of the screen and select Export Prop. No special components are required for prop exports, but optional ones may be added.

Custom Objects

Custom Objects are asset bundles that can be spawned into your VNyan scene. They are recognized by their .vnobj extension. Custom Objects have no requirements or restrictions in what can be done with them. Custom Objects do not have any component requirements or restrictions.

Custom Objects can be used to initialize plugins. For this, the core component of the plugin must be attached to the Custom Object and contain the functions required to initialize plugins. In this case, the Custom Object is typically an empty gameobject, though if the plugin requires a UI, the UI object may be parented to the empty game object.

Injected animations are animations that describe bone movements of a humanoid avatar. They do not contain any specific information on the mesh or bone shapes, and so can be applied to any model with the humanoid armature. VNyan injected animations are stored as .vnanim files.

To create injected animations, create a Unity Humanoid Animation file of the desired animation first. Then create an empty GameObject, and attach the Injected Animation component to it. Provide a name for the animation that is used in VNyan to select the animation and add a reference to the Unity Humanoid Animation file. Then select the GameObject, open the VNyan SDK dropdown menu in the menu bar at the top of the screen and select Export Injected Anim.

Bone Rotations as JSON

VNyan's Set Pose node utilizes bone rotation data in JSON format to assign poses to humanoid bones.

Community Note: This section requires expansion, including instructions and limitations for the pose data that can be exported.

Export VSFavatar for VNyan

This option can be used to export .vsfavatar files for VNyan with requiring the VSF SDK. .vsfavatar files are VRM-based models, but unlike VRM files, can contain custom shaders, among other features. Contrary to the VSF SDK export, VNyan's .vsfavatar export does not rely on a whitelist, and so custom components are not removed from your avatar. This can be used to create custom behavior through VNyan plugins

VNyan Components

The following is an overview of all of the VNyan SDK's custom components, their function and their settings.

Anim Param Link

This component is used to link VNyan parameters to the float parameters of an animator. You can use these parameters to control blendtrees.

Name Type Description
VNyan Parameter Name String The name of the parameter in VNyan that should be linked with the animator.
Animator Parameter Name String The name of the parameter in the animator that should be linked with the given VNyan parameter.
Animator Animator The animator object that needs to be controlled with the given VNyan parameter.
Update Mode - Indicate at which events the Animator Parameter value should be updated. This setting has three options:
  • Every Frame - The Animator parameter is updated every frame (default).
  • On Enable - Update the Animator Parameter when the animation is triggered.
  • On Awake - Update the Animator Parameter only when the animated object is first loaded in.

Avatar Bone Follower

This component is used to link a GameObject asset's movement to the movement of a specific humanoid bone of the loaded avatar.

Name Type Description
Link Bone Bone Select which bone the GameObject's movement is linked to.
Link Scale Bool Toggle whether the GameObject should copy the linked bone's scale transformations.
Link Rotation Bool Toggle whether the GameObject should copy the linked bone's global rotation transformations (i.e. rotation relative to the world origin).
Link Local Rotation Bool Toggle whether the GameObject should copy the linked bone's local rotation transformations (i.e. rotation relative to the parent bone).
Link Position Bool Toggle whether the GameObject should copy the linked bone's position transformations.

Avatar Object Follower

This component links the GameObject's transform to the transform of a specific GameObject found inside the loaded Avatar (e.g. a non-humanoid bone).

Name Type Description
Link Game Object Name String The name of the GameObject on the avatar that your GameObject should be linked to.
Link Scale Bool Toggle whether the GameObject should copy the linked GameObject's scale transformations.
Link Rotation Bool Toggle whether the GameObject should copy the linked GameObject's global rotation transformations.
Link Position Bool Toggle whether the GameObject should copy the linked GameObject's global position transformations.

Avatar Transform Link

Links the loaded avatar to the position and/or rotation of the GameObject (your avatar will follow this GameObject). This can be used to create animations that move your avatar around.

Name Type Description
Link Position Bool Toggle whether your avatar should follow the GameObject's position transformations.
Link Rotation Bool Toggle whether your avatar should follow the GameObject's global rotation.

Blendshape Param Link

This component links the blendshape value of a mesh's blendshape on the attached GameObject to a parameter in VNyan. This component can be used to control blendshapes of non-Avatar meshes.

Name Type Description
VNyan Parameter Name String The name of the parameter used in VNyan to control the mesh blendshape.
Blendshape Name String The name of the blendshape on the mesh to be controlled by the specified parameter.
Mesh SkinnedMeshRenderer The SkinnedMeshRenderer component of the target mesh.
Update Mode - Indicate at which events the Blendshape Parameter value should be updated. This setting has three options:
  • Every Frame - The Blendshape parameter is updated every frame (default).
  • On Enable - Update the Blendshape Parameter when the mesh is triggered.
  • On Awake - Update the Blendshape Parameter only when the blendshape mesh is first loaded in.

Call VNyan Trigger

This component will make the GameObject call a Trigger-callback node in VNyan's Node Graph whenever the GameObject is set to active (e.g. using the Object Visibility node).

Name Type Description
Trigger Name String The name of the trigger to call, as used in VNyan.

Camera Look At

This component will force the GameObject to which it is attached to always face the camera. The side of the GameObject that faces the Game camera in Unity will be the side facing the camera in VNyan.

This component has no values that can be adjusted.

Droppable Object

This script must be included on your game object to export the prop as a droppable object (with the extension .vndrop), together with a rigid body component.

Name Type Description
Collision Particle Prefab GameObject A prefab of a GameObject with particle effects. These particle effects will play when the droppable object collides with another object.
Destroy On Collision Bool Toggle whether the droppable object should despawn upon colliding with another object. The object despawns after any attached particle effect is triggered, so particles will still spawn if the droppable object is destroyed.
Object Is Sticky Bool Toggle whether the droppable object should stick to objects it collides with.

Edible Item

This script must be included on your game object to export the prop as an edible item (with the extension .vnnom), together with a collider component.

Name Type Description
Eat Particle GameObject A prefab of a GameObject with particle effects that play when the edible object is eaten.

Injected Anim

This script is used to create vnanim-files. This component must be attached to an empty GameObject.

Name Type Description
Animation Name String Name of the animation used in VNyan.
Animation Clip Animation Clip A Unity Humanoid anim-file that should be imposed onto your avatar when playing the animation.

Orientation Trigger

This script will trigger Unity Events based on the orientation of the GameObject it is attached to, relative to world space.

Name Type Description
Transform Vector - A normalized (of length 1) vector corresponding to one of the local axes of the object, which is used to determine which side of the object should be used to check the orientation. This setting has three options:
  • Up - corresponding to the green transform arrow in local space. (default).
  • Forward - corresponding to the blue transform arrow in local space.
  • Right - corresponding to the red transform arrow in local space.
World Orientation Vector X/Y/Z Float A vector indicating the orientation that the object should match in order to send the trigger, in World space.
Dot Product Value Float The dot product value that should be exceeded for the object to be considered aligned with the target orientation.
On Action Unity Event A list of Unity events that should trigger when the Object this component is attached to first aligns with the specified oerientation.
Off Action Unity Event A list of Unity events that should trigger when the Object this component is attached to first leaves alignment with the specified oerientation.

Community Note: More details on how to set up these Unity Events that are triggered by the cmponent for use in VNyan would be appreciated.

Particle Object

This script is used to create destruction particles linked to Throwable Items and Droppables

Name Type Description
Destroy Seconds Float Amount of time to pass before particles despawn after spawning.
Spawn With Parent Rotation Bool Toggle whether the Particle Object should copy the rotation transformation of the object that spawned it.
Copy Parent Velocity Bool Toggle whether spawned particles should maintain the movement of the object that spawned it.
Spawn With Parent Scale Bool Toggle whether the spawned particles should inherit the scale transformation of the object that spawned it.

Proximity Trigger

This component triggers Unity Events based on the proximity of the parent GameObject to a specified bone if the loaded Avatar's.

Name Type Description
Activate Targets Unity Events A list of Unity Events that trigger when the GameObject first moves within the specified distance from the specified Avatar bone.
Deactivate Targets Unity Events A list of Unity Events that trigger when the GameObject first leaves the specified distance from the specified Avatar bone.
Trigger Distance Float The distance to the specified bone at which the Proximity Trigger is activated and de-activated (in meters).
Sensor Bone Humanoid Bone The humanoid bone to which the proximity trigger is linked.

Set Browser Content

A component to set the content using local HTML-files for a UI Browser object.

Name Type Description
HTML String The path to the local HTML file that the UI Browser should be set to.
Browser UI Browser The UI Browser object whose content is to be set to the specified HTML file.
Update Mode - Indicate at which events the Browser Content should be updated. This setting has three options:
  • Every Frame - The Browser Content is updated every frame (default).
  • On Enable - Update the Browser Content when the Set Browser Content object is triggered.
  • On Awake - Update the Browser Content only when the Set Browser Content object is first loaded in.

Community Note: We would like to add more details on the use case for this component.

Set Browser URL

A component to set the content using URLs for a UI Browser object.

Name Type Description
URL String The URL of the webpage that the UI Browser should be set to.
Browser UI Browser The UI Browser object whose content is to be set to the specified URL file.
Update Mode - Indicate at which events the Browser Content should be updated. This setting has three options:
  • Every Frame - The Browser Content is updated every frame (default).
  • On Enable - Update the Browser Content when the Set Browser Content object is triggered.
  • On Awake - Update the Browser Content only when the Set Browser Content object is first loaded in.

Community Note: We would like to add more details on the use case for this component.

Set Layer

Set the Rendering Layer in which the parent GameObject will be rendered in VNyan. This way, physics and rendering properties of objects that are processed on one layer can be assigned to an object that would normally be processed on another layer. For example, this component can be used to add collission between throwable objects by assigning the object to the Droppable layer, where such collission exists.

Name Type Description
Layer Name String The name of the layer that the GameObject will be rendered in.

Community Note: The entry is currently missing a detailed lsit of each layer and their use-case.

Set Parameter

Set a parameter value in Vnyan.

Name Type Description
Parameter Name String Name of the parameter that is set.
Parameter value Float Value that the named parameter should be set to.

Community Note: Presumably the parameter is set on Object activation, but this is unconfirmed.

Set Shader Float From Param

Adjust a float value in the shader of the targeted material to the value of a VNyan parameter.

Name Type Description
Target Material Material The material whose shader should be reactive to the specified VNyan parameter.
Shader Parameter String The name of the parameter in the target material's shader that should be adjusted based on the specified VNyan Parameter.
Vnyan Parameter String The name of the parameter in VNyan that should be linked with the shader parameter.
Update Mode - Indicate at which events the shader parameter should be updated. This setting has three options:
  • Every Frame - The shader parameter is updated every frame.
  • On Enable - Update the shader parameter when the parent GameObject is triggered.
  • On Awake - Update the shader parameter only when the parent GameObject is first loaded in (default).

Set Text Value

A script that will adjust the text value of a Text component.

Name Type Description
Text Component Text A Text component that will be adjusted by the script. Only one type of Text component is required.
TMPro Component TextMeshPro A TextMeshPro component that will be adjusted by the script. Only one type of Text component is required.
Text Mesh Component Text Mesh Component A Text Mesh component that will be adjusted by the script. Only one type of Text component is required.
Text Value String The text that the text value of the specified Text component should be set to upon update.
Update Mode - Indicate at which events the Text component should be updated. This setting has three options:
  • Every Frame - The Text component is updated every frame.
  • On Enable - Update the Text component when the parent GameObject is triggered.
  • On Awake - Update the Text component only when the parent GameObject is first loaded in (default).

Set Transform From Param

Link the transform values of the parent GameObject based on specified VNyan Parameters.

Name Type Description
Set Position
Set Rotation
Set Scale
Bool Toggle whether the specific transformation values should be adjusted by a VNyan parameter.
Param Pos X/Y/Z
Param Rot X/Y/Z
Param Scale X/Y/Z
String Specify the names of the parameter that should be linked with the GameObject's transformation values.
Use World Space Bool Toggle whether the VNyan parameters encode the local or global transformation values of the target GameObject.

Throwable Object

This script must be included on your game object to export the item as a throwable object (with the extension .vnthrow), together with a rigid body component and a collider component.

Name Type Description
Collision Particle Prefab GameObject A prefab of a GameObject with particle effects. These particle effects will play when the throwable object collides with another object.
Destroy On Collision Bool Toggle whether the throwable object should despawn upon colliding with another object. The object despawns after any attached particle effect is triggered, so particles will still spawn if the throwable object is destroyed.
Object Is Sticky Bool Toggle whether the throwable object should stick to objects it collides with.
Look At Target At Spawn Bool Toggle whether the throwable object should be reoriented towards its target upon spawning.

UI Browser

Use this component to bind a VNyan UI Browser to specific GameObjects. Contents can be changed using the Set Browser Content and Set Browser URL components.

Name Type Description
URL String URL of the page that should be loaded into the UI Browser by default.
Height Int Specify the height of the UI Browser window in pixels.
Width Int Specify the width of the UI Browser window in pixels.

VNyan Camera

This component is used to specify the behavior of VNyan's main camera. Using this component overwrites the default behavior of VNyan's main camera.

Name Type Description
Transition To/From Seconds Float Specify the transition time to/from camera positions. ???
Camera Speed Float Specify the movement speed of the main camera. ???
Camera Smoothing Float Specify the amount of smoothing to apply to the main camera's movements. ???

Community Note: The description for each property of the component are speculative. Please let us know if these are wrong/incomplete.

VNyan Liquid Collider

Enables VNyan's liquids to collide with the attached GameObject.

This component has no values that can be adjusted.

Community Note: Presumably, a collier component is required for this component to work. Please let us know if you can confirm this.

World

This script must be included on your game object to export the GameObject as a world (with the extension .vnworld).

Name Type Description
Spawn Point Transform Specify where in the world avatars should spawn when loaded in.
Skybox Material Material The material used for the skybox of the world.
Override VNyan Ambient Light Bool Toggle whether the world should allow VNyan's ambient light to be active or not.
Skip VNyan Direct Light Bool Toggle whether VNyan's direct light should be used when the world is active.
Post Process Volume Container GameObject

Community Note: The Post Process Volume Container property needs a description.

World Lightmap Settings

This component is used to set up the Lightmap of your custom world. Lightmap textures:

Name Type Description
Lightmap Index List of Classes Lightmap Index has the following fields:
  • Renderer -
  • Lightmap Index -
  • Offset Scale X/Y/Z/W -
  • Stitch Seams -
LightMap List of Textures
LightMapDir List of Textures
LightMapShadow List of Textures
LightMaps Mode - This setting has three options:
  • Non-Directional - (Default)
  • Everything -
  • Combined Directional -
Ambient Mode - This setting has four options:
  • Trilight -
  • Skybox -
  • Flat -
  • Custom - li>
Ambient Color Color
Ambient Skybox Material
Ambient Equator Color
Ambient Ground Color
Ambient Sky Color Color
Ambient Probe List of Floats
Ambient Intensity Float

Community Note: Currently, there is little information available on the use of this component. The properties of this component need a description.

VSeeFace SDK

VSeeFace SDK can be used with VNyan for both avatars and other assets. If the avatar model is only to be used in VNyan then Unity 2020.3.48 and UniVRM 0.104 should be used, and it is recommended to use the VNyan SDK. However, if the model is also required to work with VSeeFace, then it is recommended to use Unity 2019.4.31 and UniVRM 0.89

If you require any VNyan SDK components to work on a vsfavatar exported from the VSF SDK, you can add them to the whitelist export in AvatarCheck.cs (found here in the VSF SDK), or disable this check from the vsfavatar export completely. Likely the model will no longer work in VSeeFace, but should load without issue in VNyan. This is not necessary when exporting a vsfavatar through the VNyan SDK.

⚠️ **GitHub.com Fallback** ⚠️