Commit 0df5d8220b made a change to have the `USDStageReader` only keep
a reference to the ImportSettings struct. This isn't safe to do because
there's scenarios where the ImportSettings might be defined as a stack
variable but the reader outlives the lifetime of that variable. This
happens inside `USD_create_handle` where the reader is returned to the
caller for instance.
Fix this, and the original issue which lead to the change causing the
regression, by having `USDStageReader` own ImportSettings directly so
it's more obvious that it is A) tied to the lifetime of the reader and
B) can no longer become out of sync with a caller's own ImportSettings
data (since that no longer exists).
Pull Request: https://projects.blender.org/blender/blender/pulls/132095
28 lines
813 B
C++
28 lines
813 B
C++
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
#pragma once
|
|
|
|
#include <pxr/usd/usd/common.h>
|
|
#include <pxr/usd/usdLux/domeLight.h>
|
|
|
|
struct Main;
|
|
struct Scene;
|
|
|
|
namespace blender::io::usd {
|
|
|
|
struct USDExportParams;
|
|
struct USDImportParams;
|
|
|
|
void world_material_to_dome_light(const USDExportParams ¶ms,
|
|
const Scene *scene,
|
|
pxr::UsdStageRefPtr stage);
|
|
|
|
void dome_light_to_world_material(const USDImportParams ¶ms,
|
|
Scene *scene,
|
|
Main *bmain,
|
|
const pxr::UsdLuxDomeLight &dome_light,
|
|
const double motionSampleTime = 0.0);
|
|
|
|
} // namespace blender::io::usd
|