Currently,I use an alternative way to achieve the goal by adding a create attribute node to the network through HDK. I have another question is why the nodes not connected correctly when I open up the debug scene in UE4, but it turns out to works correctly anyway.
The disconnected height-field nodes when debugging the internal Houdini scene is a known bug. It only happens when debugging, the nodes are actually properly connected in the internal scene when using the plug-in, but for some reason, appears disconnected when saving that internal hip files.
I don't see anything wrong with the code you're using for adding the string attribute. In what function are you adding that call to FHoudiniLandscapeUtils::AddLandscapeStringAttribuete()?
I call FHoudiniLandscapeUtils::AddLandscapeStringAttribuete() in FHoudiniEngineUtils::HapiCreateInputNodeForLandscape, right after FHoudiniLandscapeUtils::CreateHeightfieldInputNode which returned a MergeId node I want to add attribute on.
The disconnected height-field nodes when debugging the internal Houdini scene is a known bug. It only happens when debugging, the nodes are actually properly connected in the internal scene when using the plug-in, but for some reason, appears disconnected when saving that internal hip files.
I don't see anything wrong with the code you're using for adding the string attribute. In what function are you adding that call to FHoudiniLandscapeUtils::AddLandscapeStringAttribuete()?