Building a Sync Tool for Blender to Defold

@d954mas - sorry this has been so long in coming. Especially when there was actually a pretty simple solve for it :slight_smile:

For the problem with scene changes:
This should now always restore your scene to is original state when exporting. I do need to check for a couple of edge cases so another update may come soon.

For the duplicated meshes, I’m working on a better hierarchy export. I really want the Defold hierarchy to properly reflect the Blender hierarchy, but it turns out Blender has alot of intermediate transforms that complicate the matter. Hopefully I can figure out a nice way to convert coord space, and keep node hierarchy clean.

3 Likes

Thanks, you make awesome tool. Must have for 3d in defold

1 Like

Its going to get better. Much better, but my work and life always gets in the way :slight_smile:

4 Likes

New Release V1.4.1

While working on the new node export and render scripts I noticed (couldnt believe it was broken) that the child location (translation) seemed to be getting embedded into the gltf/glb mesh file. Making it very useless when you get it into defold if you need something like a local propellor spinning on a plane!!!

Please let me know if this breaks anything. It shouldnt, it was a bug with the scaling of the root nodes.

9 Likes

Hello,

Have to ask here because getting error when trying to install latest version of the tool. Not sure how to fix it. Any ideas?

Platform: Apple m2 - Sonoma 14.4.1
Blender: 2.93 or 4.1

Blockquote
Traceback (most recent call last):
File “/Applications/Blender.app/Contents/Resources/2.93/scripts/modules/addon_utils.py”, line 351, in enable
mod = import(module_name)
File “/Users/m*******a/Library/Application Support/Blender/2.93/scripts/addons/defender_init_.py”, line 99, in
from defoldsync import defoldUtils
ModuleNotFoundError: No module named ‘defoldsync’

Couple of quick checks:

  • How did you install it? As per instructions on github?
  • Check the folder permissions, it looks like that could be a problem (defoldsync is a folder in the plugin)
  • Also make sure you follow the instructions on Github, the luajit exe needs permissions to run.

Let me know if that works ok. This has been tested ok on OSX (see previous users here with issues :slight_smile: ).

1 Like

Yes. I’m using instruction from the git.

  1. Download latest defender.zip from release
  2. Install add-on by providing path to the zip archive. See log about successful install below

Blockquote Modules Installed () from ‘/Users/m****a/Defold Projects/blender_addons/addons/defender.zip’ into ‘/Users/m*****a/Library/Application Support/Blender/2.93/scripts/addons’

  1. Then click on checkbox of the add-on to enable it and getting the error

BlockquoteTraceback (most recent call last):
File “/Applications/Blender.app/Contents/Resources/2.93/scripts/modules/addon_utils.py”, line 351, in enable
mod = import(module_name)
File “/Users/m*****a/Library/Application Support/Blender/2.93/scripts/addons/defender\init.py”, line 99, in
from defoldsync import defoldUtils
ModuleNotFoundError: No module named ‘defoldsync’

  1. When I go to add-on folder ‘/Users/m****a/Library/Application Support/Blender/2.93/scripts/addons/defender’ I do not see ‘defoldsync’ folder. Files only. Looks like these files can be enclosed into folder but delimiter “\” will not work as a folder in OSX. See screenshot below.

After that I manually re-created folders structure and add-on got enabled without errors. Hope it will work.

Im not sure what you are doing there. Blender should install directly from the zip file. If this is not working, then this is something more to do with your Blender installation.
Manually extracting can work, but again you will need to check for permissions and security folders.
The problem looks possibly like whether there are problems with your zip extraction tools you are using on OSX - that looks like it is generating the wrong path format - this is not a function of my plugin, but Blender instead (I dont write anything to do with the zip extraction for a plugin, thats Blender).

1 Like

That’s work this way for both 2.93 and 4.1 Blender version.
Great that everything good with the plug in. I’m sure I’ll enjoy it once manage to fix Blender

1 Like

A little taste of things to come. This is a sample of the material name mapping:
image
Which maps this object in blender:


To this object in defold where a special shader has been generated for the floor:

Added also, are collider auto generation, texture file remapping, script key/values (accessible in your game), init script commands and update script commands. All which can be applied to specific game objects in the scene.

Some of the features (like material mapping) are only available in mesh buffer exporting - although I will look into how it might be possible to do this with gltf.

This is being used for a little game jam project atm as well as maps for f18 export. I hope to have this tested and in by the end of next week.

6 Likes

Awesome​:heart::fire:

3 Likes

Thanks for doing this extension. Which version of Blender are you aiming at? I have 4.2.1 LTS on Linux and the way extensions are added look a bit different to what you are doing. It has a ‘get extensions’ option, above the ‘Add-ons’ option, in the preferences window, where a remote repository can be added. I do not know how to use Blender yet so not an issue for me in any case.

Hi, yes. If you read at the top (recent update) there are notes about working with new versions. It will work with Blender 4.0. sort of. Over the coming weeks I will be adding detection so it can support Blenders internal changes, mainly between v3.4 → v3.6 and there are some recent changes in 4.1 and above that are making gltf embedded a bit of a pain (this will apply for normal gltf embedded export in Blender too, not just my addon).

When I get the auto version detect in, it will also have the game data export built in (that shouldnt be affected by versions - or I hope not! ). :slight_smile:

Little quick update. Colliders now exporting, as well as components (you can pre associate a component with an object for export)



Rotations for colliders to be added. Overall works pretty well. Almost the whole game level can be config setup in Blender.

Oh. Also, for those interested in trying this out (v3.4 atm) the branch is being updated and is available here:

5 Likes

Doing this Game Jam has been a huge help in testing some of the new game data features.
With the “Lets Bounce” game I can build a complete level in about 2 hours, almost entirely in Blender. This is very very nice. I cant wait to punch out a bunch of F18 missions now :slight_smile:

Heres Interspatial Club in blender:

Same level in Defold

And in game (its a dark game)

Into the tidying up stages (lighting, texturing bugs and game numbers tweaking)… very happy. Will drop a release of this next week. The current new release branch you can use right now, but theres one command I need to test and check more (since I didnt use it much - replace texture command).

6 Likes

Ok. Release 2.0.0 is up. With all the game data commands. This will be an ongoing improvement process but Im very happy with the capabilities so far.

8 Likes

And it looks like the Blender upgrade shouldnt be too bad. If you are using gltf/glb it might be a little more painful, but if using the meshbuffer (which is required if you need material mapping) then it looks like it is working as is.

Ive made some changes on the main branch. Will be testing for next day or two and then push another release on the weekend. Then its onto f18 mission builds! :slight_smile:

5 Likes

Some sad news. I dont think I will be doing much more on the Defender exporter. Other efforts are now taking priority in my life. I wont be removing the repo, so people are welcome to fork and contribute or develop their own from it. Thanks for everyones interest in it. Has been real fun.

5 Likes