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

Merge branch 'dev' of https://github.com/mrdoob/three.js into dev

......@@ -124,7 +124,7 @@ def buffer_normal(mesh):
for vertex_index in face.vertices:
normal = mesh.vertices[vertex_index].normal
vector = (normal.x, normal.y, normal.z)
vector = (normal.x, normal.y, normal.z) if face.use_smooth else (face.normal.x, face.normal.y, face.normal.z)
normals_.extend(vector)
return normals_
......@@ -356,7 +356,7 @@ def faces(mesh, options, material_list=None):
if vertex_normals:
for vertex in face.vertices:
normal = mesh.vertices[vertex].normal
normal = (normal.x, normal.y, normal.z)
normal = (normal.x, normal.y, normal.z) if face.use_smooth else (face.normal.x, face.normal.y, face.normal.z)
face_data.append(normal_indices[str(normal)])
mask[constants.NORMALS] = True
......@@ -899,7 +899,7 @@ def _normals(mesh):
for vertex_index in face.vertices:
normal = mesh.vertices[vertex_index].normal
vector = (normal.x, normal.y, normal.z)
vector = (normal.x, normal.y, normal.z) if face.use_smooth else (face.normal.x, face.normal.y, face.normal.z)
str_vec = str(vector)
try:
......
......@@ -481,6 +481,19 @@ def extract_mesh(obj, options, recalculate=False):
obj.select = False
obj.hide = hidden_state
# split sharp edges
original_mesh = obj.data
obj.data = mesh_node
obj.select = True
bpy.ops.object.modifier_add(type='EDGE_SPLIT')
bpy.context.object.modifiers['EdgeSplit'].use_edge_angle = False
bpy.context.object.modifiers['EdgeSplit'].use_edge_sharp = True
bpy.ops.object.modifier_apply(apply_as='DATA', modifier='EdgeSplit')
obj.select = False
obj.data = original_mesh
# recalculate the normals to face outwards, this is usually
# best after applying a modifiers, especialy for something
# like the mirror
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册