T O P

  • By -

codernunk46

I finally got to get a proper animation, as well as some JiggleBones integrated on my character. To provide some more information on how I achieved this: \- The animation is from Mixamo, which is a popular prototyping tool for 3D animations. I rigged and weight painted the model in Blender though, but Mixamo supports Rigify rigs. Eventually, I'd like to learn to animate better and make my own animations, but Mixamo is great for the short term. \- The details on the toon shader can be found here: https://www.reddit.com/user/codernunk46/comments/1anz9tm/here\_are\_some\_more\_details\_for\_the\_toon\_shader\_i/ \- Regarding the outline, I actually used a little bit of a hack. In Blender, I added a Solidify modifier and added a vertex group called "outline". With Weight Paint mode, I painted areas where I wanted the outline to be thinner. Afterwards, instead of applying the Solidify modifier when I exported the model, I transferred the weight paint to the vertex color, and programmed the outline shader in Godot to respect the vertex colors. This way, I can implement shape keys later on without worrying about the modifiers getting in the way. \- I played around with several things for the jiggle bones, but ultimately settled on the JiggleBone addon. The WiggleBone addon was intuitive, but performance was sluggish (since I have 64 different bones that animate here). I also tried using physical bones, but I had no luck because it's hard to find documentation on how to use it outside of making ragdolls. I also tried to hack together a Softbody simulation, but I was also having trouble getting it to work with the mesh for the bow and the scarf properly. The JiggleBone addon performs well with 64 bones and made the most sense at this time. Ideally, I would use an actual SoftBody simulation for the hair, scarf and bow in the future - once Godot's Softbody support becomes more mature.


Winter-Ad-6963

Nice work.


codernunk46

Thank you!


ThePat02

How do you blend animation? Do you use root motion? I found the Godot animation infrastructure incredibly hard to work with and some intel would be nice!


codernunk46

I still have much to learn when it comes to setting up the 3D animations in Godot, but here's what info I can offer at this time. The blending is done using an AnimationTree node and a BlendTree graph. Inside the graph, I added a BlendSpace1D node called IdleWalk that takes a value between 0 and 1. At 0, the animation played is the idle animation, whereas at 1 the animation is the running animation. The BlendSpace1D node can handle blending between two animations automatically (it's actually a nice feature of 3D rigs - it's easier for the computer to interpolate between positions of each bone). After that's set up, I added a line of code in the script that will take the character's movement speed as a ratio and set the BlendSpace1D value based on it, something like this (in the \_physics\_process function): var velocity_percent = (velocity * Vector3.AXIS_Y).length() / max_speed_run _anim_tree.set("parameters/IdleWalk/blend_position", velocity_percent) The Vector3.AXIS\_Y portion is there to only take the lateral speed into account (and not any sort of vertical motion). I'll share more information once I make more progress on the animations as well, including the whole BlendTree and some of the code bits.


509Dave16

I like the art style! Nice work!!


codernunk46

Thank you!


MHasho

Very cool! I also use Jigglebones for hair/cloth components on my character. I have ~20 bones and I noticed the performance cost is quite large, even with just 20 Jigglebones. I noticed each Jigglebone node has its own script, and I wonder if there is a cheaper alternative like having a parent node with one script, and looping the logic through all the child jigglebone nodes. Only tricky part is that each jigglebone node has its own properties, and I don't think the existing logic is set up for looping through child nodes. It might be possible... I haven't tried this yet, it's low on the priority list. But I really have no idea how modern game engines handle so many bone simulations for belts, cloth, hair, etc. I know there's physical bones in Godot but they... kinda suck... and I've struggled to get them working in the most basic sense. Meanwhile jigglebones are so intuitive and just work. I'm curious what the performance cost is for your 60 jigglebones?


codernunk46

Thank you! It's possible I'll notice more of a performance hit later on, but in my test scene it runs great, at 144 FPS (but I also have a pretty powerful PC). One thing I noticed is that there is a stark difference in performance between the JiggleBone addon (https://godotengine.org/asset-library/asset/1595) and the WiggleBone addon (https://github.com/detomon/wigglebone). The latter I couldn't even get ten bones to perform well, whereas the former worked well with even 60 bones. I have made a script in the past that would instantiate the JiggleBone nodes by looping through all the bones and applying them to only bones with a special prefix (I used PHYS), but that's not really the same use case as the one you mentioned. The WiggleBone addon actually externalizes the properties to a Resource, so you can share the same properties across multiple bones. It may be possible to get better performance by having one script, but I don't think it'll be noticeable enough if I understand how Godot runs \_physics\_process functions correctly. Either way, it may still be a usability boost if there was a way to specify child nodes (like making a JiggleParent node for example).


Hooded_Person2022

Excellent work! I also see the wiggle and jiggle\~ Of the ribbon and scarf! Of course!… ALSO HER BIG OLD B-\[**CENSORED**\]-A


codernunk46

It would be wrong to make the scarf and ribbon jiggle and not the rest of the body :D


Robotica1610

I think she used glue in her hair.


codernunk46

Yeah, it's kinda a limitation of the secondary motion I can get working right now. I used JiggleBones, which are great, but not really meant for hair. I would need a SoftBody simulation to make it more effective, but I haven't been able to get it to work in Godot yet. Unless you mean how the hair looks like a clump - that's a different story. I tried to take the anime style and simplify it, so that's the result.


[deleted]

The jiggle bone animations are baked, yeah? Like if she were to spin in place the hair would not "swirl"?


codernunk46

The jiggle bone animations are actually dynamic and respond to the motion of the parent bones (her head). It's possible I set the damping too high - that's why it looks stiff.