ModuleDefinitionTransformer
ModuleDefinitionTransformer targets one field on another stock module-data object and stores that override for generated part data.
Purpose
Use this transformer when a variant needs to patch a field on an existing module definition and there is no more specific V-SwiFT transformer for that job. It is the most flexible transformer in the set, but also the one that asks the most from the author.
Type
Source-backed runtime type: VSwift.Modules.Transformers.ModuleDefinitionTransformer
Fields
BehaviourType:stringDataType:stringKey:stringValue:JToken
Behavior
ApplyCommon: no effectApplyInOab: attempts to resolve the target behaviour and module-data types, shut down the target module, set one reflected field on the module-data object, rebuild the data context, and reinitialize the moduleApplyInFlight: no effect
State handling
Reverter: yes, via
ModuleDefinitionReverter.GetInstanceFor(...)Saves information: yes, through
ModuleDefinitionLoaderVisualizes information: no
Example
This fragment shows the real transformer fields. Replace the placeholder type names and field key with the stock module you actually intend to patch.
Transformers: [
{
Name: "ModuleDefinitionTransformer",
BehaviourType: "Module_Light",
DataType: "Data_Light",
Key: "...",
Value: true
}
]Caveats
BehaviourTypeandDataTypemust resolve through the runtime module registries used by V-SwiFT.This is an advanced transformer. You need to know the exact module-data field name and provide a value that deserializes correctly into that field type.
The current
ApplyInOabimplementation appears to contain a logic issue: it returns early whenTryGetValuesucceeds, which means successful type resolution may prevent the reflected field write from running. Treat that as a current implementation caveat, not as intended authoring behavior.