Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This very first script is explained and commented on in detail to give you an idea of how to write a script. While creating a program, it is absolutely important to have a plan and a concept, because without these you will hardly ever get the desired result, especially as a beginner. With growing experience and short scripts it is not always to necessary to create a complete syntax structure, but for more complex programs it is mandatory.

 

Name

Objects2Vertices.rfs

Type

Batch script

Description

This script reads out the vertices of all objects in the scene and writes them into a list. The position data are then used to place a certain object at the vertices location. These objects will be created automatically.

...

If you want to add another object type, you can write: addCube(), addTorus(), addRocket() and so on. Once it is created, RealFlow assigns a new name to it, for example “Sphere01”, “Sphere23”, “Sphere175” etc.

...

Unless the counter has reached 10, the name should be written as 01, 02, 03, 04 and so on. For this purpose the leading 0 is used and then combined with the string value of the counter: str(counter). With the “+” operator both elements are assembled together. Once 10 has been reached, the name just corresponds with the counter. Now the appropriate clone object can be identified. Finally it is necessary to translate the current vertex positions to a clone object and rescale it: 

...