public class StructDNA
extends java.lang.Object
Struct DNA is stored in the file-block with code 'DNA1'. Its block's position in the file is arbitrary.
Struct DNA contains the meta-information of all data types (c-structs and scalar types) supported by the Blender version the file was created in, thus it can be very long. All data types considered are declared in one of the header files in directory source/blender/makesdna which also contains the code to generate this information in the file. source/blender/makesdna/DNA_documentation.h describes the rules for the declaration of structs.
A C struct is described by its type name, a length and its fields (member variables). Each field has a name and a basic type which can be scalar (char, int, double, etc.) or a struct. Furthermore the field can be a pointer, an array or an array of pointers or arrays etc.. This information is encoded in the fields name the way a variable declaration in C would contain it.
Example meta-information on a field:
type | name |
int | *verts[128] |
Thus, the actual name of a field has to be extracted and the type is a combination of both: type and name information.
Modifier and Type | Class and Description |
---|---|
class |
StructDNA.Struct |
Modifier and Type | Field and Description |
---|---|
java.lang.String[] |
names
list of names.
|
int |
names_len
number of names to follow
|
StructDNA.Struct[] |
structs
structure informations
|
int |
structs_len
length of the struct type list
|
short[] |
type_lengths
list with the length of each type in bytes.
|
java.lang.String[] |
types
list of type names as zero terminated strings.
|
int |
types_len
length of the type list
|
Constructor and Description |
---|
StructDNA() |
Modifier and Type | Method and Description |
---|---|
void |
read(CDataReadWriteAccess io) |
java.lang.String |
toString() |
void |
write(CDataReadWriteAccess io) |
public int names_len
public java.lang.String[] names
public int types_len
public java.lang.String[] types
public short[] type_lengths
public int structs_len
public StructDNA.Struct[] structs
public void read(CDataReadWriteAccess io) throws java.io.IOException
java.io.IOException
public void write(CDataReadWriteAccess io) throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object