Wireframe mode hides objects

Hello,

when switching to wireframe mode, some objects are not displayed.

before:
grafik

after:
grafik

The following code is used:

var mat = scene.materials;
for (var i = 0; i <mat.length; i ++)
mat [i] .wireframe = true;

When switching back to normal mode, all objects are visible again. what am I doing wrong here?

Nothing, this should work :frowning: could you repro in the playground ???

By the way your model looks great !!!

Hello and thanks for the answer.

Creating a repro in the playground becomes difficult at this stage of development.
If I activate the wireframe mode when creating the materials and switch it back and forth later, everything is displayed correctly.
Somewhere there is a mistake …

Thanks for the praise. The “model” is configurable and can be provided with different dimensions, materials, joints, engravings and ultimately also with diamonds.

1 Like

Hello,
it seems like there is a problem with the materials. When using the debug layer and expanding the material node, the Scene Explorer is closed immediately. For all other nodes, these are expanded and can be browsed.

It is also not possible to export parts or the entire scene.

Perhaps it is because of the procedure for “renewing” the meshes.

The following routine is currently used:

for all materials: material.dispose ();
for all meshes: mesh.dispose ()

scene.clearCachedVertexData ();

for all new meshes:
mesh = new BABYLON.Mesh (…)
vertexData = new BABYLON.VertexData (…)
set vertex data …
vertexData.applyToMesh (mesh, true);

material = new BABYLON.PBRMaterial (...)
set material ...
mesh.material = material;

Can textures be assigned to multiple materials? What happens to the textures when the material is disposed.

greetings
Olli

By default disposing materials does not dispose textures and you can use the same texture on several materials.

About the issue it sounds impossible to troubleshoot without repro.

Hello,

a repro becomes difficult … how about a link to the project?
Is there a private message option here?

Yes but debugging an entire project is always hard and does not help the community which could have the same issue.

Can you not repro by isolating the materials creating the issue only if it comes from there ?