View Single Post
Old 5th January 2004, 02:34 PM   #3
Junior Member
Join Date: Dec 2003
Posts: 12
Default Re: Selection mode and hidden status detection

Thanks Andy.

I tried "extern int selectmode;", but I get an unresolved symbol when I link. For the moment, I will use "ac_get_current_selection(List **vertexlist, List **surfacelist, List **objectlist)" to access the select mode and put up with the message. I use the function only to access the mode (I use the new functions to access the lists of selected objects and surfaces), so it will be easy to update it later on.

The behavior of hidden status seems to depend on whether it is objects or surfaces that are being selected.
1. Assume that there is a model being displayed with a bunch of objects and surfaces. Select part of the model in either object or surface select mode, then hide the selected objects/surfaces. Select "surface select" mode, then have a plugin traverse the model recursively starting from "ac_get_world()", and use "ac_selection_select_by_surface(s)" to try to select some surfaces that are visible and some that are hidden. Even the hidden ones will be selected, and their edges will become visible in the display.
2. On the other hand, if you traverse the model and use "ac_select_object(ob)" to try to select some hidden and some visible objects, only the ones that are visible will be selected.

All this came up when I was writing two plugins to select all surfaces using a specified material, and to select all objects using a specified texture. After getting them running I found that there was already a way of tracking down all the surfaces using a specific material, so the selection of hidden surfaces became a non-issue for me. Oh well, it was an interesting little project to learn how the SDK works...

As for the plugin to select all objects using a specified texture, it works fine and I find it useful in trying to impose some structure on models whose structure did not survive conversion from odd formats. If you think that it would be useful to others I can send it along. I have no way of posting it myself.

AndrewFernie is offline   Reply With Quote