Switch texture in Redshift material based on object name
-
Hi,
So I have a bunch of identical objects (think typewriter keys). They all need the same material - but with a different graphic on them. I have all the graphics as separate files.
I could duplicate the materials and swap out the textures but then each adjustment to the material would have to be managed across all the copies.
What would be nicer of course is the ability to use the object name to select the corresponding texture. For instance: object name is "1", so the texture "1.png" is loaded.
I imagine something like this might be possible with 'string' user data or something, but I don't really know how to start.
Cheers,
Barend
-
Hi Barend,
This would perhaps require a lot more than just the object name. It works via User Data, which would need to created and filled first, then comes a longer evaluation, which is not even detailed in the menu. That would be a tutorial request.
https://help.maxon.net/r3d/cinema/en-us/Default.htm#html/String+User+Data.html?Highlight=stringIf you use Redshift 3D and some kind of Social media, you might have seen Saul's replies. Here is a Houdini based preview of the workings:
https://www.youtube.com/watch?v=jlK02hj4R14My suggestion would be to prepare a top view from the keys and create a single flat texture for all keys. That can be on the left, while on the right side the material tag contains the perhaps a more details surface material.
Here is a quick example:
https://stcineversityprod02.blob.core.windows.net/$web/Cineversity_Forum_Support/2023_PROJECTS_DRS/20230828_CV4_2023_drs_23_RStw_01.zipAll the best
-
Thanks, I did indeed catch Sauls video which led me to the string user data. It looks like this would be too complex for my scripting skills at this point. I had thought about your suggestion to do a single flat texture - but the objects are all individually animated clones so I dismissed that. But thinking about it some more I realize I could make it a single texture with all the symbols in a row, and offset the UV mapping per object. So thanks!
-
Hi Barend,
Sounds good, thanks for the feedback.
My best wishes for your project.
-
P.S.: Here are two ideas.
https://stcineversityprod02.blob.core.windows.net/$web/Cineversity_Forum_Support/2023_PROJECTS_DRS/20230829_CV4_2023_drs_23_RStb_01.zip
(render it)
Instead of typing the Offset manually, the Cloner could do that with a Blend setting. Linear and simple. Then use an Inheritance Effector/Matrix to position the Clones.
The other file uses UserData Integer to drive a Shader Switch; I used the Blend option again. (The Cubes have User Data)Enjoy