Post by eternity on Mar 5, 2016 20:48:19 GMT
Since version 0.03, emotool3 includes support to export an emo file to fbx format, and also to inject a fbx into an existing .emo file.
This thread is WIP. It will evolve as people figure out stuff, etc.
Unlike with .obj format, the inject of fbx supports a different number of vertex than the existing in the .emo, this is due to the fact that the .fbx format can express all information that exists in an .emo vertex, such as vertex color or bone weights, which the .obj format cannot express.
The number of vertex, though, cannot exceed 65535 per subpart, this is a limitation of the .emo format.
Exporting an .emo file
Exporting an .emo file is easy. Drag and drop the file to "export_fbx.bat". It will generate a file with identical base name and ".fbx" extension with the whole model. Additionally, it will generate a folder called "XXX_exported" (where XXX is the base file name of the .emo), which each subpart exported as separated file.
All fbx files will have each submesh of each subpart as a separate object, which you could easily select in your 3d editor.
Injecting a fbx file
There are two ways of injecting fbx. By file, and By folder.
Injecting by file
To inject a fbx file, just drag and drop it to inject_fbx.bat. emotool3 will assume that an .emo file with same name exists, since this an "inject" and not a "create from zero".
The injection works like this:
emotool3 will read the emo file, and for each submesh, it will try to find an object in the fbx with similar name. If the object exists in the fbx, emotool3 will destroy the existing polygons/vertex of the submesh in the emo, and replace them with the data in the .fbx. If the object doesn't exist in the .fbx, emotool3 will delete the submesh from the .emo file, since it will assume that that's what you wanted to do.
(Finally, if an object exists in the fbx, but not in the .emo, that's ignored).
If all submeshes of a subpart are deleted, emotool3 will automatically delete the subpart. If all subparts of a part are deleted, emotool3 will automatically delete the part. If all parts of a parts group are deleted, the parts group will be automatically deleted. And if all parts group are deleted... well, you will get an .emo file with just a skeleton (and that probably will crash the game, but not tested).
Injecting by folder
To inject a folder where each fbx file represents a subpart, the folder must be called XXX_work, where XXX is the name of a existing .emo file.
Then, you just drag and drop the folder into inject_fbx.
This mode works in a different way than the previous one. In this mode, emotool3 will scan the directory in search of .fbx files. When it finds one, it will assume that the .emo file has a subpart with similar name. If it doesn't, the program will abort. If it doesn, emotool3 will replace the contents of the subpart with the content of the file.
In this mode, no deletion of subparts, parts or parts group ever happen, but deletion of submeshes can still happen if they exist in .emo but not in .fbx.
3ds max settings
To import a fbx file generated by emotool3, use the default of settings of the "Autodesk Media & Entertainment". Those seem to be fine.
And, you will get a window like the one below telling you about two errors. I may correct these in the future, but at the moment, DON'T CLICK OK, instead close the window.
Note: when importing the model, you may get a ton of odd "lines" all around the view. That's normal, just ignore that.
Finally, on export, use the default settings of Autodesk Media & Entertainment.
Blender settings.
Unfortunately, Blender doesn't work very well with this at the moment. It seems to destroy the bone weights somwhow... but only in some submeshes... until that is figured out, stay out of Blender for fbx, except if is to test and find a working setting.
This thread is WIP. It will evolve as people figure out stuff, etc.
Unlike with .obj format, the inject of fbx supports a different number of vertex than the existing in the .emo, this is due to the fact that the .fbx format can express all information that exists in an .emo vertex, such as vertex color or bone weights, which the .obj format cannot express.
The number of vertex, though, cannot exceed 65535 per subpart, this is a limitation of the .emo format.
Exporting an .emo file
Exporting an .emo file is easy. Drag and drop the file to "export_fbx.bat". It will generate a file with identical base name and ".fbx" extension with the whole model. Additionally, it will generate a folder called "XXX_exported" (where XXX is the base file name of the .emo), which each subpart exported as separated file.
All fbx files will have each submesh of each subpart as a separate object, which you could easily select in your 3d editor.
Injecting a fbx file
There are two ways of injecting fbx. By file, and By folder.
Injecting by file
To inject a fbx file, just drag and drop it to inject_fbx.bat. emotool3 will assume that an .emo file with same name exists, since this an "inject" and not a "create from zero".
The injection works like this:
emotool3 will read the emo file, and for each submesh, it will try to find an object in the fbx with similar name. If the object exists in the fbx, emotool3 will destroy the existing polygons/vertex of the submesh in the emo, and replace them with the data in the .fbx. If the object doesn't exist in the .fbx, emotool3 will delete the submesh from the .emo file, since it will assume that that's what you wanted to do.
(Finally, if an object exists in the fbx, but not in the .emo, that's ignored).
If all submeshes of a subpart are deleted, emotool3 will automatically delete the subpart. If all subparts of a part are deleted, emotool3 will automatically delete the part. If all parts of a parts group are deleted, the parts group will be automatically deleted. And if all parts group are deleted... well, you will get an .emo file with just a skeleton (and that probably will crash the game, but not tested).
Injecting by folder
To inject a folder where each fbx file represents a subpart, the folder must be called XXX_work, where XXX is the name of a existing .emo file.
Then, you just drag and drop the folder into inject_fbx.
This mode works in a different way than the previous one. In this mode, emotool3 will scan the directory in search of .fbx files. When it finds one, it will assume that the .emo file has a subpart with similar name. If it doesn't, the program will abort. If it doesn, emotool3 will replace the contents of the subpart with the content of the file.
In this mode, no deletion of subparts, parts or parts group ever happen, but deletion of submeshes can still happen if they exist in .emo but not in .fbx.
3ds max settings
To import a fbx file generated by emotool3, use the default of settings of the "Autodesk Media & Entertainment". Those seem to be fine.
And, you will get a window like the one below telling you about two errors. I may correct these in the future, but at the moment, DON'T CLICK OK, instead close the window.
Note: when importing the model, you may get a ton of odd "lines" all around the view. That's normal, just ignore that.
Finally, on export, use the default settings of Autodesk Media & Entertainment.
Blender settings.
Unfortunately, Blender doesn't work very well with this at the moment. It seems to destroy the bone weights somwhow... but only in some submeshes... until that is figured out, stay out of Blender for fbx, except if is to test and find a working setting.