PDA

View Full Version : Brick Wall created using Array Tool...question


HarverdGrad
09-09-2004, 12:44 AM
Hi all,

Somebody (in another thread), pointed me in the right direction to quickly create a wall of bricks. In Lightwave- it's created as one object consisting of many parts.

Using the Array- I can position the blocks so they stack...I need to keep this stack formation- but they need to be individual objects.

Any tips?
JB

maddness
09-09-2004, 02:10 AM
I need to keep this stack formation- but they need to be individual objects.
Why separate objects? what are you doing this for??

HarverdGrad
09-09-2004, 02:17 AM
Hello,

I'm exporting to Next Limit's Realflow. When the Object is imported with Dynamics applied- it is treated as one object.

Regards,
JB

faulknermano
09-09-2004, 03:29 AM
do you mean in separate layers? if so



@version 2.0
@warnings
@script modeler
@define FILE 1
@define LAYER 2
fn; c1; d1..3; ei; objName; dir; ext; l; str; source;
pivotx; pivoty; pivotz;
// continue with pivot placements
setPivotOnCurrentObject
{
pc = editbegin();
if(!pc)
return;
tv = <0,0,0>;
for(k=1;k<=pc;k++)
tv = tv + pointinfo(points[k]);
tv = tv / <pc,pc,pc>;
editend();
setpivot(tv);
}
exportLayerAsLWO
{
while(true)
{
(polyc) = polycount();
if(!polyc)
break;
editbegin();
poly = polygons[1];
editend();
selpolygon(CLEAR);
selpolygon(SET,POLYID,poly);
if(mode == 1)
selpolygon(SET,CONNECT);
copy();
selhide();
new();
paste();
setPivotOnCurrentObject();
asas = getdir(OBJECTSDIR);
ei = ei + 1;
str = string(objName,ei,ext);
save(str);
close();
}
}
activeLayers: ndx
{
if(ndx == 2)
return(false);
else
return(true);
}
main
{
ei = 0;
f = recall("FILENAME","*.lwo");
mode = integer(recall("MODE",1));
oDir = string(getdir(OBJECTSDIR),"<A href="file://\",f">\\",f);
(polyc) = polycount();
if(!polyc)
error("No data.");
reqbegin("MultiFid A");
c0 = ctlchoice("Source",1,@"Current Layer","All Layers"@);
c1 = ctlchoice("Output",2,@"To File","To Layers"@);
c1b = ctlfilename("File",oDir,80,false);
c2 = ctlchoice("Mode",mode,@"Per Connected","Per Polygon"@);
d1 = ctlchoice("Pivot X",1,@"No Change","--","==","++"@);
d2 = ctlchoice("Pivot Y",1,@"No Change","--","==","++"@);
d3 = ctlchoice("Pivot Z",1,@"No Change","--","==","++"@);
ctlactive(c1,"activeLayers",c0,c1b);
return if(!reqpost());
gvfn = getvalue(c1b);
if(gvfn)
{
(d,p,f,ext) = split(gvfn);
ext = ".lwo";
objName = string(d,p,f);
sf = string(f,ext);
store("FILENAME",sf);
}
else
objName = nil;
pivotx = getvalue(d1);
pivoty = getvalue(d2);
pivotz = getvalue(d3);

source = getvalue(c0);
output = getvalue(c1);
mode = getvalue(c2);
store("MODE",mode);
if(output == LAYER) // if layer output then there could only be one layer as reference
source = 1;
reqend();
return if(!pointcount());
mainLayer = lyrfg();
l = mainLayer[1];
selmode(USER);
selpolygon(CLEAR);
while(true)
{
editbegin();
poly = polygons[1];
editend();
selpolygon(SET,POLYID,poly);
if(mode == 1)
selpolygon(SET,CONNECT);
selmode(GLOBAL);
(polycGLOBAL) = polycount();
selmode(USER);
(polyc) = polycount();
if(polycGLOBAL == polyc)
{
selunhide();
setPivotOnCurrentObject();
break;
}
if(output == FILE)
{
exportLayerAsLWO();
if(source == 1)
{
selunhide();
break;
}
else
{
selunhide();
lyrsetfg(++l);
}
}
if(output == LAYER)
{
selinvert();
cut();
setPivotOnCurrentObject();
editend();
lyrsetfg(++l);
paste();
}
}
}


caveat: if i remember correctly, only the toLayers func works. i'm not sure if i finalised the export to lwo feature.

CGTalk Moderation
01-19-2006, 04:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.