From da7e7a0e80ea4cc1f3dad985ca4101f09d32fb7e Mon Sep 17 00:00:00 2001 From: Jesse Yurkovich Date: Fri, 27 Dec 2024 21:46:48 +0100 Subject: [PATCH] Fix: Handle null Action during armature export Regressed during fix for [1]. A null action is possible so we need to provide a default name when this happens. [1] 69c63311fa2 Pull Request: https://projects.blender.org/blender/blender/pulls/132381 --- source/blender/io/usd/intern/usd_writer_armature.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/io/usd/intern/usd_writer_armature.cc b/source/blender/io/usd/intern/usd_writer_armature.cc index 37686cd5d44..be65a205a26 100644 --- a/source/blender/io/usd/intern/usd_writer_armature.cc +++ b/source/blender/io/usd/intern/usd_writer_armature.cc @@ -187,7 +187,8 @@ void USDArmatureWriter::do_write(HierarchyContext &context) if (usd_export_context_.export_params.export_animation) { /* Use the action name as the animation name. */ const animrig::Action *action = animrig::get_action(context.object->id); - const pxr::TfToken anim_name(make_safe_name(action->id.name + 2, allow_unicode)); + const pxr::TfToken anim_name(action ? make_safe_name(action->id.name + 2, allow_unicode) : + "Action"); /* Create the skeleton animation primitive as a child of the skeleton. */ pxr::SdfPath anim_path = usd_export_context_.usd_path.AppendChild(anim_name);