diff options
author | makowalski <makowalski@nvidia.com> | 2021-03-04 02:48:53 +0300 |
---|---|---|
committer | makowalski <makowalski@nvidia.com> | 2021-03-04 02:48:53 +0300 |
commit | 945be6aa02da250f8a560102603ba539e2bb753d (patch) | |
tree | 1957d07cc6786e35acc96836d71457ccd87a0a1e | |
parent | 82a6f152abb269a6a7b49e4084dceec60462da6d (diff) |
USD Import: material conversion minor updates.
Added comment re UsdPreviewSurface conversion. Now handling
lowercase raw color space specification.
-rw-r--r-- | source/blender/io/usd/import/usd_material_importer.cc | 3 | ||||
-rw-r--r-- | source/blender/io/usd/import/usd_material_importer.h | 18 |
2 files changed, 20 insertions, 1 deletions
diff --git a/source/blender/io/usd/import/usd_material_importer.cc b/source/blender/io/usd/import/usd_material_importer.cc index 6acba783aaa..11978db442e 100644 --- a/source/blender/io/usd/import/usd_material_importer.cc +++ b/source/blender/io/usd/import/usd_material_importer.cc @@ -68,6 +68,7 @@ static const pxr::TfToken st("st", pxr::TfToken::Immortal); static const pxr::TfToken varname("varname", pxr::TfToken::Immortal); // Color space names +static const pxr::TfToken raw("raw", pxr::TfToken::Immortal); static const pxr::TfToken RAW("RAW", pxr::TfToken::Immortal); // USD shader names. @@ -498,7 +499,7 @@ void USDMaterialImporter::convert_usd_uv_texture(const pxr::UsdShadeShader &usd_ // assuming sRGB otherwise, but more complex logic might be // required if the color space is "auto". pxr::TfToken colorSpace = file_input.GetAttr().GetColorSpace(); - if (colorSpace == usdtokens::RAW) { + if (colorSpace == usdtokens::RAW || colorSpace == usdtokens::raw) { STRNCPY(image->colorspace_settings.name, "Raw"); } } diff --git a/source/blender/io/usd/import/usd_material_importer.h b/source/blender/io/usd/import/usd_material_importer.h index 5013deffec4..3eed7946b18 100644 --- a/source/blender/io/usd/import/usd_material_importer.h +++ b/source/blender/io/usd/import/usd_material_importer.h @@ -50,6 +50,24 @@ struct NodePlacementContext { /* Converts USD materials to Blender representation. */ +// The current implementation converts UsdPreviewSurface to Blender +// nodes as follows: +// +// UsdPreviewSurface -> Pricipled BSDF +// UsdUVTexture -> Texture Image + Normal Map +// UsdPrimvarReader_float2 -> UV Map +// +// Limitations: arbitrary primvar readers or UsdTransform2d not yet +// supported. For UsdPreviewSurface, only the file and st inputs +// are handled, and the color space is retrieved from the texture +// metadata. +// +// TODO(makowalski): Investigate adding support for converting additional +// shaders and inputs. Supporting certain types of inputs, such as texture +// scale and bias, will probably require creating Blender Group nodes with +// the corresponding inputs. + + class USDMaterialImporter { protected: USDImporterContext context_; |