diff options
author | Nathan Craddock <nzcraddock@gmail.com> | 2020-09-16 00:23:08 +0300 |
---|---|---|
committer | Nathan Craddock <nzcraddock@gmail.com> | 2020-09-16 00:29:59 +0300 |
commit | 1572da858df49af04e4ddb5dbb87a96e57ea6f14 (patch) | |
tree | f6f7ba54d9b21acee13a0b26377a2d74f47530f0 /source/blender/editors/space_outliner/outliner_draw.c | |
parent | 583354e9e989a66a684053e16bcbd950cac91428 (diff) |
Outliner: Modifier/constraint/shaderfx drag and drop operator
This adds an operator to allow drag and drop of modifiers, constraints,
and shader effects within the outliner. Referred to as "data stack" in
the code for simplicity.
The following operations are allowed:
* Reordering within an object or bone
* Copying a single modifier/constraint/effect to another object or bone
* Copying (linking) all modifiers/constraints/effects to another object
or bone.
This complements the recent work done for panel-based modifier layouts
by allowing reordering in the outliner. It also makes it simple to copy
a single modifier/constraint/effect to another object.
Differential Revision: https://developer.blender.org/D8642
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_draw.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_draw.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 3449b73ed24..0ab98a6ab66 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -2024,9 +2024,11 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te) break; case TSE_CONSTRAINT_BASE: data.icon = ICON_CONSTRAINT; + data.drag_id = tselem->id; break; case TSE_CONSTRAINT: { bConstraint *con = te->directdata; + data.drag_id = tselem->id; switch ((eBConstraint_Types)con->type) { case CONSTRAINT_TYPE_CAMERASOLVER: data.icon = ICON_CON_CAMERASOLVER; @@ -2121,6 +2123,7 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te) } case TSE_MODIFIER_BASE: data.icon = ICON_MODIFIER_DATA; + data.drag_id = tselem->id; break; case TSE_LINKED_OB: data.icon = ICON_OBJECT_DATA; @@ -2130,6 +2133,8 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te) break; case TSE_MODIFIER: { Object *ob = (Object *)tselem->id; + data.drag_id = tselem->id; + if (ob->type != OB_GPENCIL) { ModifierData *md = BLI_findlink(&ob->modifiers, tselem->nr); switch ((ModifierType)md->type) { |