Re: [SDK] object view question

Date : Mon, 05 Feb 2007 08:56:13 +0700
To : XSI(at)Softimage.COM
From : "L. Edy Susanto" <sawamura(at)neorack.com>
Subject : Re: [SDK] object view question
thx Andy and Daniel for the replies...

yah I think we have come to an end where we have to create a temporary re-usable camera..

rgds,

edy

Andy Nicholas wrote:
This should do what you asked in your original email...

Andy


var obj = ActiveSceneRoot.AddNull(); var layout = Desktop.ActiveLayout; var vObjView = layout.CreateView( "Object View", "MyView" );

vObjView.SetAttributeValue("targetcontent", obj.Fullname);
vObjView.SetAttributeValue("displayall","true");
vObjView.SetAttributeValue("lockstatus","true");
vObjView.SetAttributeValue("view","left");
vObjView.SetAttributeValue("displaymode","shaded");

//Here we create a new camera, but you can use an existing one if you prefer

var camroot = GetPrimCamera(null, null, null, null, null, null);
var cam = camroot.children(0);


//Assign the camera to the view

vObjView.SetAttributeValue("Camera",cam.fullname);


//Now, either do this for perspective camera:

SetValue(cam.fullname+".camera.proj", 1, null);
SetValue(cam.fullname+".camera.fov", 35.095, null);


//Or do this for orthographic camera

SetValue(cam.fullname+".camera.proj", 0, null);
SetValue(cam.fullname+".camera.orthoheight", 12.178, null);






-----Original Message-----
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of
L. Edy Susanto
Sent: 03 February 2007 07:03
To: XSI(at)Softimage.COM
Subject: Re: [SDK] object view question

hi Andy,
it seems that GetAttributeValue only returning a string with the camera set
for that.
I tried GetViewCamera(-1); is also not working..

I'm still looking for a way to access that View* camera that is created with
the object view..
like the: (you can see that new view is created in the application view
list)
Views.View1.UserCamera

any ideas?

rgds,

Andy Nicholas wrote:
I've not tried it, but I think you need to use:

var current_camera = View.GetAttributeValue("camera");

That'll get the name of the current camera being used by the view. You can then set the projection method and focal length on that camera.

Andy


Hi guys,
Currently struggle with this thing..

I created an new Object view with script below :
anyone know how can I change the camera to orthographic or change the focal length parameter using script?
I checked in the view list there is a new temporary view created there..


currently I can only access some of the Object view like display all, lockstatus etc..




jscript :

  var obj =  ActiveSceneRot.AddNull();
  var layout = Desktop.ActiveLayout;
  var vObjView = layout.CreateView( "Object View", "MyView" );

  vObjView.SetAttributeValue("targetcontent", obj.Fullname);
  vObjView.SetAttributeValue("displayall","true");
  vObjView.SetAttributeValue("lockstatus","true");
  vObjView.SetAttributeValue("view","left");
  vObjView.SetAttributeValue("displaymode","shaded");


thx

--
L. Edy Susanto
Character TD
Infinite Frameworks Studios
Batam

---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
body:
unsubscribe xsi

---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi





--
L. Edy Susanto
Character TD
Infinite Frameworks Studios
Batam

---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi





--
L. Edy Susanto
Character TD
Infinite Frameworks Studios
Batam

---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.