Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2020-11-02 12:56:45 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-11-02 17:36:18 +0300
commit7887e91d316567366e99fb0d066861cb89ae5816 (patch)
treed8fe6ec558dd9fda6eb998a70accedf01c69475a /source/blender/editors/include/ED_object.h
parent417ba6aa1cacd7e69df7f54207627f13328fd3f9 (diff)
Cleanup: Sanitise return value of `ED_object_parent_set()`
Consistently return `false` from `ED_object_parent_set()` when parenting is not possible. Before, when parent and child were the same object, the function would return `true` even though the parent-child relation was not made. Just returning `false` in the `parent == child` case would break the parenting operator, as `false` stops its loop over all selected objects. This tight coupling caused T82312. The loop now has its own check for this, so that it properly continues, and the implementation of `ED_object_parent_set()` is decoupled from its surrounding code. No functional changes.
Diffstat (limited to 'source/blender/editors/include/ED_object.h')
-rw-r--r--source/blender/editors/include/ED_object.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h
index 6fdd65fdcc9..2e9b711c99a 100644
--- a/source/blender/editors/include/ED_object.h
+++ b/source/blender/editors/include/ED_object.h
@@ -160,6 +160,7 @@ extern struct EnumPropertyItem prop_clear_parent_types[];
extern struct EnumPropertyItem prop_make_parent_types[];
#endif
+/* Set the object's parent, return true iff successful. */
bool ED_object_parent_set(struct ReportList *reports,
const struct bContext *C,
struct Scene *scene,