Fix T102615: crash on USD export for scenes with point clouds or hair

Code authored by Michael B Johnson (drwave).

Reviewed by Sybren and makowalski.

This patch addresses a crash that occurs when exporting a
scene to a USD file, when that scene includes a point cloud
object or hair.

Added OB_POINTCLOUD and OB_CURVES enums and a default case
statement in the switch statement in
USDHierarchyIterator::create_data_writer, to avoid dereferencing
a NULL pointer.

Differential Revision: https://developer.blender.org/D16776
This commit is contained in:
Michael Kowalski 2023-01-19 10:57:22 -05:00
parent 9b7c2cca3d
commit 90c6674f28
Notes: blender-bot 2023-02-14 06:00:46 +01:00
Referenced by issue #102615, USD: Crash when exporting a scene that includes a point cloud object
1 changed files with 5 additions and 0 deletions

View File

@ -118,10 +118,15 @@ AbstractHierarchyWriter *USDHierarchyIterator::create_data_writer(const Hierarch
case OB_LATTICE:
case OB_ARMATURE:
case OB_GPENCIL:
case OB_POINTCLOUD:
case OB_CURVES:
return nullptr;
case OB_TYPE_MAX:
BLI_assert_msg(0, "OB_TYPE_MAX should not be used");
return nullptr;
default:
BLI_assert_unreachable();
return nullptr;
}
if (!data_writer->is_supported(context)) {