Blender
V3.3
|
#include <cmath>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_cachefile_types.h"
#include "DNA_camera_types.h"
#include "DNA_collection_types.h"
#include "DNA_constraint_types.h"
#include "DNA_curves_types.h"
#include "DNA_gpencil_modifier_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_key_types.h"
#include "DNA_light_types.h"
#include "DNA_lightprobe_types.h"
#include "DNA_linestyle_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meta_types.h"
#include "DNA_object_types.h"
#include "DNA_particle_types.h"
#include "DNA_pointcloud_types.h"
#include "DNA_scene_types.h"
#include "DNA_sequence_types.h"
#include "DNA_shader_fx_types.h"
#include "DNA_simulation_types.h"
#include "DNA_speaker_types.h"
#include "DNA_volume_types.h"
#include "DNA_world_types.h"
#include "BLI_blenlib.h"
#include "BLI_fnmatch.h"
#include "BLI_listbase.h"
#include "BLI_mempool.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "BKE_armature.h"
#include "BKE_deform.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_modifier.h"
#include "BKE_outliner_treehash.h"
#include "ED_screen.h"
#include "RNA_access.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "outliner_intern.hh"
#include "tree/common.hh"
#include "tree/tree_display.hh"
#include "tree/tree_element.hh"
Go to the source code of this file.
Classes | |
struct | tTreeSort |
struct | OutlinerTreeElementFocus |
Namespaces | |
blender | |
blender::ed | |
blender::ed::outliner | |
|
static |
Definition at line 145 of file outliner_tree.cc.
References BKE_outliner_treehash_add_element(), BKE_outliner_treehash_create_from_treestore(), BKE_outliner_treehash_lookup_unused(), BLI_mempool_alloc(), BLI_MEMPOOL_ALLOW_ITER, BLI_mempool_create(), TreeStoreElem::flag, id, TreeStoreElem::id, TreeStoreElem::nr, SpaceOutliner::runtime, TreeElement::store_elem, SpaceOutliner_Runtime::treehash, SpaceOutliner::treestore, TSE_CLOSED, type, TreeStoreElem::type, and TreeStoreElem::used.
Referenced by blender::ed::outliner::outliner_add_element().
|
static |
Definition at line 225 of file outliner_tree.cc.
References Freestyle::a, Bone::childbase, TreeElement::directdata, LISTBASE_FOREACH, TreeElement::name, Bone::name, blender::ed::outliner::outliner_add_element(), TreeElement::subtree, and TSE_BONE.
Referenced by outliner_add_id_contents().
BLI_INLINE void outliner_add_collection_init | ( | TreeElement * | te, |
Collection * | collection | ||
) |
Definition at line 935 of file outliner_tree.cc.
References BKE_collection_ui_name_get(), TreeElement::directdata, and TreeElement::name.
Referenced by outliner_add_collection_recursive().
BLI_INLINE void outliner_add_collection_objects | ( | SpaceOutliner * | space_outliner, |
ListBase * | tree, | ||
Collection * | collection, | ||
TreeElement * | parent | ||
) |
Definition at line 941 of file outliner_tree.cc.
References Collection::gobject, LISTBASE_FOREACH, blender::ed::outliner::outliner_add_element(), tree, and TSE_SOME_ID.
Referenced by outliner_add_collection_recursive().
TreeElement* outliner_add_collection_recursive | ( | SpaceOutliner * | space_outliner, |
Collection * | collection, | ||
TreeElement * | ten | ||
) |
Definition at line 951 of file outliner_tree.cc.
References Collection::children, LISTBASE_FOREACH, outliner_add_collection_init(), outliner_add_collection_objects(), blender::ed::outliner::outliner_add_element(), SpaceOutliner::outlinevis, SO_SCENES, TreeElement::subtree, and TSE_SOME_ID.
Referenced by blender::ed::outliner::TreeElementCollectionBase::expand(), and outliner_add_id_contents().
|
static |
Definition at line 546 of file outliner_tree.cc.
References Freestyle::a, bArmature::adt, CacheFile::adt, Camera::adt, Curve::adt, bGPdata::adt, Key::adt, Light::adt, LightProbe::adt, FreestyleLineStyle::adt, Material::adt, Mesh::adt, MetaBall::adt, PointCloud::adt, Simulation::adt, Speaker::adt, Tex::adt, Volume::adt, World::adt, BLI_addtail(), BLI_assert_msg, BLI_remlink(), bArmature::bonebase, curves, TreeElement::directdata, bArmature::edbo, ListBase::first, GS, id, TreeStoreElem::id, ID_AC, ID_AR, ID_CA, ID_CF, ID_CU_LEGACY, ID_CV, ID_GD, ID_GR, ID_KE, ID_LA, ID_LI, ID_LP, ID_LS, ID_MA, ID_MB, ID_ME, ID_OB, ID_PT, ID_SCE, ID_SIM, ID_SPK, ID_TE, ID_VO, ID_WO, TreeElement::idcode, if(), Tex::ima, Mesh::key, bGPdata::layers, linestyle, LISTBASE_FOREACH, LISTBASE_FOREACH_BACKWARD, LISTBASE_FOREACH_INDEX, Curve::mat, Mesh::mat, MetaBall::mat, MAX_MTEX, FreestyleLineStyle::mtex, TreeElement::name, ID::name, TreeElement::next, OB_MODE_POSE, outliner_add_bone(), outliner_add_collection_recursive(), blender::ed::outliner::outliner_add_element(), outliner_add_object_contents(), outliner_animdata_test(), EditBone::p, EditBone::parent, TreeElement::parent, simulation, TreeElement::subtree, EditBone::temp, tex, MTex::tex, Curve::totcol, Mesh::totcol, MetaBall::totcol, TREESTORE, TSE_ANIM_DATA, TSE_EBONE, TSE_GP_LAYER, TSE_IS_REAL_ID, and TSE_SOME_ID.
Referenced by blender::ed::outliner::outliner_add_element().
|
static |
Definition at line 276 of file outliner_tree.cc.
References Freestyle::a, Object::adt, bPose::agroups, BKE_object_defgroup_list(), BLI_addtail(), BLI_listbase_is_empty(), BLI_remlink(), bPose::chanbase, Object::constraints, Object::data, TreeElement::directdata, bArmature::edbo, eGpencilModifierType_Armature, eGpencilModifierType_Hook, eGpencilModifierType_Lattice, ELEM, eModifierType_Armature, eModifierType_Curve, eModifierType_Hook, eModifierType_Lattice, eModifierType_ParticleSystem, eShaderFxType_Swirl, ListBase::first, Object::greasepencil_modifiers, ParticleSettings::id, if(), IFACE_, Object::instance_collection, LISTBASE_FOREACH, LISTBASE_FOREACH_INDEX, Object::mat, Object::mode, Object::modifiers, TreeElement::name, ID::name, TreeElement::next, OB_DUPLICOLLECTION, OB_GPENCIL, OB_LATTICE, OB_MESH, OB_MODE_POSE, blender::ed::outliner::outliner_add_element(), outliner_animdata_test(), TreeElement::parent, bPoseChannel::parent, ParticleSystem::part, Object::pose, Object::poselib, Object::shader_fx, str, TreeElement::subtree, bPoseChannel::temp, Object::totcol, Object::transflag, TREESTORE, TSE_ANIM_DATA, TSE_CONSTRAINT, TSE_CONSTRAINT_BASE, TSE_DEFGROUP, TSE_DEFGROUP_BASE, TSE_GPENCIL_EFFECT, TSE_GPENCIL_EFFECT_BASE, TSE_LINKED_OB, TSE_LINKED_PSYS, TSE_MODIFIER, TSE_MODIFIER_BASE, TSE_POSE_BASE, TSE_POSE_CHANNEL, TSE_POSEGRP, TSE_POSEGRP_BASE, TSE_SOME_ID, Object::type, and TreeStoreElem::type.
Referenced by outliner_add_id_contents().
void outliner_build_tree | ( | struct Main * | mainvar, |
struct Scene * | scene, | ||
struct ViewLayer * | view_layer, | ||
struct SpaceOutliner * | space_outliner, | ||
struct ARegion * | region | ||
) |
Main entry point for building the tree data-structure that the outliner represents.
Definition at line 1667 of file outliner_tree.cc.
References BKE_outliner_treehash_rebuild_from_treestore(), BLI_assert, BLI_assert_msg, blender::ed::outliner::AbstractTreeDisplay::createFromDisplayMode(), ARegion::do_draw, SpaceOutliner::filter, SpaceOutliner::flag, outliner_clear_newid_from_main(), outliner_collections_children_sort(), outliner_filter_tree(), outliner_free_tree(), outliner_restore_scrolling_position(), outliner_sort(), outliner_storage_cleanup(), outliner_store_scrolling_position(), SpaceOutliner::outlinevis, RGN_DRAW_NO_REBUILD, SpaceOutliner::runtime, scene, SpaceOutliner::search_flags, SpaceOutliner::search_string, SO_DATA_API, SO_FILTER_NO_CHILDREN, SO_SEARCH_RECURSIVE, SO_SKIP_SORT_ALPHA, SO_TREESTORE_REBUILD, SpaceOutliner::storeflag, SpaceOutliner::tree, SpaceOutliner_Runtime::tree_display, SpaceOutliner_Runtime::treehash, and SpaceOutliner::treestore.
Referenced by collection_new_exec(), and draw_outliner().
void outliner_cleanup_tree | ( | SpaceOutliner * | space_outliner | ) |
Definition at line 192 of file outliner_tree.cc.
References outliner_free_tree(), outliner_storage_cleanup(), and SpaceOutliner::tree.
Referenced by collection_new_exec(), outliner_constraint_operation_exec(), outliner_delete_exec(), outliner_modifier_operation_exec(), outliner_orphans_purge_exec(), and outliner_scene_operation_exec().
Definition at line 1652 of file outliner_tree.cc.
References FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, and ID::newid.
Referenced by outliner_build_tree().
Definition at line 1165 of file outliner_tree.cc.
References BLI_addtail(), BLI_listbase_clear(), BLI_listbase_count(), tTreeSort::id, TreeStoreElem::id, ID_OB, TreeElement::idcode, tTreeSort::idcode, ListBase::last, LISTBASE_FOREACH, MEM_freeN, MEM_mallocN, TreeElement::name, tTreeSort::name, tTreeSort::te, treesort_child_not_in_collection(), TREESTORE, TSE_SOME_ID, and TreeStoreElem::type.
Referenced by outliner_build_tree().
|
static |
Definition at line 1526 of file outliner_tree.cc.
References ID_OB, TreeElement::idcode, outliner_is_collection_tree_element(), TreeElement::parent, TREESTORE, TSE_SOME_ID, and TreeStoreElem::type.
Referenced by outliner_extract_children_from_subtree().
|
static |
Definition at line 1406 of file outliner_tree.cc.
References BASACT, BASE_SELECTABLE, BASE_SELECTED, BASE_VISIBLE_VIEWLAYER, BKE_view_layer_base_find(), BLI_assert, TreeElement::directdata, TreeStoreElem::id, ID_OB, TreeElement::idcode, OB_ARMATURE, OB_CAMERA, OB_EMPTY, OB_LAMP, OB_MESH, TreeElement::parent, SO_FILTER_ANY, SO_FILTER_NO_CHILDREN, SO_FILTER_NO_OB_ARMATURE, SO_FILTER_NO_OB_CAMERA, SO_FILTER_NO_OB_CONTENT, SO_FILTER_NO_OB_EMPTY, SO_FILTER_NO_OB_LAMP, SO_FILTER_NO_OB_MESH, SO_FILTER_NO_OB_OTHERS, SO_FILTER_OB_STATE, SO_FILTER_OB_STATE_ACTIVE, SO_FILTER_OB_STATE_INVERSE, SO_FILTER_OB_STATE_SELECTABLE, SO_FILTER_OB_STATE_SELECTED, SO_FILTER_OB_STATE_VISIBLE, SO_FILTER_OB_TYPE, TREESTORE, TSE_SOME_ID, Object::type, and TreeStoreElem::type.
Referenced by outliner_filter_subtree().
|
static |
Definition at line 1368 of file outliner_tree.cc.
References SpaceOutliner::filter, SpaceOutliner::filter_state, SpaceOutliner::search_string, SO_FILTER_NO_OBJECT, SO_FILTER_OB_ACTIVE, SO_FILTER_OB_SELECTABLE, SO_FILTER_OB_SELECTED, SO_FILTER_OB_STATE, SO_FILTER_OB_STATE_ACTIVE, SO_FILTER_OB_STATE_SELECTABLE, SO_FILTER_OB_STATE_SELECTED, SO_FILTER_OB_STATE_VISIBLE, SO_FILTER_OB_TYPE, SO_FILTER_OB_VISIBLE, SO_FILTER_SEARCH, and SUPPORT_FILTER_OUTLINER.
Referenced by outliner_filter_tree(), and outliner_requires_rebuild_on_select_or_active_change().
|
static |
Definition at line 1542 of file outliner_tree.cc.
References BLI_insertlinkafter(), BLI_remlink(), element, outliner_element_is_collection_or_object(), outliner_free_tree_element(), TreeElement::parent, and TreeElement::prev.
Referenced by outliner_filter_subtree().
|
static |
Definition at line 1515 of file outliner_tree.cc.
References TreeElement::name, and SO_FIND_CASE_SENSITIVE.
Referenced by outliner_filter_subtree().
|
static |
Definition at line 1568 of file outliner_tree.cc.
References BLI_listbase_is_empty(), ListBase::first, TreeStoreElem::flag, TreeElement::next, outliner_element_visible_get(), outliner_extract_children_from_subtree(), outliner_filter_has_name(), outliner_free_tree_element(), SpaceOutliner::search_flags, SO_FILTER_SEARCH, TreeElement::subtree, TREESTORE, TSE_SEARCHMATCH, and TSELEM_OPEN.
Referenced by outliner_filter_tree().
|
static |
Definition at line 1628 of file outliner_tree.cc.
References BLI_strncpy_ensure_pad(), outliner_exclude_filter_get(), outliner_filter_subtree(), SpaceOutliner::search_flags, SpaceOutliner::search_string, SO_FIND_COMPLETE, and SpaceOutliner::tree.
Referenced by outliner_build_tree().
|
static |
Find the first element that passes a test starting from a reference vertical coordinate
If the element that is in the position is not what we are looking for, keep looking for its children, siblings, and eventually, aunts, cousins, distant families, ... etc.
Basically we keep going up and down the outliner tree from that point forward, until we find what we are looking for. If we are past the visible range and we can't find a valid element we return nullptr.
Definition at line 1294 of file outliner_tree.cc.
References bool, SpaceOutliner::filter, TreeElement::next, outliner_find_first_desired_element_at_y_recursive(), outliner_find_item_at_y(), SpaceOutliner::outlinevis, TreeElement::parent, SO_FILTER_NO_COLLECTION, SO_VIEW_LAYER, test_collection_callback(), test_object_callback(), SpaceOutliner::tree, UI_UNIT_Y, and TreeElement::ys.
Referenced by outliner_store_scrolling_position().
|
static |
See if TreeElement or any of its children pass the callback_test.
Definition at line 1261 of file outliner_tree.cc.
References LISTBASE_FOREACH, TreeElement::store_elem, TreeElement::subtree, and TSELEM_OPEN.
Referenced by outliner_find_first_desired_element_at_y().
Definition at line 185 of file outliner_tree.cc.
References element, LISTBASE_FOREACH_MUTABLE, outliner_free_tree_element(), and tree.
Referenced by outliner_build_tree(), outliner_cleanup_tree(), outliner_free(), and outliner_free_tree_element().
void outliner_free_tree_element | ( | TreeElement * | element, |
ListBase * | parent_subtree | ||
) |
Free element and its sub-tree and remove its link in parent_subtree.
parent_subtree | Sub-tree of the parent element, so the list containing element. |
Definition at line 198 of file outliner_tree.cc.
References BLI_assert, BLI_findindex(), BLI_remlink(), element, MEM_freeN, outliner_free_tree(), and TE_FREE_NAME.
Referenced by blender::ed::outliner::TreeDisplayOverrideLibraryHierarchies::buildTree(), outliner_extract_children_from_subtree(), outliner_filter_subtree(), and outliner_free_tree().
bool outliner_requires_rebuild_on_select_or_active_change | ( | const SpaceOutliner * | space_outliner | ) |
Definition at line 216 of file outliner_tree.cc.
References outliner_exclude_filter_get(), SO_FILTER_OB_STATE_ACTIVE, and SO_FILTER_OB_STATE_SELECTED.
|
static |
Bring the outliner scrolling back to where it was in relation to the original focus element Caller is expected to handle redrawing of ARegion.
Definition at line 1223 of file outliner_tree.cc.
References BLI_rctf_translate(), View2D::cur, MIN2, outliner_find_tree_element(), outliner_set_coordinates(), SpaceOutliner::tree, OutlinerTreeElementFocus::tselem, ARegion::v2d, rctf::ymax, TreeElement::ys, and OutlinerTreeElementFocus::ys.
Referenced by outliner_build_tree().
Definition at line 1097 of file outliner_tree.cc.
References BLI_addtail(), BLI_listbase_clear(), BLI_listbase_count(), ELEM, tTreeSort::id, TreeStoreElem::id, ID_OB, TreeElement::idcode, tTreeSort::idcode, ListBase::last, LISTBASE_FOREACH, MEM_freeN, MEM_mallocN, TreeElement::name, tTreeSort::name, tTreeSort::te, treesort_alpha(), treesort_alpha_ob(), TREESTORE, TSE_DEFGROUP, TSE_ID_BASE, TSE_SOME_ID, and TreeStoreElem::type.
Referenced by outliner_build_tree().
|
static |
Definition at line 81 of file outliner_tree.cc.
References BKE_outliner_treehash_clear_used(), BKE_outliner_treehash_free(), BKE_outliner_treehash_rebuild_from_treestore(), BLI_mempool_alloc(), BLI_MEMPOOL_ALLOW_ITER, BLI_mempool_create(), BLI_mempool_destroy(), BLI_mempool_iternew(), BLI_mempool_iterstep(), BLI_mempool_len(), TreeStoreElem::id, SpaceOutliner::runtime, SO_TREESTORE_CLEANUP, SpaceOutliner::storeflag, SpaceOutliner_Runtime::treehash, SpaceOutliner::treestore, and TreeStoreElem::used.
Referenced by outliner_build_tree(), and outliner_cleanup_tree().
|
static |
Store information of current outliner scrolling status to be restored later.
Finds the top-most collection visible in the outliner and populates the OutlinerTreeElementFocus struct to retrieve this element later to make sure it is in the same original position as before filtering.
Definition at line 1348 of file outliner_tree.cc.
References View2D::cur, outliner_find_first_desired_element_at_y(), outliner_set_coordinates(), TREESTORE, OutlinerTreeElementFocus::tselem, ARegion::v2d, rctf::ymax, rctf::ymin, TreeElement::ys, and OutlinerTreeElementFocus::ys.
Referenced by outliner_build_tree().
|
static |
Definition at line 1247 of file outliner_tree.cc.
References outliner_is_collection_tree_element().
Referenced by outliner_find_first_desired_element_at_y().
|
static |
Definition at line 1252 of file outliner_tree.cc.
References ID_OB, TreeElement::idcode, TREESTORE, TSE_SOME_ID, and TreeStoreElem::type.
Referenced by outliner_find_first_desired_element_at_y().
Definition at line 1039 of file outliner_tree.cc.
References BLI_strcasecmp_natural(), tTreeSort::name, v1, v2, and x2.
Referenced by outliner_sort().
Definition at line 986 of file outliner_tree.cc.
References BLI_strcasecmp_natural(), TreeElement::flag, ID_OB, tTreeSort::idcode, tTreeSort::name, tTreeSort::te, TE_CHILD_NOT_IN_COLLECTION, v1, v2, and x2.
Referenced by outliner_sort().
Definition at line 1025 of file outliner_tree.cc.
References TreeElement::flag, tTreeSort::te, TE_CHILD_NOT_IN_COLLECTION, v1, v2, and x2.
Referenced by outliner_collections_children_sort().