Code Monkey home page Code Monkey logo

modular-avatar-as-code's Introduction

Animator As Code - Modular Avatar

Modular Avatar As Code contains facilities to automate the creation of Modular Avatar components.

The functionality of this library is strictly limited to the handling of animators and parameters.

Installation

Install using the VRChat Creator Companion. Instructions are available in this page.

Documentation


Work in progress

Haï speaking: ModularAvatarAsCode is a companion library to AnimatorAsCode V1 that I am using in my personal avatar project to generate animator controllers non-destructively, and then declare the animator, its parameters, and the menu items to Modular Avatar.

It is wholly incomplete, but serves my purpose.

Example usage

var aac = NdAac.AnimatorAsCode("IkgAcEyeVizRange", my.relative, my.variant, my.assetKey, NdAac.Options().WriteDefaultsOn());

var fx = aac.NewAnimatorController();
var mainLayer = fx.CreateLayer();

var reduceRange = mainLayer.BoolParameter("FT_FlowerVizReduceRange");
var useConvergence = mainLayer.BoolParameter("FT_FlowerVizUseConvergence");

// (build the animator controller...)

var ma = MaAc.Create(my.gameObject);
ma.NewParameter(interpolatorLayer.FloatParameter("ConvergencePlaneDistance5M")).NotSaved();
ma.NewParameter(reduceRange);
ma.NewParameter(useConvergence).WithDefaultValue(true);
ma.NewMergeAnimator(fx, VRCAvatarDescriptor.AnimLayerType.FX);
ma.EditMenuItem(my.menuReduceRange).Name("Reduce FlowerViz range").Toggle(reduceRange).WithIcon(my.menuReduceRangeIcon);
ma.EditMenuItem(my.menuUseConvergence).Name("Use Convergence").Toggle(useConvergence).WithIcon(my.menuUseConvergenceIcon);

Notes

  • By default, parameters are synced and saved. Call NonSynced() and NonSaved() to save them.
  • It has become more usual and more usual for animators to use floats instead of bool parameters because they can be used in blend trees for use in toggles. However, the expression parameter can be synced as a bool, with an implicit cast. In these cases, use the methods containing "BoolToFloat" to express that quirk.
  • By default, the Merge Animator is initialized with absolute paths. TODO: decide if this should be relative/specified on init with a fluent buildern
  • TODO: Allow merge animator to be initialized on another object than itself (this goes for any object, really)
  • TODO: some functions carry state across invocations, i.e. if you create a parameter A, and never create it again, it may persist. This may have to be fixed or stabilized by decided how semi-destructive this workflow is

modular-avatar-as-code's People

Contributors

hai-vr avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.