Blender V4.5
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 "BKE_geometry_set.hh"
12#include "BKE_instances.hh"
13
14struct Depsgraph;
15struct ID;
16struct ListBase;
17struct Object;
18struct ParticleSystem;
19struct Scene;
20struct ViewLayer;
21struct ViewerPath;
22
23/* ---------------------------------------------------- */
24/* Dupli-Geometry */
25
30 Scene *sce,
31 Object *ob,
32 blender::Set<const Object *> *include_objects = nullptr);
37 Scene *scene,
38 Object *ob,
39 const ViewerPath *viewer_path);
41
55 Scene &scene,
56 Object &ob);
57
58constexpr int MAX_DUPLI_RECUR = 8;
59
62 /* Object whose geometry is instanced. */
64 /* Data owned by the object above that is instanced. This might not be the same as `ob->data`. */
66 float mat[4][4];
67 float orco[3], uv[2];
68
69 short type; /* From #Object::transflag. */
70 char no_draw;
72 int8_t level;
73 /* If this dupli object is belongs to a preview, this is non-null. */
75 /* Index of the top-level instance this dupli is part of or -1 when unused. */
77
78 /* Persistent identifier for a dupli object, for inter-frame matching of
79 * objects with motion blur, or inter-update matching for syncing. */
81
82 /* Particle this dupli was generated from. */
84
85 /* Geometry set stack for instance attributes; for each level lists the
86 * geometry set and instance index within it.
87 *
88 * Only non-null entries are stored, ordered from innermost to outermost.
89 * To save memory, these arrays are allocated smaller than persistent_id,
90 * assuming that not every entry will be associated with a GeometrySet; any
91 * size between 1 and MAX_DUPLI_RECUR can be used without issues.
92 */
95
96 /* Random ID for shading */
97 unsigned int random_id;
98};
99
105 const DupliObject *dupli,
106 const Object *dupli_parent,
107 const char *name,
108 float r_value[4]);
109
115 const ViewLayer *layer,
116 const char *name,
117 float r_value[4]);
bool BKE_object_dupli_find_rgba_attribute(const Object *ob, const DupliObject *dupli, const Object *dupli_parent, const char *name, float r_value[4])
constexpr int MAX_DUPLI_RECUR
void free_object_duplilist(ListBase *lb)
bool BKE_view_layer_find_rgba_attribute(const Scene *scene, const ViewLayer *layer, const char *name, float r_value[4])
ListBase * object_duplilist_preview(Depsgraph *depsgraph, Scene *scene, Object *ob, const ViewerPath *viewer_path)
ListBase * object_duplilist(Depsgraph *depsgraph, Scene *sce, Object *ob, blender::Set< const Object * > *include_objects=nullptr)
blender::bke::Instances object_duplilist_legacy_instances(Depsgraph &depsgraph, Scene &scene, Object &ob)
BPy_StructRNA * depsgraph
const blender::bke::GeometrySet * preview_base_geometry
int preview_instance_index
float mat[4][4]
int instance_idx[4]
DupliObject * prev
const blender::bke::GeometrySet * instance_data[4]
DupliObject * next
ParticleSystem * particle_system
int persistent_id[MAX_DUPLI_RECUR]
float orco[3]
unsigned int random_id
Definition DNA_ID.h:404