How to compute Redshift MoGraph index ratios (RSMGIDRatioColor)?
-
Hi,
Can you help me find out the rule of how RSMGIDRatioColor works when it is applied to a cloner in Honeycomb mode? According to the document here: The index ratio of the clone as a grayscale color. I would expect the greyscale color for each instance would be (index/total number) or (1 - index/total number). This means instances color will from pure black to white or white to black. And when cloner is in Linear mode, it matches this as below snapshot shows.
However, when the cloner is in HoneyComb mode, the first instance looks like pure white, however, the last instance is far from black as the below snapshot shows.

So I'm wondering what the rule of RSMGIDRatioColor is for each instance when cloner is in Honeycomb mode.
Thanks!
-
Hey @BruceC,
Thank you for your question. I just checked, and what RS calls the index ratio does not really have much to do with indices and is instead based on the uvw coordinate of a particle. This might be a bug, but you would have to talk with the Redshift team for that. Anyway, find below some Python code to emulate computing that 'index ratio'.
Cheers,
FerdinandResult
I emulated your setup:

Code
import c4d import mxutils doc: c4d.documents.BaseDocument # The currently active document. op: c4d.BaseObject | None # The primary selected object in `doc`. Can be `None`. def main() -> None: """Called by Cinema 4D when the script is being executed. """ data: c4d.modules.mograph.MoData = mxutils.CheckType(c4d.modules.mograph.GeGetMoData(op)) uvw: list[c4d.Matrix] = data.GetArray(c4d.MODATA_UVW) for i in range(data.GetCount()): # That is how the 'index ratio' is computed, it is effectively just the shifted x-component # of the uvw coordinate of the particle. The color is then just (ratio, ratio, ratio). Not very # 'indexy'. ratio: float = 1 - uvw[i].x print(f"{i}: {ratio}") if __name__ == '__main__': main() -
FYI: The RS team just told me that they agree that this is a bug and that they will fix this. Please reach out via our beta forums for details.
So, the code I showed you has an expiration date.
-
Thank you for the reply, Ferdinand.
I don't have access to the beta forums, can I assume the fix will make RSMGIDRatioColor act something like below for HoneyComb?(index/total number) or (1 - index/total number)Cheers
-
Hi @BruceC,
correct, the RSMGIDRatioColor is (tentatively) expected to behave as
index / total_number.
You can check the index in the Transform -> Display attribute of the cloner object (check the screenshot below).Cheers,
Ilia
-
Hey Bruce, multiple people in your company have access. When you do not, reach out to us, so that we can set you up.
-
@i_mazlov Thank you for confirming, Ilia!
-
@ferdinand Thanks!