diff options
author | Julian Eisel <julian@blender.org> | 2021-10-26 21:25:19 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-10-26 21:30:51 +0300 |
commit | f81c514bd22a25b2c6951e506f64252e0f5e84bf (patch) | |
tree | 1113861df8300cb3c835defd9d72474ea5a06b7c /source/blender/editors/object/object_add.c | |
parent | 18ace3b541eec120ad75fa7bbbaa15d9fb9b6c12 (diff) |
Assets: Disable snap-dragging for linking object assets
The location of a linked object isn't editable, or at least it will be reset
when reloading the file. So the drag & drop shouldn't even pretend like this
would work, so disable the snapping of the object and the bounding-box to show
the snapped object location while dragging.
Diffstat (limited to 'source/blender/editors/object/object_add.c')
-rw-r--r-- | source/blender/editors/object/object_add.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index f5a304a718b..be8fe3e6db7 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -3617,6 +3617,13 @@ static int object_transform_to_mouse_exec(bContext *C, wmOperator *op) BKE_report(op->reports, RPT_ERROR, "Object not found"); return OPERATOR_CANCELLED; } + + /* Don't transform a linked object. There's just nothing to do here in this case, so return + * #OPERATOR_FINISHED. */ + if (ID_IS_LINKED(ob)) { + return OPERATOR_FINISHED; + } + /* Ensure the locations are updated so snap reads the evaluated active location. */ CTX_data_ensure_evaluated_depsgraph(C); |