Open ruegr opened 2 years ago
Hello @ruegr, I need a bit of time as this is tricky and it is not my main supported flow. The flows that I use and test are:
Blender is a whole new big world for me; and I definetly discarded it as a sweethome obj to glb converter (it was doing too many changes to the object names). Using it as a modeling tool from scratch could work but I need to really get more acquaitened with the tool and maybe adapt the code to have less dependencies with Sweethome3d (ex levels or object groups, etc)
I accept that regardless of the modeling tool, if the model is displayed in three.js editor it should be displayed the same in the card but there are many factors preventing this not to work as expected. If nobody helps me in debugging the code this fix may take a significant amount of time
Hi @adizanni,
yeah, Blender is a really nice tool but it has "some learning curve" ;-) One advantage i see are the object-ids - you can define them manually and the will stay the same no matter what you change / how often you export.
I investigated the failure a little bit further; the oberservation regarding multiple materials just seem to be a side effect.
The root cause seems to be grouped/nested objects:
Here the blue cube is a child of the green cube
Again in the ThreeJS-Editor everything looks good - CubeBlue is on top of CubeGreen and the outliner shows, that in the glb the cubes are still nested
But in floor3d-card CubeBlue is misplaced. I think it is not at [0,0,0], looks like [0,0,0] + [Offset_from_CubeGreen-Origin_to_CubeBlue-Origin]
Test-Files (.blend and .glb): positionbug-simpletest2.zip
If i can help with further analysis please tell me!
Hello @ruegr , it is more than a year and a half that you opened this ticket and I will get back at spending some effort on the card, notably try to support any type of modeling tool. I would really need the help of knowledgeable people. If you are interested please let me know....
Hi there,
Seems the root cause are not multiple materials but grouped/nested objects - see https://github.com/adizanni/floor3d-card/issues/110#issuecomment-1140404471
I'm using Blender and not SweetHome3D for modelling and discovered, that objects with more than one material are not positioned at the desired coordinates but at [0,0,0].
Simple test file in blender:
"Cube.001" is placed at [5,1,0.1] and has two materials - one half green and the other blue
Exported as glb and imported to floor3d-card:
The double-material cube is placed at [0,0,0] while the just-green cube is at the desired position
I checked the same file with the https://threejs.org/editor/ (same js-bib as floor3d-card):
Here the double-material cube is at the right position.
It seems, that in the glb the cube is cuttet into to different objects, one for each material.
In the ThreeJS-Editor each new object is at the right position. In the floor3d-card there are different objects for each material too, but they are all placed at [0,0,0].
=> I think there is a bug in floor3d-card (and not ThreeJS) positioning such material-splitted objects
Test-Files (Blender & glb): positionbug-simpletest.zip