vvvv / VL.StandardLibs

A collection of standard libraries for vvvv including VL.Stride, VL.Skia, VL.ImGui, msgpack.org[VL]
https://visualprogramming.net
GNU Lesser General Public License v3.0
35 stars 14 forks source link

`EnumType` does not support custom enums #630

Closed azeno closed 9 months ago

azeno commented 1 year ago

Describe the bug See https://discourse.vvvv.org/t/how-to-make-shaders-pickup-custom-enums/21448

We'll need to add an option to guide the system to dll where the enum is defined.

Which version are you experiencing the bug with? 5.0

Expected behavior The enum should get picked up.

azeno commented 1 year ago

One approach could be to add a second parameter to EnumType taking a relative path to the dll. That path could then be used in AddEnumTypePinAttribute to load the assembly and query the type from it.

tebjan commented 1 year ago

The name of the assembly should be enough if it is loaded, i.e. referenced by the .vl doc next to the shaders folder: https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assembly.load?view=net-6.0#system-reflection-assembly-load(system-reflection-assemblyname)

azeno commented 9 months ago

Just realized this works when using assembly qualified names. Just tested the following on https://github.com/bj-rn/VL.Addons/blob/main/vl/shaders/Pulse_Internal_TextureFX.sdsl and it worked:

    [EnumType("VL.Stride.Effects.TextureFX.PulseChannel, TextureFX")]
    int ChannelType;