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

Polygon2d editor- Ability to Add/remove/move internal vertices - edit topology #20601

Closed
blurymind opened this issue Jul 30, 2018 · 32 comments
Closed

Comments

@blurymind
Copy link

blurymind commented Jul 30, 2018

Godot version:

3.0.6

Request description:
This is a request to add the ability to have internal vertices on polygon2d shapes. The feature is required for a 2d skeleton deformation workflow - specifically for animations that fake head/torso turning.
It can also be used for facial animations.

here is an example of that in spine2d:
https://youtu.be/0Dd2M8XBTo0?t=8m56s
and
https://www.youtube.com/watch?v=Whe2qvEiZds

download

In general, Godot currently can only do very simple mesh deformation animations. The end result will always feel a bit stiff without the ability to have deformation inside the mesh - internal vertices

It's a huge limitation

@vnen
Copy link
Member

vnen commented Jul 30, 2018

I think this is solved by the 2D skeletal deform (which is a 3.1 feature): https://godotengine.org/article/godot-gets-2d-skeletal-deform

@blurymind
Copy link
Author

blurymind commented Jul 30, 2018

@vnen what do you do if you want to animate the robot's eyebrows with an extra bone then? :/
untitled
Can we add vertices on his face?
This is a simple example, you have no other choice but to use internal vertices in more complicated cases.

Right now you can only add them to the silhouette , which sucks a lot for animators - its a huge limitation on creativity.

..or am I missing something?

@Ranoller
Copy link
Contributor

Ranoller commented Jul 30, 2018

I ask for this in every patreon poll after Skeleton2D commit. I hope it will be considerated. It´s a must have to bone animation.

Thing that are not hard (Actually exist but are hidden):

  • Show internal triangulation between vertices.

Things that can be hard:

  • Hability to draw lines inside that polygon (not split point-to point), and recalculating the triangulation with this internal lines.

  • Hability to move that points in runtime with animationplayer or code to do this:

https://www.youtube.com/watch?v=Sul-lc9D-8I (Sec 0:24)

https://www.youtube.com/watch?v=3mC9suxK6zM (Sec 0:42)

This is very clear (min 1:46):

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

@blurymind
Copy link
Author

blurymind commented Jul 30, 2018

I wonder why @reduz decided to hide internal triangulation by default

To me just creating internal vertices (inside the silhouette's volume) and binding them to a controller bone would be good enough

Hiding the triangulation, and not allowing internal vertices to be controlled seems like a huge problem

@blurymind
Copy link
Author

Here is an example of animation that is only possible with internal vertices
giggphy

@blurymind
Copy link
Author

blurymind commented Aug 11, 2018

Another side effect of not being able to split edges both vertically and horizontally - have internal vertices is this horrible deformation:
terriblesplits
Notice how pixels suddenly cut in the middle

If we could set weights on internal vertices we would also be able to get much better controlled deformations and avoid this problem naturally.

This is too rough to be used in production imo

@akien-mga akien-mga changed the title Request - Polygon2d node - ability to add internal vertices Polygon2d node - ability to add internal vertices Aug 15, 2018
@insomniacUNDERSCORElemon

This'd be great for just vector art as well, color-per face and much better vertex coloring! (particularly with an actual vertex painter)

I mean a faceted style currently is possible but you need to use multiple polygons (and likely more vertices), using partial transparency can make things a bit easier in some cases (but that brings its own issues as well). Meshes would make creation of anything complex much easier and faster, as well as being actually viable to edit later.

I talk about this (and Godot's polygon AA+expansion of polygon features) in this post that I made on r/godot. Including a test project with different experiments with Godot's polygons (vertex colors, animations/movement, scaling, textures+texture warps, 1 animated collision mesh, etc).

@blurymind
Copy link
Author

blurymind commented Aug 27, 2018

To me the biggest problem with this is that the artist using it is always forced to produce subpar results with ugly skin deformations.
Everyone will continue to choose dragonbones or spine over this - simply because on the very basic level it fails to be a better option

Vertex colors and turning svg files into polygon meshes is a whole other thing, that is just a pie in the sky atm. This is what Unity3d is doing atm btw. If you look at games like Night in the woods - cartoony 2d game made in unity- its all polygons moved by armatures

@ghost
Copy link

ghost commented Sep 1, 2018

@blurymind Will make this my next suggestion / vote for the upcoming Patron polling.

Skeletal2D is something we really want to make use of, but so far it hasn't been functioning at all, and seems to lack basic features.

@blurymind
Copy link
Author

blurymind commented Sep 2, 2018

@avencherus
Thank you. Hopefully it will be addressed before the official 3.1 stable release.

To add more to the examples..

Dragonbones has a great mesh editor:
mesh_deform
it can automatically generate an initial mesh and it has tools to edit it -It allows to add vertices, split edges..

Here is an animation that would be impossible to do without internal vertices
vj1de6j

1bdc40f78296a816bf5ba928b76799c9_original

That sort of torso/head turning is key to creating a better skeletal animation

@ghost
Copy link

ghost commented Sep 2, 2018

@blurymind It's not a problem. X) I am glad someone else here is interested in this feature and vocal about what it needs.

When it comes to 2D, I feel like this an area where Godot unfortunately lags very far behind many of the other engines and tools. That said, I am more than eager to see it take shape, because of how powerful it will be coupled with the AnimationPlayer and GDScript.

I don't know a whole lot about it yet, so thanks for sharing these examples. The second one is something that looks very practical for a game. This is sort of effects we're aiming for in our game right now, but we're currently blocked until 3.1 stabilizes. :(

@insomniacUNDERSCORElemon

@blurymind I don't think I saw your edit before

Vertex colors and turning svg files into polygon meshes is a whole other thing, that is just a pie in the sky atm.

Me mentioning svg importing was only a note about the only situation I could see neglecting a dedicated (vector-focused) 2D asset editor (or having it as an add-on/plugin/whatchamacallit) as being acceptable, I wasn't suggesting svg conversion. That likely wouldn't be super useful anyways without curve support, at which point conversion isn't really needed.

I don't think it's too much work, particularly sharing a lot with standard polygons that just needs some adaption/new cases. Though you're right, it's a few steps past being used only for a texture-deform skeleton... however, a mesh+vertex colors can produce some pretty neat things (see also Spyro's skyboxes back during the PS1 days, back when something that clean/smooth wouldn't have been viable with a skybox texture) for a low resource impact. Animation of a polygon character would also be significantly easier using a mesh just like a texture would, rather than having a 'body' polygon and then needing other elements as their own polygons that are animated separately. Vertex coloring would also be much more viable with internal vertices.

But I agree, it is likely "pie in the sky". Not because it's unrealistic technically, but because someone needs to work on it and that's unlikely unless someone both WANTS said feature and has the ability+time to implement it. Many people are fine with raster (even though it doesn't play nice both with high and low resolutions), and you can see the lack of care when it comes to Google/Mozilla trying to replace Flash without recreating the vector side of it (like the replacement for animations is just the HTML5 raster video player) despite the jump we've had in average screen resolutions AND 1440p/4K/8K looming in the future.

This is what Unity3d is doing atm btw. If you look at games like Night in the woods - cartoony 2d game made in unity- its all polygons moved by armatures

Not sure what you're trying to say with this, but I'd probably be interested in reading/hearing about it if you have devlogs/videos etc on any of it. Last time I checked with Unity, most vector support seemed like it required 3rd-party stuff, sometimes even paid. Though I'm not sure about polygons only.

I couldn't find anything on NitW, the main thing that pops up is their dialogue system (Yarn). I'd look at the game myself to make sure it wasn't pre-rendered, but I don't have money and I likely wouldn't buy it simply due to lack of replayability (even though I like adventure games).

@blurymind
Copy link
Author

blurymind commented Sep 3, 2018

@insomniac_lemon

here is a link
https://www.youtube.com/watch?v=BAyd5wSPQrM
https://blogs.unity3d.com/2018/07/10/2018-2-is-now-available/#svg

Unity converts svg files to meshes and the color data seems to be transferred to the vertex colors data - resulting in this crisp resolution independent look.

The idea about svg from my perspective is binding the svg generated mesh to a skeleton :)

But in this issue, my request is not for that at all. It is to improve the authoring tools in godot and allow authoring the tessellation of polygon2d - to allow internal vertices.

Polygon2d is strange imo, because its not really a polygon - doesnt have 4 vertices - its not one face. Its just a very limited mesh. Should be called mesh2d?

@insomniacUNDERSCORElemon

@blurymind

here is a link

Neat, that's refreshing to see! Seems like it's from early this year. I don't think NitW used that considering it came out in early 2017, and the kickstarter was from 2013 (where you can see a 3D view of the scene and a sprite tree)... but I guess the final game could use plane meshes imported from SVGs, maybe even with a custom importer.

Still no curves as I mentioned... though maybe it won't make too much difference performance wise, unless maybe compared to the stuff that need 20+ vertices to be smooth vs 1 curve. That is, particularly in cases where smoothness is wanted. I mean I don't mind a stylized 'cutout' look, but I like the super-smooth yet simpler look too (like an outline of a leaf made with only 2 vertices... which with 2 handles per vertex still offers a few possible shapes).

The idea about svg from my perspective is binding the svg generated mesh to a skeleton :)

But in this issue, my request is not for that at all. It is to improve the authoring tools in godot and allow authoring the tessellation of polygon2d - to allow internal vertices.

Well, internal vertices could do both. You could use it not only for better deforms and internal deforms as you've mentioned (tentacle and eyebrows respectively) but also for vertex weights. Plus you could animate the vertices directly (mouth and eye animations would not work very well with bones, or if possible it'd be really awkward both with the skeleton setup and with a cartoon-y/simple result).

Like I said in my last comment... pure mesh shares many features as what you're asking for, only it requires a bit more work (deform only vs actually renders). Much like polygon2D already shares usage for polygon art and texture deformation, so internal vertices could be a step up for both.

It would be incredibly useful for creating static art yes, but it'd also be useful for making animated characters (or other animated things) that don't rely on textures. So in the case of animation we both want the same thing, only I want it expanded a little further to work with meshes on their own.

Polygon2d is strange imo, because its not really a polygon - doesnt have 4 vertices - its not one face. Its just a very limited mesh. Should be called mesh2d?

The prefix poly- just means 'many'. So Godot's usage is perfectly fine. I don't think 'face' implies 4 vertices either, you're likely thinking of quads.

Mesh2d should be reserved for when the mesh is controllable, like for this issue and for what I want. Internal vertices should not be done through polygon2d nodes, unless maybe they just get renamed to mesh2d assuming it gets fully upgraded.

@swarnimarun
Copy link
Contributor

Let me sum up everything from this thread so that if someone wants to work on it, he/she won't have to read it through.

  • Add internal vertices to the Mesh so as to make deforms more powerful.

  • Add weight painting. Highly Optional.

  • Or instead of weight painting just add the ability like cage transform using the internal vertices.

  • All this will more than likely also require an editor to do the animation and more complex work which is being to referred to here.

And improvements to the skeletal deforms. Not mentioned here but from my perspective they will be needed to make work with the internal vertices better.

Lastly the SVG importer improvements by adding tessalation to turn it into a mesh might also be a good idea if someone is up for it.
But it probably should be a separate issue thread.

@blurymind
Copy link
Author

blurymind commented Sep 8, 2018

@swarnimarun cage transform should not be regarded as a replacement for weight painting.
In the example of the dragon wing, you can absolutely not achieve the control you need with a cage.

Cage transformation should be seen as an extra feature, not an 'instead of weight painting'.
We absolutely need to be able to set the weight of internal vertices.
Right now we can already set weights - its clunky as hell- but not impossible. The problem is that there is not even a way to create internal vertices to begin with- therefore we have absolutely no creative control in a big big way, when compared to all the other industry used 2d mesh implementations.

Here is another example where you need to very specifically set the topology of your 2d mesh:
3 6-meshtools
this is commonly used to set up a simple eye blink in a rig

Godot's implementation is not a viable option at the moment. It won't ever be with this limitation. The sad thing is that all the options out there are proprietary. Dragonbones claim to be open source on their website, but their editor is not open source, nor is it free. They have imposed some terrible DRM requirements in the latest versions - you cant use their app unless you are logged into an online account at a chinese website.

The only easily accessible drm free option at the moment- that is even a part of a game engine is sadly the one in unity3d. Unity3d atm has the best implementation of this.
https://www.youtube.com/watch?v=pRMeH_sc8PI
Anima2d, which is now a part of Unity has all ofthis. Godot doesnt even have weight painting tools or auto smooth binding, like in Unity
68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f33363839392f36393333623632372d343461312d613565342d653939612d6235623538323231366561612e676966

These are imo for another issue request. This request's focus is solely the ability to create internal vertices and set weight on them.When that is out of the way, I can post a separate issue about the weight painting tools if nobody else does :)

@ghost
Copy link

ghost commented Sep 8, 2018

@blurymind Another informative post. As it stands I don't think the results can ever get much better than the purple tentacle example from earlier posts. We've been trying to see what we can at least use out of it, but for the very issues here, the results have been very undesirable. Though it looks like it would be quite the effort to make the tools and features on par with the others.

@blurymind
Copy link
Author

blurymind commented Sep 8, 2018

@avencherus thank you. It is indeed unusable at the moment. Even basic deformations dont look good.
If you would like to have mesh deformations in godot, the unofficial dragonbones runtime is the best option. It unfortunately means running a custom build of godot and a drm riddled external editor for the animations. Hopefully this will get much needed attention before the official release, when the feature implementation will likely be criticized and compared to others by much more users than just us.

Btw I really like gun-toting cats. Well done!

@ghost
Copy link

ghost commented Sep 8, 2018

@blurymind I hope so, we will have to see how many people are actually aiming to use it. If it hits the floor as is, oh my.

The downsides about Dragonbones are very much deal breakers. If Spine delivers a run-time for Godot by the end of the year as has been suggested, we'll probably invest in that. Though we're just starting to evaluate the animation needs, it may turn out that we can make do with cut-out puppets.

Thanks. X) Now that we've decided to take the game on seriously, there will be some very ambitious improvements made to it.

@reduz
Copy link
Member

reduz commented Sep 8, 2018

Guys, if you want to add internal vertices, this work should be focused on the Polygon2D editor. As I mentioned before, importing SVG as mesh is nice and it should not be too difficult, but this is not a good enough solution for this.

@blurymind blurymind changed the title Polygon2d node - ability to add internal vertices Polygon2d editor- ability to add internal vertices Sep 8, 2018
@blurymind
Copy link
Author

blurymind commented Sep 8, 2018

@reduz thank you, I renamed the title of the issue.
The request here is for internal vertices. If that is added to the polygon2d editor- it would close this issue.

The svg stuff is not a suggested solution, just an off topic mention - related to 2d animation in godot in general

@blurymind blurymind changed the title Polygon2d editor- ability to add internal vertices Polygon2d editor- Ability to Add/remove/move internal vertices - edit topology Sep 8, 2018
@reduz
Copy link
Member

reduz commented Sep 8, 2018

As I mentioned, importing SVGs as Meshes is not too much work, but having to add internal vertices to them is a huge amount of work in comparison to just add internal vertices to Polygon2D

@blurymind
Copy link
Author

@reduz for this issue lets focus on the lower hanging fruit- ability to add internal vertices in polygon2d editor :) I think most people will use bitmap sprites anyways

Svg import and tessellation is for a separate feature request imo.

We now have this feature, but it is still missing a key ingredient to be complete

@Ranoller
Copy link
Contributor

Really godot node system has now all features that spine/dragonbones has except internal animation vertices... you can do re-skinning, you can change z position, add/delete parts of the body, triggers, etc... you can do more things that integrated editors in spriter/spine/dragonbones.... but the internal vertices (a.k.a mesh deformation in 2d slang) is dead end to 2d animations "darkest dungeons" like (spine).... we try to maintain dragonbones runtime compatibility jet (module compiles in 3.1, but original module developer don't seems to interested), spine runtime is now outdated and think doesn't compiles because COW changes and math2d split (i'm spine customer but i don't want to do the job, i'm not programmer and spine has programmers), spriter now is worst that godot animation system... in the future this can be a top feature for 2d godot so please don't lost focus on that.

@blurymind
Copy link
Author

@Ranoller I agree that it would be great if we don't have to rely on third party devs/software. Unfortunately without internal vertices it is really unusable for production. Until godot catches up with dragonbones on the most basic of features- we will have to use it instead.

So thank you for maintaining it btw

@blurymind
Copy link
Author

Everyone who wants this feature- dont forget to vote for it here
https://docs.google.com/forms/d/e/1FAIpQLSeULEXXLknOgWdaDfDPD-OJjXhUw-y27G4HQ6scPBBTEAlGww/viewform

@swarnimarun
Copy link
Contributor

@blurymind isn't that for patreons only?

@blurymind
Copy link
Author

blurymind commented Sep 26, 2018

@swarnimarun everyone can vote, however if you are a patreon your vote counts as more than one vote..at least thats how I understand it

@reduz
Copy link
Member

reduz commented Jan 18, 2019

This wad added some days ago, so closing.

@reduz reduz closed this as completed Jan 18, 2019
@blurymind
Copy link
Author

blurymind commented Jan 18, 2019 via email

@JWBWork
Copy link

JWBWork commented Feb 9, 2021

To clarify, it was just internal vertices that were added right? We're tools like cage transforms to animate internal vertices added?

@Calinou
Copy link
Member

Calinou commented Feb 9, 2021

@JWBWork I don't think cage transform tools are implemented yet. If you need this feature in a project you're working on, please open a proposal on the godot-proposals repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants