Blender V4.3
blender::io::usd::USDPrimReader Class Referenceabstract

#include <usd_reader_prim.hh>

Inherited by 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, double motionSampleTime)=0
virtual void read_object_data (Main *, double)
Objectobject () const
void object (Object *ob)
USDPrimReaderparent () const
void parent (USDPrimReader *parent)
ReportListreports () const
int refcount () const
void incref ()
void decref ()
const std::string & name () const
const std::string & 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 motionSampleTime=pxr::UsdTimeCode::Default())

Protected Attributes

std::string name_
std::string prim_path_
Objectobject_
pxr::UsdPrim prim_
const USDImportParamsimport_params_
USDPrimReaderparent_reader_
const ImportSettingssettings_
int refcount_
bool is_in_instancer_proto_

Detailed Description

Definition at line 87 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()

◆ decref()

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

Definition at line 102 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 97 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 158 of file usd_reader_prim.hh.

References is_in_instancer_proto_.

◆ is_in_proto()

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

◆ name()

const std::string & blender::io::usd::USDPrimReader::name ( ) const
inline

Definition at line 144 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 82 of file usd_reader_prim.cc.

References object_.

◆ parent() [1/2]

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

Definition at line 116 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 120 of file usd_reader_prim.hh.

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

◆ prim()

◆ prim_path()

const std::string & blender::io::usd::USDPrimReader::prim_path ( ) const
inline

◆ read_object_data()

◆ refcount()

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

Definition at line 92 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 153 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 motionSampleTime = 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
motionSampleTimeThe time code for sampling the USD attributes.

Definition at line 21 of file usd_reader_prim.cc.

References import_params_, blender::io::usd::merge_with_parent(), 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

Definition at line 92 of file usd_reader_prim.hh.

Referenced by blender::io::usd::USDGeomReader::add_cache_modifier(), blender::io::usd::USDGeomReader::add_subdiv_modifier(), blender::io::usd::USDCameraReader::create_object(), blender::io::usd::USDCurvesReader::create_object(), blender::io::usd::USDInstanceReader::create_object(), blender::io::usd::USDLightReader::create_object(), blender::io::usd::USDMeshReader::create_object(), blender::io::usd::USDNurbsReader::create_object(), blender::io::usd::USDPointInstancerReader::create_object(), blender::io::usd::USDPointsReader::create_object(), blender::io::usd::USDShapeReader::create_object(), blender::io::usd::USDSkeletonReader::create_object(), blender::io::usd::USDVolumeReader::create_object(), blender::io::usd::USDXformReader::create_object(), object(), object(), blender::io::usd::USDCameraReader::read_object_data(), blender::io::usd::USDCurvesReader::read_object_data(), blender::io::usd::USDLightReader::read_object_data(), blender::io::usd::USDMeshReader::read_object_data(), blender::io::usd::USDNurbsReader::read_object_data(), blender::io::usd::USDPointInstancerReader::read_object_data(), blender::io::usd::USDPointsReader::read_object_data(), blender::io::usd::USDShapeReader::read_object_data(), blender::io::usd::USDSkeletonReader::read_object_data(), blender::io::usd::USDVolumeReader::read_object_data(), blender::io::usd::USDXformReader::read_object_data(), blender::io::usd::USDPointInstancerReader::set_collection(), blender::io::usd::USDInstanceReader::set_instance_collection(), set_props(), and USDPrimReader().

◆ parent_reader_

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

Definition at line 95 of file usd_reader_prim.hh.

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

◆ prim_

◆ prim_path_

std::string blender::io::usd::USDPrimReader::prim_path_
protected

◆ refcount_

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

Definition at line 97 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: