paulmelis / blender-ply-import

A Python module for faster import of PLY models in Blender
BSD 2-Clause "Simplified" License
23 stars 5 forks source link

Unsure how to use the Addon #2

Open jeongjoonpark opened 5 years ago

jeongjoonpark commented 5 years ago

Hi Paul, very nice work on writing the importer -- I was frustrated the blender native ply importer was ignoring my per-vertex normals.

However, since I'm quite new to Blender, I am exactly sure how to use this program. Could you maybe provide steps to install and use this addon in Blender?

Thank you very much!

jeongjoonpark commented 5 years ago

Hi Paul, I figured that it works on command line, not dedicated UI. I was able to import a ply file.

However, it seems like, after importing, Blender is using per-face normal, ignoring my per-vertex normal (image below shows non-smooth normals). Do you know how to force blender the use the per-vertex normal, and how do I make sure that the Blender has indeed successfully loaded my vertex normals?

Thank you very much.

image

jeongjoonpark commented 5 years ago

I figured it out. It seems like we're using a different Blender version?

At L66 of mesh_readply.py file I placed the following code: ` if 'vertex_normals' in p:

n = p['normals']

for i, v in enumerate(mesh.vertices):

    v.normal = -Vector((n[3*i+0], n[3*i+1], n[3*i+2]))

`

paulmelis commented 5 years ago

I figured it out. It seems like we're using a different Blender version?

@jeongjoonpark what blender version are you using?

jeongjoonpark commented 5 years ago

@paulmelis using Blender 2.78c

paulmelis commented 5 years ago
v.normal = -Vector((n[3*i+0], n[3*i+1], n[3*i+2]))

The fact that you need to use the inverted normal seems to suggest your 3D model is using a coordinate system with a different handedness from Blender. Does your data come from a left-handed coordinate system?

If you attach the model you're trying to import I can test it myself with 2.79