CINEVERSITY

  • Recent
  • Popular
  • Users
  • Groups
  • Login
Maxon Logo
  • Login
  • Search
  • Recent
  • Popular
  • Users
  • Groups

Switch texture in Redshift material based on object name

Question & Answers
texture redshift combinations userdata shader switch
2
5
969
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B
    Bar3nd last edited by Dr. Sassi Aug 30, 2023, 6:01 AM Aug 28, 2023, 2:59 PM

    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

    1 Reply Last reply Reply Quote
    • Dr. Sassi
      Dr. Sassi last edited by Dr. Sassi Aug 28, 2023, 6:13 PM Aug 28, 2023, 6:09 PM

      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=string

      If 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=jlK02hj4R14

      My 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.zip

      login-to-view

      All the best

      Dr. Sassi Sassmannshausen Ph.D.
      Senior Trainer, Maxon Master Trainer, L&D - Strategist
      Cinema 4D mentor since 2004, Member of VES, DCS.

      1 Reply Last reply Reply Quote
      • B
        Bar3nd last edited by Aug 29, 2023, 7:35 AM

        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!

        1 Reply Last reply Reply Quote
        • Dr. Sassi
          Dr. Sassi last edited by Aug 29, 2023, 4:55 PM

          Hi Barend,

          Sounds good, thanks for the feedback.

          My best wishes for your project.

          Dr. Sassi Sassmannshausen Ph.D.
          Senior Trainer, Maxon Master Trainer, L&D - Strategist
          Cinema 4D mentor since 2004, Member of VES, DCS.

          1 Reply Last reply Reply Quote
          • Dr. Sassi
            Dr. Sassi last edited by Dr. Sassi Aug 30, 2023, 6:00 AM Aug 30, 2023, 4:53 AM

            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

            Dr. Sassi Sassmannshausen Ph.D.
            Senior Trainer, Maxon Master Trainer, L&D - Strategist
            Cinema 4D mentor since 2004, Member of VES, DCS.

            1 Reply Last reply Reply Quote
            5 out of 5
            • First post
              5/5
              Last post