Skip to content

Commit 32a97bc

Browse files
committed
Added support to attach a clip to another clip
1 parent 0320094 commit 32a97bc

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/windows/views/properties_tableview.py

+14-4
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,13 @@ def contextMenuEvent(self, event):
441441
# Handle clip attach options
442442
if property_key == "attached_id" and not self.choices:
443443
# Add all Clips as choices - initialize with None
444-
clips_choices = [{
444+
tracked_choices = [{
445+
"name": "None",
446+
"value": "None",
447+
"selected": False,
448+
"icon": QIcon()
449+
}]
450+
clip_choices = [{
445451
"name": "None",
446452
"value": "None",
447453
"selected": False,
@@ -467,13 +473,16 @@ def contextMenuEvent(self, event):
467473
if (clip_path == clip_instance_path):
468474
# Generate the clip icon to show in the selection menu
469475
clip_instance_icon = clip_index.data(Qt.DecorationRole)
476+
clip_choices.append({"name": clip_instance_data["title"],
477+
"value": clip_instance_id,
478+
"selected": False,
479+
"icon": clip_instance_icon})
470480
# Get the pixmap of the clip icon
471481
icon_size = 72
472482
icon_pixmap = clip_instance_icon.pixmap(icon_size, icon_size)
473483
# Add tracked objects to the selection menu
474484
tracked_objects = []
475485
for effect in clip_instance_data["effects"]:
476-
477486
# Check if effect has a tracked object
478487
if effect["has_tracked_object"]:
479488
# Instantiate the effect
@@ -493,11 +502,12 @@ def contextMenuEvent(self, event):
493502
"value": str(object_id),
494503
"selected": False,
495504
"icon": QIcon(tracked_object_icon)})
496-
clips_choices.append({"name": clip_instance_data["title"],
505+
tracked_choices.append({"name": clip_instance_data["title"],
497506
"value": tracked_objects,
498507
"selected": False,
499508
"icon": clip_instance_icon})
500-
self.choices.append({"name": _("Clips"), "value": clips_choices, "selected": False, "icon": None})
509+
self.choices.append({"name": _("Tracked Objects"), "value": tracked_choices, "selected": False, "icon": None})
510+
self.choices.append({"name": _("Clips"), "value": clip_choices, "selected": False, "icon": None})
501511

502512
# Handle reader type values
503513
if self.property_type == "reader" and not self.choices:

0 commit comments

Comments
 (0)