Blender V5.0
usd_utils.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4#pragma once
5
6#include "BLI_string_ref.hh"
7
8#include <pxr/usd/sdf/path.h>
9#include <pxr/usd/usd/common.h>
10
11#include <string>
12
13namespace blender::io::usd {
14
22std::string make_safe_name(StringRef name, bool allow_unicode);
23
24/* Return a unique USD `SdfPath`. If the given path already exists on the given stage, return
25 * the path with a numerical suffix appended to the name that ensures the path is unique.
26 * If the path does not exist on the stage, it will be returned unchanged.
27 *
28 * \param stage: The stage
29 * \param path: The original path
30 * \return A valid, and unique, USD `SdfPath`
31 */
32pxr::SdfPath get_unique_path(pxr::UsdStageRefPtr stage, const std::string &path);
33} // namespace blender::io::usd
pxr::SdfPath get_unique_path(pxr::UsdStageRefPtr stage, const std::string &path)
Definition usd_utils.cc:61
std::string make_safe_name(const StringRef name, bool allow_unicode)
Definition usd_utils.cc:18
const char * name