Contact Us

CATEGORIES

Whoops…Nothing found

Try other keywords in your search

pixc.callRefs

 0 Minutes

 0 Likes

 1198 Views

pixc.callRefs


The callRefs() built in function allows you to modulate the parameter values passed along the connections between actions (the "references" to other actions).

 Its use is optional in that, if an action does not contain a callRefs() invocation, the parameters are passed along the connections exactly the way they were received by the action. 

So callRefs() is only needed if you want to move away from default parameter routing. For example, consider an action with one parameter "val". The action is supposed to "magnify" the parameter when it is connected to another action. 


The code: 

pixc.callRefs(val * 5) 

would lead to val * 5 (instead of just val) arriving in any actions reached via a connection from the action with the callRef invocation. 


What is passed to callRefs() is completely up to the action. If, starting from the example above, the value is supposed to be scaled up but should be limited to a maximum of 100 then the following code could be used: 

local temp = val * 5 
if temp > 100 then 
   temp = 100 
end 
pixc.callRefs(temp) 


Any actions reached by connections (action output) from this code would receive 

val * 5 as a parameter as long as that result is less than 100 and would receive 100 otherwise. 

 

On the receiving action the incoming data will be routed to the variable as stated in the action name: 

sending end example:  

pixc.callRefs(self.var) 

can turn to: 

receiving end example: 

myactionname(variablename) 

Continue with variablename in the action body

Was this article helpful?