VFX from Unity to Three.js

Hello there. Could you help me please? We are trying to use Needle engine to export VFX from Unity to three.js project (our project compiled through Webpack) and we can’t seem to do anything that works. Do you have any ideas why that can be happening?
I created a particle system in Unity and exported it as a .gltf and .bin (with textures).

Our developer trying this process to insert it into the project with no avail:

Installed dependencies: npm i @needle-tools/engine

In main.ts:

import { NeedleEngine } from “@needle-tools/engine”;
import * as THREE from “three”;

function onStart() {
NeedleEngine.addContextCreatedCallback(args =>{
console.log(‘Needle created’);
});
}

However, the project doesn’t build with webpack.
If you add the following to webpack.config:

resolve: {
alias: {
‘@needle-tools/engine’: path.resolve(__dirname, ‘
/node_modules/@needle-tools/engine/dist/needle-engine.light.umd.cjs’),
},
},

Then the project builds, but NeedleEngine.addContextCreatedCallback still doesn’t get called.
image.png

Original Post on Discord

by user 120268259151839232

Do you get any errors?

We have a nextjs sample which also uses webpack under the hood. You will probably not be able to use this directly but maybe it helps if you take a look at the plugin there to see what we’re doing for next/webpack support: nextjs-sample/next.config.js at main · needle-engine/nextjs-sample · GitHub

How do you export your gltf file? By default we export to glb - this is not configureable. So I assume you’re going another route? Are you exporting via context menu and if so: why?

I will ask him. And hand this information. Thank you!

by user 120268259151839232

Alright - let us know if you succeed or not :slightly_smiling_face:

I export particle system by placing prefab of it into “export” derictory in scene

by user 120268259151839232

I’m not sure I understand - which export directory? Or do you mean inside a GltfObject component?

Wait I’ll make you a screen

by user 120268259151839232

image.png

by user 120268259151839232

I put it there and when I save it appears as those .bin and .gltf files

by user 120268259151839232

Oh ? Let me try ^^

Do you perhaps have a GltfObject on the Export GameObject as well? Or some other component?

Can you show me the components on Export and on VFXPixelFire?

No I don’t. I just place it there as a prefab.
As I remember this “GltfObject” is a component that I need to add in inspector right? It can be the reason why vfx doesn’t export properly? This one is from “eport” inspector

by user 120268259151839232

this one from vfx prefab

by user 120268259151839232

This will not export the gltf or bin. At least I can’t see why/how and as said before our export does currently export to glb by default.

The prefab as child of the ExportInfo will not do anything. Are you sure no other script is referencing this prefab? Or you exported it another way?

I can’t answer that. I have little experience with scripts. How do I check if it is?

by user 120268259151839232

Ah wait

by user 120268259151839232

I remember doing this

by user 120268259151839232