Forums > Dev

Attributes in external SDK


August 10, 2013 | 3:19 pm

1, When I use the macros "CLASS_ATTR_XXX" in the initialisation routine, all seems to work fine, i’ll see the attribute in the object and can set it with a message, but if i make the object in the patcher with "objectName @attributeName attrValue" then it won’t set it, even if i use a getter/setter function… Do i do something wrong here?

2, If I use "class_addmethod(c, (method)function_attrnotif, "notify", A_CANT, 0)"
then it seems if i set any attributes of the object from max, the "function_attrnotif" won’t be called… maybe i misunderstand something from the SDK doc and it works a different way? All I want to do is, not to write a pair of getter/setter functions for every attribute (i need to handle them a bit more complex then only the value), but use the "notify" function, to be notified if one attribute of the object was changed from max…

Any advice would be much appreciated!
Kevin

August 11, 2013 | 9:33 am

Nicolas, thanx a lot, solved all my problems :)


Lee
December 8, 2015 | 4:45 am

Hi, I’m having the same issue….

What was the solution to this?

thx

December 14, 2015 | 2:38 pm

sorry but I don’t remember :D

December 15, 2015 | 11:05 am

Hi Lee — hard to tell without a concrete piece of code to look at, but most likely you are missing the call to attr_args_process() in your new method.

Cheers

Viewing 5 posts - 1 through 5 (of 5 total)

Forums > Dev