user defined data
3 posters
user defined data
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
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
Re: user defined data
User defined variables go in the Logic panel. Just click Add Property.
uprise78- Posts : 228
Join date : 2008-10-31
Re: user defined data
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?
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
Re: user defined data
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...
Similar topics
» How could I move my camera which passes the fixed defined position?
» Optimize mesh data
» Basic C Question - Parsing Data
» New User here
» How do I play the sio2.ogv video in the data directory of the SDK.
» Optimize mesh data
» Basic C Question - Parsing Data
» New User here
» How do I play the sio2.ogv video in the data directory of the SDK.
Permissions in this forum:
You cannot reply to topics in this forum