Keep PictureFrame material when baking manipulated Grasshopper surface


(Behoyle) #1

Hello all,

I’m working in grasshopper to manipulate an image I imported into Rhino using PictureFrame. My script takes the picture from rhino as a surface, then splits it into smaller surfaces and scales each one. I’d like to be able to bake the scaled picture fragments back into rhino, but baking just returns the scaled surfaces as blank, without the original picture material.

Are there any ways to manipulate images in grasshopper other than linking to a rhino PictureFrame surface? Can grasshopper maintain material properties when baking?

I attached a screenshot of my script. Please let me know if I should add other information.

Thanks for your help,
Ben


(Andrew Heumann) #2

Object Attributes contain information like materials, layers, object color, etc - largely speaking Grasshopper ignores these. Human offers a number of tools for working w/ object attributes. In the particular case you’ve described here, a simple c# script paired with Human should do the trick:


preserveAttributes.gh (10.4 KB)

If you want to get fancier, a few more Human components + scripts can assist. You can extract the path to the bitmap file the picture frame surface is using, preview the bitmap textures in GH, and customize the way the texture is mapped onto your modified surfaces (tho for this to work you have to convert them to meshes: )


preserveAttributes.gh (14.6 KB)


(Behoyle) #3

Great, thanks Andrew!