Per-event shader effect selection and configuration.
Parallel to PhosphorAnimation::Profile which configures motion (curve, duration, stagger), ShaderProfile configures visual effect (which shader, with what parameters). Both use the same dot-path event namespace (window.open, editor.snapIn, etc.) but are resolved through separate trees so the two concerns evolve independently.
"Set" vs "unset" semantics
Same contract as Profile: std::optional fields distinguish "inherit
from parent" (nullopt) from "I explicitly chose this value" (engaged). A leaf with effectId = "dissolve" wins over a category that says effectId = "slide". A leaf with effectId = std::nullopt inherits whatever the category or baseline says.
An explicitly-empty effectId (engaged optional containing empty string) means "no shader effect for this event" — the event animates with motion only, no transition shader. This lets a child disable a parent's shader without disabling the parent's motion profile.
| QVariantMap PhosphorAnimationShaders::ShaderProfile::effectiveParameters |
( |
| ) |
const |
|
inline |
The parameter map a CONSUMER should render.
Identical to storedParameters() once the preset has been applied, and a loud warning when it has not. "Flattened" is a convention here rather than a type — the only marker is that presetId was reset() — so nothing in the type system stops a consumer from reading this on a RAW profile, where the answer is plausible and wrong because the preset's values are simply missing. Four of nine animation and surface consumers did exactly that, on an invariant documented in three places.
So the getter says so itself, in BOTH builds. A debug-only assert would have caught none of those four in a user session, which is the whole reason they survived review. It warns rather than refusing because the result is degraded, not dangerous, and a hard failure on a render path is worse than a wrong colour.
What would make this impossible rather than merely loud is moving the getter off the raw profile so a missed site fails to compile. That is a bigger change than a remediation pass should make to a library with four consumers, and it is recorded as the follow-up rather than attempted here.
| QVariantMap PhosphorAnimationShaders::ShaderProfile::storedParameters |
( |
| ) |
const |
|
inline |
The stored parameter map, without judgement.
For a caller that legitimately wants the RAW values while a preset is still engaged. Today there is exactly one, the flatten itself, which needs them as the delta set; an editor showing what an assignment stores of its own is the other shape that belongs here, and it reaches the raw map through the tree rather than through a profile. Named so such a read states its intent instead of sharing a spelling with the reads that want the effective answer.
| std::optional<QVariantMap> PhosphorAnimationShaders::ShaderProfile::parameters |
Per-event parameter overrides for the shader.
Keys are parameter ids declared in the effect's AnimationShaderEffect::parameters. std::nullopt = inherit. Engaged-but-empty map = explicitly use all defaults.
When presetId is engaged these are DELTAS on top of the preset rather than the whole tuning: a key present here overrides the preset's value for it, and every key absent here follows the preset. That is what lets a retuned preset move an assignment that has its own edits without discarding them.
| std::optional<QString> PhosphorAnimationShaders::ShaderProfile::presetId |
The preset parameters are deltas against, resolved by id from PhosphorShaders::ShaderPresetRegistry against the RESOLVED effect.
std::nullopt = inherit. Engaged-but-empty string = explicitly no preset, so parameters is the whole tuning.
Independent of effectId, exactly as parameters already is, so a preset-only override rides the cascade instead of severing it. A presetId inherited across a node that changed the pack is INERT, not wrong: the registry keys presets by (family, packId, presetId), so a preset belonging to another pack simply does not resolve and the assignment falls back to its own parameters — the same shape a parameter id the resolved pack does not declare already has.