Page 1 of 4

Making Blender in Java

Posted: Thu Dec 07, 2006 5:44 pm
by elander
Has anyone ever tried making Blender or at least a minimal part of it in Java instead of C?

Think about some of the advantages:

- Java support for OpenGL, through JOGL, is very good.

- Theres little problems with supporting apis.

- A great development environment with Eclipse.

- Extending the program dynamicaly with scripts or even extra java classes would be much easier since dynamicaly linking Java classes is painless.

Posted: Fri Dec 08, 2006 3:15 am
by z3r0_d
Are any java opengl libraries installed by default now?

... I'd imagine it'd just be too much effort for little gain, you might as well start over from scratch

Posted: Fri Dec 08, 2006 8:00 am
by jesterKing
Not that I'm aware of. But there have also been suggestions to do Blender entirely in C++, or in C#, or in Python. There is even an attempt to implement Blender in Lua (but currently on hold)...

/Nathan

Posted: Fri Dec 08, 2006 8:57 am
by LetterRip
Who would be insane enough to implement Blender in Lua? <grin>

The C++ and C# and other proposals have been one off statements without any serious intent as far as I'm aware.

Regarding python - I know some have done a bit of experimenting - but I thought 'project purple' was not aimed at an entire rewrite in Python, but only subsets of the functionality.

LetterRip

Posted: Fri Dec 08, 2006 9:56 am
by jesterKing
LetterRip wrote:Who would be insane enough to implement Blender in Lua? <grin>
I? :wink:

/Nathan

Posted: Sun Dec 10, 2006 5:48 pm
by elander
LetterRip wrote:Who would be insane enough to implement Blender in Lua? <grin>
What does java has to do with lua? Java compiles bytecode to native code on demand and can make programs that match the speed of any complex apliction done in C. Not talking about micro-benchmarks because these are not apropreate to test real aplications.

And yes there is a java standard for a native opengl binding that supports opengl 2.0 and even has some patches for known driver issues. It's being developed by a Sun team.

https://jogl.dev.java.net/

Also google for JSR-231.
LetterRip wrote: Regarding python - I know some have done a bit of experimenting - but I thought 'project purple' was not aimed at an entire rewrite in Python, but only subsets of the functionality.
Doing so would be a mistake. Python even with a JIT like Psyco doesn't match the performance of the Java VM.

Posted: Sun Dec 10, 2006 7:42 pm
by stiv
Doing so would be a mistake. Python even with a JIT like Psyco doesn't match the performance of the Java VM.
The idea is to re-architect Blender as a Python extension module. We would re-use the existing C code pretty much as is.

Rewriting Blender in Python is as silly as rewriting it in Java.

Posted: Sun Dec 10, 2006 9:17 pm
by elander
Thats an old misconception about the Java language that was proven wrong many years ago. Java is not Python so Java does not need any C core or any other workarounds to run at top speed as if it was a C program. If you don't believe this then go check for yourself.

About Python, even if you use Psyco speed will be far from that of a C program. In this case i don't see the purpose of rewriting parts of Blender in slow Python scripts instead of doing it in Java.

Another advantage the Java binding for opengl supports version 2.0 and is very good and providing pacthes for common driver bugs that work with both Ati and NVidia cards.

How hard would it be to link Java to Blender for people to create java class plugins for example?

Posted: Sun Dec 10, 2006 11:57 pm
by LetterRip
elander,

the Lua comment was an inside joke - jesterKing is a well known Lua-phile and I suspected that he was the one interested in doing such a rewrite.
Doing so would be a mistake. Python even with a JIT like Psyco doesn't match the performance of the Java VM.
Pythons math specific libraries kick ass, and it would not be pure python, just python where it makes sense... Also we have a large number of python lovers who are already contributing to Blender. If you get a a bunch of java people that want to do such a rewrite - awesome :) Although really I'd just as soon we get more contributors for existing functionality instead of a rewrite. I'm pretty sure that the current core coding team would be impossible to convince to do the work themselves to rewrite Blender in another language (Java, C++, etc.) aside from a low probability for going to python for some things.
Java compiles bytecode to native code on demand and can make programs that match the speed of any complex apliction done in C.
Really it is a pretty moot argument, there is plenty of work to be done already and not enough developers to do it. The support among existing developers for languages other than C is almost non existent. If you want such a rewrite to take place your best bet is first doing java bindings as is currently done with python. That will help you to attract java coders to using Blender and thus give you a coder base from which to eventually do a complete port.

LetterRip

Posted: Mon Dec 11, 2006 8:54 pm
by elander
I allways wanted to rewrite Blender or at least its interface and a minimal part of its funcionality in Java using JOGL and Eclipse as the development platform. Maybe with a basic program this would get people from the Java community to contribute. I wanted to do this as a well documented project following standard or close to standard norms of documentation but the problem is that i don't have a repository for the project and a site to place the project documentation.

Anyway i will ask the javagaming forums if they allow me to create a project in their gamedev site. If not i will need someone else help at least to get cvs or svn and a quota to create a project page. This would be an help to get this thing going.

Posted: Wed Dec 13, 2006 11:17 am
by joeri
I'm very sceptic about rewrites.
Not only about user speed (programmers don't seem to believe I as a blenderhead could notice the slowdown from IrisGL to OpenGL) but also about maintanance: All new functionality needs to be ported on the same release.
In a user base where lots of people work with a CVS version (for all OS) I cannot imagine a big interest in an "old" incomplete version that happens to be compiled differently. As a programmer I can imagine you are interested in the challenge, but if nobody is going to use and benefit from your work, then whats the use?

Posted: Wed Dec 13, 2006 2:09 pm
by elander
Why not using a version that is a subset of all Blender funcionality? For doing games for example we only need a small part of Blender funcionality. If it uses the same interface and the same funcionality it means that people used to work with Blender will be imideatly at one with this Java Blender. The advantage is that it's a lot easier to develop with Java and Eclipse and if we use a Java game engine integration with the engine is also very easy.

Posted: Thu Dec 14, 2006 9:52 am
by joeri
Sounds like a good plan. Or at least doable.
Projects need people (leader) who devote themself (for many years) to it from bleeding to death.
The foundation is willing to create project space for you if you want to start a project on the foundation site.

I would think that it would be best if a subset would create a .blend file that is still readable by other blender versions and vice versa. Perhaps not an easy task with the blender sdna file structure.

In modern gui design "modes" are not very wanted. Since 1997 it's all about "context". I think that splitting of one "context" into a separate application might work. But converting (re-writting) new features ( say blender 2.50 has real n-gons ) to your java app. sounds like work to me and not hobby. Who is going to do all that work?

Posted: Thu Dec 14, 2006 10:19 pm
by elander
Me. :D I want to get some code done first before asking for web space or contributers. It's usualy a lot easier and more convincing to get recruits when there is something to show even if it's just a small demo reading a Blender file and displaying a 3d view.

Posted: Wed Dec 27, 2006 12:01 pm
by jumpy-monkey
May be you could use jython - python embeded in java!