macros:example:setshapedirection

This is an old revision of the document!


Example

Set Shapes (and KFS) Direction

by: Gregory Haynes, January 2019
published: http://forum.avolites.com/viewtopic.php?f=20&t=5961
description: Set keyframe shapes direction
remarks:
The function that the Effects Editor window uses to change the direction is Editor.Shapes.SetShapeDirection however the parameters for this are the ID of the shape and the direction object that should be set. The object is not just a name but an item with various parameters which I'm not sure will be possible to access or create in macros. As a key frame shape is still a shape you should be able to use the standard shape functions to make changes but may mean that the UI does not update properly. You can select key frame shapes in the Shape Menu by pressing Edit followed by Select Shape and then use the Direction options within the shape menu.

functions

affected properties

control structures

Code

<macro id="Avolites.Macros.ProgrammerShapes.Direction.RightToLeft" name="Programmer Shapes Right to Left">
  <description>Select all programmer shapes and set the direction to Right to Left.</description>
  <sequence>
    <step>Editor.Shapes.ProgrammerShapesList()</step>
    <step condition="!Editor.Shapes.ProgrammerShapes.Empty">Editor.Shapes.SelectAllShapes()</step>
    <step condition="!Editor.Shapes.EditShapesEmpty">Editor.Shapes.SetCurrentShapesDirection("RightToLeft")</step>
  </sequence>
</macro>
 
<macro id="Avolites.Macros.ProgrammerShapes.Direction.LeftToRight" name="Programmer Shapes Left to Right">
  <description>Select all programmer shapes and set the direction to Left To Right.</description>
  <sequence>
    <step>Editor.Shapes.ProgrammerShapesList()</step>
    <step condition="!Editor.Shapes.ProgrammerShapes.Empty">Editor.Shapes.SelectAllShapes()</step>
    <step condition="!Editor.Shapes.EditShapesEmpty">Editor.Shapes.SetCurrentShapesDirection("LeftToRight")</step>
  </sequence>
</macro>

Explanation

This explains the functional steps within the sequence. For all the other XML details please refer to Formats and syntax

  • Editor.Shapes.ProgrammerShapesList gets all the programmer shapes including key frame shapes
  • Editor.Shapes.SelectAllShapes selects all the programmer shapes if there are any
  • Editor.Shapes.SetCurrentShapesDirection(“…”) sets the direction of the selected shapes if there are any

How to use it

Snippet only to explain the use of the functions.

You could leave a comment if you were logged in.
macros/example/setshapedirection.1552154997.txt.gz · Last modified: 2019/03/09 18:09 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki