Instantiating jitter objects with javascript in a standalone

mattyo's icon

There are a few posts on this topic, but they all seem a bit outdated at this point, so I'm hoping for some clarification. I have a patch (which is mostly a js) which is basically a movie player. In the js, I instantiate the following Jitter objects:
-- jit.matrix
-- jit.movie
-- jit.gl.videoplane

In regular Max, I instantiate a jit.world object, and that 's it. Patch runs fine in Max. the application, however, keeps coming up with missing objects. In this thread (https://cycling74.com/forums/cant-create-standalone-with-javascript-jit-window-helpfrom 2006!) Joshua says:

You also need to include jit.window and all objects referenced in your javascript file. Otherwise the class is not present to be instantiated. Patchers know which objects they contain and add them to the collective for you, but javascript files do not.

So, going for the belt-and-braces approach, I have checked 'include Max resources' in the Standalone object, and also explicitly included the externals the js instantiates in my build script (all located in a folder called 'externals'. (I have also turned off 'search for missing files' in the standalone object)Here's the build script:

open thispatcher
folder "disk:/Users/mattyo/Documents/Max 8/Library/permutations/media"
folder "disk:/Users/mattyo/Documents/Max 8/Library/permutations/externals"
include "disk:/Users/mattyo/Documents/Max 8/Library/permutations/make-videoplane.js"

(I would also expect this to move the contents of the 'media' folder into the app, but I doesn't. I can do that by hand, though, no problem...)

On launch, I get the following errors:

make-videoplane: no such file in collective
jit_listener: no such file in collective
method setcbdata called on invalid object
method setcallback called on invalid object
jit_gl_videoplane: no such file in collective
gen_domain: no such file in collective
gen_domain: no such file in collective
jit_qt_engine: no such file in collective
jit.viddll.engine: no such file in collective
jit_avf_engine: no such file in collective
jitter-config.txt: no such file in collective
jit_world: no such file in collective

Aside from the fact that things I have explicitly included seem to be missing (and indeed do not work), it claims that 'make-videoplane', which is the main js, is not in the collective, although it appears to be running, although not operating on any objects.

Also, what's the deal with the following:
jit_listener: no such file in collective -- no object with that name I can find
gen_domain: no such file in collective -- no Gen used in the project
jit_world: no such file in collective -- not instantiated in js

btw, if I build it as an .mxf, I get no errors....

Any wisdom would be appreciated!

\M

mattyo's icon

FWIW, semi-solved. Turned out that my js object read [js make-videoplane], not [js make-videoplane.js] Adding the extension made everything load nicely.

Rob Ramirez's icon

if you're still having problems, please send along example files and steps to reproduce.