Move the camera view like the 3d Viewport

General discussion about the development of the open source Blender

Moderators: jesterKing, stiv

Post Reply
banafaen
Posts: 0
Joined: Sun Nov 16, 2008 10:13 pm

Move the camera view like the 3d Viewport

Post by banafaen » Sun Nov 16, 2008 10:44 pm

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.

slow67
Posts: 0
Joined: Sun Jan 15, 2006 1:40 am

Post by slow67 » Mon Nov 17, 2008 7:29 am

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

banafaen
Posts: 0
Joined: Sun Nov 16, 2008 10:13 pm

Post by banafaen » Mon Nov 17, 2008 7:04 pm

thx m8. Works very well :D

jamin3d
Posts: 0
Joined: Tue May 06, 2008 6:08 pm
Location: GSP

Post by jamin3d » Mon Dec 01, 2008 8:26 am

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

Cenda
Posts: 0
Joined: Mon May 27, 2013 3:39 pm

Post by Cenda » Thu May 30, 2013 12:34 pm

This is old topic, but when somebody ask same question:

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

Post Reply