Bart
WiseBart
Blender to GameMaker:Studio Exporter (current release v1.0.10)
Note to the moderators viewing this topic: I spoke with @Nocturne about this and got approval to put it here
Introduction
After quite a few years I am happy to announce the updated version of my Blender exporter add-on that I posted on the old forums. (yeah, it's been a while)
The exporter now works with Blender 2.8 and also has a compatibility version for Blender versions below 2.8 (currently not entirely up-to-date).
This add-on is entirely free to use and I hope it can make life quite a bit easier for anyone who wants to use 3D models from Blender in GameMaker.
At least that's the goal I had when I started developing this for my own use a couple of years ago.
The add-on itself does not come with any code for GameMaker but I'm going to make an extensive example project to show a couple of interesting vertex formats from basic to advanced (passthrough, basic vertex formats, static batches, dynamic batches, morph animations, "tiny" vertex formats, texture atlas/group, ...)
I'm also planning to add documentation to the wiki, although this will be more focused on the Blender side.
Features
Importing in GameMaker
The exporter generates a .vbx file that contains the (vertex) buffer data and a .json file with some additional info on the data.
Both are optional, so you can choose to export vertex buffer data and/or metadata.
The code to import from a file is the following:
You can define the vertex format yourself in gml if you know what format you used to export from Blender.
A description of the vertex format is also added to the .json file.
I currently don't have "standard" gml code to read it. That may get added later.
Example Project
Blender Exporter Examples YYZ
This is an early work in progress. More examples will be added when I find the time.
(To open the .blend file straight from the IDE, right-click and select
Setup
This is described in the wiki, see Installation.
In the end, it should look like this:
Introduction to defining vertex formats
The main feature of this add-on is the ability to define custom vertex formats.
Since these are quite customizable this can easily get pretty complex.
Because of that, here's a short introduction to this:
Known bugs/Issues/Improvements/Feedback
These can be found under Issues in the repository on GitHub.
If you encounter any bugs, feel free to let me know here or add an issue to the list.
Also any other feedback on this add-on is more than welcome!
Note to the moderators viewing this topic: I spoke with @Nocturne about this and got approval to put it here
Introduction
After quite a few years I am happy to announce the updated version of my Blender exporter add-on that I posted on the old forums. (yeah, it's been a while)
The exporter now works with Blender 2.8 and also has a compatibility version for Blender versions below 2.8 (currently not entirely up-to-date).
This add-on is entirely free to use and I hope it can make life quite a bit easier for anyone who wants to use 3D models from Blender in GameMaker.
At least that's the goal I had when I started developing this for my own use a couple of years ago.
The add-on itself does not come with any code for GameMaker but I'm going to make an extensive example project to show a couple of interesting vertex formats from basic to advanced (passthrough, basic vertex formats, static batches, dynamic batches, morph animations, "tiny" vertex formats, texture atlas/group, ...)
I'm also planning to add documentation to the wiki, although this will be more focused on the Blender side.
Features
- Highly customizable vertex format: many properties can be added, including tangents, bitangents, all types of normals (vertex, loop and face), vertex group indices, vertex weights, ...
- Choose the format to write to the buffer and optionally execute a "pre-processing" function to modify the value that's being written.
- Write interpolated values for attributes up to 1 frame back in time (this could be increased, but it takes a lot of memory) - for e.g. morph animations
- Presets so you don't have to do that configuration all over again
- Hopefully a few more in the not too distant future, see the issues list for more info
Importing in GameMaker
The exporter generates a .vbx file that contains the (vertex) buffer data and a .json file with some additional info on the data.
Both are optional, so you can choose to export vertex buffer data and/or metadata.
The code to import from a file is the following:
GML:
var buffer = buffer_load("vertex_data.vbx");
vertex_buffer = vertex_create_buffer_from_buffer(buffer, vertex_format);
vertex_freeze(vertex_buffer);
A description of the vertex format is also added to the .json file.
I currently don't have "standard" gml code to read it. That may get added later.
Example Project
Blender Exporter Examples YYZ
This is an early work in progress. More examples will be added when I find the time.
(To open the .blend file straight from the IDE, right-click and select
Open Externally
)Setup
This is described in the wiki, see Installation.
In the end, it should look like this:
Introduction to defining vertex formats
The main feature of this add-on is the ability to define custom vertex formats.
Since these are quite customizable this can easily get pretty complex.
Because of that, here's a short introduction to this:
The vertex format that the exporter uses is defined under Mesh Data:
The leftmost dropdown allows you to select the source for the data. This can be the vertex, the face, the material, the uv or another property in the list.
The one next to it contains the properties at that source and is updated dynamically. Some types of properties are filtered out, such as strings and enums.
For example, Mesh Vertex contains the following properties:
The next two inputs may not be obvious at first sight.
Fmt defines the format to be written for this property, the full list for that can be found under Format Characters in the Python docs.
When you select the property to be used in the second column this will automatically be updated based on the metadata in Blender.
When one or more asterisks
You can override this suggestion by replacing it with your own format string.
In practice, you'll probably use one of these:
In the end, basically, per property/per line of the vertex format, the exporter does this:
A couple of functions are provided already but you can add your own to the file
The Int input can be changed from 0 to 1 and is the number of frames to go back when exporting multiple frames. It basically means "take the value of this property at index [frame-i]" and allows for interpolation of properties for e.g. morph animations.
The leftmost dropdown allows you to select the source for the data. This can be the vertex, the face, the material, the uv or another property in the list.
The one next to it contains the properties at that source and is updated dynamically. Some types of properties are filtered out, such as strings and enums.
For example, Mesh Vertex contains the following properties:
The next two inputs may not be obvious at first sight.
Fmt defines the format to be written for this property, the full list for that can be found under Format Characters in the Python docs.
When you select the property to be used in the second column this will automatically be updated based on the metadata in Blender.
When one or more asterisks
*
are shown it means the add-on doesn't know what type to make of it.You can override this suggestion by replacing it with your own format string.
In practice, you'll probably use one of these:
f
: a single 32 bit floati
: a single signed int (32 bit)?
: a boolean as a byte (perhaps the most confusing one)
In the end, basically, per property/per line of the vertex format, the exporter does this:
Get value of property
> Pre-processing function if not None
> Conversion to format
A couple of functions are provided already but you can add your own to the file
conversions.py
in the add-on's directory.The Int input can be changed from 0 to 1 and is the number of frames to go back when exporting multiple frames. It basically means "take the value of this property at index [frame-i]" and allows for interpolation of properties for e.g. morph animations.
Known bugs/Issues/Improvements/Feedback
These can be found under Issues in the repository on GitHub.
If you encounter any bugs, feel free to let me know here or add an issue to the list.
Also any other feedback on this add-on is more than welcome!
Last edited: