Attributes in external SDK

FineCutBodies's icon

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

FineCutBodies's icon

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

Lee's icon

Hi, I'm having the same issue....

What was the solution to this?

thx

FineCutBodies's icon

sorry but I don't remember :D

Timothy Place's icon

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