Get the current camera in a view with v4 2004-07-01 - By OO's mailbot
Back Great, thanks.
Camera switching is done by using the SetAttributeValue("activecamera:b", "Camera Name") but there is a little excentricity that the other cameras (user,top,right,...) return their names as "&Top" but you need to use "Top" to set the viewport to use that camera.
// get the view manager var oLayout = Desktop.ActiveLayout; var oViewManager = oLayout.Views("vm");
//Set the active camera to user oViewManager.SetAttributeValue( "activecamera:b", "User" );
//This will now print: "&User" as the camera name var cameraName = oViewManager.GetAttributeValue( "activecamera:b" ); LogMessage( "B View Camera: " + cameraName );
OO
On Jul 2, 2004, at 6:53 AM, Alain Laferri�re wrote:
> > Hi Olivier, > > I use this method in Xgs_Slate to get the current camera name in a > view : > > // get the view manager > var oLayout = Desktop.ActiveLayout; > var oViewManager = oLayout.Views("vm"); > > var cameraName = oViewManager.GetAttributeValue( "activecamera:b" ); > LogMessage( "B View Camera: " + cameraName ); > > Xgs display callbacks have access to a "XSI_ViewData" structure, which > contains the name of the view for which the display callback is being > evaluated - this allows to get the active camera name for the current > view. > > If you need the camera object, you can find it by name under the > active scene root. > > I hope this helps, > Alain > > -- --Original Message-- -- > From: owner-xsi@(protected) [mailto:owner-xsi@(protected)] On > Behalf Of OO's mailbot > Sent: Thursday, July 01, 2004 10:28 PM > To: XSI@(protected) > Subject: Get the current camera in a view with v4 > > Did anyon figure out how to get/set the active camera of the views in > the vie manager? I know how to get to the views using the new OM > objects, but I don't know if there is an attribute on the views that > allows the camera to be set or get. > > //Get the View A from the View Manager > var oLayout = Desktop.ActiveLayout; > var oViewManager = oLayout.Views("vm"); > var oViewB = oViewManager.Views("B"); > > LogMessage(oViewB.Name +" is a "+ oViewB.Type); > > //This is no it: > var currCam = oViewB.GetAttributeValue("Camera"); > > How do I get/set the current camera of that view? Seems a shame to be > so close and yet so far... > > --- > Olivier Ozoux's mailing list robot > mailbot@(protected) > > --- > Unsubscribe? Mail Majordomo@(protected) with the following text in > body: > unsubscribe xsi > > > --- > Unsubscribe? Mail Majordomo@(protected) with the following text in > body: > unsubscribe xsi
--- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|