Skip to content

[v4.0.0-beta.8] Unable to save scene after importing .babylon meshes with colon (':') in material names #226

@vouse-cph

Description

@vouse-cph

When importing meshes of the .babylon format, the editor sometimes ends up with the "Saving materials" message with the progress spinner spinning indefinitely afterwords.

In the console, the editor reports an error along the lines of "[ERROR]: Failed to parse material "<material_name>.json", but continues parsing the rest of the materials.

The real problem is when you close the editor and open up the scene again, the assets and changes you made to the scene before you imported the .babylon asset, losing whatever progress you made before that. The thing is, you can still build the scene and run it in the browser properly, but it just isn't being parsed and saved in the project properly.

I think I've narrowed down to the names of the material of the .babylon mesh, as the error messages always make reference to material names such as "Character_5_Idle1:Mat_F_Character8c-93298etc.json", with the colon in the middle. It might be how the JSON parser is reading the name, and how it handles unexpected colons that's causing the problem, but it's preventing the editor from saving the scene entirely.

This might extend to other parts of the mesh attributes too, like joint names and animation names, since they're being saved in a similar way, but I haven't looked into it yet.

BabylonJS_Editor_2020-11-06_11-17-20

Metadata

Metadata

Assignees

No one assigned

    Labels

    To DeployFixed and must be deployedbug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions