FPInterface, Invoke, FPParams using MaxPlus

FPInterface, Invoke, FPParams using MaxPlus

Anonymous
Not applicable
890 Views
4 Replies
Message 1 of 5

FPInterface, Invoke, FPParams using MaxPlus

Anonymous
Not applicable

Hello,

 

I feel crazy using python scripting in 3dsMAX2014 (SP5+EXT).

 

How can I invoke a plugin function with arguments using python ? The documentation doesn't mention anything about a FPParams class or anything similar...

 

A common case :

 

// Somewhere in my C++ plugin
//
Point3 CMyClass::ConvertPoint(Point3 const& point) { }
# Somewhere in my python tool
# MyClassInterface = MyClassDesc.GetInterfaceAt( 0 ) ConvertPoint = MyClassInterface.FindFn( "ConvertPoint" ) ConvertPointParams = ? MyClassInterface.Invoke( ConvertPoint, 0, ConvertPointParams )

 Thank's

Accepted solutions (1)
891 Views
4 Replies
Replies (4)
Message 2 of 5

kevinvandecar
Community Manager
Community Manager
Accepted solution

Yes, you are crazy. 🙂 No actually not... The MaxPlus API has not exposed that functionality (yet). I have reported a wishlist for that to be added ASAP. In the meantime, you can use the MaxPlus.Core.EvalMAXScript(string) API. This should allow you to execute functions published from your plugin within your python script. See here for the complete documentation, including how to retrieve the returned values:

http://help.autodesk.com/cloudhelp/2015/ENU/Max-Python-API/files/GUID-050A2EBF-A176-49B8-8ED4-14FC23...

 

hope it helps,

kevin

 


Kevin Vandecar
Developer Technical Services
Autodesk Developer Network



0 Likes
Message 3 of 5

Anonymous
Not applicable
Thank you. Will these features be included to the next service pack ?
0 Likes
Message 4 of 5

kevinvandecar
Community Manager
Community Manager

I do not think the features would come in a service pack. Generally service packs do not provide new functionality, and so the earliest we would likely see it, is in the next full release. Sorry about that bad news, but hopefully the workaround will help you until then.

 

thanks,

kevin


Kevin Vandecar
Developer Technical Services
Autodesk Developer Network



0 Likes
Message 5 of 5

Anonymous
Not applicable

Sorry for bumping an old post, but it looks like there still are problems here.

I tried looking through the wishlist for max features, but could not find anything mentioned.

 

This is the code I am executing:

import MaxPlus

obj = MaxPlus.Core.EvalMAXScript('objXRefMgr').GetFPInterface()
val = obj.FindFn('recordCount')
print val

When val gets printed it returns -1. I tried just giving the Invoke() function 1, but this throws an Unknown MaxPlus Exception.

 

Am I right assuming this has not yet been implemented, or have I interpreted the docs wrong?

 

Thanks

0 Likes