Metadata entry list does not show pure string lists when created via Python

Metadata entry list does not show pure string lists when created via Python

benfabian.bekemeier
Explorer Explorer
354 Views
1 Reply
Message 1 of 2

Metadata entry list does not show pure string lists when created via Python

benfabian.bekemeier
Explorer
Explorer

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.

benfabianbekemeier_1-1718379214804.png

Is this a bug? Is it a feature? Am I missing something?

0 Likes
355 Views
1 Reply
Reply (1)
Message 2 of 2

anton_shelenkov
Autodesk
Autodesk

Hi,

 

Thanks for reporting this issue. Yes, I can reproduce this and I will create the bug ticket for it.

 

Best regards,

Anton