EntityData
One JSON value a plugin keeps on each face, edge, group, component instance, component definition and material, saved with the model and undoable like DocumentData.
- Copies keep it, and so do the definitions Group.makeUnique copies.
- Each piece of a face or edge that splits gets the same value, so values that must be unique, such as ids, belong on groups rather than faces.
- When faces or edges become one, as when erasing the edge between two faces, the value of the one that stays wins and the other’s is dropped.
- Modlumi never reads the value. Put a version in it, such as
{ version: 2, ... }, and convert older ones when reading them. - Values are at most 1 MiB of JSON each, and a model holds at most 256 MiB of one plugin’s values, counting the copies the model holds of tagged entities.
While exactly one container holding a plugin’s value is selected, the plugin’s Properties sections show.
Methods
Section titled “Methods”get<
T>(holder):T|undefined
Returns a copy of the plugin’s value on holder, or undefined when it has none.
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”holder
Section titled “holder”Returns
Section titled “Returns”T | undefined
set(
holder,value):void
Stores the plugin’s value on holder; undefined removes it. Inside
Model.operation the change joins that operation; otherwise it is an undo step
of its own.
Parameters
Section titled “Parameters”holder
Section titled “holder”unknown
Returns
Section titled “Returns”void