FBX export mesh with vertices color

Hi, I try to export 2 meshes with color on vertices to FBX. But when I import the FBX file the result is that one mesh has its colors and the other doesn’t show the colors. How can I solve this problem?

Rhino file
test mesh vertices color.3dm (47.4 KB)

FBX file
test mesh vertices color fbx.zip (2.9 KB)

It has something to do with the row LayerElementUV: or LayerElementColor: in the fbx file.

The wrong mesh representation is exported as LayerElementUV:
And the right mesh representation is exported as LayerElementColor:

How can I contol this?


I made a fix for this problem by recreating the mesh by attached rhino script.

Rhino_MeshColorFix.py (235 Bytes)

Then it works?


There indeed appears to be a problem with exporting vertex colors for your mesh called “Wave”.

I have logged this as https://mcneel.myjetbrains.com/youtrack/issue/RH-48914 for further investigation.

Hi Nathan a solution in the future should be nice.
For now I have a work around by using the rhino script.


The workaround is indeed fine, but I hope to get to the bottom of this sometime soon.

The attached python script worked for keeping the vertex colors when I export to fbx and reimport to rhino, however, it removed all UV texture mapping. Is there any plan to fix the default rhino fbx export? I looked and it didn’t appear that there was a python method to get texture? Material Texture or MeshHasTextureCoordinates didn’t seem to do the trick, but i’m more comfortable in C# so I could be wrong?

original mesh (left is shaded view, right is rendered)

default fbx export

python fbx export

vertex_color_testing.3dm (176.8 KB)

This file is created with Rhino 5. FBX vertex color export has been fixed in Rhino 6.

@matthewjosephconway can you also post the original model prior to exporting to FBX?

Correct, the original file was created in Rhino 5. I’ve attached the same file in Rhino 6 and added a layer for the Rhino 6 fbx export test, which seems to not capture the vertex colors still. (in the rhino file I have four layers: “original_mesh_rhino_5” this is what I’m trying to export as an fbx and reimport into rhino and have it still maintain the vertex colors and texture mapping, it is an original mesh created in rhino 5, no imported into rhino). “default_fbx_export” is the Rhino 5 export. “python_fbx_import” is using the python script mentioned in this post, then exporting from Rhino 5 as fbx and reimporting into Rhino. “rhino6_default_fbx_export” is my attemp at exporting “original_mesh_rhino_5” in Rhino 6 and reimporting, but as you can see from the image it still isn’t working for me (i’ve also included the texture map I’m using at the very bottom).

vertex_color_testing_rhino6.3dm (192.1 KB)

From Rhino 6 I exported the object on the default layer of your v6 file to FBX (version 7 ASCII in case I wanted to inspect the exported contents).

I then imported the resulting file back into Rhino 6. As far as I can tell this all works as should.

vertex_color_roundtrip_test_fbx_rhino6.zip (222.8 KB)

I checked your file again and realised that it is created with 6.11. The vertex color bug I fixed in the first 6.12 release candidate (Rhino 6 SR12 Release Candidate Available).

6.12 is now out, so you may want to update to that.

Thanks Nathan, the upgrade from 6.11 to 6.12 did the trick! I noticed it only works with Version 7 binary/ascii and not Version 6. What does the rhino script look like for specifying Version 7? If Version 7 was the last fbx export I made, my script runs fine, but if my last fbx export was Version 6, then it doesn’t work.

This line of code works:
Rhino.Command "-Export " & strFile & " _Enter" & " Enter", 0

This line of code does not work:
Rhino.Command "-Export _Version=Version7binary" & strFile & " _Enter" & " Enter", 0

I’m not sure how to do that on the command-line.

@tim, how can one specify which FBX version to save as through the command-line?

I’m not good at scripting myself. But I did confirm that setting the version option in the command line is working. I know that the -export part must come first because that’s how Rhino determines which plugin to get subsequent command line i/o options. This will get you the command line options, for instance.

-saveas "C:\Users\tim\Desktop\junk.fbx"

Looks like “ExportFileAs” is what you set for the FBX flavor.