MacrosThis is a featured page

Blade3D Macros provide a very simple way to add logic to the application. Eamples of this is playing random animations, sounds or invoking actions when a trigger volume is entered.


To create a macro right click on the Macros folder in the Object Browser and select the type of macro to create.

Macros - Blade3D

Macros can be invoked in a number of ways:

1. Click on the Macro tab in the property sheet for the created macro and set the Play property to True.


Macros - Blade3D

2. You can also use a script to dynamically play macros. Here is an example of playing a macro in a script:

IObject macros = context.Site.GetObject("#Module/Macros");
IObject macro = macros.GetChild(0);
macro.SetValueFromStringByName("Play", "true");


3. Macros can be triggered through Macro Triggers. For more information see the Trigger Volume section.


Here are the types of macros that can be created in Blade3D:


Set Value Macro

The Set Value Macro is used to set the value of a given property for a specified object.


Macros - Blade3D
Target Instance The object to modify
Target Property The property to change
Time The duration in seconds within which the value of the property will be changed
Interpolate If true, the value of the property will be interpolated over the given time

Note that when you select the target property for the macro, the control to edit that property will appear at the bottom of the property sheet. Use this control to set the value of the property to the desired one.


In the example below when the macro is played, the radius of the specified sphere will be changed from its current value to 5 over a 10 second period.


Macros - Blade3D


Play Sound Macro

The Play Sound Macro is used to play an audio sample or a sound.



Macros - Blade3D

Sound The audio sample or sound to play



Play Animation Macro

The Play Animation macro is used to play an animation for a specified animated model.



Macros - Blade3D

Animation The animation to play
Model Instance The model instance to play the animation for



Random Macro

Random macros are containers for other macros. When a random macro is invoked, the contained macros will be played randomly.



Macros - Blade3D

Distribution


An enum value which controls how the macros will be selected from the contained macros
Flat - All child objects have an equal chance of being chosen
Logarithmic - Child objects further down the list have 50% less chance of being chosen



Compound Macro

Compound macros are containers for other macros. When a compound macro is invoked, all contained macros will be played in sequence.


Behnaz
Behnaz
Latest page update: made by Behnaz , Jun 6 2007, 1:20 AM EDT (about this update About This Update Behnaz Edited by Behnaz


view changes

- complete history)
Keyword tags: None
More Info: links to this page
There are no threads for this page.  Be the first to start a new thread.