Regression: Python: World matrix for newly created objects is not identity #119250
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
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#119250
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: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3090/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 551.76
Blender Version
Broken: version: 4.2.0 Alpha, branch: main, commit date: 2024-02-23 23:00, hash:
06d3627c4398
Worked: version: 4.2.0 Alpha, branch: main, commit date: 2024-02-09 09:37, hash:
e20b2d2fb947
Short description of error
Newly crated objects via python (
bpy.data.objects.new()
) have degenerate (all 0) world matrixmatrix_world
instead of identity.Exact steps for others to reproduce the error
Run script in the attached file. The script creates new object and compares basis and world matrices to identity.
On 4.2.0alpha script raises and exception when comparing world matrix to identity.
On older stable versions no exceptions are raised.
Regression, Python: world matrix for newly created objects is not identityto Regression: Python: World matrix for newly created objects is not identityI can confirm that git bisect shows that
1c0f374ec3
is the first bad commit.so what I understood from commit's description is that blender no longer updates object matrices outside of depsgraph updates, requiring script writers linking object into any scene and forcing an update (which is rather heavy handed) or calculating valid matrix manually, which can very complicated if it's a linked object with constraints
CC @HooglyBoogly, this looks like a release blocker.
@lichtwerk @mod_moder I don't know if it's a formal policy, but for a high priority bug I think it's important to always CC the relevant developer, especially this close to the release.
@brecht @mod_moder : we do have it in the https://developer.blender.org/docs/handbook/bug_reports/triaging_playbook/ (under "Advanced Actions")
To be clear, this is only a problem in main, not the 4.1 release branch.
while that does address issue for new objects. it doesn't address issue of objects loaded from blend files via python to have default matrices prior update (reported by first comment), which shares the root cause. or would that require separate issue?
Seems like that should be a separate report. Indeed, when appending objects, the transforms won't be calculated until there's a depsgraph update.
@HooglyBoogly This may have caused this error (pic below), I fixed it in
39f3ea4ab0
c0f374ec3e3 made blender not to calculate world and local matrices before depsgraph update (which was all 0, before commit that resolved this issue), so I'm fairly certain that it's the case.
but I can't help but wonder as to why import script doesn't read whole world space matrix from fbx and doesn't update
matrix_world
which would force blender to recalculatematrix_local
?In Blender these matrices are calculated dynamically based on the original location, rotation, and scale, and various procedural effects like constraints, drivers, and the animation system. They aren't directly write-able.