PDA

View Full Version : HELP - Selection SETs/parts



Lewis
10-31-2006, 04:17 PM
Hi !

Does anybody know how tu DELETE/FLUSH All selection sets/part names (in Modeler) at once ? I have CAD object imported in LW (from OBJ) which have more than 10 000 selection sets and when i save object (1.4 million triangles) LW saves that file about 20 minutes (yes minutes :( and it's about 70MB in LWo while in OBJ it's 120MB ). I think that slowness problem is caused by PARTS/SELECTION SETS which are count/calculated when LW saves (it saves in very very small chunks) ?

Lewis
11-01-2006, 09:40 AM
Anybody :(?

Ok i found workaround. It's PITA but it works :).

1. Load model in Deep Exploration converter
2. Save in LWO format from there
3. Load that LWO in modeler (instead initial *.obj)
4. Now you don't have parts but you have layers named as were part names before (in my case 1000+ layers).
5. Cut/paste all that in one layer and resave in modeler.

Now modeler saves SAME that file in about 15 seconds comparing to previous 18-20 minutes (when i had many part names).

That's only way how i could get rid of 1000+ part names at once. Any better solution for those who don't own Deep Exploration ?

Sensei
11-01-2006, 09:59 AM
IIRC select all polygons and press Create Part and leave name field empty.. This will remove the all parts.. :)

Lewis
11-01-2006, 10:50 AM
That's interesting idea, i'll try that. Only downside is that when selecting all polygons (laso or any other way) on model with so many part names it takes several minutes to select them :(. Looks liek modeler is somehow counting all those part names before ANY tool/action is applied.

Sensei
11-01-2006, 11:01 AM
Create Part tool uses so called user selection mode, which is treating point/polygon as selected when there is none selected. You can have nothing selected, press Create Part, leave empty or give new name and press ok, and all are gone.

Lewis
11-01-2006, 11:30 AM
Good. i'll try that then. I hope it'll work fine and SAVE model normally in 20-30 seconds instead 20 minutes.

thanks

Sensei
11-01-2006, 11:45 AM
Wait a bit.. I am writing flushing tools now..
Flush All Parts removes the all parts regardless of currently active layer.
Flush Layer Parts removes just the parts that are in current active layer.
Unlike Change Part Name it does not respect whether polygons are selected, and doesn't open any window/requester, just do job.
http://www.trueart.pl/Products/Plug-Ins/FlushParts/Files/FlushParts_1_0.zip

Snosrap
11-01-2006, 07:18 PM
Wait a bit.. I am writing flushing tools now..


Sensei, have you ever been contacted by Newtek to work for them? Seems like they could use your help. Also do you do custom LW programming for companies. PM if interested.

Your unreal.

Cheers
Snos

Lewis
11-02-2006, 02:50 AM
Thanks, Sensei, that will do the trick instantly :). I just tried on my problematic objects and it's working like charm, thanks one more time :). It's weird that file what i save from LW after flush parts file is 9MB and takes about 15 seconds. When i save from LW with my weird "workflow" from DE to LW and cut/paste in one layer file is 6.5MB (aslo saved from LW) and it saves in 4-5 seconds. Must be that i forgot something to do but i don't see diference. Both meshes don't have any parts and have "default" double sided surface. I'll examine more this case to see what's the catch 22 :).

Sensei
11-02-2006, 03:21 AM
FlushAllParts removes only parts from object, but selection sets still remained..
Please try second plug-in FlushSelectionSets..
http://www.trueart.pl/?URIType=Directory&URI=Products/Plug-Ins
3rd party plug-in does not have option to permanent VMap deletion, so this plug-in just unassigns vmap from the all vertices, and when you save it and reload there will be no single sign of them..

Lewis
11-02-2006, 03:41 AM
Hmm i just tested FlushSelectionSets and it's locking up my modeler ? After 2-3 minutes still not responding and CPU bussy ? Flushparts does the job on same model (250 k) in 5 seconds. Maybe this is too much selection sets for this plugin (more than 1000 if is same as on parts) ?

Sensei
11-02-2006, 04:14 AM
Please try this version and tell me how long it took to flush selection sets..
http://www.trueart.pl/Products/Plug-Ins/FlushSelectionSets/Files/FlushSelectionSets_1_1.zip
It has cached selection sets VMap database..

Sensei
11-02-2006, 04:21 AM
Hmm i just tested FlushSelectionSets and it's locking up my modeler ? After 2-3 minutes still not responding and CPU bussy ? Flushparts does the job on same model (250 k) in 5 seconds. Maybe this is too much selection sets for this plugin (more than 1000 if is same as on parts) ?

Part can be only one per polygon. Setting part on the same polygon removes previously set. So, for 1 mln poly, it's just 1 mln very quick for LW operations.

Selection Sets can be any number per point. So if you have 1 mln points, and 1000 selection sets, it's 1 billion operations needed, in the worst case.

If v1.1 didn't speed up things to acceptable timings, I will try the last possible resort, which is checking whether selection set is set for each point before tring to clear it up.. It'll depends on how quick/slow is this routine in LW in comparision to VMap setting up routine..

Lewis
11-02-2006, 04:50 AM
Nope, still don't work :(.

I waited for 2 minutes and modeler is lock up. I tried few times and always same - CPU busy, modeler in non responding processes. Flush parts working in 3 seconds (i used stopwatch this time) :)). Maybe this screengrab of names of selection sets could help a bit ?

All Selection sets are named that way probable due DeepExploration transfer from IGES to OBJ format (parts have exactly same names but flush parts terminate them pretty fast and easy).

Sadly i can't send file to you for checking due NDA restrictions :(.

Thanks for trying to do this :thumbsup:.

Sensei
11-02-2006, 05:09 AM
Selection sets name don't matter, they're scanned dynamically in v1.1 once per tool execution and buffered.. What is point/poly/selection set count?

I believe it's working but slow, too many combinations to handle..

Lewis
11-02-2006, 05:16 AM
You are probably right. Maybe it's working but slow 'coz too many calculations needed to execute (same reason why saving this object is taking too much time IMHO). But if this can't be speed up somehow (maybe new LW core will alow faster scanning ?) i'm afraid to even try do that on other model which is 1.4 million (6x times larger than current one I'm testing) polys and evem more selection sets/parts :(.

How to check how many selectin sets i have ? Scroll bar list goes tooo long to count them manually and their numbers aren't named in correct order like 1,2,3,... They are more or less random from what i can see.

Thanks anyway for your efforts, I appreciate.

Sensei
11-02-2006, 05:32 AM
Try this, it has no speed up yet, but monitor so you see progress and can cancel by pressing ESC key.. I tried it on 160,000 points/40,000 polys object/4 selection sets, and working fine..
http://www.trueart.pl/Products/Plug-Ins/FlushSelectionSets/Files/FlushSelectionSets_1_2.zip

Lightwolf
11-02-2006, 05:39 AM
The process can indeed be slow, I wrote a plugin to delete selection sets once as well... speedy is different ;)

You can try the attached plugin, it basically kills all selection sets and shows a progress bar, so you know it is working...

Cheers,
Mike

Lewis
11-02-2006, 05:44 AM
Jezzz guys, you are FAST :).

I'll test both of these right now :). Thanks again Sensei and Lightwolf

Lightwolf
11-02-2006, 05:46 AM
Jezzz guys, you are FAST :).

I'll test both of these right now :). Thanks again Sensei and Lightwolf
Lol, I've had this on my HD for four years now and just dug it out.
I actually thought DStorm have a similar plugin, but it only deletes certain VMaps, like UVs and weights.

Cheers,
Mike - who has imported his share of heavy OBJs.

Lewis
11-02-2006, 06:08 AM
OK, I tested both plugins and good news is that both of them WORKS and have nice progress bar (i just wish we finally get % number in that progress bar instead just line so if anyone of you two know how to tell that to NT Developers please do :)). Aslo good news is that both can be stopped with ESC key and Modele ris ALIVE :).

Bad news is that it's too slow for my needs right now (De-LW conbination takes about 50-60 seconds to complete that workaround). I left BOTH plugins to work for 6 minutes and 12 seconds and here is what I got in progress bar (screen capture). Sensei's looks like much faster but still i didn't get half way in 6.x minutes :(. Lightwolf's script is obviously older so it might need tune up to match Sensei's plugin speed :).

Thanks for participating in this :). It seems that NT needs to speed up some internal calculations in Modeler ? This test is made on P4-3GHz HT processor and it uses only one core (virtuall core actually but it is not multithreaded plugin since it's 50% bussy)

you rock guys :thumbsup:

Lightwolf
11-02-2006, 06:16 AM
Bad news is that it's too slow for my needs right now (De-LW conbination takes about 50-60 seconds to complete that workaround). I left BOTH plugins to work for 6 minutes and 12 seconds and here is what I got in progress bar (screen capture). Sensei's looks like much faster but still i didn't get half way in 6.x minutes :(. Lightwolf's script is obviously older so it might need tune up to match Sensei's plugin speed :).
Lol... I'm not gonna join the race ;)

I've got even slower plugins for mesh optimization that can take hours to optimize down a 500K polygon mesh... If you have more than one mesh, let a second instance of Modeler run in the background and work in another modeler...

Cheers,
Mike

Lewis
11-02-2006, 06:24 AM
Yeh Lightwolf, I wasn't impling (<---probably wrong spelling) you need to recode plugin (join the race as you say), I'm already gratefull you made this one. I just wanted to point that KillVmap is showing it's ages since you mentioned it's few years old :) :D ?

I have only two models this time (will be more later probably but one by one) so no need for two instances of modeler.

Lightwolf
11-02-2006, 06:35 AM
I just wanted to point that KillVmap is showing it's ages since you mentioned it's few years old :) :D ?

Lol... hey, relax, I was just joking ;)

Cheers,
Mike

Sensei
11-02-2006, 07:21 AM
I am really surprised that mine is faster.. After Lightwolf comming up with his Kill_VMap, thought that mine will be slower.. :D
What route you used? Each point scan per vmap and handle just one vmap at a time, or one point scan and scanning vmap database in call-back?

Lightwolf
11-02-2006, 07:25 AM
I am really surprised that mine is faster.. After Lightwolf comming up with his Kill_VMap, thought that mine will be slower.. :D
What route you used? Each point scan per vmap and handle just one vmap at a time, or one point scan and scanning vmap database in call-back?
One point scan per VMap, and I'm also checking for the existence of the VMap (per point) first.
It would probably be tons faster to just set all VMaps to 0 in one point scan, regardless of whether the VMap actually exists for the point.

Cheers,
Mike

Lightwolf
11-02-2006, 07:30 AM
Hey... this is old code... I was young (well, younger ;) )...

Cheers,
Mike - who can't come up with any more excuses.

Sensei
11-02-2006, 07:54 AM
One point scan per VMap, and I'm also checking for the existence of the VMap (per point) first.

Did you efficiently lookup vmap once per scan?



It would probably be tons faster to just set all VMaps to 0 in one point scan, regardless of whether the VMap actually exists for the point.


That's what I just gave up ;) ;) ;) and went route where is one true vmap lookup per vmap (in Lewis case - 1000 lookuping will be done), and there's check whether point is mapped..

Lewis, please check this one and tell whether it's any faster than v1.2..
http://www.trueart.pl/Products/Plug-Ins/FlushSelectionSets/Files/FlushSelectionSets_1_3.zip

Lightwolf
11-02-2006, 08:00 AM
Did you efficiently lookup vmap once per scan?



XCALL_( static EDError )
pointscan( MeshEditOp *edit, const EDPointInfo *pi )
{
if (edit->pointVGet(edit->state, pi->pnt, val))
{
edit->pntVMap( edit->state, pi->pnt, LWVMAP_PICK, vmap_name, dim, NULL);
}
return(0);
}
This is basically it.


XCALL_( static EDError )
pointscan( MeshEditOp *edit, const EDPointInfo *pi )
{
edit->pntVMap( edit->state, pi->pnt, LWVMAP_PICK, vmap_name, dim, NULL);
return(0);
}
Should do for an initial speed up, iterating through all VMaps (from a cached list) should be even faster... I suppose.

Modeler can be strange at times...

Cheers,
Mike

Sensei
11-02-2006, 08:32 AM
I think so Modeler keeps data in LWPntID and other values, and not EDPointInfo.. So when you call pointScan() the all point data must be obtained from database regardless they're used or not.. LW9 introduced new fast scanning routines which doesn't fill EDPoint/Edge/PolygonInfo structures and return just LWPntID/LWPolID, and it's you who decide what else get. In my case, in v1.3 I have pointVSet() called for each point multiplied by number of vmaps.. but as you can see what you get in saving so many pointVSet(), you loosed on filling EDPointInfo, but LW9 fast scanning should make your routine the fastest possible, at least in theory.. pointVSet() that have vmap parameter not NULL is ultimate quick, and should return that value immediately, but when it's NULL, vmap database quering by name is done, that must be slow..

Lewis
11-02-2006, 09:22 AM
Thanks Sensei, i'll check v1.3 ASAP when i get home (now i'm at work :D ).

I just forgot to mention one thing. LightWolf's version is even more interactive thant needed :). It shows (list one by one at selection sets menue) what Selection set is currently flushing/deleting :).

Lewis
11-02-2006, 02:12 PM
I tried this 1.3 version and it doesn't seem any faster or slower. I didn't leave it for 6 minutes but in 2 minutes it's right about 1/3rd of previous screen grab :)

Thanks for trying :).