Blender V4.3
curves.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/vt/array.h>
8#include <pxr/imaging/hd/sceneDelegate.h>
9
10#include "BLI_set.hh"
11
12#include "BKE_duplilist.hh"
13
14#include "DNA_curves_types.h"
15#include "DNA_particle_types.h"
16
17#include "material.hh"
18#include "object.hh"
19
20namespace blender::io::hydra {
21
22class CurvesData : public ObjectData {
23 protected:
24 pxr::VtIntArray curve_vertex_counts_;
25 pxr::VtVec3fArray vertices_;
26 pxr::VtVec2fArray uvs_;
27 pxr::VtFloatArray widths_;
28
30
31 public:
32 CurvesData(HydraSceneDelegate *scene_delegate,
33 const Object *object,
34 pxr::SdfPath const &prim_id);
35
36 void init() override;
37 void insert() override;
38 void remove() override;
39 void update() override;
40
41 pxr::VtValue get_data(pxr::TfToken const &key) const override;
42 pxr::SdfPath material_id() const override;
43 void available_materials(Set<pxr::SdfPath> &paths) const override;
44
45 pxr::HdBasisCurvesTopology topology() const;
46 pxr::HdPrimvarDescriptorVector primvar_descriptors(pxr::HdInterpolation interpolation) const;
47
48 protected:
49 void write_materials() override;
50 virtual void write_curves();
51};
52
53class HairData : public CurvesData {
54 private:
55 ParticleSystem *particle_system_;
56
57 public:
58 HairData(HydraSceneDelegate *scene_delegate,
59 const Object *object,
60 pxr::SdfPath const &prim_id,
61 ParticleSystem *particle_system);
62
63 static bool is_supported(const ParticleSystem *particle_system);
64 static bool is_visible(HydraSceneDelegate *scene_delegate,
65 Object *object,
66 ParticleSystem *particle_system);
67
68 void update() override;
69
70 protected:
71 void write_transform() override;
72 void write_curves() override;
73};
74
75} // namespace blender::io::hydra
void available_materials(Set< pxr::SdfPath > &paths) const override
pxr::VtVec2fArray uvs_
Definition curves.hh:26
pxr::VtIntArray curve_vertex_counts_
Definition curves.hh:24
pxr::VtFloatArray widths_
Definition curves.hh:27
pxr::VtValue get_data(pxr::TfToken const &key) const override
pxr::HdBasisCurvesTopology topology() const
pxr::VtVec3fArray vertices_
Definition curves.hh:25
pxr::SdfPath material_id() const override
pxr::HdPrimvarDescriptorVector primvar_descriptors(pxr::HdInterpolation interpolation) const
CurvesData(HydraSceneDelegate *scene_delegate, const Object *object, pxr::SdfPath const &prim_id)
HairData(HydraSceneDelegate *scene_delegate, const Object *object, pxr::SdfPath const &prim_id, ParticleSystem *particle_system)
static bool is_supported(const ParticleSystem *particle_system)
static bool is_visible(HydraSceneDelegate *scene_delegate, Object *object, ParticleSystem *particle_system)
pxr::SdfPath prim_id
Definition id.hh:36