Skip to content

Commit 2121020

Browse files
authored
Merge pull request #3742 from ferdnyc/properties-debug
Properties model: Make most logs debug
2 parents 47c7e2b + c2c737d commit 2121020

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

src/windows/models/properties_model.py

+25-23
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def changed(self, action):
6565

6666
# Handle change
6767
if action.key and action.key[0] in ["clips", "effects"] and action.type in ["update", "insert"]:
68-
log.info(action.values)
68+
log.debug(action.values)
6969
# Update the model data
7070
self.update_model(get_app().window.txtPropertyFilter.text())
7171

@@ -88,7 +88,7 @@ def update_item_timeout(self):
8888
self.selected = []
8989
self.filter_base_properties = []
9090

91-
log.info("Update item: %s" % item_type)
91+
log.debug("Update item: %s" % item_type)
9292

9393
if item_type == "clip":
9494
c = get_app().window.timeline_sync.timeline.GetClip(item_id)
@@ -200,7 +200,7 @@ def remove_keyframe(self, item):
200200
c = Effect.get(id=clip_id)
201201

202202
if c and property_key in c.data: # Update clip attribute
203-
log.info("remove keyframe: %s" % c.data)
203+
log.debug("remove keyframe: %s" % c.data)
204204

205205
# Determine type of keyframe (normal or color)
206206
keyframe_list = []
@@ -232,7 +232,7 @@ def remove_keyframe(self, item):
232232
# Delete point (if needed)
233233
if point_to_delete:
234234
clip_updated = True
235-
log.info("Found point to delete at X=%s" % point_to_delete["co"]["X"])
235+
log.debug("Found point to delete at X=%s" % point_to_delete["co"]["X"])
236236
keyframe["Points"].remove(point_to_delete)
237237

238238
# Reduce # of clip properties we are saving (performance boost)
@@ -278,7 +278,7 @@ def color_update(self, item, new_color, interpolation=-1, interpolation_details=
278278
if c:
279279
# Update clip attribute
280280
if property_key in c.data:
281-
log.info("color update: %s" % c.data)
281+
log.debug("color update: %s" % c.data)
282282

283283
# Loop through each keyframe (red, blue, and green)
284284
for color, new_value in [("red", new_color.red()), ("blue", new_color.blue()), ("green", new_color.green())]:
@@ -287,14 +287,14 @@ def color_update(self, item, new_color, interpolation=-1, interpolation_details=
287287
# Loop through points, find a matching points on this frame
288288
found_point = False
289289
for point in c.data[property_key][color]["Points"]:
290-
log.info("looping points: co.X = %s" % point["co"]["X"])
290+
log.debug("looping points: co.X = %s" % point["co"]["X"])
291291
if interpolation == -1 and point["co"]["X"] == self.frame_number:
292292
# Found point, Update value
293293
found_point = True
294294
clip_updated = True
295295
# Update point
296296
point["co"]["Y"] = new_value
297-
log.info("updating point: co.X = %s to value: %s" % (point["co"]["X"], float(new_value)))
297+
log.debug("updating point: co.X = %s to value: %s" % (point["co"]["X"], float(new_value)))
298298
break
299299

300300
elif interpolation > -1 and point["co"]["X"] == previous_point_x:
@@ -307,8 +307,8 @@ def color_update(self, item, new_color, interpolation=-1, interpolation_details=
307307
point["handle_right"]["X"] = interpolation_details[0]
308308
point["handle_right"]["Y"] = interpolation_details[1]
309309

310-
log.info("updating interpolation mode point: co.X = %s to %s" % (point["co"]["X"], interpolation))
311-
log.info("use interpolation preset: %s" % str(interpolation_details))
310+
log.debug("updating interpolation mode point: co.X = %s to %s" % (point["co"]["X"], interpolation))
311+
log.debug("use interpolation preset: %s" % str(interpolation_details))
312312

313313
elif interpolation > -1 and point["co"]["X"] == closest_point_x:
314314
# Only update interpolation type (and the RIGHT side of the curve)
@@ -320,13 +320,13 @@ def color_update(self, item, new_color, interpolation=-1, interpolation_details=
320320
point["handle_left"]["X"] = interpolation_details[2]
321321
point["handle_left"]["Y"] = interpolation_details[3]
322322

323-
log.info("updating interpolation mode point: co.X = %s to %s" % (point["co"]["X"], interpolation))
324-
log.info("use interpolation preset: %s" % str(interpolation_details))
323+
log.debug("updating interpolation mode point: co.X = %s to %s" % (point["co"]["X"], interpolation))
324+
log.debug("use interpolation preset: %s" % str(interpolation_details))
325325

326326
# Create new point (if needed)
327327
if not found_point:
328328
clip_updated = True
329-
log.info("Created new point at X=%s" % self.frame_number)
329+
log.debug("Created new point at X=%s" % self.frame_number)
330330
c.data[property_key][color]["Points"].append({'co': {'X': self.frame_number, 'Y': new_value}, 'interpolation': 1})
331331

332332
# Reduce # of clip properties we are saving (performance boost)
@@ -385,7 +385,7 @@ def value_updated(self, item, interpolation=-1, value=None, interpolation_detail
385385
else:
386386
new_value = None
387387

388-
log.info("%s for %s changed to %s at frame %s with interpolation: %s at closest x: %s" % (property_key, clip_id, new_value, self.frame_number, interpolation, closest_point_x))
388+
log.debug("Changing value for %s in clip %s to %s at frame %s with interpolation: %s at closest x: %s" % (property_key, clip_id, new_value, self.frame_number, interpolation, closest_point_x))
389389

390390

391391
# Find this clip
@@ -405,7 +405,7 @@ def value_updated(self, item, interpolation=-1, value=None, interpolation_detail
405405
if c:
406406
# Update clip attribute
407407
if property_key in c.data:
408-
log.info("value updated: %s" % c.data)
408+
log.debug("value updated: %s" % c.data)
409409

410410
# Check the type of property (some are keyframe, and some are not)
411411
if property_type != "reader" and type(c.data[property_key]) == dict:
@@ -414,15 +414,15 @@ def value_updated(self, item, interpolation=-1, value=None, interpolation_detail
414414
found_point = False
415415
point_to_delete = None
416416
for point in c.data[property_key]["Points"]:
417-
log.info("looping points: co.X = %s" % point["co"]["X"])
417+
log.debug("looping points: co.X = %s" % point["co"]["X"])
418418
if interpolation == -1 and point["co"]["X"] == self.frame_number:
419419
# Found point, Update value
420420
found_point = True
421421
clip_updated = True
422422
# Update or delete point
423423
if new_value != None:
424424
point["co"]["Y"] = float(new_value)
425-
log.info("updating point: co.X = %s to value: %s" % (point["co"]["X"], float(new_value)))
425+
log.debug("updating point: co.X = %s to value: %s" % (point["co"]["X"], float(new_value)))
426426
else:
427427
point_to_delete = point
428428
break
@@ -437,8 +437,8 @@ def value_updated(self, item, interpolation=-1, value=None, interpolation_detail
437437
point["handle_right"]["X"] = interpolation_details[0]
438438
point["handle_right"]["Y"] = interpolation_details[1]
439439

440-
log.info("updating interpolation mode point: co.X = %s to %s" % (point["co"]["X"], interpolation))
441-
log.info("use interpolation preset: %s" % str(interpolation_details))
440+
log.debug("updating interpolation mode point: co.X = %s to %s" % (point["co"]["X"], interpolation))
441+
log.debug("use interpolation preset: %s" % str(interpolation_details))
442442

443443
elif interpolation > -1 and point["co"]["X"] == closest_point_x:
444444
# Only update interpolation type (and the RIGHT side of the curve)
@@ -450,19 +450,19 @@ def value_updated(self, item, interpolation=-1, value=None, interpolation_detail
450450
point["handle_left"]["X"] = interpolation_details[2]
451451
point["handle_left"]["Y"] = interpolation_details[3]
452452

453-
log.info("updating interpolation mode point: co.X = %s to %s" % (point["co"]["X"], interpolation))
454-
log.info("use interpolation preset: %s" % str(interpolation_details))
453+
log.debug("updating interpolation mode point: co.X = %s to %s" % (point["co"]["X"], interpolation))
454+
log.debug("use interpolation preset: %s" % str(interpolation_details))
455455

456456
# Delete point (if needed)
457457
if point_to_delete:
458458
clip_updated = True
459-
log.info("Found point to delete at X=%s" % point_to_delete["co"]["X"])
459+
log.debug("Found point to delete at X=%s" % point_to_delete["co"]["X"])
460460
c.data[property_key]["Points"].remove(point_to_delete)
461461

462462
# Create new point (if needed)
463463
elif not found_point and new_value != None:
464464
clip_updated = True
465-
log.info("Created new point at X=%s" % self.frame_number)
465+
log.debug("Created new point at X=%s" % self.frame_number)
466466
c.data[property_key]["Points"].append({'co': {'X': self.frame_number, 'Y': new_value}, 'interpolation': 1})
467467

468468
if not clip_updated:
@@ -518,11 +518,13 @@ def value_updated(self, item, interpolation=-1, value=None, interpolation_detail
518518
# Update the preview
519519
get_app().window.refreshFrameSignal.emit()
520520

521+
log.info("Item %s: changed %s to %s at frame %s (x: %s)" % (clip_id, property_key, new_value, self.frame_number, closest_point_x))
522+
521523
# Clear selection
522524
self.parent.clearSelection()
523525

524526
def update_model(self, filter=""):
525-
log.info("updating clip properties model.")
527+
log.debug("updating clip properties model.")
526528
app = get_app()
527529
_ = app._tr
528530

0 commit comments

Comments
 (0)