Blender V5.0
DNA_object_types.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9
10#pragma once
11
12#include "BLI_utildefines.h"
13
14#include "DNA_object_enums.h"
15
17#include "DNA_defs.h"
18#include "DNA_lineart_types.h"
19#include "DNA_listBase.h"
20
21#include "DNA_ID.h"
22#include "DNA_action_types.h" /* bAnimVizSettings */
24#include "DNA_defs.h"
25#include "DNA_listBase.h"
26
27#ifdef __cplusplus
29#endif
30
31#ifdef __cplusplus
32namespace blender::bke {
33struct ObjectRuntime;
34}
36#else
38#endif
39
40struct AnimData;
41struct BoundBox;
42struct Collection;
43struct Curve;
44struct FluidsimSettings;
45struct ImageUser;
47struct Material;
48struct Object;
49struct PartDeflect;
50struct Path;
51struct RigidBodyOb;
52struct SculptSession;
53struct SoftBody;
54struct bGPdata;
55
57typedef struct bDeformGroup {
59 char name[/*MAX_VGROUP_NAME*/ 64];
60 /* need this flag for locking weights */
61 char flag, _pad0[7];
63
64#ifdef DNA_DEPRECATED_ALLOW
65typedef struct bFaceMap {
66 struct bFaceMap *next, *prev;
67 char name[/*MAX_VGROUP_NAME*/ 64];
68 char flag;
69 char _pad0[7];
70} bFaceMap;
71#endif
72
73#define MAX_VGROUP_NAME 64
74
76enum {
78};
79
101typedef struct BoundBox {
102 float vec[8][3];
104
105typedef struct ObjectLineArt {
106 short usage;
107 short flags;
108
111
113
114 char _pad[7];
116
130
135
136/* Evaluated light linking state needed for the render engines integration. */
137typedef struct LightLinkingRuntime {
138
139 /* For objects that emit light: a bitmask of light sets this emitter is part of for the light
140 * linking.
141 * A light set is a combination of emitters used by one or more receiver objects.
142 *
143 * If there is no light linking in the scene or if the emitter does not specify light linking all
144 * bits are set.
145 *
146 * NOTE: There can only be 64 light sets in a scene. */
148
149 /* For objects that emit light: a bitmask of light sets this emitter is part of for the shadow
150 * linking.
151 * A light set is a combination of emitters from which a blocked object does not cast a shadow.
152 *
153 * If there is no shadow linking in the scene or if the emitter does not specify shadow linking
154 * all bits are set.
155 *
156 * NOTE: There can only be 64 light sets in a scene. */
158
159 /* For receiver objects: the index of the light set from which this object receives light.
160 *
161 * If there is no light linking in the scene or the receiver is not linked to any light this is
162 * assigned zero. */
164
165 /* For blocker objects: the index of the light set from which this object casts shadow from.
166 *
167 * If there is no shadow in the scene or the blocker is not linked to any emitter this is
168 * assigned zero. */
170
171 uint8_t _pad[6];
173
174typedef struct LightLinking {
175 /* Collections which contains objects (possibly via nested collection indirection) which defines
176 * the light linking relation: such as whether objects are included or excluded from being lit by
177 * this emitter (receiver_collection), or whether they block light from this emitter
178 * (blocker_collection).
179 *
180 * If the collection is a null pointer then all objects from the current scene are receiving
181 * light from this emitter, and nothing is excluded from receiving the light and shadows.
182 *
183 * The emitter in this context is assumed to be either object of lamp type, or objects with
184 * surface which has emissive shader. */
187
190
191typedef struct Object {
192#ifdef __cplusplus
195 static constexpr ID_Type id_type = ID_OB;
196#endif
197
200 struct AnimData *adt;
201
203
204 short type; /* #ObjectType */
205 short partype;
209 char parsubstr[/*MAX_NAME*/ 64];
210 struct Object *parent, *track;
211 /* Proxy pointer are deprecated, only kept for conversion to liboverrides. */
212 struct Object *proxy DNA_DEPRECATED;
213 struct Object *proxy_group DNA_DEPRECATED;
214 struct Object *proxy_from DNA_DEPRECATED;
215 // struct Path *path;
216 struct bAction *poselib DNA_DEPRECATED; /* Pre-Blender 3.0 pose library, deprecated in 3.5. */
218 struct bPose *pose;
220 void *data;
221
223 struct bGPdata *gpd
224 DNA_DEPRECATED; /* XXX deprecated... replaced by gpencil object, keep for readfile */
225
230
231 ListBase effect DNA_DEPRECATED; /* XXX deprecated... keep for readfile */
232 ListBase defbase DNA_DEPRECATED; /* Only for versioning, moved to object data. */
233 ListBase fmaps DNA_DEPRECATED; /* For versioning, moved to generic attributes. */
240
242 int mode;
244
245 /* materials */
247 struct Material **mat;
249 char *matbits;
254
255 /* rot en drot have to be together! (transform('r' en 's')) */
256 float loc[3], dloc[3];
258 float scale[3];
260 float dsize[3] DNA_DEPRECATED;
262 float dscale[3];
264 float rot[3], drot[3];
266 float quat[4], dquat[4];
268 float rotAxis[3], drotAxis[3];
272 float parentinv[4][4];
275 float constinv[4][4];
276
278 unsigned int lay DNA_DEPRECATED;
279
281 short flag;
283 short colbits DNA_DEPRECATED;
284
289 short nlaflag;
290
291 char _pad1;
293
294 /* Depsgraph */
298 unsigned short base_local_view_bits;
299
301 unsigned short col_group, col_mask;
302
304 short rotmode;
305
310
312 short dtx;
314 char dt;
319
321 short index;
323 unsigned short actdef DNA_DEPRECATED;
325 char _pad2[4];
327 float color[4];
328
330 short softflag;
331
334
336 short shapenr;
339
340 char _pad3[1];
341
347
351 struct SoftBody *soft;
354
356 struct FluidsimSettings *fluidsimSettings
357 DNA_DEPRECATED; /* XXX deprecated... replaced by mantaflow, keep for readfile */
358
360
365
367 float ima_ofs[2];
373
376
380
382
384
387
390
393
395
396#ifdef __cplusplus
397 const blender::float4x4 &object_to_world() const;
398 const blender::float4x4 &world_to_object() const;
399#endif
401
403typedef struct ObHook {
404 struct ObHook *next, *prev;
405
406 struct Object *parent;
408 float parentinv[4][4];
410 float mat[4][4];
412 float cent[3];
414 float falloff;
415
416 char name[/*MAX_NAME*/ 64];
417
422 short type, active;
423 float force;
425
426/* **************** OBJECT ********************* */
427
435#define SELECT 1
436
438typedef enum ObjectType {
446
449
452
454
456
458
460
462
464
466
467 /* Keep last. */
470
471/* check if the object type supports materials */
472#define OB_TYPE_SUPPORT_MATERIAL(_type) \
473 (((_type) >= OB_MESH && (_type) <= OB_MBALL) || \
474 ((_type) >= OB_CURVES && (_type) <= OB_GREASE_PENCIL))
475
479#define OB_TYPE_IS_GEOMETRY(_type) \
480 (ELEM(_type, \
481 OB_MESH, \
482 OB_SURF, \
483 OB_FONT, \
484 OB_MBALL, \
485 OB_CURVES_LEGACY, \
486 OB_CURVES, \
487 OB_POINTCLOUD, \
488 OB_VOLUME, \
489 OB_GREASE_PENCIL))
490#define OB_TYPE_SUPPORT_VGROUP(_type) (ELEM(_type, OB_MESH, OB_LATTICE, OB_GREASE_PENCIL))
491#define OB_TYPE_SUPPORT_EDITMODE(_type) \
492 (ELEM(_type, \
493 OB_MESH, \
494 OB_FONT, \
495 OB_CURVES_LEGACY, \
496 OB_SURF, \
497 OB_MBALL, \
498 OB_LATTICE, \
499 OB_ARMATURE, \
500 OB_CURVES, \
501 OB_POINTCLOUD, \
502 OB_GREASE_PENCIL))
503#define OB_TYPE_SUPPORT_PARVERT(_type) \
504 (ELEM(_type, OB_MESH, OB_SURF, OB_CURVES_LEGACY, OB_LATTICE))
505
507#define OB_DATA_SUPPORT_EDITMODE(_type) \
508 (ELEM(_type, ID_ME, ID_CU_LEGACY, ID_MB, ID_LT, ID_AR, ID_CV, ID_GP))
509
510/* is this ID type used as object data */
511#define OB_DATA_SUPPORT_ID(_id_type) \
512 (ELEM(_id_type, \
513 ID_ME, \
514 ID_CU_LEGACY, \
515 ID_MB, \
516 ID_LA, \
517 ID_SPK, \
518 ID_LP, \
519 ID_CA, \
520 ID_LT, \
521 ID_GD_LEGACY, \
522 ID_AR, \
523 ID_CV, \
524 ID_PT, \
525 ID_VO, \
526 ID_GP))
527
528#define OB_DATA_SUPPORT_ID_CASE \
529 ID_ME: \
530 case ID_CU_LEGACY: \
531 case ID_MB: \
532 case ID_LA: \
533 case ID_SPK: \
534 case ID_LP: \
535 case ID_CA: \
536 case ID_LT: \
537 case ID_GD_LEGACY: \
538 case ID_AR: \
539 case ID_CV: \
540 case ID_PT: \
541 case ID_VO: \
542 case ID_GP
543
545enum {
546 PARTYPE = (1 << 4) - 1,
552
553};
554
556enum {
558 OB_TRANSFLAG_UNUSED_1 = 1 << 1, /* cleared */
559 OB_NEG_SCALE = 1 << 2,
560 OB_TRANSFLAG_UNUSED_3 = 1 << 3, /* cleared */
562 OB_DUPLIROT = 1 << 5,
563 OB_TRANSFLAG_UNUSED_6 = 1 << 6, /* cleared */
564 /* runtime, calculate derivedmesh for dupli before it's used */
565 OB_TRANSFLAG_UNUSED_7 = 1 << 7, /* dirty */
569 OB_DUPLIPARTS = 1 << 11,
570 OB_TRANSFLAG_UNUSED_12 = 1 << 12, /* cleared */
571 /* runtime constraints disable */
573 /* when calculating vertex parent position, ignore CD_ORIGINDEX layer */
575
577};
578
580enum {
587};
588
590enum {
592 OB_AXIS = 1 << 1,
593 OB_TEXSPACE = 1 << 2,
594 OB_DRAWNAME = 1 << 3,
595 /* OB_DRAWIMAGE = 1 << 4, */ /* UNUSED */
596 /* for solid+wire display */
597 OB_DRAWWIRE = 1 << 5,
598 /* For overdrawing. */
600 /* Enable transparent draw. */
602 OB_DRAW_ALL_EDGES = 1 << 8, /* only for meshes currently */
604 /* Enable lights for grease pencil. */
606};
607
609enum {
618};
619
624enum {
631};
632
634enum {
639 // OB_BOUND_TRIANGLE_MESH = 4, /* UNUSED */
640 // OB_BOUND_CONVEX_HULL = 5, /* UNUSED */
641 // OB_BOUND_DYN_MESH = 6, /* UNUSED */
643};
644
645/* **************** BASE ********************* */
646
648enum {
649 BA_WAS_SEL = (1 << 1),
650 /* NOTE: BA_HAS_RECALC_DATA can be re-used later if freed in `readfile.cc`. */
651 // BA_HAS_RECALC_OB = 1 << 2, /* DEPRECATED */
652 // BA_HAS_RECALC_DATA = 1 << 3, /* DEPRECATED */
655
657 BA_TEMP_TAG = 1 << 5,
663
668
669 OB_FROMDUPLI = 1 << 9,
671 OB_DONE = 1 << 10,
675};
676
678enum {
688 OB_HOLDOUT = 1 << 9,
694};
695
697enum {
699#ifdef DNA_DEPRECATED_ALLOW
700 OB_SHAPE_FLAG_UNUSED_1 = 1 << 1, /* cleared */
701#endif
703};
704
706enum {
707 OB_ADS_UNUSED_1 = 1 << 0, /* cleared */
708 OB_ADS_UNUSED_2 = 1 << 1, /* cleared */
709 /* object-channel expanded status */
711 /* object's ipo-block */
712 /* OB_ADS_SHOWIPO = 1 << 11, */ /* UNUSED */
713 /* object's constraint channels */
714 /* OB_ADS_SHOWCONS = 1 << 12, */ /* UNUSED */
715 /* object's material channels */
716 /* OB_ADS_SHOWMATS = 1 << 13, */ /* UNUSED */
717 /* object's particle channels */
718 /* OB_ADS_SHOWPARTS = 1 << 14, */ /* UNUSED */
719};
720
722enum {
723 OB_LOCK_LOCX = 1 << 0,
724 OB_LOCK_LOCY = 1 << 1,
725 OB_LOCK_LOCZ = 1 << 2,
727 OB_LOCK_ROTX = 1 << 3,
728 OB_LOCK_ROTY = 1 << 4,
729 OB_LOCK_ROTZ = 1 << 5,
735 OB_LOCK_ROTW = 1 << 9,
736 OB_LOCK_ROT4D = 1 << 10,
737};
738
740enum {
743};
744
746enum {
750};
751
753enum {
759};
760
762enum {
764};
765
#define ENUM_OPERATORS(_type, _max)
ID and Library types, which are fundamental for SDNA.
ID_Type
@ ID_OB
#define DNA_DEFINE_CXX_METHODS(class_name)
Definition DNA_defs.h:66
These structs are the foundation for all linked lists in the library system.
@ OB_EMPTY_IMAGE_USE_ALPHA_BLEND
@ OB_EMPTY_IMAGE_HIDE_FRONT
@ OB_EMPTY_IMAGE_HIDE_NON_AXIS_ALIGNED
@ OB_EMPTY_IMAGE_HIDE_ORTHOGRAPHIC
@ OB_EMPTY_IMAGE_HIDE_BACK
@ OB_EMPTY_IMAGE_HIDE_PERSPECTIVE
@ PARVERT1
@ PARSKEL
@ PAROBJECT
@ PARTYPE
@ PARVERT3
@ PARBONE
@ GREASE_PENCIL_LINEART_SCENE
@ GP_STROKE
@ GREASE_PENCIL_LINEART_COLLECTION
@ GREASE_PENCIL_LINEART_OBJECT
@ GP_MONKEY
@ GP_EMPTY
@ OB_HIDE_TRANSMISSION
@ OB_HIDE_SURFACE_PICK
@ OB_HOLDOUT
@ OB_HIDE_PROBE_VOLUME
@ OB_HIDE_RENDER
@ OB_HIDE_CAMERA
@ OB_HIDE_PROBE_PLANAR
@ OB_HIDE_PROBE_CUBEMAP
@ OB_HIDE_SELECT
@ OB_HIDE_GLOSSY
@ OB_HIDE_SHADOW
@ OB_SHADOW_CATCHER
@ OB_HIDE_VIEWPORT
@ OB_HIDE_DIFFUSE
@ OB_HIDE_VOLUME_SCATTER
@ OB_DRAWNAME
@ OB_DRAWBOUNDOX
@ OB_DRAW_ALL_EDGES
@ OB_AXIS
@ OB_USE_GPENCIL_LIGHTS
@ OB_DRAW_NO_SHADOW_CAST
@ OB_DRAW_IN_FRONT
@ OB_TEXSPACE
@ OB_DRAWWIRE
@ OB_DRAWTRANSP
@ OB_SHAPE_EDIT_MODE
@ OB_SHAPE_LOCK
ObjectModifierFlag
@ OB_MODIFIER_FLAG_ADD_REST_POSITION
@ DG_LOCK_WEIGHT
@ OB_EMPTY_CONE
@ OB_SINGLE_ARROW
@ OB_PLAINAXES
@ OB_ARROWS
@ OB_CIRCLE
@ OB_CUBE
@ OB_EMPTY_IMAGE
@ OB_EMPTY_SPHERE
eObjectLineArt_Flags
@ OBJECT_LRT_OWN_INTERSECTION_PRIORITY
@ OBJECT_LRT_OWN_CREASE
@ OB_SPEAKER
@ OB_LATTICE
@ OB_MBALL
@ OB_EMPTY
@ OB_SURF
@ OB_CAMERA
@ OB_FONT
@ OB_GREASE_PENCIL
@ OB_TYPE_MAX
@ OB_ARMATURE
@ OB_LAMP
@ OB_MESH
@ OB_POINTCLOUD
@ OB_VOLUME
@ OB_CURVES_LEGACY
@ OB_GPENCIL_LEGACY
@ OB_CURVES
@ OB_LIGHTPROBE
@ OB_ADS_COLLAPSED
@ OB_ADS_UNUSED_1
@ OB_ADS_UNUSED_2
struct ObjectRuntimeHandle ObjectRuntimeHandle
@ OB_FLAG_ACTIVE_CLIPBOARD
@ OB_FROMDUPLI
@ BA_WAS_SEL
@ OB_DONE
@ BA_TRANSFORM_CHILD
@ OB_FLAG_USE_SIMULATION_CACHE
@ BA_TRANSFORM_LOCKED_IN_PLACE
@ BA_TEMP_TAG
@ BA_TRANSFORM_PARENT
@ BA_SNAP_FIX_DEPS_FIASCO
@ OB_DUPLIFACES
@ OB_TRANSFLAG_UNUSED_7
@ OB_TRANSFORM_ADJUST_ROOT_PARENT_FOR_VIEW_LOCK
@ OB_DUPLI
@ OB_NO_CONSTRAINTS
@ OB_TRANSFLAG_UNUSED_1
@ OB_NEG_SCALE
@ OB_PARENT_USE_FINAL_INDICES
@ OB_DUPLIPARTS
@ OB_DUPLIVERTS
@ OB_TRANSFLAG_UNUSED_12
@ OB_TRANSFLAG_UNUSED_6
@ OB_TRANSFLAG_UNUSED_3
@ OB_DUPLICOLLECTION
@ OB_DUPLIROT
@ OB_DUPLIFACES_SCALE
struct Object Object
@ OB_EMPTY_IMAGE_DEPTH_DEFAULT
@ OB_EMPTY_IMAGE_DEPTH_FRONT
@ OB_EMPTY_IMAGE_DEPTH_BACK
@ OB_BOUND_CAPSULE
@ OB_BOUND_SPHERE
@ OB_BOUND_CONE
@ OB_BOUND_BOX
@ OB_BOUND_CYLINDER
eObjectLineArt_Usage
@ OBJECT_LRT_INCLUDE
@ OBJECT_LRT_NO_INTERSECTION
@ OBJECT_LRT_EXCLUDE
@ OBJECT_LRT_INHERIT
@ OBJECT_LRT_OCCLUSION_ONLY
@ OBJECT_LRT_INTERSECTION_ONLY
@ OBJECT_LRT_FORCE_INTERSECTION
@ OB_DUPLI_FLAG_VIEWPORT
@ OB_DUPLI_FLAG_RENDER
@ OB_LOCK_ROTZ
@ OB_LOCK_ROT4D
@ OB_LOCK_ROT
@ OB_LOCK_SCALEZ
@ OB_LOCK_ROTX
@ OB_LOCK_SCALEX
@ OB_LOCK_ROTW
@ OB_LOCK_LOCY
@ OB_LOCK_LOCZ
@ OB_LOCK_ROTY
@ OB_LOCK_SCALEY
@ OB_LOCK_LOC
@ OB_LOCK_LOCX
@ OB_LOCK_SCALE
@ OB_POSX
@ OB_NEGZ
@ OB_POSY
@ OB_NEGX
@ OB_POSZ
@ OB_NEGY
unsigned long long int uint64_t
static ulong * next
SymEdge< T > * prev(const SymEdge< T > *se)
MatBase< float, 4, 4 > float4x4
const char * name
__forceinline BoundBox()=default
float vec[8][3]
Definition DNA_ID.h:414
struct Collection * blocker_collection
LightLinkingRuntime runtime
struct Collection * receiver_collection
struct Object * parent
struct ObHook * prev
char name[64]
float mat[4][4]
float cent[3]
struct ObHook * next
float parentinv[4][4]
unsigned char intersection_priority
ListBase particlesystem
struct Object * track
short transflag
unsigned short col_group
ListBase constraints
struct Collection * instance_collection
char collision_boundtype
short base_flag
struct bPose * pose
struct Object *proxy DNA_DEPRECATED
struct LightProbeObjectCache * lightprobe_cache
ObjectRuntimeHandle * runtime
float drot[3]
ListBase modifiers
float dquat[4]
struct RigidBodyOb * rigidbody_object
float shadow_terminator_shading_offset
float constinv[4][4]
ListBase greasepencil_modifiers
struct PreviewImage * preview
struct Material ** mat
float loc[3]
char * matbits
struct PartDeflect * pd
float dloc[3]
float scale[3]
struct SoftBody * soft
float rot[3]
float parentinv[4][4]
char empty_drawtype
ListBase shader_fx
ImageUser * iuser
short visibility_flag
char _pad2[4]
unsigned short col_mask
char empty_image_flag
uint8_t modifier_flag
ObjectLineArt lineart
float drotAxis[3]
float empty_drawsize
float shadow_terminator_geometry_offset
bMotionPath * mpath
float quat[4]
LightLinking * light_linking
ListBase pc_ids
float rotAxis[3]
float drotAngle
float color[4]
struct AnimData * adt
float dscale[3]
float instance_faces_scale
short protectflag
char _pad3[1]
char empty_image_depth
struct Object * parent
short trackflag
char duplicator_visibility_flag
unsigned short base_local_view_bits
struct SculptSession * sculpt
struct RigidBodyCon * rigidbody_constraint
float shadow_terminator_normal_offset
struct LightgroupMembership * lightgroup
char parsubstr[64]
char empty_image_visibility_flag
bAnimVizSettings avs
float ima_ofs[2]
struct bDeformGroup * next
struct bDeformGroup * prev
uint8_t flag
Definition wm_window.cc:145