Skip to content

Commit

Permalink
Updated Clip.cpp to support GUI to select attached object
Browse files Browse the repository at this point in the history
Modified Clip.cpp PropertiesJSON function and applied minor fixes to Keyframe_Tests
  • Loading branch information
BrennoCaldato committed Jan 14, 2021
1 parent 61accdf commit 3d5d907
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
21 changes: 4 additions & 17 deletions src/Clip.cpp
Expand Up @@ -787,23 +787,10 @@ std::string Clip::PropertiesJSON(int64_t requested_frame) const {
root["display"] = add_property_json("Frame Number", display, "int", "", NULL, 0, 3, false, requested_frame);
root["mixing"] = add_property_json("Volume Mixing", mixing, "int", "", NULL, 0, 2, false, requested_frame);
root["waveform"] = add_property_json("Waveform", waveform, "int", "", NULL, 0, 1, false, requested_frame);
root["attached_id"] = add_property_json("Attached ID", 0.0, "string", GetAttachedId(), NULL, -1, -1, false, requested_frame);

// Add attached id choices (dropdown style)
if (timeline){
Timeline* parentTimeline = (Timeline *) timeline;
std::vector<std::string> tracked_ids = parentTimeline->GetTrackedObjectsIds();
Json::Value temp;
temp["name"] = "";
temp["value"] = "";
temp["selected"] = true;
root["attached_id"]["choices"].append(temp);
for (auto it = tracked_ids.begin(); it != tracked_ids.end(); ++it){
temp["name"] = *it;
temp["value"] = *it;
temp["selected"] = true;
root["attached_id"]["choices"].append(temp);
}
if (!attached_id.empty()) {
root["attached_id"] = add_property_json("Attached ID", 0.0, "string", attached_id, NULL, -1, -1, false, requested_frame);
} else {
root["attached_id"] = add_property_json("Attached ID", 0.0, "string", "None", NULL, -1, -1, false, requested_frame);
}
// Add gravity choices (dropdown style)
root["gravity"]["choices"].append(add_property_choice_json("Top Left", GRAVITY_TOP_LEFT, gravity));
Expand Down
4 changes: 1 addition & 3 deletions tests/KeyFrame_Tests.cpp
Expand Up @@ -620,8 +620,6 @@ TEST(KeyFrameBBox_Scale_test){
CHECK_EQUAL(30.0, bbox.height);
}



TEST(Attach_test){

std::stringstream path1, path2;
Expand All @@ -648,7 +646,7 @@ TEST(Attach_test){
clip.AddEffect(&tracker);

// Save a pointer to trackedData
std::shared_ptr<KeyFrameBBox> trackedData = tracker.trackedData;
std::shared_ptr<KeyFrameBBox> trackedData = tracker.trackedData;

// Change trackedData scale
trackedData->scale_x.AddPoint(1, 2.0);
Expand Down

0 comments on commit 3d5d907

Please sign in to comment.