2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2011-2022 Blender Authors
|
2023-08-06 18:57:56 +10:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2023-08-04 15:10:48 +02:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <pxr/imaging/hd/enums.h>
|
|
|
|
|
#include <pxr/usd/sdf/assetPath.h>
|
|
|
|
|
#include <pxr/usd/sdf/path.h>
|
|
|
|
|
|
|
|
|
|
#include "DNA_material_types.h"
|
|
|
|
|
|
|
|
|
|
#include "BLI_map.hh"
|
|
|
|
|
|
2024-02-05 19:37:57 +01:00
|
|
|
#include "id.hh"
|
2023-08-04 15:10:48 +02:00
|
|
|
|
|
|
|
|
namespace blender::io::hydra {
|
|
|
|
|
|
|
|
|
|
class MaterialData : public IdData {
|
2023-08-05 14:49:10 +02:00
|
|
|
public:
|
|
|
|
|
bool double_sided = true;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
pxr::VtValue material_network_map_;
|
|
|
|
|
|
2023-08-04 15:10:48 +02:00
|
|
|
public:
|
|
|
|
|
MaterialData(HydraSceneDelegate *scene_delegate,
|
2023-08-04 13:35:21 -04:00
|
|
|
const Material *material,
|
2023-08-04 15:10:48 +02:00
|
|
|
pxr::SdfPath const &prim_id);
|
|
|
|
|
|
|
|
|
|
void init() override;
|
|
|
|
|
void insert() override;
|
|
|
|
|
void remove() override;
|
|
|
|
|
void update() override;
|
|
|
|
|
|
|
|
|
|
pxr::VtValue get_data(pxr::TfToken const &key) const override;
|
|
|
|
|
pxr::VtValue get_material_resource() const;
|
|
|
|
|
pxr::HdCullStyle cull_style() const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
using MaterialDataMap = Map<pxr::SdfPath, std::unique_ptr<MaterialData>>;
|
|
|
|
|
|
|
|
|
|
} // namespace blender::io::hydra
|