Seems I missed a lot in the last couple of month of my absence here That is what I always was looking for, so I can even gradlefy it I guess. Super cool. Thanks a lot for your efforts. Definitely a step in the right direction.
Thanks. It should be pretty trivial to gradle-ify, I guess.
Edit: I tried to write it with that in mind, as I recall. Making sure command line options mapped to actual setters/getters on the class to make it easier to configure “in code” for something like gradle, ie: you could just instantiate JmeConvert and set properties.
…if I missed something then let me know.
Ive noticed a strange issue. In virtually all animated(?) models the eyes don’t appear, or maybe they’ve moved inside the head. The woman above and this model show the issue.
Do eyes have some sort of special case or something? Why just the eyes?
well, as i observed, JME generally have problem with skeleton animated objects that are not in (0,0,0) origin(for example eyes). That was annoying me so i needed use some tricks.
Yeah I know about that problem, but in this particular case only the eyes are affected and everything else works.
I’m not sure what’s going on with this. I wonder if it’s worth its own thread (since it’s a gltf issue) and maybe others will see it? (I don’t know if every gltf user is also reading this JmeConvert thread.)
The model I used in my example above seems to have eyes but they look strange for some reason. I thought maybe it was a material issue but perhaps it’s the same issue just manifested in a more visual way.
Any plan for releasing this into Bintray?
Yeah, I could do it. Since it was built as a stand-alone tool, I haven’t really thought of it but there is no reason that it couldn’t be used like a library, too. (It’s written that way, anyway.)
Just pushed a new release with some fixes for GLTF extras and the weird way that JME does serialization. Prebuilt binaries here:
I’ve also uploaded a release to bintray for anyone wanting to embed this converter directly into their application:
Kool beans. I plan on using this for my javaFX learning phase by building an GUI for it.
Thanks for bintray release.
@pspeed I was trying to add a pre-build or manual step to my project to convert all models under a folder.
But am having difficulty (on windows) pipeline the list of the files into JmeConvert. What i attempted looks something like this:
dir 'src\\assets\\' -Recurse -Include '*.blend' -Name | jmec.bat <-args>
But looking into pipeline java stuff its hard i suppose.
I can create a pull request to accept a recurse try everything like argument to JmeConvert, or i can’t help but think there is an easier way?
[my idea is to create a vscode task which runs on all the blend files in assets
]
Do note that this is super-trivial to do in gradle…
I’m not going to add recursion to jmec because it makes the command line very difficult since you can specify additional scripts, etc. and command line ordering becomes very important. So build tool integration has to be separate. The only way it would work is if jmec operated on some kind of manifest files.
…because in the end, you will undoubtedly want per-file scripts of some kind to normalize data, export materials, or whatever.
Ah, my gradle knowledge is low.
I didn’t know this was easy in gradle, I’ll look into doing this.
Thanks
Note: it would be even easier if the jmec jar was available in jcenter like it’s supposed to be. I still need to figure out why it shows up in bintray but not jcenter.
…because then you could make a buildScript dependency and just use jmec directly without having to call the script, etc… Just new JmeConvert(), set options.
Oh in that case if its simple, can there be a very simple example when its in jcenter? Please
Because i feel like a lot of people might want to be able to do this on build or on call.
It means you wouldn’t convert the files manually in blender and can keep the .blend files around in git (and just modify and re-run the JmeConvert).
I like the tool, thanks.
Note: JME’s .blend support basically ends after Blender 2.79 so you really should be exporting GLTF eventually.
Ah i forgot about that… well its nice anyway.
A bit off topic: I gather no one knows a way of converting from 2.8 .blend
to GLTF from the command line?
Blender supports this, I think. Seems to be a bunch of google hits for “using blender to convert files from the command line”
Ok cool figured it out for anyone.
Windows bat: (im sure unix people can figure it out based on this)
@echo off
set PATH="C:\Program Files\Blender Foundation\Blender 2.82"
set FILENAME=xxxxx.blend
blender %FILENAME% --background --python blend2gltf.py
pause
and blend2gltf.py:
import bpy
import sys
filePath = bpy.data.filepath+'.gltf'
bpy.ops.export_scene.gltf(filepath=filePath)
I didn’t see the --python
tag before and got stuck, so hopefully this helps someone.
Edit: proper post here Blender to gltf converter as a gradle task (or powershell)