MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / AttachToObject

Method AttachToObject

src/Clip.cpp:299–319  ·  view source on GitHub ↗

Attach clip to bounding box

Source from the content-addressed store, hash-verified

297
298// Attach clip to bounding box
299void Clip::AttachToObject(std::string object_id)
300{
301 // Search for the tracked object on the timeline
302 Timeline* parentTimeline = static_cast<Timeline *>(ParentTimeline());
303
304 if (parentTimeline) {
305 // Create a smart pointer to the tracked object from the timeline
306 std::shared_ptr<openshot::TrackedObjectBase> trackedObject = parentTimeline->GetTrackedObject(object_id);
307 Clip* clipObject = parentTimeline->GetClip(object_id);
308
309 // Check for valid tracked object
310 if (trackedObject){
311 SetAttachedObject(trackedObject);
312 parentClipObject = NULL;
313 }
314 else if (clipObject) {
315 SetAttachedClip(clipObject);
316 parentTrackedObject = nullptr;
317 }
318 }
319}
320
321// Set the pointer to the trackedObject this clip is attached to
322void Clip::SetAttachedObject(std::shared_ptr<openshot::TrackedObjectBase> trackedObject){

Callers 1

KeyFrame.cppFile · 0.80

Calls 2

GetTrackedObjectMethod · 0.80
GetClipMethod · 0.80

Tested by

no test coverage detected