Blender  V3.3
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
blender::io::usd::USDAbstractWriter Class Referenceabstract

#include <usd_writer_abstract.h>

Inheritance diagram for blender::io::usd::USDAbstractWriter:
blender::io::AbstractHierarchyWriter blender::io::usd::USDCameraWriter blender::io::usd::USDGenericMeshWriter blender::io::usd::USDHairWriter blender::io::usd::USDLightWriter blender::io::usd::USDTransformWriter blender::io::usd::USDVolumeWriter blender::io::usd::USDMeshWriter blender::io::usd::USDMetaballWriter

Public Member Functions

 USDAbstractWriter (const USDExporterContext &usd_export_context)
 
virtual void write (HierarchyContext &context) override
 
virtual bool is_supported (const HierarchyContext *context) const
 
const pxr::SdfPath & usd_path () const
 
- Public Member Functions inherited from blender::io::AbstractHierarchyWriter
virtual ~AbstractHierarchyWriter ()=default
 

Protected Member Functions

virtual void do_write (HierarchyContext &context)=0
 
std::string get_export_file_path () const
 
pxr::UsdTimeCode get_export_time_code () const
 
pxr::UsdShadeMaterial ensure_usd_material (const HierarchyContext &context, Material *material)
 
void write_visibility (const HierarchyContext &context, const pxr::UsdTimeCode timecode, pxr::UsdGeomImageable &usd_geometry)
 
virtual bool mark_as_instance (const HierarchyContext &context, const pxr::UsdPrim &prim)
 
- Protected Member Functions inherited from blender::io::AbstractHierarchyWriter
virtual bool check_is_animated (const HierarchyContext &context) const
 

Protected Attributes

const USDExporterContext usd_export_context_
 
pxr::UsdUtilsSparseValueWriter usd_value_writer_
 
bool frame_has_been_written_
 
bool is_animated_
 

Additional Inherited Members

- Static Protected Member Functions inherited from blender::io::AbstractHierarchyWriter
static bool check_has_physics (const HierarchyContext &context)
 
static bool check_has_deforming_physics (const HierarchyContext &context)
 

Detailed Description

Definition at line 26 of file usd_writer_abstract.h.

Constructor & Destructor Documentation

◆ USDAbstractWriter()

blender::io::usd::USDAbstractWriter::USDAbstractWriter ( const USDExporterContext usd_export_context)

Definition at line 40 of file usd_writer_abstract.cc.

Member Function Documentation

◆ do_write()

virtual void blender::io::usd::USDAbstractWriter::do_write ( HierarchyContext context)
protectedpure virtual

◆ ensure_usd_material()

pxr::UsdShadeMaterial blender::io::usd::USDAbstractWriter::ensure_usd_material ( const HierarchyContext context,
Material material 
)
protected

◆ get_export_file_path()

std::string blender::io::usd::USDAbstractWriter::get_export_file_path ( ) const
protected

◆ get_export_time_code()

pxr::UsdTimeCode blender::io::usd::USDAbstractWriter::get_export_time_code ( ) const
protected

◆ is_supported()

bool blender::io::usd::USDAbstractWriter::is_supported ( const HierarchyContext context) const
virtual

Returns true if the data to be written is actually supported. This would, for example, allow a hypothetical camera writer accept a perspective camera but reject an orthogonal one.

Returning false from a transform writer will prevent the object and all its descendants from being exported. Returning false from a data writer (object data, hair, or particles) will only prevent that data from being written (and thus cause the object to be exported as an Empty).

Reimplemented in blender::io::usd::USDMetaballWriter, blender::io::usd::USDGenericMeshWriter, blender::io::usd::USDLightWriter, and blender::io::usd::USDCameraWriter.

Definition at line 45 of file usd_writer_abstract.cc.

Referenced by blender::io::usd::USDHierarchyIterator::create_data_writer().

◆ mark_as_instance()

bool blender::io::usd::USDAbstractWriter::mark_as_instance ( const HierarchyContext context,
const pxr::UsdPrim &  prim 
)
protectedvirtual

Turn prim into an instance referencing context.original_export_path. Return true when the instancing was successful, false otherwise.

Reference the original data instead of writing a copy.

Definition at line 128 of file usd_writer_abstract.cc.

References BLI_assert, BLI_assert_msg, and blender::compositor::context.

◆ usd_path()

const pxr::SdfPath & blender::io::usd::USDAbstractWriter::usd_path ( ) const

◆ write()

void blender::io::usd::USDAbstractWriter::write ( HierarchyContext context)
overridevirtual

◆ write_visibility()

void blender::io::usd::USDAbstractWriter::write_visibility ( const HierarchyContext context,
const pxr::UsdTimeCode  timecode,
pxr::UsdGeomImageable &  usd_geometry 
)
protected

Member Data Documentation

◆ frame_has_been_written_

bool blender::io::usd::USDAbstractWriter::frame_has_been_written_
protected

Definition at line 31 of file usd_writer_abstract.h.

Referenced by write().

◆ is_animated_

bool blender::io::usd::USDAbstractWriter::is_animated_
protected

Definition at line 32 of file usd_writer_abstract.h.

Referenced by get_export_time_code(), and write().

◆ usd_export_context_

const USDExporterContext blender::io::usd::USDAbstractWriter::usd_export_context_
protected

◆ usd_value_writer_

pxr::UsdUtilsSparseValueWriter blender::io::usd::USDAbstractWriter::usd_value_writer_
protected

The documentation for this class was generated from the following files: