Files
test2/source/blender/io/usd/intern/usd_hook.h
Bastien Montagne b684864561 Fix USD I/O crashing on reports by using new wmJob report system.
Calling `WM_report` & co API from wmJob worker thread is utterly unsafe,
and should never have been done. It 'worked' so far presumably because
worker threads were barely (if ever) reporting anything that way, but
now USD IO code is spamming reports in some cases, leading to fairly
common crashes.

Pull Request: https://projects.blender.org/blender/blender/pulls/113883
2023-10-20 11:08:27 +02:00

32 lines
1014 B
C++

/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
#include <pxr/usd/usd/stage.h>
#include <pxr/usd/usdShade/material.h>
#include <string>
struct Depsgraph;
struct ExportJobData;
struct Material;
struct ReportList;
struct USDExportParams;
namespace blender::io::usd {
/** Ensure classes and type converters necessary for invoking export hook are registered. */
void register_export_hook_converters();
/** Call the 'on_export' chaser function defined in the registered USDHook classes. */
void call_export_hooks(pxr::UsdStageRefPtr stage, Depsgraph *depsgraph, ReportList *reports);
/** Call the 'on_material_export' hook functions defined in the registered #USDHook classes. */
void call_material_export_hooks(pxr::UsdStageRefPtr stage,
Material *material,
pxr::UsdShadeMaterial &usd_material,
ReportList *reports);
} // namespace blender::io::usd