Blender V4.3
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
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 Ipo;
47struct Material;
48struct Object;
49struct PartDeflect;
50struct Path;
51struct RigidBodyOb;
52struct SculptSession;
53struct SoftBody;
54struct bGPdata;
55
57typedef struct bDeformGroup {
60 char name[64];
61 /* need this flag for locking weights */
62 char flag, _pad0[7];
64
65#ifdef DNA_DEPRECATED_ALLOW
66typedef struct bFaceMap {
67 struct bFaceMap *next, *prev;
69 char name[64];
70 char flag;
71 char _pad0[7];
72} bFaceMap;
73#endif
74
75#define MAX_VGROUP_NAME 64
76
78enum {
80};
81
103typedef struct BoundBox {
104 float vec[8][3];
106
107typedef struct ObjectLineArt {
108 short usage;
109 short flags;
110
113
115
116 char _pad[7];
118
132
137
138/* Evaluated light linking state needed for the render engines integration. */
139typedef struct LightLinkingRuntime {
140
141 /* For objects that emit light: a bitmask of light sets this emitter is part of for the light
142 * linking.
143 * A light set is a combination of emitters used by one or more receiver objects.
144 *
145 * If there is no light linking in the scene or if the emitter does not specify light linking all
146 * bits are set.
147 *
148 * NOTE: There can only be 64 light sets in a scene. */
150
151 /* For objects that emit light: a bitmask of light sets this emitter is part of for the shadow
152 * linking.
153 * A light set is a combination of emitters from which a blocked object does not cast a shadow.
154 *
155 * If there is no shadow linking in the scene or if the emitter does not specify shadow linking
156 * all bits are set.
157 *
158 * NOTE: There can only be 64 light sets in a scene. */
160
161 /* For receiver objects: the index of the light set from which this object receives light.
162 *
163 * If there is no light linking in the scene or the receiver is not linked to any light this is
164 * assigned zero. */
166
167 /* For blocker objects: the index of the light set from which this object casts shadow from.
168 *
169 * If there is no shadow in the scene or the blocker is not linked to any emitter this is
170 * assigned zero. */
172
175
176typedef struct LightLinking {
177 /* Collections which contains objects (possibly via nested collection indirection) which defines
178 * the light linking relation: such as whether objects are included or excluded from being lit by
179 * this emitter (receiver_collection), or whether they block light from this emitter
180 * (blocker_collection).
181 *
182 * If the collection is a null pointer then all objects from the current scene are receiving
183 * light from this emitter, and nothing is excluded from receiving the light and shadows.
184 *
185 * The emitter in this context is assumed to be either object of lamp type, or objects with
186 * surface which has emissive shader. */
189
192
193typedef struct Object {
195
196 ID id;
198 struct AnimData *adt;
204
205 struct SculptSession *sculpt;
206
207 short type; /* #ObjectType */
208 short partype;
212 char parsubstr[64];
213 struct Object *parent, *track;
214 /* Proxy pointer are deprecated, only kept for conversion to liboverrides. */
215 struct Object *proxy DNA_DEPRECATED;
216 struct Object *proxy_group DNA_DEPRECATED;
217 struct Object *proxy_from DNA_DEPRECATED;
219 struct Ipo *ipo DNA_DEPRECATED;
220 // struct Path *path;
221 struct bAction *action DNA_DEPRECATED; /* XXX deprecated... old animation system */
222 struct bAction *poselib DNA_DEPRECATED; /* Pre-Blender 3.0 pose library, deprecated in 3.5. */
224 struct bPose *pose;
226 void *data;
227
229 struct bGPdata *gpd
230 DNA_DEPRECATED; /* XXX deprecated... replaced by gpencil object, keep for readfile */
231
236 void *_pad0;
237
238 ListBase constraintChannels DNA_DEPRECATED; /* XXX deprecated... old animation system */
239 ListBase effect DNA_DEPRECATED; /* XXX deprecated... keep for readfile */
240 ListBase defbase DNA_DEPRECATED; /* Only for versioning, moved to object data. */
241 ListBase fmaps DNA_DEPRECATED; /* For versioning, moved to generic attributes. */
248
250 int mode;
252
253 /* materials */
255 struct Material **mat;
257 char *matbits;
262
263 /* rot en drot have to be together! (transform('r' en 's')) */
264 float loc[3], dloc[3];
266 float scale[3];
268 float dsize[3] DNA_DEPRECATED;
270 float dscale[3];
272 float rot[3], drot[3];
274 float quat[4], dquat[4];
276 float rotAxis[3], drotAxis[3];
280 float parentinv[4][4];
283 float constinv[4][4];
284
286 unsigned int lay DNA_DEPRECATED;
287
289 short flag;
291 short colbits DNA_DEPRECATED;
292
297 short nlaflag;
298
299 char _pad1;
301
302 /* Depsgraph */
306 unsigned short base_local_view_bits;
307
309 unsigned short col_group, col_mask;
310
312 short rotmode;
313
318
320 short dtx;
322 char dt;
327
329 short index;
331 unsigned short actdef DNA_DEPRECATED;
333 char _pad2[4];
335 float color[4];
336
338 short softflag;
339
342
344 short shapenr;
347
348 char _pad3[1];
349
352 ListBase nlastrips DNA_DEPRECATED; /* XXX deprecated... old animation system */
353 ListBase hooks DNA_DEPRECATED; /* XXX deprecated... old animation system */
356
360 struct SoftBody *soft;
363
365 struct FluidsimSettings *fluidsimSettings
366 DNA_DEPRECATED; /* XXX deprecated... replaced by mantaflow, keep for readfile */
367
369
374
376 float ima_ofs[2];
382
385 char _pad8[4];
386
388
390
393
396
399
401
402#ifdef __cplusplus
403 const blender::float4x4 &object_to_world() const;
404 const blender::float4x4 &world_to_object() const;
405#endif
407
409typedef struct ObHook {
410 struct ObHook *next, *prev;
411
412 struct Object *parent;
414 float parentinv[4][4];
416 float mat[4][4];
418 float cent[3];
420 float falloff;
421
423 char name[64];
424
429 short type, active;
430 float force;
432
433/* **************** OBJECT ********************* */
434
442#define SELECT 1
443
445typedef enum ObjectType {
453
456
459
461
463
465
467
469
471
473
474 /* Keep last. */
477
478/* check if the object type supports materials */
479#define OB_TYPE_SUPPORT_MATERIAL(_type) \
480 (((_type) >= OB_MESH && (_type) <= OB_MBALL) || \
481 ((_type) >= OB_GPENCIL_LEGACY && (_type) <= OB_GREASE_PENCIL))
486#define OB_TYPE_IS_GEOMETRY(_type) \
487 (ELEM(_type, \
488 OB_MESH, \
489 OB_SURF, \
490 OB_FONT, \
491 OB_MBALL, \
492 OB_GPENCIL_LEGACY, \
493 OB_CURVES_LEGACY, \
494 OB_CURVES, \
495 OB_POINTCLOUD, \
496 OB_VOLUME, \
497 OB_GREASE_PENCIL))
498#define OB_TYPE_SUPPORT_VGROUP(_type) \
499 (ELEM(_type, OB_MESH, OB_LATTICE, OB_GPENCIL_LEGACY, OB_GREASE_PENCIL))
500#define OB_TYPE_SUPPORT_EDITMODE(_type) \
501 (ELEM(_type, \
502 OB_MESH, \
503 OB_FONT, \
504 OB_CURVES_LEGACY, \
505 OB_SURF, \
506 OB_MBALL, \
507 OB_LATTICE, \
508 OB_ARMATURE, \
509 OB_CURVES, \
510 OB_POINTCLOUD, \
511 OB_GREASE_PENCIL))
512#define OB_TYPE_SUPPORT_PARVERT(_type) \
513 (ELEM(_type, OB_MESH, OB_SURF, OB_CURVES_LEGACY, OB_LATTICE))
514
516#define OB_DATA_SUPPORT_EDITMODE(_type) \
517 (ELEM(_type, ID_ME, ID_CU_LEGACY, ID_MB, ID_LT, ID_AR, ID_CV, ID_GP))
518
519/* is this ID type used as object data */
520#define OB_DATA_SUPPORT_ID(_id_type) \
521 (ELEM(_id_type, \
522 ID_ME, \
523 ID_CU_LEGACY, \
524 ID_MB, \
525 ID_LA, \
526 ID_SPK, \
527 ID_LP, \
528 ID_CA, \
529 ID_LT, \
530 ID_GD_LEGACY, \
531 ID_AR, \
532 ID_CV, \
533 ID_PT, \
534 ID_VO, \
535 ID_GP))
536
537#define OB_DATA_SUPPORT_ID_CASE \
538 ID_ME: \
539 case ID_CU_LEGACY: \
540 case ID_MB: \
541 case ID_LA: \
542 case ID_SPK: \
543 case ID_LP: \
544 case ID_CA: \
545 case ID_LT: \
546 case ID_GD_LEGACY: \
547 case ID_AR: \
548 case ID_CV: \
549 case ID_PT: \
550 case ID_VO: \
551 case ID_GP
552
554enum {
555 PARTYPE = (1 << 4) - 1,
561
562};
563
565enum {
567 OB_TRANSFLAG_UNUSED_1 = 1 << 1, /* cleared */
568 OB_NEG_SCALE = 1 << 2,
569 OB_TRANSFLAG_UNUSED_3 = 1 << 3, /* cleared */
571 OB_DUPLIROT = 1 << 5,
572 OB_TRANSFLAG_UNUSED_6 = 1 << 6, /* cleared */
573 /* runtime, calculate derivedmesh for dupli before it's used */
574 OB_TRANSFLAG_UNUSED_7 = 1 << 7, /* dirty */
578 OB_DUPLIPARTS = 1 << 11,
579 OB_TRANSFLAG_UNUSED_12 = 1 << 12, /* cleared */
580 /* runtime constraints disable */
582
584};
585
587enum {
594};
595
597enum {
599 OB_AXIS = 1 << 1,
600 OB_TEXSPACE = 1 << 2,
601 OB_DRAWNAME = 1 << 3,
602 /* OB_DRAWIMAGE = 1 << 4, */ /* UNUSED */
603 /* for solid+wire display */
604 OB_DRAWWIRE = 1 << 5,
605 /* For overdrawing. */
607 /* Enable transparent draw. */
609 OB_DRAW_ALL_EDGES = 1 << 8, /* only for meshes currently */
611 /* Enable lights for grease pencil. */
613};
614
616enum {
625};
626
631enum {
638};
639
641enum {
646 // OB_BOUND_TRIANGLE_MESH = 4, /* UNUSED */
647 // OB_BOUND_CONVEX_HULL = 5, /* UNUSED */
648 // OB_BOUND_DYN_MESH = 6, /* UNUSED */
650};
651
652/* **************** BASE ********************* */
653
655enum {
656 BA_WAS_SEL = (1 << 1),
657 /* NOTE: BA_HAS_RECALC_DATA can be re-used later if freed in `readfile.cc`. */
658 // BA_HAS_RECALC_OB = 1 << 2, /* DEPRECATED */
659 // BA_HAS_RECALC_DATA = 1 << 3, /* DEPRECATED */
662
664 BA_TEMP_TAG = 1 << 5,
670
675
676 OB_FROMDUPLI = 1 << 9,
678 OB_DONE = 1 << 10,
680#ifdef DNA_DEPRECATED_ALLOW
681 OB_FLAG_UNUSED_12 = 1 << 12, /* cleared */
682#endif
683};
684
686enum {
696 OB_HOLDOUT = 1 << 9,
701};
702
704enum {
706#ifdef DNA_DEPRECATED_ALLOW
707 OB_SHAPE_FLAG_UNUSED_1 = 1 << 1, /* cleared */
708#endif
710};
711
713enum {
714 OB_ADS_UNUSED_1 = 1 << 0, /* cleared */
715 OB_ADS_UNUSED_2 = 1 << 1, /* cleared */
716 /* object-channel expanded status */
718 /* object's ipo-block */
719 /* OB_ADS_SHOWIPO = 1 << 11, */ /* UNUSED */
720 /* object's constraint channels */
721 /* OB_ADS_SHOWCONS = 1 << 12, */ /* UNUSED */
722 /* object's material channels */
723 /* OB_ADS_SHOWMATS = 1 << 13, */ /* UNUSED */
724 /* object's particle channels */
725 /* OB_ADS_SHOWPARTS = 1 << 14, */ /* UNUSED */
726};
727
729enum {
730 OB_LOCK_LOCX = 1 << 0,
731 OB_LOCK_LOCY = 1 << 1,
732 OB_LOCK_LOCZ = 1 << 2,
734 OB_LOCK_ROTX = 1 << 3,
735 OB_LOCK_ROTY = 1 << 4,
736 OB_LOCK_ROTZ = 1 << 5,
742 OB_LOCK_ROTW = 1 << 9,
743 OB_LOCK_ROT4D = 1 << 10,
744};
745
747enum {
750};
751
753enum {
757};
758
760enum {
766};
767
769enum {
771};
772
776
777#define MAX_DUPLI_RECUR 8
#define ENUM_OPERATORS(_type, _max)
ID and Library types, which are fundamental for SDNA.
enum eAnimEdit_AutoSnap DNA_DEPRECATED
#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.
struct ObHook ObHook
struct LightLinking LightLinking
struct ObjectLineArt ObjectLineArt
@ OB_HIDE_TRANSMISSION
@ 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_ADS_COLLAPSED
@ OB_ADS_UNUSED_1
@ OB_ADS_UNUSED_2
ObjectModifierFlag
@ OB_MODIFIER_FLAG_ADD_REST_POSITION
@ 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
@ PARVERT1
@ PARSKEL
@ PAROBJECT
@ PARTYPE
@ PARVERT3
@ PARBONE
@ OB_SHAPE_EDIT_MODE
@ OB_SHAPE_LOCK
struct LightLinkingRuntime LightLinkingRuntime
@ 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
@ GREASE_PENCIL_LINEART_SCENE
@ GP_STROKE
@ GREASE_PENCIL_LINEART_COLLECTION
@ GREASE_PENCIL_LINEART_OBJECT
@ GP_MONKEY
@ GP_EMPTY
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_EMPTY_IMAGE_DEPTH_DEFAULT
@ OB_EMPTY_IMAGE_DEPTH_FRONT
@ OB_EMPTY_IMAGE_DEPTH_BACK
struct bDeformGroup bDeformGroup
@ 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
struct ObjectRuntimeHandle ObjectRuntimeHandle
struct BoundBox BoundBox
@ OB_DUPLI_FLAG_VIEWPORT
@ OB_DUPLI_FLAG_RENDER
@ 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_DUPLIPARTS
@ OB_DUPLIVERTS
@ OB_TRANSFLAG_UNUSED_12
@ OB_TRANSFLAG_UNUSED_6
@ OB_TRANSFLAG_UNUSED_3
@ OB_DUPLICOLLECTION
@ OB_DUPLIROT
@ OB_DUPLIFACES_SCALE
@ OB_POSX
@ OB_NEGZ
@ OB_POSY
@ OB_NEGX
@ OB_POSZ
@ OB_NEGY
struct Object Object
@ OB_EMPTY_CONE
@ OB_SINGLE_ARROW
@ OB_PLAINAXES
@ OB_ARROWS
@ OB_CIRCLE
@ OB_CUBE
@ OB_EMPTY_IMAGE
@ OB_EMPTY_SPHERE
@ 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
@ DG_LOCK_WEIGHT
@ 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
@ OB_EMPTY_IMAGE_USE_ALPHA_BLEND
static ulong * next
SymEdge< T > * prev(const SymEdge< T > *se)
unsigned char uint8_t
Definition stdint.h:78
unsigned __int64 uint64_t
Definition stdint.h:90
float vec[8][3]
Definition DNA_ID.h:413
struct Collection * blocker_collection
LightLinkingRuntime runtime
struct Collection * receiver_collection
struct Object * parent
struct ObHook * prev
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 LightProbeObjectCache * lightprobe_cache
ObjectRuntimeHandle * runtime
float drot[3]
ListBase modifiers
float dquat[4]
struct RigidBodyOb * rigidbody_object
float constinv[4][4]
ListBase greasepencil_modifiers
struct PreviewImage * preview
struct Material ** mat
float loc[3]
char * matbits
struct PartDeflect * pd
float dloc[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
char _pad8[4]
bMotionPath * mpath
float quat[4]
LightLinking * light_linking
ListBase pc_ids
float rotAxis[3]
float drotAngle
struct AnimData * adt
float dscale[3]
float instance_faces_scale
short protectflag
char _pad3[1]
char empty_image_depth
struct DrawDataList drawdata
struct Object * parent
short trackflag
char duplicator_visibility_flag
unsigned short base_local_view_bits
struct RigidBodyCon * rigidbody_constraint
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:138