提交 bd2dc37e 编写于 作者: M Mr.doob

(alteredq fix)

Changed mesh JS class name generator in Blender exporter to use cross-platform path parsing.
Old version was generating broken class names on Windows (full path was included).
上级 4da30fb3
......@@ -17,7 +17,7 @@
# ##### END GPL LICENSE BLOCK #####
# Based on export_ply.py
# Contributors: Mr.doob, Kikko
# Contributors: Mr.doob, Kikko, alteredq
"""
This script exports the selected object for the three.js engine.
......@@ -25,22 +25,23 @@ This script exports the selected object for the three.js engine.
import bpy
import os
import os.path
def save(operator, context, filepath="", use_modifiers=True, use_normals=True, use_uv_coords=True, use_colors=True):
def rvec3d(v):
return round(v[0], 6), round(v[1], 6), round(v[2], 6)
def rvec2d(v):
return round(v[0], 6), round(v[1], 6)
scene = context.scene
obj = context.object
if not filepath.lower().endswith('.js'):
filepath += '.js'
classname = filepath.split('/')[-1].replace('.js','')
classname = os.path.basename(filepath).split(".")[0]
if not obj:
raise Exception("Error, Select 1 active object")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册