- Use const in more places - Use more appropriate headers and forward decls elsewhere - Remove one instance of variable shadowing - Rename an internal rna enum list and the USD operator property object to follow surrounding code and naming guidelines Pull Request: https://projects.blender.org/blender/blender/pulls/136112
68 lines
2.0 KiB
C++
68 lines
2.0 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);
|
|
|
|
std::string make_valid_name(const std::string &name) const override;
|
|
|
|
void process_usd_skel() const;
|
|
|
|
protected:
|
|
bool mark_as_weak_export(const Object *object) const override;
|
|
|
|
AbstractHierarchyWriter *create_transform_writer(const HierarchyContext *context) override;
|
|
AbstractHierarchyWriter *create_data_writer(const HierarchyContext *context) override;
|
|
AbstractHierarchyWriter *create_hair_writer(const HierarchyContext *context) override;
|
|
AbstractHierarchyWriter *create_particle_writer(const HierarchyContext *context) override;
|
|
|
|
void release_writer(AbstractHierarchyWriter *writer) override;
|
|
|
|
bool include_data_writers(const HierarchyContext *context) const override;
|
|
bool include_child_writers(const HierarchyContext *context) const 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
|