Creating Generic Material Based on Mesh Preview Color Gradient

Hello, I am trying to create a very generic material based on the color gradient generated by the mesh vertices elevations. The goal is to link in this mesh into Revit and have the colors show up in a rendered view. [This simulation is of real-world floor sloping from a laser scan] I found a similar solution here: Render mesh made in GH with VRAY!!! - Grasshopper but I am not trying to make a vray material. I am having a hard time translating this workflow into a more generic material that could be baked into an obj export or something similar.

Mesh Preview to Material.gh (17.9 KB)

I have access to Rhino.Inside but I would like to solve this workflow in the simplest way possible before moving into Rhino.Inside. Thank you all for the help!

Hi @oliviamorgan20, sorry if I’ve misunderstood, but from that V-Ray-related discussion you’re referencing you should have ended up here? Is that more or less what you need?

Can you clarify this? If you bake the colorized mesh as-is, it’ll come with the color, which you can choose to export along with the OBJ. Does that suffice or do you want a rhino material and/or texture file generated?

1 Like

Hello René, Thank you very much for your response. I reviewed this post and tried to implement them with my workflow. I think I am looking for a Rhino material to be generated from the script. With that post I was able to make a PNG file based on my mesh, but I was not able to get the obj file to create. I then took that PNG and made a material in rhino with it and applied it to my mesh surface.

This is obviously not getting me the results I need. Is there a way to generate a PNG file that can be applied as a color texture in a generic Rhino material? Is this the right line of thought?

Hello
I can propose that with Nautilus plugin
generate a UV mesh, I remap to [0, 1] I didn’t test if Rhino allows different U but it is standard.

Don’t use more than one input in t on the Gradient Component

Then I generate an image of the gradiant, it make a file.
Then
Make a material in Rhinoceros and reuse the path of the PNG file (the one in panel)
Apply the material to the mesh with UV


testUV.3dm (658.8 KB)

PS image are copied to tmp folder at each change.
You can filter files created and delete them
“C:\Users\UserName\AppData\Local\Temp\Nautilus*”

Mesh Preview to Material.gh (23.2 KB)

2 Likes

Thank you so much for sharing this solution. I did not have your plugin, so I installed it from Food for Rhino. It looks like the latest version offered on that site is 2.0.0.7 but the script you sent me is referencing a later version. Nautilus | Food4Rhino When I open up the script the plugin specific components do not show up which makes me think they only exist in the latest unrelease version of Nautilus. Could you confirm if that is the case?

I ll have to check.
You can replace band image by square image but you need to have exactly npixels Ă— npixels colors so you must duplicate colors.

Strange, colors to band must be on 2.0.07 but whatever I updated package manager and food4rhino
And here a simplified way to output a mesh with texture coordinates and making the texture file (or band or square)

Outputting gradient to material.gh (17.4 KB)


This link is also a good ressource

1 Like

Thank you for working on this other option. I see you updated your plug in as well. I downloaded the latest version but for some reason those components are still missing. I made sure to follow your directions and unblock the gha and dll files as well. You can see in this screen grab the missing components and the latest version in my library.

I am on a work laptop. I am not sure if there are other restriction that are conflicting with this plug in. No need to keep working on this with me but it would be valuable to test this with friends on a few other computers to make sure all can install it with every component.

Hello
This is strange. As there is others component from Nautilus it seems it is still an old version that Rhino is using.
If you search for LDLIB.dll or other plugin file. There must be files on different locations.

If you use the component Nautilus license information it must write which folder it is using. You copy the panel data and post it here.

It seems you have installation in rhino 6 folder and surely another in rhino 7 or 8 folders.
Rhino 6 plugins folder
C:\Users\LaurentDelrieu\AppData\Roaming\Grasshopper\Libraries
Rhino 7 plugins folder
C:\Users\LaurentDelrieu\AppData\Roaming\McNeel\Rhinoceros\packages\7.0
Rhino 8 plugins folder
C:\Users\LaurentDelrieu\AppData\Roaming\McNeel\Rhinoceros\packages\8.0
Rhino 8 plugins folder
C:\Users\LaurentDelrieu\AppData\Roaming\McNeel\Rhinoceros\packages\9.0

So it seems you update in 6 something you don’t update in 8 or 9