-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Add option to bake a mesh from animated skeleton pose #85018
Conversation
6b97b25
to
cd7cfb0
Compare
Could be use to emit particles from a animated mesh? |
See godotengine/godot-proposals#8106 and godotengine/godot-proposals#5051 Particles have currently no exposed API to bake emission points from mesh at runtime. For performance it also makes far more sense to directly bake to the texture that the particle shader uses instead of baking to an intermediate mesh. |
Personally I am a bit wary of exposing new APIs to users that cause GPU stalls like this. My preference would be to first add a caching system to Mesh so that users can choose to keep the data on the CPU if they want to do things like this. |
Where should such an option to (pre)cache the mesh arrays be added? On the |
cd7cfb0
to
741997f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am in favour of the feature, but I don't know how to resolve the request from @clayjohn
I would also reuse the same approach from the blend shape bake with the inputted mesh outputting a mesh |
Applied the same changes as in the blendshape bake pr. The baked mesh is always returned, and if an optional existing mesh param is provided it updates this mesh RID instead of creating a new mesh as this helps with updating instances that already use that mesh. |
Is this thing done yet? |
Adds option to bake a mesh from animated skeleton pose.
7b19dec
to
a99a169
Compare
All review comments are addressed.
Thanks! |
Does this actually work? i have been trying to get it to work for a few days. Any example code would be nice or an example project. i tried what is in the docs but i keep getting out the orginal unblended mesh. Aah. the 4.3 version i am running doesnt seem to have the actual code... just the stubs.... 3 days of head banging later. |
@RavinMaddHatter are you testing on 4.4? |
Does anyone have a test project so i can figure out the difference and why i only get the default pose? |
Please provide a test project with code. |
Here you go! |
So this function returns a
|
This may be my issue, I will test when I can.
…On Mon, Sep 16, 2024, 10:38 AM Ken Lee ***@***.***> wrote:
So this function returns a ArrayMesh which is a resource not a node. If
you add the resource to another MeshInstance3D it'll be correct. It seems
to work correctly for me at least.
var a : MeshInstance3D = $ExistingMeshInstance
var b : MeshInstance3D = MeshInstance3D.new()
b.mesh = a.bake_mesh_from_current_skeleton_pose()
get_tree().root.add_child(b)
—
Reply to this email directly, view it on GitHub
<#85018 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBUC5B7NVW5HXU6L5VNK23ZW4JRBAVCNFSM6AAAAAA7P4GYO2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJTGUZDGOJTGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
You can see the project. it is not minimized i apologize for that, but I am not sure how to minimize it right now. I am still figuring out the 3d aspects of godot. This is a learning project so the code hygiene is terrible. But i cannot get it to work, i am looking into other options on this topic as well. |
I have made an issue on https://github.com/RavinMaddHatter/Madhatters-Table-Top-RPG-Mini-Maker to debug this. |
From the other thread "There seems to be a missing feature to bake both blend shapes and skeleton poses." I have not seen any updates. but i am curious if this is a bug in my implementation or in the godot implementation. |
Adds option to bake a mesh from animated skeleton pose.
Takes a snapshot of the current animated skeleton pose of the skinned mesh and bakes it to another ArrayMesh.
Implements godotengine/godot-proposals#8120 to make stuff like this:
Pairs with #76725 to bake the blend shapes.
Production edit: closes godotengine/godot-roadmap#58