Skip to content

Commit

Permalink
#11 mesh setEnabled true when load completed
Browse files Browse the repository at this point in the history
  • Loading branch information
noname0310 committed Aug 8, 2023
1 parent 90451bf commit 88a0596
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.24.0

- Shows the mesh when all texture loads and shaders are compiled

## 0.23.0

- fix object freezing in place to set physics body linear damping to 6.0
Expand Down
3 changes: 3 additions & 0 deletions src/Loader/Optimized/bpmxLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ export class BpmxLoader implements ISceneLoaderPluginAsync, ILogger {
const mesh = new (state.useSdef ? SdefMesh : Mesh)(bpmxObject.header.modelName, scene);
mesh._parentContainer = assetContainer;
scene._blockEntityCollection = false;
mesh.setEnabled(false);

const vertexData = new VertexData();
vertexData.positions = bpmxObject.geometry.positions;
Expand Down Expand Up @@ -668,6 +669,8 @@ export class BpmxLoader implements ISceneLoaderPluginAsync, ILogger {

applyTextureLoading = true;
await textureLoadPromise;

mesh.setEnabled(true);

if (assetContainer !== null) {
assetContainer.meshes.push(mesh);
Expand Down
3 changes: 3 additions & 0 deletions src/Loader/pmxLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export class PmxLoader implements ISceneLoaderPluginAsync, ILogger {
const mesh = new (state.useSdef ? SdefMesh : Mesh)(pmxObject.header.modelName, scene);
mesh._parentContainer = assetContainer;
scene._blockEntityCollection = false;
mesh.setEnabled(false);

const vertexData = new VertexData();
const boneSdefC = state.useSdef ? new Float32Array(pmxObject.vertices.length * 3) : undefined;
Expand Down Expand Up @@ -810,6 +811,8 @@ export class PmxLoader implements ISceneLoaderPluginAsync, ILogger {
applyTextureLoading = true;
await textureLoadPromise;

mesh.setEnabled(true);

if (assetContainer !== null) {
assetContainer.meshes.push(mesh);
assetContainer.geometries.push(geometry);
Expand Down

0 comments on commit 88a0596

Please sign in to comment.