algorithmic modeling for Rhino

hello, i'm having issues with colored mesh baked out of grasshopper.
I bake the GH object and get a colored mesh (not a texture, right??), let's say a gradient.

Then i switch the viewport to 'rendered', or render it, and it displays the right colors.

When i try to export my model to another format, as obj or 3ds for instance (i want to upload the colored mesh on a website which doesnt accept 3dm) i get just a blank geometry.

question: HOW TO PRESERVE MESH COLORS WHEN EXPORTING? or relative workarounds

 Maybe someone can help with this? thanx

Views: 5059

Replies to This Discussion

The attached script should work better and faster than the one posted in those threads.

The top viewport is set to IRay for Rhino, which doesn't support vertex colors. Uses the mapped bitmap that the script generates.


Thanks Vicente for the script!

My mind finally absorbed the process :)  Here is an example using Keyshot

The colors in the render and viewport capture don't seem to match. Are you sure it's working for you?

I was not quite happy with the color.png file in GH. Nevertheless in Keyshot I can make more changes to the color.png, file such as Scale, Shift along x,y or z and more. I think its working....thanks again!

hi Kim. can u explain how it worked for you.

im trying the script however i can not make work for me.

what file should i save the material as?(you wrote pgn file??) and how to upload it to keyshot.


It doesn't save a material, it saves a texture. Yes, as a PNG image.

In Keyshot you have to create a new material and assign that texture, usually as the (diffuse) color of the material, or you can assign it to any other material property, like reflectance, etc.

Thanks for this!  It took me some time to figure out how to make the new script do what the old one does, but now I'm happy.  This is my first technically-OK render, in Maxwell:

I translated Vicente's script into Python and added a flag that makes it automatically write the OBJ file.


Update: this version doesn’t strip alphas from colors: if the vertex colors have alpha component, so will the texture PNG.

It also outputs the mesh with the texture map and with vertex colors stripped. This last because it doesn’t really make sense to have both sources of color active, but if you don’t want to strip the colors then comment out m.VertexColors.Clear().

And if you want a baked mesh that has a material with the texture map, comment out rs.DeleteObject at the end.






  • Add Photos
  • View All

© 2023   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service