  | | | Get the current camera in a view with v4 | Get the current camera in a view with v4 2004-07-01 - By Alain Laferrière
Back
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
|
|
 |