Maya 2023.3 hangs when loading our custom plugins at startup

Maya 2023.3 hangs when loading our custom plugins at startup

karl.loveridgeRKJJN
Participant Participant
1,613 Views
5 Replies
Message 1 of 6

Maya 2023.3 hangs when loading our custom plugins at startup

karl.loveridgeRKJJN
Participant
Participant

We have been long time users of Maya and have several custom C++ plugins we've written. We are in the process of upgrading from Maya 2018 to Maya 2023.3. 

 

I have been able to recompile our plugins with the 2023.3 SDK and they will load and run in Maya 2023 when I use the plug in manager. This is great. Except for...

 

I enabled the plugins to autoload and then restarted Maya. Maya will not restart and hangs in the process of loading the plugins. I did some further reading and found that Maya 2023 has security measures for plugins, MEL and Python. I've disabled all these and it continues to hang. There is no feedback of what its stalling on.

 

Any ideas? Thanks in advance.

 

 

0 Likes
Accepted solutions (1)
1,614 Views
5 Replies
Replies (5)
Message 2 of 6

karl.loveridgeRKJJN
Participant
Participant

Its looking like some of the initialization we have been doing in the past in the plugin start up partially might be to blame for this hang. Doing further investigating.

0 Likes
Message 3 of 6

karl.loveridgeRKJJN
Participant
Participant

After further investigation, it appears that a convention we used to use to initialize callback's not longer works. This causes the hang:

 

MLL_EXPORT MStatus initializePlugin(MObject obj)

{

MStatus status;
MFnPlugin plugin(obj, "MyPlugin", "1.1.0", "Any", &status);

status = plugin.registerCommand(cmd_ztools, MayaTools::creator);

if (status != MS::kSuccess)
{
MGlobal::displayError(MString(cmd_ztools) + " command failed to initialize");
}
else
{
MGlobal::displayInfo(MString(cmd_ztools) + " command initialized");
scriptjob_newSceneOpened = MEventMessage::addEventCallback("SceneOpened", sceneOpened);
scriptjob_selectionChanged = MEventMessage::addEventCallback("SelectionChanged", selectionChanged);
}

 

Attempting to add the event callbacks causes the  hang. If I remove them in the plugin initialization, it works fine. So the question is why? 

 

0 Likes
Message 4 of 6

brentmc
Autodesk
Autodesk

Thanks for the info. I'll ask around internally to see if I can get clarification on why this might be happening.

Brent McPherson
Principle Software Developer
0 Likes
Message 5 of 6

brentmc
Autodesk
Autodesk

Hi,

Can you verify that you are building your plugins with the correct compiler for 2023.
https://help.autodesk.com/view/MAYAUL/2023/ENU/?guid=Maya_SDK_MinimumRequirementsAllPlatforms_html

Otherwise, could you provide a sample plugin that shows the issue?

Thanks.

Brent McPherson
Principle Software Developer
0 Likes
Message 6 of 6

karl.loveridgeRKJJN
Participant
Participant
Accepted solution

So the issue turned out to be the way we were creating a callback on the idle event. We originally had the callback set up with this code:

 

 

g_idleEventCallbackId = MEventMessage::addEventCallback( "idle",
	&IdleEventCallback,
	NULL,
	&status);

 

This caused the hang. I switched both of these to this and it now works:

 

g_idleEventCallbackId = MTimerMessage::addTimerCallback(1.0f, &IdleEventCallback, NULL, &status);

 

0 Likes