12#define DNA_DEPRECATED_ALLOW
45#undef INVALIDATE_WORK_DATA
48# define INVALIDATE_WORK_DATA
59#ifdef INVALIDATE_WORK_DATA
61 memset((
void *)&data->temp_dupli_object, 0xff,
sizeof(data->temp_dupli_object));
67void ensure_id_properties_freed(
const Object *dupli_object,
Object *temp_dupli_object)
84 if (data->dupli_object_current ==
nullptr) {
89 const Object *dupli_object = data->dupli_object_current->ob;
90 Object *temp_dupli_object = &data->temp_dupli_object;
92 ensure_id_properties_freed(dupli_object, temp_dupli_object);
108 if (!dob || !(dob->
type & hide_original_types)) {
120 data->dupli_parent = object;
121 data->dupli_list = duplis;
128 if (data->dupli_list ==
nullptr) {
132 while (data->dupli_object_next !=
nullptr) {
136 data->dupli_object_next = data->dupli_object_next->next;
144 if (obd->
type !=
OB_MBALL && deg_object_hide_original(data->eval_mode, dob->
ob, dob)) {
149 if (settings->included_objects) {
151 if (!settings->included_objects->contains(object_orig)) {
156 free_owned_memory(data);
158 data->dupli_object_current = dob;
161 Object *dupli_parent = data->dupli_parent;
162 Object *temp_dupli_object = &data->temp_dupli_object;
164 *temp_dupli_object = blender::dna::shallow_copy(*dob->
ob);
165 temp_dupli_object->
runtime = &data->temp_dupli_object_runtime;
170 temp_dupli_object->
runtime->local_collections_bits =
171 dupli_parent->
runtime->local_collections_bits;
172 temp_dupli_object->
dt = std::min(temp_dupli_object->
dt, dupli_parent->
dt);
174 temp_dupli_object->
runtime->select_id = dupli_parent->
runtime->select_id;
192 copy_m4_m4(data->temp_dupli_object.runtime->object_to_world.ptr(), dob->
mat);
193 invert_m4_m4(data->temp_dupli_object.runtime->world_to_object.ptr(),
194 data->temp_dupli_object.object_to_world().ptr());
195 data->next_object = &data->temp_dupli_object;
200 free_owned_memory(data);
202 data->dupli_parent =
nullptr;
203 data->dupli_list =
nullptr;
204 data->dupli_object_next =
nullptr;
205 data->dupli_object_current =
nullptr;
206 deg_invalidate_iterator_work_data(data);
215 for (; data->id_node_index < data->num_id_nodes; data->id_node_index++) {
226 if (id_type !=
ID_OB) {
252 if (settings->included_objects) {
253 if (!settings->included_objects->contains(object_orig)) {
266 object->runtime->select_id = object_orig->
runtime->select_id;
268 const bool use_preview = object_orig == data->object_orig_with_preview;
271 data->graph, data->scene,
object, data->settings->viewer_path);
272 deg_iterator_duplis_init(data,
object, preview_duplis);
273 data->id_node_index++;
281 if (object->type !=
OB_MBALL && deg_object_hide_original(data->eval_mode,
object,
nullptr)) {
288 ((object->transflag &
OB_DUPLI) || object->runtime->geometry_set_eval !=
nullptr))
292 deg_iterator_duplis_init(data,
object, duplis);
298 data->next_object = object;
300 data->id_node_index++;
310 if (
this != &other) {
312 this->graph = other.graph;
314 this->scene = other.scene;
341 if (id_elem->
id ==
nullptr) {
360 return reinterpret_cast<Object *
>(id_elem->
id);
371 if (num_id_nodes == 0) {
376 data->next_object =
nullptr;
377 data->dupli_parent =
nullptr;
378 data->dupli_list =
nullptr;
379 data->dupli_object_next =
nullptr;
380 data->dupli_object_current =
nullptr;
382 data->id_node_index = 0;
383 data->num_id_nodes = num_id_nodes;
385 deg_invalidate_iterator_work_data(data);
388 const ViewerPath *viewer_path = data->settings->viewer_path;
389 if (viewer_path !=
nullptr) {
400 if (data->next_object !=
nullptr) {
401 iter->
current = data->next_object;
402 data->next_object =
nullptr;
405 if (deg_iterator_duplis_step(data)) {
408 if (deg_iterator_objects_step(data)) {
419 if (data !=
nullptr) {
422 deg_invalidate_iterator_work_data(data);
437 if (!only_updated && !
id_node->is_visible_on_build) {
445 if (ntree ==
nullptr) {
472 data->id_node_index = 0;
473 data->num_id_nodes = num_id_nodes;
492 ++data->id_node_index;
493 if (data->id_node_index == data->num_id_nodes) {
500 }
while (iter->
skip);
ListBase * object_duplilist(Depsgraph *depsgraph, Scene *sce, Object *ob)
void free_object_duplilist(ListBase *lb)
ListBase * object_duplilist_preview(Depsgraph *depsgraph, Scene *scene, Object *ob, const ViewerPath *viewer_path)
void IDP_FreeProperty(IDProperty *prop)
ModifierData * BKE_modifiers_findby_name(const Object *ob, const char *name)
General operations, lookup, etc. for blender objects.
void BKE_object_replace_data_on_shallow_copy(Object *ob, ID *new_data)
int BKE_object_visibility(const Object *ob, int dag_eval_mode)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void copy_m4_m4(float m1[4][4], const float m2[4][4])
bool is_negative_m4(const float mat[4][4])
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
MINLINE void copy_v4_v4(float r[4], const float a[4])
#define SET_FLAG_FROM_TEST(value, test, flag)
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
eEvaluationMode DEG_get_mode(const Depsgraph *graph)
bool DEG_id_type_any_updated(const Depsgraph *depsgraph)
Object * DEG_get_original_object(Object *object)
@ DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY
@ DEG_ITER_OBJECT_FLAG_VISIBLE
@ DEG_ITER_OBJECT_FLAG_DUPLI
@ DEG_ITER_OBJECT_FLAG_LINKED_INDIRECTLY
@ DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET
@ BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT
Object is a sort of wrapper for general info.
@ VIEWER_PATH_ELEM_TYPE_MODIFIER
@ VIEWER_PATH_ELEM_TYPE_ID
Read Guarded memory(de)allocation.
const Depsgraph * depsgraph
void DEG_iterator_ids_begin(BLI_Iterator *iter, DEGIDIterData *data)
void DEG_iterator_objects_begin(BLI_Iterator *iter, DEGObjectIterData *data)
void DEG_iterator_objects_end(BLI_Iterator *iter)
void DEG_iterator_ids_end(BLI_Iterator *)
void DEG_iterator_objects_next(BLI_Iterator *iter)
static Object * find_object_with_preview_geometry(const ViewerPath &viewer_path)
void DEG_iterator_ids_next(BLI_Iterator *iter)
static void DEG_iterator_ids_step(BLI_Iterator *iter, deg::IDNode *id_node, bool only_updated)
bNodeTree * node_tree_from_id(ID *id)
bool deg_eval_copy_is_expanded(const ID *id_cow)
bool deg_validate_eval_copy_datablock(ID *id_cow)
@ DEG_ID_LINKED_INDIRECTLY
DEGObjectIterSettings * settings
eEvaluationMode eval_mode
DEGObjectIterData & operator=(const DEGObjectIterData &other)
DupliObject * dupli_object_next
DupliObject * dupli_object_current
blender::bke::ObjectRuntime temp_dupli_object_runtime
Object * object_orig_with_preview
ObjectRuntimeHandle * runtime
unsigned short base_local_view_bits
struct ViewerPathElem * next
eDepsNode_LinkedState_Type linked_state