Some questions regarding shortcuts, rebuild-command and view

Next
 From:  DavidE
10909.1 
Hey everyone!

Over the last few weeks a few questions came up and I'd like to sum them up in this thread.
Sorry if that's a bit much in one thread so please let me know if multiple would be preferred instead.

#1. Is it possible to also deselect objects via mouse-drag or only selecting it?
So for example selecting 5 objects via the click&mouse-drag-selection and then deselecting some of them, again, somehow with the click&mouse-drag?

#2. Is it possible to have one shortcut which applies 'Rotate Axis' when being in 3D-view and just 'Rotate' in-case it is a 2D-view like Front/Top/Right/...?
I came up with the script 'ImprovedRotate.js' (attached below) which is unfortunately is always giving me the following error



Not sure what's the problem here... Does somebody know?

#3. Do not abort commands when using space-bar for other shortcuts.
I've set the space-bar as a shortcut for the following script which simply changes the view to 3D and also focuses on the selected object.

moi.ui.mainWindow.viewpanel.mode = '3D';
var viewport = moi.ui.getViewportUnderMouse(); if ( viewport ) viewport.reset();

The problem here is that whenever I'm in the middle of some command, let's say polyline, and then use the shortcut mentioned above, the polyline-command aborts. However, clicking the view-buttons in the left-bottom corner while drawing a polyline works perfectly fine.
Not sure if the script is the problem or the spacebar-shortcut itself...

#4. How to handle inaccuracies between edges/curves and connected faces
What I mean with that is how to prevent those 'inaccuracies' which often occur when creating faces between curves with e.g. the 'Planar'-command. Please check out the following screenshot:



What I figured out is that it has something to do with the amount of points the curves are having.
I've tried Rebuild-command on the curves (e.g. rebuilding with ~200 points), however the faces which are attached to the points are unfortunately not being updated and so those inaccuracies are still there.



I've also attached the .3dm file below if that helps.

Thanks a lot and best regards,
DavidE

  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
10909.2 In reply to 10909.1 
Hi David,

re:
> #1. Is it possible to also deselect objects via mouse-drag or only selecting it?
> So for example selecting 5 objects via the click&mouse-drag-selection and then deselecting some
> of them, again, somehow with the click&mouse-drag?

Yes, if you hold down the Ctrl key it will deselect objects instead of selecting them, both for single
clicks on an object and also for dragging a window.


> #2. Is it possible to have one shortcut which applies 'Rotate Axis' when being in 3D-view and just 'Rotate'
> in-case it is a 2D-view like Front/Top/Right/...?

Try putting in this as the "Command" part of your shortcut key:

script: var cmdname = (moi.ui.getActiveViewport().name == '3D' ? 'RotateAxis' : 'Rotate'); moi.command.execCommand( cmdname );


> #3. Do not abort commands when using space-bar for other shortcuts.
> I've set the space-bar as a shortcut for the following script which simply changes
> the view to 3D and also focuses on the selected object.

Only one command can be run at a time, if you run a command while another one is running the current running command will be canceled before the new one will run.

You can avoid this by not packaging your script into a "command" and instead run it as immediate script code.

You can do that by having the script code directly contained inside the keyboard shortcut instead of having it in a separate file.

Or another way is if you have the file located in a folder named "scripts" instead of in the "commands" folder, or also if you set up the shortcut key with a full path to the .js file including the .js file extension.

When something is run as a "command" there is a bunch of other stuff that is managed both before the command is run and after the command exits like setting up undo units, clearing some kinds of selection states like selection lock, loading the command's UI file, etc...

If you want some script to do something like manipulate a view or selection without exiting the current command then have it run as immediate executed script instead of as a command.


> #4. How to handle inaccuracies between edges/curves and connected faces
> What I mean with that is how to prevent those 'inaccuracies' which often occur when
> creating faces between curves with e.g. the 'Planar'-command. Please check out the
> following screenshot:

You handle that by just ignoring it, it's purely a display artifact and doesn't mean anything is wrong with your object.

See here for some more detailed information:
http://moi3d.com/forum/index.php?webtag=MOI&msg=10580.2

- Michael

EDITED: 4 Dec 2022 by MICHAEL GIBSON

  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:  pior (PIOR_O)
10909.3 In reply to 10909.2 
Hi there Michael,

FWIW I too have been having issues with deselection, as ctrl-drag (= rectangle marquee) never did it for me as far as I can remember - only regular ctrl-click does it. But seeing the question being brought up in this thread made me look into it again, and it seems like the problem might be coming from the "multiple selection : only with shift key" option from General settings.

What I am observing is :
"multiple selection : only with shift key" ON = ctrl-drag deselect impossible, as everything gets deselected instantly.
"multiple selection : only with shift key" OFF = ctrl-drag deselect possible

I would assume that quite a few users might want "only with shift key" to be ON, since it is the selection paradigm used in a huge majority of design software ; so unless it is something else causing a conflict for me and the OP when it comes to ctrl-deselect, this issue might be quite widespread.

However I am using quite a few custom presets as well as Autohotkey scripts running in the BG, so perhaps the behavior me and the OP are seeing might come from something else altogether.

Thoughts ?

BTW, on a semi-related note : since I never really tried it before I had some playing around with "multiple selection : only with shift key" OFF - and while it is interesting, I feel like it conflicts with the way MOI lets one deselect things by clicking in the empty space. Because that means that someone who actually wants to select multiple things without having to press shift will very likely lose their selection if they work fast.

EDITED: 5 Dec 2022 by PIOR_O

  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
10909.4 In reply to 10909.3 
Hi Pior,

re:
> FWIW I too have been having issues with deselection, as ctrl-drag (= rectangle marquee) never did it for me
> as far as I can remember - only regular ctrl-click does it.

That's true for version 4 but it's been improved in the current v5 beta.

https://moi3d.com/wiki/V5Beta
quote:
Update selection - multiple select. If multiple select only with shift key is enabled don't clear selection if ctrl is down so that Ctrl+drag will still work as a deselection window. Fixes bug reported on the forum by Viewbyte here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=10439.3

You can get the v5 beta at https://moi3d.com/beta.htm .


> BTW, on a semi-related note : since I never really tried it before I had some playing around with
> "multiple selection : only with shift key" OFF - and while it is interesting, I feel like it conflicts with
> the way MOI lets one deselect things by clicking in the empty space. Because that means that
> someone who actually wants to select multiple things without having to press shift will very
> likely lose their selection if they work fast.

There is no conflict that I'm aware of. Clicking in empty space to deselect works the same whether Multiple selection = "Only with Shift key" or Multiple selection = "Always".

The default is "Always" because one of the earliest design goals for MoI was to be able to do basic operations in it without needing to touch the keyboard at all. It's one of the things that gives MoI some of its unusual traits.

- 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:  pior (PIOR_O)
10909.5 In reply to 10909.4 
Hello Michael, thank you for the quick support as always :)

I see - this may be one good incentive to switch to V5 indeed, I'll keep it mind.

As for the click-deselect behavior : well, it isn't so much a conflict in the technical sense but rather a philosophical one : the unusual (but certainly original and interesting) behavior of being able to add to a selection by just clicking (without holding a modifier key) gives a certain feel of stability hence favors fast operation ; but, fast operation means a higher potential for missed clicks. And since in this case a missed click (= a click on empty space) means deselecting everything, it becomes a negative experience for the user since it means that important work (like a carefully made complex selection of elements) gets lost very easily by accident. So from an error prevention standpoint I would say that it would be more consistent to have the click on empty space trigger a deselect of the *last selected* item, as opposed to deselecting *everything*.

But of course this would be a large change which could disrupt user habits, requiring the introduction of another input for deselect all, so that's that not feasable. So if anything I think it would be interesting to have a little option to disable the "click on empty space to deselect" behavior when the user is using the option to use Shift to add to the current selection, and the Shift key is indeed being held. Because it doesn't make sense ("philosophically" speaking if I may say) to accidentally deselect everything when one is actually proactively holding down the "add stuff to my selection" key.

As a matter of fact and FWIW, I just paid attention to my muscle memory and even though I do use the "Shift to add to the selection" option, I personally always perform "deselect all" by clicking on empty space *without* holding down shift ... probably because I picked up the habit after switching to Blender a few years ago. Hence I personally wouldn't mind if shift+clicking on empty space did nothing, leaving the selection untouched. Or perhaps "walking back" the selection one step at a time, removing elements one after the other in reverse selection order. In both cases that would mean no more risks or losing an important selection because of a missclick when attempting to add stuff to current.

On a related note it could also be interesting to have the option to have Shift-marquee not only be an "add", but also as a toggler of selection state (just like it does on click). But perhaps this too is already adressed in V5.

EDITED: 5 Dec 2022 by PIOR_O

  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
10909.6 In reply to 10909.5 
Hi Pior,

re:
> since it means that important work (like a carefully made complex selection of elements) gets
> lost very easily by accident.

There is a remedy in place for when that happens.

If you make a selection error like you describe, if you do an undo (Ctrl+Z or Cmd+Z on Mac), the selection action that you just performed (including a click on an empty spot to deselect all) will be reverted and the selection you had before that will be restored.

This "selection undo" is only kept for the last selection action though and it's an ephemeral state, it will get blown away if you do anything else that generates another undo unit.

So if you make a selection mistake do undo before you do any further actions.


> the unusual (but certainly original and interesting) behavior of being able to add to a
> selection by just clicking (without holding a modifier key) gives a certain feel of stability
> hence favors fast operation ; but, fast operation means a higher potential for
> missed clicks.

Well it's not _forcing_ you to do things quickly. If you are going too quickly and making errors you probably just need to slow down a bit.

And if you do make a missed click do an undo.


re:
> On a related note it could also be interesting to have the option to have Shift-marquee not
> only be an "add", but also as a toggler of selection state (just like it does on click). But perhaps
> this too is already adressed in V5.

No there isn't any facility in v5 for doing a toggling selection window that would result in a mix of both selecting and also unselecting within the same window action. Do you have an example where that would be useful?

Thanks,
- 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:  pior (PIOR_O)
10909.7 In reply to 10909.6 
Hello !

"No there isn't any facility in v5 for doing a toggling selection window that would result in a mix of both selecting and also unselecting within the same window action. Do you have an example where that would be useful?"

Well, the most immediate example would be ... the regular click (or shift-clicking, depending on which option is enabled) for selection. It already performs such a toggle of selection state, since clicking (or shift clicking) on a selected element deselects it. So it wouldn't be much of a stretch to expect the marquee selection to perform similarly too.

But, this would have been mostly relevant (as a potential solution for marquee-deselect) had the ctrl behavior not been adressed in V5. It wouldn't hurt to have as an option though, as that would mean that people could optionally manipulate selections (by adding and removing elements to/from them) using just one modifier key (shift) instead of two (shift and control). That said my experience is mostly based on 2D drafting using MOI, so without a doubt there are some potential conflicts in 3D that I may not be seing. And shift to add / ctrl to remove is near universal anyways.

Overall if I were to pick only one thing to tweak/add to the system, it definitely would be the option to not have shift-click cause any deselect ever when performed over empty space, as this alone would personally fix my frustration of often losing selections because of missclicks. And while undo is indeed a remedy, it still doesn't make the frustration of losing a selection retroactively disappear :D And slowing down is not an option ...

EDITED: 5 Dec 2022 by PIOR_O

  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:  DavidE
10909.8 
Thanks a lot for the help Michael, it's all clear now!
Very much appreciated!

Best regards,
David
  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