From 497fc9abeabb0ef870865e04f97faf0e7010a4e7 Mon Sep 17 00:00:00 2001 From: John Haddon Date: Thu, 28 Mar 2024 12:04:08 +0000 Subject: [PATCH] ArnoldShaderUI : Use `help` parameter metadata This is now provided by the Arnold core in Arnold 7.3, rather than being duplicated in each of the official DCC plugins (and not existing at all in poor old Gaffer). --- Changes.md | 1 + python/GafferArnoldUI/ArnoldShaderUI.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Changes.md b/Changes.md index 2e48483334c..f73eb6012aa 100644 --- a/Changes.md +++ b/Changes.md @@ -13,6 +13,7 @@ Improvements - EditScope : Added a summary of edits in the NodeEditor, with the ability to select the affected objects and quickly navigate to the processor nodes. - Arnold : OSL shaders with connections from multiple outputs are no longer duplicated on export to Arnold. +- ArnoldShader : Added parameter tooltips based on `help` metadata provided by Arnold. Fixes ----- diff --git a/python/GafferArnoldUI/ArnoldShaderUI.py b/python/GafferArnoldUI/ArnoldShaderUI.py index 57ef2328f37..2852f2c97e2 100644 --- a/python/GafferArnoldUI/ArnoldShaderUI.py +++ b/python/GafferArnoldUI/ArnoldShaderUI.py @@ -205,6 +205,8 @@ def __translateNodeMetadata( nodeEntry ) : # Shader description. We support Arnold-style "desc" and # OSL style "help". + ## \todo It seems that Arnold's standard is now "help", so + # we may be able to remove "desc". description = __aiMetadataGetStr( nodeEntry, None, "desc", defaultValue = __aiMetadataGetStr( nodeEntry, None, "help" ) @@ -245,7 +247,10 @@ def __translateNodeMetadata( nodeEntry ) : # Parameter description - description = __aiMetadataGetStr( nodeEntry, paramName, "desc" ) + description = __aiMetadataGetStr( + nodeEntry, paramName, "desc", + defaultValue = __aiMetadataGetStr( nodeEntry, paramName, "help" ) + ) if description is not None : __metadata[paramPath]["description"] = description