Halloween Costume ideas 2015

PIPELINE / Import Vertex Color SOLVED

I have been researching and asking so many forums including Blender Artist forum, this one question:
"Can we import Vertex Color data into Blender?"

Surprisingly, I could not find the satisfactory answer anywhere!

Except, this one post reply at Blender Artist Forum by Michalis that seems to kind of confirming that it is possible, although no thorough explanation or example file to proof it:
http://blenderartists.org/forum/showthread.php?244589-PLY-from-MeshLab-into-Blender-with-Vertex-Color

So, PLY can really import vertex data? But how? Is it really true? Today, I can confidentially give you the final answer: YES, Blender can import Vertex Color!




PLY FORMAT IS THE ANSWER (RIGHT NOW)

After so many trials and errors, the answer to importing Vertex Color data is simply via: PLY file format.

I actually did try this PLY method sometimes ago, but with disappointing result. It didn't work. The reason being: because the other 3D package export out PLY but somewhat did not transfer to Blender.

Read my previous post on Vertex Color.
http://blendersushi.blogspot.com.au/2012/03/basic-working-with-vertex-color.html

I found out today that apparently you need the right PLY format with Vertex Color data that Blender can recognize and import correctly.

And this is exactly the problem: normally we cannot really tell or be sure if that particular PLY file contains the right data for Blender.

The reason with Export and Import (interoperability) being so troublesome is because:
1. Most 3D packages are limited in term of exporting and importing data.
2. So many broken links between 3D packages and lack of technical support in regards of export-import.
3. Particular 3D format is not always clear or transparent regarding what data it contained during export-import. You may lose data during export-import without knowing it.


FBX FILE FORMAT


The current export-import trend is by using FBX file format. FBX does actually export-import all kinds of data nicely between main commercial 3D packages.

Blender does not really have FBX Import at this moment, but maybe soon, I heard there is a development going on with this area.

So, in regards to Vertex Color, I have tried many other format to import vertex color:
- Collada DAE --> failed just because it is not very common and Blender Collada is also limited
- OBJ --> usually will not carry vertex data

All my experiment to import Vertex Color data into Blender has failed many times, until today, when I tried to export and import the Vertex Color data once more, and I was successful!

MY EXPERIMENT ON IMPORTING VERTEX COLOR DATA

All started with me being curious on how I could export-import Point Cloud (Particle Simulation) with Vertex Color data between 3D packages commercials <--> open source.

I want to be able to transfer animation between package (from Maya/Houdini into Blender), and more importantly I want to render it inside Blender, using Blender Cycles.

Vertex or Point Color Data is the tricky one. I am doing this test using Houdini. Houdini can handle and access component data with ease, so this is the reason I am using Houdini.



I did many kind of test, like assigning Vertex Color data into Points and also Primitives (Face). Storing Vertex Color inside the Points/Vertex seems to be the right way after so many test.

VERTEX COLOR: Houdini --> Maya via FBX
Houdini Polygon Mesh with Vertex Color can export out to Maya via FBX without problem.

Maya shows it in its 3D Viewport, but Maya Software does not render Vertex Color. Maya Hardware does. Renderman for Maya does render Vertex Color as well.

Mental Ray kind of does it, but need to use special Mental Ray Vertex Color node.



This is confirmed for Maya 2010, 2011. Somewhat failed on me on Maya 2012, because I only have the Student Version or maybe because Maya tends to do this. Anyway, that does not matter.


VERTEX COLOR: Houdini --> Blender via PLY
Next, I tried exporting Houdini Polygon Mesh as PLY (Houdini can export PLY data), and I import it into Blender. Unfortunately, this actually failed. I was disappointed.



VERTEX COLOR: Houdini --> Meshlab --> Blender via PLY
Today, out of curiosity, I am testing it again. From Houdini, I first triangulate the mesh so that Meshlab can correctly bring in the Vertex Color.

Apparently PLY export from Houdini is imported into Meshlab as colored mesh! This means, the color data is actually there (confirmed!).

NOTE: Meshlab is another Open Source tool that allow you to import all kind of Point Cloud data, normally from 3D scan.


This COLOR option under Vert for PLY export from MeshLab is the key answer.

Hey, why didn't the PLY from Houdini works directly when imported into Blender? That is the question I don't dare to answer. I really do not know the reason. Maybe PLY import in Blender is limited?

Anyhow from inside Meshlab, I tried exporting out PLY with COLOR options being checked.

Here comes the second surprise: When the PLY mesh exported from Meshlab being imported into Blender, this mesh has Vertex Color Data!

TESTING IMPORTED VERTEX COLOR IN BLENDER
Now, the Vertex Color Data does exist in Blender, we can finally do something with it.

It might not be so obvious at first (vertex color is not showing in 3D view by default), but if you turn on the Vertex Color for Material rendering, and hit RENDER, it will actually renders out the Vertex Color data beautifully.


And if we want to render in Blender Cycles, we can simply use Attribute node trick, to point into the Vertex Color data, and doing so will allow Cycles to render Vertex Color data.

Old trick: plug Attribute node (Vertex Color name) into Color.

Sometimes it is really handy to have Vertex Color on a mesh, meaning, you can kind of Skip UV until later and have coloring to happen on the Vertex level.

Vertex Color data imported into Blender from Houdini, rendered in Cycles.
Blender can also easily export out PLY into Houdini (natively supported). Not Maya, you probably need FBX to do so.

UPDATE 2012.06.12:
With Maya PLY Export-Import, you can use this:
https://sites.google.com/site/mayaplyimportexport/

I think this is an interesting found and hence this post.

WHAT NEXT?

From this little finding, the next question is: Apart from being able to render this Vertex Data, what would you want to do with this Vertex Color data anyway?

1. Dynamic Paint works with Vertex Color, so that is something to test. Vertex Color data can be baked out as texture as well.

2. I think what would be nice is for Blender to be able to create Particle Instance objects that inherit the Vertex Color. This is actually possible, but only via Python scripting. LIERO from Blender Artist showed me a little hack that does.

3. Can Blender Particles inherit Vertex Color data? No, the current Particle system does not do that, apparently. You could have colorful particle that is inherited from Material Texture, but not from Color Vertex data, unless you first bake it as image texture.

But, Blender new Particle System (node based), is potentially can do this. So.... that is something to look forward to.

4. 3D Printing and other things.

Eventually, maybe all this "dilemma" of export-import will be no longer exist. In the meantime, we probably should always find a way around things.

Anyways, we can say that Vertex (Point) Color Import is possible in Blender, it is "Quod Erat Demonstrandum" (Q.E.D) and no need to be questioned anymore! :)

UPDATE 2012.05.04
Any BMesh related "issue" regarding Vertex Color script maybe want to read this, hopefully useful:
http://blenderartists.org/forum/showthread.php?252333-Importing-vertex-color-for-bmesh

Typically I think there should not be issue using Vertex Color so you don't need to worry about it.

Post a Comment

MKRdezign

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget