HC.GetPatch

Open Source software contributions and discussions that supplement or extend the Palette / Light Palette software
Post Reply
User avatar
gooze
Posts: 1760
Joined: Tue Dec 18, 2007 12:42 pm
Location: Amsterdam, The Netherlands
Contact:

HC.GetPatch

Post by gooze » Wed Aug 19, 2009 10:00 am

Could we add a way to check the patch from a script.
I want to be able to check for fixtures with colour mixing capabilities and add them to the selection.

The ultimate goal would be to be able to write a script that auto-builds colourlooks with Lee/Rosco colours I often use. (So to not have the repetitive task of typing the TextMatch)
Floriaan Ganzevoort - Lighting designer
THEATERMACHINE design. production. operations.

User avatar
JohnGrimshaw
Posts: 1233
Joined: Tue Oct 16, 2007 12:51 pm
Primary Venue / Use: Other
Where I Am: International Man of Mystery
Location: Sydney, Australia
Contact:

Re: HC.GetPatch

Post by JohnGrimshaw » Wed Aug 19, 2009 5:39 pm

I have not tested this, but if you simply "Get Attribute "Red" and it returns a number > 0, then it has that attribute.
...and for more entertainment industry trivia and useless facts, just ask:
John Grimshaw
Managing Director
Stage Fast Pty Ltd

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: HC.GetPatch

Post by RobertBell » Wed Aug 19, 2009 10:27 pm

if

Code: Select all

print(HC.AttributeGetValue(n,'Color A'))
returns anything (where n is a fixture #) it is a colour mix light.
Robert Bell - Product Manager - Horizon Control Inc.

User avatar
JohnGrimshaw
Posts: 1233
Joined: Tue Oct 16, 2007 12:51 pm
Primary Venue / Use: Other
Where I Am: International Man of Mystery
Location: Sydney, Australia
Contact:

Re: HC.GetPatch

Post by JohnGrimshaw » Thu Aug 20, 2009 1:13 am

OK - so say I want to intelligently manipulate the colour space information so that I know that I get the "Cyan" and then the "Red" output, why doesn't this work:

Code: Select all

HC.AttributeSetValue(1,'cl Space','CMY')
CMYinfo = HC.AttributeGetValue(1,'Color A')
HC.AttributeSetValue(1,'cl Space','RGB')
RGBinfo = HC.AttributeGetValue(1,'Color A')
print(CMYinfo .. " " .. RGBinfo)
The attribute "set" command does not appear to be responding.
...and for more entertainment industry trivia and useless facts, just ask:
John Grimshaw
Managing Director
Stage Fast Pty Ltd

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: HC.GetPatch

Post by RobertBell » Thu Aug 20, 2009 9:17 am

Cl Space is not an attribute. It's encoded at the top of Color A. I don't think you can do what you want.
I'll let Alan explain why or why not.
Robert Bell - Product Manager - Horizon Control Inc.

User avatar
AlanMartello
Posts: 500
Joined: Thu Oct 11, 2007 9:00 pm
Primary Venue / Use: Other
Where I Am: Pittsburgh, Pennsylvania USA
Location: Pittsburgh, Pennsylvania

Re: HC.GetPatch

Post by AlanMartello » Thu Aug 20, 2009 10:35 am

Robert is correct, but John should be able to do what he wants. I'll point Gary to this to comment / add to FS as appropriate.
Alan Martello, Ph.D. - System Architect - Horizon Control Inc.

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

Re: HC.GetPatch

Post by gooze » Thu Aug 20, 2009 10:57 am

RobertBell wrote:if

Code: Select all

print(HC.AttributeGetValue(n,'Color A'))
returns anything (where n is a fixture #) it is a colour mix light.
Even in a rig full of CMY fixtures, this returns nothing (nil) (In the test function)
Floriaan Ganzevoort - Lighting designer
THEATERMACHINE design. production. operations.

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

Re: HC.GetPatch

Post by gooze » Thu Aug 20, 2009 11:01 am

Also, I think this is not going to work, since I cannot do a textmatch for colour in lua...

Mmmm... I think I should have started with an easier task for my first script :cry:
Floriaan Ganzevoort - Lighting designer
THEATERMACHINE design. production. operations.

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: HC.GetPatch

Post by RobertBell » Thu Aug 20, 2009 11:43 am

Load this show file. It demos well.

Code: Select all

n = HC.GetScriptSource('number')/1000
s = HC.AttributeGetValue(n,'Color A')
if string.len(s) == 1 then
  s = "Nothing"
end
HC.MessageBox('Fixture ' .. n .. ' Color A is ' .. s)
Attachments
Returning Color A.spf
auto run show with Message Boxes
(34.75 KiB) Downloaded 147 times
Robert Bell - Product Manager - Horizon Control Inc.

User avatar
golights
Posts: 159
Joined: Mon Feb 04, 2008 2:58 pm
Location: South Of Atlanta

Re: HC.GetPatch

Post by golights » Thu Aug 20, 2009 1:49 pm

Robert posted this in a earlier thread and it helped me a lot to understand the flow of things. Maybe more info like this could be posted for other HC.commands. The more questions you ask the more you and everyone else will learn.
So keep asking.

download/file.php?id=414

Post Reply