Scripting - dfki-ric/phobos GitHub Wiki

Blender has a great Python scripting API that Phobos is based on. However, you need not limit yourself to using our pre-defined operators TODOL, but you can create your own scripts in Blender and save them together with your model, or punch in a few commands in a python terminal.

scripting

You can open a text editor in Blender...

scripting

Hit the '+ New' button to create a new text file, name it as you fancy and start editing. A Blender file can contain many such user-created text files and they can also be loaded and saved from/to disc, allowing to import scripts that are often used or store robot-specific scripts for later use together with the robot.

scripting

When this simple script is run, we create a new custom property of the selected objects, in the same way as one would create new entries to a Python dictionary.

scripting

You can also switch the overall GUI of Blender to the 'Scripting' layout, thus opening a text editor and python terminal by default.

scripting

Blender's python terminal is quite powerful, providing an awesome autocomplete function, so you can easily access all properties of the objects that make up your robot. Press TAB to use it.

We are using short scripts made for the occasion all the time when editing our models and it can especially speed up repetitive tasks. If you're using a script again and again on your robots, you may even want to build an operator for it and contribute it to Phobos.

⚠️ **GitHub.com Fallback** ⚠️