Selection Thoughts

 From:  Michael Gibson
1073.2 In reply to 1073.1 
Hi Marc, thanks for the selection feedback!

> 1.-Current selection set lock.

There is kind of a concept of selection lock, it is currently used for commands that have multiple stages of selection in them. Like for example boolean difference - you select one object set, and then in a second stage you select a different object set for the cutters. During the selection of the second object set the first object set has selection lock turned on for it so that it will be out of the way and not interfere with the selection of the second object set.

It is possible to turn on or off selection lock through a script macro on a keyboard shortcut. To enable selection lock on the currently selected items use this as the Command part of a keyboard shortcut:
code:
script:moi.geometryDatabase.getSelectedObjects().lockSelection();

To disable it use this:
code:
script:moi.geometryDatabase.getObjects().unlockSelection();

But I'm not sure if it will behave exactly as you are thinking about since it is pretty much tuned up right now just for the needs of those commands that do multiple stage selection. Like for example one thing is that selection lock is automatically removed from everything at the end of every command, but it shouldn't get disturbed when you are outside of a command in regular selection mode.



> 2.-When show points is enabled for curves, there could be a mode to prevent
> selection of other objects. This could avoid accidental selection of other entities
> while fencing for points.

It looks like the current selection lock will actually work pretty well for creating a mode like this. Put this on a shortcut key:
code:
script:var objs = moi.geometryDatabase.getObjects(), locked = moi.geometryDatabase.createObjectList(); for ( var i = 0; i < objs.length; ++i ) { var obj = objs.item(i); if ( !obj.showPoints ) locked.addObject( obj ); } locked.lockSelection();

That will turn on selection lock for every object that does not have points turned on. When in this mode, other objects won't be selectable until you exit some command or run the unlock all script above. The nice thing is that dragging points does not count as running a command for this particular thing, so you can select and drag different points while in this mode without other objects getting in the way.

Normally I'd recommend hiding other objects that are in the way, but this may be useful as well.


> 3.-Also with show points, to prevent deletion of the edited object when you hit
> delete to clear a control point would be nice.

Currently the way to do this is to make sure the "main object" itself is unselected when you hit delete - like for a curve for example if it is selected you can move over it and see a dark halo and if you click on it, it should deselect and then delete will only target the points.

- Michael