Page MenuHome

Fix error when keyframing with Custom Properties
ClosedPublic

Authored by Demeter Dzadik (Mets) on Jan 10 2022, 12:34 PM.

Details

Summary

It seems that in the past, the data.path_resolve() would raise a ValueError when the custom property's value was None. This no longer seems to be the case, it actually returns None now, so replaced the try/except with a None check.

Test file:

(Will say successfully inserted 10 keyframes but throw error in console when trying to Insert Keyframe)

Diff Detail

Repository
rB Blender

Event Timeline

Demeter Dzadik (Mets) requested review of this revision.Jan 10 2022, 12:34 PM
Demeter Dzadik (Mets) created this revision.
Demeter Dzadik (Mets) edited the summary of this revision. (Show Details)Jan 10 2022, 12:39 PM
Sybren A. Stüvel (sybren) requested changes to this revision.Jan 10 2022, 12:43 PM

The change: rBf9ccd26b037d. It resolves the issue that a None value caused a ValueError. However, I can't find anything about other reasons to raise that exception. This code is still in place:

PyErr_Format(PyExc_ValueError,
             "%.200s.path_resolve(\"%.200s\") could not be resolved",
             RNA_struct_identifier(self->ptr.type),
             path);

which means that the exception can still be raised. I think you simply need both the try/except clauses and the check for None.

release/scripts/modules/keyingsets_utils.py
247

Always use is None to compare with None, so if rna_property is None:

This revision now requires changes to proceed.Jan 10 2022, 12:43 PM

Silly mistake because of hurry!

This revision is now accepted and ready to land.Jan 10 2022, 1:00 PM