Page 1 of 3

Color Mixing Fan Tool

Posted: Fri Aug 01, 2008 10:23 am
by BrianEvans
Manually place the first fixture you'd like to fan into a color (even from color picker).
Then place the last fixture in a color.

Select all fixtures (including first and last fixture) you want to include in the fan,
and trigger the macro.

All fixtures MUST be in the same color space,
doesn't matter which one,
BEFORE applying tool.

Code: Select all

--* * * * * * * * * * * * * * * * * * * * * * *
--* * *      Color Mix Fanning  V4.0      * * *
--* * *  Written By: Brian F. Evans - HCI * * *
--* * * * * * * * * * * * * * * * * * * * * * *
--
--Compatible with PaletteOS Version 10.5 ONLY
--

NumFixtures=0
Pos1=1
FixSel={}
FixSel[0]=HC.GetCurrentSelectionSet(',')

for x = 1,string.len(FixSel[0]) do
    FindCom=string.find(FixSel[0],',',Pos1)
    
    if FindCom~=nil then
        NumFixtures=NumFixtures+1
        FixSel[NumFixtures]=string.sub(FixSel[0],Pos1,FindCom-1)
        Pos1=FindCom+1
    end
end

FirstFixture=FixSel[1]
LastFixture=FixSel[NumFixtures]

FirstA=HC.AttributeGetValue(FirstFixture,'Color A')
FindPerc=string.find(FirstA,' ',1)
FirstA=string.sub(FirstA,1,FindPerc-2)
FirstB=HC.AttributeGetValue(FirstFixture,'Color B')
FindPerc=string.find(FirstB,' ',1)
FirstB=string.sub(FirstB,1,FindPerc-2)
FirstC=HC.AttributeGetValue(FirstFixture,'Color C')
FindPerc=string.find(FirstC,' ',1)
FirstC=string.sub(FirstC,1,FindPerc-2)

LastA=HC.AttributeGetValue(LastFixture,'Color A')
FindPerc=string.find(LastA,' ',1)
LastA=string.sub(LastA,1,FindPerc-2)
LastB=HC.AttributeGetValue(LastFixture,'Color B')
FindPerc=string.find(LastB,' ',1)
LastB=string.sub(LastB,1,FindPerc-2)
LastC=HC.AttributeGetValue(LastFixture,'Color C')
FindPerc=string.find(LastC,' ',1)
LastC=string.sub(LastC,1,FindPerc-2)


if FirstA==LastA then
    for x = 2, NumFixtures-1 do
        HC.AttributeFade(FixSel[x],'Color A',FirstA,0)
    end
else
    if FirstA>LastA then
        IncA=(FirstA-LastA)/(NumFixtures-1)
        for x = 2, NumFixtures-1 do
            HC.AttributeFade(FixSel[x],'Color A',FirstA-((x-1)*IncA),0)
        end
    else
        IncA=(LastA-FirstA)/(NumFixtures-1)
        for x = 2, NumFixtures-1 do
            HC.AttributeFade(FixSel[x],'Color A',(x-1)*IncA+FirstA,0)
        end
    end
end


if FirstB==LastB then
    for x = 2, NumFixtures-1 do
        HC.AttributeFade(FixSel[x],'Color B',FirstB,0)
    end
else
    if FirstB>LastB then
        IncB=(FirstB-LastB)/(NumFixtures-1)
        for x = 2, NumFixtures-1 do
            HC.AttributeFade(FixSel[x],'Color B',FirstB-((x-1)*IncB),0)
        end
    else
        IncB=(LastB-FirstB)/(NumFixtures-1)
        for x = 2, NumFixtures-1 do
            HC.AttributeFade(FixSel[x],'Color B',(x-1)*IncB+FirstB,0)
        end
    end
end


if FirstC==LastC then
    for x = 2, NumFixtures-1 do
        HC.AttributeFade(FixSel[x],'Color C',FirstC,0)
    end
else
    if FirstC>LastC then
        IncC=(FirstC-LastC)/(NumFixtures-1)
        for x = 2, NumFixtures-1 do
            HC.AttributeFade(FixSel[x],'Color C',FirstC-((x-1)*IncC),0)
        end
    else
        IncC=(LastC-FirstC)/(NumFixtures-1)
        for x = 2, NumFixtures-1 do
            HC.AttributeFade(FixSel[x],'Color C',(x-1)*IncC+FirstC,0)
        end
    end
end

Re: Color Mixing Fan Tool

Posted: Fri Aug 01, 2008 10:45 pm
by RobertBell
This is very cool when it works. Attached is a show file that shows it not working. I didn't even try to debug it, but maybe you could have a look. It sort of looks like an Off-By-One thing.

Using Fixture 1 thru 9 in this case.

Can't wait to add it to my arsinal on this cyc I have.

Thanx

Re: Color Mixing Fan Tool

Posted: Sat Aug 02, 2008 9:01 am
by BrianEvans
Thanks Rob,
to save confusion the original code has been fixed above.

Didn't you know you were only supposed to use colors that are are at 0% or 100% on all colors? 8-)

Re: Color Mixing Fan Tool

Posted: Sat Aug 02, 2008 10:59 pm
by RobertBell
I LOVE IT.
All I can say is YUMMMMMMM!

Re: Color Mixing Fan Tool

Posted: Tue Aug 05, 2008 5:41 pm
by BrianEvans
The version I just posted automatically detects the first and last fixture to fan.
Just select the first and last fixture before running the macro.
This ONLY works with 10.3.28 and NEWER software.

One can remove the section marked, and uncomment the First and Last fixture to manually enter them.

Re: Color Mixing Fan Tool

Posted: Sun Oct 26, 2008 9:37 pm
by BrianEvans
I just posted a version 3.0 that only fans fixtures selected,
taking color from the lowest fixture number in the range, and color from the highest fixture number in the range.

Re: Color Mixing Fan Tool

Posted: Sat Dec 20, 2008 7:58 am
by gooze
I'v tested version 3 before and it worked perfectly. Now 10.4.12 it only takes the cyan (Color A) value.
So "fading from red to yellow results in red and yellow on either end of the selection and almost white (between 20 and 2 percent of cyan) for the other fixtures.
Same with colorpicker or Lee color text match.
Afbeelding 1.png
Colorfan not working
Afbeelding 1.png (8.67 KiB) Viewed 3047 times

Re: Color Mixing Fan Tool

Posted: Sat Dec 20, 2008 11:00 am
by BrianEvans
You need to select all of the fixtures before running the macro.

Re: Color Mixing Fan Tool

Posted: Sat Dec 20, 2008 11:54 am
by gooze
Hmmmm. Seems that my copy and paste skills were not that good... I must have missed the last part of the script. After a restart with a new show it seems to work.

Re: Color Mixing Fan Tool

Posted: Mon Dec 22, 2008 11:14 am
by TaineGilliam
Brian,

How involved would it be to use the colors from the first and last channels in the selection as opposed to the lowest and highest numbered channels? I'm not sure how Lua surfaces selection order.

Taine