Advertisement

You're blocking ads, which pay for BlenderNation. Read about other ways to support us.

Blender Java Source Code Released

55

BlenderLogo5

Jason LaDere reports on the progress of his Blender Java port.

Jason LaDere writes:

Blender Java is back and the source code is now available. A Google code project has been created and we are looking for interested developers.

This is a Java/JOGL/Jython wip port of Blender version 2.57 and soon to be updated to 2.63.

Let us know what you think.

Thanks.

-Jason

I asked Jason some further questions about his project:

Why are you coding this in Java? What are the advantages of Java?

I am coding this in Java because I am very familiar with Java (since it was first released) and I really like to push the boundaries of Java and see what it can do.

Some advantages of Java:

  • It's the most popular and accessible managed language (one of the reasons it was chosen for Android apps.)
  • Cross platform with no changes needed in the code itself (just different VMs and native libraries.)
  • It has a very large developer base and is simpler to understand for most people with no pointers and auto garbage collection etc. (one reason universities have switched to it for teaching.)

How does Blender Java performance compare to the original Blender?

Java by itself is comparable in speed to c/c++ nowadays for most projects. Java combined with JOGL (openGL) is also very fast. One of my other open source projects is Jario64: a Nintendo64 emulator written in Java/JOGL, and it is comparable in speed to n64 emulators written in c. Jython however, I believe is still slower than python. Blender Java is still at the initial porting stages and has had no optimizations done yet. Java has great performance profilers available and I am sure that Blender Java will be comparable in speed to Blender at least for medium sized projects (It is yet to be seen how it will do with very large production files and if Jython is going to be a problem.)

Is the Java port manual work, or do you use automated tools?

The 400-600 core Blender DNA objects are auto generated from a Blender file and the RNA objects are auto generated just like they are in the original Blender. I also have some Java libraries that help when porting certain things like c style string manipulation but everything else is just manually ported.

Did you port all existing functionality?

No. This is still in the initial stages and so far only the framework (UI, event system, DNA, RNA, Jython, etc,) mesh/object editing, and simple rendering have been ported and are still being worked on. After the base functionality of creating 3d models and rendering them is mostly stable then the rest will be added in like rigging, animating, painting/sculpting, compositing/nodes, etc. The last things to be added would probably be stuff like video editing, game engine, and audio.

What are your future plans? How will you keep up with changes in Blender?

I don't really have any specific future plans. If all goes well then maybe I could use it in my own studio's pipeline with our own in-house modifications. Or maybe it will end up as just an educational tool. I think it would probably be too hard to keep up with all the changes in Blender and I am not sure that is the best destiny for this project anyway. Maybe, after the core functionality is there, the user community will take it in it's own direction with it's own unique functionality.

I have a passion for 3d modeling, animating, and rendering. I also have a passion for Java and other similar managed languages like C#, so this project is a natural choice for me. I like to push the boundaries and learn in the process. I like to try to create things that people didn't think could be created and make them work. I hope others who have similar passions will enjoy this project as much as I do. The fun is in creating the impossible and the possibilities are yet to be discovered.

Thanks Jason!

55 Comments

  1. Hm, interesting but just educational I guess. Even if the port will be completed once, it would be a nightmare to keep up with the changes of Blenders future versions. After some initial porting, I hope he contributes to the original codebase. :)
    Another option would be to create a Java fork which will be independently developed...

  2. Just wondering why wasting time in this since there are mutli-platforms versions. Maybe just for the fun of it I guess. Or an android port will be then possible?

  3. Would it be possible to start this just from the web? So without any downloads? For example, you're clicking on the Blender website and then Start Blender, and you got Blender on your screen?

    • It would be possible, although it would require a little extra effort. Java "applets" are different than desktop applications written in java, but it probably wouldn't be too difficult to write an applet that runs on top of the rest of the code. Perhaps somebody could look at Geogebra, which has exactly this feature (an online java applet and a downloadable application) to see how they did it.

  4. Why not learn python and contribute to the core Blender. As an experienced programmer, it shouldnt be too hard. Your passion, skills and enthusiasm are much needed!

    Am not sure if it will be sustainable, but best of luck!

  5. Ambitious effort! Congratulations on making it this far already. I'm going to take a look at the sourcecode, while trying to (anonymously) check out the sourcode I found a small error in the instructions for the commandline to check out sources on your google projects page:

    Original, doesn't work:
    # Non-members may check out a read-only working copy anonymously over HTTP.
    svn checkout http://blender-java.googlecode.com/svn/trunk/ blender-java-read-only

    Does work (for me):
    svn checkout http://blender-java.googlecode.com/svn/blender_java/trunk/ blender-java-read-only
    svn checkout http://blender-java.googlecode.com/svn/blender_java_dna/trunk/ blender-java-dna-read-only

  6. Haters will always do their thing :( - keep up the great work, porting to Java is what you enjoy, and there will be Blender users who will try it out and like it. The Java profiling tools might even discover some parts of Blender that can be optimised!

  7. Ambitious project! Congrats on making it this far already. While trying to check out the code, I found I had to split the checkout in 2 steps, as the original URL didn't work (at least for me, trying to check out anonymously)

    Original, didn't work for me:
    svn checkout http://blender-java.googlecode.com/svn/trunk/ blender-java-read-only

    This does work:
    svn checkout https://blender-java.googlecode.com/svn/blender_java/trunk/ blender-java-read-only

    svn checkout https://blender-java.googlecode.com/svn/blender_java_dna/trunk/ blender-java-dna-read-only

    (posting this again, seems like my earlier comment got deleted somehow)

  8. Should have gone with D or Mono C#. Some of the mathematical hot-loops of Blender (which, because of the type of application it is, will be in major parts) will run _much_ slower in Java because of the lack of stack allocated (struct) objects.

    Plus, Java support on Linux is crap because we can't distribute it anymore (so I hear).

    • Dude; why are you running a 2008 JVM? You must be sorely missing out on the optimisations that have been introduced since then, especially escape analysis. It gives you stack allocation for most objects that don't escape the enclosing scope, without you having to decide on the allocation in your code. Works a treat.

      • It's my understanding that Escape Analysis is only available in the Java 7 Server Compiler (
        http://docs.oracle.com/javase/7/docs/technotes/guides/vm/performance-enhancements-7.html). I've only dabbled in Java a few times, but I believe I remember a different distribution for Java Sever and Client. So Escape Analysis wouldn't be available to the majority of folks who downloaded the Java Client runtime. If this has changed recently, I would love to know.

        This is why I mentioned D first. If the goal of this port is largely due to modern convenience features that C lacks, such as Garbage Collection, then D seems to offer the best of both worlds. It's natively compiled with full access to inlined ASM and SSE operations, but it's also a convenient language with a GC, foreach loops, good dev tools (somewhat), etc.

        I'm not a huge fan of Mono C#, but in my tests it's always outperformed Java in mathematical performance by a large margin. The Xmarian port of Android to C# (XobotOS) illustrates this as well: http://blog.xamarin.com/2012/05/01/android-in-c-sharp/ granted I have no doubt those results are skewed to some degree.

        • If you download the VM then you have the option to start a program either with the client or server VM (might be internally the same, but with different options). The typical result is that the client VM starts faster and uses less RAM, but isn't as fast in the long run. That means that nearly everyone (a simple command line option) can run the server VM. No need for an additional Download or so.

          Mathematical operations can be quite fast in Java. Often they are even faster if not explicitly defined as strict(math), which ensures high standard conform precession. If you want to crunch numbers you just have to avoid excessive object allocations. If you don't run in this trap, then Java sometimes even outperforms C/C++ programs, due to the fact that the code can adapt to the data. Overall it might be a bit slower, but it isn't as slow as in the folk tales.

          But even if Java is a bit slower it doesn't really matter because most of the hard work is transfered to the GPU. Currently it is only the cycles renderer and the gui and scene drawing, but even modifiers can/could be implemented inside the GPU. Or even more: http://chirrup.org/rootbeer/

          With further development i would expect the speed of the language of Blender itself gets much less important.

          • This is interesting, I didn't know that Java came with both the Client and Server runtimes. Thanks for the info. Can you tell me if Java caches the build (and therefor negates most of the startup cost after the first run)? I'll need to do some more benchmarks with Java Server it seems.

  9. Renaud Warnotte on

    I was dreaming of a Java API for blender instead of python, that could be cooooool ! Not sure it will give something to the end, but I salute the effort.

      • One important difference is that Java is statically-typed. This makes it easy for IDEs to provide additional information about the code (what methods are there?; what objects implement this interface?; etc.). This tends not to be that useful for small projects, but becomes valuable on a larger scale. The JVM running raw Java bytecode also tends to be much faster than C-Python running raw Python (not considering C-language libraries like numpy, etc., which can easily be used to speed up Python).

    • Not sure I share your enthusiasm for programming addons in Java.

      "No list comprehensions" + "no first class functions" = "no thanks!"

  10. blender's uninterrupted progress has been enabled by a lack of fragmentation ... I don't see this as useful in any way other than to sate the curiosity of a lone developer. I hate python but that's what blender uses, I can program in java so this should appeal to me but I would prefer that this guy had created a java scripting interface rather than re-inventing the wheel

  11. why_so_negative? on

    Why are people "upset" over this? Sure it may be a waste of time but its a waste of HIS time. He seems passionate about the process and not the end result. Maybe some community members will pick this up and run with it into something completely new and different from blender in the end. Maybe it he will get to a point where he wants to stop and the project festers and dies. Doesn't matter.

    It's like you guys making your favorite game character in blender. It doesn't add anything to the character or the game so then it's a waste of time right?

    • People are not 'upset', they are just voicing their opinion on a great piece of work, which is, in their opinion, pointless and a waste of good coding effort which could have been better spent improving Blender.

      • I would gladly contribute to blender. But with it's extremely macro driven source code, various programming concepts and sometimes little to no documentation (the source) it is very hard for a new developer to under the code and if they do then they will have a hard time writing good code following the same conceptions. Thats makes it a lot easier for me to contribute to Java programs (no macros, easy to read source code) or well documented C programs as compared to Blender.

        • But apparently, you understood the code well enough to redo all the stuff in java.
          I know it's not the best part, but why not to do the work you did but spent on the documentation of the code?
          architecture, patterns, some nice diagrams, etc...

          There is nothing wrong to do what you did, we agree, but in term of interest...

        • I agree, and I believe the Blender Foundation should start a 'mentor' program just like LibreOffice is doing, where they assign a mentor to each new programmer. Also, novice developers are given small tasks to do so they can get familiar with the code and the structure. Some 'birds eye view' documentation on how the application hangs together would also help getting new developers up to speed.

  12. If it becomes android friendly, doesn't it potentially open up tablet usage, which might lead to a number of varied applications ? Fascinating avenue.

    • With Windows 8 launching in a month and a half, Blender will be naively 'tablet friendly' once multitouch interactions are ironed out. It may need some porting to run on Windows RT since those will run on an ARM processor, but beyond that, no changes that I can think of.

  13. Wow, impressive work! But I wonder if your time wouldn't be better spent improving the C++ / Python version of Blender.

  14. I understand the desire to see blender python complete and perfect, but we can't stop the creative mind of a person; what we need is more people working in the project; we need more Jasons, with the same passion, and commitment to what they love to do. We are lucky to have such a person among us. Some times the answer to a problem is elsewhere, were we less expected.

  15. Ernst Jedermann on

    I think this is a great idea and I wish you good luck!
    The productivity of java with the current toolstack is great and maybe you reach a state where you can test concepts in addition to the mainstream c implementation.

    cheers,
    Ernst

  16. stevenshearing on

    Great but is it really needed ?, we already are Cross platform between Windows,Mac,FreeBSD and Linux.
    Why not work on improving blenders tools or add new features instead of wasting time on something un needed with your skills ?.

  17. This is just a question not a critique, why people should use the java version?
    I read the entire article (but I must say that I'm not a programmer so I didn't understand every point) and he says that his port is quite the same of the original software. So there are some advantages for a blender's end-user?
    What about new blender versions? They will not be released at the same time of the original product, right?

  18. I think that a straight port is not so clever, but actually an opportunity to view Blender source code in a totally new aspect.

    For example, here are some extremely useful features that can exist with Java:
    - Exceptions mechanism (so Blender will not crash)
    - Plugin based development (No need to compile 5 different versions, you simply have the core functionality and the addon functionality. No simple Python Addons, I mean real functional bytecode that activated/deactivated on demand).

    - Automatic updates (sigh...)
    - A panic button that brings a blue sky with clouds in OpenGL :D
    - e.t.c.

    No more no less, the best part of Open source is that software is "blooming", it always comes something better for the common good.

  19. I´m a long time user of a Java based modeling, animation and rendering software called Art of Illusion.
    It´s not comparable to Blender, but it has a fast raytracer for years and we users had something similar to bmesh also for years already. I do like Blender, but I´m often wondering about this fanboy enthusiasm.
    I can´t tell if Java is better or worse compared to Phyton, or if the time bringing a good software on other platforms or systems is worth it, but exchanging ideas with users of other soft- or hardware is for sure worth it. And I see that as an excellence possibility to exchange ideas.
    (Hey Jason - what about changing to the illuminated side of the moon?) :D
    Harald (aka vidiot)

  20. I think it's a cool idea that could eventually lead to a fork of Blender with java programmers doing their magic. It's very interesting indeed!

  21. I wish people in the open-source community would stop forgetting how free we are to do these kinds of projects, for our own personal reasons. Not every programmer out there have an obligation to develop on the official Blender releases.

    If this guy wants to do this as his own personal programming experience project and just for fun, let him. But do it without placing this demand on the guy for wanting to do this with his own time, over-criticizing this personal project.

    Besides, controlling your own personal project is far different than working with a team of other developers on a rather impersonal project. Maybe he's not ready to develop with a team on an official development team. Or maybe this is just something he really wants to do personally.

    Maybe after this good experience for him, he will join the Blender Foundation developers, but then again, will he as such have to face the ever-demanding non-developer crowd? People are free to express opinions, but people shouldn't be belittling or reprimanding this guy for this personal project, to which is of no obligation to us, anyways.

    • As a programmer myself, I personally know how demanding many non-programmers benefiting from a project can sometimes (actually, often) be, and how much obligation some can start to put on a developer.

      And while I understand that we'd all like to have more developers on Blender to accelerate its development, people shouldn't forget that other Blender projects are free to exist, and should exist without people stamping obligation on these developers. Again, there could be other reasons why the developers decide to do their own personal projects, from everything from comfort levels to just plain personal achievements.

      And it also couldn't hurt to show a little more patience with the official Blender developers as well. I know many here are patient and appreciative, and those people rock, but almost every developers meeting note or on YouTube videos of feature previews, I can be sure to read a few folks posting their own list of demands, sometimes even complaining about the developer's not developing their demands instead of whatever they're working on.

      It's good that the open-source community is more open-ears about software development, but it can be easy to start to see people flat-out demanding features and updates and assistance in development. Sometimes it can feel like enough to make a developer wanna make all projects "personal." LOL

  22. I appreciate the effort, and based on the previous I want to mention here one thing strongly... If a software is gonna be focused on the user features requests other than the functionality and workflow, it is gonna suck. Sticking to the design principle is what kept blender unique from the other packages...

  23. Performance of well written Java programs can be similar to C/C++ but I insist on "well written"... My comment will appear as a troll but I think this kind of projects is more like a self-satisfaction quest or showing skills (and in this case, very good skills). This will eventually end in a interesting project... or not. If it has skills on 3D rendering, he can do more things to participate in the current version of Blender.

    It's similar to those hardcore coders who are currently converting some games to HTML5/Javascript just to show that it can be done but a lot of people (which are not programmers) doesn't show any interest in it...

    • I don't think any of this developer's explanations contradict what you are saying. It's currently unusable and he doesn't even propose any future for it being used by artists. This is really, unless one is personally interested in java coding and its possibilities, merely a curiosity.

  24. Porting blender to java could allow it to run on more platforms. Or, here is an idea, Blender to minecraft; the awesomeness is incalculable.

  25. I'm not a coder, but I firmly believe that if Blender came in more flavors (java, C#, etc), that it could open up more possibilities and even greater discoveries (that are specific to one language or another) that could be beneficial to us all. Whether it be for science, games, or movies...we should all be open minded towards.

    Key word here is: Open

  26. This is an important step to get Blender out into the Mobile market, with so many of us using smart phones and Tablets now it is an area that should not be ignored. Using java and something like Codename One (http://www.codenameone.com/) Blender could realistically be brought to both android and IOS :). Not that I feel that designing 3D on a smartphone is a smart idea, but on a tablet would be cool.

  27. I don't think it's a waste of time. The person itself had a challenge and with his passion about java and maybe future use for own purpose, he could develop his own features. Which in future may be ported back to c/c++ If something like that happens, no matter if it's him or someone else, it's a good addition to the community. Maybe for another developer this is easier to understand and step into the real sourcecode of Blender. Who knows? =)

    Everything has a purpose, someone coding a webserver doesn't mean he wasting time because there are enough of them available. Maybe he'll make a better one in the future, but has to know the very basic understanding how a webserver works in general. It's a challenge, and action creates reaction which could trigger another action. ;)

  28. It's really interesting. If it could just help release a blender player for Android, since it's java, it would worth so much!

  29. Java or .NET is not and will not be faster than C/C++. It's fast enough for most tasks where you don't need to think about optimization at all. Like forms and SQL processing, but that's where it ends.
    For benchmarks, or small apps written by incompetent developers yes, the end result will be that Java/.NET is probably going to be close and maybe even faster.
    In reality, simple things like allocating memory on stack, or simply using memzones will simply kill the Java/.NET on the spot.

Leave A Reply

To add a profile picture to your message, register your email address with Gravatar.com. To protect your email address, create an account on BlenderNation and log in when posting a message.

Advertisement

×