Converting grid to image and writing out png?

   3056   5   2
User Avatar
Member
88 posts
Joined: April 2020
Offline
Dear Experts,

This is probably super simple, but I haven't managed to figure it out. I have a grid upon which I've applied some colors, and I'd like to write it out as a png -- as if the grid and its colors were a photo. I've tried using the "Save > Texture UV to Image" menu option on uvtexture, but it seems to hang (see attached .hip example). I've tried using the python hou.saveImageDataToFile() method, but I can't figure out how to get the grid data into the required image format first.

Does anyone have suggestions? Do I need to move the data to a COPS network instead?

Thanks so much,
Mary
Edited by mgbaker - June 1, 2021 14:48:06

Attachments:
pic to write.png (254.2 KB)
image write.hip (381.0 KB)

User Avatar
Member
654 posts
Joined: Aug. 2014
Offline
I'd just bake it to file with Labs' Maps Baker.
PS. "Save > Texture UV to Image" only writes UVs as lines into image.
Edited by ajz3d - June 1, 2021 15:39:44

Attachments:
image write.hiplc (413.0 KB)
image write_color.png (9.2 KB)

User Avatar
Member
88 posts
Joined: April 2020
Offline
Thanks so much, ajz3d, this seems to do exactly what I need!

Mary
User Avatar
Member
720 posts
Joined: Sept. 2013
Offline
mgbaker
Do I need to move the data to a COPS network instead?

From what I've seen and done, you would first store the color values in a two-dimensional voxel field to then import them into COPs using the SOP import node.

I've uploaded various ways though on this page:
https://forums.odforce.net/topic/47032-weathering-texture-tool/ [forums.odforce.net]

This one might be close to what you need, albeit not simple:
https://forums.odforce.net/topic/47032-weathering-texture-tool/?do=findComment&comment=219309 [forums.odforce.net]
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
88 posts
Joined: April 2020
Offline
Thanks so much, Konstantin! I will study those examples. (Using the Labs Map Bake that ajz3d suggested indeed works, but at least as I'm currently using it it's rather slow when trying to use it on a stack of images. I might not be using the best settings.)

Thanks!
Mary
User Avatar
Member
654 posts
Joined: Aug. 2014
Offline
If it's always going to be a flat plane, you can also cheat your way out with Render COP.
Though I'm unsure if it's faster than Labs baker or not.

Attachments:
image_write.hiplc (409.6 KB)

  • Quick Links