Erfan-Shooraj / ifc2b3dm

MIT License
70 stars 35 forks source link

How can i solve this problem? #3

Closed wendyHYR closed 5 years ago

wendyHYR commented 5 years ago

Hello, I tried to use your code 'GLTFs2B3DM'.But, the following errors are occurred. Unhandled rejection TypeError: Cannot read property 'KHR_materials_common' of undefined at Function.Material.fromGltf (C:\Users\wendy\Desktop\ifc2b3dm-master\ifc2b3dm-master\GLTFs2B3DM\lib\Material.js:40:37) at Function.Mesh.fromGltf (C:\Users\wendy\Desktop\ifc2b3dm-master\ifc2b3dm-master\GLTFs2B3DM\lib\Mesh.js:295:29) at C:\Users\wendy\Desktop\ifc2b3dm-master\ifc2b3dm-master\GLTFs2B3DM\lib\createBatchTableHierarchy.js:126:42 at So, how can i solve this problem?

Thanks.

Erfan-Shooraj commented 5 years ago

Hi, Obj2gltf has removed the --materialsCommon flag and has replaced it with --materialsUnlit. I will change the code later to adapt to the newer versions.

In the meantime, you can use an older version of obj2gltf like version 2.0.0 and it should solve your problem.

wendyHYR commented 5 years ago

@Erfan-Shooraj Thanks for your quick response. This problem has been solved. But, a new problem has arisen. I can use your code to convert my model from gltf to b3dm. But, the tileset is too small and also i can't load it into Cesium. I think some mistakes are appeared from gltf to b3dm, but no errors are displayed in my cmd. So, can you help me solve this problem or can you provide me your BIM model? image image image image

Erfan-Shooraj commented 5 years ago

Since you're tileset is too small, I think it's because your gltf files don't have the geometry information in them and they're practically blank. Can you view each gltf file with the windows viewer or a program like open3mod? If the gltf files don't open, or you can't view them, it must be a problem with prior stages. You can trace back by trying to see if you can view the IFC files with something like open3mod or Solibri. Same with objs. If the problem is with the IFC files, I should mention when I tried to query objects with BimServer and IFC4 files, I had similar issues. So try to check in IFC2x3 files if that is your problem. Sometimes the querying issue happened even with IFC2x3, so a restart of the server or re-checking in the model might help. I think I can help you better if you let me know at which stage you lose the geometry and can't view it.

wendyHYR commented 5 years ago

I got it. Thanks.