Scene kit command

graph.addModifier

Add F-Curve Modifier

Adds an F-curve modifier (cycles, noise, generator, …) to an animated property's curve.

Kit
Scene 0.1.0 (.kscene)
Changes the document
yes

Parameters

Parameters of graph.addModifier
NameTypeRequiredDescription
additivebooleannogenerator, function: adds to the curve instead of replacing it
after"none" | "repeat" | "repeatOffset" | "mirror"nocycles: after the last key
afterCountintegernocycles: cycles after (0 forever)
amplitudenumbernofunction
before"none" | "repeat" | "repeatOffset" | "mirror"nocycles: before the first key
beforeCountintegernocycles: cycles before (0 forever)
blend"replace" | "add" | "subtract" | "multiply"nonoise: how it mixes in
coefficientsnumber[]nogenerator: the coefficients
depthintegernonoise: octaves beyond the first (0 to 32)
endnumbernostepped: steps only up to this frame; null for always
function"sin" | "cos" | "tan" | "sqrt" | "ln" | "sinc"nofunction: the function of amplitude · f(phaseMultiplier · frame + phaseOffset) + valueOffset
indexintegernoThe component, from 0 (0)
influencenumbernoScales its effect, 0 to 1; null for full
lacunaritynumbernonoise: frequency step between octaves
maxnumbernoenvelope: the high end, above the reference
maxXnumber | nullnolimits: maximum evaluated frame; null disables
maxYnumber | nullnolimits: maximum curve value; null disables
minnumbernoenvelope: the low end, below the reference
minXnumber | nullnolimits: minimum evaluated frame; null disables
minYnumber | nullnolimits: minimum curve value; null disables
mode"expanded" | "factorized"nogenerator: expanded (c0 + c1·x + …) or factorized ((c0·x + c1)(c2·x + c3)…)
mutedbooleannoDoes nothing (values of rotation channels are radians)
offsetnumbernonoise, stepped: frame offset
pathstringnoThe bone or shape key, for their properties
phasenumbernonoise
phaseMultipliernumbernofunction
phaseOffsetnumbernofunction
pointsobject[]noenvelope: control points { frame, min, max } in frame order
propertystringyesThe channel's property (location, boneRotation, shapeKey, ...)
rangeobjectnoLimits it to { start, end, blendIn, blendOut } frames; null for everywhere
referencenumbernoenvelope: the reference value
roughnessnumbernonoise: amplitude step between octaves
scalenumbernonoise: frames per noise feature
startnumbernostepped: steps only from this frame; null for always
stepnumbernostepped: frames each step holds
strengthnumbernonoise
targetintegeryesThe channel's object (or material) id
type"generator" | "function" | "envelope" | "cycles" | "noise" | "stepped" | "limits"yesThe modifier
valueOffsetnumbernofunction

Call through scene_run

text
scene_run {
  "path": "<file>.kscene",
  "steps": [{ "command": "graph.addModifier", "params": { "property": <string>, "target": <integer>, "type": <"generator" | "function" | "envelope" | "cycles" | "noise" | "stepped" | "limits"> } }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: additive, after, afterCount, amplitude, before, beforeCount, blend, coefficients, depth, end, function, index, influence, lacunarity, max, maxX, maxY, min, minX, minY, mode, muted, offset, path, phase, phaseMultiplier, phaseOffset, points, range, reference, roughness, scale, start, step, strength, valueOffset. scene_run answers the step’s result in completed[i].result.

Result

The kit gives no result schema for this command.

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "additive": {
      "description": "generator, function: adds to the curve instead of replacing it",
      "type": "boolean"
    },
    "after": {
      "description": "cycles: after the last key",
      "enum": [
        "none",
        "repeat",
        "repeatOffset",
        "mirror"
      ],
      "type": "string"
    },
    "afterCount": {
      "description": "cycles: cycles after (0 forever)",
      "type": "integer"
    },
    "amplitude": {
      "description": "function",
      "type": "number"
    },
    "before": {
      "description": "cycles: before the first key",
      "enum": [
        "none",
        "repeat",
        "repeatOffset",
        "mirror"
      ],
      "type": "string"
    },
    "beforeCount": {
      "description": "cycles: cycles before (0 forever)",
      "type": "integer"
    },
    "blend": {
      "description": "noise: how it mixes in",
      "enum": [
        "replace",
        "add",
        "subtract",
        "multiply"
      ],
      "type": "string"
    },
    "coefficients": {
      "description": "generator: the coefficients",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "depth": {
      "description": "noise: octaves beyond the first (0 to 32)",
      "type": "integer"
    },
    "end": {
      "description": "stepped: steps only up to this frame; null for always",
      "type": "number"
    },
    "function": {
      "description": "function: the function of amplitude · f(phaseMultiplier · frame + phaseOffset) + valueOffset",
      "enum": [
        "sin",
        "cos",
        "tan",
        "sqrt",
        "ln",
        "sinc"
      ],
      "type": "string"
    },
    "index": {
      "description": "The component, from 0 (0)",
      "type": "integer"
    },
    "influence": {
      "description": "Scales its effect, 0 to 1; null for full",
      "type": "number"
    },
    "lacunarity": {
      "description": "noise: frequency step between octaves",
      "type": "number"
    },
    "max": {
      "description": "envelope: the high end, above the reference",
      "type": "number"
    },
    "maxX": {
      "description": "limits: maximum evaluated frame; null disables",
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "maxY": {
      "description": "limits: maximum curve value; null disables",
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "min": {
      "description": "envelope: the low end, below the reference",
      "type": "number"
    },
    "minX": {
      "description": "limits: minimum evaluated frame; null disables",
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "minY": {
      "description": "limits: minimum curve value; null disables",
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "mode": {
      "description": "generator: expanded (c0 + c1·x + …) or factorized ((c0·x + c1)(c2·x + c3)…)",
      "enum": [
        "expanded",
        "factorized"
      ],
      "type": "string"
    },
    "muted": {
      "description": "Does nothing (values of rotation channels are radians)",
      "type": "boolean"
    },
    "offset": {
      "description": "noise, stepped: frame offset",
      "type": "number"
    },
    "path": {
      "description": "The bone or shape key, for their properties",
      "type": "string"
    },
    "phase": {
      "description": "noise",
      "type": "number"
    },
    "phaseMultiplier": {
      "description": "function",
      "type": "number"
    },
    "phaseOffset": {
      "description": "function",
      "type": "number"
    },
    "points": {
      "description": "envelope: control points { frame, min, max } in frame order",
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array"
    },
    "property": {
      "description": "The channel's property (location, boneRotation, shapeKey, ...)",
      "type": "string"
    },
    "range": {
      "additionalProperties": true,
      "description": "Limits it to { start, end, blendIn, blendOut } frames; null for everywhere",
      "type": "object"
    },
    "reference": {
      "description": "envelope: the reference value",
      "type": "number"
    },
    "roughness": {
      "description": "noise: amplitude step between octaves",
      "type": "number"
    },
    "scale": {
      "description": "noise: frames per noise feature",
      "type": "number"
    },
    "start": {
      "description": "stepped: steps only from this frame; null for always",
      "type": "number"
    },
    "step": {
      "description": "stepped: frames each step holds",
      "type": "number"
    },
    "strength": {
      "description": "noise",
      "type": "number"
    },
    "target": {
      "description": "The channel's object (or material) id",
      "type": "integer",
      "x-khp-types": [
        "Object",
        "Material"
      ]
    },
    "type": {
      "description": "The modifier",
      "enum": [
        "generator",
        "function",
        "envelope",
        "cycles",
        "noise",
        "stepped",
        "limits"
      ],
      "type": "string"
    },
    "valueOffset": {
      "description": "function",
      "type": "number"
    }
  },
  "required": [
    "property",
    "target",
    "type"
  ],
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (scene_commands through @kition/[email protected], built from KitionAI/kition-scene@4d06faf). As data: commands.jsonl.