Jump to content

Load Images from Directory and Map to Objects (randomly)


z3r0

Recommended Posts

Hi,

I'm trying to load multiple images from a directory and map them to multiple copies/instances of a cube (cube attached to points on a grid) which I later want to attach to particles

or animate.

The images would need to map to only one face of the cube and not repeat.

I'm trying to avoid manually mapping each image to each cube as I don't know the exact number of images in the folder.

I found these that might help:

Image sequence and sprites

TV copy

For example look at the image grid here:

(Jump to 2:51)

Each image would need to be manually added to each square. Now if I could automatically load them from a directory (or image sequence)

to each corresponding slot I would save lots of time.

Each slot would be a cube (instanced on grid), would love to attach each instance to particles and animate.

Any ideas on how to approach?

Thanks!

Edited by z3r0
Link to comment
Share on other sites

Have a look at this:

The example hip file there shows you how to override material parameters on a per-point/instance basis. Which is most likely what you want / need for your random textures.

Remember, to make things really easy for yourself, keep your texture names consistent, for example:

- name all your images numerically, like: 0.exr, 1.exr, 2.exr, etc.

This will allow you to override, say, a texture parameter on your shader with something like:

/my/random/pics/$PT.exr

Obviously, the texture name expression will become a little more involved but the above is just to get you started.

HTH.

CheerZ,

Van Aarde.

Edited by nanocell
  • Like 1
Link to comment
Share on other sites

Great find Van!

This will definitely help, I'll post progress as soon as I can!

-z3r0

Have a look at this:

The example hip file there shows you how to override material parameters on a per-point/instance basis. Which is most likely what you want / need for your random textures.

Remember, to make things really easy for yourself, keep your texture names consistent, for example:

- name all your images numerically, like: 0.exr, 1.exr, 2.exr, etc.

This will allow you to override, say, a texture parameter on your shader with something like:

/my/random/pics/$PT.exr

Obviously, the texture name expression will become a little more involved but the above is just to get you started.

HTH.

CheerZ,

Van Aarde.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...