So I’m not a fan of scripting languages like python at all, so that’s the main reason for wondering about this, and the future of Blender having support in using a managed language like C#. Just with the direction .Net is going with it being supported on all OS platforms now I’m wonder if something like https://github.com/dotnet/corert runtime compilation along with Blender supporting a C# api would ever likely happen?
How feasible would it be in implementing I have no idea, but still interested to see if others would like to see it happen.
Supporting multiple languages is not something we’re currently interested in.
Embedding a language runtime has a significant maintenance overhead, so there would need to be very compelling reasons (besides developer preference) to add support for other languages or to move away from Python.
You can use pythonnet, it’s good opensource project that allows to call any .NET function from python, and also, allows to some extend bidirectional communication with .NET. We use it in both 3ds Max and Houdni tools. But I think python is much more versatile then .NET for scripting, and I use C# everyday with Unity, and know and use it since it appear in 2000/2001.
By the way, I’m moving away from 3ds Max (15+ years) to Blender (2.8) and I’m loving it. Very versatile, very powerful, and incredible fast for the tasks I need to do.
Hell yeah i’d like c# instead of python. I understand why python was chosen initially, it being open source and all back in the 2000’s, when c# was very much not. But in the current day, yeah, c# is a sorely missed feature, python sucks nutz.
I would enjoy using C# way more in Blender than Python. I simply don’t like so many aspects of it. I passionately dislike it .
However, there is quite an Blender ecosystem built around Python, so a switch won’t happen and would not make sense. Having an additional API for C# would be an unnecessary overhead in my opinion.
I expect a requirement would be to have a C/C++ API, which could then be used by C#. A C/C++ API appears way more likely to happen, even though it is an anti-feature.
I’ve just found out about Mojo lang, a superset of Python designed for AI programming, with the choice to code with static or dynamic types, and have immutables/constants. And to top it off…has an allegedly theoretical 25K times faster execution time. It’s yet to be released to the public, private beta is currently underway. The future for python and blender programming is looking bright indeed.
I don’t see how Mojo could be useful for the future of Python and Blender. Mojo is not Python and as far as I can see, if you want the full speed of Mojo, it isn’t Python compatible anymore (that’s why I am confused by the statement it is a subset of Python). From a practical point of view, I don’t see how this would be useful for Blender.
Thanks, that’s where my confusion came from. I most likely misunderstood it in an interview. Superset makes more sense, indeed.
Though, it doesn’t change much regarding the future of Python in Blender from my current point of view.
Am I wrong in thinking that a team capable of creating a C plugin should be able to just fork Blender and write C code within the source code itself to do what they need to do?
For many things, they could probably even missuse the api which Cycles uses to interface with Blender.
If memory serves me right, @KWD mentioned somewhere in some casual side discussion a while ago, he does this with respect to some personal, private fork which uses said api to have Blender interface with some custom node system (which Kevin wrote himself for fun or research purposes or whatever it be).
Since there are no chances of C# getting into Blender (for now) I guess that we have to find other workarounds:
Use Blender Python only as glue code
Write all of the logic (heavy lifting) into another language.
Since .NET 6 and .NET 7 things started getting into the right track, and now is feasible to interoperate code among Python and .NET without any problems.
For me personally, the intention would be to write C# code, instead of Python. Your example shows how to use C# libraries from Python. In theory, https://github.com/pythonnet/pythonnet would also allow to execute Python code from within .NET, though it would need to be thoroughly tested whether it can be used with Blender too.
Personally, I always decide against those sorts of approaches, because if something doesn’t work, there is essentially no support. Even worse, it might work with one version and then fail in future updates. That happend to me for other projects and that’s why I stick to the official stuff only and leave my personal preferences out of the way.