OpenSAGE / OpenSAGE.BlenderPlugin

A Westwood 3D Blender plugin. Imports & exports the W3D/W3X format to/from Blender.
https://opensage.github.io
GNU Lesser General Public License v3.0
50 stars 18 forks source link

Support 2nd UV map, file import logic optimization #256

Closed nkx111 closed 1 year ago

nkx111 commented 1 year ago

This PR include many updates:

  1. Texture names are treated correctly as the Asset Name, not the file name. For example:
    <FXShader ShaderName="BuildingsAllied.fx">
            <Constants>
                <Texture Name="DiffuseTexture">
                    <Value>AUMCV</Value>
                </Texture>
    ...

    Here AUMCV is the name of the asset Texture defined somewhere else. The output should not be like "AUMCV.dds" as it was before.

  2. When exporting w3x, the Include sections for texture xml will only be generated when the option "Create texture xml files" is on.
  3. Shader property: Material.edge_fade_out changed to float. Added shader property: DamagedTexture
  4. Support 2nd UV maps! https://github.com/OpenSAGE/OpenSAGE.BlenderPlugin/issues/32 . However this is still not perfect since the user need to switch manually between them.
  5. Optimize the file import logic: it will find containers/hierarchies with certain bibber naming format(i.e., _CTR, _HRC, _SKN). When loading animations, it will also look for the armatures in the current scene.
  6. Fix a bug when opening multiple files with same mesh name. The bug is because that blender will automatically append ".001 .002" suffix to the newly created meshes, which makes it wrong when finding corresponding armatures.
feliwir commented 1 year ago

Thanks for your work already! @Tarcontar and I will have a "coding weekend" in 2 weeks, we'll hopefully be able to look at this in depth

Tarcontar commented 1 year ago

Thank you very much! :)