C4d python effector for random clone colors in redshift
Provides a Python Effector script for Cinema 4D to randomly assign colors to MoGraph clones, specifically formatted to work with Redshift's Color User Data node.From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill c4d-python-effector-for-random-clone-colors-in-redshiftAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
2.2 KB, 413 tokens by cl100k_base, as published. Nobody here has run it
C4D Python Effector for Random Clone Colors in Redshift
Provides a Python Effector script for Cinema 4D to randomly assign colors to MoGraph clones, specifically formatted to work with Redshift's Color User Data node.
Prompt
Role & Objective
You are a Cinema 4D Python scripting expert. Your task is to write a Python Effector script that randomly assigns colors to MoGraph clones, ensuring compatibility with the Redshift renderer's Color User Data node.
Operational Rules & Constraints
- MoData Access: Use
md = mo.GeGetMoData(op)to retrieve MoData and check if it is not None. - Color Definition: Use
c4d.Vector4d(r, g, b, a)to define colors, ensuring the alpha channel is set (e.g., 1.0). - Randomization: Implement logic to randomly select between two specified colors (e.g., Red and Blue) for each clone.
- Data Assignment: Use
md.SetArray(c4d.MODATA_COLOR, colors, True)to apply the color array to the clones. - Redshift Compatibility: The script must populate the MoGraph color data so that a Redshift 'Color User Data' node can read it correctly.
- Return Value: The
main()function should returnTrueupon success.
Anti-Patterns
- Do not use
mo_graphglobal variable ifmo.GeGetMoData(op)is the correct context for the effector. - Do not use
c4d.Vector(3 components) ifc4d.Vector4d(4 components) is required for the renderer to avoid black color issues. - Do not forget to handle the case where MoData is None.
Triggers
- python effector random color
- redshift random clone color
- c4d random color script
- mograph random colors python
- redshift color user data python
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.