|
Blender V5.0
|
#include <usd_reader_stage.hh>
Public Member Functions | |
| USDStageReader (pxr::UsdStageRefPtr stage, const USDImportParams ¶ms, const std::function< CacheFile *()> &get_cache_file_fn={}) | |
| ~USDStageReader () | |
| USDPrimReader * | create_reader_if_allowed (const pxr::UsdPrim &prim) |
| USDPrimReader * | create_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 USDImportParams & | params () const |
| const ImportSettings & | settings () const |
| ReportList * | reports () 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_ |
Definition at line 34 of file usd_reader_stage.hh.
| blender::io::usd::USDStageReader::USDStageReader | ( | pxr::UsdStageRefPtr | stage, |
| const USDImportParams & | params, | ||
| const std::function< CacheFile *()> & | get_cache_file_fn = {} ) |
Definition at line 200 of file usd_reader_stage.cc.
References blender::io::usd::convert_to_z_up(), blender::io::usd::determine_blender_compat(), blender::io::usd::find_prefix_to_skip(), params(), params_, settings_, stage(), and stage_.
| blender::io::usd::USDStageReader::~USDStageReader | ( | ) |
Definition at line 216 of file usd_reader_stage.cc.
References clear_readers().
| 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_.
| 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().
| void blender::io::usd::USDStageReader::collect_readers | ( | ) |
Definition at line 531 of file usd_reader_stage.cc.
References clear_readers(), collect_readers(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::is_empty(), params_, proto_readers_, readers_, stage_, and valid().
Referenced by collect_readers(), and blender::io::usd::import_startjob().
| void blender::io::usd::USDStageReader::create_proto_collections | ( | Main * | bmain, |
| Collection * | parent_collection ) |
Create prototype collections for instancing by the USD instance readers.
Definition at line 757 of file usd_reader_stage.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), BKE_collection_object_add(), BLI_assert, CLOG_WARN, COLLECTION_HIDE_RENDER, COLLECTION_HIDE_VIEWPORT, blender::io::usd::create_collection(), DEG_id_tag_update(), Collection::flag, Collection::id, ID_RECALC_HIERARCHY, instancer_proto_readers_, integer_digits_i(), LOG, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default(), blender::io::usd::USDPrimReader::object(), blender::io::usd::USDPointInstancerReader::proto_paths(), proto_readers_, readers_, blender::io::usd::USDPointInstancerReader::set_collection(), and blender::io::usd::set_instance_collection().
| 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().
| USDPrimReader * blender::io::usd::USDStageReader::create_reader_if_allowed | ( | const pxr::UsdPrim & | prim | ) |
Definition at line 234 of file usd_reader_stage.cc.
|
inline |
Definition at line 131 of file usd_reader_stage.hh.
References dome_light_readers_.
Referenced by blender::io::usd::import_startjob().
| 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_.
| 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().
| void blender::io::usd::USDStageReader::import_all_materials | ( | struct Main * | bmain | ) |
Definition at line 615 of file usd_reader_stage.cc.
References blender::io::usd::USDMaterialReader::add_material(), BLI_assert, BLI_assert_msg, blender::io::usd::build_material_map(), blender::io::usd::find_existing_material(), Material::id, material_paths_, ID::name, params_, settings_, stage_, blender::io::usd::USD_MTL_NAME_COLLISION_MAKE_UNIQUE, and valid().
Referenced by blender::io::usd::import_startjob().
|
inline |
Definition at line 107 of file usd_reader_stage.hh.
References params_.
Referenced by USDStageReader().
| void blender::io::usd::USDStageReader::process_armature_modifiers | ( | ) | const |
Complete setting up the armature modifiers that were created for skinned meshes by setting the modifier object on the corresponding modifier.
Definition at line 572 of file usd_reader_stage.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), BKE_modifiers_findby_type(), BKE_reportf(), eModifierType_Armature, blender::io::usd::USDMeshReader::get_skeleton_path(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default(), ArmatureModifierData::object, blender::io::usd::USDPrimReader::object(), readers_, reports(), and RPT_WARNING.
Referenced by blender::io::usd::import_startjob().
|
inline |
Definition at line 126 of file usd_reader_stage.hh.
References readers_.
Referenced by blender::io::usd::call_import_hooks(), and blender::io::usd::import_startjob().
|
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().
|
inline |
Definition at line 112 of file usd_reader_stage.hh.
References settings_.
Referenced by blender::io::usd::call_import_hooks().
| 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().
|
inline |
Definition at line 103 of file usd_reader_stage.hh.
References stage_.
Referenced by blender::io::usd::CacheReader_open_usd_object(), blender::io::usd::call_import_hooks(), and USDStageReader().
| bool blender::io::usd::USDStageReader::valid | ( | ) | const |
Definition at line 221 of file usd_reader_stage.cc.
References stage_.
Referenced by blender::io::usd::CacheReader_open_usd_object(), collect_readers(), and import_all_materials().
|
protected |
Definition at line 45 of file usd_reader_stage.hh.
Referenced by clear_readers(), and dome_light_readers().
|
protected |
Definition at line 55 of file usd_reader_stage.hh.
Referenced by clear_readers(), and create_proto_collections().
|
protected |
Definition at line 49 of file usd_reader_stage.hh.
Referenced by import_all_materials().
|
protected |
Definition at line 38 of file usd_reader_stage.hh.
Referenced by call_material_import_hooks(), collect_readers(), create_reader(), create_reader_if_allowed(), find_material_import_hook_sources(), import_all_materials(), params(), reports(), and USDStageReader().
|
protected |
Definition at line 52 of file usd_reader_stage.hh.
Referenced by clear_readers(), collect_readers(), and create_proto_collections().
|
protected |
Definition at line 41 of file usd_reader_stage.hh.
Referenced by clear_readers(), collect_readers(), create_proto_collections(), process_armature_modifiers(), readers(), and sort_readers().
|
protected |
Definition at line 39 of file usd_reader_stage.hh.
Referenced by call_material_import_hooks(), create_reader(), create_reader_if_allowed(), fake_users_for_unused_materials(), find_material_import_hook_sources(), import_all_materials(), settings(), and USDStageReader().
|
protected |
Definition at line 37 of file usd_reader_stage.hh.
Referenced by call_material_import_hooks(), collect_readers(), find_material_import_hook_sources(), import_all_materials(), stage(), USDStageReader(), and valid().