Khanon
February 9, 2025, 12:24am
1
Exporting a scene from Blender with different meshes, I’m trying to get the actual position, rotation and scale of each mesh from the world origin.
In the Blender scene, I import a mesh from a .glb
file. Then I duplicate it, and I move, rotate and scale the duplicated one. I apply all transforms
to both meshes to let Babylon add-on export the scene.
Then when I import that scene into Babylon, both meshes are in the 0,0,0 position, 0,0,0 rotation and 1,1,1 scale.
How can I export a scene from Blender to get the actual transform of each mesh from the world origin?
labris
February 9, 2025, 1:28am
2
You may find the mesh position with mesh.absolutePosition
.
As well as absolutePosition
and absoluteScaling
- Babylon.js docs
Khanon
February 9, 2025, 1:52am
3
So position
rotation
and scaling
are the local transforms, they wil be usually at origin, and I should work with absolutes?
I’ve just checked and absolute position is also 0,0,0.
For what I’ve reading in this post , I can use mesh.getBoundingInfo().boundingBox.centerWorld
to get the actual position, but this is not desired.
The good path would be getting actual position
directly from Blender export data.
Khanon
February 9, 2025, 1:32pm
5
I don’t get why I have the mesh in this position in Blender, with the origin set to the geometry:
And in Babylon is appears under the floor:
I’m clearly missing something.
Are you using gltf or babylon format to export?
Khanon
February 10, 2025, 4:35pm
7
I’m using Babylon exporter 3.3.2
Is it right to export an entire scene using the Blender glTF native exporter?
labris
February 10, 2025, 5:05pm
8
If you don’t have things which are not supported by GLTF format, it is completely OK.
1 Like
Khanon
February 10, 2025, 5:12pm
9
What kind of things are not supported?
Lights, cameras, animations, materials, shaders…?
Lights, cameras, animations, materials, shaders: all of that is supported
1 Like
labris
February 10, 2025, 10:35pm
11
For example, partcle systems are not supported in GLTF format.
Khanon
February 10, 2025, 10:50pm
12
That’s not a problem, the game engine will generate them. I will go for .glb
files.
Thanks!
1 Like