Page 1 of 1

Move the camera view like the 3d Viewport

Posted: Sun Nov 16, 2008 10:44 pm
by banafaen
Instead of grabbing the camera from other viewports, use "camera fly mode" or using ctrl alt num 0, would it be possible to move the camera just like in 3d viewport? Like MMB rotate, shift mmb pan etc.

Posted: Mon Nov 17, 2008 7:29 am
by slow67
blender has no way to do this at the moment.
you can assign a script to a specific viewport and have that
abbility in that viewport.

copy this script below and paste it into the text editor in blender.
Then in the 'Panels' window choose 'Script' and toggle 'Enable Script Links'.
In the ViewPort you wish to control the camera choose,
View -> Space Handler Scripts -> Scriptname.

After that as long as the camera is selected, in that viewport you should
have regular viewport controls for the camera.

Code: Select all

#SPACEHANDLER.VIEW3D.DRAW
import Blender
scn = Blender.Scene.GetCurrent()
cam = Blender.Object.Get('Camera')
if cam in scn.objects.selected:
	if Blender.Draw.MIDDLEMOUSE:
		VM = Blender.Window.GetViewMatrix()
		cam.setMatrix(VM.invert())
	else:
		pass

Posted: Mon Nov 17, 2008 7:04 pm
by banafaen
thx m8. Works very well :D

Posted: Mon Dec 01, 2008 8:26 am
by jamin3d
Cool script. Alternatively, you can select the camera you want to move, then adjust your viewport until it is where you want the camera to be, then press CTRL+ALT+NUMPAD 0 (or choose "View, Align View, Align Active Camera to View" from the 3D View header).

cheers

Posted: Thu May 30, 2013 12:34 pm
by Cenda
This is old topic, but when somebody ask same question:

Press N for show side panel, under View check option Lock Camera to View