+1 vote

In godot you can covert a Sprite to a MeshInstance2D using a menu in the editor. What I want to know is if there is a way to do this in gdscript. I have Sprites that aren't created till runtime that I would like to convert to MeshInstance2Ds after their creation. Is there a way to do this conversion using gdscript or is it only available through the editor?

in Engine by (18 points)
edited by

1 Answer

+1 vote

I was looking for the same just now but there are no relevant info about it. I check it directly on the Github project and unfortunately the code for calculating the mesh vertices is build-into the Editor's code which means that it's only available through the Editor. If someone wants to check the implementation the source was located at: editor/plugins/sprite2deditor_plugin.cpp on Godot project

by (16 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.