diff options
author | Siddhartha Jejurkar <f20180617@goa.bits-pilani.ac.in> | 2021-12-17 16:01:32 +0300 |
---|---|---|
committer | Siddhartha Jejurkar <f20180617@goa.bits-pilani.ac.in> | 2021-12-17 16:01:32 +0300 |
commit | dbc41b30f88b96f7d8c6e995b17f5930eb55cc77 (patch) | |
tree | c6c495328443ea3621e5df2ef483b0e0dd504496 /source/blender/io/usd/intern/usd_reader_material.h | |
parent | 99a2af76d10e05a18987be5d554ada197b1ca086 (diff) | |
parent | 7c9e4099854a4fc8eab4db97173c1aacd25f9e08 (diff) |
Merge branch 'master' into soc-2021-uv-edge-select-supportsoc-2021-uv-edge-select-support
Diffstat (limited to 'source/blender/io/usd/intern/usd_reader_material.h')
-rw-r--r-- | source/blender/io/usd/intern/usd_reader_material.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/io/usd/intern/usd_reader_material.h b/source/blender/io/usd/intern/usd_reader_material.h index a17504bd590..fb40b4f2f6d 100644 --- a/source/blender/io/usd/intern/usd_reader_material.h +++ b/source/blender/io/usd/intern/usd_reader_material.h @@ -90,12 +90,14 @@ class USDMaterialReader { Material *add_material(const pxr::UsdShadeMaterial &usd_material) const; protected: + /** Create the Principled BSDF shader node network. */ void import_usd_preview(Material *mtl, const pxr::UsdShadeShader &usd_shader) const; void set_principled_node_inputs(bNode *principled_node, bNodeTree *ntree, const pxr::UsdShadeShader &usd_shader) const; + /** Convert the given USD shader input to an input on the given Blender node. */ void set_node_input(const pxr::UsdShadeInput &usd_input, bNode *dest_node, const char *dest_socket_name, @@ -103,6 +105,10 @@ class USDMaterialReader { int column, NodePlacementContext *r_ctx) const; + /** + * Follow the connected source of the USD input to create corresponding inputs + * for the given Blender node. + */ void follow_connection(const pxr::UsdShadeInput &usd_input, bNode *dest_node, const char *dest_socket_name, @@ -118,8 +124,18 @@ class USDMaterialReader { int column, NodePlacementContext *r_ctx) const; + /** + * Load the texture image node's texture from the path given by the USD shader's + * file input value. + */ void load_tex_image(const pxr::UsdShadeShader &usd_shader, bNode *tex_image) const; + /** + * This function creates a Blender UV Map node, under the simplifying assumption that + * UsdPrimvarReader_float2 shaders output UV coordinates. + * TODO(makowalski): investigate supporting conversion to other Blender node types + * (e.g., Attribute Nodes) if needed. + */ void convert_usd_primvar_reader_float2(const pxr::UsdShadeShader &usd_shader, const pxr::TfToken &usd_source_name, bNode *dest_node, |