0
$\begingroup$

Trying to import model to Blender 2.67 using guide:

http://wiki.xentax.com/index.php/Blender_Import_Guide#Vertex_normals

But importing normals doesn't work.

Code sample:

...
mesh = bpy.data.meshes.new(obname)
mesh.from_pydata(vlist, edges, faces)

from bpy_extras import object_utils
object_utils.object_data_add(context, mesh, operator=None)
...
vindex = 0
for vertex in mesh.vertices:
    vertex.normal = (0, 0, 1)
    vindex += 1

All normals must be oriented along z, but they seems to be random.

enter image description here

$\endgroup$
0
$\begingroup$

It seems like importing normals is impossible with 2.67 version of Blender. Blender recalculates them manually.

But for version 2.74 you can import custom normals using code sample:

normals2 = []
for l in mesh.loops:
    normals2.append(nlist[l.vertex_index])
mesh.normals_split_custom_set(normals2)
mesh.use_auto_smooth = True
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.