Call function in one plugin from other plugin.

Call function in one plugin from other plugin.

Anonymous
Not applicable
1,308 Views
7 Replies
Message 1 of 8

Call function in one plugin from other plugin.

Anonymous
Not applicable

I have a utility plugin. Is it possible to call a function in some other plugin from the current utility plugin using 3ds max sdk?

If possible, How can it be done?

What type of plugin should be created?

 

Thanks in advance..

0 Likes
Accepted solutions (1)
1,309 Views
7 Replies
Replies (7)
Message 2 of 8

istan
Advisor
Advisor

yes is possible. the magic word is "function publishing".

Message 3 of 8

Anonymous
Not applicable

Thanks Istan.

I created an interface in a public header file.

Its implementation is done in an implementation file.

 

How can I call the published functions from other plugins?

How can I get the edmeshCD in the following code snippet from max sdk documentation?

 

EMFaceOps* efi = GetEMFaceOpsInterface(edmeshCD);

//...

efi->Extrude(mesh, faces, 10.0);

0 Likes
Message 4 of 8

istan
Advisor
Advisor
I used core function publishing between my own plugins.
Message 5 of 8

Anonymous
Not applicable

I used FP_CORE flag to make it core interface. But it returned null when I called GetCoreInterface with my interface id. I called it from my another plugin which includes the public header file.

 

Is published function only accessible through Max Script? Is it possible through C++ code. I am using C++ and max sdk 2013.

0 Likes
Message 6 of 8

istan
Advisor
Advisor

Of course C++ plugin communication works with FP! As a side effect, you can then also access via MXS. You have to assure that your plugin, you want to access to, is loaded already!

0 Likes
Message 7 of 8

Anonymous
Not applicable
Accepted solution

Yes.It is possible.

Using function publishing we can expose the functions of one plugin to another using  FpInterface.

In Fp_Basic.h replace the 

 

inline class IFP_Basic* GetFP_basic()
{
    return (IFP_Basic*) GetCOREInterface(FP_BASIC_INTERFACE);
}

with

 

inline class IFP_Basic* GetFP_basic()
{

     return (IFP_Basic*)GetInterface(GUP_CLASS_ID,fp_basics_CLASS_ID,FP_BASIC_INTERFACE);
}

Message 8 of 8

Anonymous
Not applicable

This worked for me too.

Thank You very much SoumyaBasheer 🙂

0 Likes