# -*- coding: latin1 -*-
import Blender
# ----------------------------------
# On suppose que l'objet sélectionné est un spot.
# ----------------------------------
SPOT=Blender.Object.GetSelected()[0]
# ----------------------------------
# On crée un Empty.
# ----------------------------------
EMPTY=Blender.Object.New('Empty')
SCENE=Blender.Scene.getCurrent()
SCENE.link(EMPTY)
# ----------------------------------
# On déplace ce spot vers l'emplacement visé
# ----------------------------------
EMPTY.setLocation(0.0,0.0,-SPOT.getData().clipEnd)
# ----------------------------------
# Then we move it to the correct
# place
# ----------------------------------
EMPTY.setMatrix(EMPTY.getMatrix()*SPOT.getMatrix())
|