Maya 2015 NEX (Modelling toolkit) context issue

I have a problem getting the coordinates for the manipulator inside the UV Editor once the NEX modelling toolkit is active.

pm.texMoveContext( “texMoveContext”, query=True, position=True )
pm.texRotateContext( “texRotateContext”, query=True, position=True )
pm.texScaleContext( “texScaleContext”, query=True, position=True )

That’s the code I run in order to query the texture editor context position (manipulator position).
Problem is that once the user activates NEX, these are replaced for some different context type and I haven’t been able to find out how to query that.

With print(pm.currentCtx()) this string is printed:
“ModelingToolkitSuperCtx”

And print( pm.contextInfo( pm.currentCtx(), c=True ) ) says that the class is:
texMove

But really… is it?
pm.texMoveContext( “ModelingToolkitSuperCtx”, query=True, position=True )

RuntimeError: texMoveContext: Object ‘ModelingToolkitSuperCtx’ not found

So I went a step back and tried with superCtx
print( pm.superCtx( “ModelingToolkitSuperCtx”, query=True) )

Result: texMoveContext

I don´t understand this!
“ModelingToolkitSuperCtx” is a superCtx which in turn is a texMoveContext??

Since I created this thread, I still haven´t found a solution to this: I still have no way of getting the position of the manipulator inside the UV editor once the Maya Modelling Toolkit is active :frowning:

I would really appreciate if someone could help out with this.

are you querying the manipulator’s position so you can find the center of the selected UVs? I used to use that method to get the center of the selection so I could average the UVs on either the U or V axis, but I switched over to determining the selection center myself.

It’s a little more work to do all the math yourself to find the center, but it will always work.

ya but your not transforming from the center at all times, but sometimes a temporary pivot

[QUOTE=rgkovach123;25717]are you querying the manipulator’s position so you can find the center of the selected UVs? I used to use that method to get the center of the selection so I could average the UVs on either the U or V axis, but I switched over to determining the selection center myself.

It’s a little more work to do all the math yourself to find the center, but it will always work.[/QUOTE]

[QUOTE=rgkovach123;25717]are you querying the manipulator’s position so you can find the center of the selected UVs? I used to use that method to get the center of the selection so I could average the UVs on either the U or V axis, but I switched over to determining the selection center myself.

It’s a little more work to do all the math yourself to find the center, but it will always work.[/QUOTE]

No that´s not the issue.
The problem is that I have no idea how to query the manipulator inside the UV editor once the Modelling Toolkit is active. I know how to query Maya´s native manipulators, but the Modelling Toolkit - when activated - switches the context type of all manipulators (because all of them are custom).

So once the toolkit is active, I have no way of querying the UV texture editor manipulator.

I understand the issue, and I was able to reproduce the problem. I was just wondering what you needed the manipulator’s position for. If you are using the position as a quick method to determine the center of the selection, then there other ways to get the information without querying the manipulator.

In this case, the manipulator is used by the user as a pivot for rotating components inside the UV editor. (Example: the user wants to rotate a shell and set a custom pivot to a very specific UV coordinate)

The reason Im looking into this is because a user has reported a bug with my UV Editor tool. Once the Modelling Toolkit is activated (and all contexts are swapped), component and UV shell rotations are no longer possible because the pivot never updates with this “new” context type. :frowning:
Hope that explains it.

its probably worth reporting as a bug to autodesk.
if the user switches back to the regular Move/Rotate/Scale manipulators does your code start to work again? Or, once the Toolkit is active, is a Maya restart required to fix the problem?

You could temp switch context to native query the values then switch back.

I think switching contexts will lose the manipulator’s pivot offset…?

True… I tried it out, even though the currentCtx is ‘ModelingToolkitSuperCtx’, you can just use texMoveContext( “texMoveContext”, query=True, position=True ) and friends to query the data correctly.

[QUOTE=rgkovach123;25788]its probably worth reporting as a bug to autodesk.
if the user switches back to the regular Move/Rotate/Scale manipulators does your code start to work again? Or, once the Toolkit is active, is a Maya restart required to fix the problem?[/QUOTE]

That is correct. It’s only when the NEX Modelling Toolkit’s manipulators are active that this issue occurs.
I´ll report it as a bug when I´m at work on monday.