CINEVERSITY

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

    Equivalent of Vertex Attribute for MoGraph clones?

    Question & Answers
    2
    10
    389
    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.
    • V
      vincent.hardy last edited by vincent.hardy

      Hello,

      I am working on a project where I need to drive both the brightness and opacity of clones. I have a Python script which computes a point cloud for where the clone should be placed, as well as two weight maps, one for the brightness and one for the alpha. I am looking for solutions to use these weight maps in the RedShift material applied to the cloner. I have a solution which works, but I am not sure it is the most adequate.

      I came up with the attached file as a solution, and I did my best to use fields wherever I found possible. I am attaching the test file that illustrates my current working solution.

      brightness_and_alpha-test.c4d

      Essentially, it uses two Effectors, one to drive the RSMGColor attribute value, and another to drive the RSMGWeight. One of the Effectors affects the Weight, and the other the Color. I can then use these two attributes through a Scalar User Data node in my RedShift material.

      My question is: is there a better solution? In particular, is there a method equivalent to using a Vertex Attribute node which points to a Vertex map, but for MoGraph weights? I was looking for something like a Weight Attribute node where I could set the Attribute Name to my weight map's name, or something like it, but I could not find anything like this. I love that the Vertex Attribute is very versatile and simple for geometry shading, and am looking for something similar.

      Thanks in advance for your help. I hope I am not missing the obvious!

      1 Reply Last reply Reply Quote
      • Dr. Sassi
        Dr. Sassi last edited by Dr. Sassi

        Hi contribution-stage,

        I would not think of anything that would cause less effort than your setup, while not using code for MoGraph. I have suggested similar setups in the past, and so far, I have not gotten negative feedback on them.

        However, here is an alternative:
        CV_2025_drs_25_MGwv_01.c4d
        Please test this in your setup carefully, as the Vertex maps will store a value for every point, which can get heavy.

        Screenshot 2025-02-17 at 12.06.14 PM.jpg

        With Python, you are between chairs here, as this forum is strictly code-free for security reasons. The forum for Python is here:
        https://developers.maxon.net/forum/

        When I get your full setup (not part of the file above, and thanks for leaving the code out!), then my suggestion would be to use the Python Effector to set the RGB and Weight (Alpha in your case) and use the data you have to influence the value that you need.
        Less elements, but if that is less work - you pick.

        My best wishes

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

        V 1 Reply Last reply Reply Quote
        • V
          vincent.hardy @Dr. Sassi last edited by

          @Dr-Sassi

          Hi Dr Sassi,

          Thanks for the fast response again :-).

          Hi contribution-stage,

          I updated my profile so that my name is no longer contribution-stage, good you pointed it out!

          However, here is an alternative:

          Thanks for the alternative, using a variable tag to define a vertex map on the cloner. I tested it in my set up (simplified, below), and it holds up on my system, even though I see the Memory usage go up in Activity Monitor.

          With Python, you are between chairs here, as this forum is strictly code-free for security reasons. The forum for Python is here:
          https://developers.maxon.net/forum/

          I understand the word of caution about Python. I hope I had no code left in the file I sent but if I do have questions about Python, I will go to the developer forum you pointed me to.

          When I get your full setup (not part of the file above, and thanks for leaving the code out!), then my suggestion would be to use the Python Effector to set the RGB and Weight (Alpha in your case) and use the data you have to influence the value that you need.
          Less elements, but if that is less work - you pick.

          Here is my full set-up (actually, still simplified a bit, but it has the approximate scale (in number of clones ) that I am using. This test file has both my original approach and also your solution with Vertex Maps. I am interested in understanding how to you a PythonEffector to modify a clone's color and alpha to use in the RedShift shader but I have not researched that yet.

          brightness_and_alpha-test.c4d

          Thanks again,
          -v

          1 Reply Last reply Reply Quote
          • Dr. Sassi
            Dr. Sassi last edited by

            Hi vincent.hardy,

            Thanks for exploring it, and yes, as mentioned, memory can go up (store a value for every point). I think it is always good to know some more options.

            Did I get the same scene again? I checked, and nothing was hidden via layers or Takes.

            Code and Python, thanks for keeping it out of the forum. Whenever something is posted with code, I will not hesitate to take care of it. Code is powerful, and that makes it dangerous. Thanks for understanding!

            According to the manual's comment, "alpha" in MoGraph is slightly smaller with Fields, but I hope that has not affected anything else. Please explore what information could be used.

            Since Colors can be created via Ramp based on gray values, it is easy to see that R, G, and B (interpreted as Linear) could be used as three independent information channels — one drive gray values (for a Ramp), the next the alpha information, and a third something else.

            If you find yourself limited and have an idea, please always use the "Share Your Ideas" here:
            https://www.maxon.net/en/support-center

            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.

            V 1 Reply Last reply Reply Quote
            • V
              vincent.hardy @Dr. Sassi last edited by

              @Dr-Sassi

              Hi Dr. Sassi,

              Thanks for the feedback. Sorry for attaching the wrong file. Here is the right one:

              alpha-brightness-set-up.c4d

              Cheers,
              -v

              V 1 Reply Last reply Reply Quote
              • Dr. Sassi
                Dr. Sassi last edited by

                Thank you, vincent.hardy.

                Out of curiosity, I checked if the RS Render Object in "Matrix" mode could save some render time, but I can't see any real improvements.

                Enjoy 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
                • V
                  vincent.hardy @vincent.hardy last edited by

                  @vincent-hardy Thanks Dr Sassi. I'll share my idea at the support center for a MoGraphWeight node for RedShift materials, it seems it would be handy.

                  1 Reply Last reply Reply Quote
                  • Dr. Sassi
                    Dr. Sassi last edited by Dr. Sassi

                    Thank you for doing that, vincent.hardy.

                    This will be a good addition to the Materials Nodes, User Data, and MoGraph-Weight.

                    I'm biased here, as MoGraph Weight was my idea (back in the day), so I love to see it growing and connecting inside the app. Thank you!

                    My best wishes

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

                    V 1 Reply Last reply Reply Quote
                    • V
                      vincent.hardy @Dr. Sassi last edited by

                      @Dr-Sassi Nice, grateful for the MoGraph weights, they are such a useful too!

                      1 Reply Last reply Reply Quote
                      • Dr. Sassi
                        Dr. Sassi last edited by Dr. Sassi

                        Thank you very much for the feedback, vincent.hardy

                        Cheers

                        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