3D Lingo Dictionary > T-Z > toon (modifier) |  |

toon (modifier)

Syntax

    member(whichCastmember).model(whichModel).toon.toonModifierProperty

Description

3D modifier; once you have added the `#toon` modifier to a model you can get and set the `#toon` modifier properties.

The toon modifier draws a model using only a handful of colors, and resulting in a cartoon style of rendering of the model's surface. When the `#toon` modifier is applied, the model's shader `texture`, `reflectionMap`, `diffuseLightMap`, `specularLightMap`, and `glossMap` properties are ignored.

When the `#toon` modifier is used in conjunction with the `#inker` modifier, the rendered effect is cumulative and varies depending on which modifier was first applied. Note, that the list of modifiers returned by the `modifier` property will list #inker or #toon (whichever was added first), but not both. The toon modifier can not be used in conjunction with the `#sds` modifier.

The `#toon` modifier has the following properties:

Note: For more detailed information about the following properties see the individual property entries.

style allows you to get or set the style applied to color transitions. Possible values include:

`#toon` gives sharp transitions between available colors.

`#gradient` gives smooth transitions between available colors.

`#blackAndWhite` gives sharp transition between black and white.

colorSteps allows you to get or set the number of different colors used for lighting calculations. When setting this value it is rounded down to nearest power of 2. Allowed values are 2, 4, 8, and 16. The default is 2.

shadowPercentage allows you to get or set the percentage of the colors (`colorSteps`) defined for lighting used to render the shadowed portion of the model's surface. Possible values range from 0 to 100. The default is 50.

highlightPercentage allows you to get or set the percentage of the colors defined for lighting (`colorSteps`) used to render the highlighted portion of the model's surface. Possible values range from 0 to 100. The default is 50.

shadowStrength allows you to get or set the level of darkness applied to the shadowed portion of the model's surface. Possible values are any non-negative floating point number. The default value is 1.0.

highlightStrength allows you to get or set the level of brightness applied to the highlighted portion of the model's surface. Possible values are any non-negative floating point number. The default value is 1.0.

lineColor allows you to get or set the color of lines drawn by the inker. Possible values are any valid Lingo color object. The default value is `rgb (0, 0, 0)`, which is black.

creases allows you to get or set whether lines are drawn in creases. This is a Boolean value; the default value is `True`.

creaseAngle if `creases` is set to `TRUE`, this property allows you to get or set how sensitive the line drawing function of the toon modifier is to the presence of creases.

boundary allows you to get or set whether lines are drawn around the boundary of the surface. This is a Boolean value; the default value is `True`.

lineOffset allows you to get or set where lines are drawn relative to the shaded surface and the camera. Negative lines move lines toward the camera. Positive values move lines away from the camera. Possible values are floating point numbers from -100.0 to 100.0. The default value is -2.0.

useLineOffset allows you to get or set whether `lineOffset` is on or off. This is a Boolean value; the default value is `False`.

silhouettes allows you to get or set whether lines are drawn to define the edges along the border of a model, outlining it's shape. This is a Boolean value; the default value is `True`.

See also

`addModifier`, `modifiers`, `sds (modifier)`, `inker (modifier)`