gltf: Use the new ShapeKey.points with faster foreach_get/set #105134
No reviewers
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
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-addons#105134
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Mysteryem/blender-addons:shape_key_points_gltf"
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?
Added to Blender 4.1.0 in blender/blender@7d77caab9b, ShapeKey.points
gives optimized access to shape key points data (meshes/lattices) when
accessed with #foreach_get and #foreach_set.
This patch updates gltf to use ShapeKey.points, speeding up accessing
shape key data with #foreach_get/#foreach_set about 100 times on average
because gltf is using compatible buffers.
Best I can tell,
squish(sk_vert_locs[sk_i])
will result in a C-contiguous buffer in this case and therefore will be compatible. If the goal ofsquish
is to ensure a compatible 1D buffer, it may be better to usenp.ndarray.ravel()
instead ofnp.ndarray.reshape()
becauseravel()
also ensures the result is contiguous.This PR should be fine as it is now, but I'm holding off on removing the WIP for a bit while I investigate why, out of the models I was profiling with, one of the heavier model's with large meshes and lots of shape keys takes 40s to export, both before and after.
Edit: That model exports in just under 6 seconds if I disable shape key normals. When exporting shape key normals, the slow access to shape key normals and the extra size and extra sorts (though
np.unique
) of thePrimitiveCreator.dots
array take about 31s. I think I have workarounds for both to reduce that 31s by quite a bit. I'll try and put some code and additional PRs together.WIP: gltf: Use the new ShapeKey.points with faster foreach_get/setto gltf: Use the new ShapeKey.points with faster foreach_get/setHello,
Let's close this PR, and continue discussion on PR you submitted in upstream repository:
https://github.com/KhronosGroup/glTF-Blender-IO/pull/2125
Pull request closed