Making Blender in Java

General discussion about the development of the open source Blender

Moderators: jesterKing, stiv

elander
Posts: 0
Joined: Sun Dec 19, 2004 4:30 pm

Making Blender in Java

Post by elander » Thu Dec 07, 2006 5:44 pm

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.

z3r0_d
Posts: 289
Joined: Wed Oct 16, 2002 2:38 am
Contact:

Post by z3r0_d » Fri Dec 08, 2006 3:15 am

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

jesterKing
Site Admin
Posts: 207
Joined: Fri Oct 18, 2002 12:48 pm
Location: Finland

Post by jesterKing » Fri Dec 08, 2006 8:00 am

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

LetterRip
Posts: 0
Joined: Thu Mar 25, 2004 7:03 am

Post by LetterRip » Fri Dec 08, 2006 8:57 am

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

jesterKing
Site Admin
Posts: 207
Joined: Fri Oct 18, 2002 12:48 pm
Location: Finland

Post by jesterKing » Fri Dec 08, 2006 9:56 am

LetterRip wrote:Who would be insane enough to implement Blender in Lua? <grin>
I? :wink:

/Nathan

elander
Posts: 0
Joined: Sun Dec 19, 2004 4:30 pm

Post by elander » Sun Dec 10, 2006 5:48 pm

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.

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv » Sun Dec 10, 2006 7:42 pm

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.

elander
Posts: 0
Joined: Sun Dec 19, 2004 4:30 pm

Post by elander » Sun Dec 10, 2006 9:17 pm

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?

LetterRip
Posts: 0
Joined: Thu Mar 25, 2004 7:03 am

Post by LetterRip » Sun Dec 10, 2006 11:57 pm

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

elander
Posts: 0
Joined: Sun Dec 19, 2004 4:30 pm

Post by elander » Mon Dec 11, 2006 8:54 pm

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.

joeri
Posts: 96
Joined: Fri Jan 10, 2003 6:41 pm
Contact:

Post by joeri » Wed Dec 13, 2006 11:17 am

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?

elander
Posts: 0
Joined: Sun Dec 19, 2004 4:30 pm

Post by elander » Wed Dec 13, 2006 2:09 pm

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.

joeri
Posts: 96
Joined: Fri Jan 10, 2003 6:41 pm
Contact:

Post by joeri » Thu Dec 14, 2006 9:52 am

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?

elander
Posts: 0
Joined: Sun Dec 19, 2004 4:30 pm

Post by elander » Thu Dec 14, 2006 10:19 pm

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.

jumpy-monkey
Posts: 0
Joined: Fri Dec 02, 2005 7:16 am

Post by jumpy-monkey » Wed Dec 27, 2006 12:01 pm

May be you could use jython - python embeded in java!
Look beyond yourself!

Post Reply