From 4d5bf9ba8c99615e7b4a3af139263b1ed59138be Mon Sep 17 00:00:00 2001 From: Brenno Date: Fri, 13 Aug 2021 21:15:58 -0300 Subject: [PATCH] Bug fix. Prevent adding the same clip as child in the Tracker and Object Detection Effects --- src/TrackedObjectBBox.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/TrackedObjectBBox.cpp b/src/TrackedObjectBBox.cpp index 451cde044..e577e4d06 100644 --- a/src/TrackedObjectBBox.cpp +++ b/src/TrackedObjectBBox.cpp @@ -395,10 +395,13 @@ void TrackedObjectBBox::SetJsonValue(const Json::Value root) // Set the protobuf data path by the given JSON object if (!root["protobuf_data_path"].isNull()) protobufDataPath = root["protobuf_data_path"].asString(); + // Set the id of the child clip - if (!root["child_clip_id"].isNull() && root["child_clip_id"].asString() != ""){ + if (!root["child_clip_id"].isNull() && root["child_clip_id"].asString() != "" && root["child_clip_id"].asString() != Id()){ Clip* parentClip = (Clip *) ParentClip(); - ChildClipId(root["child_clip_id"].asString()); + + if (root["child_clip_id"].asString() != parentClip->Id()) + ChildClipId(root["child_clip_id"].asString()); } // Set the Keyframes by the given JSON object