@@ -253,19 +253,16 @@ void Clip::AttachToObject(std::string object_id)
253
253
SetAttachedClip (clipObject);
254
254
}
255
255
}
256
- return ;
257
256
}
258
257
259
258
// Set the pointer to the trackedObject this clip is attached to
260
259
void Clip::SetAttachedObject (std::shared_ptr<openshot::TrackedObjectBase> trackedObject){
261
260
parentTrackedObject = trackedObject;
262
- return ;
263
261
}
264
262
265
263
// Set the pointer to the clip this clip is attached to
266
264
void Clip::SetAttachedClip (Clip* clipObject){
267
265
parentClipObject = clipObject;
268
- return ;
269
266
}
270
267
271
268
// / Set the current reader
@@ -754,11 +751,8 @@ std::string Clip::PropertiesJSON(int64_t requested_frame) const {
754
751
root[" display" ] = add_property_json (" Frame Number" , display, " int" , " " , NULL , 0 , 3 , false , requested_frame);
755
752
root[" mixing" ] = add_property_json (" Volume Mixing" , mixing, " int" , " " , NULL , 0 , 2 , false , requested_frame);
756
753
root[" waveform" ] = add_property_json (" Waveform" , waveform, " int" , " " , NULL , 0 , 1 , false , requested_frame);
757
- if (!parentObjectId.empty ()) {
758
- root[" parentObjectId" ] = add_property_json (" Parent" , 0.0 , " string" , parentObjectId, NULL , -1 , -1 , false , requested_frame);
759
- } else {
760
- root[" parentObjectId" ] = add_property_json (" Parent" , 0.0 , " string" , " " , NULL , -1 , -1 , false , requested_frame);
761
- }
754
+ root[" parentObjectId" ] = add_property_json (" Parent" , 0.0 , " string" , parentObjectId, NULL , -1 , -1 , false , requested_frame);
755
+
762
756
// Add gravity choices (dropdown style)
763
757
root[" gravity" ][" choices" ].append (add_property_choice_json (" Top Left" , GRAVITY_TOP_LEFT, gravity));
764
758
root[" gravity" ][" choices" ].append (add_property_choice_json (" Top Center" , GRAVITY_TOP, gravity));
@@ -1438,17 +1432,14 @@ QTransform Clip::get_transform(std::shared_ptr<Frame> frame, int width, int heig
1438
1432
1439
1433
// Get the parentTrackedObject properties
1440
1434
if (parentTrackedObject){
1441
-
1442
1435
// Convert Clip's frame position to Timeline's frame position
1443
1436
long clip_start_position = round (Position () * info.fps .ToDouble ()) + 1 ;
1444
1437
long clip_start_frame = (Start () * info.fps .ToDouble ()) + 1 ;
1445
1438
double timeline_frame_number = frame->number + clip_start_position - clip_start_frame;
1446
1439
1447
1440
// Get parentTrackedObject's parent clip's properties
1448
- std::map<std::string, float > trackedObjectParentClipProperties;
1449
- if (parentClipObject) {
1450
- parentTrackedObject->GetParentClipProperties (timeline_frame_number);
1451
- }
1441
+ std::map<std::string, float > trackedObjectParentClipProperties =
1442
+ parentTrackedObject->GetParentClipProperties (timeline_frame_number);
1452
1443
1453
1444
// Get the attached object's parent clip's properties
1454
1445
if (!trackedObjectParentClipProperties.empty ())
0 commit comments