Hi all,
I'm trying to save some lists to a metadata entry via the python.
# Selected is a manually created Metadata Set.
# It contains a manually created list entry that
# contains the string entries ['test', 'TEST']
meta = vrMetadataService.getSelection()[0]
entry = meta.getEntries().data()[0]
print(f'<{entry.getValue()}>, <{entry.getValueType()}>')
# prints: <['test', 'Test']>, <vrKernelServices.vrMetadataTypes.ValueType.List>
entry.setValueType(vrMetadataTypes.ValueType.List)
entry.setValue([0, 0])
print(f'<{entry.getValue()}>, <{entry.getValueType()}>')
# prints: <[0, 0]>, <vrKernelServices.vrMetadataTypes.ValueType.List>
entry.setValueType(vrMetadataTypes.ValueType.List)
entry.setValue([0, 'test'])
print(f'<{entry.getValue()}>, <{entry.getValueType()}>')
# prints: <[0, 'test']>, <vrKernelServices.vrMetadataTypes.ValueType.List>
entry.setValueType(vrMetadataTypes.ValueType.List)
entry.setValue(['test', 0])
print(f'<{entry.getValue()}>, <{entry.getValueType()}>')
# prints: <['test', 0]>, <vrKernelServices.vrMetadataTypes.ValueType.List>
entry.setValueType(vrMetadataTypes.ValueType.List)
entry.setValue(['test', 'test'])
print(f'<{entry.getValue()}>, <{entry.getValueType()}>')
# prints <['test', 'test']>, <vrKernelServices.vrMetadataTypes.ValueType.String>
Whenever I pass it a list thats purely constisting of strings, VRED sets the type of the entry from <vrKernelServices.vrMetadataTypes.ValueType.List> to <vrKernelServices.vrMetadataTypes.ValueType.String>. If the list consisted of a single string, it is then handled like a regular sting. If it were multiple strings, VRED starts acting weired. It seems like it still returns the list when getting the value via Python, but if I interact with the metadata window it shows an empty <vrKernelServices.vrMetadataTypes.ValueType.String> entry, without the possibility to edit its value. The list can still be retrieved and edited via Python.
Is this a bug? Is it a feature? Am I missing something?
Hi,
Thanks for reporting this issue. Yes, I can reproduce this and I will create the bug ticket for it.
Best regards,
Anton
Can't find what you're looking for? Ask the community or share your knowledge.