Forum

Serialization - Class indexes ignore category

Hi, some of my classes are being serialized with a number at the end, most not. And the number changes sometimes:

eg.: <Bee r:Type="Schema.Blocks.Effects.Generic.Delay_0" /> and sometimes it’s _1 - making the files incompatible between runs.

There is only one Delay in this category.

Changing the name to DelayEffect for instance mitigates this problem. I have the same issue with my Damper block. Is it because these names are already in the VL Core library? This shouldn’t matter as they’re in completely different categories and therefore it’s obviously different classes so no indexing should be needed.

this is still an open issue I guess. just not with pads, but with types.

anyway, recently had a similar issue again. vanilla json serialization helped me work around it while vanilla xelement didn’t

Is the type as the category suggest generic? If so I’d suggest to have another look when roslyn branch comes in if that is ok for you - problem is that the current backend emits a new class (that’s the _0, _1 coming from) for each generic instantiation. In rosyln this will not be the case anymore and it will make proper use of .NET generics.

@Elias No, it’s not really generic in language sense, just in the usage sense in Schéma - it works on all attributes because it handles the whole PropertyBank with everything that’s in it.

The generic settings are just the same as for all the other Blocks, the only difference here and with the Damper really seems that it conflicts with another node name even though it’s in a different category. As I said if I change the name to something else the suffix goes away.

off topic

@Elias Please take this snapshot of a diamond pick axe as an earnest token of appreciation for your groundbreaking work. getting roslyn to perform even close to il emission, wow
image

Godspeed! Needed to be said

7 Likes