USD mesh sequence cache modifier doesn't update material indices #104683
No reviewers
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#104683
Loading…
Reference in New Issue
No description provided.
Delete Branch "makowalski/blender:usd-mesh-sequence-mtl-update"
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?
This pull request has been ported from patch http://developer.blender.org/D14087.
Fixed issue where the USD mesh reader invoked by the mesh sequence cache modifier does
not update material face sets when reading animating USD meshes with changing topology.
No longer checking the USD import parameters import_materials option to determine
whether to read the face sets, since that flag is always value-initialized to false
when the USD mesh reader is instantiated for the mesh sequence cache modifier.
Added a new
MOD_MESHSEQ_READ_MAT_FACE_SETS
enum for enabling reading material facesets. This flag is currently only used by the USD mesh reader (since the Alembic mesh
importer always reads material face sets by default).
Added a
read_mat_face_sets
RNA property definition to the modifier to allowsetting this flag in scripts.
To test: Load the attached
animating_mtl_subsets.usd
, which contains an animated mesh with changing topology and two materials assigned to geom subsets. Without this fix, the second material is lost after the first frame. With this fix, both materials are correctly assigned when playing all the frames.@mont29 This has the latest updates per your requests in https://archive.blender.org/developer/D14087
The only remaining question is whether an update to
do_version
is actually needed, per your last comment. I believe this might not be necessary, but please correct me if I misunderstood the issue.Is this describing a problem (like "even though it was set at import time, the modifier is no longer checking...") or is this a description of what the patch is doing ("originally the modifier checked the
import_materials
option, but it is no longer checking that now")?On a higher level, what would be the impact of always loading these face sets? Is there a practical benefit of not loading this data? Does it significantly impact performance?
And as a final (if admittedly somewhat rhetorical) question: is there a design task where there is an outline of which mesh data is considered optional and which will always be loaded? I think having such a design discussion would be nice, as then we can have a clear overview of the kinds of mesh data we're talking about, and can make Blender behave consistently across different file types.
USD mesh sequence cache modifier doesn't update material indices.to USD mesh sequence cache modifier doesn't update material indicesMy apologies for the delayed reply.
This is a description of what the patch is currently doing, i.e., that the modifier is no longer checking the
import_materials
option.It's hard to generalize about the performance impact of always loading face sets. Loading face sets requires computing bound materials per mesh, so the performance would depend on the number of meshes and materials and possibly also on the complexity of the USD composition. However, the optimization in this patch would only apply when reading materials is turned off, which is probably a less common use case.
There was no design task for this. Would you like me to keep this patch on hold pending such a discussion?
The reason I'm asking is to get a better understanding of this choice:
Another hypothetical solution for this would be to always properly initialise the
import_materials
flag, depending on what was chosen at import time (and maybe make it an option that can be toggled on theCacheFile
datablock). After all, when you import without materials, why should they all of a sudden be imported when the mesh topology changes?Maybe there's a good reason to do this, but this reasoning is not available in the PR description. Because of this, I think it's a good idea to discuss & agree upon such designs first, before looking at the code changes that might be necessary.
Without such explicit motivation for such choices, we'll no doubt have to deal with bug reports later, when Blender's behaviour isn't understood and considered a bug. If there is no explanation as to why it was implemented this way, it will be significantly harder to consistently answer such reports.
Checkout
From your project repository, check out a new branch and test the changes.