Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stl import at runtime #25

Open
Narfath opened this issue Feb 20, 2022 · 2 comments
Open

Stl import at runtime #25

Narfath opened this issue Feb 20, 2022 · 2 comments

Comments

@Narfath
Copy link

Narfath commented Feb 20, 2022

I have a question how should I execute the import script during runtime?

I give the path to the Importer.Import() method but nothing happens.
Is there any other parameter that I should add to the method besides the path?

@Narfath Narfath closed this as completed May 17, 2022
@Narfath Narfath reopened this May 18, 2022
@braneof
Copy link

braneof commented Apr 26, 2023

I haven't tried it, but this fork updated the importer, so maybe they fixed it: https://github.com/JohnGames/pb_Stl

@Orinion
Copy link

Orinion commented Feb 27, 2024

You also have to send the mesh to a meshfilter if you want to render it

    var mesh = Importer.Import(pathToFile)[0];
    var meshFilter = new GameObject().AddComponent<MeshRenderer>().GetComponent<MeshFilter>();
    meshFilter.sharedMesh = mesh;

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

No branches or pull requests

3 participants