Blender V4.3
object.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
7#include <pxr/base/gf/matrix4d.h>
8#include <pxr/base/tf/hashmap.h>
9
10#include "DNA_object_types.h"
11
12#include "BLI_map.hh"
13#include "BLI_set.hh"
14
15#include "BKE_layer.hh"
16#include "BKE_object.hh"
17
18#include "id.hh"
19#include "material.hh"
20
21namespace blender::io::hydra {
22
23class ObjectData : public IdData {
24 public:
25 pxr::GfMatrix4d transform;
26 bool visible = true;
27
28 public:
29 ObjectData(HydraSceneDelegate *scene_delegate,
30 const Object *object,
31 pxr::SdfPath const &prim_id);
32
33 static std::unique_ptr<ObjectData> create(HydraSceneDelegate *scene_delegate,
34 const Object *object,
35 pxr::SdfPath const &prim_id);
36 static bool is_supported(const Object *object);
37 static bool is_mesh(const Object *object);
38 static bool is_visible(HydraSceneDelegate *scene_delegate,
39 const Object *object,
40 int mode = OB_VISIBLE_SELF);
41
42 using IdData::get_data;
43 virtual pxr::VtValue get_data(pxr::SdfPath const &id, pxr::TfToken const &key) const;
44 virtual pxr::SdfPath material_id() const;
45 virtual pxr::SdfPath material_id(pxr::SdfPath const &id) const;
46 virtual void available_materials(Set<pxr::SdfPath> &paths) const;
47
48 protected:
49 virtual void write_transform();
50 virtual void write_materials();
52};
53
55
56pxr::GfMatrix4d gf_matrix_from_transform(const float m[4][4]);
57
58} // namespace blender::io::hydra
General operations, lookup, etc. for blender objects.
@ OB_VISIBLE_SELF
Object is a sort of wrapper for general info.
virtual pxr::VtValue get_data(pxr::TfToken const &key) const =0
pxr::SdfPath prim_id
Definition id.hh:36
pxr::GfMatrix4d transform
Definition object.hh:25
virtual void available_materials(Set< pxr::SdfPath > &paths) const
virtual pxr::SdfPath material_id() const
static bool is_mesh(const Object *object)
MaterialData * get_or_create_material(const Material *mat)
static bool is_visible(HydraSceneDelegate *scene_delegate, const Object *object, int mode=OB_VISIBLE_SELF)
static std::unique_ptr< ObjectData > create(HydraSceneDelegate *scene_delegate, const Object *object, pxr::SdfPath const &prim_id)
static bool is_supported(const Object *object)
virtual pxr::VtValue get_data(pxr::SdfPath const &id, pxr::TfToken const &key) const
ObjectData(HydraSceneDelegate *scene_delegate, const Object *object, pxr::SdfPath const &prim_id)
pxr::GfMatrix4d gf_matrix_from_transform(const float m[4][4])