Switch cameras
-
Boris
- Posts: 67
- Joined: 25 May 2012, 14:35
- Location: R&M
Switch cameras
Hi guys , tell me how to make the switch button for camera, so the camera switched to the upper left screen !?
Oops ,something went wrong 
-
Hirazi Blue
- Administrator
- Posts: 5113
- Joined: 04 Jun 2009, 10:15
Re: Switch cameras
Could you please try to explain a little better, what you mean by "the camera switched to the upper left screen"? At the moment this is unclear to me, making it very hard to help...

Stay safe, sane & healthy!
-
Boris
- Posts: 67
- Joined: 25 May 2012, 14:35
- Location: R&M
Re: Switch cameras
I want to create a camera and attach them to objects and then switch between the cameras and so it was the upper-left viewport / i hope you understand me /Hirazi Blue wrote:Could you please try to explain a little better, what you mean by "the camera switched to the upper left screen"? At the moment this is unclear to me, making it very hard to help...
Oops ,something went wrong 
-
Hirazi Blue
- Administrator
- Posts: 5113
- Joined: 04 Jun 2009, 10:15
Re: Switch cameras
So you define two cameras beforehand and want a button to switch between them in the upper-left viewport? A script button like that obviously will have to know which cameras (names) to switch between.
Stay safe, sane & healthy!
-
Boris
- Posts: 67
- Joined: 25 May 2012, 14:35
- Location: R&M
Re: Switch cameras
Yeah, exactly !Hirazi Blue wrote:So you define two camera beforehand and want a button to switch between them in the upper-left viewport?
Oops ,something went wrong 
-
Hirazi Blue
- Administrator
- Posts: 5113
- Joined: 04 Jun 2009, 10:15
Re: Switch cameras
If I find the time, I will look into it over the weekend... (but I can't promise I'll find the time) ;)
Stay safe, sane & healthy!
-
Boris
- Posts: 67
- Joined: 25 May 2012, 14:35
- Location: R&M
Re: Switch cameras
ok, I hope you can help me, thank you for your attentionHirazi Blue wrote:If I find the time, I will look into it over the weekend... (but I can't promise I'll find the time) ;)
Oops ,something went wrong 
-
Hirazi Blue
- Administrator
- Posts: 5113
- Joined: 04 Jun 2009, 10:15
Re: Switch cameras
Try this very quickly made, untested little script. Replace the strings after CameraName1 and CameraName2 with the strings for the actual names of your cameras. Create a toolbar, drag the script unto it, to make a button.
It's Python, by the way. Look out for the tabs (the lines after if and else should be indented by one tab... ;)
For this to work, one of your two camera has to already be selected in Viewport A.
Code: Select all
CameraName1 = "Camera"
CameraName2 = "Camera1"
camthis = Application.GetViewCamera(0)
if str(camthis) == str(CameraName1):
Application.SetViewCamera(str(CameraName2), 0)
else:
Application.SetViewCamera(str(CameraName1), 0)For this to work, one of your two camera has to already be selected in Viewport A.
Stay safe, sane & healthy!
-
Boris
- Posts: 67
- Joined: 25 May 2012, 14:35
- Location: R&M
Re: Switch cameras
Hirazi Blue wrote:Try this very quickly made, untested little script. Replace the strings after CameraName1 and CameraName2 with the strings for the actual names of your cameras. Create a toolbar, drag the script unto it, to make a button.
It's Python, by the way. Look out for the tabs (the lines after if and else should be indented by one tab... ;)Code: Select all
CameraName1 = "Camera" CameraName2 = "Camera1" camthis = Application.GetViewCamera(0) if str(camthis) == str(CameraName1): Application.SetViewCamera(str(CameraName2), 0) else: Application.SetViewCamera(str(CameraName1), 0)
For this to work, one of your two camera has to already be selected in Viewport A.
this is what I need , Man , i love you !
Oops ,something went wrong 