Selection Thoughts

Next
 From:  Marc (TELLIER)
1073.1 
Hi,

Some suggestions about selection methods in MoI:

1.-Current selection set lock.

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.

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


Regards,

Marc
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 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
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Marc (TELLIER)
1073.3 In reply to 1073.2 
Hi Michael, thanks for the scripts I will check this out!

Marc
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Marc (TELLIER)
1073.4 In reply to 1073.2 
Hi Michael,

Thanks again for the scripts, the behavior of "lock objects with show points" script is just what I was looking for.


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

Hiding other objects is a very useful and quick workflow but I often find I do adjustments on my curves or profiles in relation with existing geometry, especially with sweep lofts, etc...


I there a simple way to tweak the script to behave like this?;
-Command would trigger "show points"
-Selection set would be locked (as in script).
-Escape two times would exit the script. (Like current show points behavior) and therefore unlock the selection.


For the lock selection set feature, I was initially thinking of a toggle On-Off lock that would lock selection and prevent adding other object, similar to the "show points lock" script you have made.

Regards,

Marc

EDITED: 31 Oct 2007 by TELLIER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
1073.5 In reply to 1073.4 
Hi Marc,

> I there a simple way to tweak the script to behave like this?;
> -Command would trigger "show points"
> -Selection set would be locked (as in script).
> -Escape two times would exit the script. (Like current show
> points behavior) and therefore unlock the selection.

There is for the first 2 things, that would be this:
code:
script:moi.geometryDatabase.showPoints(); 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();

So that turns on the special "locked points" mode with one key.

But for the moment Escape won't work to exit this mode, you will need to use this on a different key instead:
code:
script:moi.geometryDatabase.getObjects().unlockSelection();

However, I have tuned up Escape for the next release to handle this - if nothing is selected when you push Escape (which will be the case on the second time that you push it), it will look to see if there is any locked selection and if there is it will clear the locked selection.


> For the lock selection set feature, I was initially thinking of a toggle
> On-Off lock that would lock selection and prevent adding other object,
> similar to the "show points lock" script you have made.

Then I guess that means locking all the objects that are _not_ currently selected... That would be this:
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.selected ) locked.addObject( obj ); } locked.lockSelection();

I'm not quite sure if that is what you wanted?

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Marc (TELLIER)
1073.6 In reply to 1073.5 
This works great, many thanks Michael!

With Autohotkey, I have assigned my escape key to send two keystroke simultaneously in moi.
One is the normal escape key and the other is my shortkey to unlock (ctrl+k).

I will test drive some more when I get some time, but it seems to work A-1.

Regards,

Marc
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All