Open the Grasshopper Script
Set render mesh(s) the the Mesh Component, if there are many meshes, use Mesh Join
Choose the number of pixels for the texture file (512, 1024 …)
Click on do the work
The component will output a list of points (XYZ)
Transform these point to colors
Give a path for a texture file, just PNG output at the moment, if extension is not png it will be changed to PNG
Click on “Do The Work”
Wrapping texture on meshes was something I always seen on other softwares but completely miss on on rhino.
I can see many situations where this might come handy by creating ultra-light models with alpha channel and disabled filtering.
Thanks for sharing this, Laurent!
@nathanletwory it could be interesting to do the same with texture generator in Rhinoceros/Cycle/Grasshopper. Do you know if it is possible to get the color in physical space (xyz) not UV space? At the moment all the tools in Rhinoceros works well, thanks for that. I had some problem with Texture Matching but I wasn’t able to repeat simply the error in order to post the problem!
You’d determine the UV coordinate based on the XYZ coordinate. Lets ask @Jussi_Aaltonen what the SDK tools in Rhino are to do this, he maintains the texture baking code in Rhino.
It’d be quite interesting to bake Cycles textures indeed. Cycles has bake functionality where for one or more objects the entire raytracing process is baked to texture but that I haven’t hooked up. So in addition to the normal albedo pass you’d get everything you’d choose - shadows, highlights, etc. That is commonly used to speed up rendering in especially animations and game models.