anima icon indicating copy to clipboard operation
anima copied to clipboard

Add/Investigate support for C#

Open ceceppa opened this issue 4 years ago • 6 comments

ceceppa avatar Sep 17 '21 07:09 ceceppa

Looking at the structure of your project and the complexity of it i'm pretty sure C# would be a better fit for it! I will see if i can help you port it to c# in the following days!

zakstam avatar Jan 07 '22 13:01 zakstam

That's sounds great to me. Although I would wait for the syntax and the main feature to be stable first. Also, a full rewrite could be a very big job, so I was more thinking of writing a wrapper around Anima and AnimaNode first. This would allow C# users to use the wrapper and have the autocomplete. Then pass to convert both to C# and at very last convert AnimaTween (as is the one that would take more time)

ceceppa avatar Jan 07 '22 16:01 ceceppa

I had a Anima wrapper for C#, but it will not likely increase a performance since all of functions are only called from GDScript. The reason why I didn't fully convert it to C# is because of having a dynamically function that returns 2 possible values which isn't possible on C# (I'm not talking about Tuples). It would be better if someone actually fully convert Anima C#, but if anyone wants a wrapper just for temporary use, then I'll submit a pull request.

Terria-K avatar Jan 07 '22 16:01 Terria-K

I had a Anima wrapper for C#, but it will not likely increase a performance since all of functions are only called from GDScript. The reason why I didn't fully convert it to C# is because of having a dynamically function that returns 2 possible values which isn't possible on C# (I'm not talking about Tuples). It would be better if someone actually fully convert Anima C#, but if anyone wants a wrapper just for temporary use, then I'll submit a pull request.

If we need a fully converted Anima C#, both projects needs to be maintained. In c# there is something called out that has a similar function https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/out-parameter-modifier

CodeDoctorDE avatar Feb 13 '22 14:02 CodeDoctorDE

If we need a fully converted Anima C#, both projects needs to be maintained. In c# there is something called out that has a similar function https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/out-parameter-modifier

Yeah, that's a problem, we need to maintained both projects, and if GDScript version has some changes, it would need a C# changes aswell. If it's just a wrapper, it don't need to have much changes as its just calling from GDScript API. Since Visual Editor will be coming out soon, its such a pain to convert it to C# because there is a scenes now with export variables that would be hard to convert in C#.

Terria-K avatar Mar 16 '22 05:03 Terria-K

Yep, maintaining a C# version could be a bit too much. I made some performance improvements that halved Anima's time to animate a property. So it should be fast enough to don't cause any performance issues.

Considering that, I would say that in the short time, a wrapper is preferable, and, in the long run, see if there is any part worth converting to improve performances.

ceceppa avatar Mar 17 '22 13:03 ceceppa