workshops:blender:python_tools_in_blender
Differences
This shows you the differences between two versions of the page.
workshops:blender:python_tools_in_blender [2015/06/19 00:58] – created Julien Deswaef | workshops:blender:python_tools_in_blender [2015/06/20 19:27] (current) – Julien Deswaef | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Python tools in Blender ====== | ||
- | <code=python> | + | ===== The Scripting layout ===== |
- | >>> | + | Blender has a handy " |
- | ... | + | * **Info panel** expanded to see what Python commands are being called when manipulating the interface |
- | ... | + | * **Text editor** to write your scripts |
- | Camera | + | * **Console** to explore commands |
- | Cube | + | * And the panels we know from the " |
- | Lamp | + | |
- | >>> for object in bpy.data.objects: | + | In the Menu, '' |
- | ... | + | |
- | ... | + | ===== Accessing data ===== |
- | < | + | Some examples of how to navigate in Blender data from the console. |
- | <bpy_struct, Object(" | + | |
- | < | + | <code=python> |
+ | # With the default scene when starting Blender | ||
- | >>> | + | for objects |
- | ... print(object.location) | + | print(objects.name) |
- | ... | + | # Camera |
- | <Vector (7.9362, -7.1326, 3.8174)> | + | # Cube |
- | <Vector (0.0000, 0.0000, 0.0000)> | + | # Lamp |
- | <Vector (4.0762, 1.0055, 5.9039)> | + | |
- | >>> | + | for object in bpy.data.objects: |
- | >>> | + | print(object.location) |
- | 10 | + | # <Vector (7.9362, -7.1326, 3.8174)> |
+ | # <Vector (0.0000, 0.0000, 0.0000)> | ||
+ | # <Vector (4.0762, 1.0055, 5.9039)> | ||
- | >>> | + | for object in bpy.data.objects: |
- | ... print(object.location.x) | + | print(object.location.x) |
- | ... | + | # 7.93615198135376 |
- | 7.93615198135376 | + | # 0.0 |
- | 0.0 | + | # 4.076245307922363 |
- | 4.076245307922363 | + | |
</ | </ |
workshops/blender/python_tools_in_blender.1434668322.txt.gz · Last modified: 2015/06/19 00:58 by Julien Deswaef