Giter Club home page Giter Club logo

albam's Introduction

Albam

Actions Status Code coverage

Albam is a Blender 3.6+ addon for importing and exporting 3d models, textures and animations from game engines.

This repository is going through a refactor. Refer to Albam Reloaded for the stable version.

albam's People

Contributors

brachi avatar henryofcarim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

albam's Issues

Exported model streches ingame

Game

Resident Evil 5

Example game file names

Any .arc

Blender version

2.79

Albam version

0.3.0-testing (albam-bugfix-ISSUE-47-original-model-deformed-after-export)

Observed behavior

Model streches ingame.
20170920000432_1

Expected behavior

Model should appear normally.

Steps to reproduce

Export a model that's taller than the original model.

Import a mod will cause error

Game

Resident Evil 5 Gold Edition

Example game file names

uPl07RebeccaNormal.arc

Blender version

2.78c

Albam version

0.2.0

Observed behavior

Modded model is not show up and show up the original model instead.
http://i.imgur.com/kn6kgYA.png
(vertex array length is -58 wow)

Expected behavior

should at least show the skirt of cheerleader?
http://i.imgur.com/mU8HnZG.png

Steps to reproduce

Get the mod here:
http://residentevilmodding.boards.net/thread/5839/rebecca-chambers-sports-outfit
Then just import the only arc file in that rar.

Exporting: Support DDS Textures with no mipmaps

Game

Resident Evil 5

If for some reason a DDS texture with no mipmap is used, the exporter raises an exception.
I don't know if MTFramework supports DDS with no mipmaps, but if it does, they should be supported. If not, all textures should be pre-checked and a clear error message and how to fix it should be displayed.

Traceback (most recent call last):
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/blender.py", line 189, in execute
    func(obj, self.filepath)
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/engines/mtframework/blender_export.py", line 109, in export_arc
    tex = Tex112.from_dds(file_path=bpy.path.abspath(blender_texture.image.filepath))
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/engines/mtframework/tex.py", line 54, in from_dds
    assert len(mipmap_offsets) == mipmap_count
AssertionError

location: <unknown location>:-1

Problem with level exporting

Game

Resident evil 5 Gold Edition

Example game file names

s100.arc
s101.arc
s103.arc
s104.arc
s105.arc
s106.arc
s108.arc
s109.arc
s113.arc
s114.arc
s115.arc
s116.arc
s117.arc
s118.arc
s119.arc

Blender version

2.76

Albam version

0.2.0

Observed behavior

s100 -error exporting
s101 -error importing
s103 - working*
s104 - game error "inflate unknown compression metod: -3"
s105 - game error "inflate unknown compression metod: -3"
s106 - working*
s108 - working*
s109 - error importing
s113 - error exporting
s114 - game error "inflate unknown compression metod: -3"
s115 - game error "inflate unknown compression metod: -3"
s116 - error exporting
s117 - working*
s118 - working*
s119 - error exporting
*means that game run it with lightmap and transperancy glitches
20170217174601_1
20170217185219_1

Expected behavior

import and export without errors and working without gliches

Steps to reproduce

import-export level without changes

Wrong textures exported

Game

Resident Evil 5

Example game file names

Any

Blender version

2.77

Albam version

v0.2.0-dev-alpha

Observed behavior

When the texture name and filename don't match, the textures are not exported

Expected behavior

Textures are exported regardless of texture names

Steps to reproduce

  1. Import a model
  2. Rename the file path to a texture of a certain mesh/material
  3. Export the model
  4. Import it again. See how the material now has a wrong texture assigned, and the texture with the filepath change was not exported

Model distorted if scaled up

Game

Resident Evil 5

Example game file names

Any

Blender version

2.77

Albam version

0.0.1

Observed behavior

When scaling all the meshes of a model after a certain point makes the model look terribly.

Expected behavior

The bounding box values of a model are calculated dynamically instead of using the ones from the saved/imported model.

Steps to reproduce

Import a model and scale the mesh (edit mode) 20 times.

Exported model's UV becomes broken

Game

Resident Evil 5

Example game file names

Any .arc

Blender version

2.79

Albam version

0.3.0-testing (albam-bugfix-ISSUE-47-original-model-deformed-after-export)

Observed behavior

UV map is broken after export.
f

Expected behavior

UV map should be the same as it is in Blender.

Steps to reproduce

Export a custom model with textures and UV map.

No material settings being exported

Game

Resident Evil 5

When exporting a mesh created from scratch (i.e. one that was not imported with Albam), the mesh doesn't show in game because the material settings are all empty.
Default settings for the materials must be created. Until research is done to figure out all the unknowns in the MaterialData structure, this seems like a good approach.

Arcs with multiple mods not setting parent correctly

Game

Resident Evil 5

Example game file names

Resident Evil 5/nativePC_MT/Image/Archive/uPl03WeskerCos1.arc

Blender version

2.77

Albam version

0.0.1

Observed behavior

The example file that has 2 mod files, and the meshes of one of them have no parents.
E.g.:

--uPl03WeskerCos1.arc
      --md0058.mod   --> No children, meshes should go here
      --pl1500.mod      --> has children, works ok
--mesh_from_md0058_1  --> this should go as a child of md0058.mod
--mesh_from_md0058_2
-- ...

Expected behavior

All meshes have a parent

Steps to reproduce

Import the example file

Fix vertices export with multiple attributes

Vertices are not exported correctly, causing visual artifacts in-game around UV seams.
The work-around is to use the "Fix leaked textures" tool from Albam Reloaded that essentially splits vertices in the UV edges.
This shouldn't be necessary if the exporter would generate the extra vertices at export time. Touching the original mesh or a copy of it shouldn't be necessary
This happens because GPUs expect that each new vertex attribute be a different item in in the vertices array. That's why an imported model always has duplicate vertices that can be removed with the "Merge by distance" operator.
See the official Blender glTF importer/explanation in the "Merge vertices" tooltip for import:

the glTF format requires discontinuous normals, UVs, and other vertex attributes to be stored as separate vertices, as required for rendering on typical graphics hardware. This option attempts to combine co-located vertices where possible.

The glTF exporter splits the vertices automatically, so it can be used as a reference. Handling triangle strips (RE5) when performing the split seems like a challenge and prevented this to be implemented so far.

Blender 4.0 support

At least shader node gropus need to be updated to manage API changes in 4.0:
https://developer.blender.org/docs/release_notes/4.0/python_api/#node-groups

Current behavior:

Traceback (most recent call last):
  File "/blender/4.0/scripts/addons/albam/blender_ui/import_panel.py", line 47, in execute
    self._execute(item, context)
  File "/blender/4.0/scripts/addons/albam/blender_ui/import_panel.py", line 54, in _execute
    bl_container = import_function(item, context)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/blender/4.0/scripts/addons/albam/engines/mtfw/mesh.py", line 266, in build_blender_model
    materials = build_blender_materials(
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/blender/4.0/scripts/addons/albam/engines/mtfw/material.py", line 92, in build_blender_materials
    _create_mtfw_shader()
  File "/blender/4.0/scripts/addons/albam/engines/mtfw/material.py", line 553, in _create_mtfw_shader
    shader_group.inputs.new("NodeSocketColor", "Diffuse BM")
    ^^^^^^^^^^^^^^^^^^^
AttributeError: 'ShaderNodeTree' object has no attribute 'inputs'

Model becomes invisible when aiming

Game

Resident Evil 5

Example game file names

uPl00ChrisCos1.arc
uPl03WeskerCos1.arc

Blender version

2.78

Albam version

0.2.0

Observed behavior

When aiming (camera too close) the model disappears.

Expected behavior

Model behaves like the original.

Steps to reproduce

Import and export a model without touching it, play in game and aim.

Exporting: errors with meshes with no faces

Game

Resident Evil 5,

Errors when trying to export meshes:

  1. No vertices -> exception
  2. Vertices, but no faces -> exception
  3. Some vertices with no faces -> artifacts

Vertices by itself use 'degenerate' triangles (e.g. invisible, see pl00ChrisNormal.arc, in mesh 0). However, it might be also a good idea to just skip exporting those kind of meshes.
For 3, it seems that the algorithm for converting triangle lists to triangle strips expects all vertices to be referenced by an index.

For 1, 2, the exception is:

Traceback (most recent call last):
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/blender.py", line 189, in execute
    func(obj, self.filepath)
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/engines/mtframework/blender_export.py", line 78, in export_arc
    exported_mod = export_mod156(child)
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/engines/mtframework/blender_export.py", line 168, in export_mod156
    exported_meshes = _export_meshes(blender_meshes, bounding_box, bone_palettes, exported_materials)
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/engines/mtframework/blender_export.py", line 424, in _export_meshes
    vertices_array = _export_vertices(blender_mesh_ob, bounding_box, mesh_index, bone_palette)
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/engines/mtframework/blender_export.py", line 306, in _export_vertices
    tangents = _get_tangents_per_vertex(blender_mesh)
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/engines/mtframework/blender_export.py", line 292, in _get_tangents_per_vertex
    blender_mesh.calc_tangents(uv_name)
RuntimeError: Error: Tangent space computation needs an UVMap, "UVMap" not found, aborting

Uncheck 'deform' in Blender bones while importing if they have no influence

Armatures being imported might include bones with no weights, e.g. IK bones.
Currently the importer checks the box 'deform' for every bone, regardless of them having weights or not.

When modding with a base skeleton this is an inconvenience since applying automatic weights will make those bone influence when originally they were not designed to do so.

The importer must have post-processing of models to find these bones and unckeck the 'deform' box if they are not being influence. This must be generic for all models.

Exporting : ChrisCos4 cannot be exported

Game

Resident Evil 5

Example game file names

ChrisCos4.arc

Blender version

2.76b

Albam version

0.3.0-testing

Observed behavior

The model, even clean, cannot be exported

Expected behavior

The model could be exported

Steps to reproduce

Import ChrisCos4.arc , even if you dont do any modification, try to re-export it, the program will not let you do it

Vertices with no weights in-game (OK in Blender)

When exporting a custom made model, I've noticed some vertices appearing in-game like they have no weights, but in Blender they look OK.
Turns out that MTFramework will ignore the weights completely if one vertex has no weights, even when the others sum up to 255.
Simple example to reproduce:

# bone_index/weight value pairs from Blender
[(47, 0.0021963752806186676), (53, 0.5013832449913025), (57, 0.0008065812289714813), (58, 0.36875882744789124)]
# After processing them for export, bone_index 57 has no influence
[(47, 1), (53, 146), (57, 0), (58, 108)]

So, weights exported have to:

  1. Have values sum up to exactly 255
  2. Have values be non-zero

Import individual materials file (MRL)

Currently materials files are loaded automatically using a very simple heuristic that searches for the file based on the path of the model file.
For example, pl00.mod will look for the file pl00.mrl in the same path as the model, and load it if it's found; pl00.mesh.<app-mesh-version> will look for pl00.mdf2.<app-mdf-version> or pl00_mat.mdf2.<app-mdf-version>.

The problem is that some games, notably RE6, don't follow this pattern exactly: the main characters' mrl files are empty. The "real" mrl files are scattered around different paths, with unpredictable names. This causes that by default most interesting models are imported without materials.

One option would be to hard-code those paths after careful research, but it doesn't scale well.

To solve this and allow for better modding, an mrl file can be made importable, with the optional requirement to select a model to apply it to. Materials will be applied only if the custom attributes in the mesh match the hash_id of the material.
If not matches are found, warning must be shown, but materials and textures should be created anyway.

Importing: Incorrect weights for Rev2 heads

Users found an issue with imported heads for Revelation 2 but it can be elsewhere too. The addon fails to import weighs for a bone with the index 0, probably because of this code in mesh.py

# TODO: verify in parsing tests that bone_index = 0 is never taken into account for bi, bone_index in enumerate(bone_indices): if bone_index == 0 and ( (mesh.vertex_format not in (0xC31F201C,) and mod.header.num_bones != 1) ): # no root bone, 0 is acceptable continue

Example of problematic vertices in pl2203.mod_0083

image
image
image

Textures not exported

Steps to reproduce

  1. Import a model from RE5, e.g. uPl00ChrisNormal.arc
  2. Delete all meshes, leaving the armature
  3. Import another model, e.g. uPl03WeskerCos1.arc
  4. Delete weight groups and modifiers from the last model imported, and its armature. Parent the meshes to the first imported armature, with automatic weights
  5. Export the armature with the new model, and import it again

Expected behavior: the exported model contains valid reference to textures
Observed behavior: the exported model points to non-existent texture paths, making them not visible.

Add icons to file explorer

Icons in the file explorer for 3d models, materials, textures and animations can provide a good visual aid on what's importable, instead of all items using gray dots.

Image

Improve error handling

When something goes wrong at any time during loading, importing or exporting a model, the user is presented with a code traceback. Maybe the exception has a useful message, but most of the time it doesn't.

Refactor entrypoints so all exceptions are handled globally, with a useful pop-up that not only states the problem but recommends a solution. If the error is unexpected (e.g. no solution is recorded), the traceback must be shown with the pop-up.
The pop-up should include a link to github issues and discord support channel.

Export: Ignore empty vertex groups

If there's a single empty vertex group, e.g., a vertex group with no weights assigned the export will fail with an obscure traceback.

Error: Python: Traceback (most recent call last):
  File "/blender/3.6/scripts/addons/albam/blender_ui/export_panel.py", line 224, in execute
    self._execute(item)
  File "/blender/3.6/scripts/addons/albam/blender_ui/export_panel.py", line 234, in _execute
    vfiles = export_function(item.bl_object)
  File "/blender/3.6/scripts/addons/albam/engines/mtfw/mesh.py", line 733, in export_mod
    _serialize_meshes_data(bl_obj, bl_meshes, src_mod, dst_mod, materials_map, bone_palettes))
  File "/blender/3.6/scripts/addons/albam/engines/mtfw/mesh.py", line 1164, in _serialize_meshes_data
    mesh_weight_bounds = _calculate_weight_bounds(
  File "/blender/3.6/scripts/addons/albam/engines/mtfw/mesh.py", line 1486, in _calculate_weight_bounds
    weight_bound = _calculate_vertex_group_weight_bound(
  File "/blender/3.6/scripts/addons/albam/engines/mtfw/mesh.py", line 1602, in _calculate_vertex_group_weight_bound
    min_x = min((v[0] for v in vertices_in_group_bone_space))
ValueError: min() arg is an empty sequence

It won´t tell you which mesh, and it will keep failing until all are fixed.

The albam_reloaded tool "Remove empty vertex groups" is almost mandatory then, providing a terrible user experience for first-time users . Empty weight groups can be safely ignored.

Import unpacked files

Currently only packed files can be imported[1]. However, many games can be modded using unpacked assets as well. This is very useful when games are distributed in single huge packed file instead of many small ones. It allows to leave the main packed file untouched. See for example the "first natives" tool. Additionally, not all final files are actually packed in games[2].

The only requirement to implement this is for the user to provide the "root" folder to search for references in the files imported. For example, texture paths in a materials file.

[1] Actually, mod files can be imported, but are currently filtered out by the glob pattern of "*.arc". They will be imported without materials though, since the virtual file system won't be constructed without a packed file (.arc).

[2] Note that many mods are meant to be installed unpacked, but they are distributed packed, for example, in a rar file. Providing support for packing/unpacking common archives could actually make this feature less useful.

Weird artifacts in exported models

Game

Resident Evil 5

Example game file names

Any

Blender version

2.76, 2.77, 2.78

Albam version

develop 0.3 alpha at commit 913b03e

Observed behavior

When exporting importing and then exporting a game character without any modifications, weird artifacts appear in some parts, probably caused by bad normals.

Expected behavior

Normals should be exported fine

Steps to reproduce

Import and export ShebaNormal and check some in game cut-scenes. Her chin has a clear glitch, as well as some other parts of her body.

20170807063723_1

Apply transforms automatically when exporting

Currently, before exporting a model, transforms on each objects must be applied. If not, the model would look terrible in-game, leaving the poor user clueless on what went wrong, since the model would look perfectly fine in Blender.

Now, I don't know if transforms should be applied to the model directly, since exporting must be a non disruptive function. An option would be to make a copy of the mesh, apply transforms and export.

Exporting: Original model deformed after export

Game

Resident Evil 5

Example game file names

uPl00ChrisNormal.arc
uPl00ChrisCos1.arc

Blender version

2.78

Albam version

0.3-testing

Observed behavior

Model is deformed, finger and eye placement doesn't match, neck is streched after export.
comparison

Expected behavior

Model should be the same as the original.

Steps to reproduce

Import a model and export without changes.

Improve modding workflow while exporting

Currently, modding the only game available, Resident Evil 5, sucks.
The process of importing a model, deleting all meshes and skin meshes from another model could use a lot of improvements.
The process should be simple for a modder and all conversions should be done automatically while possible, or at least provide some tools to do so.

Draft ideas

  • Albam Mesh Tools When selecting a mesh, show info and buttons to change:

    • Quantity of bones influencing the mesh (eg, Mod156 max 32 per mesh)
    • Quantity of bones with no weights linked to the mesh (empty vertex groups)
    • Rotation/Location/Scaled applied
    • Textures per mesh
    • Belongs to an Albam imported item? If so, display which game
  • Default unk values with a new mesh (selector for type of game?)

  • Sanity checker before export:

    • max bones per mesh
    • max textures per mesh
    • texture types per mesh
    • Scale/rotate/location applied
    • All meshes are triangulated

Exception in certain situations while trying to export: context is incorrect

Game

Resident Evil 5

Example game file names

Any

Blender version

2.76

Albam version

develop at commit 913b03e (probably reproducible in 0.1)

Observed behavior

Exception thrown when trying to export a model

Traceback (most recent call last):
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/blender.py", line 188, in execute
    bpy.ops.object.mode_set(mode='OBJECT')
  File "/opt/blender-2.76b/2.76/scripts/modules/bpy/ops.py", line 189, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.object.mode_set.poll() failed, context is incorrect

location: <unknown location>:-1

Expected behavior

No exceptions, of course.

Steps to reproduce

  1. Open a model ready to export
  2. Delete part a mesh of that model
  3. Click on export

Exporting: In game characters heads show in cutscenes

Game

Resident Evil 5

When importing/exporting any character that appears in a cut-scene, two heads appear: the in-game head and the more detailed/high poly head for cut-scenes. Only the latter should should.
It was observed that this is a setting apparently controlled by' Mod156.group_data_array; every mesh has an index to a member then, in Mesh156.group_index, which could be renamed to 'RenderOptions', probably.

5-3 cutscene Wesker invisible (except head) when exported

Resident Evil 5 Gold Edition

With uEm80_arc

Blender version 2.78

Albam version 0.3.0

Observed behavior

After doing any edit to Wesker his body appears invisible in the 5-3 cutscene. In gameplay it's fine.

Additionally, the originally intended model appears for a split second, possibly suggesting is a LOD issue.

Expected behavior

The body should show.

Steps to reproduce

Import and export Wesker.
20200721192200_1
20200721192203_1
20200721165614_1

Import / Export Errors on recent versions + below 2.78 + Blender 2.8

Game

Resident Evil 5

Example game file names

Every Upl ARC file.

Blender version

Below 2.78 and Blender 2.8

Albam version

0.3.0

Observed behavior

I think the description should say 2.78 and above because I tried with 2.70 and below 2.78 and all of them had issues which make the plugin unusable on these versions, later versions told me the plugin is made for 2.78 - which the plugin works fine on.

Trying it on the upcoming Blender 2.8 (experimental builds) and there seems no issue on import at all but an error is given on export.

Expected behavior

It should export fine without errors (but I don't expect it to import/export on versions below 2.78).
But export bug should be fixed for future Blender (2.8) releases perhaps.

Exporting: Blender crash

Game

Resident Evil 5

Example game file names

uPl02JillCos2.arc

Blender version

2.79

Albam version

0.3.0-testing

Observed behavior

Blender crashes when exporting.

Expected behavior

Error message should come up.

Steps to reproduce

Download:
crash.zip
then click export.

No shadows exported

Game

Resident Evil 5

There's a flag for a mesh to cast shadows that is not being used.
The problem with Blender is that the option to cast shadow is per material and not per mesh. It's unknown if there's any case where 2 meshes share the same material but they have different cast shadows options. However, it shouldn't be a big issue.

Wrong materials exported

Game

Resident Evil 5

Example game file names

Resident Evil 5/nativePC_MT/Image/Archive/uPl00ChrisNormal.arc

Blender version

2.77

Albam version

0.0.1

Observed behavior

When exporting the model back to the game, the materials look different:
No shadows are are casted, specularity and roughness seems off.

Expected behavior

Shadows should show always if the original model had them, as well as the materials should look fine when just importing//exporting.

Steps to reproduce

Import and export the example file and play the game.

Issues when modding

Some issues from a conversation with knabsi. This is a draft issue that needs to be split when each issue is confirmed and reproducible.
Knabsi writes:

the weight one was a problem, the UV Mesh was the biggest problem, exporting with mote than ** textures problem. (idk the exact number) the disapearing problem when aiming (is being looked at, awesome). importing DLC characters does not seem to work, test it yourself. Exporting with more than 1 material on a mesh causes blender to crash for me
cant think of anything else as of yet

Unedited Exported model has errors such as inverted normals and broken mesh

This character issue doesn't persist to 0.3.0 therefore the issue has been closed.
Other characters well be tested and any issues will be reported if issues come using 0.3.0

Resident Evil 5 (Gold Edition)

uPl02JillCos2 (Mercenaries Model)

Also tried desperate escape model and got a different set of issues such as much more blatant deformed mesh and much less present inverted normals.

Blender version 2.78

Albam 0.2.0

Observed behavior

Even with no edits to the character model/mesh, exporting this imported model brings about numerous issues. These issues seem to be consistent though as this has been tried 4 times and the export issues seem to be the exact same for each time.

Expected behavior

With an unedited model it is expected to have no issues but even leaving the model completely untouched, exporting it as an .arc messes the model up ingame. In blender, there are no noticeable problems.

Steps to reproduce

Import model and export it. (Jillcos2)
b
a
c

Bone groups and layers importing albam.engines.mtframework.Mod156

Mod156 has a field called unk_13 that is a fixed array of 256 bytes. It turns out it's actually a mapping used for animations. Apparently, every index represents a hard-coded bone type.
For example, based on uPl00ChrisNormal.arc->pl0000.mod and uPl01ShebaNormal.arc->pl0100.mod, indices 16 and 20 represent the upper left and right leg respectively. This can be confirmed parsing both mod files and taking the bone indices visually when they were imported:

>>> from albam.engines.mtframework import Mod156
>>> mod = Mod156('pl0000.mod')
>>> mod2 = Mod156('pl0100.mod')
>>> chris_right_leg = 112  # taken from blender
>>> chris_left_leg = 117
>>> sheva_right_leg = 2
>>> sheva_left_leg = 8
>>> assert list(mod.unk_13).index(chris_right_leg) == list(mod2.unk_13).index(sheva_right_leg)
>>> assert list(mod.unk_13).index(chris_left_leg) == list(mod2.unk_13).index(sheva_left_leg)

Knowing this, it would be useful for modding to classify them all and create bone groups and layers.
For example, the first layer should include the most important bone: spine, legs, arms, head bone, etc.
This way, automatic weighting can also be done in layers, refining or omitting more detailed bones.

Bounding box precision errors

In some cases while exporting a new model for RE5, the precision will make some vertices be larger than 1.0, making the number go above 32767.
See albam.engines.mtframework.utils.vertices_export_locations

Count only vertex groups with influence when exporting

A behavior I noticed when applying armature parent with automatic weights to models is that all bones create an entry in the vertex groups for every mesh, even if the mesh is not influenced for the vertex group of the bone. When exporting RE5 models, it seems all vertex groups are used and hence the 32 bone limit per mesh is reached. When exporing, only the vertex groups that have a weight > 0 should be exported only.

Exporting a model with a mesh with no uv's fails.

Traceback (most recent call last):
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/blender.py", line 103, in execute
    func(obj, self.filepath)
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/mtframework/blender_export.py", line 75, in export_arc
    mod, textures = export_mod156(child)
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/mtframework/blender_export.py", line 144, in export_mod156
    materials_mapping)
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/mtframework/blender_export.py", line 377, in _export_meshes
    vertices_array = _export_vertices(blender_mesh_ob, bounding_box, mesh_index, bone_palette)
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/mtframework/blender_export.py", line 220, in _export_vertices
    uvs_per_vertex = get_uvs_per_vertex(blender_mesh_object.data, blender_mesh_object.data.uv_layers[0])
IndexError: bpy_prop_collection[index]: index 0 out of range, size 0

ZeroDivisionError in bone weights exporting

Game

Resident Evil 5

Example game file names

Any

Blender version

2.78c

Albam version

0.2.0

Observed behavior

Looking at the code in albam.engines.mtframework.blender_export._export_vertices, clearly there's a case where a ZeroDivisionError might happen. More specifically, a vertex with no weights.

Expected behavior

No ZeroDivisionError exceptions thrown, handle the case and print a warning if necessary

Steps to reproduce

Should upload a file.

Exporting meshes with vertices influenced by more than 5 bones

Game

Resident Evil 5

The meshes become invisible. This requires more research or a workaround to discard the the bones that influence the vertex the least, up to 4. The latter option is not ideal, but might be acceptable. The question is how much the quality might change in the exported mesh and what kind of vertex really needs to be influenced by more than 4 bones.

Copy-paste between custom properties

Per-app custom properties in materials, meshes, and texture are long and tedious to copy manually. Defaults values are often not good enough.
Implement a copy/paste functionality like Albam_reloaded

Image

Exporting a model in edit mode fails

When attempting to export a model, if any mesh is in edit mode, the addon will fail

Traceback (most recent call last):
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/blender.py", line 103, in execute
    func(obj, self.filepath)
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/mtframework/blender_export.py", line 75, in export_arc
    mod, textures = export_mod156(child)
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/mtframework/blender_export.py", line 144, in export_mod156
    materials_mapping)
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/mtframework/blender_export.py", line 377, in _export_meshes
    vertices_array = _export_vertices(blender_mesh_ob, bounding_box, mesh_index, bone_palette)
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/mtframework/blender_export.py", line 220, in _export_vertices
    uvs_per_vertex = get_uvs_per_vertex(blender_mesh_object.data, blender_mesh_object.data.uv_layers[0])
  File "/home/sysop/.config/blender/2.76/scripts/addons/albam/utils.py", line 368, in get_uvs_per_vertex
    uvs = uvs_per_loop[i].uv
IndexError: bpy_prop_collection[index]: index 0 out of range, size 0

Bad normals when exporting

Game

Resident Evil 5

Example game file names

Any

Blender version

2.78

Albam version

0.2.0

Observed behavior

All normals are having the same value, making the models look weird in any lighting condition

Expected behavior

Normals are exported fine.

Steps to reproduce

Import and export a model without touching it, see them in game or in the Figures section.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.