ice799
09-17-2006, 11:25 PM
Hey guys -
Quick background: I'm a unix systems programmer (lots of C and x86 assembly knowledge), but this is my first time working with 3DSMax SDK and max scrippting.
The problem: A max script has been created which assigns a custom attribute to an object in the scene. This is done more or less by doing the following:
on assign pressed do
(
for i in selection do
(
custAttributes.add i classCAs
i.class = classMaster.tv.selectedItem.text
)
)
For reference:
classCAs = attributes classAttributes
(
parameters classParams rollout:classMaster2
(
mass type:#float ui:massSpinner
price type:#float ui:priceSpinner
class type:#string
)
)
Now, I have written a C++ Plugin which exports each object in a file format which another program can use. In the export process, I ask 3d Studio max how many custom attributes an INode has, and it returns 0:
/* error check is ommited to save space... */
ICustAttribContainer *tmp = node->GetCustAttribContainer();
int numAttribs = tmp->GetNumCustAttribs();
Using a debugger, the function GetNumCustAttribs() returns 0, when I was hoping that the above max script code would add in custom attributes, class price and mass.
Is there something obvious I am missing here? I can provide more code if it would be useful for solving the problem -- I've only provided the lines which seem relevant to save space on this already lenghty post.
Thanks for the help and suggestions.
Quick background: I'm a unix systems programmer (lots of C and x86 assembly knowledge), but this is my first time working with 3DSMax SDK and max scrippting.
The problem: A max script has been created which assigns a custom attribute to an object in the scene. This is done more or less by doing the following:
on assign pressed do
(
for i in selection do
(
custAttributes.add i classCAs
i.class = classMaster.tv.selectedItem.text
)
)
For reference:
classCAs = attributes classAttributes
(
parameters classParams rollout:classMaster2
(
mass type:#float ui:massSpinner
price type:#float ui:priceSpinner
class type:#string
)
)
Now, I have written a C++ Plugin which exports each object in a file format which another program can use. In the export process, I ask 3d Studio max how many custom attributes an INode has, and it returns 0:
/* error check is ommited to save space... */
ICustAttribContainer *tmp = node->GetCustAttribContainer();
int numAttribs = tmp->GetNumCustAttribs();
Using a debugger, the function GetNumCustAttribs() returns 0, when I was hoping that the above max script code would add in custom attributes, class price and mass.
Is there something obvious I am missing here? I can provide more code if it would be useful for solving the problem -- I've only provided the lines which seem relevant to save space on this already lenghty post.
Thanks for the help and suggestions.
