Notifications
Clear all

[Closed] 2012 SDK Function publishing broken ?

Hello,

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 ?
4 Replies

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.

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:

Myutils
 ->undefined

???

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.

Anyway,

#include <maxscript\macros\define_instantiation_functions.h>

did the trick, thanks Keees