View Full Version : Can you select polygons by Surface COLOUR??
eliasf7
09-03-2003, 08:31 PM
Greetings;
I'll start by saying that I am a novice user of LW (v. 7.5). I was sent a model of a house in 3ds format, which I had no problem at all importing into Modeler. The problem came about when I opened the Surface Editor and found about 500 surfaces named "mat0", "mat1", ... "mat500"!
The object itself contains 4 colours, but each of the 500 surfaces follows one of FOUR variations.
Question 1: Is there a way for me to select all polygons which have the same material colour?
I tried looking through Polygon Info (clicking 'i', after selecting the polys), and I can see the surface name and color, but I cannot select by them (they're polygon children, in that GUI). Similarly, I couldn't get what I wanted by examining the statistics.
Question 2: Assuming there's an answer to question #1, can I group the polys sharing the same material, and reduce the number of surfaces fromm 500 to 4?
Thanks much, in advance.
renderingfarmer
09-03-2003, 09:46 PM
I don't have an answer for you, buddy, but I second your question. I've also experienced situations where it would be very useful to be able to select via color. I was actually under the impression that there was indeed such a tool. Like the Statistics Menu, except with textures. Oh well. Maybe in LW8.
In polygon mode, open the Statistics window, click on the black triangle next to "Surf", choose the surface you want to select, then hit the "+" to the left -
fxnut
09-04-2003, 05:46 AM
As far as I'm aware you could do this only by writing a plugin or an LScript to do it for you. Although it wouldn't be too difficult to do.
Regards
Andy
fxnut
09-04-2003, 06:27 AM
Well, like the sucker I am for a challenge, I couldn't resist knocking up the LScript to do the job for you. Just save everything below the line as "SelectByColor.ls" and load it in via the LScript tab in Modeller. Select a surface that you want to base the selection on (by using it's color value), and press OK.
If you like this script, why not chuck a comment in my guestbook here (http://www.andynicholas.com/thezone/index.php?area=guestbook).
Regards
Andy
@warnings
@version 2.1
@script modeler
@name Select By Surface Color
main
{
surfSel = 1;
var surfStore;
editbegin();
ttlPnts = pointcount();
if(!ttlPnts)
{
error("<br>You must have geometry to perform this operation");
return;
}
editend();
x = 1;
surfObj = Surface();
while(surfObj)
{
surfStore[x] = surfObj.name;
surfObj = surfObj.next();
x++;
}
reqbegin("Select by Matching Surface Color");
c1 = ctlpopup("Surface",surfSel,surfStore);
if(reqpost())
{
surfSel = getvalue(c1);
}
else
return;
reqend();
selColor = Surface(surfSel).getValue(SURFCOLR);
surfObj = Surface();
numSet=0;
selmode(USER);
while(surfObj)
{
surfColor = surfObj.getValue(SURFCOLR);
if(surfColor == selColor)
{
selpolygon(SET,SURFACE,surfObj.name);
numSet++;
}
surfObj = surfObj.next();
}
if(numSet<=1)
{
info("No other surface matches the color value.");
}
}
gjjackson
09-04-2003, 07:29 AM
Originally posted by toby
In polygon mode, open the Statistics window, click on the black triangle next to "Surf", choose the surface you want to select, then hit the "+" to the left -
One thing I do like about that feature is you can select mulitple surfaces. If you have a lot of geometry, especially after flattening layers it can be hard to select what you want. This allows selecting exactly what surfaces you want. It just goes to show how many features there are that some may not be aware of.
eliasf7
09-04-2003, 08:09 AM
Thank you all very much for your quick and helpful responses!
Andy, the script you knocked out did exactly what I needed!! I truly appreciate your effort in writing it!! And I did write a comment in your guest book ;)
Regarding being able to select multiple surfaces in the Statistics view, I can't seem to make that work (not that I need to anymore, now that I have Andy's script!). I can select one surface at a time, but not multiple surfaces at the same time. My problem was wanting to select all polygons in my model which shared the same surface color.
Thanks again, all!
Elias.
gjjackson
09-04-2003, 12:31 PM
You should be able to select multiple surfaces. First, you need to be in polygon mode. Then use the drop-down and select the surface. Hit the + key. Then select another surface and use the + key again. This will keep selecting multiple surfaces.
ThreeDBFX
09-04-2003, 02:21 PM
I have a plugin that was written by a friend of mine. I'll ask him if he would mind me posting it.
jimnokc
09-05-2003, 03:52 PM
There is an LScript on Flay called Select Polys by Surface. Really handy if you want to combine surfaces because it keeps adding to the selection. It's a freebie too.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.