Skinned MeshParts are live!

TLDR: I would have never thought to look! Thanks!

I’m still getting used to the server side stuff. No, Robie’s code didn’t work over there, but your code was very similar to the original. I switched from a WeldConstraint to a Weld, and when in doubt, referred back to the working code from Robie.

You introduced a “Character.RightHand” when I think you just meant “mesh.” You already have the part positioned, welded, with a Motor6D in place. These edits work on client and server. Thanks again for all your help!:

local Character = script.Parent
local hrp = Character:WaitForChild("HumanoidRootPart")
local Humanoid = Character:WaitForChild("Humanoid")
local RunService = game:GetService("RunService")
local boneparent = hrp--or whatever part of your character that your bones are parented to

local mesh = Character:FindFirstChild("FlamePart")--the name of the charactermesh that you are using
local meshweld = mesh:FindFirstChild("FlameWeld")--the name of the weld between mesh and parent 
local bone = boneparent:FindFirstChild("LeftHand", true)--the name of the bone you want to track

local handToPartCenter = CFrame.Angles(0, math.rad(0), math.rad(-90)) + Vector3.new(2.5, 0.5, -0.25) --adjust to align mesh with rig
meshweld.C1 = CFrame.new()
mesh.Motor6D.Enabled = false
RunService.Stepped:Connect(function(time, step)--if something errors in here make sure it is the right pathway to that instance
	if Character and Character.Humanoid.Health > 0 then
		local partCFrame2 = bone.TransformedWorldCFrame * handToPartCenter
		local C1 = meshweld.Part0.CFrame:ToWorldSpace(meshweld.C1)
		meshweld.C0 = C1:Inverse() * partCFrame2
	end
end)
2 Likes

Ya, the purpose of the “Character.RightHand” was to make it compatible with tools. This is what roblox does with tools: When a tool is picked up, (whatever built in roblox script) search’s for two things, a part named “Handle” which is a descendant of the tool and a Part name “RightHand”, which is parented to the character. If both of those parts exist, then the roblox script is will create a weld under the the part RightHand, name it “RightGrip” set Part0 to the part RightHand and part1 to the part Handle. But all of this won’t happen if the part RightHand is does not exist or is not named correctly.

To any people who have actually looked inside roblox, I’m sorry if I was a bit wrong, this is just my best guess

Personally, I would make a part named LeftHand under the character and track that using a script, that way, I can just the same script in all of my fake LeftHanded tools so I don’t have to modify every single one

Ahh, I see. That’s the difference. I want to keep the freedom of the skinned mesh, and track what happens differently for each tool. For example, a whip or torch I might track just the end, where a sword or shield I would track the whole part. I plan on changing the animation up each time. Might be a problem later…

Hello Roblox Dev community.

It’s exciting to see all the amazing skinning work in progress on this thread, nice job everyone!

Today, Roblox will be enabling a new internal code path relating to skinned MeshParts. This change lays the groundwork for some exciting developer facing features coming soon, but in itself should be unnoticed. That said, there is one known issue that we are hoping won’t impact many developers: if you have added joints to your skeleton hierarchy in Studio, that didn’t exist in your FBX import, they may not deform correctly. If your Studio skeleton hierarchy matches your FBX import, you should be unaffected. We have a fix for this in progress, but we want to enable this new code path without it, so we can stress test it as much as possible and get the new features to you as soon as possible.

If you are adversely impacted by this change, or if you notice any other regressions, please let us know, and we will work with you to resolve any issues asap. Thanks for your support and patience, we couldn’t do this without you!

– Your Roblox Avatar Engineering Team

8 Likes

Is there any possibility of adding support for bulk-setting the positions of Bone objects? An issue with my ocean code stems from how I simply cannot update many bones in bulk due to them being somewhat expensive - I have implemented a lot of code such as frustum culling just to try and mitigate the issue by as much as possible, but I believe a bulk-position setter would be the most optimal approach at the end of the day.

2 Likes

We are using skinned meshes in the game that I linked in the bug report you replied to:

Could this new internal code path be causing crashes on that place if it has skinned meshes?

Could you apply the bone animations in chunks and only enable the animations for chunks within a certain distance of the character, doing this locally might increase performance too.
If you are using offset than you could create a algorithm to determine the offset of a bone(bone.transform) and apply them locally with in a range of the character, you could also use these values to calculate physics of the height of waves, so a part could float on top of a wave.you might want to do this with a module script so that the module script could take in other info like if there is a storm or not(waves get taller) or if there is no wind(waves are very flat)
I know very little about actors, but to my knowledge they might help

I’ve already done more than enough on my end. Setting a bone’s position takes 85% of the total update time alone - and I perform a whole summed gerstner wave algorithm per every bone, so you can see how it’s quite expensive.

Oh, well I am no expert but at the top of this post, they featured a wave, and it did not look to expensive so there may be a better way

It updates at 2ms. The issue is that I need to limit how much I can update - I can’t make the waves more detailed (more bones per square stud), and have to resort to spreading out the bones over a bigger grid, like tyridge does in his video.

We would like to optimize this eventually. Is there a way you can get the same effect using animations? That would be the fastest way to do it for now.

1 Like

Sadly no, as it would ultimately be much less dynamic - I customize ocean settings where for instance the shore has calm waves, whilst the ocean has dangerous storms with huge waves. Animations would be not only extremely hard to use, but you’d have to remake them every time we would want to decide to fine tune them.

2 Likes

Hi
I had been struggling with the same issue for a long time. Updating bones every frame is just to computationally heavy at the moment.

In this reply I posted the method I use to efficiently move the bones of my waves: In-Game Realistic Ocean Thunderstorm - #11 by apenzijncoolenleuk1

Basically, instead of updating every frame, I divide all the bones into tables that get smoothly interpolated over a few frames. This way the work that has to be done is nicely divided. Instead of having to compute 4000 positions at once, it now is reduced to 400 for example.

I found TweenService to be really slow and buggy, so I created my own (simple) interpolation module.
The code for my waves can be found here: https://github.com/noah-peeters/Roblox-Procedural-Ocean (the interpolation module is here: src/shared/WaveHandler/InterpolateVector3)

Having an option similar to BulkMoveTo would be extremely handy though. As it would improve every bulk bone movement.

3 Likes

This reminds me of the original Doom workarounds. They got around all the hard computations that created lag by hard coding it all.

Classic! :+1:

1 Like

Like others, when I edit my character which is a skinned mesh - it uses Dogu15 - it flickers all the limbs. This needs a fix soon as it’s making games that used skinned mesh rigs look worse.

Heres an example:
https://i.gyazo.com/bf9f42988bd87fb0b6472dedc57123a5.mp4

I’ve found out that it only happens when something in the character has been edited (transparency, size, colour etc.)

I’ve also found out that it only flickers when you change the character on the server, but if you change it on the client it does not flicker.

I know many people have mentioned this already but I just posted to flag up the problem.

3 Likes

Thanks for your patience, we are investigating.

1 Like

What happened to my request of allowing us to use any constraint such as springs, to skin meshes? Im still not able to create a trampoline, or a strechy rope.

wait for some reason this has been my question

will Importing S15 directly autorigs if there is no bone for it?
because i don’t wanna use Mixamo since it’s problematic with name Detecting it’s named mixamorigs:RightHand and i want it to be “RightHand” instead since willbobdie’s script is only working for few rigs I’ve downloaded from roblox dev hub
it works fine until realized that they still won’t go with RightHand

also when will there be auto rigs because i need this to be added! and since i’m confused how are they able to rig without getting stretch error

Could this “non-animated state” be manipulated, specifically by saving/changing default poses within Roblox? Seems like it could solve more than one problem.

I run into the same issue of reverting to the initial pose, but only because my mesh is R15 compatible. The default jumping animation does not use the arms, so they revert to the “T pose” midjump. The problem is there’s no combination of arm positions that would be acceptable for the entirety of the game, so there’s no point changing the pose during loading.

Being able to take a snapshot/freeze of a frame of an animated pose (and make it the default pose) right before doing something that isn’t animated (or just partially animated) would solve a lot of problems.

If such a thing is possible, I do not know what words to search for. This doesn’t sound restricted to skinned meshes, but skinned meshes are more likely to show up in their design pose.

robloxapp-20210622-1420510

2 Likes

Can’t you just run a looped Core priority animation that consists of the frame that you want it to revert to. I think that would work because animations from any priority will overlap if there are no keyframes assigned to a certain bone/motor6d.

1 Like