Blender  V2.93
Classes | Macros | Typedefs | Enumerations | Functions
outliner_dragdrop.c File Reference
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_collection_types.h"
#include "DNA_material_types.h"
#include "DNA_object_types.h"
#include "DNA_space_types.h"
#include "BLI_listbase.h"
#include "BLT_translation.h"
#include "BKE_collection.h"
#include "BKE_context.h"
#include "BKE_layer.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_object.h"
#include "BKE_report.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "ED_object.h"
#include "ED_outliner.h"
#include "ED_screen.h"
#include "UI_interface.h"
#include "UI_view2d.h"
#include "RNA_access.h"
#include "WM_api.h"
#include "WM_types.h"
#include "outliner_intern.h"

Go to the source code of this file.

Classes

struct  StackDropData
 
struct  CollectionDrop
 

Macros

#define OUTLINER_DRAG_SCOLL_OUTSIDE_PAD   7 /* In UI units */
 

Typedefs

typedef bool(* CheckTypeFn) (TreeElement *te)
 
typedef enum eDataStackDropAction eDataStackDropAction
 
typedef struct StackDropData StackDropData
 
typedef struct CollectionDrop CollectionDrop
 

Enumerations

enum  eDataStackDropAction { DATA_STACK_DROP_REORDER , DATA_STACK_DROP_COPY , DATA_STACK_DROP_LINK }
 

Functions

static Collectioncollection_parent_from_ID (ID *id)
 
static TreeElementoutliner_dropzone_element (TreeElement *te, const float fmval[2], const bool children)
 
static TreeElementoutliner_dropzone_find (const SpaceOutliner *space_outliner, const float fmval[2], const bool children)
 
static TreeElementoutliner_drop_find (bContext *C, const wmEvent *event)
 
static IDoutliner_ID_drop_find (bContext *C, const wmEvent *event, short idcode)
 
static TreeElementoutliner_drop_insert_find (bContext *C, const wmEvent *event, TreeElementInsertType *r_insert_type)
 
static TreeElementoutliner_data_from_tree_element_and_parents (CheckTypeFn check_type, TreeElement *te)
 
static bool is_collection_element (TreeElement *te)
 
static bool is_object_element (TreeElement *te)
 
static bool is_pchan_element (TreeElement *te)
 
static TreeElementoutliner_drop_insert_collection_find (bContext *C, const wmEvent *event, TreeElementInsertType *r_insert_type)
 
static int outliner_get_insert_index (TreeElement *drag_te, TreeElement *drop_te, TreeElementInsertType insert_type, ListBase *listbase)
 
static bool parent_drop_allowed (TreeElement *te, Object *potential_child)
 
static bool allow_parenting_without_modifier_key (SpaceOutliner *space_outliner)
 
static bool parent_drop_poll (bContext *C, wmDrag *drag, const wmEvent *event, const char **UNUSED(r_tooltip))
 
static void parent_drop_set_parents (bContext *C, ReportList *reports, wmDragID *drag, Object *parent, short parent_type, const bool keep_transform)
 
static int parent_drop_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void OUTLINER_OT_parent_drop (wmOperatorType *ot)
 
static bool parent_clear_poll (bContext *C, wmDrag *drag, const wmEvent *event, const char **UNUSED(r_tooltip))
 
static int parent_clear_invoke (bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
 
void OUTLINER_OT_parent_clear (wmOperatorType *ot)
 
static bool scene_drop_poll (bContext *C, wmDrag *drag, const wmEvent *event, const char **UNUSED(r_tooltip))
 
static int scene_drop_invoke (bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
 
void OUTLINER_OT_scene_drop (wmOperatorType *ot)
 
static bool material_drop_poll (bContext *C, wmDrag *drag, const wmEvent *event, const char **UNUSED(r_tooltip))
 
static int material_drop_invoke (bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
 
void OUTLINER_OT_material_drop (wmOperatorType *ot)
 
static void datastack_drop_data_init (wmDrag *drag, Object *ob, bPoseChannel *pchan, TreeElement *te, TreeStoreElem *tselem, void *directdata)
 
static bool datastack_drop_init (bContext *C, const wmEvent *event, StackDropData *drop_data)
 
static bool datastack_drop_are_types_valid (StackDropData *drop_data)
 
static bool datastack_drop_poll (bContext *C, wmDrag *drag, const wmEvent *event, const char **r_tooltip)
 
static void datastack_drop_link (bContext *C, StackDropData *drop_data)
 
static void datastack_drop_copy (bContext *C, StackDropData *drop_data)
 
static void datastack_drop_reorder (bContext *C, ReportList *reports, StackDropData *drop_data)
 
static int datastack_drop_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void OUTLINER_OT_datastack_drop (wmOperatorType *ot)
 
static bool collection_drop_init (bContext *C, wmDrag *drag, const wmEvent *event, CollectionDrop *data)
 
static bool collection_drop_poll (bContext *C, wmDrag *drag, const wmEvent *event, const char **r_tooltip)
 
static int collection_drop_invoke (bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
 
void OUTLINER_OT_collection_drop (wmOperatorType *ot)
 
static TreeElementoutliner_item_drag_element_find (SpaceOutliner *space_outliner, ARegion *region, const wmEvent *event)
 
static int outliner_item_drag_drop_invoke (bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
 
void OUTLINER_OT_item_drag_drop (wmOperatorType *ot)
 
void outliner_dropboxes (void)
 

Macro Definition Documentation

◆ OUTLINER_DRAG_SCOLL_OUTSIDE_PAD

#define OUTLINER_DRAG_SCOLL_OUTSIDE_PAD   7 /* In UI units */

Definition at line 1327 of file outliner_dragdrop.c.

Typedef Documentation

◆ CheckTypeFn

typedef bool(* CheckTypeFn) (TreeElement *te)

Definition at line 186 of file outliner_dragdrop.c.

◆ CollectionDrop

◆ eDataStackDropAction

◆ StackDropData

typedef struct StackDropData StackDropData

Enumeration Type Documentation

◆ eDataStackDropAction

Enumerator
DATA_STACK_DROP_REORDER 
DATA_STACK_DROP_COPY 
DATA_STACK_DROP_LINK 

Definition at line 672 of file outliner_dragdrop.c.

Function Documentation

◆ allow_parenting_without_modifier_key()

static bool allow_parenting_without_modifier_key ( SpaceOutliner space_outliner)
static

◆ collection_drop_init()

static bool collection_drop_init ( bContext C,
wmDrag drag,
const wmEvent event,
CollectionDrop data 
)
static

◆ collection_drop_invoke()

static int collection_drop_invoke ( bContext C,
wmOperator UNUSEDop,
const wmEvent event 
)
static

◆ collection_drop_poll()

static bool collection_drop_poll ( bContext C,
wmDrag drag,
const wmEvent event,
const char **  r_tooltip 
)
static

◆ collection_parent_from_ID()

static Collection * collection_parent_from_ID ( ID id)
static

Definition at line 1084 of file outliner_dragdrop.c.

References GS, id, ID_GR, ID_IS_LINKED, ID_SCE, ID::name, and NULL.

Referenced by collection_drop_init(), and collection_drop_invoke().

◆ datastack_drop_are_types_valid()

static bool datastack_drop_are_types_valid ( StackDropData drop_data)
static

◆ datastack_drop_copy()

static void datastack_drop_copy ( bContext C,
StackDropData drop_data 
)
static

◆ datastack_drop_data_init()

static void datastack_drop_data_init ( wmDrag drag,
Object ob,
bPoseChannel pchan,
TreeElement te,
TreeStoreElem tselem,
void *  directdata 
)
static

◆ datastack_drop_init()

static bool datastack_drop_init ( bContext C,
const wmEvent event,
StackDropData drop_data 
)
static

◆ datastack_drop_invoke()

static int datastack_drop_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ datastack_drop_link()

static void datastack_drop_link ( bContext C,
StackDropData drop_data 
)
static

◆ datastack_drop_poll()

static bool datastack_drop_poll ( bContext C,
wmDrag drag,
const wmEvent event,
const char **  r_tooltip 
)
static

◆ datastack_drop_reorder()

static void datastack_drop_reorder ( bContext C,
ReportList reports,
StackDropData drop_data 
)
static

◆ is_collection_element()

static bool is_collection_element ( TreeElement te)
static

◆ is_object_element()

static bool is_object_element ( TreeElement te)
static

Definition at line 205 of file outliner_dragdrop.c.

References ID_OB, TreeElement::idcode, TREESTORE, TSE_SOME_ID, and TreeStoreElem::type.

Referenced by datastack_drop_init().

◆ is_pchan_element()

static bool is_pchan_element ( TreeElement te)
static

Definition at line 211 of file outliner_dragdrop.c.

References TREESTORE, TSE_POSE_CHANNEL, and TreeStoreElem::type.

Referenced by datastack_drop_init().

◆ material_drop_invoke()

static int material_drop_invoke ( bContext C,
wmOperator UNUSEDop,
const wmEvent event 
)
static

◆ material_drop_poll()

static bool material_drop_poll ( bContext C,
wmDrag drag,
const wmEvent event,
const char **  UNUSEDr_tooltip 
)
static

Definition at line 612 of file outliner_dragdrop.c.

References C, ID_MA, ID_OB, NULL, outliner_ID_drop_find(), and WM_drag_get_local_ID().

Referenced by outliner_dropboxes().

◆ outliner_data_from_tree_element_and_parents()

static TreeElement* outliner_data_from_tree_element_and_parents ( CheckTypeFn  check_type,
TreeElement te 
)
static

Definition at line 188 of file outliner_dragdrop.c.

References NULL, and TreeElement::parent.

Referenced by datastack_drop_init(), and outliner_drop_insert_collection_find().

◆ outliner_drop_find()

static TreeElement* outliner_drop_find ( bContext C,
const wmEvent event 
)
static

◆ outliner_drop_insert_collection_find()

static TreeElement* outliner_drop_insert_collection_find ( bContext C,
const wmEvent event,
TreeElementInsertType r_insert_type 
)
static

◆ outliner_drop_insert_find()

static TreeElement* outliner_drop_insert_find ( bContext C,
const wmEvent event,
TreeElementInsertType r_insert_type 
)
static

◆ outliner_dropboxes()

void outliner_dropboxes ( void  )

◆ outliner_dropzone_element()

static TreeElement* outliner_dropzone_element ( TreeElement te,
const float  fmval[2],
const bool  children 
)
static

◆ outliner_dropzone_find()

static TreeElement* outliner_dropzone_find ( const SpaceOutliner space_outliner,
const float  fmval[2],
const bool  children 
)
static

◆ outliner_get_insert_index()

static int outliner_get_insert_index ( TreeElement drag_te,
TreeElement drop_te,
TreeElementInsertType  insert_type,
ListBase listbase 
)
static

◆ outliner_ID_drop_find()

static ID* outliner_ID_drop_find ( bContext C,
const wmEvent event,
short  idcode 
)
static

◆ outliner_item_drag_drop_invoke()

static int outliner_item_drag_drop_invoke ( bContext C,
wmOperator UNUSEDop,
const wmEvent event 
)
static

◆ outliner_item_drag_element_find()

static TreeElement* outliner_item_drag_element_find ( SpaceOutliner space_outliner,
ARegion region,
const wmEvent event 
)
static

◆ OUTLINER_OT_collection_drop()

void OUTLINER_OT_collection_drop ( wmOperatorType ot)

◆ OUTLINER_OT_datastack_drop()

void OUTLINER_OT_datastack_drop ( wmOperatorType ot)

◆ OUTLINER_OT_item_drag_drop()

void OUTLINER_OT_item_drag_drop ( wmOperatorType ot)

◆ OUTLINER_OT_material_drop()

void OUTLINER_OT_material_drop ( wmOperatorType ot)

◆ OUTLINER_OT_parent_clear()

void OUTLINER_OT_parent_clear ( wmOperatorType ot)

◆ OUTLINER_OT_parent_drop()

void OUTLINER_OT_parent_drop ( wmOperatorType ot)

◆ OUTLINER_OT_scene_drop()

void OUTLINER_OT_scene_drop ( wmOperatorType ot)

◆ parent_clear_invoke()

static int parent_clear_invoke ( bContext C,
wmOperator UNUSEDop,
const wmEvent event 
)
static

◆ parent_clear_poll()

static bool parent_clear_poll ( bContext C,
wmDrag drag,
const wmEvent event,
const char **  UNUSEDr_tooltip 
)
static

◆ parent_drop_allowed()

static bool parent_drop_allowed ( TreeElement te,
Object potential_child 
)
static

◆ parent_drop_invoke()

static int parent_drop_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ parent_drop_poll()

static bool parent_drop_poll ( bContext C,
wmDrag drag,
const wmEvent event,
const char **  UNUSEDr_tooltip 
)
static

◆ parent_drop_set_parents()

static void parent_drop_set_parents ( bContext C,
ReportList reports,
wmDragID drag,
Object parent,
short  parent_type,
const bool  keep_transform 
)
static

◆ scene_drop_invoke()

static int scene_drop_invoke ( bContext C,
wmOperator UNUSEDop,
const wmEvent event 
)
static

◆ scene_drop_poll()

static bool scene_drop_poll ( bContext C,
wmDrag drag,
const wmEvent event,
const char **  UNUSEDr_tooltip 
)
static

Definition at line 544 of file outliner_dragdrop.c.

References C, ID_OB, ID_SCE, NULL, outliner_ID_drop_find(), and WM_drag_get_local_ID().

Referenced by outliner_dropboxes().