can save value to variable using set_variable_VARIABLENAME1 and then recall that variable in a mapping using eg set_the_shader_param_0_layer_offset_0_continuous<VARIABLENAME1

This commit is contained in:
Tristan Rowley
2020-01-31 23:40:47 +00:00
parent ac78a2c03c
commit 986a26fd11
2 changed files with 10 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
# Auto-generated Actions list
Fri 31 Jan 23:22:31 UTC 2020
Fri 31 Jan 23:39:48 UTC 2020
for branch=feature_plugins
@@ -176,6 +176,7 @@ for branch=feature_plugins
* (.*)|invert (from ManipulatePlugin)
* (.*)|f:(.*): (from ManipulatePlugin)
* set_variable_([a-zA-Z0-9]+) (from ManipulatePlugin)
* (.*)<([a-zA-Z0-9]+) (from ManipulatePlugin)
* (.*)&&(.*) (from MultiActionsPlugin)
* test_plugin (from TestPlugin)
* cycle_shaders (from TestPlugin)

View File

@@ -26,7 +26,8 @@ class ManipulatePlugin(ActionsPlugin):
return [
( r"^(.*)\|invert$", self.invert ),
( r"^(.*)\|f:(.*):$", self.formula ),
( r"^set_variable_([a-zA-Z0-9]+)$", self.set_variable )
( r"^set_variable_([a-zA-Z0-9]+)$", self.set_variable ),
( r"^(.*)<([a-zA-Z0-9]+)$", self.recall_variable )
]
variables = {}
@@ -51,3 +52,9 @@ class ManipulatePlugin(ActionsPlugin):
def set_variable(self, var_name, value):
self.variables[var_name] = value
def recall_variable(self, action, var_name, *args):
print ("recall_variable(%s) got args %s" % (var_name,args))
self.pc.actions.call_method_name(
action, self.variables.get(var_name)# + list(args)
)