Skip to content

Commit

Permalink
fix context override breaking api changes
Browse files Browse the repository at this point in the history
0.6.0 - 2023-12-13

- fixed: api changes for Blender 4.0.0
  • Loading branch information
Pullusb committed Dec 13, 2023
1 parent 258f893 commit 9b8d259
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Changelog

0.6.0 - 2023-12-13

- fixed: api changes for Blender 4.0.0
- added: lots of snippets since last version

0.5.6 - 2022-10-01

- changed: default preview line display 10 > 25
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ It can be usefull after conversion on external editors (see Conversion above)

Thanks to [tin2tin](https://github.com/tin2tin) for the feedbacks

<!--
---
Expand All @@ -111,4 +112,4 @@ or just an enum/list of the current folders to choose what to scan
- Maybe avoid scan doubles.
- TabTrigger : use the tabstop syntax on snippets to jump the cursor after insertion in blender. (Very hard to implement...)
- quick insert : Double click to insert (with UIlist only an ugly modal on each clic or and operator in list but operator force center the text...)
- online lib : Make some sort of repo where every user can pull-push snippets...(super difficult)
- online lib : Make some sort of repo where every user can pull-push snippets...(super difficult) -->
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"name": "Snippets Library",
"description": "Add a library list to quickly load/save personnal texts snippets from text editor",
"author": "Samuel Bernou",
"version": (0, 5, 6),
"version": (0, 6, 0),
"blender": (3, 0, 0),
"location": "Text editor > toolbar (ctrl+T) > Snippets tab",
"warning": "",
Expand Down
6 changes: 5 additions & 1 deletion func.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ def path_to_display_name(fp):
return splitext(basename(fp))[0].replace('_', ' ')#display name

def insert_template(override, src_text):
bpy.ops.text.insert(override, text=src_text)
if bpy.app.version < (4,0,0):
bpy.ops.text.insert(override, text=src_text)
else:
with bpy.context.temp_override(**override):
bpy.ops.text.insert(text=src_text)

def scan_folder(fp):
'''take a filepath (location of the files) and return a list of filenames'''
Expand Down

0 comments on commit 9b8d259

Please sign in to comment.