Page MenuHome

Fix T84569: Crash when trying to bake an object with no faces
ClosedPublic

Authored by Habib Gahbiche (zazizizou) on Jan 16 2021, 12:56 PM.

Diff Detail

Repository
rB Blender

Event Timeline

Habib Gahbiche (zazizizou) requested review of this revision.Jan 16 2021, 12:56 PM
Habib Gahbiche (zazizizou) created this revision.

Thx!

I think this is generally true (even for baking to vertex colors?).
While it might be possible to keep the data around for vertex baking, there are all kinds of checks all around vertex paint code that also poll for me->totpoly != 0.
Not sure if there are possible usecases where vertexcolors could be relevant when having no faces?
I mean [having geometry nodes in mind] there could be uses for this, but at the moment - without faces - you also wont have a valid CustomData color layer.

So it might make sense to do this check -- regardless of R_BAKE_TARGET_IMAGE_TEXTURES or R_BAKE_TARGET_VERTEX_COLORS

Would like @Brecht Van Lommel (brecht) opinion here.

Otherwise LGTM.

Indeed, this test can be used for both image and vertex colors, I'll commit the fix with that minor change.

This revision is now accepted and ready to land.Jan 20 2021, 3:03 PM