Reputation: 3931
I am developing 2 Maya plugins in C++ and would like to call a function in plugin #1 from plugin #2 and send parameters along with the function.
The caller plugin is an MPxNode and the called plugin should be "general" functions whose role are to create some rendering VRayPlugins.
How should I proceed to declare and call the appropriate functions ?
Upvotes: 0
Views: 234
Reputation: 2659
Maya plug-ins are not different from standard DLL whether you run on Windows, OSX, or Linux. There is multiple approach you can use here. You can link the utility dll to your plug-in, and as long the OS can find it, it will be loaded in Maya address space whenever the plug-in loads in Maya (like any DLL, including the Maya DLLs). The other way is to export symbols from the DLL, but link the function/class at runtime (LoadLibrary() / GetProcAdress()). This time, you need to load the utility DLL yourself, and search for the export signatures before calling them. For these 2 methods, this is standard C++ programming, nothing special regarding Maya.
Now if you work with the Maya DG, you could also think about MMessage / MPxNode to transport and evaluate data. This is specific to the Maya DG and API. But I am not sure you need that level of complexity for what you described above.
Upvotes: 1