Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_layer.h
| Show All 25 Lines | |||||
| /** \file blender/blenkernel/BKE_layer.h | /** \file blender/blenkernel/BKE_layer.h | ||||
| * \ingroup bke | * \ingroup bke | ||||
| */ | */ | ||||
| #include "BKE_collection.h" | #include "BKE_collection.h" | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| extern "C" { | extern "C" { | ||||
| #endif | #endif | ||||
sergey: What's this?
Also, consider using anonymous enum instead of defines. | |||||
Not Done Inline ActionsI didn't finish the "syncronization" of the collection trees for all instances. So this is a way for me to track down the known TODOs. Example of uncovered cases:
That's without even getting started on the filter functionality (to add objects to a collection based on their names and a filter). dfelinto: I didn't finish the "syncronization" of the collection trees for all instances. So this is a… | |||||
| #define TODO_LAYER_SYNC /* syncing of SceneCollection and LayerCollection trees*/ | #define TODO_LAYER_SYNC /* syncing of SceneCollection and LayerCollection trees*/ | ||||
| #define TODO_LAYER_SYNC_FILTER /* syncing of filter_objects across all trees */ | #define TODO_LAYER_SYNC_FILTER /* syncing of filter_objects across all trees */ | ||||
| #define TODO_LAYER_OVERRIDE /* CollectionOverride */ | #define TODO_LAYER_OVERRIDE /* CollectionOverride */ | ||||
| #define TODO_LAYER_CONTEXT /* get/set current (context) SceneLayer */ | #define TODO_LAYER_CONTEXT /* get/set current (context) SceneLayer */ | ||||
| #define TODO_LAYER_BASE /* Base to ObjectBase related TODO */ | |||||
| #define TODO_LAYER /* generic todo */ | #define TODO_LAYER /* generic todo */ | ||||
| struct LayerCollection; | struct LayerCollection; | ||||
| struct ID; | struct ID; | ||||
| struct Main; | struct Main; | ||||
| struct Object; | struct Object; | ||||
| struct ObjectBase; | struct ObjectBase; | ||||
| struct Scene; | struct Scene; | ||||
| struct SceneCollection; | struct SceneCollection; | ||||
| struct SceneLayer; | struct SceneLayer; | ||||
| struct SceneLayer *BKE_scene_layer_add(struct Scene *scene, const char *name); | struct SceneLayer *BKE_scene_layer_add(struct Scene *scene, const char *name); | ||||
| bool BKE_scene_layer_remove(struct Main *bmain, struct Scene *scene, struct SceneLayer *sl); | bool BKE_scene_layer_remove(struct Main *bmain, struct Scene *scene, struct SceneLayer *sl); | ||||
| void BKE_scene_layer_free(struct SceneLayer *sl); | void BKE_scene_layer_free(struct SceneLayer *sl); | ||||
| void BKE_scene_layer_engine_set(struct SceneLayer *sl, const char *engine); | void BKE_scene_layer_engine_set(struct SceneLayer *sl, const char *engine); | ||||
| void BKE_scene_layer_selected_objects_tag(struct SceneLayer *sl, const int tag); | void BKE_scene_layer_selected_objects_tag(struct SceneLayer *sl, const int tag); | ||||
| struct ObjectBase *BKE_scene_layer_base_find(struct SceneLayer *sl, struct Object *ob); | struct ObjectBase *BKE_scene_layer_base_find(struct SceneLayer *sl, struct Object *ob); | ||||
| void BKE_scene_layer_base_deselect_all(struct SceneLayer *sl); | |||||
| void BKE_scene_layer_base_select(struct SceneLayer *sl, struct ObjectBase *selbase); | |||||
| void BKE_layer_collection_free(struct SceneLayer *sl, struct LayerCollection *lc); | void BKE_layer_collection_free(struct SceneLayer *sl, struct LayerCollection *lc); | ||||
| struct LayerCollection *BKE_layer_collection_active(struct SceneLayer *sl); | struct LayerCollection *BKE_layer_collection_active(struct SceneLayer *sl); | ||||
| int BKE_layer_collection_count(struct SceneLayer *sl); | int BKE_layer_collection_count(struct SceneLayer *sl); | ||||
| int BKE_layer_collection_findindex(struct SceneLayer *sl, struct LayerCollection *lc); | int BKE_layer_collection_findindex(struct SceneLayer *sl, struct LayerCollection *lc); | ||||
| Show All 22 Lines | #define FOREACH_SELECTED_OBJECT(sl, _ob) \ | ||||
| ITER_BEGIN(BKE_selected_objects_Iterator_begin, \ | ITER_BEGIN(BKE_selected_objects_Iterator_begin, \ | ||||
| BKE_selected_objects_Iterator_next, \ | BKE_selected_objects_Iterator_next, \ | ||||
| BKE_selected_objects_Iterator_end, \ | BKE_selected_objects_Iterator_end, \ | ||||
| sl, _ob) | sl, _ob) | ||||
| #define FOREACH_SELECTED_OBJECT_END \ | #define FOREACH_SELECTED_OBJECT_END \ | ||||
| ITER_END | ITER_END | ||||
| #define FOREACH_OBJECT(sl, _ob) \ | |||||
| { \ | |||||
| ObjectBase *base; \ | |||||
| for (base = sl->object_bases.first; base; base = base->next) { \ | |||||
| _ob = base->object; | |||||
| #define FOREACH_OBJECT_END \ | |||||
| } \ | |||||
| } | |||||
| #define FOREACH_OBJECT_FLAG(scene, sl, flag, _ob) \ | #define FOREACH_OBJECT_FLAG(scene, sl, flag, _ob) \ | ||||
| { \ | { \ | ||||
| IteratorBeginCb func_begin; \ | IteratorBeginCb func_begin; \ | ||||
| IteratorCb func_next, func_end; \ | IteratorCb func_next, func_end; \ | ||||
| void *data_in; \ | void *data_in; \ | ||||
| \ | \ | ||||
| if (flag == SELECT) { \ | if (flag == SELECT) { \ | ||||
| func_begin = &BKE_selected_objects_Iterator_begin; \ | func_begin = &BKE_selected_objects_Iterator_begin; \ | ||||
| Show All 22 Lines | |||||
What's this?
Also, consider using anonymous enum instead of defines.