Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/layer.c
| Show All 20 Lines | |||||
| */ | */ | ||||
| /** \file blender/blenkernel/intern/layer.c | /** \file blender/blenkernel/intern/layer.c | ||||
| * \ingroup bke | * \ingroup bke | ||||
| */ | */ | ||||
| #include <string.h> | #include <string.h> | ||||
| #include "BLI_array.h" | |||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BLI_string_utf8.h" | #include "BLI_string_utf8.h" | ||||
| #include "BLI_string_utils.h" | #include "BLI_string_utils.h" | ||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
| #include "BKE_collection.h" | #include "BKE_collection.h" | ||||
| #include "BKE_freestyle.h" | #include "BKE_freestyle.h" | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BKE_group.h" | #include "BKE_group.h" | ||||
| #include "BKE_idprop.h" | #include "BKE_idprop.h" | ||||
| #include "BKE_layer.h" | #include "BKE_layer.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "BKE_workspace.h" | #include "BKE_workspace.h" | ||||
| #include "BKE_object.h" | |||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "DNA_group_types.h" | #include "DNA_group_types.h" | ||||
| #include "DNA_ID.h" | #include "DNA_ID.h" | ||||
| #include "DNA_layer_types.h" | #include "DNA_layer_types.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_node_types.h" | #include "DNA_node_types.h" | ||||
| ▲ Show 20 Lines • Show All 2,178 Lines • ▼ Show 20 Lines | void BKE_renderable_objects_iterator_next(BLI_Iterator *iter) | ||||
| iter->valid = false; | iter->valid = false; | ||||
| } | } | ||||
| void BKE_renderable_objects_iterator_end(BLI_Iterator *UNUSED(iter)) | void BKE_renderable_objects_iterator_end(BLI_Iterator *UNUSED(iter)) | ||||
| { | { | ||||
| /* Do nothing - iter->data was static allocated, we can't free it. */ | /* Do nothing - iter->data was static allocated, we can't free it. */ | ||||
| } | } | ||||
| /* --- */ | |||||
| void BKE_view_layer_objects_in_mode_iterator_begin(BLI_Iterator *iter, void *data_in) | |||||
| { | |||||
| struct ObjectsInModeIteratorData *data = data_in; | |||||
| Base *base = data->base_active; | |||||
| /* when there are no objects */ | |||||
| if (base == NULL) { | |||||
| iter->valid = false; | |||||
| return; | |||||
| } | |||||
| iter->data = data_in; | |||||
| iter->current = base; | |||||
| } | |||||
| void BKE_view_layer_objects_in_mode_iterator_next(BLI_Iterator *iter) | |||||
| { | |||||
| struct ObjectsInModeIteratorData *data = iter->data; | |||||
| Base *base = iter->current; | |||||
| if (base == data->base_active) { | |||||
| /* first step */ | |||||
| base = data->view_layer->object_bases.first; | |||||
| if (base == data->base_active) { | |||||
| base = base->next; | |||||
| } | |||||
| } | |||||
| else { | |||||
| base = base->next; | |||||
| } | |||||
| while (base) { | |||||
| if ((base->flag & BASE_SELECTED) != 0 && | |||||
| (base->object->type == data->base_active->object->type) && | |||||
| (base != data->base_active) && | |||||
| (BKE_object_has_mode_data(base->object, data->object_mode) == true)) | |||||
| { | |||||
| iter->current = base; | |||||
| return; | |||||
| } | |||||
| base = base->next; | |||||
| } | |||||
| iter->valid = false; | |||||
| } | |||||
| void BKE_view_layer_objects_in_mode_iterator_end(BLI_Iterator *UNUSED(iter)) | |||||
| { | |||||
| /* do nothing */ | |||||
| } | |||||
| /* --- */ | |||||
| /* Evaluation */ | /* Evaluation */ | ||||
| /** | /** | ||||
| * Reset props | * Reset props | ||||
| * | * | ||||
| * If props_ref is pasted, copy props from it | * If props_ref is pasted, copy props from it | ||||
| */ | */ | ||||
| static void idproperty_reset(IDProperty **props, IDProperty *props_ref) | static void idproperty_reset(IDProperty **props, IDProperty *props_ref) | ||||
| ▲ Show 20 Lines • Show All 182 Lines • Show Last 20 Lines | |||||