Extensions:2.6/Py/Scripts/Import-Export/Marmalade Exporter

提供: wiki
< Extensions:2.6‎ | Py‎ | Scripts‎ | Import-Export
2018年6月29日 (金) 05:47時点におけるYamyam (トーク | 投稿記録)による版 (1版 をインポートしました)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先: 案内検索
Marmalade Cross-platform Apps (.group)
Export Marmalade Format files (.group)
UI location File > Export > Marmalade cross-platform Apps (.group)
Usage Export Meshes (colors and UVS) and rigged characters (bones) in Marmalade format. Marmalade allows to develop best-in class Mobile Applications on iPhone, Android, BlackBerry, Bada, Symbian ...
Version 0.62 Author(s) Benoit Muller
Blender 2.6.3 License GPL
Category Import-Export Distribution Contrib


Executable information
File name io_export_marmalade.py
Current version download http://git.blender.org/gitweb/gitweb.cgi/blender-addons-contrib.git/blob_plain/HEAD:/io_export_marmalade.py
Python modules os math mathutils datetime shutil subprocess


Links https://www.madewithmarmalade.com/devnet/forum/7428

http://www.madewithmarmalade.com/

Exporter File v0.62

The exporter is part of the Blender contrib repository

Here is the link to download the Exporter compatible with Blender 2.63 and upwards:
http://git.blender.org/gitweb/gitweb.cgi/blender-addons-contrib.git/blob_plain/HEAD:/io_export_marmalade.py

Copy it into your install directory, example: C:\Program Files\Blender Foundation\Blender\2.63\scripts\addons


For reference, you can find the last version compatible with Blender 2.58-2.62
http://projects.blender.org/tracker/download.php/153/467/30371/20219/io_export_marmalade.py


Latest changes

New feature:
- Fix Mac issues.
- Compatible with Blender 2.63 API changes due to BMesh.
- Option to Export multiple Animation actions for Armatures.

Fixes:
- Rest pose was wrong (it was the first Pose Frame, so export was wrong when Animation was not started by the Rest pose)
- Rotation is now applied before export (scale was already applied)
- Clamp material exported colors to 255
- Skin export: Exclude VertexGroup that doesn't match any Bone Name.

About


The Marmalade Exporter intends to simplify the mobile development from Blender. It allows to export artist asset in native Marmalade files.
The exporter will create a group file that is usually located in the data folder of the application. It creates the .geo and .mtl .skel .skin file in the Models sub directories , and the .anim files in the anims subdirectories. Texture file are automatically unpack and copied into the Models\textures directory.
It allows to export multiple animations for one skeleton.


The Z and Y axis are automatically swapped by the export (Z up in Blender, Y up in Marmalade)

Information


Installation

To install the most recent version of the script:

  • Drop io_export_marmalade.py into the blender install directory C:\Program Files\Blender Foundation\Blender\2.63\scripts\addons
  • Open Blender
  • Display the User Preferences window
  • In the Import-Export Category, Check the Add-On: Import-Export Marmalade Cross-platform Apps (.group)


general help on Blender Addon management http://wiki.blender.org/index.php/Doc:2.6/Manual/Extensions/Python/Add-Ons

Use

Select File > Export > Marmalade cross-platform Apps (.group)) to enter the exporter. From there, check the options you wish to use for export, choose a file path, and then click Export Marmalade.

Here is a brief description of the options:

Export options.
  • Export Mode:
    • All Objects - All Mesh and Armature objects will be exported.
    • Selected Objects - Only selected Mesh and Armature objects will be exported.
  • Merge:
    • None - Objects are exported separately, in model space. To be used when exporting a Rigged Character animation. However it is not usefull to export a full scene with many small items.
    • Merge in unique Geo File containing several meshes - Objects Meshes are merged in a single exported geo file.The geo contains several mesh sections. Objects are in World space, so it can be usefull to export a scene background.
    • Merge in one big Mesh - Objects Meshes are merged in a single Mesh in a single GEO file.Objects are in World space, so it can be usefull to export a scene background, or if your Object has been made by many small cubes.
  • Scale - Allows to change the scaling percent used by the export. For compatibility reason, 100% corresponds to the scale that was applied by the collada / colladaconvertor exports.
  • Flip Normals - Inverts all vertex normals.
  • Apply Modifiers - Applies all modifiers on mesh objects before export, using Preview settings if applicable. Note that Armature modifiers are not applied if the Export Armatures option is checked.
  • Export Vertices Colors - Exports colors of vertices if any have been set in Blender.
  • Export Material Colors - Exports Material Colors in the Marmalade MTL file.
  • Export Textures and UVs - Exports UVs coordinates in GEO file and Includes references to external image files to be used by the material (MTL File). Note that the image files must be in the same directory (or relative) as the exported model to be detected.
  • Copy Textures Files - Copy the Images Files referenced by the Blender file, directly into the marmalade modeles\textures directory. Packed textures are managed. Jpeg and tiff pictures are converted to png, to be handled by Marmalade.
  • Export Armatures - Exports the bones of Armature objects and writes vertex weight data for objects with Armature modifiers. Note that you must have only one Root Bone. One Vertex can be weighted by more that 4 bones, otherwise the exporter will skip some weighting.
  • Animations Frames:
    • None - No object animation will be exported.
    • Keyframes Only - Writes Position/Rotation data for each Bones at each keyed animation frame.
    • Full Animation - Writes Position/Rotation data for each Bones at all animation frames.
  • Animations Actions:
    • Default Animation - Export the default animation associated with the armature.
    • All Animations - Export all animations. Several animations for an armature can be defined in the Blender DopeSheet window using the action editor.
  • Animation FPS - Allows to change the animation speed. By default the value is the one inherited from the Blend file. It can be overriden to slow down or speed up the animation at export time.
  • Verbose - Displays debug text in the external console. Useful when getting export errors to see exactly where the problem occurred. Please email me with any bugs that you encounter.

Sample


Rigged Character

you should have one mesh for you character, textured, with one Armature, and animation. The Armature should have only one Root bone. Do not use the Merge option, the armature and Model will be exported in Model space.

Export Animated rigged character in Blender.
Export Animated rigged character in Marmalade Viewer.

Background Scene

The background of your scene is often made of several meshes, where you need to export in World coordinates to keep relative distances between each piece of the scene. So here you have to use the Merge option to generate one geo file for the whole scene in world coordinate. In World space you might need to reduce the scale factor in the Export Option
(the vaults.blend has been exported in 10% with Merge option set)

Use Merge option to export a scene background.
Exported scene background displayed in the Marmalade Viewer.

Scope


- no world file are currently generated

- coordinates are Model space, except if you use the Merge option that export in world space

- single bone animation are not 'yet' managed

- Bone and bone animations are Model space.

- UV0 are managed, UV1 are not manged (However should not be complex, if someone has a Blend sample file with UV0 and UV1)

Links and Support