Go Back   AC3D Forums > Technical > AC3D Developers
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 21st May 2004, 12:36 AM   #1
monster
Member
Advanced member
 
Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 39
Default 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.
monster is offline   Reply With Quote
Old 21st May 2004, 12:49 AM   #2
monster
Member
Advanced member
 
Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 39
Default

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 is offline   Reply With Quote
Old 21st May 2004, 11:01 AM   #3
monster
Member
Advanced member
 
Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 39
Default

...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?
monster is offline   Reply With Quote
Old 22nd May 2004, 02:26 PM   #4
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default

Monster,

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

Code:
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:
Code:
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
Andy is offline   Reply With Quote
Old 23rd May 2004, 11:08 PM   #5
monster
Member
Advanced member
 
Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 39
Default

Cool. Thanks.
monster is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 12:10 PM.


AC3D Forum
(C) Inivis Limited 2020