Skip to content

Final replace call in export_mesh causes wrong mesh name #66

Closed

Description

@AutumnSun1996

Found a small bug in export_mesh: the final replace call will replace all 'e' with 'E'.

sb = "".join(sb).replace("NaN", "0").replace("e", "E")

When there are lower 'e' in mesh name, it will also be replaced.

This replace clause is trying to convert numbers like '1e5'? maybe these conversions should be done separately for each line.

Activity

  1. AutumnSun1996 commented on Aug 2, 2021

    @AutumnSun1996
    ContributorAuthor

    The replace("NaN", "0") will cause 'NaN' in name be wrongly converted, too.
    And it also seems to be useless since '{}'.format(float('nan')) == 'nan'.

    Use '{:G}'.format(1e21) will gives us 1E21, so replace("e", "E") can be removed if we update the format str.

    Still have to handle the "NAN". And, do we have to take "INF" and "-INF" into consider?

  2. K0lb3 commented on Oct 15, 2021

    @K0lb3
    Owner

    Sorry that I forgot to reply.

    The replace("NaN", "0") will cause 'NaN' in name be wrongly converted, too.

    NaN is replaced with 0 because AssetStudio does so as well, see here.
    I'm not sure why either, but considering that it gets way more reports about such issues, it's probably correct for whatever reason.

    And it also seems to be useless since '{}'.format(float('nan')) == 'nan'.

    Indeed, I just noticed that as well -.-'

    Use '{:G}'.format(1e21) will gives us 1E21, so replace("e", "E") can be removed if we update the format str.

    That seems to be the best solution.

  3. added a commit that references this issue on Sep 14, 2025
    5f5f497
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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