Rinkhals
(Rinkhals)
July 30, 2003, 3:23pm
1
Can anyone point me in the right direction here?
The following stab in the dark definatley does not work…
sc = Scene.getCurrent()
GCam=Camera.New()
OCam=Object.New('Camera')
OCam.link(GCam)
OCam.setLocation([x1,y1,z1])
sc.link(OCam)
Any hint on setting the camera’s Look_at direction would be appreciated, too.
Many thanks,
Rink
levon
(levon)
July 30, 2003, 7:48pm
2
try this, it will get the camera and move it, might help you.
import Blender
from Blender import Object
cam = Blender.Object.Get("Camera")
cam.LocX = cam.LocX + 5
Blender.Redraw()
Rinkhals
(Rinkhals)
July 30, 2003, 11:49pm
3
Thanks for the reply.
Unfortunatly that will only get the camera (if it exists in the scene). I want to add more cameras and place them in the scene looking at different items.
Rink
jms
(jms)
July 31, 2003, 1:06am
4
import Blender
from Blender import Camera,Scene,Object
sc = Scene.getCurrent()
GCam=Camera.New()
OCam=Object.New('Camera')
OCam.link(GCam)
OCam.RotX=1.57 #this is the real "Look At" function
sc.link(OCam)
Blender.Redraw()
x1=2.0
y1=2.0
z1=0.0
OCam.LocX=x1
OCam.LocY=y1
OCam.LocZ=z1
Blender.Redraw()
Tested on blender 2.28 , works perfectly.
Rinkhals
(Rinkhals)
August 5, 2003, 3:05pm
5
JMS,
Cannot get the code you specified to work in 2.27 (2.28 might work for all I know, but it kills my script).
Bit of a Bummer.
Rink
jms
(jms)
August 6, 2003, 1:56am
6
Just tested, it works perfectely in b2.27 too.
Just an advise:
do not import the script in the blender text window with the short cut ctrl-shift-V, this adds a very very bad character at the end of each line.
Rinkhals
(Rinkhals)
August 6, 2003, 9:31am
7
JMS,
This is my code (cut and pasted from PythonWin rather than the other way around )
sc = Scene.getCurrent()
GCam=Camera.New()
OCam=Object.New('Camera')
OCam.link(GCam)
OCam.RotX=anglet
sc.link(OCam)
OCam.LocX=x1
OCam.LocY=y1
OCam.LocZ=z1
Blender.Redraw()
Still can’t get it to work. Can’t think of a reason.
Thanks for your efforts.
Rink
jms
(jms)
August 6, 2003, 2:35pm
8
What is the text error in the console?
jms
(jms)
August 7, 2003, 8:18am
10
Try to find if there is (or not) a new object camera with shift-F4
short cut…
Rinkhals
(Rinkhals)
August 7, 2003, 4:26pm
11
Well, I’m blowed!
4 little cameras! Just little dots, though,