Quellcode durchsuchen

Fixed BufferGeometryUtils import

fabian0702 vor 1 Jahr
Ursprung
Commit
edd63077d6
1 geänderte Dateien mit 9 neuen und 0 gelöschten Zeilen
  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()