MovingBlocks / TeraMisc

Support repo for Terasology - for stuff we don't want to keep in the main repo
https://github.com/MovingBlocks/Terasology
6 stars 21 forks source link

Added the json files as string #52

Closed kartikey0303 closed 7 years ago

kartikey0303 commented 7 years ago

The script exports models and animations from blender.

  1. To export a ready to use module navigate to File->Export->Expor zip for Terasology.
  2. Individual files can also be exported using a panel to select the folder in which to export the files.
  3. Clicking the "+" next to the path exports the entire module in the folder and changes the path for future exports to the new folder.
  4. Exporting multiple actions is now supported using the scene switch method rather than the action method.
  5. The prefab which is exported contains the list of animations roughly according to the naming conventions.
  6. The code now contains the template prefab and template material json so there is no need to copy it to the addon directory.
  7. Texture files export works by checking if the model is linked with a texture otherwise it checks for a texture named Texture.png in the folder of the .blend file (here starts with a capital letter).
flo commented 7 years ago

I get an error when I try to export via the + button.

Traceback (most recent call last):
  File "/home/flo/.config/blender/2.77/scripts/addons/io_export_md5.py", line 1242, in execute
    exportModuleForTerasology(dirpath, fileName, self.report)
  File "/home/flo/.config/blender/2.77/scripts/addons/io_export_md5.py", line 1158, in exportModuleForTerasology
    with open(os.path.join(parentDirectory, fileName),'w') as outFile:
FileNotFoundError: [Errno 2] No such file or directory: '/home/flo/terasology/wildAnimals/modules/MyTestModule/module.txt'

I entered "MyTestModule" as directory name and "/home/flo/terasology/wildAnimals/modules" as parent directory path. MyTestModule was of course a directory that did not exist previously.

flo commented 7 years ago

I tested the jar ingame, it appears in the module list.

Howeever the animationPool fields are empty

flo commented 7 years ago

Also I noticed that the module is not listed as the exported jar file name but as the model file name. Which is breaks with the convention that modules have the same name like the jar.

flo commented 7 years ago

I was successfully able to export the skeleton as module and activate it ingame. I was even able to spawn the skeleton, but the texture was wrong.

I think the issue is that "diffuse" was set to "skeleton" in the material but the texture in the folder was called skeletonTexture.png.

Also the module name was different from it's id which made it hard to find it. The id should be the same as it's name.