Rename `usd.h` to `usd.hh`, and put its declarations in the `blender::io::usd` namespace. Pull Request: https://projects.blender.org/blender/blender/pulls/117897
67 lines
1.9 KiB
C++
67 lines
1.9 KiB
C++
/* SPDX-FileCopyrightText: 2019 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
#pragma once
|
|
|
|
#include "IO_abstract_hierarchy_iterator.h"
|
|
#include "usd.hh"
|
|
#include "usd_exporter_context.hh"
|
|
#include "usd_skel_convert.hh"
|
|
|
|
#include <string>
|
|
|
|
#include <pxr/usd/usd/common.h>
|
|
#include <pxr/usd/usd/timeCode.h>
|
|
|
|
struct Depsgraph;
|
|
struct Main;
|
|
struct Object;
|
|
|
|
namespace blender::io::usd {
|
|
|
|
using blender::io::AbstractHierarchyIterator;
|
|
using blender::io::AbstractHierarchyWriter;
|
|
using blender::io::HierarchyContext;
|
|
|
|
class USDHierarchyIterator : public AbstractHierarchyIterator {
|
|
private:
|
|
const pxr::UsdStageRefPtr stage_;
|
|
pxr::UsdTimeCode export_time_;
|
|
const USDExportParams ¶ms_;
|
|
|
|
ObjExportMap armature_export_map_;
|
|
ObjExportMap skinned_mesh_export_map_;
|
|
ObjExportMap shape_key_mesh_export_map_;
|
|
|
|
public:
|
|
USDHierarchyIterator(Main *bmain,
|
|
Depsgraph *depsgraph,
|
|
pxr::UsdStageRefPtr stage,
|
|
const USDExportParams ¶ms);
|
|
|
|
void set_export_frame(float frame_nr);
|
|
|
|
virtual std::string make_valid_name(const std::string &name) const override;
|
|
|
|
void process_usd_skel() const;
|
|
|
|
protected:
|
|
virtual bool mark_as_weak_export(const Object *object) const override;
|
|
|
|
virtual AbstractHierarchyWriter *create_transform_writer(
|
|
const HierarchyContext *context) override;
|
|
virtual AbstractHierarchyWriter *create_data_writer(const HierarchyContext *context) override;
|
|
virtual AbstractHierarchyWriter *create_hair_writer(const HierarchyContext *context) override;
|
|
virtual AbstractHierarchyWriter *create_particle_writer(
|
|
const HierarchyContext *context) override;
|
|
|
|
virtual void release_writer(AbstractHierarchyWriter *writer) override;
|
|
|
|
private:
|
|
USDExporterContext create_usd_export_context(const HierarchyContext *context);
|
|
|
|
void add_usd_skel_export_mapping(const Object *obj, const pxr::SdfPath &usd_path);
|
|
};
|
|
|
|
} // namespace blender::io::usd
|