Blender V5.0
blender::io::usd::USDStageReader Class Reference

#include <usd_reader_stage.hh>

Public Member Functions

 USDStageReader (pxr::UsdStageRefPtr stage, const USDImportParams &params, const std::function< CacheFile *()> &get_cache_file_fn={})
 ~USDStageReader ()
USDPrimReadercreate_reader_if_allowed (const pxr::UsdPrim &prim)
USDPrimReadercreate_reader (const pxr::UsdPrim &prim)
void collect_readers ()
void process_armature_modifiers () const
void import_all_materials (struct Main *bmain)
void fake_users_for_unused_materials ()
void find_material_import_hook_sources ()
void call_material_import_hooks (struct Main *bmain) const
bool valid () const
pxr::UsdStageRefPtr stage ()
const USDImportParamsparams () const
const ImportSettingssettings () const
ReportListreports () const
void clear_readers ()
const blender::Vector< USDPrimReader * > & readers () const
const blender::Vector< USDDomeLightReader * > & dome_light_readers () const
void sort_readers ()
void create_proto_collections (Main *bmain, Collection *parent_collection)

Protected Attributes

pxr::UsdStageRefPtr stage_
USDImportParams params_
ImportSettings settings_
blender::Vector< USDPrimReader * > readers_
blender::Vector< USDDomeLightReader * > dome_light_readers_
blender::Vector< pxr::SdfPath > material_paths_
ProtoReaderMap proto_readers_
ProtoReaderMap instancer_proto_readers_

Detailed Description

Definition at line 34 of file usd_reader_stage.hh.

Constructor & Destructor Documentation

◆ USDStageReader()

blender::io::usd::USDStageReader::USDStageReader ( pxr::UsdStageRefPtr stage,
const USDImportParams & params,
const std::function< CacheFile *()> & get_cache_file_fn = {} )

◆ ~USDStageReader()

blender::io::usd::USDStageReader::~USDStageReader ( )

Definition at line 216 of file usd_reader_stage.cc.

References clear_readers().

Member Function Documentation

◆ call_material_import_hooks()

void blender::io::usd::USDStageReader::call_material_import_hooks ( struct Main * bmain) const

Invoke USD hook add-ons to convert materials. This function should be called from the main thread and not from a background job.

Definition at line 689 of file usd_reader_stage.cc.

References blender::io::usd::call_material_import_hooks(), CLOG_WARN, blender::io::usd::USDMaterialReader::import_usd_preview(), LOG, params_, reports(), settings_, and stage_.

◆ clear_readers()

void blender::io::usd::USDStageReader::clear_readers ( )

Clear all cached reader collections.

Definition at line 720 of file usd_reader_stage.cc.

References blender::io::usd::decref(), dome_light_readers_, instancer_proto_readers_, proto_readers_, and readers_.

Referenced by collect_readers(), and ~USDStageReader().

◆ collect_readers()

◆ create_proto_collections()

◆ create_reader()

USDPrimReader * blender::io::usd::USDStageReader::create_reader ( const pxr::UsdPrim & prim)

Definition at line 284 of file usd_reader_stage.cc.

References params_, and settings_.

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

◆ create_reader_if_allowed()

USDPrimReader * blender::io::usd::USDStageReader::create_reader_if_allowed ( const pxr::UsdPrim & prim)

Definition at line 234 of file usd_reader_stage.cc.

References params_, and settings_.

◆ dome_light_readers()

const blender::Vector< USDDomeLightReader * > & blender::io::usd::USDStageReader::dome_light_readers ( ) const
inline

Definition at line 131 of file usd_reader_stage.hh.

References dome_light_readers_.

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

◆ fake_users_for_unused_materials()

void blender::io::usd::USDStageReader::fake_users_for_unused_materials ( )

Definition at line 665 of file usd_reader_stage.cc.

References id_fake_user_set(), and settings_.

◆ find_material_import_hook_sources()

void blender::io::usd::USDStageReader::find_material_import_hook_sources ( )

Discover the USD materials that can be converted by material import hook add-ons.

Definition at line 676 of file usd_reader_stage.cc.

References blender::io::usd::have_material_import_hook(), params_, reports(), settings_, and stage_.

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

◆ import_all_materials()

◆ params()

const USDImportParams & blender::io::usd::USDStageReader::params ( ) const
inline

Definition at line 107 of file usd_reader_stage.hh.

References params_.

Referenced by USDStageReader().

◆ process_armature_modifiers()

◆ readers()

const blender::Vector< USDPrimReader * > & blender::io::usd::USDStageReader::readers ( ) const
inline

◆ reports()

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

Get the wmJobWorkerStatus-provided reports list pointer, to use with the BKE_report API.

Definition at line 118 of file usd_reader_stage.hh.

References params_.

Referenced by call_material_import_hooks(), find_material_import_hook_sources(), and process_armature_modifiers().

◆ settings()

const ImportSettings & blender::io::usd::USDStageReader::settings ( ) const
inline

Definition at line 112 of file usd_reader_stage.hh.

References settings_.

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

◆ sort_readers()

void blender::io::usd::USDStageReader::sort_readers ( )

Definition at line 747 of file usd_reader_stage.cc.

References b, blender::parallel_sort(), and readers_.

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

◆ stage()

pxr::UsdStageRefPtr blender::io::usd::USDStageReader::stage ( )
inline

◆ valid()

bool blender::io::usd::USDStageReader::valid ( ) const

Member Data Documentation

◆ dome_light_readers_

blender::Vector<USDDomeLightReader *> blender::io::usd::USDStageReader::dome_light_readers_
protected

Definition at line 45 of file usd_reader_stage.hh.

Referenced by clear_readers(), and dome_light_readers().

◆ instancer_proto_readers_

ProtoReaderMap blender::io::usd::USDStageReader::instancer_proto_readers_
protected

Definition at line 55 of file usd_reader_stage.hh.

Referenced by clear_readers(), and create_proto_collections().

◆ material_paths_

blender::Vector<pxr::SdfPath> blender::io::usd::USDStageReader::material_paths_
protected

Definition at line 49 of file usd_reader_stage.hh.

Referenced by import_all_materials().

◆ params_

◆ proto_readers_

ProtoReaderMap blender::io::usd::USDStageReader::proto_readers_
protected

Definition at line 52 of file usd_reader_stage.hh.

Referenced by clear_readers(), collect_readers(), and create_proto_collections().

◆ readers_

blender::Vector<USDPrimReader *> blender::io::usd::USDStageReader::readers_
protected

◆ settings_

◆ stage_

pxr::UsdStageRefPtr blender::io::usd::USDStageReader::stage_
protected

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