Page 1 of 1

(LUA) Selection cropping

Posted: Tue Nov 29, 2011 11:48 am
by tom
Crops a selection set based on a high and low value.

Reads a level from a look(channel 9995) and filters the selection based on the level. With one script you can use the level as a low end and another script uses it for a high end. I use 9995 because this is the way it panned out for me. If you want to use a different number go through the scripts and change 9995 for whatever you want to use. Its in te first line of each script.

Setup:
Add fixture 9995 (does not need to be patched, just needs to exist)
Dedicate 2 looks, one for level setting and low end, the other for high end passes.
fixture 9995@100% - record look 1
record look 2 with no data
set bump modes to action momentary
label look1 as "low crop" and look2 as "high crop"

scripts
look1 - action - add - bump down - script

Code: Select all

base = tonumber(HC.AttributeGetValue(9995, 'Intensity'))

s = HC.GetCurrentSelectionSet(',')
for fixture in string.gmatch(s,"%d+") do
HC.Deselect(fixture)
HC.Select(fixture)
end

for fixture in string.gmatch(s,"%d+") do
val = tonumber(HC.AttributeGetValue(fixture, 'Intensity'))
if val<base then HC.Deselect(fixture)end
end
look2 - action - add - bump down - script

Code: Select all

base = tonumber(HC.AttributeGetValue(9995, 'Intensity'))

s = HC.GetCurrentSelectionSet(',')
for fixture in string.gmatch(s,"%d+") do
HC.Deselect(fixture)
HC.Select(fixture)
end

for fixture in string.gmatch(s,"%d+") do
val = tonumber(HC.AttributeGetValue(fixture, 'Intensity'))
if val>base then HC.Deselect(fixture)end
end
Usage:
With a big selection set, with various levels, you want to narrow it down to fixtures between 40% and 60%. Set look1 to 40%(channel 9995) and press to bump button to launch the script. This takes all the fixtures out below 40%. Then again adjust look1 to set the high level, in this case 60%. Now press bump button for look 2. This takes out all the high levels and leaves you with a selection of levels between 40% and 60%. This whole process can be done very quickly once you get the feel of it.

The deselect/select loop in the begining seems a bit redundant but it's to counteract a small bug I've come across with selection sets.

Re: (LUA) Selection cropping

Posted: Tue Nov 29, 2011 12:08 pm
by BobbyHarrell
this is interesting Tom. What scenarios do you find this helps you with?

Re: (LUA) Selection cropping

Posted: Tue Nov 29, 2011 12:16 pm
by tom
I used this last week while programming with a 18*5 PAR matrix. We did alot of different levels and gradients so I used this for tweak certain areas. Make a rough selection and then fine tune it with the scripts. Also working now with a 900+ fixture matrix and it's been handy. Though this show has already been programmed so I'm just playing about.

I guess it's handy when dealing with big numbers where groups and looks dont cut it anymore.