SDK creating external compatible with jit.anim.node, jit.phys.body, etc.


    Sep 27 2015 | 10:07 am
    How does one write a custom C external with the SDK so that it is a compatible object connected up to jit.anim.node, jit.anim.drive, jit.phys.body, jit.phys.ghost, etc.? Or with what functionality, interfaces, and behavior?
    This external will not draw anything to OpenGL, will not automatically output based on the timing of a render bang, and its output will not always be relevant to a GL context's coordinate system. Therefore for now, I am not anticipating the external to have have a GL context param or @drawto.
    Imagine the custom external being in the following chain: jit.anim.node -> custom.external -> jit.anim.node -> jit.gl.gridshape
    The custom.external needs to be able to know/listen for the parent jit.anim.node to understand its pos/rot/scale. The custom external then would have its own @position, @scale, @rotate, @rotatexyz, @quat, etc. The custom.external then needs to pass down these "summed" attributes to the child jit.anim.node
    Thanks for any and all insight. --Dale

    • Sep 28 2015 | 11:43 pm
      I have a partial implementation. I have this working when the custom.external is a leaf and not in the middle of the chain. I created local attributes and then registered for notifications from the parent. This seems to work. Unknown if this implementation method is the better performing.
      Middle and top of chain still to be reverse engineered. I'm going to explore doing the math on the local data and then being a server for some child node on which to register. Unsure how to get the automatic anim value by patchcord behavior.
      All suggestions welcome.
    • Sep 29 2015 | 5:34 pm
      hey dale. there's some internal stuff that happens with jit.anim.node that is not exposed to the API, however you should be able to insert your own transform processing object simply by accessing transform parameters exposed by jit.anim.node: (get/set) position, quat, scale, parentpos, parentquat, parentscale, (get only) worldpos, worldquat, worldscale.
      chaining your object in with jit.anim.node objects with patch cords won't work, but they should still be able to do their job.
      i can provide a patch example of this if necessary. let me know if there's something else that's missing.
      another approach may be to create your object as a wrapper around jit.anim.node.
    • Oct 19 2015 | 6:42 pm
      I've figured out how the anim chain works + patchcords auto setup. The latter was almost no work for me. :-) I have noticed that every time a parent anim's world position, scale or quat changes...that node sends down a notify for all three pos, scale, and quat. It doesn't sent down just one...it always sends all three. Which then results in 2 extra chains of code for cases where only one changes. Which is 100% of the time since Max in this scenario is single threaded. Is there some intention that I haven't recognized yet?