Issues with customLocator boundingBox updating in vp2.0

126 views
Skip to first unread message

Daniel Lindsey

unread,
Jan 28, 2016, 7:49:43 PM1/28/16
to Python Programming for Autodesk Maya
Has anyone else had this issue?  I have a custom locator, that has attributes on it to define scale, orientation, and translation offsets.  
It draws properly in vp 2.0, and even reports back the proper boundingbox size from the boundingbox method.  
However, the locator is only selectable in the region of -1,1 in the scene.  Once selected like that, then the boundingBox seems to be updated properly, 
and you can select the locator from the correct bounding space.

Has anyone had this issue?  Has anyone found a workaround for this if they have had this issue?

Thanks,
-D

Dilen Shah

unread,
Jan 29, 2016, 9:26:10 AM1/29/16
to Python Programming for Autodesk Maya
Hey, what version of maya are you using? because there is some supportability issues of viewport 2.0 in maya 2014 and 15.

I wouldn't want to use vp 2.0 with draw functions for now until it gets patched but i guess that won't happen.

But 2016 Maya has some improvements may be you can try on it.

Goodluck!

D.

Daniel Lindsey

unread,
Jan 29, 2016, 1:16:02 PM1/29/16
to Python Programming for Autodesk Maya
Thanks, tried all three versions (2014-2016).  They all have the same issue, which makes me think it's something I'm doing.
The weird part is, it works perfectly well in the legacy viewport in all 3 versions.  And I'm computing the boundingbox the same way
for both the legacy and vp2 locators.

Janos Hunyadi

unread,
Jan 29, 2016, 2:43:45 PM1/29/16
to Python Programming for Autodesk Maya
Did you implement the BB, and selection on the legacy VP 1.0 part too (selection still happens there), not just the VP 2.0 override? 


On Friday, January 29, 2016 at 1:49:43 AM UTC+1, Daniel Lindsey wrote:

Janos Hunyadi

unread,
Jan 29, 2016, 2:45:24 PM1/29/16
to Python Programming for Autodesk Maya
addon:
I made a few locators in VP2.0 and it should work if you draw the same geo in VP1.0 as in VP2.0, than you can select it.

Daniel Lindsey

unread,
Jan 29, 2016, 3:01:06 PM1/29/16
to Python Programming for Autodesk Maya
I did implement the boundingbox in both the custom MPxLocatorNode class and the custom MPxDrawOverride class.  They're both being generated the same.  I'm using an MMatrix to transform the boundingBox.  I've even gone as far as manually calling the boundingBox method from within the prepareToDraw method in custom MPxDrawOverride class still with no luck.  It's very odd that internally, Maya will print the proper scale of the boundingBox, but the selection marque doesn't realize that's the actual size.

Daniel Lindsey

unread,
Jan 29, 2016, 6:49:26 PM1/29/16
to Python Programming for Autodesk Maya
Found the issue.
So it seems even though the MPxDrawOverride has it's own boundingBox method, the boundingBox that's actually being used by vp 2.0 is the boundingBox returned by the MPxLocator class.  Found this issue when I returned the objPath.node()->boundingBox in the MPxDrawOverride boundingBox method.  It would never update.  So, reorganized the code a bit to force the update as needed, and works fine now.  Just and FYI for anyone else that may hit this issue
Reply all
Reply to author
Forward
0 new messages