Python Woes

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
Posts: 2
Joined: Sat Nov 16, 2002 3:07 am

Python Woes

Post by emaurina » Sat Nov 16, 2002 3:10 am


I'm hoping a Blender guru will see this and take pity on me. I've got Blender 2.25 and Python 2.20 installed. I've got The Official Blender 2.0 guide and have been following the lessons (I have The Blender Bood tranlated to english also). Anyway, I'm trying to run the first python example and it just doesn't do anything.

import Blender
if (Blender.bylink):
obj =
if(obj.LocZ<0.0): obj.LocZ = 0.0

Then I create a sphere, link the script to the object and then try to move the object. It moves in all dimensions w/o being stopped like it is supposed to. Can anyone give me a clue as to how to get these scripts working? BTW, the DOS (using Blender for windows and running Win2000) window shows no erros.

Also, going into the text window and typing:

import sys
print sys.path

and then pressing ALTP works. Argh!!! Frustrated. :evil:

Also, I've made more complicated scripts like vertex export work, but for some reason this simple script doesn't work. I would really love to see it working and to know what I'M DOING WRONG (likely) so I can better learn this awesome tool. :?

Please help if you can

Posts: 13
Joined: Sun Oct 20, 2002 12:16 am
Location: Georgia Tech, Atlanta


Post by markluffel » Sun Nov 17, 2002 1:50 am

Go to your script-buttons tab of the button window. Click the axes in the window bar - this activates object driven scripts.
Select your object then click the "new" button on the left, drag the dropdown menu to Redraw and type the name of your script in the text box.

This is probably not the best place to ask usage questions. Try

Posts: 2
Joined: Sat Nov 16, 2002 3:07 am

Post by emaurina » Sun Nov 17, 2002 8:49 pm

Thanks! I'm still confused as to why there are two script windows (left and right), but I'll continue to study and hopefully it will become clear. Once I did that though, it worked. So, thanks again.

Posts: 500
Joined: Wed Oct 16, 2002 5:47 am
Location: Montreal

Post by theeth » Mon Nov 18, 2002 4:40 am

the script buttons on the right are global scene links while those on the left are object links.

Life is what happens to you when you're busy making other plans.
- John Lennon

Post Reply