loading
 
Multiple Sample Color Modules
Najmi Zabawi from Malaysia  [3 posts]
6 year
How do I use more than one Sample_Color module in one image? I was able to put those modules in the pipeline, but the problem is all the modules use the same variable which is "COLOR_SAMPLE". This creates conflict to the variable where only the last module is referenced, not each of them. I tried to use Set Variable module to change the variable name using Set Variable module but no success. Please help me. Thanks!
Steven Gentner from United States  [1446 posts] 5 year
You are correct in your usage of the Set_Variable module. That would be the way to "rename" a variable to another name such that the value is not overwritten. You must be sure, however, to use the correct expression in the Set_Variable module to do this. For example, in the Sample_Color module the variable COLOR_SAMPLE_R is create. In Set_Variable you would use

new_r [COLOR_SAMPLE_R]

but NOT select the IsArray checkbox ... that's only for when you specify a list of values in a comma separated list that you want converted into an array.

See attached example.

STeven.



program.robo

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index