PDA

View Full Version : Extend Camera FrameSize



papou
12-04-2010, 12:42 PM
This script help to render all around the current framesize in %.


@version 2.2
@warnings
@name Extend Camera FrameSize
@script generic

//2010(c)TAIS

frame = 0; varwidth = 1920; varheight = 1080; varpercent = 20;

generic
{
scene = Scene();
selItems = scene.getSelect();
selected_type = (selItems[1].genus);
if (selected_type == 3)
{
reqbegin("Extend Frame Size");
reqsize(220,120);
c1 = ctlminislider("Width ",varwidth,1920,80000);
c2 = ctlminislider("Height ",varheight,1920,80000);
c3 = ctlminislider("% Border",varpercent,20,100);
return if !reqpost();

camera = Camera();
varwidth = getvalue(c1);
varheight = getvalue(c2);
varpercent = getvalue(c3)/100;
zfactor = camera.zoomFactor(frame) * (1 - varpercent);
varwidth = varwidth * (1 + varpercent);
varheight = varheight * (1 + varpercent);

reqend();

Clone();
FrameSize (varwidth,varheight);
ZoomFactor (zfactor);
SelectAllCameras();
}
else
{
info("Select a Camera First.");
}
}

This script will not work when zoomfactor is controlled by a enveloppe.
(Work with Persp and Classic Cam. Havn't test it with Advanced and Real Cam.)

wrench
12-04-2010, 05:23 PM
Should this line:

c2 = ctlminislider("Height ",varheight,1920,80000);

read:
c2 = ctlminislider("Height ",varheight,1080,80000); ?

B

papou
12-04-2010, 06:24 PM
Thank you to point me in that direction. There is an error there.
This must be the minimum value authorized by the minislider!
Use this one:

@version 2.2
@warnings
@name Extend Camera FrameSize
@script generic

//2010(c)TAIS

frame = 0; varwidth = 1920; varheight = 1080; varpercent = 20;

generic
{
scene = Scene();
selItems = scene.getSelect();
selected_type = (selItems[1].genus);
if (selected_type == 3)
{
reqbegin("Extend Frame Size");
reqsize(220,120);
c1 = ctlminislider("Width ",varwidth,16,16000);
c2 = ctlminislider("Height ",varheight,16,16000);
c3 = ctlminislider("% Border",varpercent,20,100);
return if !reqpost();

camera = Camera();
varwidth = getvalue(c1);
varheight = getvalue(c2);
varpercent = getvalue(c3)/100;
zfactor = camera.zoomFactor(frame) * (1 - varpercent);
varwidth = varwidth * (1 + varpercent);
varheight = varheight * (1 + varpercent);

reqend();

Clone();
FrameSize (varwidth,varheight);
ZoomFactor (zfactor);
SelectAllCameras();
}
else
{
info("Select a Camera First.");
}
}

DiM
12-17-2010, 03:31 PM
:agree: :agree:

thx Tais ^^ I put it in my lw tools
I wanted it since a lot of years :p

papou
12-18-2010, 10:07 AM
thx dim

a small patch to correct when nothing is selected...:D



@version 2.2
@warnings
@name Extend Camera FrameSize
@script generic

//2010(c)TAIS

frame = 0; varwidth = 1920; varheight = 1080; varpercent = 20;

generic
{
scene = Scene();
selItems = scene.getSelect();

if (selItems != nil)
{
selected_type = (selItems[1].genus);
if (selected_type == 3)
{
reqbegin("Extend Frame Size");
reqsize(220,120);
c1 = ctlminislider("Width ",varwidth,16,16000);
c2 = ctlminislider("Height ",varheight,16,16000);
c3 = ctlminislider("% Border",varpercent,20,100);
return if !reqpost();

camera = Camera();
varwidth = getvalue(c1);
varheight = getvalue(c2);
varpercent = getvalue(c3)/100;
zfactor = camera.zoomFactor(frame) * (1 - varpercent);
varwidth = varwidth * (1 + varpercent);
varheight = varheight * (1 + varpercent);

reqend();

Clone();
FrameSize (varwidth,varheight);
ZoomFactor (zfactor);
SelectAllCameras();
}
else
{
info("Select a Camera First.");
}

}
else
info("Select a Camera First.");
}