Regression: New Principled BSDF does not load keyframes or drivers correctly from prior versions #113898

Closed
opened 2023-10-18 17:25:50 +02:00 by Len-Krenzler · 10 comments

System Information
Operating system: Windows
Graphics card: RTX 4060Ti

Blender Version
Broken: 4.0
Worked: 3.6
4.0 does not load keyframes for "Alpha" slider in the Principled BSDF from 3.6.

Exact steps for others to reproduce the error
Add keyframes for Alpha such as 1 to 0 in Blender 3.6. Load project in 4.0. Keyframes for Alpha are there but do not contain the information. For example, it will stay at 1 and not go to zero as it should.

**System Information** Operating system: Windows Graphics card: RTX 4060Ti **Blender Version** Broken: 4.0 Worked: 3.6 4.0 does not load keyframes for "Alpha" slider in the Principled BSDF from 3.6. **Exact steps for others to reproduce the error** Add keyframes for Alpha such as 1 to 0 in Blender 3.6. Load project in 4.0. Keyframes for Alpha are there but do not contain the information. For example, it will stay at 1 and not go to zero as it should.
Len-Krenzler added the
Priority
Normal
Status
Needs Triage
Type
Report
labels 2023-10-18 17:25:50 +02:00
Member

Hi, thanks for the report. I can confirm. Could it be due to new panel interface? or some api/versioning code changes? I'll bisect.

Hi, thanks for the report. I can confirm. Could it be due to new panel interface? or some api/versioning code changes? I'll bisect.
Member

Broke between fca8df9415b1 - 264c3e7bd7a6

Broke between `fca8df9415b1 - 264c3e7bd7a6`
Hans Goudey added
Type
Bug
and removed
Type
Report
labels 2023-10-19 09:53:04 +02:00

Attaching a file to test both Keyframes and Drivers from 3.6 to 4.0. These are different f-curves that both need to be handled.

The original file from 3.6 starts with a Driver in Metallic (.input[6]) and Keyframes on Specular Tint (.inputs[8]) and Alpha (.inputs[21]).

When loading into 4.0 here's what happens:

  • The driver will be lost as .inputs[6] is no longer present
  • The Keyframes on Specular Tint now control the Subsurface Radius "r" value (as this is the new .inputs[8] value)
  • The Keyframes on Alpha now control the Coat Tint color (as this is the new .inputs[21] value)
Attaching a file to test both Keyframes and Drivers from 3.6 to 4.0. These are different f-curves that both need to be handled. The original file from 3.6 starts with a Driver in Metallic (.input[6]) and Keyframes on Specular Tint (.inputs[8]) and Alpha (.inputs[21]). When loading into 4.0 here's what happens: - The driver will be lost as .inputs[6] is no longer present - The Keyframes on Specular Tint now control the Subsurface Radius "r" value (as this is the new .inputs[8] value) - The Keyframes on Alpha now control the Coat Tint color (as this is the new .inputs[21] value)
Jesse Yurkovich changed title from New Principled BSDF does not load keyframes for Alpha from projects from 3.6. to New Principled BSDF does not load keyframes or drivers correctly from prior versions 2023-10-19 21:45:19 +02:00
Member

Git bisect points to 88ad79c2d1
@Alaska ^

Git bisect points to 88ad79c2d19b0dc705df06cebf6829cf31f62aaa @Alaska ^
Pratik Borhade changed title from New Principled BSDF does not load keyframes or drivers correctly from prior versions to Regression: New Principled BSDF does not load keyframes or drivers correctly from prior versions 2023-10-20 08:20:59 +02:00
Member

I'm sorry, I don't know how to fix this issue. My knowledge of this area of Blenders code is limited.

I'm trying to figure out how to create a fix, but I haven't found anything useful yet. If someone would like to provide guidance or fix this issue, then feel free to do so.

I'm sorry, I don't know how to fix this issue. My knowledge of this area of Blenders code is limited. I'm trying to figure out how to create a fix, but I haven't found anything useful yet. If someone would like to provide guidance or fix this issue, then feel free to do so.
Member

if you know how the socket names (before and after), you could probably use something like BKE_animdata_fix_paths_rename_all / BKE_action_fix_paths_rename ?

if you know how the socket names (before and after), you could probably use something like `BKE_animdata_fix_paths_rename_all` / `BKE_action_fix_paths_rename` ?
Brecht Van Lommel added
Module
Render & Cycles
and removed
Module
Animation & Rigging
labels 2023-10-20 17:30:27 +02:00

It should be fixed using version_node_socket_index_animdata, search the code for an example where this was used for the Principled BSDF. It's pretty bad that the RNA path uses the index instead of the socket name, but not going to change for 4.0.

@LukasStockner can you take care of this? Unless @Alaska fixes it first :)

It should be fixed using `version_node_socket_index_animdata`, search the code for an example where this was used for the Principled BSDF. It's pretty bad that the RNA path uses the index instead of the socket name, but not going to change for 4.0. @LukasStockner can you take care of this? Unless @Alaska fixes it first :)
Member

I've tried some experiments, and thanks to Jesse Yurkovich for providing some guidance on blender chat, but I haven't had much luck getting a fix working. I'll keep experimenting, it's a good learning experience, but it's probably best that this gets fixed by someone more knowledgeable, especially if I'm having trouble getting some basic stuff working.

I just wanted to add a note that might help anyone that works on this.
Not only do we have to copy animation data and drivers between re-ordered sockets, we also need to copy this data between nodes and new data types. Examples:

  • If a file is saved in 3.6 and has a node connected to the base color, and the specular tint is set to something other than 0, then a mix node will be added, where the factor is the old specular tint and the output is connected to specular tint. We need to copy the animation data and drivers to the factor in the mix node.
  • If a file is saved in 3.6 and has a animated specular tint and/or base color, but no nodes connected to the Principled BSDF, then the versioning code for the specular tint will merge the specular tint value and base color together to create a material that looks similar to 3.6. We need to combine the animation data in this case to make sure it works. (It might be easier to add a mix node in this case and copy the animation data out to the mix ndoe)
I've tried some experiments, and thanks to Jesse Yurkovich for providing some guidance on blender chat, but I haven't had much luck getting a fix working. I'll keep experimenting, it's a good learning experience, but it's probably best that this gets fixed by someone more knowledgeable, especially if I'm having trouble getting some basic stuff working. I just wanted to add a note that might help anyone that works on this. Not only do we have to copy animation data and drivers between re-ordered sockets, we also need to copy this data between nodes and new data types. Examples: - If a file is saved in 3.6 and has a node connected to the base color, and the specular tint is set to something other than 0, then a mix node will be added, where the `factor` is the old specular tint and the output is connected to specular tint. We need to copy the animation data and drivers to the factor in the mix node. - If a file is saved in 3.6 and has a animated specular tint and/or base color, but no nodes connected to the Principled BSDF, then the versioning code for the specular tint will merge the specular tint value and base color together to create a material that looks similar to 3.6. We need to combine the animation data in this case to make sure it works. (It might be easier to add a mix node in this case and copy the animation data out to the mix ndoe)

While ideally we would support copying animation data to other nodes, we can accept some imperfect compatibility. I think the main thing is to update the animation data on the Principled BSDF node itself.

While ideally we would support copying animation data to other nodes, we can accept some imperfect compatibility. I think the main thing is to update the animation data on the Principled BSDF node itself.
Brecht Van Lommel added this to the 4.0 milestone 2023-10-23 12:19:34 +02:00
Member

Fixed with #114300 / 0b81a163e2.

Not updating automatically generated conversion setups is accepted as a known limitation for now.

Fixed with #114300 / 0b81a163e2560a3f72a512ad00d101af54081868. Not updating automatically generated conversion setups is accepted as a known limitation for now.
Lukas Stockner self-assigned this 2023-11-01 19:30:19 +01:00
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2023-11-01 19:31:14 +01:00
Sign in to join this conversation.
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
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#113898
No description provided.