Re: how to use and jit.anim.node in javascript

Forums > Javascript > how to use and jit.anim.node in javascript
Jun 13 2012 | 7:58 pm

hello. thanks for the questions.

there is currently some limitations to using the animation objects inside of javascript. these should all be gone in a future update.

for now, your best bet is to leave the outside of javascript, and create an "anything" function to pass messages from the max-box, to the javascript jit.anim.node. (this technique is found in the javascript example patch here: Max6/examples/jitter-examples/javascript/other/jitternotify.js)

to set up an anim.node hierarchy inside of javascript, you can create an array of gl objects and an array of anim.node objects, and set the "anim" attribute of the gl object to the "name" attribute of the anim.node.
you then can create a parent anim.node object, and set the "anim" attribute of the child anim.node objects to the "name" attribute of the parent.

you can then pass messages from the (or any kind of message) to this parent anim.node.

here’s a basic patch with javascript to demonstrate.
please let me know if anything is unclear.

-- Pasted Max Patch, click to expand. --

  1. anodeadrive.js

Subscribe to the Cycling ’74 Weekly Newsletter

Let us tell you about notable Max projects, obscure facts, and creative media artists of all kinds.

* indicates required