Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 
Share Thread:
Reddit Facebook Twitter
Selecting in folders
04-01-2015, 05:44 PM (This post was last modified: 04-02-2015 04:56 PM by micheus.)
Post: #1
Selecting in folders
ggaliens, as you have deleted the that thread I create this one as a replacement.

As you ask in your video - Select All Object in Folder: "Am I crazy? Am I crazy? I don't know. You tell me"

Yeah, maybe you are. Smile
You are spending time with things that already exists - and works no only for selection.

You are a very active coder, but seems to not be so active Wings3d user. Otherwise - for all these years - you probably would to know about this feature I tried to "show" you how to use in that deleted thread.

As you say: "Enjoy the show"
Wings3D: Select/Hide/Lock/Wire operations in the Geometry window (best seen at YouTube)



@MicheusVieira MicheusVieira Micheuss micheus4wings3d
* Wings3D Team stands for: Björn and Dan
Reply
04-01-2015, 06:54 PM (This post was last modified: 04-01-2015 07:19 PM by ggaliens.)
Post: #2
RE: ggaliens: selecting in folders
Micheus ... how does it work if the folders are in closed state ?

Does it work in that case ?

"Toggle Selection for all other objects ? " That worthless command IMHO. At very least ... not ideal.

I think someone wrote the helptext to obey the current implementation ... rather than considering whether the action makes sense.

My command is not TOGGLING the same way ... and is available for closed folders and simpler to understand.



Reply
04-01-2015, 08:21 PM
Post: #3
RE: ggaliens: selecting in folders
(04-01-2015 06:54 PM)ggaliens Wrote:  Micheus ... how does it work if the folders are in closed state ?

Does it work in that case ?
No it doesn't. But I can see that as a big "problem".

Why not work in something similar to that, but more relevant and new as the Layers management?

@MicheusVieira MicheusVieira Micheuss micheus4wings3d
* Wings3D Team stands for: Björn and Dan
Reply
04-01-2015, 08:58 PM
Post: #4
RE: ggaliens: selecting in folders
It is a big problem. As is having to click twice instead of once ... for a very simple action.

Sheesh.
Reply
04-02-2015, 04:06 AM
Post: #5
RE: ggaliens: selecting in folders
A last comment. I swear.
Something really missing that you could add in the same pack: Collapse All and - maybe - the opposite Expand All.

@MicheusVieira MicheusVieira Micheuss micheus4wings3d
* Wings3D Team stands for: Björn and Dan
Reply
04-02-2015, 04:44 AM (This post was last modified: 04-02-2015 05:36 AM by ggaliens.)
Post: #6
RE: ggaliens: selecting in folders
OK. I'll add them.

Code:
close_all_folders(#st{pst=Pst0}=St,OpenOrClosed0) ->
    {Key0,Fld}  = gb_trees:get(?FOLDERS,Pst0),
    MyAcc = fun
        (no_folder, MORE, Acc) ->
            orddict:store(no_folder,MORE, Acc);
        (Key, {OpenOrClosed1,MORE}, Acc) when OpenOrClosed1 == open orelse OpenOrClosed1 == closed ->
            orddict:store(Key,{OpenOrClosed0,MORE},Acc)
    end,
    Fld2 = orddict:fold(MyAcc,Fld,Fld),
    Pst1 = gb_trees:enter(?FOLDERS, {Key0,Fld2}, Pst0),
    St#st{pst=Pst1}.
Reply
04-02-2015, 05:47 AM
Post: #7
RE: ggaliens: selecting in folders
Released.
Reply
04-02-2015, 06:26 AM
Post: #8
RE: ggaliens: selecting in folders
As you shared the code here...

Don't you think it's a good idea to have a "guard" option: _ ->
Just in case at some point in the future someone call the function with a wrong value into OpenOrClosed0?

@MicheusVieira MicheusVieira Micheuss micheus4wings3d
* Wings3D Team stands for: Björn and Dan
Reply
04-02-2015, 01:33 PM (This post was last modified: 04-02-2015 01:46 PM by ggaliens.)
Post: #9
RE: ggaliens: selecting in folders
Yes.
I moved the guard up to the main function entry point.

Code:
close_all_folders(#st{pst=Pst0}=St,OpenOrClosed0)
    when OpenOrClosed0 == open orelse OpenOrClosed0 == closed ->
    {Key0,Fld}  = gb_trees:get(?FOLDERS,Pst0),
    MyAcc = fun
        (?NO_FLD, MORE, Acc) ->
            orddict:store(?NO_FLD,MORE, Acc);
        (Key, {open,MORE}, Acc) ->
            orddict:store(Key,{OpenOrClosed0,MORE},Acc);
        (Key, {closed,MORE}, Acc) ->
            orddict:store(Key,{OpenOrClosed0,MORE},Acc)
    end,
    Fld2 = orddict:fold(MyAcc,Fld,Fld),
    Pst1 = gb_trees:enter(?FOLDERS, {Key0,Fld2}, Pst0),
    St#st{pst=Pst1}.
Reply


Forum Jump:


User(s) browsing this thread: 1 Guest(s)