View Single Post
Old 31st December 2003, 11:37 AM   #2
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,452
Default Re: Selection mode and hidden status detection

Select mode - sorry, an oversight.

Code:
Prototype int ac_get_current_selection(List **vertexlist, List **surfacelist, List **objectlist)
WILL return the correct select mode but will also print out a warning about it being a depecated function.

Until a new function is added, use:

Code:
extern int selectmode;
and access select mode (read only)


To get the current selection, use these:

Code:
Prototype List *ac_selection_get_vertices(); // call in vertex select mode, free list after
Prototype List *ac_selection_get_surfaces(); // call in surface select mode, free list after
Prototype List *ac_selection_get_objects(); // call in object or group select mode, free list after
Prototype List *ac_selection_get_groups(); // gets all selected toplevel obs, call in object or group select mode, free returned list
Prototype List *ac_selection_get_whole_surfaces_all(void); // any select mode, free the list when you've finished with it
Prototype List *ac_selection_get_vertices_all(); // in vertex/surface modes et all selected vertices
Prototype List *ac_selection_get_poly_objects(); // call in object or group select mode, free returned list
To change the selection, use:

Code:
Prototype void ac_selection_select_objectlist(List *obs);
Prototype void ac_selection_select_vertexlist(List *l);
Prototype void ac_selection_select_surfacelist(List *l);
Prototype void ac_selection_select_by_surfaces(List *surfacelist);
Prototype void ac_selection_select_by_surface(Surface *s);
(and clear_selection())
If you are making your function Undoable (which you really should), use:

Code:
Prototype ACSelection *ac_selection_get_snapshot();
Prototype void ac_selection_restore_from_snapshot(ACSelection *replacement);
to save/restore the selection.

Let me know if you have any problems making this work.

Objects that are hidden or locked will not be selectable (i.e. it should be safe to try and select them, and it will be ignored). There are currently no exported functions that check visibility apart from within tcl (object_is_visible) but I'll ensure that these are added to the next release.

Andy
Andy is offline   Reply With Quote