Cycles: Fix Principled BSDF versioning for keyframes and drivers #114300

Merged
Lukas Stockner merged 1 commits from LukasStockner/blender:fix-principled-animdata into blender-v4.0-release 2023-11-01 19:27:59 +01:00
Member

This is a last-minute patch to address #113898.

The base logic is there, but it has some remaining issues:

  • Drivers/keyframes don't transfer to the extra nodes in automatic conversion setups (probably fine)
  • Drivers/keyframes on Sheen Tint/Specular Tint only apply to the R channel, since they changed from float to color (probably fine)
  • Drivers/keyframes for removed sockets (Transmission Roughness, Subsurface Color) stay in the file. Not sure how to clean them up properly, for now I set their index to -1 so that they become invalid instead of affecting an unrelated socket.
  • The versioning-test.blend from the linked bug discussion crashes on opening. No idea why, to be honest. My own test file works.

I'm at my limit for knowledge of the animdata system - considering the urgency here, it'd be great if @brecht (or someone else) could pick this up.

This is a last-minute patch to address #113898. The base logic is there, but it has some remaining issues: - Drivers/keyframes don't transfer to the extra nodes in automatic conversion setups (probably fine) - Drivers/keyframes on Sheen Tint/Specular Tint only apply to the R channel, since they changed from float to color (probably fine) - Drivers/keyframes for removed sockets (Transmission Roughness, Subsurface Color) stay in the file. Not sure how to clean them up properly, for now I set their index to -1 so that they become invalid instead of affecting an unrelated socket. - The `versioning-test.blend` from the linked bug discussion crashes on opening. No idea why, to be honest. My own test file works. I'm at my limit for knowledge of the animdata system - considering the urgency here, it'd be great if @brecht (or someone else) could pick this up.
Lukas Stockner added this to the 4.0 milestone 2023-10-31 05:44:12 +01:00
Brecht Van Lommel was assigned by Lukas Stockner 2023-10-31 05:44:12 +01:00
Lukas Stockner force-pushed fix-principled-animdata from 97dc0de163 to 4f54ad4f5e 2023-11-01 05:29:32 +01:00 Compare
Lukas Stockner changed title from WIP: Cycles: Fix Principled BSDF versioning for keyframes and drivers to Cycles: Fix Principled BSDF versioning for keyframes and drivers 2023-11-01 05:29:36 +01:00
Author
Member

The crash was solved by moving the logic to do_versions_after_linking_400.

Also, I've added code to remove animdata for the removed sockets, it turned out to be easier than expected.

The crash was solved by moving the logic to `do_versions_after_linking_400`. Also, I've added code to remove animdata for the removed sockets, it turned out to be easier than expected.
Brecht Van Lommel requested changes 2023-11-01 15:15:49 +01:00
@ -245,0 +260,4 @@
BKE_animdata_fix_paths_remove(id, (prefix + "[18]").c_str());
BKE_animdata_fix_paths_remove(id, (prefix + "[3]").c_str());
};
BKE_animdata_main_cb(bmain, remove_old_inputs, &prefix);

This looks like it loops over all node trees in the file, not just this one?

This looks like it loops over all node trees in the file, not just this one?
Author
Member

Yes, seems like it does. However, as far as I can tell, BKE_animdata_fix_paths_rename_all_ex does the same - the nodetree ID that is being passed into it is only used in one bone-specific check in drivers_path_rename_fix, which doesn't apply here. And that function is used for existing node versioning.

For the test file from the report, everything actually also works if we don't use BKE_animdata_fix_paths_rename_all_ex and BKE_animdata_main_cb for iteration, and instead just call BKE_animdata_fix_paths_remove/BKE_animdata_fix_paths_rename directly on the nodetree.
But I guess there is some reason to have the iteration in the original code? Not sure how all the ownership works here.

I'll update the code to skip the iteration for now, since it still seems to work.

Yes, seems like it does. However, as far as I can tell, `BKE_animdata_fix_paths_rename_all_ex` does the same - the nodetree ID that is being passed into it is only used in one bone-specific check in `drivers_path_rename_fix`, which doesn't apply here. And that function is used for existing node versioning. For the test file from the report, everything actually also works if we don't use `BKE_animdata_fix_paths_rename_all_ex` and `BKE_animdata_main_cb` for iteration, and instead just call `BKE_animdata_fix_paths_remove`/`BKE_animdata_fix_paths_rename` directly on the nodetree. But I guess there is some reason to have the iteration in the original code? Not sure how all the ownership works here. I'll update the code to skip the iteration for now, since it still seems to work.
Lukas Stockner force-pushed fix-principled-animdata from 4f54ad4f5e to 48c66be4ed 2023-11-01 19:05:49 +01:00 Compare
Brecht Van Lommel approved these changes 2023-11-01 19:09:55 +01:00
Lukas Stockner merged commit 0b81a163e2 into blender-v4.0-release 2023-11-01 19:27:59 +01:00
Lukas Stockner deleted branch fix-principled-animdata 2023-11-01 19:28:01 +01:00
Lukas Stockner added this to the Render & Cycles project 2023-11-01 19:28:21 +01:00
Sign in to join this conversation.
No reviewers
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 Assignees
2 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#114300
No description provided.