Skip to content

Commit

Permalink
Fixed unset references menu
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielBoxer committed Jun 3, 2022
1 parent ec3650d commit c2d48b0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# BlenDir v0.17.0 <!-- omit in toc -->
# BlenDir v0.17.1 <!-- omit in toc -->

**BlenDir** is a Blender add-on for automatic folder structure creation and management!

Expand Down
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"author": "Daniel Boxer",
"description": "Automatic folder structure",
"blender": (2, 90, 0),
"version": (0, 17, 0),
"version": (0, 17, 1),
"location": "View3D > Sidebar > BlenDir",
"category": "System",
"doc_url": "https://github.com/DanielBoxer/BlenDir#readme",
Expand Down
3 changes: 2 additions & 1 deletion blendir_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,10 @@ def open_bookmarks():


def get_references():
ref_path = pathlib.Path(bpy.context.scene.blendir_props.reference_path)
ref_path = bpy.context.scene.blendir_props.reference_path
references = []
if ref_path != "":
ref_path = pathlib.Path(ref_path)
for ref in os.listdir(ref_path):
if (ref_path / ref).is_file():
references.append(ref)
Expand Down
13 changes: 8 additions & 5 deletions blendir_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,11 @@ class BLENDIR_MT_references(Menu):
def draw(self, context):
pie = self.layout.menu_pie()
for ref_idx, ref in enumerate(get_references()[0]):
pie.operator(
"blendir.reference",
text=ref,
icon="FUND",
).reference = str(ref_idx)
if ref_idx < 8:
pie.operator(
"blendir.reference",
text=ref,
icon="FUND",
).reference = str(ref_idx)
else:
break

0 comments on commit c2d48b0

Please sign in to comment.