Skip to content

Commit 10d8345

Browse files
committed
Simplified if statements
1 parent 2df9e94 commit 10d8345

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/windows/models/properties_model.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def remove_keyframe(self, item):
196196

197197
# Create reference
198198
clip_data = c.data
199-
if object_id is not None:
199+
if object_id:
200200
clip_data = c.data.get('objects').get(object_id)
201201

202202
if property_key in clip_data: # Update clip attribute
@@ -237,7 +237,7 @@ def remove_keyframe(self, item):
237237

238238
# Reduce # of clip properties we are saving (performance boost)
239239
clip_data = {property_key: clip_data[property_key]}
240-
if object_id is not None:
240+
if object_id:
241241
clip_data = {'objects': {object_id: clip_data}}
242242

243243
# Save changes
@@ -281,7 +281,7 @@ def color_update(self, item, new_color, interpolation=-1, interpolation_details=
281281
if c:
282282
# Create reference
283283
clip_data = c.data
284-
if object_id is not None:
284+
if object_id:
285285
clip_data = c.data.get('objects').get(object_id)
286286

287287
# Update clip attribute
@@ -352,7 +352,7 @@ def color_update(self, item, new_color, interpolation=-1, interpolation_details=
352352

353353
# Reduce # of clip properties we are saving (performance boost)
354354
clip_data = {property_key: clip_data[property_key]}
355-
if object_id is not None:
355+
if object_id:
356356
clip_data = {'objects': {object_id: clip_data}}
357357

358358
# Save changes
@@ -430,7 +430,7 @@ def value_updated(self, item, interpolation=-1, value=None, interpolation_detail
430430

431431
# Create reference
432432
clip_data = c.data
433-
if object_id is not None:
433+
if object_id:
434434
clip_data = c.data.get('objects').get(object_id)
435435

436436
# Update clip attribute
@@ -555,7 +555,7 @@ def value_updated(self, item, interpolation=-1, value=None, interpolation_detail
555555
# Reduce # of clip properties we are saving (performance boost)
556556
clip_data = {property_key: clip_data.get(property_key)}
557557

558-
if object_id is not None:
558+
if object_id:
559559
clip_data = {'objects': {object_id: clip_data}}
560560

561561
# Save changes
@@ -838,7 +838,7 @@ def update_model(self, filter=""):
838838
self.add_property(property, filter, c, item_type)
839839

840840
# Insert objects properties from custom effetcs
841-
if objects_raw_properties is not None:
841+
if objects_raw_properties:
842842
for obj_id in objects_raw_properties:
843843
objects_all_properties = OrderedDict(sorted(objects_raw_properties[obj_id].items(), key=lambda x: x[1]['name']))
844844
for property in objects_all_properties.items():

0 commit comments

Comments
 (0)