Snapping on a Custom Locator in Viewport 2.0

Snapping on a Custom Locator in Viewport 2.0

sebastianNYUXH
Explorer Explorer
414 Views
2 Replies
Message 1 of 3

Snapping on a Custom Locator in Viewport 2.0

sebastianNYUXH
Explorer
Explorer

Hi,

 

I created  a custom locator derived from MPxLocatorNode with the c++ api.

For Viewport 2.0 support I also created a DrawOverride class derived from MHWRender::MPxDrawOverride.

 

Everything works fine, but now I want to snap on this custom locator.

So I create a sphere, press 'v' and move the sphere near to the custom locator, but a snapping is not happening.

After switching from Viewport 2.0 to the Legacy Viewport the snapping works... 

 

Anyone got a Idea, what I have to implement, to get the snapping working in Viewport 2.0?

 

Best regards

 

Sebastian

415 Views
2 Replies
Replies (2)
Message 2 of 3

FirespriteNate
Advocate
Advocate

Did you ever figure this out Sebastian? I now have the same issue with my custom MPxLocatorNode in viewport 2. Legacy viewport isn't even a default option any more.

0 Likes
Message 3 of 3

FirespriteNate
Advocate
Advocate

Seriously, does nobody know how to enable point snapping on a custom locator for Viewport2.0? It seems to just work by default on legacy viewport (I mean, point-snapping is arguably one of the primary purposes of a regular locator), but legacy viewport has not been the default, or readily available, or even relevant at all, for years now.

 

I've found I can kinda workaround it by turning on the display of the transform pivot or handle, but this is a hacky workaround and doesn't adequately cover every eventuality (like when the user wants to move the pivot or the locator's localPosition) without even more messy hacks layered on top.

0 Likes