ExternalDefinition.HideWhenNoValue and Parameter.ClearValue() never work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Calling Parameter.ClearValue() doesn't work when HideWhenNoValue is set to true. I have tried setting HideWhenNoValue to true from within code, but it would later revert to false and Parameter.ClearValue() would fail.
I tried setting it to true immediately before calling Parameter.ClearValue() but it still failed. Finally, I edited the actual shared parameter file and it still fails.
if (defs.TryGetValue(shared.GUID, out var def) && def.HideWhenNoValue) { shared.ClearValue(); }
When it fails, it does so with the message 'Cannot call ClearValue when HideWhenNoValue is false.' (I have also double checked and the parameter is not ReadOnly and is shared). How are the HideWhenNoValue property and ClearValue() method supposed to be used?
Additionally, even when HideWhenNoValue is set to true, the parameter still shows up in the properties panel.