From 44aae78956b46d8410247e90a6d2309930c03e1a Mon Sep 17 00:00:00 2001 From: OmarEmaraDev Date: Wed, 15 Nov 2023 22:01:24 +0200 Subject: [PATCH] Fix Set Keyframe node fails when path contains a subscript The Set Keyframe node always fails when the path contains a subscript. This is apparently due to a change in the AST python module, where slice object values can be directly accessed through the value attribute. --- CHANGELOG.md | 1 + animation_nodes/utils/path.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58e25ceea..c3fa60699 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ - Fixed incorrect loading of boolean mesh attribute. - Fixed *BMesh Mesh Data* not loading indices. - Fixed *Set Bevel Vertex Weight* and *Set Bevel Edge Weight* nodes for API changes. +- Fixed *Set Keyframe* node failing when path contains a subscript. ### Changed diff --git a/animation_nodes/utils/path.py b/animation_nodes/utils/path.py index 48a36dd4d..47c353424 100644 --- a/animation_nodes/utils/path.py +++ b/animation_nodes/utils/path.py @@ -25,7 +25,7 @@ def getResolvedNestedPath(id_block, path): def parsePath(expression): def split_internal(value): if isinstance(value, ast.Subscript): - return split_internal(value.value) + [f'["{value.slice.value.s}"]'] + return split_internal(value.value) + [f'["{value.slice.value}"]'] elif isinstance(value, ast.Attribute): return split_internal(value.value) + [value.attr] elif isinstance(value, ast.Name):