Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OpenFlipper Scripting

TODO: OpenFlipper Scripting and examples.

Iterating over objects

In the scripting system you can also iterate over objects in the scene.

// Get a list of all target triangle meshes in the scene
var list = datacontrol.getTargetObjects(DataType("TriangleMesh"));
// Print the names of all target objects
for( object in list )
{
print(datacontrol.getObjectName(list[object]))
}

DataTypes

In the scripting system the type DataType is already known. You can do for example

DataType("TriangleMesh");

You can get a string list with all available data types via

// Get the string list of data types via DataControl Plugin
var types = datacontrol.availableDataTypeNames();

Getting the DataType of an Object

// Set the object id
var object = 5;
// Get the DataTypes and print its name
print(datacontrol.dataType(object))

Vector data type

The Vec3d used in the C++ code is mapped to the scripting language. Details can be found here: Vector data type for scripting

Matrix data type

The Matrix4x4T type used in the C++ code is mapped to the scripting language. Details can be found here: Matrix data type used for scripting

Scripting Examples

Iterating over a QStringList

// Get the string list of data types via DataControl Plugin
var types = datacontrol.availableDataTypeNames();
// Iterate over the list and print to the console
for ( i = 0 ; i < types.length ; ++i ) {
print(types[i]);
}