[Bf-python] setLocation bug?

Manuel Bastioni manuelbastioni at tin.it
Wed Aug 13 14:35:21 CEST 2003


This code don't work under 2.28:

-------------------------------------------
import Blender
from Blender import *
global obX,obY,obZ

def getLocationofFoo():
 global obX,obY,obZ

 foo = Blender.Object.Get("Mesh")

 obX = foo.LocX
 obY = foo.LocY
 obZ = foo.LocZ



def setLocationofFoo():
 global obX,obY,obZ

 foo = Blender.Object.GetSelected()[0]
 print obX,obY,obZ
 foo.setLocation(obX,obY,obZ)


getLocationofFoo()
setLocationofFoo()

-------------------------------------------

The print instruction give a correct float values, but I've
this error:

Run Python script "Text.001" ...
In Object_GetSelected()
-1.17035913467 2.9564204216 0.987630426884
Traceback (most recent call last):
  File "Text.001", line 25, in ?
  File "Text.001", line 21, in setLocationofFoo
AttributeError: expected three float arguments


If I use foo.LocX = obX, foo.LocY = obX, foo.LocZ = obZ
instead the setLocation, it work.


Thx,
                 Manuel









More information about the Bf-python mailing list