Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there,
I've built my own license mechanism for a C++ plugin, the algorithm works fine. Now I need to block the plugin registration if the user failed to provide a valid license key.
For now I have this:
MStatus initializePlugin(MObject obj) {
MStatus stat;
if (licenseIsNotValid()){
// logically I thought that the plug wouldn't be loaded
return stat;
}
MFnPlugin plugin(obj, "me", "1.4", "2020");
stat = plugin.registerContextCommand(blablabla);
return stat;
}
I would have make sense if Maya would just skip the plug-in loading process but it doesn't. The plugin manager show the plugin as "loaded' and when I try to tick this off, nothing happens. The unloadPlugin command says it's not loaded. To make it short, Maya is confused.
The question is fairly simple:
How can we prevent a plug-in to load after checking some conditions?
Solved! Go to Solution.