21st May 2004, 12:36 AM | #1 |
Member
Advanced member
Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 39
|
Linkage errors with object_get_userdata
Howdy, when I use object_get_userdata in my plugin I get "unresolved external symbol" linking errors.
I think I had this in the past with a different function, and solved that by redefining it in my C++ source file (so it had C++ linkage). I've tried that in this case, but it didn't seem to work. Quickly searching through the ac3d.lib I can see object_set_userdata, but not the equivalent get. |
21st May 2004, 12:49 AM | #2 |
Member
Advanced member
Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 39
|
Ah, OK.
Should I be using "ac_object_get_data" instead? Will "object_set_userdata" still work? And does that take a copy of whatever I pass in, so I can delete my copy as soon as I've set it? |
21st May 2004, 11:01 AM | #3 |
Member
Advanced member
Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 39
|
...and while I'm on the subject of the API;
If I'm creating my own materials, what should I set the "a" value in the Col3 members of the ACMaterial structure to? The same as "transparency", or "1 - transparency", or are they ignored in favour of the transparency member? And finally, is there any point setting the name and userdata members of the material structure, is there anywhere in AC3D that these can be set or viewed? |
22nd May 2004, 02:26 PM | #4 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,565
|
Monster,
Sorry, it's old function naming that remained for compatibility reasons. Code:
Prototype void object_set_userdata(ACObject *ob, char *dat) You can get this with: Code:
Prototype char *ac_object_get_data(ACObject *ob) This is the string that is editable from the object properties - it will copy your string into it's own space (and deallocate when you set the data again). I'm pretty sure the a component in the material spec is not used but you should set it to 1.0. The way materials are allocated will be changing in the next release - I'll add you to be an alpha tester. Andy |
23rd May 2004, 11:08 PM | #5 |
Member
Advanced member
Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 39
|
Cool. Thanks.
|
|
|