AutoSkill 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.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/c4d-python-effector-for-random-clone-colors-in-redshift" ~/.claude/skills/ecnu-icalk-autoskill-c4d-python-effector-for-random-clone-colors-in-redshift && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8_GLM4.7/c4d-python-effector-for-random-clone-colors-in-redshift/SKILL.mdsource content
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
to retrieve MoData and check if it is not None.md = mo.GeGetMoData(op) - Color Definition: Use
to define colors, ensuring the alpha channel is set (e.g., 1.0).c4d.Vector4d(r, g, b, a) - Randomization: Implement logic to randomly select between two specified colors (e.g., Red and Blue) for each clone.
- Data Assignment: Use
to apply the color array to the clones.md.SetArray(c4d.MODATA_COLOR, colors, True) - 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
function should returnmain()
upon success.True
Anti-Patterns
- Do not use
global variable ifmo_graph
is the correct context for the effector.mo.GeGetMoData(op) - Do not use
(3 components) ifc4d.Vector
(4 components) is required for the renderer to avoid black color issues.c4d.Vector4d - 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