Visual Selector - cameras..

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  08 August 2013
Visual Selector - cameras..

Does anyone know how can i add a button in my visual selector that makes the active camera a different one?
 
  08 August 2013
Originally Posted by smurfted: Does anyone know how can i add a button in my visual selector that makes the active camera a different one?


Add a hotspot with the Action type "Python".

Use the following script with your camera's name instead of MyCameraName:


 import c4d
 from c4d import documents
 
 def main():
 	doc=c4d.documents.GetActiveDocument()
 	if doc!=None:
 		bd=doc.GetActiveBaseDraw()
 		if bd!=None:
 			cam=doc.SearchObject("MyCameraName")
 			if cam!=None:
 				bd.SetSceneCamera(cam)
 	
 if __name__=='__main__':
 	main()
 
 
  08 August 2013
That is great, thanks for doing that, but i'm getting a syntax error line 13 position 26?

The end of the second to last line.

Any ideas on why that could be?
 
  08 August 2013
Originally Posted by smurfted: That is great, thanks for doing that, but i'm getting a syntax error line 13 position 26?

The end of the second to last line.

Any ideas on why that could be?


The script is copied directly from a C4D input field and works fine there. I guess the forum is messing with the formatting, although I can't see an obvious mess in the text. Make sure in the Python input field that the indents are set properly.
 
  08 August 2013
Good man, there were just a few spaces that were halting it's brilliance..

Super helpful thank you..
 
  08 August 2013
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 05:49 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.