dynamic texture from phyton shell

   2467   5   2
User Avatar
Member
20 posts
Joined: 12月 2011
Offline
hi all magicians,

this command shows me the texture im using on my material for the geometry:

print hou.node(“./mat/clay”).parm(“basecolor_texture”).eval()

i can change to a new texture:
hou.node(“./mat/clay”).parm(“basecolor_texture”).set(“path_to_the_new_texture”)

I would like to create a dynamic texture in the shell by giving a color and write letters and numbers on it, all inside houdini so i can feed this to a neural netowork that has to learn.
User Avatar
Member
20 posts
Joined: 12月 2011
Offline
up
User Avatar
Member
682 posts
Joined: 9月 2013
Offline
Why does it have to be done in python shell? Couldnt you just use COPs?

Attachments:
rand_numbered_textures.hipnc (22.1 KB)

https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
20 posts
Joined: 12月 2011
Offline
Hi Konstantin thank you for your feedback, I see that through COPs i can create a texture as you did and $I does change numbers but what about text and numbers? I can create a material and point to that cop texture which is great.

However Im creating textures generated from phyton code and I would like to call it in Houdini.

num_pictures = 100
save_folder = “/home/directoy/textures/automated_ready/”
extension = “.jpg”

for i in range(num_pictures):
random_y = (np.random.rand(1)- 0.5) * 2
random_x = (np.random.rand(1) - 0.5) * 2
img = generate_images_0(
cylinder_radius=1.2,
cylinder_height=0.8,
cylinder_center=Point3D(3 + random_x, 0.3 + random_y, 0),
code=“011”,
padding=0.1,
num_jets_for_noozle=100,
noozle_cone_angle=Angle(0.01),
resolution=300,
diffusion_length=0.05,
point_ink_density=5
)
User Avatar
Member
483 posts
Joined: 12月 2006
Offline
what should be the final result ?

Is it not better to pre generate the images and then
assign them via prim attribute, like:
s@material_override= “{'basecolor_texture':'uvgrid_grey.pic'}”;
or use material overrides to generate this attribute.

You can use a Python Node or Textport to execute your Code,
to regenerate then the textures.
English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
20 posts
Joined: 12月 2011
Offline
no the idea is to make the texture in real time
  • Quick Links