Skip to content

Commit

Permalink
Fix Set Keyframe node fails when path contains a subscript
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
OmarEmaraDev committed Nov 15, 2023
1 parent 1c9bf68 commit 44aae78
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion animation_nodes/utils/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 44aae78

Please sign in to comment.