Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_select.c
| Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | |||||
| #include "RNA_enum_types.h" | #include "RNA_enum_types.h" | ||||
| #include "object_intern.h" | #include "object_intern.h" | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Public Object Selection API | /** \name Public Object Selection API | ||||
| * \{ */ | * \{ */ | ||||
| /* simple API for object selection, rather than just using the flag | /** | ||||
| * simple API for object selection, rather than just using the flag | |||||
| * this takes into account the 'restrict selection in 3d view' flag. | * this takes into account the 'restrict selection in 3d view' flag. | ||||
| * deselect works always, the restriction just prevents selection */ | * deselect works always, the restriction just prevents selection | ||||
| * | |||||
| /* Note: send a NC_SCENE|ND_OB_SELECT notifier yourself! (or | * \note Caller must send a `NC_SCENE | ND_OB_SELECT` notifier | ||||
| * or a NC_SCENE|ND_OB_VISIBLE in case of visibility toggling */ | * (or a `NC_SCENE | ND_OB_VISIBLE` in case of visibility toggling). | ||||
| */ | |||||
| void ED_object_base_select(Base *base, eObjectSelect_Mode mode) | void ED_object_base_select(Base *base, eObjectSelect_Mode mode) | ||||
| { | { | ||||
| if (mode == BA_INVERT) { | if (mode == BA_INVERT) { | ||||
| mode = (base->flag & BASE_SELECTED) != 0 ? BA_DESELECT : BA_SELECT; | mode = (base->flag & BASE_SELECTED) != 0 ? BA_DESELECT : BA_SELECT; | ||||
| } | } | ||||
| if (base) { | if (base) { | ||||
| switch (mode) { | switch (mode) { | ||||
| ▲ Show 20 Lines • Show All 1,334 Lines • Show Last 20 Lines | |||||