Blender V5.0
BKE_duplilist.hh
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
5#pragma once
6
10
11#include "BLI_vector_list.hh"
12
13#include "BKE_geometry_set.hh"
14#include "BKE_instances.hh"
15
16struct Depsgraph;
17struct ID;
18struct ListBase;
19struct Object;
20struct ParticleSystem;
21struct Scene;
22struct ViewLayer;
23struct ViewerPath;
24
25/* ---------------------------------------------------- */
26/* Dupli-Geometry */
27
28constexpr int MAX_DUPLI_RECUR = 8;
29
31 /* Object whose geometry is instanced. */
33 /* Data owned by the object above that is instanced. This might not be the same as `ob->data`. */
35 float mat[4][4];
36 float orco[3], uv[2];
37
38 short type; /* From #Object::transflag. */
39 char no_draw;
41 int8_t level;
42 /* If this dupli object is belongs to a preview, this is non-null. */
44 /* Index of the top-level instance this dupli is part of or -1 when unused. */
46
47 /* Persistent identifier for a dupli object, for inter-frame matching of
48 * objects with motion blur, or inter-update matching for syncing. */
50
51 /* Random ID for shading */
52 unsigned int random_id;
53
54 /* Particle this dupli was generated from. */
56
57 /* Geometry set stack for instance attributes; for each level lists the
58 * geometry set and instance index within it.
59 *
60 * Only non-null entries are stored, ordered from innermost to outermost.
61 * To save memory, these arrays are allocated smaller than persistent_id,
62 * assuming that not every entry will be associated with a GeometrySet; any
63 * size between 1 and MAX_DUPLI_RECUR can be used without issues.
64 */
67};
68
70
74void object_duplilist(Depsgraph *depsgraph,
75 Scene *sce,
76 Object *ob,
77 blender::Set<const Object *> *include_objects,
78 DupliList &r_duplilist);
83 Scene *scene,
84 Object *ob,
85 const ViewerPath *viewer_path,
86 DupliList &r_duplilist);
87
101 Scene &scene,
102 Object &ob);
103
109 const DupliObject *dupli,
110 const Object *dupli_parent,
111 const char *name,
112 float r_value[4]);
113
119 const ViewLayer *layer,
120 const char *name,
121 float r_value[4]);
void object_duplilist_preview(Depsgraph *depsgraph, Scene *scene, Object *ob, const ViewerPath *viewer_path, DupliList &r_duplilist)
bool BKE_object_dupli_find_rgba_attribute(const Object *ob, const DupliObject *dupli, const Object *dupli_parent, const char *name, float r_value[4])
blender::VectorList< DupliObject > DupliList
constexpr int MAX_DUPLI_RECUR
bool BKE_view_layer_find_rgba_attribute(const Scene *scene, const ViewLayer *layer, const char *name, float r_value[4])
void object_duplilist(Depsgraph *depsgraph, Scene *sce, Object *ob, blender::Set< const Object * > *include_objects, DupliList &r_duplilist)
blender::bke::Instances object_duplilist_legacy_instances(Depsgraph &depsgraph, Scene &scene, Object &ob)
BPy_StructRNA * depsgraph
const char * name
const blender::bke::GeometrySet * preview_base_geometry
int preview_instance_index
float mat[4][4]
int instance_idx[4]
const blender::bke::GeometrySet * instance_data[4]
ParticleSystem * particle_system
int persistent_id[MAX_DUPLI_RECUR]
float orco[3]
unsigned int random_id
Definition DNA_ID.h:414