-- This is an overload function for TransparencyController:IsValidPartToModify(part)
-- You may call it directly if you'd like, as it does not have any external dependencies.


function FpsCamera:IsValidPartToModify(part)
	if part:FindFirstAncestorOfClass("Tool") then
		return false
	end
	
	if part:IsA("Decal") then
		part = part.Parent
	end
	
	if part and part:IsA("BasePart") then
		local accessory = part:FindFirstAncestorWhichIsA("Accoutrement")
		
		if accessory then
			if part.Name ~= "Handle" then
				local handle = accessory:FindFirstChild("Handle", true)

				if handle and handle:IsA("BasePart") then
					part = handle
				end
			end
			
			for _,child in pairs(part:GetChildren()) do
				if child:IsA("Attachment") then
					if self.HeadAttachments[child.Name] then
						return true
					end
				end
			end
		elseif part.Name == "Head" then
			local model = part.Parent
			local camera = workspace.CurrentCamera
			local humanoid = model and model:FindFirstChildOfClass("Humanoid")

			if humanoid and camera.CameraSubject == humanoid then
				return true
			end
		end
	end
	
	return false
end
