Ply Import problem - vertex color

The interface, modeling, 3d editing tools, import/export, feature requests, etc

Moderators: jesterKing, stiv

Post Reply
ALoopingIcon
Posts: 1
Joined: Thu Sep 27, 2007 12:05 pm

Ply Import problem - vertex color

Post by ALoopingIcon » Thu Sep 27, 2007 12:24 pm

Hi all,
i was trying to import a ply file with per-vertex color but i did not succeeded in.

the python script importing ply seems that correctly understand and parse color but the color do not appear once loaded.

Saving a very simple mesh with vertex color seems to work correctly
(the saved ply is almost ok and can be correctly visualized with for example meshlab after correcting some things in the header like the comment)
Trying to re load this file into blender do not give back the saved colors.

Looking at the python code it seems that this script uses the NMesh deprecated access functions, that according to the documentation (http://www.blender.org/documentation/24 ... odule.html ) when used cause problems with the per vertex color layer:
Access to data such as properties, library, UVLayers and ColorLayers is not available further more, a mesh modified with NMesh will destroy inactive UV and Color layers so writing tools that use NMesh is discouraged.
Are my reasonings correct?
Can someone help me to correct this issue?

Here is a simple ply with vertex color as saved by blender (comment at the beginning of the ply removed)

Code: Select all

ply
format ascii 1.0
element vertex 24
property float x
property float y
property float z
property uchar red
property uchar green
property uchar blue
element face 6
property list uchar int vertex_indices
end_header
1.000000 1.000000 -1.000000 17 17 17
1.000000 -1.000000 -1.000000 17 17 17
-1.000000 -1.000000 -1.000000 0 0 0
-1.000000 1.000000 -1.000000 0 0 0
1.000000 0.999999 1.000000 147 147 147
-1.000000 1.000000 1.000000 129 129 129
-1.000000 -1.000000 1.000000 29 29 29
0.999999 -1.000001 1.000000 180 11 11
1.000000 1.000000 -1.000000 17 17 17
1.000000 0.999999 1.000000 147 147 147
0.999999 -1.000001 1.000000 180 11 11
1.000000 -1.000000 -1.000000 17 17 17
1.000000 -1.000000 -1.000000 17 17 17
0.999999 -1.000001 1.000000 180 11 11
-1.000000 -1.000000 1.000000 29 29 29
-1.000000 -1.000000 -1.000000 0 0 0
-1.000000 -1.000000 -1.000000 0 0 0
-1.000000 -1.000000 1.000000 29 29 29
-1.000000 1.000000 1.000000 129 129 129
-1.000000 1.000000 -1.000000 0 0 0
1.000000 0.999999 1.000000 147 147 147
1.000000 1.000000 -1.000000 17 17 17
-1.000000 1.000000 -1.000000 0 0 0
-1.000000 1.000000 1.000000 129 129 129
4 0 1 2 3 
4 4 5 6 7 
4 8 9 10 11 
4 12 13 14 15 
4 16 17 18 19 
4 20 21 22 23 

cyde
Posts: 6
Joined: Thu Oct 16, 2008 3:21 pm

Re: Ply Import problem - vertex color

Post by cyde » Thu Oct 16, 2008 6:03 pm

Hi

What's about the function Mesh instead of NMesh?
There is now a reference in the NMesh documentation to this function:

http://www.blender.org/documentation/24 ... odule.html


Unfortunately I have no Idea how to change/program blender with Python etc...

Thanks for any help

cyde

psullie
Posts: 554
Joined: Thu Sep 11, 2008 11:09 am
Location: Ireland

Post by psullie » Thu Oct 23, 2008 6:26 pm

Just to let you know, Blender 2.48a has fixed this, thanks goes to Ideasman for fixing the code.
imported Vertex colours now appear in the correct channel and will display in Texture Mode

gaeldk
Posts: 2
Joined: Mon Jul 08, 2013 8:27 pm

Post by gaeldk » Mon Jul 08, 2013 8:30 pm

Uping this topic as I can not get vertex colors to display in texture mode on Blender 2.67.

My mesh is a points cloud which displays just fine in MeshLab with vertex color information and exported/imported in PLY format.

I have a thread on this @blenderartists

http://www.blenderartists.org/forum/sho ... int-Clouds

psullie
Posts: 554
Joined: Thu Sep 11, 2008 11:09 am
Location: Ireland

Post by psullie » Mon Jul 08, 2013 9:52 pm

Hi
Blender will not display the vertex colour due to limitations in the way it draws on screen.

Here's a workaround, build your mesh in blender being careful not to alter the origin. Export as a triangulated UV mapped object
In meshlab import both your coloured pointcloud and new mesh and use the Filter: transfer Colour to Texture (between two meshes) to bake your vertex colour to your UV mapped texture. Both mesh and cloud must occupy the same place for this to work.

psullie

gaeldk
Posts: 2
Joined: Mon Jul 08, 2013 8:27 pm

Post by gaeldk » Tue Jul 09, 2013 3:54 pm

psullie wrote:Hi
Blender will not display the vertex colour due to limitations in the way it draws on screen.

Here's a workaround, build your mesh in blender being careful not to alter the origin. Export as a triangulated UV mapped object
In meshlab import both your coloured pointcloud and new mesh and use the Filter: transfer Colour to Texture (between two meshes) to bake your vertex colour to your UV mapped texture. Both mesh and cloud must occupy the same place for this to work.

psullie
Thanks that could work but the problem is that for building the mesh I need the visual clues of the colour on the vertices... it is visually very hard to work with a uni color points cloud... See what I meen ?

Alternatively I think I will then build the mesh automatically with a Poisson surface reconstruction script and use your suggested technique for baking the texture.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests