Explorar el Código

Fixed BufferGeometryUtils import

fabian0702 hace 1 año
padre
commit
edd63077d6
Se han modificado 1 ficheros con 9 adiciones y 0 borrados
  1. 9 0
      npm.py

+ 9 - 0
npm.py

@@ -116,6 +116,15 @@ for key, dependency in dependencies.items():
             newfile = prepare(Path(destination, filename))
             Path(tmp, key, extracted.name).rename(newfile)
 
+            if 'GLTFLoader' in filename:
+                print(newfile, flush=True)
+                content = newfile.read_text()
+                MSG = '../utils/BufferGeometryUtils.js'
+                if MSG not in content:
+                    raise ValueError(f'Expected to find "{MSG}" in {download_path}')
+                content = content.replace(MSG, 'BufferGeometryUtils')
+                newfile.write_text(content)
+
     # Delete destination folder if empty.
     if not any(destination.iterdir()):
         destination.rmdir()