You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The goal of this feature request is to reduce numerical errors after an import of a dataset in the open 3D Tiles format. Each dataset in the 3D Tiles format is a collection of glTF files typically containing a mesh that represents 3D geospatial content (buildings, trees, terrain, etc).
The origin of the system of reference of a 3D Tiles dataset is located in the center of Earth, so an object in the glTF file typically has the coordinates of millions of units. That leads to noticeable gaps between separate 3D tiles due to numerical errors caused by the single floating number precision in Blender.
Describe the solution you'd like
Provide a hook to change at least the location of objects in a glTF file. For example, a constant offset can be applied to all objects in the glTF file to bring the objects to Blender's origin and decrease the resulting numerical errors.
Describe alternatives you've considered
Currently I am patching the function set_convert_functions and apply an offset in convert_loc:
fromio_scene_gltf2.io.imp.gltf2_io_gltfimportglTFImporterfromio_scene_gltf2.blender.imp.blender_gltfimportBlenderGlTFdefmy_set_convert_functions(gltf):
ifbpy.app.debug_value!=100:
# Unit conversion factor in (Blender units) per meteru=1.0/bpy.context.scene.unit_settings.scale_lengthoffset=gltf._offset# We will apply <offset> before creating a <Vector> to decrease numerical errors caused by# 32 bits floats useb by <Vector> and other <mathutils> classes.# glTF Y-Up space --> Blender Z-up space# X,Y,Z --> X,-Z,Ydefconvert_loc(x): returnu*Vector([x[0] -gltf._offset[0], -x[2] -gltf._offset[1], x[1] -gltf._offset[2]])
## the rest of the function is omitted for bravity#glTFImporter._offset= (X, Y, Z)
BlenderGlTF.set_convert_functions=my_set_convert_functions
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
The goal of this feature request is to reduce numerical errors after an import of a dataset in the open 3D Tiles format. Each dataset in the 3D Tiles format is a collection of glTF files typically containing a mesh that represents 3D geospatial content (buildings, trees, terrain, etc).
The origin of the system of reference of a 3D Tiles dataset is located in the center of Earth, so an object in the glTF file typically has the coordinates of millions of units. That leads to noticeable gaps between separate 3D tiles due to numerical errors caused by the single floating number precision in Blender.
Describe the solution you'd like
Provide a hook to change at least the location of objects in a glTF file. For example, a constant offset can be applied to all objects in the glTF file to bring the objects to Blender's origin and decrease the resulting numerical errors.
Describe alternatives you've considered
Currently I am patching the function
set_convert_functions
and apply an offset inconvert_loc
:The text was updated successfully, but these errors were encountered: