Color Mixing Fan Tool

Open Source software contributions and discussions that supplement or extend the Palette / Light Palette software
User avatar
BrianEvans
Posts: 700
Joined: Fri Oct 12, 2007 1:11 pm
Location: Orlando, Florida

Color Mixing Fan Tool

Post by BrianEvans » Fri Aug 01, 2008 10:23 am

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
Last edited by BrianEvans on Mon Mar 02, 2009 12:26 pm, edited 9 times in total.
Brian Evans - System Specialist - Horizon Control Inc.

User avatar
RobertBell
Posts: 2421
Joined: Fri Oct 12, 2007 1:11 pm
Primary Venue / Use: Other
Where I Am: Horizon Control Inc
Location: On the dark side just north of Toronto
Contact:

Re: Color Mixing Fan Tool

Post by RobertBell » Fri Aug 01, 2008 10:45 pm

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
Attachments
Fan Colour Issue.spf
(60.49 KiB) Downloaded 118 times
Robert Bell - Product Manager - Horizon Control Inc.

User avatar
BrianEvans
Posts: 700
Joined: Fri Oct 12, 2007 1:11 pm
Location: Orlando, Florida

Re: Color Mixing Fan Tool

Post by BrianEvans » Sat Aug 02, 2008 9:01 am

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-)
Brian Evans - System Specialist - Horizon Control Inc.

User avatar
RobertBell
Posts: 2421
Joined: Fri Oct 12, 2007 1:11 pm
Primary Venue / Use: Other
Where I Am: Horizon Control Inc
Location: On the dark side just north of Toronto
Contact:

Re: Color Mixing Fan Tool

Post by RobertBell » Sat Aug 02, 2008 10:59 pm

I LOVE IT.
All I can say is YUMMMMMMM!
Robert Bell - Product Manager - Horizon Control Inc.

User avatar
BrianEvans
Posts: 700
Joined: Fri Oct 12, 2007 1:11 pm
Location: Orlando, Florida

Re: Color Mixing Fan Tool

Post by BrianEvans » Tue Aug 05, 2008 5:41 pm

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.
Brian Evans - System Specialist - Horizon Control Inc.

User avatar
BrianEvans
Posts: 700
Joined: Fri Oct 12, 2007 1:11 pm
Location: Orlando, Florida

Re: Color Mixing Fan Tool

Post by BrianEvans » Sun Oct 26, 2008 9:37 pm

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.
Attachments
ColorMixFanning.jpg
ColorMixFanning.jpg (11.31 KiB) Viewed 2258 times
Brian Evans - System Specialist - Horizon Control Inc.

User avatar
gooze
Posts: 1760
Joined: Tue Dec 18, 2007 12:42 pm
Location: Amsterdam, The Netherlands
Contact:

Re: Color Mixing Fan Tool

Post by gooze » Sat Dec 20, 2008 7:58 am

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 2099 times
Floriaan Ganzevoort - Lighting designer
THEATERMACHINE design. production. operations.

User avatar
BrianEvans
Posts: 700
Joined: Fri Oct 12, 2007 1:11 pm
Location: Orlando, Florida

Re: Color Mixing Fan Tool

Post by BrianEvans » Sat Dec 20, 2008 11:00 am

You need to select all of the fixtures before running the macro.
Attachments
Colors.JPG
Colors.JPG (8.34 KiB) Viewed 2088 times
Brian Evans - System Specialist - Horizon Control Inc.

User avatar
gooze
Posts: 1760
Joined: Tue Dec 18, 2007 12:42 pm
Location: Amsterdam, The Netherlands
Contact:

Re: Color Mixing Fan Tool

Post by gooze » Sat Dec 20, 2008 11:54 am

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.
Floriaan Ganzevoort - Lighting designer
THEATERMACHINE design. production. operations.

User avatar
TaineGilliam
Posts: 1183
Joined: Tue Oct 23, 2007 5:15 pm
Location: Cleveland, OH
Contact:

Re: Color Mixing Fan Tool

Post by TaineGilliam » Mon Dec 22, 2008 11:14 am

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

Post Reply