Blender
V3.3
|
Classes | |
struct | ExportJobData |
struct | ImportJobData |
struct | USDExporterContext |
class | USDHierarchyIterator |
class | USDCameraReader |
class | USDCurvesReader |
class | USDGeomReader |
class | USDLightReader |
struct | NodePlacementContext |
class | USDMaterialReader |
class | USDMeshReader |
class | USDNurbsReader |
struct | ImportSettings |
class | USDPrimReader |
class | USDStageReader |
class | USDVolumeReader |
class | USDXformReader |
class | USDAbstractWriter |
class | USDCameraWriter |
class | USDHairWriter |
class | USDLightWriter |
struct | InputSpec |
struct | USDMeshData |
class | USDGenericMeshWriter |
class | USDMeshWriter |
class | USDMetaballWriter |
class | USDTransformWriter |
class | USDVolumeWriter |
class | USDImagingTest |
class | USDStageCreationTest |
Typedefs | |
typedef std::map< pxr::SdfPath, std::vector< USDPrimReader * > > | ProtoReaderMap |
using | InputSpecMap = std::map< std::string, InputSpec > |
Enumerations | |
enum | { USD_NO_ERROR = 0 , USD_ARCHIVE_FAIL } |
Functions | |
static void | report_job_duration (const ExportJobData *data) |
static void | export_startjob (void *customdata, short *stop, short *do_update, float *progress) |
static void | export_endjob (void *customdata) |
static CacheArchiveHandle * | handle_from_stage_reader (USDStageReader *reader) |
static USDStageReader * | stage_reader_from_handle (CacheArchiveHandle *handle) |
static bool | gather_objects_paths (const pxr::UsdPrim &object, ListBase *object_paths) |
static void | convert_to_z_up (pxr::UsdStageRefPtr stage, ImportSettings *r_settings) |
static void | report_job_duration (const ImportJobData *data) |
static void | import_startjob (void *customdata, short *stop, short *do_update, float *progress) |
static void | import_endjob (void *customdata) |
static void | import_freejob (void *user_data) |
void | ensure_usd_plugin_path_registered () |
static bool | merge_with_parent (USDPrimReader *reader) |
static void | camera_sensor_size_for_render (const Camera *camera, const struct RenderData *rd, float *r_sensor_x, float *r_sensor_y) |
static pxr::UsdShadeShader | create_usd_preview_shader (const USDExporterContext &usd_export_context, pxr::UsdShadeMaterial &material, const char *name, int type) |
static pxr::UsdShadeShader | create_usd_preview_shader (const USDExporterContext &usd_export_context, pxr::UsdShadeMaterial &material, bNode *node) |
static void | create_uvmap_shader (const USDExporterContext &usd_export_context, bNode *tex_node, pxr::UsdShadeMaterial &usd_material, pxr::UsdShadeShader &usd_tex_shader, const pxr::TfToken &default_uv) |
static void | export_texture (bNode *node, const pxr::UsdStageRefPtr stage, const bool allow_overwrite=false) |
static bNode * | find_bsdf_node (Material *material) |
static void | get_absolute_path (Image *ima, char *r_path) |
static std::string | get_tex_image_asset_path (bNode *node, const pxr::UsdStageRefPtr stage, const USDExportParams &export_params) |
static InputSpecMap & | preview_surface_input_map () |
static bNode * | traverse_channel (bNodeSocket *input, short target_type) |
template<typename T1 , typename T2 > | |
void | create_input (pxr::UsdShadeShader &shader, const InputSpec &spec, const void *value) |
void | create_usd_preview_surface_material (const USDExporterContext &usd_export_context, Material *material, pxr::UsdShadeMaterial &usd_material, const std::string &default_uv) |
void | create_usd_viewport_material (const USDExporterContext &usd_export_context, Material *material, pxr::UsdShadeMaterial &usd_material) |
static std::string | get_in_memory_texture_filename (Image *ima) |
static void | export_in_memory_texture (Image *ima, const std::string &export_dir, const bool allow_overwrite) |
static pxr::TfToken | get_node_tex_image_color_space (bNode *node) |
static std::string | get_tex_image_asset_path (Image *ima) |
static void | copy_tiled_textures (Image *ima, const std::string &dest_dir, const bool allow_overwrite) |
static void | copy_single_file (Image *ima, const std::string &dest_dir, const bool allow_overwrite) |
static void | get_vertices (const Mesh *mesh, USDMeshData &usd_mesh_data) |
static void | get_loops_polys (const Mesh *mesh, USDMeshData &usd_mesh_data) |
static void | get_edge_creases (const Mesh *mesh, USDMeshData &usd_mesh_data) |
static void | get_vert_creases (const Mesh *mesh, USDMeshData &usd_mesh_data) |
TEST_F (USDImagingTest, CapsuleAdapterTest) | |
TEST_F (USDStageCreationTest, JSONFileLoadingTest) | |
std::string | register_usd_plugins_for_tests () |
using blender::io::usd::InputSpecMap = typedef std::map<std::string, InputSpec> |
Definition at line 88 of file usd_writer_material.cc.
typedef std::map<pxr::SdfPath, std::vector<USDPrimReader *> > blender::io::usd::ProtoReaderMap |
Definition at line 19 of file usd_reader_stage.h.
anonymous enum |
Enumerator | |
---|---|
USD_NO_ERROR | |
USD_ARCHIVE_FAIL |
Definition at line 112 of file usd_capi_import.cc.
|
static |
Definition at line 27 of file usd_writer_camera.cc.
References BKE_camera_sensor_fit(), BLI_assert_msg, camera, CAMERA_SENSOR_FIT_AUTO, CAMERA_SENSOR_FIT_HOR, CAMERA_SENSOR_FIT_VERT, RenderData::xasp, RenderData::xsch, RenderData::yasp, and RenderData::ysch.
Referenced by blender::io::usd::USDCameraWriter::do_write().
|
static |
Definition at line 91 of file usd_capi_import.cc.
References axis_angle_normalized_to_mat3(), blender::io::usd::ImportSettings::conversion_mat, copy_m4_m3(), blender::io::usd::ImportSettings::do_convert_mat, M_PI_2, stage, unit_m4(), and z.
Referenced by import_startjob(), and USD_create_handle().
|
static |
Definition at line 674 of file usd_writer_material.cc.
References BLI_copy(), BLI_exists(), BLI_path_cmp_normalized(), BLI_path_join(), BLI_split_file_part(), FILE_MAX, get_absolute_path(), RPT_WARNING, and WM_reportf().
Referenced by export_texture().
|
static |
Definition at line 621 of file usd_writer_material.cc.
References BKE_image_get_tile_strformat(), BKE_image_set_filepath_from_tile_number(), BLI_copy(), BLI_exists(), BLI_path_cmp_normalized(), BLI_path_join(), BLI_split_file_part(), FILE_MAX, FILE_MAXFILE, get_absolute_path(), LISTBASE_FOREACH, MEM_SAFE_FREE, RPT_WARNING, tile, Image::tiles, UDIM_TILE_FORMAT_UDIM, and WM_reportf().
Referenced by export_texture().
void blender::io::usd::create_input | ( | pxr::UsdShadeShader & | shader, |
const InputSpec & | spec, | ||
const void * | value | ||
) |
Definition at line 252 of file usd_writer_material.cc.
References blender::io::usd::InputSpec::input_name, blender::io::usd::InputSpec::input_type, T1, and T2.
|
static |
Definition at line 502 of file usd_writer_material.cc.
References create_usd_preview_shader(), blender::io::usd::USDExporterContext::export_params, usdtokens::file(), get_node_tex_image_color_space(), get_tex_image_asset_path(), material, node, SH_NODE_TEX_IMAGE, usdtokens::sourceColorSpace(), and blender::io::usd::USDExporterContext::stage.
|
static |
Definition at line 467 of file usd_writer_material.cc.
References material, usdtokens::preview(), usdtokens::preview_surface(), usdtokens::primvar_float2(), SH_NODE_BSDF_DIFFUSE, SH_NODE_BSDF_PRINCIPLED, SH_NODE_TEX_COORD, SH_NODE_TEX_IMAGE, SH_NODE_UVMAP, blender::io::usd::USDExporterContext::stage, usdtokens::surface(), type, and usdtokens::uv_texture().
Referenced by create_usd_preview_shader(), create_usd_preview_surface_material(), and create_uvmap_shader().
void blender::io::usd::create_usd_preview_surface_material | ( | const USDExporterContext & | usd_export_context, |
Material * | material, | ||
pxr::UsdShadeMaterial & | usd_material, | ||
const std::string & | default_uv = "" |
||
) |
Entry point to create an approximate USD Preview Surface network from a Cycles node graph. Due to the limited nodes in the USD Preview Surface specification, only the following nodes are supported:
default_uv | used as the default UV set name sampled by the primvar reader shaders generated for image texture nodes that don't have an attached UVMap node. |
Definition at line 117 of file usd_writer_material.cc.
References create_usd_preview_shader(), create_uvmap_shader(), blender::io::usd::USDExporterContext::export_params, export_texture(), USDExportParams::export_textures, find_bsdf_node(), blender::io::usd::InputSpec::input_name, blender::io::usd::InputSpec::input_type, LISTBASE_FOREACH, material, node, USDExportParams::overwrite_textures, usdtokens::preview(), usdtokens::preview_surface(), preview_surface_input_map(), blender::io::usd::InputSpec::set_default_value, SH_NODE_TEX_IMAGE, SOCK_FLOAT, SOCK_RGBA, SOCK_VECTOR, blender::io::usd::InputSpec::source_name, blender::io::usd::USDExporterContext::stage, traverse_channel(), bNode::type, and cyclestokens::UVMap().
Referenced by blender::io::usd::USDAbstractWriter::ensure_usd_material().
void blender::io::usd::create_usd_viewport_material | ( | const USDExporterContext & | usd_export_context, |
Material * | material, | ||
pxr::UsdShadeMaterial & | usd_material | ||
) |
Definition at line 207 of file usd_writer_material.cc.
References Material::b, usdtokens::diffuse_color(), Material::g, material, usdtokens::metallic(), Material::metallic, usdtokens::preview_shader(), usdtokens::preview_surface(), Material::r, usdtokens::roughness(), Material::roughness, blender::io::usd::USDExporterContext::stage, and usdtokens::surface().
Referenced by blender::io::usd::USDAbstractWriter::ensure_usd_material().
|
static |
Definition at line 262 of file usd_writer_material.cc.
References create_usd_preview_shader(), bNode::inputs, LISTBASE_FOREACH, usdtokens::result(), SH_NODE_TEX_COORD, SH_NODE_UVMAP, usdtokens::st(), bNode::storage, STREQ, traverse_channel(), and usdtokens::varname().
Referenced by create_usd_preview_surface_material().
void blender::io::usd::ensure_usd_plugin_path_registered | ( | ) |
Definition at line 12 of file usd_common.cc.
References BKE_appdir_folder_id(), and BLENDER_DATAFILES.
Referenced by USD_create_handle(), USD_export(), and USD_import().
Definition at line 154 of file usd_capi_export.cc.
References BLI_delete(), BLI_exists(), data, DEG_graph_free(), G, report_job_duration(), and WM_set_locked_interface().
Referenced by USD_export().
|
static |
Definition at line 352 of file usd_writer_material.cc.
References BKE_image_acquire_ibuf(), BKE_image_format_from_imbuf(), BKE_image_path_ensure_ext_from_imformat(), BKE_imbuf_write_as(), BLI_exists(), BLI_path_cmp_normalized(), BLI_path_join(), BLI_split_file_part(), FILE_MAX, Image::filepath, get_absolute_path(), Image::id, ID::name, RPT_WARNING, and WM_reportf().
Referenced by export_texture().
|
static |
Definition at line 57 of file usd_capi_export.cc.
References BKE_blender_version_string(), BKE_scene_graph_update_for_newframe(), BKE_scene_graph_update_tagged(), RenderData::cfra, data, DEG_get_input_scene(), RenderData::efra, FPS, G, blender::io::AbstractHierarchyIterator::iterate_and_write(), max, r, Scene::r, blender::io::AbstractHierarchyIterator::release_writers(), RPT_ERROR, UnitSettings::scale_length, scene, blender::io::usd::USDHierarchyIterator::set_export_frame(), RenderData::sfra, RenderData::subframe, Scene::unit, WM_reportf(), WM_set_locked_interface(), and z.
Referenced by USD_export().
|
static |
Definition at line 706 of file usd_writer_material.cc.
References BKE_image_has_packedfile(), BKE_image_is_dirty(), BLI_dir_create_recursive(), BLI_path_join(), BLI_split_dir_part(), copy_single_file(), copy_tiled_textures(), export_in_memory_texture(), FILE_MAX, IMA_SRC_GENERATED, IMA_SRC_TILED, node, SEP_STR, SH_NODE_TEX_ENVIRONMENT, SH_NODE_TEX_IMAGE, Image::source, and stage.
Referenced by create_usd_preview_surface_material().
Definition at line 455 of file usd_writer_material.cc.
References LISTBASE_FOREACH, material, node, bNodeTree::nodes, Material::nodetree, SH_NODE_BSDF_DIFFUSE, and SH_NODE_BSDF_PRINCIPLED.
Referenced by create_usd_preview_surface_material().
|
static |
Definition at line 70 of file usd_capi_import.cc.
References BLI_addtail(), BLI_strncpy(), MEM_callocN, and CacheObjectPath::path.
Referenced by USD_create_handle().
Definition at line 403 of file usd_writer_material.cc.
References BLI_path_abs(), BLI_path_normalize(), BLI_strncpy(), FILE_MAX, Image::filepath, Image::id, and ID_BLEND_PATH_FROM_GLOBAL.
Referenced by copy_single_file(), copy_tiled_textures(), export_in_memory_texture(), and get_tex_image_asset_path().
|
static |
Definition at line 278 of file usd_writer_mesh.cc.
References blender::io::usd::USDMeshData::crease_lengths, blender::io::usd::USDMeshData::crease_sharpnesses, blender::io::usd::USDMeshData::crease_vertex_indices, Mesh::medge, mesh, and Mesh::totedge.
|
static |
Definition at line 325 of file usd_writer_material.cc.
References BKE_image_acquire_ibuf(), BKE_image_format_from_imbuf(), BKE_image_has_packedfile(), BKE_image_is_dirty(), BKE_image_path_ensure_ext_from_imformat(), FILE_MAX, Image::id, IMA_SRC_GENERATED, ID::name, and Image::source.
Referenced by get_tex_image_asset_path().
|
static |
Definition at line 254 of file usd_writer_mesh.cc.
References blender::io::usd::USDMeshData::face_groups, blender::io::usd::USDMeshData::face_indices, blender::io::usd::USDMeshData::face_vertex_counts, MPoly::loopstart, MPoly::mat_nr, mesh, Mesh::mloop, Mesh::mpoly, Mesh::totcol, Mesh::totloop, MPoly::totloop, Mesh::totpoly, and MLoop::v.
|
static |
Definition at line 411 of file usd_writer_material.cc.
References Image::colorspace_settings, IMB_colormanagement_space_name_is_data(), IMB_colormanagement_space_name_is_srgb(), ColorManagedColorspaceSettings::name, node, usdtokens::raw(), and usdtokens::sRGB().
Referenced by create_usd_preview_shader().
|
static |
Definition at line 544 of file usd_writer_material.cc.
References BLI_path_is_rel(), BLI_path_join(), BLI_path_rel(), BLI_split_dir_part(), BLI_split_file_part(), BLI_str_replace_char(), USDExportParams::export_textures, FILE_MAX, Image::filepath, get_in_memory_texture_filename(), node, USDExportParams::relative_paths, and stage.
Referenced by create_usd_preview_shader().
|
static |
Definition at line 529 of file usd_writer_material.cc.
References FILE_MAX, and get_absolute_path().
|
static |
Definition at line 303 of file usd_writer_mesh.cc.
References CD_CREASE, blender::io::usd::USDMeshData::corner_indices, blender::io::usd::USDMeshData::corner_sharpnesses, CustomData_get_layer(), mesh, Mesh::totvert, v, and Mesh::vdata.
|
static |
Definition at line 244 of file usd_writer_mesh.cc.
References mesh, Mesh::mvert, blender::io::usd::USDMeshData::points, Mesh::totvert, and verts.
|
static |
Definition at line 60 of file usd_capi_import.cc.
Referenced by USD_create_handle().
Definition at line 290 of file usd_capi_import.cc.
References BKE_collection_object_add(), BKE_id_free_us(), BKE_layer_collection_get_active(), BKE_layer_collection_resync_allow(), BKE_layer_collection_resync_forbid(), BKE_main_collection_sync(), BKE_view_layer_base_deselect_all(), BKE_view_layer_base_find(), BKE_view_layer_base_select_and_set_active(), LayerCollection::collection, data, DEG_id_tag_update(), DEG_id_tag_update_ex(), DEG_relations_tag_update(), Collection::id, Object::id, ID_RECALC_ANIMATION, ID_RECALC_BASE_FLAGS, ID_RECALC_COPY_ON_WRITE, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, NC_SCENE, ND_FRAME, report_job_duration(), RPT_ERROR, USD_ARCHIVE_FAIL, USD_NO_ERROR, WM_main_add_notifier(), WM_report(), and WM_set_locked_interface().
Referenced by USD_import().
Definition at line 374 of file usd_capi_import.cc.
References data, and user_data.
Referenced by USD_import().
|
static |
Definition at line 147 of file usd_capi_import.cc.
References BKE_cachefile_add(), BKE_collection_add(), BKE_layer_collection_first_from_scene_collection(), BKE_main_blendfile_path_from_global(), BLI_path_abs(), BLI_path_basename(), BLI_path_to_display_name(), blender::io::usd::USDStageReader::collect_readers(), convert_to_z_up(), data, DEG_id_tag_update(), DEG_relations_tag_update(), CacheFile::filepath, G, CacheFile::id, Collection::id, id_fake_user_set(), ID_RECALC_COPY_ON_WRITE, id_us_min(), CacheFile::is_sequence, NC_SCENE, ND_LAYER, blender::io::usd::USDPrimReader::object(), blender::io::usd::USDPrimReader::parent(), Object::parent, blender::io::usd::USDStageReader::readers(), RPT_ERROR, CacheFile::scale, size(), blender::io::usd::USDStageReader::sort_readers(), stage, STRNCPY, WM_main_add_notifier(), WM_reportf(), and WM_set_locked_interface().
Referenced by USD_import().
|
static |
|
static |
Definition at line 226 of file usd_writer_material.cc.
References usdtokens::clearcoat(), usdtokens::clearcoatRoughness(), usdtokens::diffuse_color(), usdtokens::ior(), usdtokens::metallic(), usdtokens::normal(), usdtokens::opacity(), usdtokens::r(), usdtokens::rgb(), usdtokens::roughness(), and usdtokens::specular().
Referenced by create_usd_preview_surface_material().
std::string blender::io::usd::register_usd_plugins_for_tests | ( | ) |
Definition at line 17 of file usd_tests_common.cc.
References BLI_assert, BLI_path_join(), and FILE_MAX.
Referenced by TEST_F().
|
static |
Definition at line 49 of file usd_capi_export.cc.
References data, and blender::timeit::print_duration().
Referenced by export_endjob(), and import_endjob().
|
static |
Definition at line 139 of file usd_capi_import.cc.
References data, and blender::timeit::print_duration().
|
static |
Definition at line 65 of file usd_capi_import.cc.
Referenced by CacheReader_open_usd_object(), and USD_free_handle().
blender::io::usd::TEST_F | ( | USDImagingTest | , |
CapsuleAdapterTest | |||
) |
Definition at line 16 of file usd_imaging_test.cc.
References register_usd_plugins_for_tests(), and stage.
blender::io::usd::TEST_F | ( | USDStageCreationTest | , |
JSONFileLoadingTest | |||
) |
Definition at line 22 of file usd_stage_creation_test.cc.
References register_usd_plugins_for_tests().
|
static |
Definition at line 431 of file usd_writer_material.cc.
References input, bNode::inputs, LISTBASE_FOREACH, and bNode::type.
Referenced by create_usd_preview_surface_material(), and create_uvmap_shader().