Pose Breakdowner bug in Gooseberry rigs #44219
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
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#44219
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?
breakdowner_bug.blend
Hi I've attached a file with Victor's rig.
I'm sorry for not simplifying this, but it is a bug that I have known of for a very long time but was never able to recreate. Now I finally have an action where it pops up.
Just open the file and press shift+E (breakdowner), move the mouse a bit to modify the pose, and you'll most likely notice that the custom property that the bone has gets modified by the breakdowner. The bad thing is that this property drives the Rotation Order, so this issue can cause huge animation problems.
Just to make this clear, you'll notice that in the action the property is keyed and changes its values, well, those changes happened randomly, it wasn't Beorn who modified those values manually.
So, the thing is that the breakdowner makes values of bone custom properties jump "randomly".
Changed status to: 'Open'
Added subscriber: @jpbouza-4
Added subscriber: @LukasTonne
The issue is caused by an fcurve animating the
rotation_mode
property. This is probably not intentional, but since it's generally allowed it should be handled gracefully. When using the "breakdowner" tool the fcurve at some point sets an invalid enum value outside the allowed -1..6 range for rotation modes:https://developer.blender.org/diffusion/B/browse/gooseberry/source/blender/makesrna/intern/rna_pose.c$275
This leads to invalid access of the static
rotOrders
array and subsequent random memory and crash.https://developer.blender.org/diffusion/B/browse/gooseberry/source/blender/blenlib/intern/math_rotation.c$1375
Added subscriber: @ideasman42
@ideasman42: How can we ensure fcurves on enum properties don't cause undefined results? Should this be handled at fcurves, RNA or BLI_math?
Added subscriber: @BeornLeonard
If I understand this correctly, the undefined results causes a crash.
So we have two issues, this crash, and the original cause of the bug report, which is that the Breakdowner should not change the value of this custom property.
Furthermore, if you have two keys in the property, with a value of 1.0, when the breakdowner supposedly interpolates between 1.0 and 1.0, it might throw a value different to 1.0, which doesn't make sense... (at least from a simple user point of view)
Added subscriber: @JoshuaLeung
Dont see a really nice way to resolve this...
The correct solution is likely to be:
FCurve code would get the enum. Search for the value and check it exists in the enum, - before assigning.
However this would give some reasonable overhead- especiallty for dynamically allocated enums.
We could instead define that animatable enums must clamp their input in the set function.
I just spotted this last night.... (Why I didn't notice it before is another matter)
Having had a look this morning, the fix would be simple if the custom properties in question were proper enums (and not ints). Specifically, that would open up two possibilities:
While this still wouldn't solve the issue of invalid values getting used via other places (i.e edited FCurves), it would solve the immediate problem here. What is unclear though is whether custom properties can be defined in a way that they adopt the enum values from another enum. Maybe it's possible, maybe not; I'm not familiar enough with bpy to say.
As for the second (and more serious issue) with RNA:
Indeed, it does look like having the FCurve code check whether it's about to set a valid value is one of the better options considering what else goes on in Blender. I'm not sure how the Python API does it, but I'm sure it has to do something similar since it throws exceptions about this, while the UI generally doesn't have this problem (since it only shows valid values anyway).
Dynamic enums are an issue too of course. If we have a way of knowing the size in advance for these (without having to just generate them), maybe we could guess? Otherwise, we may just leave these unclamped.
Initially, I was leaning towards favouring making the RNA set callbacks check their own values themselves. In theory, they should know best what to expect, and this may allow some optimisations. The only problem is that this does also result in makesrna generating a lot more code to perform all this checking, meaning that our binary sizes are likely to see another good bump. Another potential issue is that, by introducing the check at RNA level, any other checks performed elsewhere will now result in a double-up of checking, which is a slight performance cost. That said, in the interests of having a good + solid API, putting these checks there is the best option, since any other RNA frontends which may crop up (e.g. the C++ api, extra language bindings?) will all have these abilities baked in by default. Somewhat negating that argument though is that we don't have any plans to introduce anything more ;)
Finally, regarding @jpbouza-4's point about 1.0 to 1.0: Good point! Those checks should be simple to add
OK... well if it makes things simpler, I would also contemplate the possibility that the breakdowner doesn't take into account custom properties!
After all, the tool is called "pose breakdowner". not property breakdowner!
If you think of it, this feature is meant for animation, and custom properties belong more to the rigging world than to any other...
What I want to say is that I wouldn't go crazy finding a solution to this, even less if it impacts on performance... I don't think anyone would use the breakdowner to interpolate custom properties values... it's more simple to just set the numbers manually.
@jpbouza-4: Well, IIRC rigs like the Sintel rigs and/or some of the rigify-based ones (last time I checked) are heavily reliant on custom properties for facial animation. So in those cases, custom properties aren't just tools for riggers to use to define the rig, but end up playing an integral role in defining what the pose should be! Hence, it makes sense for those that the breakdowner can be used.
Ok you win, just don't make blender slower :p
It would be good to double check that. Rigify rigs use transforms for posing, and custom props for properties, like IK/FK and hinges, which you don't need to be included in the breakdowner..
From memory, the Sintel rig did indeed use custom properties for facial stuff. However, I can't double check that now, as last time I checked, the Sintel rig didn't work in the current Blender.
The point jpbouza makes is a valid one. There should be a separation between properties and pose controls, but maybe the solution is in how the rig is setup and/or whether the animator is using keying sets. (which I think most of us don't)
I've just committed two partial fixes which resolve some of the most immediate issues noted here, but not the underlying RNA problem. That is:
I've looked into adding some of the relevant checks into the animsys_write_setting() function for enums, but quickly discovered the problem of what should happen if we encounter an invalid value. If we simply skip setting values, this does lead to non-threadsafe behaviour (i.e. if it doesn't change the value when jumping around, the value you'll have will depend on what order you visited the frames in).
Added subscriber: @JulianEisel
@JoshuaLeung, so what do you think, is this fixable? Let's move it to the todo if not.
Changed this to a todo.
Added subscriber: @ChrisLend
Changed status from 'Confirmed' to: 'Resolved'
This can be seen as resolved.
The issue with RNA goes deeper and would need a Design task, but it hasn't been an issue since.
Except that there is a regression that enum properties crash blender #82669