Hi, I'm playing around with my copy of the source a little to get comfortable with how things fit together.
I've added a flag to the SpaceText structure (an integer) but now the makesdna utility complains that the structure length is wrong.
My problem is I can't figure out what makesdna is comparing the structure length with, and where that information is stored.
A terse note in blenload\intern\genfile.c suggests that I might have to make a file named "StructDNA" with information about the new structure in it. Is this correct? If so, I have no valid example of what that file should look like (just a vaguely-typed description).
If one of you has done this before, please help!
SDNA SpaceX modification help
Moderators: jesterKing, stiv
You know about blender3d.org, right? Some useful stuff in the Development section.
http://www.blender3d.org/cms/Notes_on_SDNA.436.0.html
http://www.blender3d.org/cms/Adding_new ... 557.0.html
http://www.blender3d.org/cms/Notes_on_SDNA.436.0.html
http://www.blender3d.org/cms/Adding_new ... 557.0.html
Heh, yes, I've read all those quite thoroughly to no avail.
As far as I understand it, the whole point of SDNA is that the makesdna utility automatically produces the SDNA data string.
Wait, I just found the answer. I added a single int to the structure, which is a 4-byte type. I think the complaint was that that was only half the amount wanted to keep an 8-byte boundry. By adding another int blender compiled without error. (That's alright because I'll need it for bit-flags...)
The error message DNA_makesdna gave me was not particularly clear about the reason for the error... (Of course, it seems obvious now in hindsight only
)
Thanks for the quick response though.
As far as I understand it, the whole point of SDNA is that the makesdna utility automatically produces the SDNA data string.
Wait, I just found the answer. I added a single int to the structure, which is a 4-byte type. I think the complaint was that that was only half the amount wanted to keep an 8-byte boundry. By adding another int blender compiled without error. (That's alright because I'll need it for bit-flags...)
The error message DNA_makesdna gave me was not particularly clear about the reason for the error... (Of course, it seems obvious now in hindsight only

Thanks for the quick response though.

Er, SDNA produces a bitcode which describes the data structures used in Blender. This bitstring is what gives Blender the ability to load and save .blend files with both forward and backward compatability against any other file version of Blender.
SDNA also forces 8-byte alignment for cross-platform compatability. Thus, a SunSparc and a PC can both read and write the same .blend files by directly dumping or reading memory to file. Only two filters need be applied: the SDNA bitcode to degrade/upgrade the structure gracefully, and endian-ness repair.
I know I'm a newbie here but I know my stuff and I won't flounder about unless something is particularly unclear. Please don't condescend.
SDNA also forces 8-byte alignment for cross-platform compatability. Thus, a SunSparc and a PC can both read and write the same .blend files by directly dumping or reading memory to file. Only two filters need be applied: the SDNA bitcode to degrade/upgrade the structure gracefully, and endian-ness repair.
I know I'm a newbie here but I know my stuff and I won't flounder about unless something is particularly unclear. Please don't condescend.