def _clickedCb(self, unused_action, unused_actor): #TODO : Let's be more specific, masks etc .. mode = SELECT if self.timeline._container._controlMask: if not self.bElement.selected: mode = SELECT_ADD self.timeline.current_group.add(self.bElement.get_toplevel_parent()) else: self.timeline.current_group.remove(self.bElement.get_toplevel_parent()) mode = UNSELECT elif not self.bElement.selected: GES.Container.ungroup(self.timeline.current_group, False) self.timeline.current_group = GES.Group() self.timeline.current_group.add(self.bElement.get_toplevel_parent()) self.timeline._container.gui.switchContextTab(self.bElement) children = self.bElement.get_toplevel_parent().get_children(True) selection = [elem for elem in children if isinstance(elem, GES.Source)] self.timeline.selection.setSelection(selection, mode) if self.keyframedElement: self.showKeyframes(self.keyframedElement, self.prop) return False
def group(self): """Groups the serializable toplevel elements into a new GES.Group. Returns: GES.Group: The serializable elements which have no parent or have only non-serializable ancestors. """ toplevels = set() for obj in self.selected: if not obj.timeline: # The element has been removed from the timeline. Ignore it. continue toplevel = obj.get_toplevel_parent() toplevels.add(toplevel) group = GES.Group() group.props.serialize = False for toplevel in toplevels: group.add(toplevel) return group