Blender V4.3
dna_defaults.c
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
60#define DNA_DEPRECATED_ALLOW
61
62#include <limits.h>
63#include <stdio.h>
64#include <stdlib.h>
65#include <string.h>
66
67#include "MEM_guardedalloc.h"
68
69#include "BLI_endian_switch.h"
70#include "BLI_math_rotation.h"
71#include "BLI_memarena.h"
72#include "BLI_utildefines.h"
73
74#include "IMB_imbuf_enums.h"
75
76#include "DNA_defaults.h"
77
78#include "DNA_anim_types.h"
79#include "DNA_armature_types.h"
80#include "DNA_asset_types.h"
81#include "DNA_brush_types.h"
82#include "DNA_cachefile_types.h"
83#include "DNA_camera_types.h"
84#include "DNA_cloth_types.h"
86#include "DNA_curve_types.h"
87#include "DNA_curves_types.h"
88#include "DNA_fluid_types.h"
91#include "DNA_image_types.h"
92#include "DNA_key_types.h"
93#include "DNA_lattice_types.h"
94#include "DNA_light_types.h"
96#include "DNA_linestyle_types.h"
97#include "DNA_mask_types.h"
98#include "DNA_material_types.h"
99#include "DNA_mesh_types.h"
100#include "DNA_meta_types.h"
101#include "DNA_modifier_types.h"
102#include "DNA_movieclip_types.h"
103#include "DNA_object_types.h"
104#include "DNA_particle_types.h"
105#include "DNA_pointcloud_types.h"
106#include "DNA_scene_types.h"
107#include "DNA_space_types.h"
108#include "DNA_speaker_types.h"
109#include "DNA_texture_types.h"
110#include "DNA_volume_types.h"
111#include "DNA_world_types.h"
112
113#include "DNA_action_defaults.h"
115#include "DNA_asset_defaults.h"
116#include "DNA_brush_defaults.h"
118#include "DNA_camera_defaults.h"
120#include "DNA_curve_defaults.h"
121#include "DNA_curves_defaults.h"
122#include "DNA_fluid_defaults.h"
125#include "DNA_image_defaults.h"
126#include "DNA_lattice_defaults.h"
127#include "DNA_light_defaults.h"
131#include "DNA_mesh_defaults.h"
132#include "DNA_meta_defaults.h"
135#include "DNA_object_defaults.h"
138#include "DNA_scene_defaults.h"
139#include "DNA_space_defaults.h"
140#include "DNA_speaker_defaults.h"
141#include "DNA_texture_defaults.h"
142#include "DNA_userdef_defaults.h"
143#include "DNA_volume_defaults.h"
144#include "DNA_world_defaults.h"
145
146#define SDNA_DEFAULT_DECL_STRUCT(struct_name) \
147 static const struct_name DNA_DEFAULT_##struct_name = _DNA_DEFAULT_##struct_name
148
149/* DNA_action_defaults.h */
152
153/* DNA_asset_defaults.h */
156
157/* DNA_armature_defaults.h */
159
160/* DNA_brush_defaults.h */
162
163/* DNA_cachefile_defaults.h */
165
166/* DNA_camera_defaults.h */
168
169/* DNA_collection_defaults.h */
171
172/* DNA_curve_defaults.h */
174
175/* DNA_fluid_defaults.h */
179
180/* DNA_image_defaults.h */
182
183/* DNA_curves_defaults.h */
185
186/* DNA_grease_pencil_defaults.h */
188
189/* DNA_lattice_defaults.h */
191
192/* DNA_light_defaults.h */
194
195/* DNA_lightprobe_defaults.h */
197
198/* DNA_linestyle_defaults.h */
200
201/* DNA_material_defaults.h */
203
204/* DNA_mesh_defaults.h */
206
207/* DNA_meta_defaults.h */
209
210/* DNA_movieclip_defaults.h */
214
215/* DNA_object_defaults.h */
217
218/* DNA_particle_defaults.h */
220
221/* DNA_pointcloud_defaults.h */
223
224/* DNA_scene_defaults.h */
228
229/* DNA_space_defaults.h */
231
232/* DNA_speaker_defaults.h */
234
235/* DNA_texture_defaults.h */
237
238/* DNA_userdef_types.h */
242
243/* DNA_view3d_defaults.h */
245
246/* DNA_volume_defaults.h */
248
249/* DNA_world_defaults.h */
251
252/* DNA_modifier_defaults.h */
265// SDNA_DEFAULT_DECL_STRUCT(DataTransferModifierData);
271/* Fluid modifier skipped for now. */
288/* Shape key modifier has no items. */
294/* Softbody modifier skipped for now. */
315
316/* Grease Pencil 3.0 modifiers. */
318
319/* DNA_gpencil_modifier_defaults.h */
370
371#undef SDNA_DEFAULT_DECL_STRUCT
372
373/* Reuse existing definitions. */
374extern const UserDef U_default;
375#define DNA_DEFAULT_UserDef U_default
376
377extern const bTheme U_theme_default;
378#define DNA_DEFAULT_bTheme U_theme_default
379
383#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
384# define SDNA_TYPE_CHECKED(v, t) (&(v) + (_Generic((v), t: 0)))
385#else
386# define SDNA_TYPE_CHECKED(v, t) (&(v))
387#endif
388
389#define SDNA_DEFAULT_DECL(struct_name) \
390 [SDNA_TYPE_FROM_STRUCT(struct_name)] = SDNA_TYPE_CHECKED(DNA_DEFAULT_##struct_name, struct_name)
391
392#define SDNA_DEFAULT_DECL_EX(struct_name, struct_path) \
393 [SDNA_TYPE_FROM_STRUCT(struct_name)] = SDNA_TYPE_CHECKED(DNA_DEFAULT_##struct_path, struct_name)
394
395/* NOTE: Keep headers sorted. */
396
397const void *DNA_default_table[SDNA_TYPE_MAX] = {
398
399 /* DNA_anim_defaults.h */
402
403 /* DNA_asset_defaults.h */
406
407 /* DNA_armature_defaults.h */
409
410 /* DNA_brush_defaults.h */
412
413 /* DNA_cachefile_defaults.h */
415
416 /* DNA_camera_defaults.h */
420
421 /* DNA_collection_defaults.h */
423
424 /* DNA_curve_defaults.h */
426
427 /* DNA_fluid_defaults.h */
431
432 /* DNA_image_defaults.h */
434
435 /* DNA_curves_defaults.h */
437
438 /* DNA_grease_pencil_defaults.h */
440
441 /* DNA_lattice_defaults.h */
443
444 /* DNA_light_defaults.h */
446
447 /* DNA_lightprobe_defaults.h */
449
450 /* DNA_linestyle_defaults.h */
452
453 /* DNA_material_defaults.h */
455
456 /* DNA_mesh_defaults.h */
458
459 /* DNA_space_defaults.h */
462
463 /* DNA_meta_defaults.h */
465
466 /* DNA_movieclip_defaults.h */
471
472 /* DNA_object_defaults.h */
474
475 /* DNA_particle_defaults.h */
477
478 /* DNA_pointcloud_defaults.h */
480
481 /* DNA_scene_defaults.h */
493
503
505
506 /* DNA_speaker_defaults.h */
508
509 /* DNA_texture_defaults.h */
512
513 /* DNA_userdef_types.h */
522
523 /* DNA_view3d_defaults.h */
528
529 /* DNA_volume_defaults.h */
531
532 /* DNA_world_defaults.h */
534
535 /* DNA_modifier_defaults.h */
548 // SDNA_DEFAULT_DECL(DataTransferModifierData),
554 /* Fluid modifier skipped for now. */
571 /* Shape key modifier has no items. */
577 /* Softbody modifier skipped for now. */
599
600 /* Grease Pencil 3.0 defaults. */
602
603 /* DNA_gpencil_modifier_defaults.h */
653};
654#undef SDNA_DEFAULT_DECL
655#undef SDNA_DEFAULT_DECL_EX
656
658 size_t size,
659 const char *alloc_str)
660{
661 uint8_t *data_dst = MEM_mallocN(size, alloc_str);
662 memcpy(data_dst, data_src, size);
663 return data_dst;
664}
Object groups, one object can be in many groups at once.
Object is a sort of wrapper for general info.
Read Guarded memory(de)allocation.
#define SDNA_DEFAULT_DECL(struct_name)
const void * DNA_default_table[SDNA_TYPE_MAX]
const UserDef U_default
#define SDNA_DEFAULT_DECL_STRUCT(struct_name)
#define SDNA_DEFAULT_DECL_EX(struct_name, struct_path)
const bTheme U_theme_default
uint8_t * _DNA_struct_default_alloc_impl(const uint8_t *data_src, size_t size, const char *alloc_str)
void *(* MEM_mallocN)(size_t len, const char *str)
Definition mallocn.cc:44
unsigned char uint8_t
Definition stdint.h:78
The meta-data of an asset. By creating and giving this for a data-block (ID.asset_data),...
struct MTex mtex
struct CameraStereoSettings stereo
struct CameraDOFSettings dof
struct GP_Sculpt_Guide guide
struct MovieTrackingMarker undist_marker
ParticleBrushData brush[7]
struct BakeData bake
struct ImageFormatData im_format
struct FFMpegCodecData ffcodecdata
struct RaytraceEEVEE ray_tracing_options
struct PhysicsSettings physics_settings
struct SceneDisplay display
struct RenderData r
View3DCursor cursor
struct DisplaySafeAreas safe_areas
struct AudioData audio
struct SceneEEVEE eevee
MaskSpaceInfo mask_info
struct CurvePaintSettings curve_paint_settings
struct ImagePaintSettings imapaint
struct UnifiedPaintSettings unified_paint_settings
struct MeshStatVis statvis
struct ParticleEditSettings particle
struct GP_Sculpt_Settings gp_sculpt
struct WalkNavigation walk_navigation
UserDef_FileSpaceData file_space_data
UserDef_SpaceData space_data
View3DOverlay overlay
View3DShading shading