@@ -95,25 +95,24 @@ def update_item_timeout(self):
95
95
96
96
log .debug ("Update item: %s" % item_type )
97
97
98
+ timeline = get_app ().window .timeline_sync .timeline
98
99
if item_type == "clip" :
99
- c = get_app ().window .timeline_sync .timeline .GetClip (item_id )
100
- if c :
101
- # Append to selected items
102
- self .selected .append ((c , item_type ))
103
-
104
- if item_type == "transition" :
105
- t = get_app ().window .timeline_sync .timeline .GetEffect (item_id )
106
- if t :
107
- # Append to selected items
108
- self .selected .append ((t , item_type ))
109
-
110
- if item_type == "effect" :
111
- e = get_app ().window .timeline_sync .timeline .GetClipEffect (item_id )
112
- if e :
113
- # Filter out basic properties, since this is an effect on a clip
114
- self .filter_base_properties = ["position" , "layer" , "start" , "end" , "duration" ]
115
- # Append to selected items
116
- self .selected .append ((e , item_type ))
100
+ item = timeline .GetClip (item_id )
101
+ elif item_type == "transition" :
102
+ item = timeline .GetEffect (item_id )
103
+ elif item_type == "effect" :
104
+ item = timeline .GetClipEffect (item_id )
105
+ # Filter out basic properties, since this is an effect on a clip
106
+ self .filter_base_properties = ["position" , "layer" , "start" , "end" , "duration" ]
107
+ if item :
108
+ # We also need the parent
109
+ self .selected_parent = item .ParentClip ()
110
+ else :
111
+ item = None
112
+
113
+ if not item :
114
+ return
115
+ self .selected .append ((item , item_type ))
117
116
118
117
# Update frame # from timeline
119
118
self .update_frame (get_app ().window .preview_thread .player .Position (), reload_model = False )
@@ -135,21 +134,9 @@ def update_frame(self, frame_number, reload_model=True):
135
134
# Ignore null clip
136
135
return
137
136
138
- # If effect, find the position of the parent clip
137
+ # If effect, we really care about the position of the parent clip
139
138
if item_type == "effect" :
140
- # find parent clip
141
- effect = Effect .get (id = clip .Id ())
142
- if not effect :
143
- # Invalid effect
144
- return
145
-
146
- parent_clip_id = effect .parent ["id" ]
147
-
148
- # Find this clip object
149
- c = get_app ().window .timeline_sync .timeline .GetClip (parent_clip_id )
150
- if c :
151
- # Override the selected clip object (so the effect gets the correct starting position)
152
- clip = c
139
+ clip = self .selected_parent
153
140
154
141
# Get FPS from project
155
142
fps = get_app ().project .get ("fps" )
0 commit comments