On 09/07/2018 at 06:25, xxxxxxxx wrote:
Originally posted by xxxxxxxx
I'm not sure to understand what you want to achieve. Do you want to identify each clone within a cloner in order to assign a different color or something like that?
Yes, that would be the most simple example, but could by any kind of attribute really.
e.g. setup a cloner, add shader or random effector to randomise the clone's colours. But using code like this just returns the display colour of the parent cloner, since "op" is the cloner not the clone:
import c4d
def main() :
return op[c4d.ID_BASEOBJECT_COLOR]
How could I find out about the actual clone (ID) to fetch the proper attribute?
As a workaround in this case one could setup a Matrix instead a Cloner, then use a simple XPresso setup to copy the matrix data to a group of objects (basically faking a Cloner). That way things render properly at least. This is okay for small cases, but can become quickly cumbersome for more complex setups obviously just to workaround a problem during the render stage. That's why it would be nice to be able to solve it just via some quick Python code. :)


Advanced examples could be to look up Thinking Particle's custom channels to transport custom values from a TP setup to the Sketch'n'Toon material to control the look of the lines.
Regarding variable and documentation about python Sketch and Toon sadly there is no documentation done and there is no example about them. Definitely, something we need to improve.
PolyHit = the polygon ID hit by the ray
ObjLeft = the left boundaries of the object similar to https://developers.maxon.net/docs/Cinema4DCPPSDK/html/struct_ray_parameter.html#a436c782621b03d27e4bd5468342c4eab
LineStart/End = the start/end position of a line
Ah... those are simple globals. Got it. I was confused because it says "Commands" everywhere (in the UI and the documentation) suggesting it's functions/methods that have to be invoked.