Added warning for using GLTF importer

This commit is contained in:
Lucas Dower 2023-04-10 01:20:25 +01:00
parent 81e40a41c0
commit 3e05844d39
No known key found for this signature in database
GPG Key ID: B3EE6B8499593605
2 changed files with 5 additions and 0 deletions

View File

@ -34,6 +34,7 @@ export const en_GB = {
vertex_triangle_count: '{{vertex_count, number}} vertices, {{triangle_count, number}} triangles',
missing_normals: 'Some vertices do not have their normals defined, this may cause voxels to be aligned incorrectly',
failed_to_parse_line: 'Failed attempt to parse "{{line}}", because "{{error}}"',
gltf_experimental: 'The GLTF importer is experimental and may produce unexpected results',
components: {
input: '3D Model (.obj, .gltf/.glb)',
rotation: 'Rotation',

View File

@ -2,13 +2,17 @@ import { parse } from '@loaders.gl/core';
import { GLTFLoader } from '@loaders.gl/gltf';
import { RGBAColours, RGBAUtil } from '../colour';
import { LOC } from '../localiser';
import { MaterialMap, MaterialType, Mesh, Tri } from '../mesh';
import { StatusHandler } from '../status';
import { UV } from '../util';
import { Vector3 } from '../vector';
import { IImporter } from './base_importer';
export class GltfLoader extends IImporter {
public override import(file: File): Promise<Mesh> {
StatusHandler.warning(LOC('import.gltf_experimental'));
return new Promise<Mesh>((resolve, reject) => {
parse(file, GLTFLoader, { limit: 0 })
.then((gltf: any) => {