If you have registered and activated your program (non-Steam version), you'll have the ability to save and export.
- Click File on the menubar and choose either Export Scene or Export Objects. Export Objects will export each object separately whereas Export Scene will combine everything together.
- Select which objects to include in the scene if necessary.
- Adjust the export settings to your liking. Details of these settings are outlined below.
- Click Export and pick a location to save your files.
- Type in a name for your file and click Save.
OBJ format
When exporting, you can also export the textures as well as a .mtl file. If you export with the MTL file, then when you import the .obj file into a program that supports mtl files, it will import everything with the appropriate textures assigned. This is because the MTL file helps define the materials that the object uses, along with which textures there should be.
By default, Crocotile will export all the tiles (and the tiles of objects that you choose to include), but if you want to limit the tiles that get exported to just those that belong to a single tileset, you can enable the "Limit export to currently selected tileset" option. This will allow you to split up your scene into multiple parts. Then when importing into another program, you can load all of the exported .obj files, apply the correct tileset texture to each one, and position them to the same coordinates. Your scene will look fine, and everything will be together. This option usually isn't recommended though.
🐊
Watch this video to learn about all the options as well as how to import into Unity, Godot, Blender, Sketchfab.
GLTF & GLB formats
You can choose to export your scene and objects as .gltf files or .glb files. Gltf files are human readable json formatted files while the glb files are binary. The binary format has a smaller file size.
Gltf and Glb files can embed the texture images into the file. This way you can have just one file that contains everything you need to import into another program. Because of this, these formats are the preferred way to export.
DAE (Collada) format
In some cases you may want to export as a .dae, which is an XML formatted file. These files will store the file path to any textures that they use. In this case, they will assume they are in the same directory as the .dae file.
C3dp format
If you are exporting objects (not the scene), you can export them as .c3dp files. These are prefab files that are designed for importing into other Crocotile scenes. Use this format if your intention is to transfer Crocotile built objects into other Crocotile scenes.
Export Options
- Merge Vertices
If this option is selected, any vertices that are overlapping will be merged together to create just one vertex. The UVs of the vertices must also be the same for them to be merged as there can only be one UV coordinate per vertex. If the UVs are different, then the vertices won't merge even though they have the same position in 3d space.
- Vertex Colors
You can choose whether or not to include any vertex colors in the exported model. The .obj file format doesn't officially support vertex colors, however some programs accept a modified form where the R,G,B values are written directly after each vertex X,Y,Z position (v X Y Z R G B). This modified format will be used if exporting vertex colors in .obj format.
- Vertex Normals
You can choose between flat or smooth normals. Flat will set all vertex normals to be the same as the face normal. This will give the impression of sharp edges to each polygon. Smooth will average the vertex normals based on all polygon faces connected to that vertex. With Smooth selected you can specify the angle threshold to control which face normals affect the vertex normals. Specify the angle in degrees. If the angle between surfaces are within this angle, the vertex normals will be averaged betweeen them.
- Vertex Color Space
The color space for the Vertex colors can be set to either sRGB or Linear. This applies only to the .obj and .dae formats. The .gltf/.glb files store them as Linear based on the standard specifications of that file format.
As of v2.5.3, .gltf/.glb formats can specify the color space as well. This is in case an importer chooses not to convert vertex colors from Linear to sRGB. Otherwise, it is recommended keeping it set to Linear.
- Decal Offset
This will offset any decals by the provided amount to avoid z-fighting. Usually this is handled by a shader, but if that is not a option you can bake it into the geometry by providing a value other than 0. Use a small fraction like 0.01.
- Polygon Type
Polygon type only applies to .obj files. You can choose to export your tiles as Triangles or Quads. Triangles are three-sided polygons and Quads are four-sided polygons.
If you have triangular tiles in the scene (tiles that have one of their polygons collapsed), these may mess up your export when Polygon type is set to Quads and Merge Vertices is enabled. There is an option in the context-menu when you right-click the 3d scene that allows you to select all the triangular tiles (if there are any). While in Edit mode, right-click the scene and goto Faces > Select triangular tiles.
- Use Groups
Use Groups only applies to .obj files. This option will organize the tiles of each instance to their corresponding object group. This may effect how your .obj gets imported into other programs. Some programs will separate each group into their own objects upon import. So if you need the tiles split up into their corresponding objects then you will select this, otherwise everything will be treated as a single object.
- Use single mesh
This option does not apply to .obj files. If this option is checked, it will combine everything into one mesh. If it isn't checked, the scene hierarchy will be retained with correct instance parenting as well as animations.
- Unlit
The Unlit option only applies to .gltf and .glb files. If unlit is chosen, it will export the model without any lighting/shading properties.
- Embed Textures
Embed Textures only applies to .gltf and .glb files. This option will embed the texture data with the rest of the data so that there is only one file.
- Export Static Pose
With this option enabled, any skinned objects you export will have their current bone transformations baked into the geometry and any animations will be removed as well. This will result in exporting a static pose of the objects. This option applies automatically to .obj and .dae formats, because they do not export animations. Since .gltf and .glb files can contain animations, you will have to enable this option specifically for them if you want to export a static pose.
- Texture Prefix
Textures that are exported can have a prefix applied to their filenames. You can supply a custom prefix, or have the project's name applied as a prefix.
- Tilesize
When Tile Spacing is set higher than 0, it will use this option to determine the tilesize on the tilesets. You can set this to Auto, Unique or Custom. Auto will automatically try to determine the size of the tiles for each tileset. Unique will use the unique tilesize values that you have set for each tileset. Check the Tilesets section of this documentation for details on how to set those. Custom will allow you to provide a specific tilesize for all tilesets.
- Tile Spacing
When exporting, the tile spacing option will add pixels around each tile. So if you choose a value of 2, each tile will have two rows/columns of pixels added on each side, so there would be 4 total pixels rows/columns between every tile. Example: [[Tile]][[Tile]][[Tile]]
This tile spacing implementation only works if you keep all your uvs square with the same dimensions (one tile size per tileset). The wrapping mode of the tileset must also be set to "Clamp to Edge".
- Power of Two
With power of two option enabled, the tilesets will resize the canvas (it will add empty space) up to a power of two dimension if they aren't already. This may be necessary for some engines to render your textures correctly. For instance, if your textures look blurry, it may be due to tilesets not being power of two dimensions. The wrapping mode of the tileset must also be set to "Clamp to Edge" otherwise it won't resize the canvas.
- Limit export to currently selected tileset
With this enabled, only the tiles that belong to the currently selected tileset will be exported.
- Export UV Animations
This will export a text file containing JSON formated data for all the UV animations in your project. It will also bake some corresponding animation data into the UV data of vertices in your model. For more details about this data and how to use it, check the Animated Tiles section of this documentation.
- Export Lights
If you are exporting a scene, this option will decide whether any lights should be included in the scene. For this option to be available, Use single mesh needs to be unchecked.
- Scale
All vertices positions will be multiplied by this value. You can modify this value to magnify/scale the size of your model if you need to.
Texture Names
Each tileset is assigned a name when they are added to your Crocotile scene. By default it will be a number such as 0,1,2,etc.. You can change a tileset's name by going to the Tileset Material Settings panel. This can be accessed in the Tileset menu, or by double-clicking the tileset in the tileset list. Check the Tileset section of this documentation if you need to learn more about the Tileset panel.
When tilesets get exported as textures for your models, they will use their tileset name to distinguish them. Each tileset name in a Crocotile scene will be unique to prevent tilesets from overwriting other tilesets when exporting, however if you are exporting multiple scenes it is possible that you may be using the same names in two or more scenes. To prevent exported tilesets being overwritten, you can add a prefix to your textures if you need to via the Texture Prefix option in the Export panel. You can set a custom prefix, or use the project name as the prefix. Another way to avoid overwriting textures is to export to separate folders so that all your files for one scene is located in its own folder.
Export Scene Data
You can export entity data by going to the Scene panel and selecting Export Scene Data from within the Scene dropdown menu.
This will export object and instance data as a json formatted text document. It will also include Light and Camera data if you have any in the scene.
{
"objects":[ {
"name":"Object 1",
"points":[ {
"name": "Origin",
"pos": {"x":0,"y":0,"z":0}
},{
"name": "Point",
"pos": {"x":0,"y":0,"z":0}
} ...],
"billboard":{"enabled":false,"y":false},
"custom":[ {
"name": "Name",
"uuid": "E6205BF6-0FA3-47F7-90BD-7D895DAD9DD1",
"type": "object",
"valueType": "number",
"value": 25
},{
"name": "Name2",
"uuid": "19E722F6-E597-489A-B766-BA575DB71D63",
"type": "instance",
"valueType": "string",
"value": "hey"
} ...],
"instances":[ {
"name": "Instance 1",
"uuid": "0D08FF35-7E44-422B-9C62-4F104857209F",
"parent": null,
"pos": {"x":0,"y":0,"z":0},
"rot": {"x":0,"y":0,"z":0,"order":"XYZ"},
"sca": {"x":0,"y":0,"z":0},
"custom":[ {
"uuid": "19E722F6-E597-489A-B766-BA575DB71D63",
"value": "hi"
} ...]
}, ...]
}, ...],
"lights":[ {
"name": "Point Light",
"pos": {"x":0,"y":0,"z":0},
"rot": {"x":0,"y":0,"z":0,"order":"XYZ"},
"sca": {"x":0,"y":0,"z":0},
"parent": null,
"color": {"r":1,"g":1,"b":1},
"intensity": 1,
"distance": 100,
"decay": 1,
"angle": 30,
"penumbra": 0,
"target": {
"pos": {"x":0,"y":0,"z":0},
"rot": {"x":0,"y":0,"z":0,"order":"XYZ"},
"dir": {"x":0,"y":0,"z":-1},
"parent": null,
},
"castShadow": true,
"shadow": {
"bias": -0.001,
"mapSize": {"x":512,"y":512},
"camera": {"near":0.5,"far":500,"left":-10,"right":10,"top":10,"bottom":-10},
"valueType": "number",
"value": 25
},
}, ...],
"cameras":[ {
"name": "Camera 123",
"cameraZoom": 1.22773766,
"zoom": 1,
"cameraType": "PerspectiveCamera",
"parent": null,
"perspective": {
"pos": {"x":0,"y":0,"z":0},
"rot": {"x":0,"y":0,"z":0,"order":"XYZ"},
"sca": {"x":0,"y":0,"z":0},
"zoom": 1,
"near": 0.01,
"far": 500,
"aspect": 1.3132530120481927,
"fov": 50,
},
"orthographic": {
"pos": {"x":0,"y":0,"z":0},
"rot": {"x":0,"y":0,"z":0,"order":"XYZ"},
"sca": {"x":0,"y":0,"z":0},
"zoom": 1,
"near": 0.01,
"far": 500,
"left": -10,
"right": 10,
"top": 10,
"bottom": -10,
},
"target": {
"pos": {"x":0,"y":0,"z":0},
"rot": {"x":0,"y":0,"z":0,"order":"XYZ"},
"dir": {"x":0,"y":0,"z":-1},
"parent": null,
},
}, ...]
}
Export Grid Map
Each tile placed inside an Prefab Object can correspond to a grid cell in a grid map. The tile index in the tilemap also gets saved to each grid cell when exported. Grid maps are useful for defining a three-dimensional map of cells. You can decide what these cells represent, but the most common use would be for defining collideable areas.
You can export Grid Map data by going to the Scene panel, right-clicking on a listed Prefab Object and selecting Export Grid Map from within the Export Misc section of the context-menu. The Grid Map panel will pop up with inputs for specifying the Cell Size. The Cell Size defines the dimensions of each cell and is measured in Pixels. When exported, it will be converted to Meters.
When you click Export, it will cycle through every tile in the Prefab Object and check the position immediately behind/under it. It will determine the location of the cell relative to the Object's origin point and store the x,y,z position as well as the tile index inside an array. The tile index is useful if you want to differentiate your cells; you can have one tile correspond with sloped collision cells for example. Tile indices begin with 0 at the top left corner of a tileset, and will be based on the Tilesize or the Tileset's Unique Tilesize if it is set.
Below is an example of some Grid Map data exported as a json formatted text document.
{
"size":{"x":1,"y":1,"z":1},
"cells":[ [2,-1,0,0],[3,-1,0,0],[4,-1,0,0], ...],
"dimensions":{"x":10,"y":10,"z":10},
"min":{"x":-5,"y":-5,"z":-5},
"max":{"x":5,"y":5,"z":5}
}
🐊
To demonstrate how to work with this data, a Godot project has been created that uses a Grid Map to define the collidable areas of a level. Godot is a free and open-source program for developing games, and it is an excellent engine for importing your Crocotile work into if you are comfortable with more technical processes. You can use the data in other engines, such as Unity, if you like. Watch the video to see how this data can be used in Godot!