Getting started with Python Scripting in Blender

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
berky115
Posts: 0
Joined: Mon May 27, 2013 10:16 pm

Getting started with Python Scripting in Blender

Post by berky115 » Mon May 27, 2013 10:27 pm

Hello Blender community!

I've been learning python , and wanted to continue to teach myself via blender scripting! I've followed the tutorial linked below and looked over the introductory documentation.

http://en.wikibooks.org/wiki/Blender_3D ... rt_scripts

That being said, I am having trouble getting my scripts to run. With the tutorial I get the following error:

"python script failed, look in the console for now..."

I attempted to create a simple script that just printed a word to the console, and that itself isn't working. Can anyone think of a step I am over looking or a step by step guide to help me get started?

CoDEmanX
Posts: 0
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany

Post by CoDEmanX » Tue May 28, 2013 11:06 am

what's is the actual error? see system console for that (on windows: Window > Toggle system console)
I'm sitting, waiting, wishing, building Blender in superstition...

berky115
Posts: 0
Joined: Mon May 27, 2013 10:16 pm

Post by berky115 » Wed May 29, 2013 7:10 am

CoDEmanX wrote:what's is the actual error? see system console for that (on windows: Window > Toggle system console)
i am getting an error that says "No module named 'Blender' "





this is the script :
#!BPY

"""
Name: 'Wikibooks'
Blender: 259
Group: 'Export'
Tooltip: 'Wikibooks sample exporter'
"""
import Blender
import bpy

def write(filename):
out = open(filename, "w")
sce= bpy.data.scenes.active
for ob in sce.objects:
out.write(ob.type + ": " + ob.name + "\n")
out.close()

Blender.Window.FileSelector(write, "Export")

CoDEmanX
Posts: 0
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany

Post by CoDEmanX » Wed May 29, 2013 1:03 pm

that looks like really old 2.4x leftover, there's only "bpy" nowadays (was "Blender" earlier)
I'm sitting, waiting, wishing, building Blender in superstition...

Post Reply