Error reporting in modifiers #101091
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#101091
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?
D11591: Alembic: import arbitrary attributes adds some error reporting for attribute reading. It would be nice to formalize this, and extend it to be applicable in other areas, Alembic I/O or otherwise.
One area of improvement would be to stop outputting to the console while telling users to look it: on some platform, or depending on how Blender was started, there may not be a console readily available, and Blender would need to be restarted with a console.
This can fixed by using
ReportLists
where applicable.Further, modifiers should have the ability to carry multiple error messages as multiple things can go wrong (e.g. if multiple attributes could not be imported, we should have one error per attribute). This would be the responsability of modifier type. D15492: Modifiers: add a callback to copy the error message introduces some API for modifiers to manage their own errors.
Discussion summary
Rather than D15492, extend
ModifierData
with an optionalReportList*
which would help differentiate between info/warning/error, and have it all displayed in the UI generically.See P3197 for a quick implementation. Here is an example, based on D11591: Alembic: import arbitrary attributes:
Added subscriber: @kevindietrich
Added subscriber: @brecht
I think modifier could get a optional
ReportList*
instead of aconst char* error
, and then the modifier UI can show them with the appropriate icon for info/warning/error (same as the status bar for operators).Is D15492 mainly intended to display the error message in the attribute remapping panel rather than at the bottom of the modifier? I can see how that would avoid the error being scrolled out of view, but not sure it's worth doing something custom per modifier like that.
Added subscriber: @HooglyBoogly
If we were further along in the project of converting modifiers to nodes, I would suggest that we skip these complications, since the node warning system already supports these features.
Because Alembic import isn't a node, we can't rely on that though, so this seems reasonable. I just wanted to mention that because in the future this system should become unnecessary.
Added subscriber: @dr.sybren
Sounds like a good idea.
No, it was because I added some logic specific to the
MeshSequenceCache
error inside ofBKE_object_sync_to_original
in D11591 to copy the error message, so @dr.sybren asked to add a callback to modifiers for that, to keep specific things out of generic places, and split the change in a separate patch.The error message is actually displayed at the top of the modifier for some reason. I put it there because elsewhere was not working, but I don't remember why.
Why was the error not just put in
ModifierData.error
then?Unit tests were failing (it is mentioned in the patch description). Those errors are recoverable with the remapping system, so they are not really errors that should make unit tests fail (I am talking about added unit tests, not existing ones).
Ah ok, then using
ReportList*
to distinguish between info/warning/error may be a good fit.Regarding duplication with geometry nodes, I'm hoping that eventually we can get logs from modifiers, nodes, depsgraph, render all into the info editor. And so for that reason I think moving in the direction of using
ReportList
more makes sense, and especially here where code is shared with operators that already use it.So we are on the same page, here is what I quickly did (based on my alembic branch): P3197
And the result (2 attributes fail reading out of 13):
Added subscriber: @Rowan-Ibbeken
How would this deal when there are many errors? Is there some way that flooding the UI is prevented? Or can messages be grouped somehow? Was the UI module involved in this change?
The UI module was not involved with this change, although a couple core UI member (according to the #user_interface project page) have commented here.
For many errors, I guess we could use a dedicated panel which will only be displayed when there are some errors, and whose header will indicate that are errors. Although, we would need a dedicated error panel for each modifier type, if I understand how subpanels are setup via their parent id. I don't about other grouping mechanism which could be used.
I like that option too.
Messages like these IMO don't belong in the info editor, at least not if it would behave like printing to
stdout
. Since they're produced on every evaluation of the modifier, that could get spammy really quickly.That sounds a bit tricky, also in terms of UI/UX. Maybe just showing the first N errors and then collapse the rest under a "show more" button would be enough.
The main use case is users being able to see all warnings/errors in the current scene and fix them. For that indeed it should not work like stdout, but rather retain and replace the errors somehow per object, per depsgraph for cyclic dependency errors, etc.
I think this would work well as a new mode in the info editor, distinct from the current operator/property logging that works like stdout. And then you can imagine additional modes like render, viewport, memory usage, etc. I don't think we need a distinct editor for each.
👍 I can certainly see that working!
Also worth noting, there used to be a GSOC project that could be revived to extend the info editor: #78164 (GSoC 2020 Info Editor Improvements), with similar functionalities as the ones discussed here.
D15492 mentions this task has no clear conclusion. What I guess is remaining is how to deal with the UI in case of many reports?
I think a panel is the proper solution, I don't think we need a custom "show more" mechanism.
It seems reasonable to register an error subpanel for every modifier type, or all modifiers types that potentially report many errors.
We could support panel types having multiple parents, it's mainly the Python API that is not compatible with this. Panel types have a list of child panel types, and the subpanel type itself only needs to know if it has a parent or not. Not sure it's worth getting into this compared to just registering a panel for the handful of modifiers that need it though.
The problem with adding a subpanel for errors is that it isn't possible to display a sub-panel conditionally based on some modifier data, due to the way modifier panels are created.
If we're okay with the subpanel always displaying, that's okay, but that doesn't seem great to me.
Generally I'm not sure that it's worth putting that much effort into this right now, since modifiers will generally be implemented as nodes in the future, and in cases with many error messages, it would probably make more sense to go there instead anyway.
Don't panels like that have a
poll()
function?My main concern is to get the USD/Alembic improvements landed in time for Blender 3.5, since this is something users requests a lot. Error reporting in the existing modifier is not any better so I would not even consider improving that a blocker personally.
I definitely don't consider this blocking the Alembic/USD import patches. They're totally unrelated implementation-wise.
We shouldn't try to bundle these things together arbitrarily, holding important features like that hostage.
They do, but it takes the
PanelType
instead of thePanel
unfortunately, so knowing which modifier it applies to will be very hacky at best.I assumed there would be a
"modifier"
entry in the context that it would look at, not the panel.There isn't currently. Maybe that would work, though I'm not exactly sure where that would be set, based on where
PanelType::poll
is called.Anyway, I think it's fair to say it's not trivial, whatever that means for planning an implementation.
Only the Alembic attributes import patch depends on this. The Geometry Set patch depends in turn on the attributes one, but it's just about loading attributes for Curves and PointCloud. This little dependency can removed and either added to the other patch, or committed separately.
Then for the attributes patch, I could remove the dependency on this error reporting by revising the unit tests. Besides UI improvement, as noted in the past, there was the need to differentiate between various types of errors so we don't abort the unit tests while testing "recoverable errors" via the attribute remapping system.
We already show empty (sub)panels at least in the
MeshSequenceCache
modifier when there is noCacheFile
data block set (for the same problem of not being able to show them conditionally). So this is not unprecedented.I don't know about the timeline, but unless this happens in the next few months and all modifiers are simply gone, I think it does make sense to spend a bit of time improving the UI/UX here.