This configuration of parts crashes my studio(animation editor)

Viewmodel test.rbxm (5.5 KB)

any ideas of why it does that? I’m trying to animate it by the way.

in order to fix it you can copy the Arm2 Motor6D into Arm1 and replace the Part1 in the Motor6D to Arm1, so that both of the Part0 are set to Main, this will prevent the infinite recursion so being able to animate without crashing

(I’m not an animator though, just a programmer, so this is just my educated guess on what you’d do you might need a different setup)

the way the your Motor6Ds are setup make the Animation Editor go into an infinite recursion when trying to find the root part of the rig model.

Arm2.Part0 → Main
Arm2.Part1 → Arm2
Main.Part0 → Arm1 → Main → Arm1 → Main → Arm1… (the infinite recursion in question)
Main.Part1 → Arm1

I’m unsure of whether this will ever be fixed because it’s technically a user error, but here’s an in-depth explanation of why it crashes and how to prevent it if you want to know, this was how I found this out:


a studio crash log showed me some of what had happened, but it didn’t exactly say why, so I had to dive deeper.

Error [FLog::LuaHangedScript] Hang stack trace for LuaHangScriptName: builtin_AnimationClipEditor.rbxm.AnimationClipEditor.Src.Util.RigInfo, line 138 - function findRootPart
builtin_AnimationClipEditor.rbxm.AnimationClipEditor.Src.Util.RigValidation, line 304 - function rigHasErrors
builtin_AnimationClipEditor.rbxm.AnimationClipEditor.Src.Components.InstanceSelector, line 150

after some decompiling of studio plugins and manual refactoring, we can immediately see why the animation editor crashes with this setup:

function RigInfo.findRootPart(rigModel)
	...
	local foundRootPart = nil
	local currentPartName = next(partNameToMotor or {}) --> Arm1->Main
	if currentPartName then
		while not foundRootPart do
			local motor = partNameToMotor[currentPartName] -- Arm1 -> Main
			if motor and motor.Part0 then
				currentPartName = motor.Part0.Name -- Arm1
			else
				foundRootPart = currentPartName
			end
		end
	end
	...
end

this findRootPart method is being held up by wishes and prayers :sob:

the animation editor would view the Motor6D’s and use the PartNameToMotor LUT (lookup table of Part1.Name → Motor6D) to find things, in this model’s case, this is what the LUT looks like when it’s generated by the RigInfo module:

["PartNameToMotor"] =  ▼  {
	-- V --------------------------------- V
	["Arm1"] = Main.Motor6D, -- Part0 -> Arm1 (BAD!!! INFINITE RECURSION😡😡🤬💢)
	["Arm2"] = Arm2 -- Part0 -> Main (OK)
}

because of the way you had your ‘Main’ Motor6d set up (both Part0 and Part1 are set to Arm1), the while loop would do these in order:

  1. look at Main.Motor6D.Part0 (Arm1) and use PartNameToMotor[“Arm1”] to find Arm1’s Motor6D, which is Main.
  2. look at Main.Motor6D.Part0 (Arm1) and use PartNameToMotor[“Arm1”] to find Arm1’s Motor6D, which is Main.
  3. repeat step 1-2 forever, causing a crash

you get the point, and I hope it’s solved for you now and you’re now fully aware of why this happens and can prevent it in the future, aswell as other people that may come across this problem! :3

2 Likes

Thanks for your answer! Sorry for the late response though. This will help me a ton! :smiley: