Utility for Converting Blend and OgreXML files to j3o format

So I got Ubuntu up and running on my tablet, but found that the jME SDK doesn’t work on it well enough to be usable. NetBeans and Eclipse work fine though so I wrote a quick command line utility to convert .blend and OgreXML files to .j3o format. File paths are specified as absolute or relative to the current working directory. If you don’t specify an output file it just saves it in the same directory as the input file with the same filename. Run java -jar 2j3o.jar --help for usage.

Converts a model in .blend or OgreXML format to jMonkeyEngine .j3o format.
Usage:
 java -jar 2j3o.jar [options] [-m material] <input> [-o output]

Options:
 -t    Generate tangents
 -k    Use Mikktspace tangents, assumes -t
 -w    Overwrite existing files
 -m    Load j3m material file
 -o    Output file
 -v    Verbose

2j3o.jar:

2j3o source:

Edit:
If you’re loading a material file with textures it is recommended that at least one of your files, input model, output j3o or material file, be stored in your game’s assets directory so 2j3o can find the referenced textures. 2j3o will search the paths of the files for an assets directory and assume that to be the assets directory for your game.

So for example:
java -jar 2j3o.jar -m assets/Materials/mymat.j3m ../../Blender/Models/MyGame/mymodel.blend -o assets/Models/mymodel.j3o

In the above 2j3o.jar would be executed from the project folder and would correctly locate the assets directory. The model to convert is stored in subfolders of the Blender directory which is two directories up from the project directory.

If there are no referenced textures it doesn’t matter if 2j3o finds the assets directory or not.

P.S. I have not tested this on Windows.

P.P.S. In my opinion the Blender Loader logs a lot of Level.SEVERE events that should probably be Level.WARNING instead.

6 Likes

Can you check how SS editor works on your tablet? :slight_smile:

1 Like

I don’t know what ss editor is.

1 Like
1 Like

No it does not work. It runs, but not in a usable way. It has the same problem the SDK had, it causes my system to hang to the point where I can’t even move the mouse cursor. I’m looking at pause–3 seconds of responsiveness–pause–3seconds–pause–etc…

It looks like the problem is that it’s taking up too much memory. This tablet has 2GB of memory, after booting up Ubuntu with Xfce 16% is being used. Running NetBeans that jumps to 35%, with Eclipse it’s 45%. When I ran SpaceShift editor that jumped to 90% + 56% of my swap space which is also 2GB.

This tablet only has 32GB of built-in storage space, it’s not enough to run Windows and Ubuntu so I installed Ubuntu to a USB drive. Said USB drive is plugged into a 4 port hub which is plugged into the only USB port the tablet has. The hub is also running my mouse, keyboard and a second USB drive. My guess is the bandwidth of that USB port is being eaten up by swap access which causes me to lose control of the mouse and keyboard.

1 Like

Did you try to use the debian version of the editor? I think you can try to use the .jar version with option -Xmx300m, could you recheck it please? :slight_smile:

1 Like

I’m using the .jar version from the 7z package. Running with the Xmx-300m option did not make a difference.

java -Xmx300m -jar jme3-spaceshift-editor.jar

Memory consumption was continually climbing, as you can see, the graph only leveled out when it started taking up swap space which isn’t represented in the graph.

Edit:
I also tried with -XX:MaxDirectMemorySize=100m with no change in memory consumption.

it’s true, because we use jemalloc :slight_smile:

Is this memory cost on start? Or did you look at after when you did some actions?

It starts out around 400MiB and continually climbs from there. I have taken no actions from within the application.

It’s very interesting, I will look at this.

You are aware that a java app never really releases the memory it uses to the system? You won’t see any changes in a system monitor (i.e. “Task Manager” in windows) when garbage collections happen. Still that memory is available to java applications then.

Yeah, but it shouldn’t keep consuming more and more especially when Xmx300m is specified and it’s taking up 1.4GiB. This suggests there could be a direct memory leak. However; I suspect the memory leak could be coming from somewhere else, the video driver perhaps, although I just updated and there’s still a memory leak. Plus, and I’ll double check, it doesn’t seem to be a problem with Blender.

It would appear this leak occurs in all jME applications. I have tried running under Java8 and Java7.

I’m running the latest LTS version of Ubuntu; however, I’ve installed the 4.12.2 kernel from kernel.Ubuntu.com. This version of Ubuntu should be on a 4.10 kernel, but support for my tablet’s WiFi and SDcard reader was added in to the 4.12 kernel so I upgraded.

I upgraded to kernel 4.12.4 and it’s still a problem. It’s not a problem in Blender, it’s not a problem in prboom-plus and it’s not a problem in other Java applications.

I wouldn’t stress too much about it though, there’s still a good chance it’s a problem with my setup rather than jME. I don’t know how well these Intel Atom processors are supported. Still don’t have Bluetooth working or the ability to adjust the screen’s backlight.

I’m most likely going to use it to develop Android games, maybe. The sound doesn’t work on this tablet anyway, my girlfriend dropped it and ripped the headphone port off the motherboard so if I wanted to add sound to a game I’d need to run it on my android.