Start getting Blender default Font in Text rendering after long use #113044
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#113044
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information:
Operating system: "Debian GNU/Linux"
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
CPU(s): 2
We are using Kubernetes to deploy our blend Application.
Blender Version:
Used bpy 3.5 package published in PyPI
link: https://pypi.org/project/bpy/3.5.0/
Description of error:
If there is a single pod available for a long time then after a certain no of file rendering [50k approx]. We start getting font problems. Every time we have received the same Blender default font in output .
We face problems with random blend files. Even if two blend files have the same font used one may work and the other may not.
After this affected file always gives rendered output with default font.
When issues start occurring we get
Too many fonts!!!
in the log multiple times.This log has no fixed count.
After the pod restarts the same file starts working fine.
The same issue was reported by me here
steps to reproduce the error
Keep blend file with fonts and images in a folder. read blend file as.
bpy.ops.wm.open_mainfile(filepath='')
render file using bpy package after updating text into it.
Please help me to fix this. This we have been facing for a long. After the Blender version upgrade [which was suggested in the last ticket] from 3.0 to 3.5 it still persists. But frequency has reduced.
Since
d39abb74a0
, we should have a maximum number of 64 fonts.#define BLF_MAX_FONT 64
If I understand correctly, you never have more than ~64 fonts in one .blend file?
These just dont get "freed" when loading another .blend file, right?
@Harley might be interested
CC @ISS
hey @lichtwerk ,
Thanks for your Quick reply.
Too many fonts!!!
@alokkrchoudhary does this happen only when you render using BPY package? To reproduce we will need the .blend file and best would be to share fonts too if their license permits that.
This is definitely an error of ours.
We maintain the list of current fonts in an array called
global_font
with a size of 64. We assign a font id to this when opening a font, and remove them with calls to BLF_unload, BLF_unload_id, and BLF_unload_all.We clear the list in
BLF_init()
, called only from WM_init. This is in our main function, only called when the program starts up. We also clear the list inBLF_exit()
, but this similarly only called in WM_exit in our main function when closing down.Therefore, as illustrated in this complaint, if you start Blender, load a blend file that uses 40 unique fonts, then load a blend file containing 40 different fonts, you could get that "Too many fonts!!!."
We could find suitable places to call both BLF_exit() and BLF_init() when loading new files. These functions also initialize and deinitialize FreeType and we may not want that. and we don't want to strand any open FontBLFs.
BLF_unload_all() does safely clear global_font and properly frees the fonts. But this also frees the interface font. uiStyleInit() calls this and also loads the interface fonts, but this also assumes it is run just once and might keep adding to U.uistyles.
UI_style_init_default() clears U.uistyles and creates them again, including calling BLF_unload_all. But odd to deal with UI fonts when fixing a problem with the other fonts. And we might not be loading the file with UI, in which case we don't want to start using a potentially different UI font.
Needs some careful thought.
hey @Harley,
Thanks a lot for the fix.
I want help/clarity with two things here:
As explained by you in the above comment:
Therefore, as illustrated in this complaint, if you start Blender, load a blend file that uses 40 unique fonts, then load a blend file containing 40 different fonts, you could get that "Too many fonts!!!."
In this way, you are using a total of 80 different fonts to reproduce the issue but we have a specific limited set of fonts not more than 20. Once these are used for a long time then we start getting issues. Even the same font with one file works but with another file it doesn't. So will this fix be helpful here.
As shared in issue description:
Used bpy 3.5 package published in PyPI
link: https://pypi.org/project/bpy/3.5.0/
I can see your fix PR is merged with
blender-v4.0-release
branch but I am using bpy==3.5.0 from PyPI. Can I expect the latest package available soon with the fix?Thanks and regard
Alok
@alokkrchoudhary - So will this fix be helpful here.
This change was needed in that our font list was not cleared when loading new blend files. To know whether it truly solves all your issues (because you could have more than one), it would be best for you to test it yourself. Nightly builds on the buildbots for 4.0 Beta and 4.1 Alpha contain this change.
Besides going into 4.0 and 4.1 and newer, this fix will likely go into a future point release of 3.6 since that is a long-term support release. Probably for 3.6.5.
okay @Harley ,
I will wait for
bpy 3.6.5 PyPi package
which will include the fix. Once that is published I will test my setup and if the issue is found I will report again.Thanks.
OK, I have added the fix to the LTS backport list #109399 now.
Will close this report then, 3.6.5 should be out Oct 17, 2023, the pypi package should probably be out soon after
hey @lichtwerk ,
We would like to know about the status of the pypi package [bpy= 3.6.5] with the mentioned fix. Is there a planned release for this package or are there any known delays? We are experiencing issues randomly with the current package.
Thanks.
Alok
I have to apologize, seems
bpy
is only build for full releases (so 4.0 would be next, this is scheduled for Nov 14, 2023).I'll try to find out if we can built this more often (also for point releases).
Okay, Thanks for the details :)