User Tools

Site Tools


macros:example:reverseallshapes

Example

Shapes - Reverse All Shapes

by: Sebastian Beutel, February 2020
published: here
description: this macro reverses all running shapes
remarks: requested by Marco Rossoni
“is it possible to do a macro that invert the shape direction? thanks a lot … , e.g. I have a symmetric circle running outwards and with that macro make that circle running inward.”

From Titan v15 on ClearAll() requires two parameters, see Programmer.Editor.ClearAll.
Simply change the relevant line(s) to Programmer.Editor.ClearAll(false, false).

functions

affected properties

control structures

Code

ReverseAllShapes.xml
<?xml version="1.0" encoding="utf-8"?>
<avolites.macros>
 
  <macro id="Avolites.Macros.ReverseAllShapes" name="Reverse All Shapes">
    <sequence>
      <step>Editor.Shapes.ConnectShapesList()</step>
      <step condition="!Editor.Shapes.ProgrammerShapes.Empty">Editor.Shapes.SelectAllShapes()</step>
      <step condition="!Editor.Shapes.EditShapesEmpty">
        ActionScript.SetProperty.Boolean("Editor.Shapes.EditingPlaybackShapes", true)
      </step>
      <step>Editor.Shapes.Reverse()</step>
      <step>Programmer.Editor.ClearAll()</step>
    </sequence>
  </macro>
 
</avolites.macros>

Explanation

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

  • Editor.Shapes.ConnectShapesList() lists and highlights all running shapes
  • Editor.Shapes.SelectAllShapes() selects all shapes from the programmer if there are any
  • Editor.Shapes.EditingPlaybackShapes flag is set if there are any shape being edited
  • Editor.Shapes.Reverse() actually reverses all shapes currently being edited
  • Programmer.Editor.ClearAll() finally clears programmer and editor

How to use it

  1. e.g. fire a playback with a shape
  2. fire this macro - the running shape will be inverted and runs in the other direction
You could leave a comment if you were logged in.
macros/example/reverseallshapes.txt · Last modified: 2021/06/10 19:07 by icke_siegen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki