ProxyPreset is the base class for a number of Preset classes for JITLib proxies: It can handle proxies that keep their settings in environments, such as TaskProxies and PatternProxies, and proxies that use nodeMaps, like NodeProxy.
Settings are lists of key - value pairs, like [[key1, val1], [key2, val2], ... [keyN, valN]]. One can switch between these settings, or - if the parameter values in the list are single numbers, one can interpolate and morph between them.
Its subclasses using named proxies are: TdefPreset for Tdef, PdefPreset for Pdef, and NdefPreset for Ndef. Finally, there are also gui classes for all of them: ProxyPresetGui, TdefPresetGui, PdefPresetGui, and NdefPresetGui.
make a new anonymous ProxyPreset
proxy |
a TaskProxy or PatternProxy |
namesToStore |
which paramNames to store in presets. if none given, inferred from the current proxy settings. |
settings |
provide preset settings for the proxy |
specs |
provide preset specs for the proxy, mainly for randomizing and morphing. if none given here, and object has a halo of specs, those in halo will be used. |
morphFuncs |
special functions to provide for morphing between non-numerical settings. not used yet. |
the proxy for which preset contains settings
the param names for which values will be stored in the settings
settings stored for the proxy
the name of the current setting
the name of the target setting used in morphing
a dict for specs to use for numerical parameter interpolation. by default this is synced with the proxy's Halo specs.
the current morph/blend value.
a taskproxy that can crossfade between different settings.
special functions to provide for morphing between non-numerical settings. not used yet.
use the proxy's Halo for syncing specs and namesToStore.
check if there are specs for all namesToStore. if not, posts an invitation to add the missing ones, or a
open a dialog window to add specs.
add a setting by name. if no values are given, take current setting of proxy.
remove a setting by name
add a list of named settings
remove a list of settings by their names
post current settings as compilestring.
get the names of all currently stored settings.
set the current setting by name within stored settings.
set the target setting by name within stored settings.
get a stored setting by name.
set the proxy's current settings to the setting given by name.
get the proxy's current settings as [[key1, val1], ... [keyN, valN]]
get the proxy's current settings and store them as \curr.
step the current and target setting by increment.
Note that randomizing settings only fully works for numerical settings!
create a rand setting, based on an existing one
rand |
how muct to randomize (0.0 to 1.0) |
startSet |
which set to randomize - if nil, uses currSet |
except |
which keys not to randomize |
seed |
a seed number for the random generator |
same as randSet, but sets proxy to the random setting.
like randSet, but ratio sets how many of the params will be randomized.
Note that morphing and crossfading only fully works for numerical settings!
blend between two sets given by name. the mapped flag sets whether to blend between mapped or unmapped values; the result is again unmapped.
morph between two settings with a given blend factor.
blend |
the blend factor |
name1 |
the name of setting 1 |
name2 |
the name of setting 2 |
mapped |
a flag whether to interpolate between mapped values of the params. |
crossfade to a target setting in the given duration.
the lower-level way to do a straight blend between two sets.
utilities to convert single settings between mapped and unmapped values. used when blending in mapped mode.
get and whether to store settings to disk automatically. default = true.
the path where to store and read settings to and from disk.
load settings from disk at given path.
write settings to disk. By default, they go next to the source code file where the Preset was created, and by default, a backup of the previous stored settings is made.
set storage name
path where to store presets. currently, this is next to the source code file where the Preset was created.
open a dialog window for entering a storage name. Intended for use with ProxyPresetGui.
open a dialog window for deleting existing settings by name(s). Intended for use with ProxyPresetGui.