|
Blender V5.3
|
#include <usd_writer_abstract.hh>
Inherits blender::io::AbstractHierarchyWriter.
Inherited by blender::io::usd::USDArmatureWriter, blender::io::usd::USDCameraWriter, blender::io::usd::USDCurvesWriter, blender::io::usd::USDGenericMeshWriter, blender::io::usd::USDHairWriter, blender::io::usd::USDLightWriter, blender::io::usd::USDPointInstancerWriter, blender::io::usd::USDPointsWriter, blender::io::usd::USDTransformWriter, and blender::io::usd::USDVolumeWriter.
Public Member Functions | |
| USDAbstractWriter (const USDExporterContext &usd_export_context) | |
| void | write (HierarchyContext &context) override |
| virtual bool | is_supported (const HierarchyContext *context) const |
| const pxr::SdfPath & | usd_path () const |
| ReportList * | reports () 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::SdfPath | get_material_library_path () const |
| pxr::SdfPath | get_proto_material_root_path (const HierarchyContext &context) const |
| pxr::UsdShadeMaterial | ensure_usd_material_created (const HierarchyContext &context, Material *material) const |
| pxr::UsdShadeMaterial | ensure_usd_material (const HierarchyContext &context, Material *material) const |
| void | write_id_properties (const pxr::UsdPrim &prim, const ID &id, pxr::UsdTimeCode=pxr::UsdTimeCode::Default()) const |
| void | write_user_properties (const pxr::UsdPrim &prim, IDProperty *properties, pxr::UsdTimeCode=pxr::UsdTimeCode::Default()) const |
| void | write_visibility (const HierarchyContext &context, const pxr::UsdTimeCode time, const pxr::UsdGeomImageable &usd_geometry) |
| virtual bool | mark_as_instance (const HierarchyContext &context, const pxr::UsdPrim &prim) |
| void | author_extent (const pxr::UsdGeomBoundable &boundable, const pxr::UsdTimeCode time) |
| void | author_extent (const pxr::UsdGeomBoundable &boundable, const std::optional< Bounds< float3 > > &bounds, const pxr::UsdTimeCode time) |
| void | add_to_prim_map (const pxr::SdfPath &usd_path, const ID *id) const |
| 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) |
Definition at line 31 of file usd_writer_abstract.hh.
| blender::io::usd::USDAbstractWriter::USDAbstractWriter | ( | const USDExporterContext & | usd_export_context | ) |
Definition at line 218 of file usd_writer_abstract.cc.
References blender::false, frame_has_been_written_, is_animated_, and usd_export_context_.
Referenced by blender::io::usd::USDArmatureWriter::USDArmatureWriter(), blender::io::usd::USDCameraWriter::USDCameraWriter(), blender::io::usd::USDCurvesWriter::USDCurvesWriter(), blender::io::usd::USDGenericMeshWriter::USDGenericMeshWriter(), blender::io::usd::USDHairWriter::USDHairWriter(), blender::io::usd::USDLightWriter::USDLightWriter(), blender::io::usd::USDPointInstancerWriter::USDPointInstancerWriter(), blender::io::usd::USDPointsWriter::USDPointsWriter(), blender::io::usd::USDTransformWriter::USDTransformWriter(), and blender::io::usd::USDVolumeWriter::USDVolumeWriter().
|
protected |
Definition at line 578 of file usd_writer_abstract.cc.
References blender::io::usd::USDHierarchyIterator::add_to_prim_map(), blender::io::usd::USDExporterContext::hierarchy_iterator, usd_export_context_, and usd_path().
Referenced by do_write(), blender::io::usd::USDCameraWriter::do_write(), blender::io::usd::USDCurvesWriter::do_write(), blender::io::usd::USDGenericMeshWriter::do_write(), blender::io::usd::USDHairWriter::do_write(), blender::io::usd::USDLightWriter::do_write(), blender::io::usd::USDTransformWriter::do_write(), and ensure_usd_material_created().
|
protected |
Compute the bounds for a boundable prim, and author the result as the extent attribute.
Although this method works for any boundable prim, it is preferred to use Blender's own cached bounds when possible.
This method does not author the extentsHint attribute, which is also important to provide. Whereas the extent attribute can only be authored on prims inheriting from UsdGeomBoundable, an extentsHint can be provided on any prim, including scopes. This extentsHint should be authored on every prim in a hierarchy being exported.
Note that this hint is only useful when importing or inspecting layers, and should not be taken into account when computing extents during export.
TODO: also provide method for authoring extentsHint on every prim in a hierarchy.
Definition at line 546 of file usd_writer_abstract.cc.
References blender::io::usd::set_attribute(), and usd_value_writer_.
Referenced by do_write(), blender::io::usd::USDCurvesWriter::do_write(), blender::io::usd::USDHairWriter::do_write(), blender::io::usd::USDLightWriter::do_write(), blender::io::usd::USDPointsWriter::do_write(), and blender::io::usd::USDVolumeWriter::do_write().
|
protected |
Author the extent attribute for a boundable prim given the Blender bounds.
Definition at line 564 of file usd_writer_abstract.cc.
References blender::io::usd::set_attribute(), and usd_value_writer_.
|
protectedpure virtual |
Implemented in blender::io::usd::USDArmatureWriter, blender::io::usd::USDCameraWriter, blender::io::usd::USDCurvesWriter, blender::io::usd::USDGenericMeshWriter, blender::io::usd::USDHairWriter, blender::io::usd::USDLightWriter, blender::io::usd::USDMeshWriter, blender::io::usd::USDPointInstancerWriter, blender::io::usd::USDPointsWriter, blender::io::usd::USDTransformWriter, and blender::io::usd::USDVolumeWriter.
References add_to_prim_map(), author_extent(), ensure_usd_material(), ensure_usd_material_created(), get_export_file_path(), get_export_time_code(), get_material_library_path(), get_proto_material_root_path(), mark_as_instance(), usd_path(), write_id_properties(), write_user_properties(), and write_visibility().
Referenced by write().
|
protected |
Definition at line 323 of file usd_writer_abstract.cc.
References CLOG_WARN, ensure_usd_material_created(), blender::io::usd::USDExporterContext::export_params, get_proto_material_root_path(), blender::LOG, blender::io::usd::USDExporterContext::stage, usd_export_context_, usd_path(), and blender::io::usd::USDExportParams::use_instancing.
Referenced by blender::io::usd::USDHairWriter::assign_material(), blender::io::usd::USDCurvesWriter::assign_materials(), and do_write().
|
protected |
Definition at line 294 of file usd_writer_abstract.cc.
References add_to_prim_map(), blender::io::usd::USDExportParams::allow_unicode, blender::io::usd::colorspace_apply_to_prim(), blender::io::usd::create_usd_material(), blender::io::usd::USDExporterContext::export_params, get_export_time_code(), get_material_library_path(), blender::get_mesh_active_uvlayer_name(), blender::io::usd::make_safe_name(), reports(), blender::io::usd::USDExporterContext::stage, usd_export_context_, usd_path(), and write_id_properties().
Referenced by do_write(), and ensure_usd_material().
|
protected |
Definition at line 228 of file usd_writer_abstract.cc.
References blender::io::usd::USDExporterContext::export_file_path, and usd_export_context_.
Referenced by do_write().
|
protected |
Definition at line 233 of file usd_writer_abstract.cc.
References blender::BLI_assert(), blender::io::usd::USDExporterContext::get_time_code, is_animated_, and usd_export_context_.
Referenced by blender::io::usd::USDMeshWriter::add_shape_key_weights_sample(), do_write(), blender::io::usd::USDArmatureWriter::do_write(), blender::io::usd::USDCameraWriter::do_write(), blender::io::usd::USDCurvesWriter::do_write(), blender::io::usd::USDGenericMeshWriter::do_write(), blender::io::usd::USDHairWriter::do_write(), blender::io::usd::USDLightWriter::do_write(), blender::io::usd::USDPointInstancerWriter::do_write(), blender::io::usd::USDPointsWriter::do_write(), blender::io::usd::USDTransformWriter::do_write(), blender::io::usd::USDVolumeWriter::do_write(), ensure_usd_material_created(), and blender::io::usd::USDTransformWriter::set_xform_ops().
|
protected |
Definition at line 270 of file usd_writer_abstract.cc.
References blender::io::usd::USDExporterContext::export_params, blender::io::usd::USDExportParams::root_prim_path, and usd_export_context_.
Referenced by do_write(), and ensure_usd_material_created().
|
protected |
Definition at line 283 of file usd_writer_abstract.cc.
References blender::io::usd::USDExporterContext::export_params, blender::io::usd::USDExportParams::root_prim_path, and usd_export_context_.
Referenced by do_write(), and ensure_usd_material().
|
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::USDCameraWriter, blender::io::usd::USDGenericMeshWriter, blender::io::usd::USDLightWriter, and blender::io::usd::USDMetaballWriter.
Definition at line 223 of file usd_writer_abstract.cc.
Referenced by blender::io::usd::USDHierarchyIterator::create_data_writer().
|
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 373 of file usd_writer_abstract.cc.
References blender::BLI_assert(), BLI_assert_msg, CLOG_ERROR, CLOG_WARN, blender::io::usd::USDExporterContext::export_params, blender::LOG, blender::io::usd::USDExportParams::root_prim_path, blender::io::usd::USDExporterContext::stage, and usd_export_context_.
Referenced by do_write(), and blender::io::usd::USDTransformWriter::do_write().
| ReportList * blender::io::usd::USDAbstractWriter::reports | ( | ) | const |
Get the wmJobWorkerStatus-provided reports list pointer, to use with the BKE_report API.
Definition at line 244 of file usd_writer_abstract.cc.
References blender::io::usd::USDExporterContext::export_params, blender::wmJobWorkerStatus::reports, usd_export_context_, and blender::io::usd::USDExportParams::worker_status.
Referenced by blender::io::usd::USDCurvesWriter::do_write(), blender::io::usd::USDPointInstancerWriter::do_write(), blender::io::usd::USDVolumeWriter::do_write(), and ensure_usd_material_created().
| const pxr::SdfPath & blender::io::usd::USDAbstractWriter::usd_path | ( | ) | const |
Definition at line 265 of file usd_writer_abstract.cc.
References usd_export_context_, and blender::io::usd::USDExporterContext::usd_path.
Referenced by add_to_prim_map(), blender::io::usd::USDHierarchyIterator::create_data_writer(), do_write(), blender::io::usd::USDLightWriter::do_write(), blender::io::usd::USDPointInstancerWriter::do_write(), blender::io::usd::USDPointsWriter::do_write(), ensure_usd_material(), and ensure_usd_material_created().
|
overridevirtual |
Implements blender::io::AbstractHierarchyWriter.
Definition at line 249 of file usd_writer_abstract.cc.
References blender::io::AbstractHierarchyWriter::check_is_animated(), do_write(), blender::io::usd::USDExportParams::export_animation, blender::io::usd::USDExporterContext::export_params, frame_has_been_written_, is_animated_, and usd_export_context_.
|
protected |
Definition at line 412 of file usd_writer_abstract.cc.
References blender::io::usd::USDExportParams::author_blender_name, blender::usdtokens::blender_ns(), blender::io::usd::USDExportParams::export_custom_properties, blender::io::usd::USDExporterContext::export_params, blender::GS(), blender::ID_OB, lexit::String, usd_export_context_, and write_user_properties().
Referenced by do_write(), blender::io::usd::USDCameraWriter::do_write(), blender::io::usd::USDCurvesWriter::do_write(), blender::io::usd::USDGenericMeshWriter::do_write(), blender::io::usd::USDHairWriter::do_write(), blender::io::usd::USDLightWriter::do_write(), blender::io::usd::USDTransformWriter::do_write(), and ensure_usd_material_created().
|
protected |
Definition at line 441 of file usd_writer_abstract.cc.
References blender::io::usd::USDExportParams::allow_unicode, blender::io::usd::create_vector_attrib(), blender::io::usd::USDExportParams::custom_properties_namespace, blender::IDProperty::data, blender::io::usd::USDExporterContext::export_params, blender::IDPropertyData::group, blender::IDP_ARRAY, blender::IDP_BOOLEAN, blender::IDP_DOUBLE, blender::IDP_FLOAT, blender::IDP_GROUP, blender::IDP_ID, blender::IDP_IDPARRAY, blender::IDP_INT, blender::IDP_STRING, blender::io::usd::make_safe_name(), blender::parse_accessibility_property_name(), blender::IDProperty::type, usd_export_context_, and blender::write_accessibility_property().
Referenced by do_write(), and write_id_properties().
|
protected |
Definition at line 359 of file usd_writer_abstract.cc.
References blender::io::usd::USDExportParams::evaluation_mode, blender::io::usd::USDExporterContext::export_params, usd_export_context_, and usd_value_writer_.
Referenced by do_write().
|
protected |
Definition at line 36 of file usd_writer_abstract.hh.
Referenced by blender::io::usd::USDArmatureWriter::do_write(), blender::io::usd::USDMeshWriter::do_write(), USDAbstractWriter(), and write().
|
protected |
Definition at line 37 of file usd_writer_abstract.hh.
Referenced by blender::io::usd::USDTransformWriter::do_write(), get_export_time_code(), USDAbstractWriter(), and write().
|
protected |
Definition at line 33 of file usd_writer_abstract.hh.
Referenced by blender::io::usd::USDMeshWriter::add_shape_key_weights_sample(), add_to_prim_map(), blender::io::usd::USDHairWriter::assign_material(), blender::io::usd::USDCurvesWriter::assign_materials(), blender::io::usd::USDTransformWriter::create_xformable(), blender::io::usd::USDArmatureWriter::do_write(), blender::io::usd::USDCameraWriter::do_write(), blender::io::usd::USDCurvesWriter::do_write(), blender::io::usd::USDGenericMeshWriter::do_write(), blender::io::usd::USDHairWriter::do_write(), blender::io::usd::USDLightWriter::do_write(), blender::io::usd::USDPointInstancerWriter::do_write(), blender::io::usd::USDPointsWriter::do_write(), blender::io::usd::USDTransformWriter::do_write(), blender::io::usd::USDVolumeWriter::do_write(), ensure_usd_material(), ensure_usd_material_created(), get_export_file_path(), blender::io::usd::USDMeshWriter::get_export_mesh(), blender::io::usd::USDMetaballWriter::get_export_mesh(), blender::io::usd::USDTextWriter::get_export_mesh(), get_export_time_code(), get_material_library_path(), get_proto_material_root_path(), blender::io::usd::USDMeshWriter::init_blend_shapes(), blender::io::usd::USDMeshWriter::init_skinned_mesh(), blender::io::usd::USDGenericMeshWriter::is_supported(), blender::io::usd::USDMetaballWriter::is_supported(), mark_as_instance(), reports(), blender::io::usd::USDMeshWriter::set_skel_export_flags(), blender::io::usd::USDTransformWriter::set_xform_ops(), blender::io::usd::USDTransformWriter::should_apply_root_xform(), usd_path(), USDAbstractWriter(), write(), write_id_properties(), write_user_properties(), and write_visibility().
|
protected |
Definition at line 34 of file usd_writer_abstract.hh.
Referenced by author_extent(), author_extent(), blender::io::usd::USDArmatureWriter::do_write(), blender::io::usd::USDCameraWriter::do_write(), blender::io::usd::USDHairWriter::do_write(), blender::io::usd::USDLightWriter::do_write(), blender::io::usd::USDPointInstancerWriter::do_write(), blender::io::usd::USDPointsWriter::do_write(), blender::io::usd::USDVolumeWriter::do_write(), blender::io::usd::USDTransformWriter::set_xform_ops(), and write_visibility().