Fix: Build error with USD/Hydra with some build systems

Move API shared between USD and Hydra to usd_private.hh. It seems ninja
added an include directory other build systems don't.
This commit is contained in:
Brecht Van Lommel
2025-08-04 17:19:50 +02:00
parent 2da51cef50
commit 526b776417
3 changed files with 24 additions and 24 deletions

View File

@@ -23,7 +23,6 @@
#include "hydra_scene_delegate.hh"
#include "image.hh"
#include "usd_light_convert.hh"
/* TODO: add custom `tftoken` "transparency"? */

View File

@@ -9,8 +9,6 @@
struct bNode;
struct bNodeTree;
struct Image;
struct ImageUser;
struct Main;
struct Scene;
@@ -46,25 +44,4 @@ void dome_light_to_world_material(const USDImportParams &params,
const pxr::UsdPrim &prim,
const pxr::UsdTimeCode time = 0.0);
/**
* Helper struct for converting world shader nodes to a dome light, used by both
* USD and Hydra. */
struct WorldToDomeLight {
/* Image and its transform. */
Image *image = nullptr;
ImageUser *iuser = nullptr;
pxr::GfMatrix4d transform = pxr::GfMatrix4d(1.0);
/* Multiply image by color. */
bool mult_found = false;
float color_mult[4]{};
/* Fixed color. */
bool color_found = false;
float intensity = 0.0f;
float color[4]{};
};
void world_material_to_dome_light(const Scene *scene, WorldToDomeLight &res);
} // namespace blender::io::usd

View File

@@ -2,6 +2,8 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/* Functions shared between USD and Hydra, that are private to the USD module. */
#pragma once
#include <pxr/usd/usd/common.h>
@@ -11,6 +13,9 @@
#include "usd.hh"
struct Depsgraph;
struct Image;
struct ImageUser;
struct Scene;
namespace blender::io::usd {
@@ -22,4 +27,23 @@ std::string image_cache_file_path();
std::string get_image_cache_file(const std::string &file_name, bool mkdir = true);
std::string cache_image_color(const float color[4]);
/** Result from converting world shader nodes to dome light parameters. */
struct WorldToDomeLight {
/* Image and its transform. */
Image *image = nullptr;
ImageUser *iuser = nullptr;
pxr::GfMatrix4d transform = pxr::GfMatrix4d(1.0);
/* Multiply image by color. */
bool mult_found = false;
float color_mult[4]{};
/* Fixed color. */
bool color_found = false;
float intensity = 0.0f;
float color[4]{};
};
void world_material_to_dome_light(const Scene *scene, WorldToDomeLight &res);
}; // namespace blender::io::usd