FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

user defined data

3 posters

Go down

user defined data Empty user defined data

Post  spoboyle Thu Jun 18, 2009 9:52 am

hi guys

i want to be able to add my own data to objects within blender, export them and then load/parse them within the sio2 engine. apparently tutorial 9 contains these details but i have been through it thoroughly and can't find anything. is it there and i am just very tired and need to try again tomorrow or was it left out for some reason? if so can someone possibly give me a place to start looking into it myself

thanks

spoboyle

Posts : 12
Join date : 2009-04-08
Age : 43
Location : manchester, uk

Back to top Go down

user defined data Empty Re: user defined data

Post  uprise78 Thu Jun 18, 2009 12:11 pm

User defined variables go in the Logic panel. Just click Add Property.

uprise78

Posts : 228
Join date : 2008-10-31

Back to top Go down

user defined data Empty Re: user defined data

Post  sio2interactive Thu Jun 18, 2009 10:20 pm

and check tutorial09 to see how you can retrieve them back...
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

user defined data Empty Re: user defined data

Post  spoboyle Tue Jun 23, 2009 4:51 am

I have been through tutorial 9 and managed to make a start. Within the custom_parser i use the void pointer 'userdata' to store a user defined property to be used later. this works fine.

unsigned char custom_parser( char *_root, char *_tok, char *_val )
{
....
float *temp;
sio2StringScanf( _val, "%f", temp);
sio2->_SIO2object->userdata = temp;
....
}

however when i come to read this value out of 'userdata' later on the value has changed is no longer correct.

am i right in thinking 'userdata' can be used in this way ? or does anyone have any ideas what is causing the value of 'userdata' to change?

spoboyle

Posts : 12
Join date : 2009-04-08
Age : 43
Location : manchester, uk

Back to top Go down

user defined data Empty Re: user defined data

Post  sio2interactive Tue Jun 23, 2009 8:30 am

Yes but the way you are using the float * is innacurate since it's an uninitiized local variable and will be probably replaced by the memory manager which would explain the change of value...
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

user defined data Empty Re: user defined data

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum