PDA

View Full Version : real time or interactive script



waelkf
12-12-2009, 12:32 AM
hi there,
i need to create lscript that will create box interactively, where the given result will be drawn in real time.

anyone can help me pleeeeeeeeeeeeeease.

thank you in advance

dpont
12-12-2009, 02:28 AM
Lscript have no non-modal requester,
but this can be faked, except you couldn't
change viewport settings.



@version 2.2
@warnings
@script modeler
@name plane

//Need all global
scl;
c1 = nil;
start = 0;



main
{
scl = 100;
meshedit();

reqbegin("Simple Plane");

c1 = ctlminislider("Scale %",scl,1,1000);

ctlrefresh(c1,"call");


if(!reqpost())
{
undo();
return;
}

reqend();
}

//call back run the plane builder from within requester
call:value
{
undo();
meshedit();
}

//plane builder function
meshedit
{
if (start == 1)
scl = getvalue(c1);

editbegin();

pnt[1] = addpoint(<-0.5 * (scl/100),0,0.5 * (scl/100)>);
pnt[2] = addpoint(<0.5 * (scl/100),0,0.5 * (scl/100)>);
pnt[3] = addpoint(<0.5 * (scl/100),0,-0.5 * (scl/100)>);
pnt[4] = addpoint(<-0.5 * (scl/100),0,-0.5 * (scl/100)>);

poly = addpolygon(pnt);
editend();

start = 1;
}

Denis.

waelkf
12-12-2009, 11:34 PM
thank you, i tried it, and it work fine. need some time to study it,