@@ -208,7 +208,11 @@ def remove_keyframe(self, item):
208
208
# Create reference
209
209
clip_data = c .data
210
210
if object_id :
211
- clip_data = c .data .get ('objects' ).get (object_id )
211
+ objects = c .data .get ('objects' , {})
212
+ clip_data = objects .pop (object_id , {})
213
+ if not clip_data :
214
+ log .debug ("No clip data found for this object id" )
215
+ return
212
216
213
217
if property_key in clip_data : # Update clip attribute
214
218
log_id = "{}/{}" .format (clip_id , object_id ) if object_id else clip_id
@@ -281,13 +285,17 @@ def remove_keyframe(self, item):
281
285
has_waveform = True
282
286
283
287
# Reduce # of clip properties we are saving (performance boost)
284
- clip_data = {property_key : clip_data [property_key ]}
285
- if object_id :
286
- clip_data = {'objects' : {object_id : clip_data }}
288
+ if not object_id :
289
+ clip_data = {property_key : clip_data .get (property_key )}
290
+ else :
291
+ # If objects dict detected - don't reduce the # of objects
292
+ objects [object_id ] = clip_data
293
+ clip_data = {'objects' : objects }
287
294
288
295
# Save changes
289
296
if clip_updated :
290
297
# Save
298
+ c .data = clip_data
291
299
c .save ()
292
300
293
301
# Update waveforms (if needed)
@@ -331,7 +339,11 @@ def color_update(self, item, new_color, interpolation=-1, interpolation_details=
331
339
# Create reference
332
340
clip_data = c .data
333
341
if object_id :
334
- clip_data = c .data .get ('objects' ).get (object_id )
342
+ objects = c .data .get ('objects' , {})
343
+ clip_data = objects .pop (object_id , {})
344
+ if not clip_data :
345
+ log .debug ("No clip data found for this object id" )
346
+ return
335
347
336
348
# Update clip attribute
337
349
if property_key in clip_data :
@@ -403,13 +415,17 @@ def color_update(self, item, new_color, interpolation=-1, interpolation_details=
403
415
})
404
416
405
417
# Reduce # of clip properties we are saving (performance boost)
406
- clip_data = {property_key : clip_data [property_key ]}
407
- if object_id :
408
- clip_data = {'objects' : {object_id : clip_data }}
418
+ if not object_id :
419
+ clip_data = {property_key : clip_data .get (property_key )}
420
+ else :
421
+ # If objects dict detected - don't reduce the # of objects
422
+ objects [object_id ] = clip_data
423
+ clip_data = {'objects' : objects }
409
424
410
425
# Save changes
411
426
if clip_updated :
412
427
# Save
428
+ c .data = clip_data
413
429
c .save ()
414
430
415
431
# Update the preview
@@ -434,12 +450,15 @@ def value_updated(self, item, interpolation=-1, value=None, interpolation_detail
434
450
property_type = property [1 ]["type" ]
435
451
property_key = property [0 ]
436
452
object_id = property [1 ]["object_id" ]
453
+ objects = {}
437
454
clip_id , item_type = item .data ()
438
455
439
456
# Get value (if any)
440
- if item .text ():
457
+ if item .text () or value :
441
458
# Set and format value based on property type
442
- if value is not None :
459
+ if value == "None" :
460
+ new_value = ""
461
+ elif value is not None :
443
462
# Override value
444
463
new_value = value
445
464
elif property_type == "string" :
@@ -478,12 +497,16 @@ def value_updated(self, item, interpolation=-1, value=None, interpolation_detail
478
497
# Get effect object
479
498
c = Effect .get (id = clip_id )
480
499
481
- if c :
500
+ if c and c . data :
482
501
483
502
# Create reference
484
503
clip_data = c .data
485
504
if object_id :
486
- clip_data = c .data .get ('objects' ).get (object_id )
505
+ objects = c .data .get ('objects' , {})
506
+ clip_data = objects .pop (object_id , {})
507
+ if not clip_data :
508
+ log .debug ("No clip data found for this object id" )
509
+ return
487
510
488
511
# Update clip attribute
489
512
if property_key in clip_data :
@@ -616,9 +639,12 @@ def value_updated(self, item, interpolation=-1, value=None, interpolation_detail
616
639
has_waveform = True
617
640
618
641
# Reduce # of clip properties we are saving (performance boost)
619
- clip_data = {property_key : clip_data .get (property_key )}
620
- if object_id :
621
- clip_data = {'objects' : {object_id : clip_data }}
642
+ if not object_id :
643
+ clip_data = {property_key : clip_data .get (property_key )}
644
+ else :
645
+ # If objects dict detected - don't reduce the # of objects
646
+ objects [object_id ] = clip_data
647
+ clip_data = {'objects' : objects }
622
648
623
649
# Save changes
624
650
if clip_updated :
@@ -766,7 +792,7 @@ def set_property(self, property, filter, c, item_type, object_id=None):
766
792
# Append ROW to MODEL (if does not already exist in model)
767
793
self .model .appendRow (row )
768
794
769
- else :
795
+ elif name in self . items and self . items [ name ][ "row" ] :
770
796
# Update the value of the existing model
771
797
# Get 1st Column
772
798
col = self .items [name ]["row" ][0 ]
0 commit comments