Skip to content

Changing transparency on Rig models #21

@ringkun

Description

@ringkun

I was making an animation where a rig changed its transparency over the course of the animation. However playing it, the transparency isn't animated. I noticed that transparency was actually handled in the Specials module. However I think I figured out the culprit in that for Rigs, it only exclusively compile the files for rig animation or property animation. Not both, specifically in this portion of the compileItem function. Is there a way to fix this issue?
` if rig and itemType == "Rig" then
local joints = resolveJoints(target)

	for i, jointData in rig:GetChildren() do
		if jointData.Name ~= "_joint" then
			continue
		end

		local hier = jointData:FindFirstChild("_hier")
		local default: any = jointData:FindFirstChild("default")
		local keyframes = jointData:FindFirstChild("_keyframes")

		if default then
			default = readValue(default)
		end

		if hier and keyframes then
			local tree = readValue(hier)
			local readName = tree:gmatch("[^%.]+")

			local name = readName()
			local data: MoonJointInfo? = joints[name]

			while data do
				local children = data.Children
				name = readName()

				if name == nil then
					break
				elseif children[name] then
					data = children[name]
				else
					warn(`failed to resolve joint '{tree}' (could not find child '{name}' in {data.Name}!)`)
					data = nil
				end
			end

			if data then
				local joint = data.Joint

				local props: any = {
					Transform = {
						Default = CFrame.identity,
						Static = false,
						Sequence = unpackKeyframes(keyframes, function(c1: CFrame)
							return c1:Inverse() * default
						end),
					},
				}

				targets[joint] = {
					Props = props,
					Target = joint,
				}
			end
		end
	end
else
	local props = {}
	for i, prop in frame:GetChildren() do
		if not prop:IsA("Folder") or prop == markerTrack then
			continue
		end

		local default: any = prop:FindFirstChild("default")
		local name = prop.Name

		if default then
			default = readValue(default)
		end

		props[name] = {
			Default = default,
			Static = Specials.Static(target, name),
			Sequence = unpackKeyframes(prop),
		}
	end

	targets[target] = {
		Props = props,
		Target = target,
	}
end

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions