Dear Blender Artists community,
I have just begun with some blender python beginner’s tutorials, and ran across my first issue.
I have this very simple piece of code I want to run in a text block (not directly in the python console), from this tutorial page:
import bpy from bpy import context from math import sin, cos, radians add_cube = bpy.ops.mesh.primive_cube_add cursor = context.scene.cursor_location radius = 5 anglesInRadians = [radians(degree) for degree in range(0,360,36)] for theta in anglesInRadians: x = cursor.x + radius * cos(theta) y = cursor.y + radius * sin(theta) z = cursor.z add_cube(location=(x,y,z))
The code won’t run due to this error message:
AttributeError: Calling operator “bpy.ops.mesh.primitive_cube_add” error, could not be found.
I’m running Blender 2.75 and it refers to a Python version 2.75, so that should be correct.
However, when I look for the bpy module source code in my C:\Programs drive (Blender installation folder) and I open it in the text editor, I indeed can’t find any reference to the primitive_cube_add.
So I suspect that I don’t have the proper Python version installed…?
Thanx for any clues