Building a Sync Tool for Blender to Defold

Ahh. rats. I’ll need to get and sort out my Mac to test. Its likely there are pathing/folder issues. I’ll try to get and test over the coming days. Sorry about that - it will be my fault there somewhere :slight_smile:

3 Likes

Thank you!

Amazing progress! Really gets my graphics fingers itching to do something cool with it :slight_smile:

1 Like

Some more samples. I have been trying a large number from sketchfab (free) and it is reasonably okay with converions to Defold. Heres a more “platformer” oriented one:

Source:

13 Likes

Nice asset pack! I’ll make sure to test these out as well for the new model importer pipeline!

8 Likes

Another release today. Includes some new capabilities mainly in the PBR Simple material.

  • Ability to merge textures into single texture
  • New AO + Metallic + Roughness texture (combines three into one).
  • Fixes to the shader params.

The above work will be used to get alpha channels from blender to be merged into the Albedo + Alpha texture that is currently supported.

Additionally, AO (not truly AO) will allow people to add maps to their models for shadow maps. With a slight change, adding a secondary UV stream, and the AO map - shadowmaps should be achievable without any render_script changes.
I’ll add a test for this in a week or so.

Next on the list:

  • Render scripts
  • Lighting improvements (multiple lights)
  • Shadows and scene lighting features (maybe some GI).
14 Likes

Another new release tonight.

  • Albedo + Alpha now properly maps in the Blender Alpha channel or the alpha in the Base Color map.

Various other little bug fixes. V1.0.5

8 Likes

Ok. Finally a new update going in. And Im very pleased with it, because it addresses some of the problems with animation exporting:

  • Multiple animations within a single collection or scene.
  • Animated and non animated meshes within an object hierarchy
  • Inconsistent animation syncs.
  • No longer need to select the animation armature (this is automated).
    I hope to have multiple animation actions working as well with this new release.
    Heres a vid:

    Its a little choppy, Im doing a big build (compiling) at the same time :slight_smile:
    There is a little issue I need to figure out, and the anim when looping seems to animate back to the default pose position. Will look into it, hopefully its a simple fix.
    Here’s a pic of the hirerachy so you can understand the complexity that is now successfully being syncd:

Normally this would be quite a complex monster to export to Defold. Now, its one button press :slight_smile:
The new release should be up sometime tonight.

20 Likes

Hi, more updates.
Thanks to @anon95708182 I have managed to diagnose some OSX sync tool issues and rectify them.
Im planning on a full release on Wednesday (with a simpler solution for the libpng - include the lib).
If you are having problems at all, please let me know here or raise an issue on the github page. All suggestions and complaints are welcome :slight_smile:

Cheers,
Dave

11 Likes

Tried it the first time, followed the instructions about luajit flags and installing libpng. But something is not enough to save the picture, maybe access rights to the folder?

macOS 11.5.2 on M1.

Archive with blender project:
trenchgame.zip (582.6 KB)

5 Likes

Hi @astrochili - thanks for giving it a try. Thats an interesting bug.
It looks like its something to do with permissions on a temp folder the script uses. I’ll check that.
To see if it is, you could check:
1 - does that textures folder exist?
2 - does the textures folder have write permissions for your user?
If you could let me know. I’m doing a bunch of mac testing tomorrow so I hope to resolve it quickly.

Im wondering if newer OSX might be a problem (with handling permissions). Im using an old Mac Mini with old OSX 10.3 ?? (I think). I’ll have a look more tomorrow.

3 Likes

Hello @astrochili,

I just tried your project and get the same error. I then removed the images and get a bit further but then end up with an error I’ve shared with @dlannan already:


Would you get this error as well if you removed the images?
@dlannan - might this be a Monterey thing, I am on m1 as well, Monterey 12.3.1

1 Like

Hi @anon95708182, thanks again for your feedback. I think this is more about permissions which I will focus on tomorrow and see if I can replicate it.

It may be related to the M1. Currently the luajit plugin setup Im using is using an x64 build for OSX. However I have seen issues with x64 running native on M1’s. I might see if I can build a universal binary, as that should resolve the problem (if thats whats causing it).

One thing you could try is to go to the folder:
/Users/{username}/Library/Application Support/Blender/3.1/scripts/addons/sync_tool/defoldsync/luajit/darwin/
Open a terminal window in this, and just run luajit. If it throws an error, then its very likely an M1 build issue. If it runs ok (you should see it start with a command prompt) then the M1 should be fine.
Note: once started just press Ctrl+C twice to get out of the command prompt.

I might also see if I can get it to capture some of the output so people can send me the logs to determine issues more easily.

Thanks again @anon95708182 and @astrochili for even giving it a try. To be honest, the majority of people using it have been on Win10. And myself on Win10 and Linux. Being able to get some OSX feedback is very valuable. I’ll probably start using some online testing systems for this so I can cater for various configurations.

3 Likes

@dlannan,
Here you go:

Fabulous. It means its my problem :slight_smile:
Could you try running the command it failed on from the window you showed?
It would be like this:

/Users/{username}/Library/Application Support/Blender/3.1/scripts/addons/sync_tool/defoldsync/luajit/darwin/luajit /Users/{username}/Library/Application Support/Blender/3.1/scripts/addons/sync_tool/defoldsync/main.lua /Users/{username}/Library/Application Support/Blender/3.1/scripts/addons/sync_tool

This is a bit hard to read but the usage is essentially:
{sync_tool path}/defoldsync/luajit/darwin/luajit {sync_tool path}/defoldsync/main.lua {sync_tool path}

You can replace {sync_tool path} with what yours is above.
This should produce more details about why it is failing. Thanks :slight_smile:

1 Like

Btw. I will be testing on a M1 tomorrow - so I hope to resolve this. Im so sorry for the issues you are having. Wasted time and effort is something I generally dislike creating for people.

2 Likes

Hi again,

this is the output:

To make sure, I checked again if libpng is installed:
Screenshot 2022-04-12 at 09.55.55

1 Like

For debugging purposes I think it’s good to know the architecture of that shared library.
Start by locating it:

$ locate libpng.dylib

Then, check what architecture it is, e.g.:

$ file /usr/local/lib/libpng.dylib

I suspect there might be a mismatch between the architecture between Python/luajit and the shared library.

3 Likes

Hello @Mathias_Westerdahl,

this is what I get:

Screenshot 2022-04-12 at 10.07.54

Note: Please post text next time, as screenshots are very hard to read (and also hard to search for text on the forum)

Ok, you can probably find the shared library some other way?

1 Like