Ver Fonte

- strip() is not the right way to remove substrings, replace() is the right one

Mr.doob há 15 anos atrás
pai
commit
1c729ec8a0
2 ficheiros alterados com 2 adições e 2 exclusões
  1. 1 1
      utils/export_threejs_25a2.py
  2. 1 1
      utils/export_threejs_25b.py

+ 1 - 1
utils/export_threejs_25a2.py

@@ -22,7 +22,7 @@ def write(filename, scene, ob, \
     if not filename.lower().endswith('.js'):
         filename += '.js'
 
-    classname = filename.split('/')[-1].strip('.js')
+    classname = filename.replace('.js','').split('/')[-1]
 
     if not ob:
         raise Exception("Error, Select the object to export")

+ 1 - 1
utils/export_threejs_25b.py

@@ -22,7 +22,7 @@ def write(filename, scene, ob, \
     if not filename.lower().endswith('.js'):
         filename += '.js'
 
-    classname = filename.split('/')[-1].strip('.js')
+    classname = filename.replace('.js','').split('/')[-1]
 
     if not ob:
         raise Exception("Error, Select the object to export")