Memory leak when exporting to gltf (using blender as a python module) #116319
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
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
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
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
EEVEE & Viewport
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
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#116319
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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: MacOS Ventura
Operating system: Linux-6.6.8-200.fc39.x86_64-x86_64-with-glibc2.38 64 Bits, X11 UI
Blender Version
bpy 4.0.0
bpy version: 4.1.0 Alpha, branch: main, commit date: 2024-01-21 18:49, hash:
3df7939eec96
Short description of error
Memory leak when exporting to gltf (using blender as a python module)
Exact steps for others to reproduce the error
bpy
as a python module (following https://developer.blender.org/docs/handbook/building_blender/python_module/ or through other sources such as pip)Original Report
I'm using
bpy
(4.0.0
) to convert USDZ to GLB and my script is showing errors like this when exiting:I'm new to Python and Blender so i'm assuming i need to free memory somewhere, but i'm not sure what's causing it, I've tried resetting Blender to factory settings before the program exits as well as setting
iFile
toNone
and deleting it.I've also tried to call
gc.collect()
explicitly but that didn't help, I checkedgc.garbage
but it is empty ([]
).I'm thinking maybe there is an issue with
usd_import
or maybeexport_scene
?The script
Do you get the same leaks reported when you do the steps manually?
If so, at which step does this occur?
the
usd_import
?the
export_scene.gltf
?Might also help if you attach an example USDZ (since I cannot reproduce with a simple test file here)
If i only run
usd_import
there is no error, it only happens if i call theexport_scene.gltf
I've attached both filed that i've tried this with, both give me the memory error.
Note that the converted
gecko
has the eyes texture floating way above where they are supposed to be and thealberto
looks much darker, not sure how this could be fixed but i guess thats a different discussion.I cant spot leaks using the provided files when doing this through blenders UI.
@Julie-Fabre : do you also get leaks reported when you do this from inside blender?
So you only get the memory leaks when using blender as a python module?
I haven't tried through the UI I don't have that installed I don't know how to use it I just need to use it through scripting since it's for a web app, but I guess I can give it a try and figure it out just to rule things out, I'll report back.
So it seems inside blender no errors pop up so i guess this just happens using blender as a python module.
Any ideas how to solve this?
Memory leak when working with USDZ filesto Memory leak when working with USDZ files (when using blender as a python module)Will have to check again with blenderas a python module (sorry this has been lying around for a bit...)
Sorry again this took a while to answer.
Can confirm now (using a selfmade build of the bpy module following https://developer.blender.org/docs/handbook/building_blender/python_module/)
Please note this from the documentation though:
However, I assume this should still be looked at.
For this, we should simplify the report description (will do) since this only affects the gltf/glb export (has nothing to do with USD, can also be reproduce with just the startup file, other exporters such as alembic or FBX dont have the same issue, see below).
So this already triggers it:
This also might have to be moved to the Addon repository (not sure yet), but will leave in the blender repository since this only happens when using
bpy
as a python module@JulienDuroure , @ideasman42 : does this ring a bell?
Memory leak when working with USDZ files (when using blender as a python module)to Memory leak when exporting to gltf (using blender as a python module)Hello,
It's the first time someone reported this leak.
I can confirm that I can't see anything when import / export from Blender UI, but not sure if there are so many users using bpy as a py module, that can explain why it was not reported before.
Maybe Campbell will have more information
Hi guys, any update on this? Anything i can do?
@lichtwerk @JulienDuroure any update?