Skip to content

Commit

Permalink
Merging fix-7.0.0 to master (Autodesk#909)
Browse files Browse the repository at this point in the history
* Fixing testsuite issues using 21.02+ and supporting new and old light parameter naming conventions. (Autodesk#881)

* Fixing testsuite issues using 21.02+ and supporting new and old light parameter naming conventions.

Fixes Autodesk#880
Fixes Autodesk#772

* Only call AiBegin/AiEnd in the delegate if no arnold session is active Autodesk#884 (Autodesk#885)

* Support render tags in the render delegate. (Autodesk#883)

* Checking for render tags.
* Tracking render tags for shapes.
* Improving render tag tracking.
* Interrupt before disabling nodes.
* Renaming render tag handling functions and moving the core logic to a separate function.
* Tracking the point instancer's render tag.

Fixes Autodesk#843

* Improving conversions between integer types. (Autodesk#889)

* Setting unsigned int parameters from int. (Autodesk#887)

* Adding more tests and conversions. (Autodesk#887)

* Passing render session to AiDeviceAutoSelect. (Autodesk#903)

Fixes Autodesk#902

* Avoid calling AiRenderBegin when render is already running. (Autodesk#901)

Fixes Autodesk#900

* Fixing the use of AI_TYPE_INT AOVs and removing a warning when setting blend_opacity. (Autodesk#908)

Fixes Autodesk#905

* Setting the returned version to default in the Sdr plugin. (Autodesk#907)

Fixes Autodesk#906

Co-authored-by: Sebastien Blaineau-Ortega <sebastien.blaineau.ortega@autodesk.com>
  • Loading branch information
sirpalee and sebastienblor authored Nov 4, 2021
1 parent a7f2fa4 commit 660f3f2
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 13 deletions.
16 changes: 8 additions & 8 deletions ndr/discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ NdrNodeDiscoveryResultVec NdrArnoldDiscoveryPlugin::DiscoverNodes(const Context&
TfToken filename("<built-in>");
prim.GetMetadata(_tokens->filename, &filename);
ret.emplace_back(
NdrIdentifier(TfStringPrintf("arnold:%s", shaderName.GetText())), // identifier
NdrVersion(AI_VERSION_ARCH_NUM, AI_VERSION_MAJOR_NUM), // version
shaderName, // name
_tokens->shader, // family
_tokens->arnold, // discoveryType
_tokens->arnold, // sourceType
filename, // uri
filename // resolvedUri
NdrIdentifier(TfStringPrintf("arnold:%s", shaderName.GetText())), // identifier
NdrVersion(AI_VERSION_ARCH_NUM, AI_VERSION_MAJOR_NUM).GetAsDefault(), // version
shaderName, // name
_tokens->shader, // family
_tokens->arnold, // discoveryType
_tokens->arnold, // sourceType
filename, // uri
filename // resolvedUri
);
}
return ret;
Expand Down
2 changes: 1 addition & 1 deletion render_delegate/nodes/driver_aov.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ node_finish {}
driver_supports_pixel_type
{
return pixel_type == AI_TYPE_RGBA || pixel_type == AI_TYPE_RGB || pixel_type == AI_TYPE_VECTOR ||
pixel_type == AI_TYPE_VECTOR2 || pixel_type == AI_TYPE_FLOAT || pixel_type == AI_TYPE_FLOAT;
pixel_type == AI_TYPE_VECTOR2 || pixel_type == AI_TYPE_FLOAT || pixel_type == AI_TYPE_INT;
}

driver_extension { return supportedExtensions; }
Expand Down
4 changes: 4 additions & 0 deletions render_delegate/render_delegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,11 @@ void HdArnoldRenderDelegate::_SetRenderSetting(const TfToken& _key, const VtValu
if (key == str::t_enable_gpu_rendering) {
_CheckForBoolValue(value, [&](const bool b) {
AiNodeSetStr(_options, str::render_device, b ? str::GPU : str::CPU);
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiDeviceAutoSelect(_renderSession);
#else
AiDeviceAutoSelect();
#endif
});
} else if (key == str::t_log_verbosity) {
if (value.IsHolding<int>()) {
Expand Down
6 changes: 4 additions & 2 deletions render_delegate/render_param.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,13 @@ HdArnoldRenderParam::Status HdArnoldRenderParam::Render()
return Status::Aborted;
}
_paused.store(false, std::memory_order_release);
if (status != AI_RENDER_STATUS_RENDERING) {
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderBegin(_delegate->GetRenderSession());
AiRenderBegin(_delegate->GetRenderSession());
#else
AiRenderBegin();
AiRenderBegin();
#endif
}
return Status::Converging;
}

Expand Down
11 changes: 9 additions & 2 deletions render_delegate/render_pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,13 @@ AtNode* _CreateFilter(HdArnoldRenderDelegate* renderDelegate, const HdAovSetting
return filter;
}

void _DisableBlendOpacity(AtNode* node)
{
if (AiNodeEntryLookUpParameter(AiNodeGetNodeEntry(node), str::blend_opacity) != nullptr) {
AiNodeSetBool(node, str::blend_opacity, false);
}
}

const std::string _CreateAOV(
HdArnoldRenderDelegate* renderDelegate, const ArnoldAOVType& arnoldTypes, const std::string& name,
const TfToken& sourceType, const std::string& sourceName, AtNode*& writer, AtNode*& reader,
Expand Down Expand Up @@ -340,7 +347,7 @@ const std::string _CreateAOV(
AiNodeSetStr(writer, str::name, writerName);
AiNodeSetStr(reader, str::name, readerName);
AiNodeSetStr(writer, str::aov_name, AtString(name.c_str()));
AiNodeSetBool(writer, str::blend_opacity, false);
_DisableBlendOpacity(writer);
AiNodeLink(reader, str::aov_input, writer);
aovShaders.push_back(writer);
return name;
Expand Down Expand Up @@ -673,7 +680,7 @@ void HdArnoldRenderPass::_Execute(const HdRenderPassStateSharedPtr& renderPassSt
AiNodeSetStr(buffer.writer, str::name, writerName);
AiNodeSetStr(buffer.reader, str::name, readerName);
AiNodeSetStr(buffer.writer, str::aov_name, AtString(aovName));
AiNodeSetBool(buffer.writer, str::blend_opacity, false);
_DisableBlendOpacity(buffer.writer);
AiNodeLink(buffer.reader, str::aov_input, buffer.writer);
aovShaders.push_back(buffer.writer);
} else {
Expand Down

0 comments on commit 660f3f2

Please sign in to comment.