I’m pleased to say that the Bournville dark chocolate and mugs of tea have once again paid off. I’ve made a working PoserPython script that automatically randomises the ToonID colours across a Poser scene. Documentation of random number generation methods inside PoserPython is poor, with the methods manual not even mentioning ‘random’. But I managed to figure out how to generate a value type that the ToonID node would accept and use.
In the script the new random numbers can be constrained within a range (e.g. “(20000, 70000)”), and it appears from tests that the higher you go the brighter and more ‘Clown World’ things get. For instance, hot fushia pink is 16711808 while a vivid ‘Canadian maple leaf’ red-orange is 12932389. Here’s proof-of-concept, with 20000-70000 leading to a range of greens and turquoise…
The dotting is not on the render, it’s my selection of a colour-area in Photoshop.
I probably need to try a range like “(500000, 25000000)” for a proper Clown Pass look, and will be plugging that in as I give the script a final polish. I’d suspect that the colour limit is probably 32-million numbers, for 32-million colours.
This discovery leads me to a hunch about why Poser’s ToonID was always so dull and blue-black and needed to be lifted in Photoshop to be usable. It looks to me like it was always clustering in the low range, re: the numbers, and thus it stayed dark.
The aliasing of the ToonID layer is still lacking, and I found a forum comment to the effect that that’s probably the way the animation and film/TV crowd likes it. The colours selected are thus completely pure and clean, and there’s no muddied fringing at the edges. That makes sense. In such a studio setting I guess also it’s easier to work upward from a dark base, picking out exactly what one wants to mask, rather than be faced with a multi-colour Clown World straight off.
I don’t find this a problem as in Photoshop one can make a selection by the unique colour, and then have an Action smooth and feather the edges to taste. So the jaggies are really not that much of a nuisance. Plus, if you have comic-book ink lines on top as a layer, any seams are shmushed away under the lines, and jaggies can also be slightly softened when you flood-fill new colours by using the paint-bucket tool in Photoshop.
Of course it may be possible to antialias the ToonID layer in Poser, and I just haven’t stumbled on the right Firefly render settings yet.
So… my new script will be integrated into my multipass script. Since if I’m going to be spending 25 seconds getting a Firefly pen-lines only render out of my comic-book multipass script, then I might as well have the ToonID ‘Clown Pass’ as well for only a few seconds more. It’s less clunky for masking and colour-filling than the other options for Poser 11, which so far as I know are:
1) For something quicker and smoother, SnarlyGribbly’s free EZmat script set has a “Randomizer” script which randomises the Diffuse colour value of a figure or prop. However, as that destroys your scene’s material diffuse values, and as it needs to be applied character-by-character and prop-by-prop, it’s not ideal — despite the nice results.
2) There’s also the paid-for $20 XS – Extended Shader Manager. This has a ToonID button. But it’s used as a character/prop grouping tool, because it sets the same ToonID across each character or prop. Thus it’s not a tool for automatically uniquely identifying every material type in the scene, right down to the diamonds in Doreen’s ear-rings. Also, if the ToonID value is the same across a whole figure or prop, the inked outline may vanish in-between, since it also plays a role in inking.
For an un-occluded free equivalent, see the Render each figure/prop separately script and use it with Preview renders, then re-assemble the scene in Photoshop.
3) Use the free Pick Colour and Assign to ToonID script to pick out, in a bright colour, just the fiddly bits you know you’ll want to mask in Photoshop. Such as the diamonds in Doreen’s ear-rings. Again it’s not ideal because such second-guessing of the future constrains your creative choices, and also those of clients and editors.