Page MenuHome

Fix T92120: Bone custom shape does not work with curve object meshes
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Oct 29 2021, 9:24 PM.

Details

Summary

This part of the drawing code assumes that the bone custom object
has only one evaluated geometry component, and it also uses the
object type to check which data to draw, with the functions like
DRW_cache_object_surface_get that just take an object input.
Those functions usually work on evaluaed objects, which use the
instancing system to access a temporary object with object.data
replaced.

That assumption used to work, but now curve, point cloud, or volume
objects can have an evalauted mesh, but that is not accessed with the
same object for usual drawing.

The "correct" solution for the way this code is structured would be to
loop through all of the geometry components and try to get GPU batches
from every one of them. However, that significantly increases complexity
in an area that should probably be refactored anyway. This patch treats
the mesh as a special case, and only draws the evaluated mesh.

The best solution in my opinion might be refactoring this area to
use the instancing system with some sort of viewport-only flag to
the custom shape instances aren't added in the render.

Diff Detail

Repository
rB Blender

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Oct 29 2021, 9:24 PM
Hans Goudey (HooglyBoogly) created this revision.
Hans Goudey (HooglyBoogly) retitled this revision from Fix T92120: Bone custom shape does not work with curve meshes to Fix T92120: Bone custom shape does not work with curve object meshes.Oct 29 2021, 9:35 PM

This feel safe for a quick workaround.

This revision is now accepted and ready to land.Nov 24 2021, 4:01 PM