Blender V5.0
blender::dna Namespace Reference

Namespaces

namespace  array
namespace  pointers

Functions

void print_structs_at_address (const SDNA &sdna, int struct_id, const void *data, const void *address, int64_t element_num, std::ostream &stream)
void print_struct_by_id (int struct_id, const void *data)
template<typename T>
int sdna_struct_id_get ()
int sdna_struct_id_get_max ()
static void print_struct_array_recursive (const SDNA &sdna, const SDNA_Struct &sdna_struct, const void *initial_data, const int64_t element_num, const int indent, fmt::appender &dst)
static void print_single_struct_recursive (const SDNA &sdna, const SDNA_Struct &sdna_struct, const void *initial_data, const int indent, fmt::appender &dst)
static bool char_array_startswith_simple_name (const char *data, const int array_len)

Function Documentation

◆ char_array_startswith_simple_name()

bool blender::dna::char_array_startswith_simple_name ( const char * data,
const int array_len )
static

Uses a heuristic to detect if a char array should be printed as string.

Definition at line 2042 of file dna_genfile.cc.

References data, and i.

Referenced by print_single_struct_recursive().

◆ print_single_struct_recursive()

◆ print_struct_array_recursive()

void blender::dna::print_struct_array_recursive ( const SDNA & sdna,
const SDNA_Struct & sdna_struct,
const void * initial_data,
const int64_t element_num,
const int indent,
fmt::appender & dst )
static

◆ print_struct_by_id()

void blender::dna::print_struct_by_id ( int struct_id,
const void * data )

Prints all members of the struct to stdout.

Definition at line 2217 of file dna_genfile.cc.

References data, DNA_sdna_current_get(), and print_structs_at_address().

◆ print_structs_at_address()

void blender::dna::print_structs_at_address ( const SDNA & sdna,
int struct_id,
const void * data,
const void * address,
int64_t element_num,
std::ostream & stream )

Print all members of the struct assuming that the data has the given address. This is mainly useful for observing what data is written to a .blend file.

Parameters
sdnaContains reflection information about DNA structs.
struct_idThe type the data points to. Used to index into sdna.structs.
dataWhere the data is stored.
addressThe address that should be printed. Often it's the same as data.
element_numThe number of elements in the array, or 1 if there is only one struct.
streamWhere to print the output.

Definition at line 2198 of file dna_genfile.cc.

References print_struct_array_recursive(), SDNA::structs, SDNA_Struct::type_index, and SDNA::types.

Referenced by print_struct_by_id(), and writestruct_at_address_nr().

◆ sdna_struct_id_get()

template<typename T>
int blender::dna::sdna_struct_id_get ( )

Each DNA struct has an integer identifier which is unique within a specific Blender build, but not necessarily across different builds. The identifier can be used to index into SDNA.structs.

Referenced by blender::eevee::LightModule::begin_sync(), and blender::nodes::socket_items::blend_write().

◆ sdna_struct_id_get_max()

int blender::dna::sdna_struct_id_get_max ( )

The maximum identifier that will be returned by sdna_struct_id_get in this Blender build.

Referenced by writestruct_at_address_nr().