Is it dah tumah?

Hello to all Blenderites and Pythonians,
This is my first post here.
I am impressed by the quality of the posts on this forum!
I would like to thank everyone (you know who you are) for working on blender, python and supporting/contributing to this elYsium forum, thank you! Can you imagine if all this brain power were massed in an effort to destroy the internet? Bad News! :slight_smile:

You guessed it, I’ve a problem with blender/python, and yes I am a noobie…

For future reference my box is (blah blah…)
Dell PWS400
CPU: Ripped the p3 500 and replaced with two p3 coppermine’s
MEM: 1 gig non-parity ram from crucial (I know…)
VID: Nvidia - geforce 2/32 meg (Latest detonator drivers)
OS: WinXP-Pro (Latest “Critical Updates…”)
As of today I am using:
Blender: 2.27
Python: 2.2.2

It did’nt take me long to realize that python is where the fun will be with Blender. So I banged around with it until I hit a snag. Then banged around somemore (ho hum) to find a way to reliably reproduce this snag.
Yes, I have searched the forum and atleast tried the dead faq link.
I hope this post will ultimately help other noobies.

Ok, Ok, I know you are ready for me to blow this latex glove up and snap it over my head like Howy Mandle so here goes…

There are other ways to make this happen but this seemed like the easy way to explain…

1.) Start blender (mine comes up in the top view.)

2.) Add>Empty then switch to front view and cntrl/grab/drag up a ways on the ‘z’ axis.

3.) Ok Ok, switch to the text editor and > add new (dbn=Text:)

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

4.) Ok Ok, switch back to 3d view and add the ‘Text’ script link to the selected empty and select Redraw as event.

5.) Now Grab/Drag the empty down… stops at LocZ < 0.0 right?
Cool Beanz…

6.) Now go back to the text editor and add an intentional indentation error:

   import Blender
   if (Blender.bylink):
   obj = Blender.link ###### oops
      if (obj.LocZ &lt;0.0): obj.LocZ = 0.0

7.) Ok Ok, switch back to 3d view and Grab/Drag the empty now…
It will no longer stop at LocZ < 0.0 right?
Bad Taco!

8.) Now go fix the indentation error and try it again - still broke huh?
Too much sugar in my diet?

Don’t like dead fish in my trunk so I’ve tried:
A.) Saving the good script and then cntrl-r to reload the good copy.
B.) Doing init={}
C.) keypad 9
D.) uhmmm…?

The only thing I can do is quit blender and start all over!

I’d really like to solve this little mystery.
What was the name of that ‘Dirty Birdy’ movie with James Caan and Kathy Bates by Stephen King? Damm!

Anyway thanks for reading this, maybe someday I will have a solution to offer instead of another problem :wink:

I hope it’s not dah tumah!
Cheers

sorry can’t help except for… “Misery”

Yes, this seems to be a bug. IMHO your step 7 should give an python error. To fix this, just do an Alt-P in the script-window after step 8, which gives you an indention error, after that delete the indention and set it again, and everything should work fine.

Did you post this error over at blender.org?

Yes,
Yep you’re right it seems to be a bug.
I will read the bug tracker first in the future at:
http://projects.blender.org/tracker/?atid=125&group_id=9

In 2.03 this works ok but 2.27 GUI is much nicer so,
lucky me, I’ll just keep them both!

Thanks Schlops