[SOLVED] BinaryExporter and materials

Sorry for delay, got hit by a storm, lost electric and had to repair the roof missing shingles.

I read the gradle docs again and it looks to me like this is correct.

settings.gradle

include 'assets'

build.gradle,

project(":assets") {
    apply plugin: "java"
    
    buildDir = rootProject.file("build/assets")

    sourceSets {
        main {
            resources {
                srcDirs '.'
                exclude ('**/*.j3odata','**/*.mesh','**/*.skeleton','**/*.mesh.xml','**/*.skeleton.xml','**/*.scene','**/*.material','**/*.obj','**/*.mtl','**/*.3ds','**/*.dae','**/*.blend','**/*.blend*[0-9]','**/*.bin','**/*.gltf')
            }
        }
    }
}
runtime project(':assets')

Im using the template from your repo, installed using bootmonkey. This should mean I can do things like this right?

        ModelConverter converter = new ModelConverter(assetManager);
        converter.convert(new File("Textures/Oto.mesh.xml"), new File("Textures/Oto.j3o"), true);

but this throws exception because its missing the assets folder in the path. I tried adding it via

    implementation project(':asset')
sourceSets {
  main {
    java {
      src 'assets'
    }
  }
}
   startScripts {
       classpath += files('assets')
   }

and many more things.

No. I have both netbeans 8 and sdk, each with gradle builds. Each has only simpleApplication and the one conversion class to try and convert. Using each separate trying to get it to work.

…well, this line is using java.io.File so doesn’t know anything about classpaths… it wants real paths.

I pass that in like before and everything does work but textures still fail. Same problem when using a sdk mygame project, which is definately setup right, and a sdk gradle project. Same behavior though. Always no texture on loading the j3o. If I load anything not j3o, perfect.

As before, I can see the material is there, everything is setup properly in j3m including texture2d paths. Its even locating the j3m as the warning shows.

I will roll back to 3.1 tomorrow and try again. Maybe something will show up.

im not sure if i do it wrong(not tested production fully) but i got:

dependencies {
if(production){
runtime project(‘:GameAssets’)
} else {
runtime files(“…//GameAssets/assets”)
}

and what is nice, it dont needed build assets each stupid change.
dont know why but i dont had classpath problems.

to below image:

mitm: no problem, lets just fix it!

https://accuweather.brightspotcdn.com/3b/8d/ed46995b4dfe8e71cf4fd8adc4f0/gettyimages-458279347-1.jpg

Well looks like there is yet even another problem.

j3mExporter cannot handle ogre materials?

Does anyone but me find it disturbing that in order to use the engine you are tied to the SDK unless you completely reinvent the wheel for assets?

I fail to see how anyone is using this engine without having to create some seriously complicated tools to handle assets like the SDK does.

Shouldn’t this all be handled by the engine library with a tool set?

For me, the SDK is just an asset conversion tool these days… and since Spix got far enough along on Remy’s branch to use it instead, I haven’t even installed the SDK on my newer Windows boxes.

But a lot of times, I don’t even need “Blender assets” or whatever and so it’s not an issue.

I will have to readdress this again when I need animated mobs again.

Edit: but yes it would be nice to have a gradle plugin for asset conversion.

Yeah, thats what I am running into. I had planned on using a sdk agnostic build system but I keep hitting snags every time I figure something out. I setup gradle to sweep assetts from a standard project but it feels so hackish having to do this.

I am also worried about the SDK since I dont know how long it will be viable with whats going on with java.

I really like the sdk tools and if it could handle dependencies and tasks like gradle it would be the best of both worlds.

Building libraries sucks.

@normen was a genius with the sdk and it takes me some considerable effort to figure out what is going on with it when digging around in its guts.

Normen’s reputation speaks for itself, but with the SDK it’s just a matter of getting to know the API. Most people aren’t interested in improving it. It’s a thankless task. I wish I could just code for fun and not have to worry about money :confused:

Times move on, too, hence the spix-bridge-type realization.

Trying different means of using the assets folder from sdk in the gradle project.

Keep having a problem with the gradle build/distributions folder where the zipped asset.jar contains asset files that are not in the gradle project or sdk project. They were deleted but keep showing up.

Even when the gradle project uses nothing but its own empty assets folder, ie no links to any other folders just its own, these same deleted files keep showing up in the asset.jar.

I think there must be some cache thats placing them there. Deleting the nb-gradle folder has no effect.

Any ideas on how to clear these files?

Gradle is straight forward generic start build from bootmonkey.

project(":assets") {
    apply plugin: "java"

    buildDir = rootProject.file("build/assets")

    sourceSets {
        main {
            resources {
                srcDir '.'
                exclude ('**/*.j3odata','**/*.mesh','**/*.skeleton','**/*.mesh.xml','**/*.skeleton.xml','**/*.scene','**/*.material','**/*.obj','**/*.mtl','**/*.3ds','**/*.dae','**/*.blend','**/*.blend*[0-9]','**/*.bin','**/*.gltf')
            }
        }
    }
}
  
dependencies {

    implementation "org.jmonkeyengine:jme3-core:$jmeVersion"
    implementation "org.jmonkeyengine:jme3-desktop:$jmeVersion"
    implementation "org.jmonkeyengine:jme3-lwjgl:$jmeVersion"
    implementation "org.jmonkeyengine:jme3-blender:$jmeVersion"
    implementation "org.jmonkeyengine:jme3-plugins:$jmeVersion"

    runtimeOnly project(':assets')
}

What are the names of those files that keep appearing in the JAR?

Oto.mesh.j3o, Oto.j3m, Oto.jpg.

I was using those for test building distributions, synching assets folders.

1 Like

Have you ever deleted the JAR?

Yes, reloaded the gradle to. Every build they come back.

1 Like

The assets jar under assets/libs shows empty folders like it should.

Ok, I exited sdk/ restarted and now they are gone. I dont want to have to exit the sdk to clear deleted files, any ideas why this would happen?

1 Like

i had same issues removing files. so i just remove via file manager, so sdk just see change properly. no need restart then.

I will give that a shot, thanks.