Toggle all snaps on or off

Next
 From:  Metin Seven (METINSEVEN)
9045.1 
Hi,

The MoI 3D Command Reference contains three individual inline scripts to toggle each snap type on or off, but not one script to toggle them all on or off at the same time, so I combined the script lines. In case you could also use it, here it is:

script: /* Toggle snaps on or off */ moi.drawingAids.gridSnap = !moi.drawingAids.gridSnap; moi.drawingAids.objectSnap = !moi.drawingAids.objectSnap; moi.drawingAids.straightSnap = !moi.drawingAids.straightSnap;

You can also hold the Alt key to temporarily disable all snaps, but sometimes I find it easier to toggle them on or off.

Sorry if this is already discussed in an old MoI forum thread. I couldn't find it, but I didn't search thoroughly.

Regards,

Metin

———————

visualization • pixel art • illustration • animation • 3D design — https://metinseven.nl
  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:  Metin Seven (METINSEVEN)
9045.2 
P.S.: I personally assigned the script to toggle all snaps on or off to the ';' key, because that's also the snap toggle key in Affinity Photo and Affinity Designer.

Regards,

— Metin

———————

visualization • illustration • animation • 3D design — metinseven.nl

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

Message 9045.3 deleted 30 Aug 2018 by METINSEVEN

Previous
Next
 From:  Metin Seven (METINSEVEN)
9045.4 
Hi Michael,

I've noticed one drawback to this way of turning off or on all snaps: if one of the snaps is already turned off it will be toggled on again.

Is there a way to turn off or on all snaps at once (while keeping the snap subtypes intact) ?

Thanks in advance.

Regards,

Metin

———————

visualization • pixel art • illustration • animation • 3D design — https://metinseven.nl
  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
9045.5 In reply to 9045.4 
Hi Metin, try using this:

script: /* Toggle snaps on or off */ moi.drawingAids.gridSnap = !moi.drawingAids.gridSnap; moi.drawingAids.objectSnap = moi.drawingAids.gridSnap; moi.drawingAids.straightSnap = moi.drawingAids.gridSnap;

That one will toggle grid snap, then make object snap and straight snap match the new grid snap state.

- 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:  Metin Seven (METINSEVEN)
9045.6 In reply to 9045.5 
Nice! Thank you Michael!

Regards,

— Metin

———————

visualization • illustration • animation • 3D design — metinseven.nl

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

Message 9045.7 deleted 4 Dec 2022 by CEEN

Message 9045.8 deleted 4 Dec 2022 by CEEN

Previous
Next
 From:  Chris (CEEN)
9045.9 In reply to 9045.6 
Hi,

bumping this thread: is there a way to toggle only the active snapping?

The last version of the script alway activates all three snapping when used for toggle. Thx!
  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
9045.10 In reply to 9045.9 
Hi Chris,

re:
> bumping this thread: is there a way to toggle only the active snapping?

Sorry I don't understand what you mean by "active snapping", can you maybe describe a little bit more about what you are asking?

- 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:  pior (PIOR_O)
9045.11 In reply to 9045.10 
I believe that by "active snapping "the OP means "the currently activated snap mode(s), whichever they may be." In other words the OP is likely looking for a functionality similar to that of Inkscape, where "Enable Snapping" on/off turns off all current snapping options altogether (but without losing the granular snap settings).


  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