Blender V5.0
blender::io::usd::USDPrimReader Class Referenceabstract

#include <usd_reader_prim.hh>

Inherited by blender::io::usd::USDDomeLightReader, and blender::io::usd::USDXformReader.

Public Member Functions

 USDPrimReader (const pxr::UsdPrim &prim, const USDImportParams &import_params, const ImportSettings &settings)
virtual ~USDPrimReader ()
const pxr::UsdPrim & prim () const
virtual bool valid () const
virtual void create_object (Main *bmain)=0
virtual void read_object_data (Main *, pxr::UsdTimeCode)
Objectobject () const
void object (Object *ob)
USDPrimReaderparent () const
void parent (USDPrimReader *parent)
ReportListreports () const
int refcount () const
void incref ()
void decref ()
StringRefNull name () const
pxr::SdfPath prim_path () const
virtual pxr::SdfPath object_prim_path () const
virtual pxr::SdfPath data_prim_path () const
void set_is_in_instancer_proto (bool flag)
bool is_in_instancer_proto () const
bool is_in_proto () const

Protected Member Functions

void set_props (bool merge_with_parent=false, pxr::UsdTimeCode time=pxr::UsdTimeCode::Default())

Protected Attributes

StringRefNull name_
Objectobject_
pxr::UsdPrim prim_
USDPrimReaderparent_reader_
const USDImportParamsimport_params_
const ImportSettingssettings_
int refcount_
bool is_in_instancer_proto_

Detailed Description

Definition at line 74 of file usd_reader_prim.hh.

Constructor & Destructor Documentation

◆ USDPrimReader()

blender::io::usd::USDPrimReader::USDPrimReader ( const pxr::UsdPrim & prim,
const USDImportParams & import_params,
const ImportSettings & settings )

◆ ~USDPrimReader()

blender::io::usd::USDPrimReader::~USDPrimReader ( )
virtualdefault

Member Function Documentation

◆ create_object()

◆ data_prim_path()

virtual pxr::SdfPath blender::io::usd::USDPrimReader::data_prim_path ( ) const
inlinevirtual

Definition at line 144 of file usd_reader_prim.hh.

References prim_path().

◆ decref()

void blender::io::usd::USDPrimReader::decref ( )

Definition at line 99 of file usd_reader_prim.cc.

References BLI_assert, and refcount_.

Referenced by blender::io::usd::decref(), and blender::io::usd::USD_CacheReader_free().

◆ incref()

void blender::io::usd::USDPrimReader::incref ( )

Definition at line 94 of file usd_reader_prim.cc.

References refcount_.

Referenced by blender::io::usd::CacheReader_open_usd_object().

◆ is_in_instancer_proto()

bool blender::io::usd::USDPrimReader::is_in_instancer_proto ( ) const
inline

Definition at line 154 of file usd_reader_prim.hh.

References is_in_instancer_proto_.

◆ is_in_proto()

bool blender::io::usd::USDPrimReader::is_in_proto ( ) const

◆ name()

StringRefNull blender::io::usd::USDPrimReader::name ( ) const
inline

Definition at line 130 of file usd_reader_prim.hh.

References name_.

◆ object() [1/2]

◆ object() [2/2]

void blender::io::usd::USDPrimReader::object ( Object * ob)

Definition at line 79 of file usd_reader_prim.cc.

References object_.

◆ object_prim_path()

virtual pxr::SdfPath blender::io::usd::USDPrimReader::object_prim_path ( ) const
inlinevirtual

Reimplemented in blender::io::usd::USDXformReader.

Definition at line 139 of file usd_reader_prim.hh.

References prim_path().

◆ parent() [1/2]

USDPrimReader * blender::io::usd::USDPrimReader::parent ( ) const
inline

Definition at line 102 of file usd_reader_prim.hh.

References parent_reader_, and USDPrimReader().

Referenced by blender::io::usd::import_startjob(), and parent().

◆ parent() [2/2]

void blender::io::usd::USDPrimReader::parent ( USDPrimReader * parent)
inline

Definition at line 106 of file usd_reader_prim.hh.

References parent(), parent_reader_, and USDPrimReader().

◆ prim()

◆ prim_path()

pxr::SdfPath blender::io::usd::USDPrimReader::prim_path ( ) const
inline

◆ read_object_data()

◆ refcount()

int blender::io::usd::USDPrimReader::refcount ( ) const

Definition at line 89 of file usd_reader_prim.cc.

References refcount_.

Referenced by blender::io::usd::decref(), and blender::io::usd::USD_CacheReader_free().

◆ reports()

ReportList * blender::io::usd::USDPrimReader::reports ( ) const
inline

◆ set_is_in_instancer_proto()

void blender::io::usd::USDPrimReader::set_is_in_instancer_proto ( bool flag)
inline

Definition at line 149 of file usd_reader_prim.hh.

References flag, and is_in_instancer_proto_.

◆ set_props()

void blender::io::usd::USDPrimReader::set_props ( bool merge_with_parent = false,
pxr::UsdTimeCode time = pxr::UsdTimeCode::Default() )
protected

Convert custom attributes on the encapsulated USD prim (or on its parent) to custom properties on the generated object and/or data. This function assumes create_object() and read_object_data() have been called.

If the generated object has instantiated data, it's assumed that the data represents the USD prim, and the prim properties will be set on the data ID. If the object data is null (which would be the case when a USD Xform is converted to an Empty object), then the prim properties will be set on the object ID. Finally, a true value for the 'merge_with_parent' argument indicates that the object represents a USD Xform and its child prim that were merged on import, and the properties of the prim's parent will be set on the object ID.

Parameters
merge_with_parentIf true, set the properties of the prim's parent on the object ID
timeThe time code for sampling the USD attributes.

Definition at line 21 of file usd_reader_prim.cc.

References import_params_, object_, prim_, blender::io::usd::set_id_props_from_prim(), and blender::io::usd::USD_ATTR_IMPORT_NONE.

Referenced by blender::io::usd::USDXformReader::read_object_data().

◆ valid()

Member Data Documentation

◆ import_params_

◆ is_in_instancer_proto_

bool blender::io::usd::USDPrimReader::is_in_instancer_proto_
protected

◆ name_

◆ object_

Object* blender::io::usd::USDPrimReader::object_
protected

◆ parent_reader_

USDPrimReader* blender::io::usd::USDPrimReader::parent_reader_
protected

Definition at line 80 of file usd_reader_prim.hh.

Referenced by parent(), parent(), and USDPrimReader().

◆ prim_

◆ refcount_

int blender::io::usd::USDPrimReader::refcount_
protected

Definition at line 83 of file usd_reader_prim.hh.

Referenced by decref(), incref(), refcount(), and USDPrimReader().

◆ settings_


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