Jump to content

Dispose mesh with skeleton


Dad72
 Share

Recommended Posts

I am unable to reproduce on the playground because no model animate seems to have been created with a biped, but with bones.

So I create a screenshot to show however that corresponds Bip01 (this is a point Bip01).

<fr> Si je supprime le modèle avec dispose(), il est supprimer a 100%, les os aussi mais à 99%. Il reste ce point Bip01( voir capture d’écran) qui lui est pas supprimer et reste sur la scene non visible. C'est parce que j'utilise un biped de 3ds max pour créer le squelette et pas des os</fr>

bip01_explor.jpg.08337f1f3bfab934d1bb107

Voici où ce situe ce Bip01 qui est selectionner:

bip01.thumb.jpg.e5e3d53f1e124e843493c1f8

 

Link to comment
Share on other sites

BABYLON.SceneLoader.Append("data/characters/", "skeletons.animation.babylon", global.scene, function(scene) {	
    skelette = global.scene.getSkeletonByName("skeleton #0");			
	scene.getMeshByName("casual01_m_highpoly").dispose();
});

Je supprime simplement l'objet. je ne vois pas ce que tu demande comme code ?

Logiquement, là je met en mémoire le skelette et je supprime le modèle 3d, mais il reste le Bip01 qui est juste un points.

Link to comment
Share on other sites

Voila, comme promis.

Et en faite c’est pire que ce que j'avais vue. c'est tout les bones spline qui ne sont pas totalement effacer quand on regarde dans un console.log les mesh restant dans la scene complete.

Et on dirait aussi que le mesh est bien effacer de la scene mais on peut encore le voir dans un console.log après un dispose()

http://www.babylonjs-playground.com/#J4VIN#2

Link to comment
Share on other sites

Ok so this is not a bug :) It is by design:

 

- If you dispose a mes: it is removed from the scene obviously but because you keep a link on it, you can still use it. The garbage collector will remove it from memory as long as no one has an access to it. In shorter word, you just need to set mesh = null in your example

- Because skeletons can be shared between multiple meshes, disposing a mesh does not dispose its skeleton. You have to first call mesh.skeleton.dispose() if you want to force it

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...