Introduction to RealFlow Scripting

trampknowledgeΛογισμικό & κατασκευή λογ/κού

4 Νοε 2013 (πριν από 4 χρόνια και 6 μήνες)

100 εμφανίσεις

NL Team
Introduction / Tutorial
Introduction to RealFlow Scripting
Introduction to RealFlow Scripting
Scripting is a perfect way of extending RealFlow's capabilities or develop your own customized solutions.
For this purpose, RealFlow offers a Python interface which provides all necessary commands and functions
to control most of the software's nodes, parameters and attributes. The description of such an interface is
called Software Development Kit (SDK). There you can find all available commands together with
explanations how to use them. RealFlow's Python-SDK is part of the internal Help Viewer and can be used
directly within the application.
"Python" and the Python logos are trademarks or registered trademarks of the Python Software Foundation,
used by Next Limit Technologies with permission from the Foundation.
The official Python logo
Python has many advantages:
Easy to learn. Python is perfect for beginners, because the source code is easy to read and
Flexibility. Python is available for all operating systems and there are many free extensions.
Active community. There are lots of developers who are constantly extending Python with new
Wide distribution. Python comes with all Unix and Linux operating systems, as well as with OS X. Of
course, there´s also an easy-to-install version for Windows.
Many resources. The web is full of Python resources and there are lots of very good books and
publications for all levels of knowledge.
Quasi-standard. Many 3D packages support Python, making it possible to directly access the data
structures of a program. Maya, for example, introduced Python as an alternative to MEL. Over the
years, Python has become the standard scripting language for many applications.
Introduction to RealFlow Scripting
Page 1/2
Free license. Python is free, even for commercial projects.
All these advantages are good reasons for an implementation of Python into RealFlow. Python is a
full-featured scripting language with support for modern structures, such as object-oriented
programming, also called OOP, or hashes for fast search algorithms. It is also possible to establish
database connections to store and administrate large amounts of data. Other packages offer
functions for numerical calculations, image generation, and OpenGL support. There are also many
modules available for 3D graphics and visualization Next Limit introduced a Python interface giving
the user the ability to overcome many of the restrictions known from earlier RealFlow versions. With
RealFlow 5 the entire Python distribution has been extended to support all the new features.
An often-discussed issue is Python´s inability to use more than one processor, also called multi-threading.
Please be aware that:
Python is single-threaded by default, but RealFlow is not. Python´s limitation has a direct effect on
RealFlow´s simulation speed when scripts are involved.
Executing Python scripts isn´t completely single-threaded. Computers and operating systems
always use more than one core or processor, though it´s not possible to address them directly.
Python provides some libraries for multi-threading support, but they only work on few platforms and
in the worst case you have to recompile your Python distribution.
You can speed up Python scripts with effective programming and data structures. Ask yourself:
Do I always need large lists or can I loop through my objects with a while statement?
Is there a point where I can empty a list and free memory?
Do I really need all global variables?
Is there unnecessary code within my script?
Are there ways to shorten or contract my code and statements?
Introduction to RealFlow Scripting
Page 2/2