CINEVERSITY

    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
    402
    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

      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

        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

        Screen Shot 2023-08-28 at 11.10.19 AM.jpg

        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

          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

            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

              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
              • First post
                Last post