Page 1 of 1

Align Mode

Posted: 28 Jun 2018, 07:04
by kimwida
Hi.
I recorded a color-align macro.
And I want to set "Repeat" or "Spread" align mode before I execute the macro.
So I wrote two simple macros.

Code: Select all

ActionScript.SetProperty(Programmer.Editor.Fixtures.AlignMode,"Repeat")


Code: Select all

ActionScript.SetProperty(Programmer.Editor.Fixtures.AlignMode,"Spread")


But they don't work. What should I change here??

Re: Align Mode

Posted: 28 Jun 2018, 08:47
by icke_siegen
"Spread" should be "Interpolate".

Apart from that, how do you tell thie doesn't work? Maybe the fault lies elsewhere... So, if it doesn't work. maybe you can post the entire context.

Re: Align Mode

Posted: 28 Jun 2018, 08:57
by Gregory
To set an enum value using a string you need to use the ActionScript.SetProperty.Enum function and, as with other SetProperty functions, the property name should be passed in as a string otherwise you are passing in the current value of the property.

For example:

Code: Select all

ActionScript.SetProperty.Enum("Programmer.Editor.Fixtures.AlignMode", "Repeat")

Re: Align Mode

Posted: 28 Jun 2018, 09:10
by kimwida
I just recorded a color-align macro NOT using Titan API.
Because if I use Titan API, I should ask many things to the forum.
And I just need to set align mode "Repeat" or "Spread" for variety before the macro.

What I want to do is just two step.
1. fire selective align mode macro. (repeat or spread)
2. fire the color-align macro.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<avolites.macros>
  <macro id="Align_Mode_Repeat">
    <name>Align Mode1</name>
    <sequence>
      <step pause="0">ActionScript.SetProperty(Programmer.Editor.Fixtures.AlignMode,"Repeat")</step>
    </sequence>
  </macro>
</avolites.macros>

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<avolites.macros>
  <macro id="Align_Mode_Spread">
    <name>Align Mode1</name>
    <sequence>
      <step pause="0">ActionScript.SetProperty(Programmer.Editor.Fixtures.AlignMode,"Interpolate")</step>
    </sequence>
  </macro>
</avolites.macros>


Anyway, is it possible combination of recorded macro and titan api macro??
If it's possible, I could make them into one macro.

Re: Align Mode

Posted: 28 Jun 2018, 09:28
by kimwida
"Menu" button > "Align Fixtures" > "Repeat Attributes" or "Spread Attributes"

I recorded these step to a macro. But the macro only does toggle.
I want to two macros which each do only "repeat" or "spread".

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<avolites.macros>
  <macro id="Align_Mode_Repeat">
    <name>Align Mode Repeat</name>
    <sequence>
      <step pause="0">ActionScript.SetProperty.Enum(Programmer.Editor.Fixtures.AlignMode,"Repeat")</step>
    </sequence>
  </macro>
</avolites.macros>

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<avolites.macros>
  <macro id="Align_Mode_Spread">
    <name>Align Mode Spread</name>
    <sequence>
      <step pause="0">ActionScript.SetProperty.Enum(Programmer.Editor.Fixtures.AlignMode,"Interpolate")</step>
    </sequence>
  </macro>
</avolites.macros>


But they don't work. Maybe alignmode works in the way of align processing.

Re: Align Mode

Posted: 28 Jun 2018, 09:37
by Gregory
Perhaps I wasn’t clear, when I said that the property name should be passed in as a string, that means that the property name, the first parameter, should be in quotation marks.

Code: Select all

ActionScript.SetProperty.Enum("Programmer.Editor.Fixtures.AlignMode", "Repeat")

Re: Align Mode

Posted: 28 Jun 2018, 09:55
by kimwida
Yes, it works! Thanks.

Align Color Macro of fixture 1 thru fixture 8

1. Select 1st fixture and apply first color palette.
2. Select 8st fixture and apply second color palette.
3. Select all fixture (or using a group).
4. "Menu" button > "Align Fixtures" > Set the setttings. (--c-----, Remember Mask, Spread Attributes, Align Programmer Attributes, Palette References Maintained)
5. Select 1st fixture then select 8st fixture.
6. "Align" button

This macro makes two color gradient from fixture 1 thru fixture 8.
And I recorded another macro which make two color gradient from center to two side.
I like these macros very much. Because they make good look in very short time.
And very easily, you just need to change the two color palettes.

If I can write the align color macro process in the titan api, I can make the macro in general use.

Re: Align Mode

Posted: 28 Jun 2018, 10:28
by kimwida
1. Select 1st fixture and apply first color palette.

Which one shoud I use to select a fixture by API??
Void Selection.Context.Global.SelectFixture(Handle handle)
Void Selection.Context.Programmer.SelectFixture(Handle handle)
Void Selection.Context.SelectFixture(Handle handle)

should need this.
Void Palette.ApplyPalette(Handle handle, Boolean usePaletteTimes)

2. Select 8st fixture and apply second color palette.

Same step 1.

3. Select all fixture (or using a group).

should need this.
Void Group.RecallGroupNumeric(Single userId)

4. "Menu" button > "Align Fixtures" > Set the setttings. (--c-----, Remember Mask, Spread Attributes, Align Programmer Attributes, Palette References Maintained)

No guess.

5. Select 1st fixture then select 8st fixture.

No guess.


6. "Align" button

should need this.
Void Programmer.Editor.Fixtures.Align()

Re: Align Mode

Posted: 28 Jun 2018, 10:34
by icke_siegen
I 100% second this idea/request. I'd say this goes in two directions:
- the syntax of Align needs to be grossly improved (I submitted this various times)
- for future implementations, the API should be more variable, and this is another perfect example for this: align requires (at least) 3 inputs (assuming default values for the others): first fixture, second fixture, range of fixture to be aligned. Now the API should allow to pass these parameters to the macro at runtime: either by prompts, or by a separator.

Re: Align Mode

Posted: 30 Jun 2018, 20:56
by kimwida

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<avolites.macros>
  <macro id="Test_Align">
    <name>Test Align</name>
   <sequence>
      
      <step pause="0.01">ActionScript.SetProperty.Boolean("Programmer.Editor.Fixtures.ClearAlignMask",false)</step>
      <step pause="0.01">ActionScript.SetProperty.Enum("Programmer.Editor.Fixtures.AlignMode","Interpolate")</step>
      <step pause="0.01">ActionScript.SetProperty.Boolean("Programmer.Editor.Fixtures.AlignAddAllToProgrammer",false)</step>
      <step pause="0.01">ActionScript.SetProperty.Boolean("Programmer.Editor.Fixtures.AlignCopyPaletteReferences",false)</step>   

      <step pause="0.01">Selection.Context.Programmer.SelectFixture(handle:"Location=Fixtures,1,1")</step>
      <step pause="0.01">Palette.ApplyPalette(handle:"Location=Colours,1,14", false)</step>
            
      <step pause="0.01">Selection.Context.Programmer.SelectFixture(handle:"Location=Fixtures,1,8")</step>
      <step pause="0.01">Palette.ApplyPalette(handle:"Location=Colours,1,15", false)</step>
            
      <step pause="0.01">Group.RecallGroupNumeric(5)</step>
      
      <step pause="0.01">AlignSelection.SelectFixture(handle:"Location=Fixtures,1,1")</step>
      <step pause="0.01">AlignSelection.SelectFixture(handle:"Location=Fixtures,1,8")</step>
      
      <step pause="0.01">Programmer.Editor.Fixtures.Align()</step>
    </sequence>
  </macro>
</avolites.macros>


It works. But I don't know how to set align mask.

Code: Select all

<step pause="0.01">ActionScript.SetProperty.SetFlag("Attribute.Mask.Align.Value","C")</step>
<step pause="0.01">ActionScript.SetProperty.String("Attribute.Mask.Align.Value","C")</step>
<step pause="0.01">ActionScript.SetProperty("Attribute.Mask.Align.Value","C")</step>

They don't work.
==========================================================================
I found it doesn't work sometimes.
I tried many things to find out the reason. But I don't know why. It looks like time lag or something.
I should stick to the recorded macro one. :( :( :(