Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
Scriptquestion camera and viewport

Scriptquestion camera and viewport

2005-05-20       - By Rob Wuijster

 Back
Reply:     1     2     3     4     5  

Guillaume and Patrick,

Cheers for the replys, they helped a lot to understand what's going on.
Gonna dive a little more into scripting as it seems to be needed on my
part ;)

rob wuijster
s-5 multimedia
holland


__ ____ ____ ____ ____ ____ ____

From: owner-xsi@(protected) [mailto:owner-xsi@(protected)] On Behalf
Of guillaume laforge
Sent: Thursday, May 19, 2005 6:35 PM
To: XSI@(protected)
Subject: Re: Scriptquestion camera and viewport


Here it is :

//switch_two_cams.js
//Guillaume Laforge 05-2005

var oRoot = ActiveProject.ActiveScene.Root

// your two cameras you want to switch
var cam1 = oRoot.findChild("Camera_1")
var cam2 = oRoot.findChild("Camera_2")

//The current camera in viewport b
var oVM = Application.Desktop.ActiveLayout.Views( "vm" ) ;
oCurent_Cam = oVM.GetAttributeValue ("activecamera:b") ;

//The switch
if( oCurent_Cam == cam1.Name)
{
oVM.SetAttributeValue ("activecamera:b", cam2.Name) ;
}
if( oCurent_Cam == cam2.Name)
{
oVM.SetAttributeValue ("activecamera:b", cam1.Name) ;
}

Cheers,

Guillaume Laforge
CG artist
www.vol2nuit.fr



2005/5/19, Rob Wuijster <rob@(protected)>:

  Hi,
 
  Just a quick question here:
 
  How can I script switching a camera in a certain viewport. Say
viewport B, switching from cam1 to cam2.
  I found a SetValue "Views.ViewX" statement but that doesn't
work... Still trying to grasp scripting here...
 
  cheers,
 
 
  rob wuijster
  s-5 multimedia
  holland
 
 



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2627" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=052283308-20052005>Guillaume and Patrick,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=052283308-20052005></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=052283308-20052005>Cheers for the replys, they helped a lot to understand
what's going on.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=052283308-20052005>Gonna dive a little more into scripting as it seems to
be needed on my part ;)</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=052283308-20052005></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=052283308-20052005>
<DIV align=left><!--StartFragment --><FONT face=Arial size=2>rob
wuijster</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>s-5 multimedia</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>holland</FONT></DIV>
<DIV align=left><FONT face=Arial color=#ffffff
size=2></FONT>&nbsp;</DIV></SPAN></FONT></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> owner-xsi@(protected)
[mailto:owner-xsi@(protected)] <B>On Behalf Of </B>guillaume
laforge<BR><B>Sent:</B> Thursday, May 19, 2005 6:35 PM<BR><B>To:</B>
XSI@(protected)<BR><B>Subject:</B> Re: Scriptquestion camera and
viewport<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>Here it is :</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>//switch_two_cams.js</FONT></DIV>
<DIV><FONT size=2>//Guillaume Laforge 05-2005&nbsp;</FONT></DIV>
<P>var oRoot = ActiveProject.ActiveScene.Root</P>
<P>// your two cameras you want to switch<BR>var cam1 =
oRoot.findChild("Camera_1")<BR>var cam2 = oRoot.findChild("Camera_2")</P>
<P>//The current camera in viewport b<BR>var oVM =
Application.Desktop.ActiveLayout.Views( "vm" ) ;<BR>oCurent_Cam =
oVM.GetAttributeValue ("activecamera:b") ;</P>
<P>//The switch<BR>if( oCurent_Cam == <A
href="http://cam1.Name">cam1.Name</A>)<BR>{<BR>oVM.SetAttributeValue
("activecamera:b", <A href="http://cam2.Name">cam2.Name</A>) ;<BR>}<BR>if(
oCurent_Cam == <A
href="http://cam2.Name">cam2.Name</A>)<BR>{<BR>oVM.SetAttributeValue
("activecamera:b", <A href="http://cam1.Name">cam1.Name</A>) ;<BR>}</P>
<DIV>Cheers,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Guillaume Laforge</DIV>
<DIV>CG artist</DIV>
<DIV><A href="http://www.vol2nuit.fr">www.vol2nuit.fr</A></DIV>
<DIV><BR><BR>&nbsp;</DIV>
<DIV><SPAN class=gmail_quote>2005/5/19, Rob Wuijster &lt;<A
href="mailto:rob@(protected)">rob@(protected)</A>&gt;:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px
solid">
 <DIV><SPAN><FONT face=Arial size=2>Hi,</FONT></SPAN></DIV>
 <DIV><SPAN><FONT face=Arial size=2></FONT></SPAN>&nbsp;</DIV>
 <DIV><SPAN><FONT face=Arial size=2>Just a quick question
 here:</FONT></SPAN></DIV>
 <DIV><SPAN><FONT face=Arial size=2></FONT></SPAN>&nbsp;</DIV>
 <DIV><SPAN><FONT face=Arial size=2>How can I script switching a camera in a
 certain viewport. Say viewport B, switching from cam1 to
 cam2.</FONT></SPAN></DIV>
 <DIV><SPAN><FONT size=2><FONT face=Arial>I found a SetValue "Views.ViewX"
 statement but that doesn't work... Still trying to grasp scripting
 here...</FONT></FONT></SPAN></DIV>
 <DIV><SPAN><FONT face=Arial size=2></FONT></SPAN>&nbsp;</DIV>
 <DIV><SPAN><FONT face=Arial size=2>cheers,</FONT></SPAN></DIV><SPAN class=sg>
 <DIV>&nbsp;</DIV>
 <DIV align=left><FONT face=Arial size=2>rob wuijster</FONT></DIV>
 <DIV align=left><FONT face=Arial size=2>s-5 multimedia</FONT></DIV>
 <DIV align=left><FONT face=Arial size=2>holland</FONT></DIV>
 <DIV align=left><FONT face=Arial color=#ffffff size=2></FONT>&nbsp;</DIV>
 <DIV>&nbsp;</DIV></SPAN></BLOCKQUOTE></DIV><BR></BODY></HTML>