Godot: 2D mesh-based sprite deformation

Created on 25 Nov 2015  Â·  40Comments  Â·  Source: godotengine/godot

This would certainly be a lovely feature to add in Godot ;)
And maybe not THAT difficult... Maybe it could already be done with GDScript.

https://www.youtube.com/watch?v=rw6wNRdmBpU

feature proposal core

Most helpful comment

Hello,

Just a quick update for you guys. I just checked in the Creature Animation Tool's Godot Plugin here:
https://github.com/kestrelm/Creature_Godot

The plugin does full on mesh deformation of course for animation.
Creature animations are all mesh deformations in nature. The plugin includes a sample project with a running raptor dinosaur. It also includes docs and a video tutorial.

Cheers

All 40 comments

+1 This feature would really enhance the quality of cut out animations made in Godot.

planned for 1.1

On Mon, Nov 30, 2015 at 2:15 PM, Maximillian [email protected]
wrote:

+1 This feature would really enhance the quality of cut out animations
made in Godot.

—
Reply to this email directly or view it on GitHub
https://github.com/godotengine/godot/issues/2914#issuecomment-160693584.

err 2.1

On Mon, Nov 30, 2015 at 2:51 PM, Juan Linietsky [email protected] wrote:

planned for 1.1

On Mon, Nov 30, 2015 at 2:15 PM, Maximillian [email protected]
wrote:

+1 This feature would really enhance the quality of cut out animations
made in Godot.

—
Reply to this email directly or view it on GitHub
https://github.com/godotengine/godot/issues/2914#issuecomment-160693584
.

Hi,
is there any possiblity to add an Spine2D animation importer to this, I think Mesh deformation was the only feature missing between Godot and Spine animations.
Thanks

once this is supported it may be interesting to try a spine2d importer

+1 on the Spine2D importer, that would be great, I have a license and can help you with the testing (but Im pretty sure that Spine Developers would probably also give you some licenses reduz, to help you integrate with Godot, they are also a very nice indie community)

Note that there is still this PR pending for Spine animations: #1734

In my opinion, instead of using proprietary apps, use blender:
https://www.youtube.com/watch?v=uoQZV1f_J1s

@alabd14313 No one talks about using proprietary apps here (why would we anyway? I don't understand your statement.).
This Andreas Esau's plugin for Blender is indeed great, however as he tells it himself at the end of the video you linked, nothing can be exported to Godot from it, unfortunately.

Thus, this functionality should be integrated into Godot directly, imo. I don't think Andreas Esau would be against the idea to use his work and put it into Godot ;) .

I just wanted to mention that in the realms of proprietary apps, Spriter is also a nice solution.
And i think godot and Spriter have feature parity or almost.
Why would you use one instead of the other? interface mainly i think.
And also, with Spriter the animations you make can -also- be export as a bunch of things, which is a plus.

Heck, since we're talking animation I'm going to throw in the most annoying animation package, synfig... But hey, it's free :-P

Well, I have an update on Andreas' work. He made a Godot importer so... :) https://www.youtube.com/watch?v=krCYZ7BPdCI

Blender supports this type of deformation and if i remember correctly so does ndee's addon. Once godot gets it too, its very likely that he adds it to his exporter. Spine2d has a very expensive license. I use spriter myself, but would gladly use andreas' addon for godot - because i am very used to blender

@reduz said on fb that this is being postponed to 3.0

The plan is to add support for 2D meshes, but we'll have to wait for 3.0
for this as we'll do it with the new renderer'

On Sun, Feb 21, 2016 at 4:02 PM, Todor Imreorov [email protected]
wrote:

@reduz https://github.com/reduz said on fb that this is being postponed
to 3.0

—
Reply to this email directly or view it on GitHub
https://github.com/godotengine/godot/issues/2914#issuecomment-186889428.

New renderer :) , I was really hopping for the mesh deformation and if it was possible some Spine support, but if you are going for a new renderer, Im all for it (please include vulkan support)

it will take a few years until vulkan is stable. Please use something more established

Hello,

Just a quick update for you guys. I just checked in the Creature Animation Tool's Godot Plugin here:
https://github.com/kestrelm/Creature_Godot

The plugin does full on mesh deformation of course for animation.
Creature animations are all mesh deformations in nature. The plugin includes a sample project with a running raptor dinosaur. It also includes docs and a video tutorial.

Cheers

The plugin by @kestrelm is awesome and quite performant. For anyone not willing to wait for 3, i highly recommend giving Creature a try instead of waiting.

there are example files provided with it. :+1:

As mentioned above, this was postponed to 3.0

I'm working on _MessDeform_:
with_mess_deform

I've posted the whole announcement at Godot Q&A.

@RandomShaper Thank you for sharing this.
First of all , clicking on the link leads to a not found 404. Let me fix that:

https://godotengine.org/qa/7487/messdeform-hacky-deformable-mesh-engine-for-godot

Its because of that dot you added at the end of the url.
The gif looks promising, but some of the deformations are pretty bad. In your solution, is it possible to control skin weights?
How exactly does one set up a 2d mesh?

Link fixed.

Each segment (from head to front foot, each arm and the back leg) is a hierarchy of pieces. Each piece is a Polygon2D with four vertices.

_MessDeform_ moves the vertices of parent and child polygons so that they match. In other words, it moves parent vertices toward child's and vice versa. You can control how close the new location is to the unadjusted vertex of parent or child with a weight parameter. But in practice, exception made of some cases like torso-head, 0.5 is the best value to avoid even bigger distortion.

I'm planning on implementing some kind of tesselation because I believe the greater the number of pieces the less the distortion.

Anyway, as it is now it doesn't need to improve too much for my use case so I probably won't devote a lot of time to this plugin unless the community tells me otherwise.

Anyway, I think this conversation should continue on the Q&A site to avoid flooding here. If you agree, please publish your same post there and I will put my answer again so information doesn't scatter.

I'm posting info/updates in the forum so I won't update here since this is no place for this.

There was a suggestion on #8477by @WalasPrime, which is to have a MeshInstance2D node, which would allow one to use regular openGL primitives in 2D scenes. Quote:

Basically there is no way to use OpenGL primitives in 2D, while in 3D you can use the SurfaceTool and a MeshInstance. Polygon2D is limited (still it is useful), and it also assumes edges do not intersect with eachother (also you can't render with PRIMITIVE_LINE_STRIP for example).

2D Meshes might make use of the Z coordinate, so basically only a MeshInstance2D would be needed (SurfaceTool, MeshDataTool could stay the same).

Not sure how useful or crashy the Z-coordinate thing would be, but we can probably just force Z=0 on all vertexes (by, for example, scaling the matrix), if it is a problem.

perhaps it's best to look into the already available spine2d and creature2d runtimes for a performant implementation example with useful features - like skins in spine2d - ability to reuse animation between different characters without making copies of it, ability to swap a collection of body parts easily (armor), ability to dynamically drive some of the bones (for physics or aim constraint)

All that is good stuff to have. But I guess the main one is mesh deformation and that entails adding new editor features - like an editor to turn a sprite into a mesh and another one to paint skinning weights of bones..

Btw opentoonz also has z-coordinate of bones on a single mesh and they work quite beautifully. You can animate a hand going behind the body of a character easily, without any need to change the hierarchy structure.
Without that ability, you are forced to make ugly workarounds to meet some very basic and common animation needs

kicking again to 3.1

it's been a long time coming... that Spine2D importer can come soon enough ;)
gimme some metroidvania bosses effects and animations!!!

Hello,

So Creature now has support for Skin/Item Swapping as well:
https://twitter.com/KestrelmMoon/status/883026439372587008

I will be happy to help port the Creature runtimes for Godot to 3.1 when it is ready along with the latest features:
https://twitter.com/KestrelmMoon/status/890687376112066560

Creature, being a 100% Mesh based 2D solution, should be able to show off your engine quite a bit :)

Cheers

For 3.0 it will be easy to integrate the runtime via GDNative

On Fri, Aug 4, 2017 at 4:59 PM, Kestrel Moon Studios <
[email protected]> wrote:

Hello,

So Creature now has support for Skin/Item Swapping as well:
https://twitter.com/KestrelmMoon/status/883026439372587008

I will be happy to port the Creature runtimes for Godot to 3.1 when it is
ready along with the latest features:
https://twitter.com/KestrelmMoon/status/890687376112066560

Cheers

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/2914#issuecomment-320339964,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z215lOEqUdEywKRVVvTVkjxsPkSE1ks5sU3gagaJpZM4Gpg1w
.

@reduz Sounds great! Looking forward to it. Will be reading into the docs online soon.

Cheers

@kestrelm Using GDnative for integration also makes the runtime way more accessible to users, as it will eliminate the need to recompile godot with it - in order to use it.
Instead all they would have to do is simply copy it to a folder :D

I saw the skinswap demo video and am very excited about getting these new features in godot 3.0

Thank you for making this available in Godot

@blurymind Yes indeed, I am waiting for 3.0 to be stable with proper docs before I can start. Looking forward to the stable release of Godot 3.

Creature for Godot 3 is almost ready, will be making a release with docs soon:
https://twitter.com/KestrelmMoon/status/923778463424581632

Cheers

I still hope 2D mesh deformation will find it's way into Godot 3.1
Creature is barely an alternative, since it's proprietary software.

I hope even if Godot gets an importer for popular animation tools, it will still get its own native mesh deformation solution.

mesh 2d is now implemented and working.
so this can get closed I guess

I agree

Was this page helpful?
0 / 5 - 0 ratings