Skip to content

"Array to Array of VData" should not unwrap variants #71

@raphschru

Description

@raphschru

image

Behavior:
When decomposing a variant containing an array of variants into an array of variants with the function "Array to Array of VData", the elements are automatically unwrapped from their variant, so instead of having an array of variants containing each a variant, I have an array of variants with the contained type directly.

Problem:
Now I have an array of variants with heterogeneous contained types, so I cannot apply the reverse operation with function "Array of VData to Array". I have to wrap each element back in a variant first, then use the reverse function.

This behavior differs from the similar function for clusters, which, when decomposing a cluster of variants into an array of variants, effectively gives the correct "Variant" type (the elements are not unwrapped from their variant).

Explanation:
This is because "Array to Array of VData" internally uses the native function "Variant to Data", which naturally unwraps variants, while "Cluster to Array of VData" implements its own parsing method, which strictly preserves data types.

Proposed solutions:
Align the behavior of "Array to Array of VData" with the function "Cluster to Array of VData", meaning strictly preserve data types of the elements.
If modifying the current behavior is too dangerous for applications relying on the current behavior, could we imagine adding an option on the function to choose to not unwrap the variants?

See attached the VI created with LV2020-32bit:
[LV2020] OpenG Array to Array of VData Unwraps Variants.zip

Regards,
Raphaël.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions