diff options
Diffstat (limited to 'intern/cycles/hydra')
-rw-r--r-- | intern/cycles/hydra/camera.cpp | 9 | ||||
-rw-r--r-- | intern/cycles/hydra/material.cpp | 13 |
2 files changed, 12 insertions, 10 deletions
diff --git a/intern/cycles/hydra/camera.cpp b/intern/cycles/hydra/camera.cpp index 62042cbbcd2..8b76afb2e44 100644 --- a/intern/cycles/hydra/camera.cpp +++ b/intern/cycles/hydra/camera.cpp @@ -281,9 +281,12 @@ void HdCyclesCamera::ApplyCameraSettings(HdRenderParam *renderParam, auto data = dataUnconformedWindow; CameraUtilConformWindow(&data, windowPolicy, width / height); - static_assert(GfCamera::Perspective == CAMERA_PERSPECTIVE && - GfCamera::Orthographic == CAMERA_ORTHOGRAPHIC); - cam->set_camera_type(static_cast<CameraType>(data.GetProjection())); + if (data.GetProjection() == GfCamera::Orthographic) { + cam->set_camera_type(CAMERA_ORTHOGRAPHIC); + } + else { + cam->set_camera_type(CAMERA_PERSPECTIVE); + } const float metersPerUnit = static_cast<HdCyclesSession *>(renderParam)->GetStageMetersPerUnit(); diff --git a/intern/cycles/hydra/material.cpp b/intern/cycles/hydra/material.cpp index b296d9f3751..a20f6578270 100644 --- a/intern/cycles/hydra/material.cpp +++ b/intern/cycles/hydra/material.cpp @@ -266,7 +266,7 @@ void HdCyclesMaterial::UpdateParameters(NodeDesc &nodeDesc, const std::map<TfToken, VtValue> ¶meters, const SdfPath &nodePath) { - for (const std::pair<TfToken, VtValue> ¶m : parameters) { + for (const auto ¶m : parameters) { VtValue value = param.second; // See if the parameter name is in USDPreviewSurface terms, and needs to be converted @@ -313,7 +313,7 @@ void HdCyclesMaterial::UpdateParameters(const HdMaterialNetwork &network) void HdCyclesMaterial::UpdateParameters(const HdMaterialNetwork2 &network) { - for (const std::pair<SdfPath, HdMaterialNode2> &nodeEntry : network.nodes) { + for (const auto &nodeEntry : network.nodes) { const SdfPath &nodePath = nodeEntry.first; const auto nodeIt = _nodes.find(nodePath); @@ -331,8 +331,7 @@ void HdCyclesMaterial::UpdateConnections(NodeDesc &nodeDesc, const SdfPath &nodePath, ShaderGraph *shaderGraph) { - for (const std::pair<TfToken, std::vector<HdMaterialConnection2>> &connection : - matNode.inputConnections) { + for (const auto &connection : matNode.inputConnections) { const TfToken &dstSocketName = connection.first; const UsdToCyclesMapping *inputMapping = nodeDesc.mapping; @@ -418,7 +417,7 @@ void HdCyclesMaterial::PopulateShaderGraph(const HdMaterialNetwork2 &networkMap) auto graph = new ShaderGraph(); // Iterate all the nodes first and build a complete but unconnected graph with parameters set - for (const std::pair<SdfPath, HdMaterialNode2> &nodeEntry : networkMap.nodes) { + for (const auto &nodeEntry : networkMap.nodes) { NodeDesc nodeDesc = {}; const SdfPath &nodePath = nodeEntry.first; @@ -465,7 +464,7 @@ void HdCyclesMaterial::PopulateShaderGraph(const HdMaterialNetwork2 &networkMap) // Now that all nodes have been constructed, iterate the network again and build up any // connections between nodes - for (const std::pair<SdfPath, HdMaterialNode2> &nodeEntry : networkMap.nodes) { + for (const auto &nodeEntry : networkMap.nodes) { const SdfPath &nodePath = nodeEntry.first; const auto nodeIt = _nodes.find(nodePath); @@ -478,7 +477,7 @@ void HdCyclesMaterial::PopulateShaderGraph(const HdMaterialNetwork2 &networkMap) } // Finally connect the terminals to the graph output (Surface, Volume, Displacement) - for (const std::pair<TfToken, HdMaterialConnection2> &terminalEntry : networkMap.terminals) { + for (const auto &terminalEntry : networkMap.terminals) { const TfToken &terminalName = terminalEntry.first; const HdMaterialConnection2 &connection = terminalEntry.second; |