Skip to content

Commit

Permalink
Merge fix-7.3.2 to master (#1948)
Browse files Browse the repository at this point in the history
* Ensure polymesh topology attributes are not written to USD when not set #1914

* Fix behaviour when the vidxs array is null #1914 (#1915)

* Fix instance primvar indices with multiple prototypes #1923 (#1925)

* Ensure subdiv_iterations is not set uselessly during procedural updates (#1931)

* Ensure subdiv_iterations is not set uselessly during procedural updates #1929

(cherry picked from commit 1adc860)

* Add changelog

* check if the VtValue is empty before doing a UncheckedGet (#1934)

* update changelog for 7.3.2.1 release (#1943)

* Support shaders shared by multiple materials (#1945)

* Support shader shared by multiple materials #1940

* Add changelog

* Improve connection resolution for shaders which are not under the hierarchy of materials #1940

---------

Co-authored-by: cpichard <cpichard@users.noreply.github.com>
  • Loading branch information
sebastienblor and cpichard authored Jun 26, 2024
1 parent 47c0ea4 commit 4110873
Show file tree
Hide file tree
Showing 8 changed files with 580 additions and 278 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
- [usd#1661](https://github.com/Autodesk/arnold-usd/issues/1661) - In the procedural the subdivision meshes will use the normals generated by the subdivision algorithm instead of the normal primvar.
- [usd#1919](https://github.com/Autodesk/arnold-usd/issues/1919) - Fix rendering multiple frames with husk.

## Pending bugfix release
- [usd#1940](https://github.com/Autodesk/arnold-usd/issues/1940) - Incorrect handling of shaders referenced in multiple materials

## [7.3.2.1] - 2024-06-19

### Bug fixes
Expand Down
28 changes: 24 additions & 4 deletions libs/render_delegate/node_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,22 @@ class MaterialHydraReader : public MaterialReader
void ConnectShader(AtNode* node, const std::string& attrName,
const SdfPath& target) override
{
_context.AddConnection(
node, attrName.c_str(), target.GetPrimPath().GetText(),
ArnoldAPIAdapter::CONNECTION_LINK, target.GetElementString());
if (target.HasPrefix(_nodeGraph.GetId())) {
_context.AddConnection(
node, attrName.c_str(), target.GetPrimPath().GetText(),
ArnoldAPIAdapter::CONNECTION_LINK, target.GetElementString());

}
else {
// If the connected shader is not already prefixed with our material path,
// we add this prefix to that shader name #1940
std::string targetPath =
_nodeGraph.GetId().GetString() + target.GetPrimPath().GetString();
_context.AddConnection(
node, attrName.c_str(), targetPath.c_str(),
ArnoldAPIAdapter::CONNECTION_LINK, target.GetElementString());
}

}

// GetShaderInput is called to return a parameter value for a given shader
Expand Down Expand Up @@ -333,6 +346,7 @@ AtNode* HdArnoldNodeGraph::ReadMaterialNetwork(const HdMaterialNetwork& network,
InputAttributesList inputAttrs;
TimeSettings time;
AtNode* terminalNode = nullptr;
const SdfPath &id = GetId();
for (const auto& node : network.nodes) {
// Check if we only want to translate a filtered list of shaders
// from this network, and eventually ignore this node
Expand Down Expand Up @@ -370,7 +384,13 @@ AtNode* HdArnoldNodeGraph::ReadMaterialNetwork(const HdMaterialNetwork& network,
inputAttrs[c->outputName].connection = SdfPath(c->inputId.GetString() + ".outputs:" + c->inputName.GetString());
}
}
AtNode* arnoldNode = ReadShader(node.path.GetString(), node.identifier, inputAttrs, _renderDelegate->GetAPIAdapter(), time, materialReader);
const SdfPath &nodePath = node.path;
// If the shader is not already prefixed with its material path,
// we add the prefix to the shader name #1940
std::string arnoldNodeName = nodePath.HasPrefix(id) ?
nodePath.GetString() : id.GetString() + nodePath.GetString();

AtNode* arnoldNode = ReadShader(arnoldNodeName, node.identifier, inputAttrs, _renderDelegate->GetAPIAdapter(), time, materialReader);
// Eventually store the root AtNode if it matches the terminal path
if (node.path == terminalPath)
terminalNode = arnoldNode;
Expand Down
3 changes: 1 addition & 2 deletions testsuite/groups
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ darwin:
#######################
# Tests that can be run in hydra mode

hydra: test_0000 test_0001 test_0002 test_0003 test_0004 test_0005 test_0006 test_0007 test_0008 test_0009 test_0010 test_0011 test_0012 test_0014 test_0016 test_0017 test_0018 test_0019 test_0020 test_0021 test_0022 test_0023 test_0024 test_0025 test_0026 test_0027 test_0028 test_0029 test_0030 test_0031 test_0032 test_0033 test_0034 test_0037 test_0038 test_0041 test_0046 test_0048 test_0049 test_0050 test_0051 test_0052 test_0055 test_0056 test_0057 test_0058 test_0059 test_0060 test_0062 test_0064 test_0066 test_0067 test_0068 test_0071 test_0072 test_0073 test_0074 test_0077 test_0080 test_0081 test_0082 test_0083 test_0084 test_0086 test_0087 test_0088 test_0091 test_0093 test_0094 test_0097 test_0099 test_0104 test_0105 test_0107 test_0108 test_0110 test_0112 test_0113 test_0114 test_0115 test_0117 test_0120 test_0121 test_0122 test_0123 test_0125 test_0126 test_0127 test_0128 test_0129 test_0130 test_0132 test_0133 test_0135 test_0139 test_0140 test_0141 test_0142 test_0143 test_0144 test_0145 test_0148 test_0149 test_0150 test_0151 test_0158 test_0159 test_0160 test_0161 test_0162 test_0163 test_0164 test_0165 test_0166 test_0168 test_0169 test_0170 test_0171 test_0172 test_0173 test_0174 test_0175 test_0177 test_0178 test_0180 test_0183 test_0184 test_0186 test_0187 test_0188 test_0189 test_0191 test_0194 test_0195 test_0196 test_0197 test_0198 test_0200 test_0201 test_0202 test_0204 test_0205 test_0206 test_0207 test_0215 test_0216 test_0217 test_0219 test_0220 test_0221 test_0222 test_0223 test_0225 test_0227 test_0228 test_0229 test_0230 test_0231 test_0232 test_0233 test_0234 test_0238 test_0239 test_0240 test_0242 test_0243 test_0244 test_0245 test_0299 test_0316 test_0739 test_1181 test_1204 test_1209 test_1223 test_1225 test_1238 test_1245 test_1262 test_1294 test_1309 test_1311 test_1313 test_1329 test_1333 test_1334 test_1346 test_1354 test_1416 test_1420 test_1426 test_1427.1 test_1427.2 test_1427.3 test_1430 test_1433 test_1435 test_1438 test_1442 test_1457 test_1486 test_1499 test_1524 test_1525 test_1530 test_1535 test_1538 test_1546 test_1547.1 test_1547.2 test_1550 test_1567 test_1588 test_1590 test_1593 test_1607 test_1613 test_1625 test_1632 test_1635 test_1654 test_1657 test_1678 test_1705 test_1718 test_1726 test_1730 test_1735 test_1769 test_1772 test_1776 test_1814 test_1868 test_1873 test_1878 test_1881 test_1894 test_1906 test_1923 test_14028

hydra: test_0000 test_0001 test_0002 test_0003 test_0004 test_0005 test_0006 test_0007 test_0008 test_0009 test_0010 test_0011 test_0012 test_0014 test_0016 test_0017 test_0018 test_0019 test_0020 test_0021 test_0022 test_0023 test_0024 test_0025 test_0026 test_0027 test_0028 test_0029 test_0030 test_0031 test_0032 test_0033 test_0034 test_0037 test_0038 test_0041 test_0046 test_0048 test_0049 test_0050 test_0051 test_0052 test_0055 test_0056 test_0057 test_0058 test_0059 test_0060 test_0062 test_0064 test_0066 test_0067 test_0068 test_0071 test_0072 test_0073 test_0074 test_0077 test_0080 test_0081 test_0082 test_0083 test_0084 test_0086 test_0087 test_0088 test_0091 test_0093 test_0094 test_0097 test_0099 test_0104 test_0105 test_0107 test_0108 test_0110 test_0112 test_0113 test_0114 test_0115 test_0117 test_0120 test_0121 test_0122 test_0123 test_0125 test_0126 test_0127 test_0128 test_0129 test_0130 test_0132 test_0133 test_0135 test_0139 test_0140 test_0141 test_0142 test_0143 test_0144 test_0145 test_0148 test_0149 test_0150 test_0151 test_0158 test_0159 test_0160 test_0161 test_0162 test_0163 test_0164 test_0165 test_0166 test_0168 test_0169 test_0170 test_0171 test_0172 test_0173 test_0174 test_0175 test_0177 test_0178 test_0180 test_0183 test_0184 test_0186 test_0187 test_0188 test_0189 test_0191 test_0194 test_0195 test_0196 test_0197 test_0198 test_0200 test_0201 test_0202 test_0204 test_0205 test_0206 test_0207 test_0215 test_0216 test_0217 test_0219 test_0220 test_0221 test_0222 test_0223 test_0225 test_0227 test_0228 test_0229 test_0230 test_0231 test_0232 test_0233 test_0234 test_0238 test_0239 test_0240 test_0242 test_0243 test_0244 test_0245 test_0299 test_0316 test_0739 test_1181 test_1204 test_1209 test_1223 test_1225 test_1238 test_1245 test_1262 test_1294 test_1309 test_1311 test_1313 test_1329 test_1333 test_1334 test_1346 test_1354 test_1416 test_1420 test_1426 test_1427.1 test_1427.2 test_1427.3 test_1430 test_1433 test_1435 test_1438 test_1442 test_1457 test_1486 test_1499 test_1524 test_1525 test_1530 test_1535 test_1538 test_1546 test_1547.1 test_1547.2 test_1550 test_1567 test_1588 test_1590 test_1593 test_1607 test_1613 test_1625 test_1632 test_1635 test_1654 test_1657 test_1678 test_1705 test_1718 test_1726 test_1730 test_1735 test_1769 test_1772 test_1776 test_1814 test_1868 test_1873 test_1878 test_1881 test_1894 test_1906 test_1923 test_1940 test_14028

# Tests in this group will never be executed (you can use it to temporarily disable some tests and/or groups)
ignore:
Expand Down
Loading

0 comments on commit 4110873

Please sign in to comment.