PDA

View Full Version : how to change camera types?



Red_Oddity
12-20-2007, 07:40 AM
Does anyone know if it is possible to change the camera type from say, the default Classic setting, to say Perspective or Surface camera via Lscript or the SDK.
I ask, because so far i can't find any references to those settings in either the LScript or SDK.

Sensei
12-26-2007, 08:09 AM
AFAIK no. But there is workaround: save scene, parse file, find camera, replace strings, save scene, load in LWSDK..

Red_Oddity
12-27-2007, 03:47 PM
Yes, i was afraid of that...
I asked because i was trying to create a one click shortcut way of having LW create a poly, camera, asign current material your working on and then have it render that poly with on of the new cameras and then delete the whole lot again when done.
A sort of Maya ´test texture´feature...

Still, i guess it can be done using the normal default camera LW creates.

faulknermano
12-27-2007, 07:49 PM
you can do what sensei has outlined and then do a load camera from scene, that i think i available from dstorm. not sure if it has a mandatory prompt though.

Jarno
12-28-2007, 03:26 PM
The camera types are plugins. As with all plugins, you can use the ApplyServer command to set the plugin for the currently selected camera. From LScript:

ApplyServer("CameraHandler", "Perspective");
The plugin name is the internal name, not the displayed name. For the cameras these are:

Classic
Perspective
Orthographic
surfaceBaking
Advanced
RealLens


---JvdL---

Red_Oddity
12-28-2007, 04:17 PM
Aaah, brilliant...is more like this nifty stuff documented somewhere?

edit

Nevermind, found it in the SDK docs

/edit

Red_Oddity
12-29-2007, 09:13 AM
Jarno, do you know whether or not Render() and RenderSelected() get executed after a GN script is done running, rather then render at the moment it is called within the script?

For example, in this example, LW should render the imported object before it gets deleted again in the same script, but for some reason, when LW starts rendering the object isn't there anymore.

I'm baffled about this one...



generic
{
AddCamera("_PREVIEW_");
ApplyServer("CameraHandler", "Orthographic");
FrameSize(512,512);
Position(0,0,-1);
LoadObject("D://sven//LW//objects//_PREVIEW_.lwo");
//Refresh();
//RefreshNow();
RenderSelected();

AutoConfirm(1);
ClearSelected();
SelectItem("_PREVIEW_");
ClearSelected();
AutoConfirm(0);
}

Jarno
12-29-2007, 03:18 PM
Jarno, do you know whether or not Render() and RenderSelected() get executed after a GN script is done running

This problem sounds familiar. They get executed after the script has finished and control returned to LW. And no, it's not easy to change that behaviour.

What you can do is temporarily install a plugin which gets notified of render starts and ends (e.g. a master plugin) which does the post-rendering cleanup.

---JvdL---