Though "Point Cloud" written as two words is technically correct and should be used in the UI, as one word it's typically easier to write and parse when reading. We had a mix of both before this patch, so better to unify this as well. This commit also renames the editor/intern/ files to remove pointcloud_ prefix. point_cloud was only preserved on the user facing strings: * is_type_point_cloud * use_new_point_cloud_type Pull Request: https://projects.blender.org/blender/blender/pulls/134803
56 lines
1.5 KiB
C++
56 lines
1.5 KiB
C++
/* SPDX-FileCopyrightText: 2024 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
#pragma once
|
|
|
|
#include "usd.hh"
|
|
#include "usd_reader_geom.hh"
|
|
|
|
#include <pxr/usd/usdGeom/points.h>
|
|
|
|
struct Main;
|
|
struct PointCloud;
|
|
|
|
namespace blender::io::usd {
|
|
|
|
/*
|
|
* Read UsdGeomPoints primitives as Blender point clouds.
|
|
*/
|
|
class USDPointsReader : public USDGeomReader {
|
|
private:
|
|
pxr::UsdGeomPoints points_prim_;
|
|
|
|
public:
|
|
USDPointsReader(const pxr::UsdPrim &prim,
|
|
const USDImportParams &import_params,
|
|
const ImportSettings &settings)
|
|
: USDGeomReader(prim, import_params, settings), points_prim_(prim)
|
|
{
|
|
}
|
|
|
|
bool valid() const override
|
|
{
|
|
return bool(points_prim_);
|
|
}
|
|
|
|
/* Initial object creation. */
|
|
void create_object(Main *bmain, double motionSampleTime) override;
|
|
|
|
/* Initial point cloud data update. */
|
|
void read_object_data(Main *bmain, double motionSampleTime) override;
|
|
|
|
/* Implement point cloud update. This may be called by the cache modifier
|
|
* to update animated geometry. */
|
|
void read_geometry(bke::GeometrySet &geometry_set,
|
|
USDMeshReadParams params,
|
|
const char **r_err_str) override;
|
|
|
|
void read_velocities(PointCloud *pointcloud, const double motionSampleTime) const;
|
|
void read_custom_data(PointCloud *pointcloud, const double motionSampleTime) const;
|
|
|
|
/* Return true if the USD data may be time varying. */
|
|
bool is_animated() const;
|
|
};
|
|
|
|
} // namespace blender::io::usd
|