View Full Version : 2012 SDK Function publishing broken ?

06 June 2011, 09:31 AM

I have been using since Max2008 a custom plugin dlx with various functions, gouped in a struct,
using def_struct_primitive( Myfunc, MyUtlis, "Myfunc" );

Value* Myfunc_cf( Value** arg_list, int count )
check_arg_count( MyUtlis.Myfunc, 0, count );
int MyVal = 5
return Integer::intern(MyVal);

all fine and dandy I can use MyUtlis.Myfunc() in max no problem.

this seams to work in all version but 2012, any ideas ?

06 June 2011, 04:40 PM
The 2012 SDK has been re-organized and a few things have changed.
In one of my plugins I was missing:

#include <maxscript\macros\define_instantiation_functions.h>

I believe this file is new, or its used differently then before.

06 June 2011, 06:39 PM
Thanks Kees,
I indeed had to make a #if block for max2012, because of the include changes. No worries.
Thing is, it compiles and loads in max fine.... but the struct is undefined
In listener I get:

06 June 2011, 12:29 AM
Yea it loads fine because there are no errors made.
The functions just haven't been registered with MXS if you don't have the include.

I agree it should ideally give an useful error in that case.

06 June 2011, 11:20 PM
#include <maxscript\macros\define_instantiation_functions.h>
did the trick, thanks Keees

CGTalk Moderation
06 June 2011, 11:20 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.