PDA

View Full Version : Linkage errors with object_get_userdata


monster
21st May 2004, 01:36 AM
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.

monster
21st May 2004, 01:49 AM
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?

monster
21st May 2004, 12:01 PM
...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?

Andy
22nd May 2004, 03:26 PM
Monster,

Sorry, it's old function naming that remained for compatibility reasons.

Prototype void object_set_userdata(ACObject *ob, char *dat)
sets the string data (as seen from the object properties dialog).

You can get this with:
Prototype char *ac_object_get_data(ACObject *ob)

(object_set_userdata should really be called ac_object_set_data)

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

monster
24th May 2004, 12:08 AM
Cool. Thanks.