Files
test2/source/blender/io/usd/intern/usd_writer_transform.hh
Charles Wardlaw 5e6760d554 Fix #122625: List of XForm ops needs to be stored at class level
The code review request to move the vector of xform ops from class to
function-local scope broke animation export. Moved xform ops vector back
into the class, and only create new xform ops on first xform write.

Co-authored-by: kiki <charles@skeletalstudios.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/122665
2024-06-03 19:56:17 +02:00

30 lines
861 B
C++

/* SPDX-FileCopyrightText: 2019 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
#include "usd_writer_abstract.hh"
#include <pxr/usd/usdGeom/xform.h>
namespace blender::io::usd {
class USDTransformWriter : public USDAbstractWriter {
private:
blender::Vector<pxr::UsdGeomXformOp> xformOps_;
public:
USDTransformWriter(const USDExporterContext &ctx);
protected:
void do_write(HierarchyContext &context) override;
bool check_is_animated(const HierarchyContext &context) const override;
bool should_apply_root_xform(const HierarchyContext &context) const;
void set_xform_ops(float parent_relative_matrix[4][4], pxr::UsdGeomXformable &xf);
/* Subclasses may override this to create prims other than UsdGeomXform. */
virtual pxr::UsdGeomXformable create_xformable() const;
};
} // namespace blender::io::usd