jagenjo / webglstudio.js

A full open source 3D graphics editor in the browser, with scene editor, coding pad, graph editor, virtual file system, and many features more.
MIT License
5.21k stars 605 forks source link

How to trigger animations on click event using Graph (GUI editor)? #50

Open KnightCoder opened 4 years ago

KnightCoder commented 4 years ago

Lets say I have various takes in an animation or I've multiple @scene animations on different nodes of a model.

Using Graph (GUI), lets say I've placed multiple choice component (radio button) and I want to trigger each of these animations based on the choice of the options.

How can I do this using Graph (GUI) ?

jagenjo commented 4 years ago

image

KnightCoder commented 4 years ago

@jagenjo I think this would only set the value of the variable take. But how do I trigger the animation and its take? I noticed that LS.PlayAnimation.play method plays animation but getAnimation and getTake gets the animation and its takes respectively.

Hence, please show using the Graph GUI: How we can execute the play a selected take of an animation? How can we trigger another function on start_animation and end_animation events?