Importing textured obj/mtl models created in Asset Forge


#1

Hello!

Has anyone had success importing textured models created in Asset Forge? http://assetforge.io/

I am trying to use the Import Model wizard in the SDK and the model looks correct in the preview, however something goes wrong once I finish importing and look at the model in the Scene Composer or in game.

Preview:
preview

Scene composer:
scenecomposer

Does anyone have any insight into this?


#2

not sure, but it looks more like texture-repeat required. you can set it in material, let me know if this help.


#3

Thank you! That did fix the issue.

However, if it works correctly in the preview, can this be fixed for the imported material as well? Doing this manually could get tedious. Is OBJLoader.java the correct place to go about doing this?


#4

you can always make just in code(on load, or some run file to fix it for models(load, change and save)):

  1. loop through models
  2. set material repeat mode

so no more manual set :slight_smile:

you could create issue on github site:

(removed wrong link like @Darkchaos said )

so you can also look yourself and help fix this creating solution and putting to ticket/issue topic on github.

Anyway its up to @Darkchaos, because im not sure if it is issue for sure, but looks like.
maybe assetforge just dont save repeat param at all.

Please note many people also use different IDE with JME gradle builds and they dont even have tools like this there, and they work :slight_smile:


#5

So the linked code is not correct, asset packs were an attempt to bundle multiple assets and deploy them to web servers and make them available (much like the .unitypackage), what would be needed is the materialloader module.

I am uncertain if this is an issue with the SDK not transfering the Material correct or something related to asset importing or something, but it seems odd anyway because I can’t imagine how this bug could be coded, it could however be that this is due to Material#clone() dropping these changes as part of an Engine Bug.

You can work around this by exporting the material (that means doubleclicking the Material Property where it says (Generated Material), because then a real j3m file will be create which you can edit, there you can easily set the Texture Wrap Mode as well. This is bad though because if you would reimport the Model, all changes would be lost.

If you want to get your hands dirty with code, you can try to setup an SDK Build Environment and debug the code using breakpoints to see where the differences are. I would recommend this anyway, because no matter where the bug is, it’ll take a while until the new version is out which fixes this. I’d really suspect Material#clone() but other than that one can inspect the materials texture wrapping mode in that preview window and then step through the code.

My guess still is the code is doing: saveNodeToFile(“model.j3o”); and then loadModel(“model.j3o”); (Pseudocode obviously)