Tried bringing in an npm package for depthkit as an NPM Definition in needle but once setup I get this warning when importing it: File 'C:/Unity_Projects/NeedleWebDemos/Assets/Needle/depthkitNew~/index.ts' is not a module.. The index.ts seems to be generated by needle and is empty
I’m really struggling at bringing another package into Needle, the depthkit.js I’m trying to bring in works fine otherwise when I run it via live server in VS Code from a fresh git pull.
Is there any kind of guide for bringing in an external dependency and importing it with Needle via typescript? Idk why I’m having so much trouble
Using this updated branch of depthkit.js, if I straight pull it down with git, open in VS code, npm install then run one of the source html files in Live Server via VS Code it is fine. https://github.com/juniorxsound/Depthkit.js/tree/dependabot/npm_and_yarn/three-0.137.0
When I bring it into Needle I get issues with require and glsl.file when I import and try to run it via a .ts script
I’ll keep hacking at it, I was just hoping I missed something obvious, their npm package uses a really old version of three which I think is the issue so I wanted to change the package to the branch version and edit the files myself
Just checking what I’m doing, all the depthkit thing seems to be is a .js file you call to make a new ‘depthkit’ character in the scene. Something very simple I am trying to get working like this which is why I’m stumbling
import DepthKit from "depthkit/src";
start()
{
var depthkit = new DepthKit();
depthkit.load(
"/include/depthkitexamples/Depthkit_AzureKinect_Autumn/Export/autumn-meta.txt",
"/include/depthkitexamples/Depthkit_AzureKinect_Autumn/Export/autumn.mp4",
character => {
this.context.scene.add(character);
}
);
}
Im not sure if its the same thing but I remember someone else tried to import some library that required some different import syntax. I’ll try to look it up later if you didnt solve it until then
Now I get the joyous depthkit.js?v=5c92bae1:18 Uncaught ReferenceError: require is not defined which I think I solved by importing browserify to allow require to run in the browser