Python Woes

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

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

Python Woes

Postby emaurina » Sat Nov 16, 2002 3:10 am

Hi,

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 = Blender.link
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

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

HOWTO

Postby 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 http://www.elysiun.com/

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

Postby 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.

theeth
Posts: 1184
Joined: Wed Oct 16, 2002 5:47 am
Location: Montreal
Contact:

Postby 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.

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


Return to “Python”

Who is online

Users browsing this forum: No registered users and 1 guest