-
Notifications
You must be signed in to change notification settings - Fork 31
Exported model from Blender 2.83 LTS breaks ForwardRenderer #100
Comments
Hi @kungfooman, The crash is something we can fix, but as we're about to release new viewer which does not exhibit the crash issue, we might not get to fix the old one. Try new viewer from here: https://github.com/playcanvas/engine/tree/master/tools/viewer But missing parts of the mesh could perhaps be something to do with the gltf file itself? I tried loading it into 2 other viewers, and they both show missing parts.
|
Hi @mvaligursky, thank you for the quick answer! The gltf file itself is indeed missing the body (Blender only exported the selected objects). So I exported everything now: Thanks for referencing the new viewer, I just have a hard time to understand how it loads an entire model (with textures). I tried to drag&drop the model folder (like this viewer works), but it seems to only support single files (maybe thats something you work on already) |
@slimbuck Were you planning on supporting loading of unpacked glTF in the new viewer? |
Hi @kungfooman @willeastcott, the latest version of the viewer will support dragging multiple files into the viewer. The viewer released with engine 1.31.0 has limited support for multiple files. |
@kungfooman I'd suggest migrating to the engine-native glTF support soon as you can. The engine glTF code is actively maintained and developed, it largely has feature parity with playcanvas-gltf and in some cases has much better support (for example morph targets). We'll also continue developing the viewer, so if you have any feature requests please shout :) |
Once the new viewer supports folder drag&drop I would like to test/compare the performance, so my feature request would be a "Spawn 8x8" button 😅 |
So I was pretty relaxed about adding that 8x8 feature to the viewer in this repo. But it's a bit of a non-standard feature for a model viewer IMHO. So I probably wouldn't want to add it to the new viewer in the engine repo. But if you want to fork the viewer and add it to your fork, go right ahead. 😄 (BTW, just FYI, we're probably going to move the viewer in the engine repo out into its own repo in the coming days). |
IMHO not having a 8x8 cloning button just shows the inability of these other viewers. When I worked a bit with ThreeJS/glTF it wasn't even possible to clone an animated glTF model and it still has open issues (and the cloning problem dates back to 2016). https://www.google.com/search?q=gltf+clone+threejs+fail Being able to quickly and easily clone a model 64 times also allowed me to discover/verify memory/GC issues in the past (like #70) Looking forward to the new viewer repo 🎉 |
I'm not saying it's an effective way to add 64 objects, but you can drag & drop while holding Shift (or Ctrl?) and it adds the object without removing what's already there. |
An aspect of this bug is present in both glTF loaders (playcanvas-gltf and glb-parser), they just shine through differently. So we are all on the same page and analyze the same thing here, this is the full test model: It defines a scene like this: "scenes" : [
{
"name" : "Scene",
"nodes" : [
0,
1,
97,
100
]
}
] However, as we can see here, glb-loader will have six rootNodes (two more than defined in the scene). Because glb-loader doesn't looks into the This is how the hierarchy looks in Blender:
|
Good observation, I've noticed that on Friday when looking at some other improvements / optimizations to glb characters. I'll be fixing this shortly. Thanks! |
I have a fix for your issue @kungfooman, it should get released soon. |
Thank you so much for fixing Glb-parser @mvaligursky That's a huge argument to switch now, as it even seems to perform faster than playcanvas-gltf (quite hard to compare without materials yet): clones = [];
/**
* @summary
* clones viewer.entities[0] 64 times
* 8 rows, 8 cols
* useful for performance tracing
*/
function spawn8x8() {
var entity = viewer.entities[0];
if (!entity) {
console.log("drag&drop an entity first");
return;
}
var padding_x = 0;
var padding_z = 0;
for (var i=0; i<entity.model.meshInstances.length; i++) {
var aabb = entity.model.meshInstances[i].aabb;
padding_x = Math.max(padding_x, aabb.halfExtents.x * 2);
padding_z = Math.max(padding_z, aabb.halfExtents.z * 2);
}
for (var i=1; i<=8; i++) {
for (var j=1; j<=8; j++) {
var clone = entity.clone();
clone.setLocalPosition(
i * padding_x,
0,
j * padding_z * -1
);
clones.push(clone);
}
}
// add all clones to scene
for (var i=0; i<clones.length; i++) {
var clone = clones[i];
viewer.app.root.addChild(clone);
}
}
spawn8x8(); And Glb-parser feels like a "first-class citizen", e.g. no custom-clone-function, simply I would just like to point out that this issue is not solved for playcanvas-gltf (but probably nobody cares anyway now):
Yea, too bad that exporter is written in Python. I had a look once but I find it confusingly hard to debug. I would love a |
Hi, I used this model all the time for testing (mostly exported by using Blender 2.79), but for some reason it breaks multiple things when exported from Blender 2.83 LTS:
Supposed to look like:
The glTF model for testing:
maila.zip
The text was updated successfully, but these errors were encountered: