Closed clement-nardi closed 5 months ago
Fixed with Version 4.1.1
Hi @RivinHD ,
Thank you for your prompt action on this bug!
Unfortunately I just tested the version 4.1.1 and I still have the font error when I try to edit the macros... I updated the add-on with the embedded updater.
Regards, Clément
I tested in Ubuntu 22.04 VM and everything works fine.
Is the error message the exact same? I.e. /datafiles/fonts/DejaVuSans.woff2
Hi!
Yes looks like the exact same callstack:
I tried to remove/reinstall the addon, and create a new recording, I still get the error.
Hi,
Can you run this script in the Text Editor?
/usr/share/blender/datafiles/fonts/DejaVuSans.woff2
)import bpy
import os
def get_font_path() -> str:
"""
get the font path of the active font in Blender
Returns:
str: path to the font
"""
if bpy.context.preferences.view.font_path_ui == '':
version = bpy.app.version
version_directory = os.path.dirname(bpy.app.binary_path)
for root, dirs, _ in os.walk(version_directory):
if len(root) and root.strip(" /\\").endswith("datafiles") and "fonts" in dirs:
version_directory = os.path.join(root, "fonts")
break
if version >= (4, 0, 0):
return os.path.join(version_directory, "Inter.woff2")
if version >= (3, 4, 0):
return os.path.join(version_directory, "DejaVuSans.woff2")
return os.path.join(version_directory, "droidsans.ttf")
else:
return bpy.context.preferences.view.font_path_ui
def oops(self, context):
self.layout.label(text=get_font_path())
bpy.context.window_manager.popup_menu(oops, title="Error", icon='ERROR')
print(get_font_path())
I get this:
Hey, I edit it, can you run this as described above and screenshot the output.
import bpy
import os
def get_font_path() -> str:
"""
get the font path of the active font in Blender
Returns:
str: path to the font
"""
if bpy.context.preferences.view.font_path_ui == '':
version = bpy.app.version
version_directory = os.path.join(
os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(bpy.__file__)))),
"datafiles",
"fonts"
)
if version >= (4, 0, 0):
return os.path.join(version_directory, "Inter.woff2")
if version >= (3, 4, 0):
return os.path.join(version_directory, "DejaVuSans.woff2")
return os.path.join(version_directory, "droidsans.ttf")
else:
return bpy.context.preferences.view.font_path_ui
def oops(self, context):
self.layout.label(text=get_font_path())
bpy.context.window_manager.popup_menu(oops, title="Error", icon='ERROR')
print(get_font_path())
I tested on Ubuntu with a Blender apt installation and the path was correct. Can you verify?
Yes this time the path is correct:
This should finally be fixed with Version 4.1.2
Describe the bug When I click on a macro element in the macro editor, I systematically get this error:
FileNotFoundError: [Errno 2] No such file or directory: 'datafiles/fonts/DejaVuSans.woff2'
To Reproduce Steps to reproduce the behavior:
Expected behavior I guess a pop-up should appear? I don't know since I'm using the addon for the first time.
Screenshots
Version Information:
Additional context I search my system for a file named DejaVuSans.woff2 and found these 2: /usr/share/blender/datafiles/fonts/DejaVuSans.woff2 /usr/share/fonts/woff2/dejavu/DejaVuSans.woff2
Note: After installing the add-on, when I tried to activate it I got an error about module ensurepip not being found. I solved this by running this command:
sudo apt install python3-pip python3-venv