Hi and sorry for the late reply,
you can react to a change in a node parameter registering a changed message with RegisterValueChangedMessage
You need to define the Node ID and the port. If you change some parameter this will call an update of the UI and CreateC4DDescription will be called.
From there you can achieve what you want. I did not try but as you said, in the customgui_string you can defined parameter for the custom GUI.
Let me know if it is not enough.
#include "maxon/datadescriptiondefinitiondatabase.h"
#include "maxon/datadescription_ui.h"
#include "maxon/datadescription_nodes.h"
#include "maxon/graph.h"
#include "customnode-customnodespace_descriptions.h"
static maxon::Result<void> ColorChanged(const maxon::DataDictionary& userData, maxon::DataDictionary& multiSelectionStorage)
{
iferr_scope;
maxon::GraphModelRef graph = userData.Get(maxon::ARGUMENTS::NODECORE::GRAPHMODEL) iferr_return;
// Node that owns the port (NODECORE::PORTPATH).
maxon::IoNodePath nodePath = userData.Get(maxon::ARGUMENTS::NODECORE::NODEPATH) iferr_return;
// Internal port on which the callback was registered.
maxon::NodePath innerPortPath = userData.Get(maxon::ARGUMENTS::NODECORE::INNERPORTPATH) iferr_return;
// Should always just be valid if the callback is fired.
CheckAssert(graph);
CheckAssert(nodePath.first.IsPopulated());
CheckAssert(innerPortPath.IsPopulated());
maxon::GraphNode currentNode = graph.GetNode(nodePath.first);
if (!currentNode.IsValid())
return maxon::NullptrError(MAXON_SOURCE_LOCATION);
const maxon::GraphNode colorA = graph.GetNode(innerPortPath);
if (!colorA.IsValid())
return maxon::NullptrError(MAXON_SOURCE_LOCATION);
const maxon::GraphNode hybridPort = currentNode.GetInputs().FindChild(maxonexample::NODE::USERNODE::HYBRID) iferr_return;
if (!colorA.IsValid())
return maxon::NullptrError(MAXON_SOURCE_LOCATION);
const maxon::ColorA colorAValue = colorA.GetDefaultValue(maxon::ColorA(0)) iferr_return;
if (colorAValue.r > 0.5)
{
// Make the graph modifiable.
maxon::GraphTransaction trans = graph.BeginTransaction() iferr_return;
hybridPort.SetValue(maxon::NODE::BASE::NAME, "Code Red"_s) iferr_return;
// Apply the change to the graph.
return trans.Commit();
}
return maxon::OK;
}
MAXON_INITIALIZATION(
[]() -> maxon::Result<void>
{
iferr_scope;
maxon::DataDescriptionDefinitionDatabaseInterface::RegisterValueChangedMessage(
maxonexample::NODE::USERNODE::GetId(), maxonexample::NODE::USERNODE::COLORA,
maxon::DescriptionMessageFunction(maxon::DESCRIPTION::UI::BASE::COMMANDCONTEXT.ENUM_NIMBUSCORE, nullptr, nullptr, ColorChanged)) iferr_return;
return maxon::OK;
}, nullptr);
Cheers,
Manuel