Skip to content

[WIP] [Model] Add "load model from code" feature#3

Open
w0wca7a wants to merge 8 commits intofeaturesfrom
ModelImporterFeature
Open

[WIP] [Model] Add "load model from code" feature#3
w0wca7a wants to merge 8 commits intofeaturesfrom
ModelImporterFeature

Conversation

@w0wca7a
Copy link
Copy Markdown
Owner

@w0wca7a w0wca7a commented Apr 4, 2026

PR Details

Enables loading 3D models (FBX, GLTF, OBJ, etc.) at runtime directly from code using MeshConverter, without requiring asset compilation or ContentManager.

Usage example:

using Stride.Core.Mathematics;
using Stride.Engine;
using Stride.Importer.ThreeD;

public class FileImporter : StartupScript
{
    public override void Start()
    {
        base.Start();
        if (Entity.Scene == null) return;

        string InputFile = "C:\\Users\\damzi\\Desktop\\andryuha\\andryuha\\Resources\\female.Fbx";
        var model = ModelBuilder.CreateFromFile(GraphicsDevice, InputFile);
        var modelComponent = new ModelComponent(model);
        var importedEntity = new Entity("Imported", position: new Vector3(0, 1, 0)) { modelComponent };
        Entity.Scene.Entities.Add(importedEntity);
    }
}

Related Issue

N/A

Importan NOTE

At this time model can not be unload and load again #2101

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

Add model loading from code
@w0wca7a w0wca7a changed the title Update MeshConverter.cs [Model] Add runtime model loading Apr 4, 2026
@w0wca7a w0wca7a changed the title [Model] Add runtime model loading [Model] Add "load model from code" feature Apr 8, 2026
@w0wca7a w0wca7a changed the title [Model] Add "load model from code" feature [WP] [Model] Add "load model from code" feature Apr 8, 2026
@w0wca7a w0wca7a changed the title [WP] [Model] Add "load model from code" feature [WIP] [Model] Add "load model from code" feature Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant