SPS with 3d models is possible?

Hi, im trying to create multiple instances of a 3d model, so is it possible to SPS for such purpose? If yes, could anyone give me a sample PG?

then one im trying to work - PG - https://playground.babylonjs.com/#U5SSCN#225

@JohnK Hi John, Could you help?

See Solid Particle System | Babylon.js Documentation (babylonjs.com), Cloning With the Solid Particle System | Babylon.js Documentation (babylonjs.com). It is possible to use any kind of mesh as the SPS particle, your PG is passing something that is not a mesh to it. If you want to use the return function of loading the mesh, I recommend using ImportMeshAsync like here: Loading Any File Type | Babylon.js Documentation

There are several errors in your PG

Your SPS code will be executed before your model is loaded. The code needs to be inside the the SceneLoader.

You have not used Append correctly.

See Loading Any File Type | Babylon.js Documentation

Here is a PG that nearly works

The problem is that SPS does not handle models with a parent, only the parent is added and in this case newMeshes[0] is an empty mesh. GLB models are always added a root parent to deal with right handed system.

Here is one using .babylon format

3 Likes

Sure, understood, thank you :slight_smile:

can .dae file type can be treated as the same? - .dae files can be loaded? Im getting a console error!

i tried with around 1000 numbers(SPS) and it started crashing. so using 2d will the apt workaround right? or anyother way to fix it?

Do not know about .dae files

1 Like

You might be better of creating a simple pallet with boxes directly in Babylon.js to cut down on vertices. Or even use one box with a pallet texture.

check out opacity

and Troubleshooting Solid Particle System Transparency Issues | Babylon.js Documentation

[quote=“JohnK, post:9, topic:32879”]
You might be better of creating a simple pallet with boxes directly in Babylon.js to cut down on vertices.
[/quote]. how to achieve this? and can you explain ‘vertices’?

This is to explain vertices I am not suggesting you build a custom mesh.

For pallet make three boxes on top, two underneath and merge the meshes.
Texture with wood.

Or try the one box option with opacity.

3 Likes

Thank you @JohnK :slight_smile:

I also encountered a problem, which is that the loaded GLB has been deformed, and I believe more in the issue in the blender export here


@JohnK how can I correct my model

Single-tiered glb model
https://playground.babylonjs.com/#6A98QF#3

Multi-tiered glb model
https://playground.babylonjs.com/#6A98QF#4

Can I convert your model to non-hierarchical or single-mesh?

1 Like

thanks, I merged all levels and it wasn’t considered complete until I removed the materials as well.

Another one question about Blender export, which is very important to me, I need your help.
I can’t thank you enough.
Most of the mateial I export will be lost,unless it’s some of the most basic “principled BSDF”.

in the example above model “seagulf.glb”, I only exec import & export . it also lose material
How do I operate export


First of all, please keep in mind that I am not a designer and this is not accurate.

First of all, when you say merge in DCC(blender), do you mean that the actual model that comes out is not merged?

1.Once merged, meshes that are not of the same material are automatically socketed on export.
2. I wish there was a way to prevent this, but I’m not aware of it, so I uv mapped from the same material to make one mesh with one mat.

Also, this may be a vague answer.
Our designer uses the GLB as the final export after FBX-oriented transformations and I use the transformed GLB as the final export, optimizing it back to GLB afterwards.

So I don’t know if this glb model loses material normally or not because it’s optimized to do so, and if it’s a normal glb, it seems like something is wrong if it loses material in the import - export rule.
Does your glb model also lose material on import and export?

1 Like

First of all, when you say merge in DCC(blender), do you mean that the actual model that comes out is not merged?

I have verified it many times, The plan you provided is correct.
There is indeed a problem with the model in pg, which I did not encounter with other models

Also, this may be a vague answer.
Our designer uses the GLB as the final export after FBX-oriented transformations and I use the transformed GLB as the final export, optimizing it back to GLB afterwards.

So I don’t know if this glb model loses material normally or not because it’s optimized to do so, and if it’s a normal glb, it seems like something is wrong if it loses material in the import - export rule.
Does your glb model also lose material on import and export?

If I use some complex materials, it’s difficult to ensure the normal use of the material, it seems a bit like schrodinger cat,As you said, it doesn’t seem to have a statistical process
lucky, I just learned a new skill, which is to bake the material, bind it to the mesh, and then export it

1 Like