Apply random textures from folders

   1327   2   1
User Avatar
Member
385 posts
Joined: 7月 2018
Offline
i have this geo and i want to apply random textures from a folder hierarchy. How can i read each texture from its own folder.
Lets say ten textures in ten different folders on my drive.
First of all how should i lay my UVs, each plane needs each own tile? do i need to generate udims? never done that before
Edited by papsphilip - 2019年9月11日 15:22:55

Attachments:
geo.bgeo (90.1 KB)

User Avatar
Member
385 posts
Joined: 7月 2018
Offline
So i friend of mine helped with some python code, so now i can select a folder randomly and then get the first image of the sequence with a little tweaking i managed to plug it in a quickshade and converting the file numbers to $F4 or $F3.

BUT!! although i have the iterations for the foreach meta node as a seed for the python script, the same image applies to all primitives

Can someone shed some light on this problem, this is the first time messing around with python and its hard to understand whats wrong

Attachments:
untitled.bgeo (180.5 KB)
test.hip (241.8 KB)

User Avatar
Member
385 posts
Joined: 7月 2018
Offline
i've done some more progress and i am one step before nailing this!! so within a python node i read folders and take the first image from each. i also convert the last part of the path to $F3 or $F4 depending on the sequence.
So i have a list of all the paths and i write them as detail attributes, so that i can choose in a random fashion later and apply to each primitive.
Problem occurs, the LAST problem i hope, when try to read this detail string attribute (CSequences/image.$F3.jpg) from a material node like this `@path0` using the local material override

if i expand the expression this is what shows up CSequences/image.$F3.jpg

but when i write a path directly to that string field this is what shows up CSequences/image.001.jpg

the second attempt shows that the sequence gets recognised but for some reason through the detail string attribute the $F expression doesnt get recognised.

Hope this is clear,any tips much appreciated!

Attachments:
random_sequences_V2.hip (321.9 KB)
untitled.bgeo (180.5 KB)

  • Quick Links