Equivalent of Vertex Attribute for MoGraph clones?
-
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.
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!
-
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.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
-
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.
Thanks again,
-v -
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-centerMy best wishes for your project
-
Hi Dr. Sassi,
Thanks for the feedback. Sorry for attaching the wrong file. Here is the right one:
Cheers,
-v -
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.
-
@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.
-
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