Blender  V2.93
dna_defaults.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * DNA default value access.
17  */
18 
71 #include <limits.h>
72 #include <stdio.h>
73 #include <stdlib.h>
74 #include <string.h>
75 
76 #include "MEM_guardedalloc.h"
77 
78 #include "BLI_endian_switch.h"
79 #include "BLI_math.h"
80 #include "BLI_memarena.h"
81 #include "BLI_utildefines.h"
82 
83 #include "IMB_imbuf.h"
84 
85 #include "DNA_defaults.h"
86 
87 #include "DNA_armature_types.h"
88 #include "DNA_asset_types.h"
89 #include "DNA_brush_types.h"
90 #include "DNA_cachefile_types.h"
91 #include "DNA_camera_types.h"
92 #include "DNA_cloth_types.h"
93 #include "DNA_collection_types.h"
94 #include "DNA_curve_types.h"
95 #include "DNA_fluid_types.h"
97 #include "DNA_hair_types.h"
98 #include "DNA_image_types.h"
99 #include "DNA_key_types.h"
100 #include "DNA_lattice_types.h"
101 #include "DNA_light_types.h"
102 #include "DNA_lightprobe_types.h"
103 #include "DNA_linestyle_types.h"
104 #include "DNA_material_types.h"
105 #include "DNA_mesh_types.h"
106 #include "DNA_meta_types.h"
107 #include "DNA_modifier_types.h"
108 #include "DNA_movieclip_types.h"
109 #include "DNA_object_types.h"
110 #include "DNA_particle_types.h"
111 #include "DNA_pointcloud_types.h"
112 #include "DNA_scene_types.h"
113 #include "DNA_simulation_types.h"
114 #include "DNA_space_types.h"
115 #include "DNA_speaker_types.h"
116 #include "DNA_texture_types.h"
117 #include "DNA_volume_types.h"
118 #include "DNA_world_types.h"
119 
120 #include "DNA_armature_defaults.h"
121 #include "DNA_asset_defaults.h"
122 #include "DNA_brush_defaults.h"
123 #include "DNA_cachefile_defaults.h"
124 #include "DNA_camera_defaults.h"
125 #include "DNA_collection_defaults.h"
126 #include "DNA_curve_defaults.h"
127 #include "DNA_fluid_defaults.h"
129 #include "DNA_hair_defaults.h"
130 #include "DNA_image_defaults.h"
131 #include "DNA_lattice_defaults.h"
132 #include "DNA_light_defaults.h"
133 #include "DNA_lightprobe_defaults.h"
134 #include "DNA_linestyle_defaults.h"
135 #include "DNA_material_defaults.h"
136 #include "DNA_mesh_defaults.h"
137 #include "DNA_meta_defaults.h"
138 #include "DNA_modifier_defaults.h"
139 #include "DNA_movieclip_defaults.h"
140 #include "DNA_object_defaults.h"
141 #include "DNA_particle_defaults.h"
142 #include "DNA_pointcloud_defaults.h"
143 #include "DNA_scene_defaults.h"
144 #include "DNA_simulation_defaults.h"
145 #include "DNA_speaker_defaults.h"
146 #include "DNA_texture_defaults.h"
147 #include "DNA_volume_defaults.h"
148 #include "DNA_world_defaults.h"
149 
150 #define SDNA_DEFAULT_DECL_STRUCT(struct_name) \
151  static const struct_name DNA_DEFAULT_##struct_name = _DNA_DEFAULT_##struct_name
152 
153 /* DNA_asset_defaults.h */
155 
156 /* DNA_armature_defaults.h */
158 
159 /* DNA_brush_defaults.h */
161 
162 /* DNA_cachefile_defaults.h */
164 
165 /* DNA_camera_defaults.h */
167 
168 /* DNA_collection_defaults.h */
170 
171 /* DNA_curve_defaults.h */
173 
174 /* DNA_fluid_defaults.h */
178 
179 /* DNA_image_defaults.h */
181 
182 /* DNA_hair_defaults.h */
184 
185 /* DNA_lattice_defaults.h */
187 
188 /* DNA_light_defaults.h */
190 
191 /* DNA_lightprobe_defaults.h */
193 
194 /* DNA_linestyle_defaults.h */
196 
197 /* DNA_material_defaults.h */
199 
200 /* DNA_mesh_defaults.h */
202 
203 /* DNA_meta_defaults.h */
205 
206 /* DNA_movieclip_defaults.h */
208 
209 /* DNA_object_defaults.h */
211 
212 /* DNA_particle_defaults.h */
214 
215 /* DNA_pointcloud_defaults.h */
217 
218 /* DNA_scene_defaults.h */
221 
222 /* DNA_simulation_defaults.h */
224 
225 /* DNA_speaker_defaults.h */
227 
228 /* DNA_texture_defaults.h */
230 
231 /* DNA_view3d_defaults.h */
233 
234 /* DNA_volume_defaults.h */
236 
237 /* DNA_world_defaults.h */
239 
240 /* DNA_modifier_defaults.h */
253 // SDNA_DEFAULT_DECL_STRUCT(DataTransferModifierData);
259 /* Fluid modifier skipped for now. */
276 /* Shape key modifier has no items. */
282 /* Softbody modifier skipped for now. */
298 
299 /* DNA_gpencil_modifier_defaults.h */
319 
320 #undef SDNA_DEFAULT_DECL_STRUCT
321 
322 /* Reuse existing definitions. */
323 extern const struct UserDef U_default;
324 #define DNA_DEFAULT_UserDef U_default
325 
326 extern const bTheme U_theme_default;
327 #define DNA_DEFAULT_bTheme U_theme_default
328 
332 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
333 # define SDNA_TYPE_CHECKED(v, t) (&(v) + (_Generic((v), t : 0)))
334 #else
335 # define SDNA_TYPE_CHECKED(v, t) (&(v))
336 #endif
337 
338 #define SDNA_DEFAULT_DECL(struct_name) \
339  [SDNA_TYPE_FROM_STRUCT(struct_name)] = SDNA_TYPE_CHECKED(DNA_DEFAULT_##struct_name, struct_name)
340 
341 #define SDNA_DEFAULT_DECL_EX(struct_name, struct_path) \
342  [SDNA_TYPE_FROM_STRUCT(struct_name)] = SDNA_TYPE_CHECKED(DNA_DEFAULT_##struct_path, struct_name)
343 
345 const void *DNA_default_table[SDNA_TYPE_MAX] = {
346 
347  /* DNA_asset_defaults.h */
349 
350  /* DNA_armature_defaults.h */
352 
353  /* DNA_brush_defaults.h */
355 
356  /* DNA_cachefile_defaults.h */
358 
359  /* DNA_camera_defaults.h */
363 
364  /* DNA_collection_defaults.h */
366 
367  /* DNA_curve_defaults.h */
369 
370  /* DNA_fluid_defaults.h */
374 
375  /* DNA_image_defaults.h */
377 
378  /* DNA_hair_defaults.h */
380 
381  /* DNA_lattice_defaults.h */
383 
384  /* DNA_light_defaults.h */
386 
387  /* DNA_lightprobe_defaults.h */
389 
390  /* DNA_linestyle_defaults.h */
392 
393  /* DNA_material_defaults.h */
395 
396  /* DNA_mesh_defaults.h */
398 
399  /* DNA_meta_defaults.h */
401 
402  /* DNA_movieclip_defaults.h */
404 
405  /* DNA_object_defaults.h */
407 
408  /* DNA_particle_defaults.h */
410 
411  /* DNA_pointcloud_defaults.h */
413 
414  /* DNA_scene_defaults.h */
425 
435 
436  /* DNA_simulation_defaults.h */
438 
439  /* DNA_speaker_defaults.h */
441 
442  /* DNA_texture_defaults.h */
445 
446  /* DNA_userdef_types.h */
452 
453  /* DNA_view3d_defaults.h */
458 
459  /* DNA_volume_defaults.h */
461 
462  /* DNA_world_defaults.h */
464 
465  /* DNA_modifier_defaults.h */
478  // SDNA_DEFAULT_DECL(DataTransferModifierData),
484  /* Fluid modifier skipped for now. */
501  /* Shape key modifier has no items. */
507  /* Softbody modifier skipped for now. */
523 
524  /* DNA_gpencil_modifier_defaults.h */
544 };
545 #undef SDNA_DEFAULT_DECL
546 #undef SDNA_DEFAULT_DECL_EX
547 
548 char *_DNA_struct_default_alloc_impl(const char *data_src, size_t size, const char *alloc_str)
549 {
550  char *data_dst = MEM_mallocN(size, alloc_str);
551  memcpy(data_dst, data_src, size);
552  return data_dst;
553 }
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.
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
const struct UserDef U_default
#define SDNA_DEFAULT_DECL(struct_name)
Definition: dna_defaults.c:338
const void * DNA_default_table[SDNA_TYPE_MAX]
Definition: dna_defaults.c:345
#define SDNA_DEFAULT_DECL_STRUCT(struct_name)
Definition: dna_defaults.c:150
#define SDNA_DEFAULT_DECL_EX(struct_name, struct_path)
Definition: dna_defaults.c:341
const bTheme U_theme_default
char * _DNA_struct_default_alloc_impl(const char *data_src, size_t size, const char *alloc_str)
Definition: dna_defaults.c:548
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:47
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
ParticleBrushData brush[7]
struct BakeData bake
struct ImageFormatData im_format
struct FFMpegCodecData ffcodecdata
struct PhysicsSettings physics_settings
struct SceneDisplay display
struct RenderData r
View3DCursor cursor
struct DisplaySafeAreas safe_areas
struct AudioData audio
struct SceneEEVEE eevee
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