Skip to content

Re-exporting GFS: 'Mesh' object has no attribute 'calc_normals_split' #168

@ShrineFox

Description

@ShrineFox

Describe the bug
When I import F051_090_0.GFS from P5R and re-export, even without any changes, this exception occurs immediately and export fails.

Traceback (most recent call last):
  File "C:\Users\Ryan\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\BlenderToolsForGFS-develop\src\BlenderIO\modelUtilsTest\Misc\Errorlog\Handler.py", line 10, in handled_execute
    return function(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Ryan\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\BlenderToolsForGFS-develop\src\BlenderIO\Export\Operator.py", line 183, in export_file
    bpy_material_names = export_mesh_data(gfs, selected_model, bpy_to_gfs_nodes, full_rest_pose_matrices, errorlog, self.policies)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Ryan\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\BlenderToolsForGFS-develop\src\BlenderIO\Export\ExportModel\Mesh.py", line 54, in export_mesh_data
    gfs_meshes.append(create_mesh(gfs, bpy_mesh_object, armature, node_id, material_names, material_index, version, errorlog, export_policies))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Ryan\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\BlenderToolsForGFS-develop\src\BlenderIO\Export\ExportModel\Mesh.py", line 241, in create_mesh
    mesh_buffers = extract_vertices(bpy_mesh_object, material_index, bone_names, version, errorlog, export_policies)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Ryan\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\BlenderToolsForGFS-develop\src\BlenderIO\Export\ExportModel\Vertices.py", line 36, in extract_vertices
    bpy_mesh.calc_normals_split()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Mesh' object has no attribute 'calc_normals_split'

To Reproduce
Steps to reproduce the behavior:

  1. Import F051_090_0.GFS
  2. Export as new GMD

Expected behavior
The new GMD should be saved without an exception occurring.

Files
MODEL\FIELD_TEX\F051_090_0.GFS
F051_090_0.zip

Additional context
It appears Mesh.calc_normals_split() has been removed from the Blender Python API after 4.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions