|
Blender V4.5
|
#include "usd_reader_material.hh"#include "usd_asset_utils.hh"#include "usd_hash_types.hh"#include "usd_reader_utils.hh"#include "usd_utils.hh"#include "BKE_image.hh"#include "BKE_lib_id.hh"#include "BKE_library.hh"#include "BKE_main.hh"#include "BKE_material.hh"#include "BKE_node.hh"#include "BKE_node_legacy_types.hh"#include "BKE_node_tree_update.hh"#include "BKE_report.hh"#include "BLI_fileops.h"#include "BLI_listbase.h"#include "BLI_map.hh"#include "BLI_math_vector.h"#include "BLI_math_vector_types.hh"#include "BLI_path_utils.hh"#include "BLI_string.h"#include "BLI_string_ref.hh"#include "BLI_vector.hh"#include "DNA_material_types.h"#include "IMB_colormanagement.hh"#include <pxr/base/gf/vec3f.h>#include <pxr/usd/ar/packageUtils.h>#include <pxr/usd/usdShade/material.h>#include <pxr/usd/usdShade/shader.h>#include "CLG_log.h"Go to the source code of this file.
Classes | |
| struct | blender::io::usd::IntermediateNode |
Namespaces | |
| namespace | usdtokens |
| namespace | blender |
| namespace | blender::io |
| namespace | blender::io::usd |
Typedefs | |
| using | ShaderToNodeMap |
Functions | |
| static const pxr::TfToken | usdtokens::a ("a", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::b ("b", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::bias ("bias", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::clearcoat ("clearcoat", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::clearcoatRoughness ("clearcoatRoughness", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::diffuseColor ("diffuseColor", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::displacement ("displacement", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::emissiveColor ("emissiveColor", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::file ("file", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::g ("g", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::ior ("ior", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::in ("in", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::metallic ("metallic", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::normal ("normal", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::occlusion ("occlusion", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::opacity ("opacity", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::opacityThreshold ("opacityThreshold", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::r ("r", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::rgb ("rgb", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::rgba ("rgba", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::roughness ("roughness", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::scale ("scale", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::sourceColorSpace ("sourceColorSpace", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::specularColor ("specularColor", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::st ("st", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::varname ("varname", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::auto_ ("auto", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::sRGB ("sRGB", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::raw ("raw", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::RAW ("RAW", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::black ("black", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::clamp ("clamp", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::repeat ("repeat", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::mirror ("mirror", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::wrapS ("wrapS", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::wrapT ("wrapT", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::rotation ("rotation", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::translation ("translation", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::UsdPreviewSurface ("UsdPreviewSurface", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::UsdPrimvarReader_float2 ("UsdPrimvarReader_float2", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::UsdUVTexture ("UsdUVTexture", pxr::TfToken::Immortal) |
| static const pxr::TfToken | usdtokens::UsdTransform2d ("UsdTransform2d", pxr::TfToken::Immortal) |
| static bNode * | add_node (bNodeTree *ntree, const int type, const blender::float2 loc) |
| static void | link_nodes (bNodeTree *ntree, bNode *source, const blender::StringRefNull sock_out, bNode *dest, const blender::StringRefNull sock_in) |
| static pxr::SdfLayerHandle | get_layer_handle (const pxr::UsdAttribute &attribute) |
| static blender::Vector< int > | get_udim_tiles (const std::string &file_path) |
| static void | add_udim_tiles (Image *image, const blender::Vector< int > &indices) |
| static bool | needs_blend (const pxr::UsdShadeShader &usd_shader) |
| static float | get_opacity_threshold (const pxr::UsdShadeShader &usd_shader, float default_value=0.0f) |
| static pxr::TfToken | get_source_color_space (const pxr::UsdShadeShader &usd_shader) |
| static int | get_image_extension (const pxr::UsdShadeShader &usd_shader, const int default_value) |
| static bool | get_usd_preview_surface (const pxr::UsdShadeMaterial &usd_material, pxr::UsdShadeShader &r_preview_surface) |
| static void | set_viewport_material_props (Material *mtl, const pxr::UsdShadeShader &usd_preview) |
| static pxr::UsdShadeInput | get_input (const pxr::UsdShadeShader &usd_shader, const pxr::TfToken &input_name) |
| static bNodeSocket * | get_input_socket (bNode *node, const blender::StringRefNull identifier, ReportList *reports) |
| static IntermediateNode | blender::io::usd::add_normal_map (bNodeTree *ntree, int column, NodePlacementContext &ctx) |
| static IntermediateNode | blender::io::usd::add_scale_bias (const pxr::UsdShadeShader &usd_shader, bNodeTree *ntree, int column, bool feeds_normal_map, NodePlacementContext &ctx) |
| static IntermediateNode | blender::io::usd::add_scale_bias_adjust (bNodeTree *ntree, int column, NodePlacementContext &ctx) |
| static IntermediateNode | blender::io::usd::add_separate_color (const pxr::UsdShadeShader &usd_shader, const pxr::TfToken &usd_source_name, bNodeTree *ntree, int column, NodePlacementContext &ctx) |
| static IntermediateNode | blender::io::usd::add_lessthan (bNodeTree *ntree, float threshold, int column, NodePlacementContext &ctx) |
| static IntermediateNode | blender::io::usd::add_oneminus (bNodeTree *ntree, int column, NodePlacementContext &ctx) |
| static void | blender::io::usd::configure_displacement (const pxr::UsdShadeShader &usd_shader, bNode *displacement_node) |
| static pxr::UsdShadeShader | blender::io::usd::node_graph_output_source (const pxr::UsdShadeNodeGraph &node_graph, const pxr::TfToken &output_name) |
| void | blender::io::usd::build_material_map (const Main *bmain, blender::Map< std::string, Material * > &r_mat_map) |
| Material * | blender::io::usd::find_existing_material (const pxr::SdfPath &usd_mat_path, const USDImportParams ¶ms, const blender::Map< std::string, Material * > &mat_map, const blender::Map< pxr::SdfPath, Material * > &usd_path_to_mat) |
Variables | |
| static CLG_LogRef | LOG = {"io.usd"} |
Definition at line 27 of file usd_reader_material.hh.
|
static |
Definition at line 102 of file usd_reader_material.cc.
References add_node(), bNode::location, and blender::bke::node_add_static_node().
Referenced by blender::io::usd::add_lessthan(), add_node(), blender::io::usd::add_normal_map(), blender::io::usd::add_oneminus(), blender::io::usd::add_scale_bias(), blender::io::usd::add_scale_bias_adjust(), blender::io::usd::add_separate_color(), blender::io::usd::USDMaterialReader::convert_usd_primvar_reader_float2(), blender::io::usd::USDMaterialReader::convert_usd_primvar_reader_generic(), blender::io::usd::USDMaterialReader::convert_usd_transform_2d(), blender::io::usd::USDMaterialReader::convert_usd_uv_texture(), blender::io::usd::USDMaterialReader::import_usd_preview_nodes(), and blender::io::usd::USDMaterialReader::set_displacement_node_inputs().
|
static |
Definition at line 177 of file usd_reader_material.cc.
References add_udim_tiles(), BKE_image_add_tile(), IMA_SRC_TILED, and Image::source.
Referenced by add_udim_tiles(), and blender::io::usd::USDMaterialReader::load_tex_image().
|
static |
Definition at line 258 of file usd_reader_material.cc.
References usdtokens::black(), usdtokens::clamp(), get_image_extension(), usdtokens::mirror(), usdtokens::repeat(), SHD_IMAGE_EXTENSION_CLIP, SHD_IMAGE_EXTENSION_EXTEND, SHD_IMAGE_EXTENSION_MIRROR, SHD_IMAGE_EXTENSION_REPEAT, usdtokens::wrapS(), and usdtokens::wrapT().
Referenced by get_image_extension(), and blender::io::usd::USDMaterialReader::load_tex_image().
|
static |
Definition at line 357 of file usd_reader_material.cc.
References get_input(), and input.
Referenced by blender::io::usd::USDMaterialReader::convert_usd_transform_2d(), and get_input().
|
static |
Definition at line 378 of file usd_reader_material.cc.
References BKE_reportf(), blender::StringRefNull::c_str(), get_input_socket(), bNode::idname, blender::bke::node_find_socket(), reports, RPT_ERROR, and SOCK_IN.
Referenced by blender::io::usd::USDMaterialReader::convert_usd_transform_2d(), and get_input_socket().
|
static |
Definition at line 138 of file usd_reader_material.cc.
References get_layer_handle().
Referenced by get_layer_handle(), and blender::io::usd::USDMaterialReader::load_tex_image().
|
static |
Definition at line 215 of file usd_reader_material.cc.
References get_opacity_threshold(), and usdtokens::opacityThreshold().
Referenced by get_opacity_threshold(), and blender::io::usd::USDMaterialReader::set_principled_node_inputs().
|
static |
Definition at line 238 of file usd_reader_material.cc.
References get_source_color_space(), and usdtokens::sourceColorSpace().
Referenced by get_source_color_space(), and blender::io::usd::USDMaterialReader::load_tex_image().
|
static |
Definition at line 153 of file usd_reader_material.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BKE_image_get_tile_info(), BLI_freelistN(), FILE_MAX, get_udim_tiles(), LISTBASE_FOREACH, POINTER_AS_INT, result, STRNCPY(), tile, and tiles.
Referenced by get_udim_tiles(), and blender::io::usd::USDMaterialReader::load_tex_image().
|
static |
Definition at line 299 of file usd_reader_material.cc.
References get_usd_preview_surface(), and usdtokens::UsdPreviewSurface().
Referenced by get_usd_preview_surface(), and blender::io::usd::USDMaterialReader::import_usd_preview().
|
static |
Definition at line 112 of file usd_reader_material.cc.
References blender::StringRefNull::c_str(), CLOG_ERROR, link_nodes(), LOG, blender::bke::node_add_link(), blender::bke::node_count_socket_links(), blender::bke::node_find_socket(), SOCK_IN, and SOCK_OUT.
Referenced by blender::io::usd::USDMaterialReader::convert_usd_primvar_reader_float2(), blender::io::usd::USDMaterialReader::convert_usd_primvar_reader_generic(), blender::io::usd::USDMaterialReader::convert_usd_transform_2d(), blender::io::usd::USDMaterialReader::convert_usd_uv_texture(), blender::io::usd::USDMaterialReader::follow_connection(), blender::io::usd::USDMaterialReader::import_usd_preview_nodes(), link_nodes(), and blender::io::usd::USDMaterialReader::set_displacement_node_inputs().
|
static |
Definition at line 188 of file usd_reader_material.cc.
References needs_blend(), and usdtokens::opacity().
Referenced by blender::io::usd::USDMaterialReader::import_usd_preview_nodes(), and needs_blend().
|
static |
Definition at line 320 of file usd_reader_material.cc.
References Material::b, usdtokens::diffuseColor(), Material::g, Material::metallic, usdtokens::metallic(), Material::r, Material::roughness, usdtokens::roughness(), and set_viewport_material_props().
Referenced by blender::io::usd::USDMaterialReader::import_usd_preview(), and set_viewport_material_props().
|
static |
Definition at line 41 of file usd_reader_material.cc.