Disable Shift + Mouse Snapping

On 05/04/2016 at 10:28, xxxxxxxx wrote:

Hi all!

I've created a CommandData plugin that allows snapping with individual steps for each axis.

I want the snapping to work only when the user holds down the shift key.

But the default behaviour of shift + mouse interferes with my plugin.
Any ideas to turn that default off?

Thanks a lot in advance & best regards

On 06/04/2016 at 09:17, xxxxxxxx wrote:

Hi Paul,

welcome to the Plugin Café forums 🙂

Can you give us more details about what you are trying to do?
From what can be read between the lines, we are wondering, if it really is a CommandData plugin you want to develop or if you'd rather want to take a look at developing a ToolData plugin? But that's of course just guess work, without knowing the details.

On 06/04/2016 at 11:50, xxxxxxxx wrote:

Hi Andreas, nice to meet you again over here 🙂

The easy part:

I have a CommandData plugin with a gui window with 3 float input fields, one for each space axis. When i drag an object in the perspective view it snaps to multiples of those input values. I limited the snapping to work only on MouseUp when shift is held down by listening for some event/message that is always fired when a drag is finished (id 604)

The question:

I'd like the snapping to work continously during mouse drag while shift is pressed. What would be the proper approach to that?

And a second question:

How do I print the static string representation of message ids instead of just integers in the console?

Thanks in advance & best regards!

On 08/04/2016 at 05:49, xxxxxxxx wrote:

Hi Paul,

I don't think it is a good idea to have a CommandData plugin trying to influence the behavior of other tools. And you almost certainly won't be able to achieve what you want with this approach.

There are two roads I can offer, unfortunately only one can be done in Python:

  1. ToolData
    Write your own move tool via a ToolData plugin. An example for a ToolData plugin is the Py-LiquidPainter.

  2. SnapData
    Unforunately SnapData is not available via the Python SDK, yet. With this you could implement your own snapping mode, probably the more elegant way to achieve what you want.