cutan.characters.lids¶
A HALF eyelid drawing, made from a character’s own OPEN and CLOSED lid art (cutan#65).
The expression solver picks an eyelid DRAWING per lid state (the ladder: wide,
open, half, closed; cutan.expression.axes.lid_key()). A rig whose
eyelid set draws only OPEN and CLOSED shows OPEN for a partial
lid, so a squint, suspicion or annoyance cannot narrow the eyes, and the
validator says so. This module gives such a rig its HALF drawing without an
illustrator: for each eye, the CLOSED drawing clipped to its upper part, with
the OPEN drawing (its outline) laid over it. It works on any pair of SVG eye
drawings that share a view box, the factory’s or a hand-drawn rig’s.
>>> half_lid_svg(
... '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 32"><ellipse cx="32" cy="16" rx="14" ry="10" fill="none" stroke="#222"/></svg>',
... '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 32"><ellipse cx="32" cy="16" rx="14" ry="10" fill="#8b5a3b"/></svg>',
... ).count("clip-path")
1
The half attachment copies the open one’s placement. Its source says
what it was derived from; when both drawings carry the same licence it carries
that licence too, pinned to the new file’s digest, so the asset library and
an credits can state it. Otherwise it is left unlabelled (UNVERIFIED), never
guessed.
Module Attributes
How much of the eye the half lid covers, from the top of the drawing. |
|
The attachment name the HALF key points at. |
|
The provider of the source a derived half lid carries. |
Functions
|
Give the character at |
|
The HALF drawing: |
- cutan.characters.lids.DFLT_HALF_LID_FRACTION: float = 0.5¶
How much of the eye the half lid covers, from the top of the drawing.
- cutan.characters.lids.HALF_LID_PROVIDER: str = "cutan add-half-lid (derived from the rig's own lid art)"¶
The provider of the source a derived half lid carries.
- cutan.characters.lids.add_half_lid(char_dir, *, fraction=0.5, overwrite=False)[source]¶
Give the character at
char_diraHALFeyelid drawing; return its descriptor path.For every slot of the default skin that holds both the
OPENand theCLOSEDattachment of theeyelidset, writes the half drawing beside the open one (eye_l_open.svg->eye_l_half.svg), adds ahalfattachment placed like the open one, and mapsHALFto it. Idempotent. A rig that already has aHALFit did not get from here is refused unlessoverwrite: that drawing is an illustrator’s.- Return type: