I’m just starting to get into Python scripting in blender, and I’ve already hit a weird snag. When I try to execute this example code from Wartmann’s “The Blender Book” (which, true, is not up to date for my version 2.25 blender):
import Blender if (Blender.bylink): obj = Blender.link if (obj.LocZ <0.0): obj.LocZ = 0.0
For some reason, it doesn’t work at all. It seems as if the object I’ve linked to the script isn’t acknowledging the link. The script is supposed to prevent an object from going lower than 0 on the Z axis.
I’ve tried linking with Frames Changes as well as Redraw, but no dice. I can get it to send info to stdout by including this line:
Naturally, all it outputs is 0 everytime I move the object around. Has anyone else run into this? It’s seems really, really basic, but I can’t find any documentation of the problem.