18
« on: June 14, 2013, 07:19:36 AM »
I'm trying to figure out what getSize is in this code. Do you think it's specific to a spotlight, which is what the object is, or is it just a general object attribute?
Maybe you would be able to tell from the context. There is no getSize() attribute for a object that I can find. There's scale, or it could be dealing with the size of the spot. There is a slider for that in Blender.
if blender_light.getType()==2: #spotlight
e1=Mathutils.Euler([obj.RotX, obj.RotY, obj.RotZ])
e2=e1.toMatrix()
light_vec=Vector([obj.LocX, obj.LocY, obj.LocZ])
size = obj.getSize()
isy, isz = size[1], size[2]
if isy!=0.0: isy = 1.0/isy
if isz!=0.0: isz = 1.0/isz
lookdir = (-matrix[2][0]*isz, -matrix[2][1]*isz, -matrix[2][2]*isz)
lookAt = (light_loc[0] + 10*lookdir[0], light_loc[1] + 10*lookdir[1], light_loc[2] + 10*lookdir[2])
light.spotlight.target = lookAt