Page 1 of 1

HC.GetPatch

Posted: Wed Aug 19, 2009 10:00 am
by gooze
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)

Re: HC.GetPatch

Posted: Wed Aug 19, 2009 5:39 pm
by JohnGrimshaw
I have not tested this, but if you simply "Get Attribute "Red" and it returns a number > 0, then it has that attribute.

Re: HC.GetPatch

Posted: Wed Aug 19, 2009 10:27 pm
by RobertBell
if

Code: Select all

print(HC.AttributeGetValue(n,'Color A'))
returns anything (where n is a fixture #) it is a colour mix light.

Re: HC.GetPatch

Posted: Thu Aug 20, 2009 1:13 am
by JohnGrimshaw
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.

Re: HC.GetPatch

Posted: Thu Aug 20, 2009 9:17 am
by RobertBell
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.

Re: HC.GetPatch

Posted: Thu Aug 20, 2009 10:35 am
by AlanMartello
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.

Re: HC.GetPatch

Posted: Thu Aug 20, 2009 10:57 am
by gooze
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)

Re: HC.GetPatch

Posted: Thu Aug 20, 2009 11:01 am
by gooze
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:

Re: HC.GetPatch

Posted: Thu Aug 20, 2009 11:43 am
by RobertBell
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)

Re: HC.GetPatch

Posted: Thu Aug 20, 2009 1:49 pm
by golights
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