AvatarEditorService BodyParts can not be loaded

For these Enums:

Enum.AvatarAssetType.Head
Enum.AvatarAssetType.LeftArm
Enum.AvatarAssetType.LeftLeg
Enum.AvatarAssetType.RightArm
Enum.AvatarAssetType.RightLeg
Enum.AvatarAssetType.Torso

I get wrong results with the ingame AvatarEditorService API. For each of the mentioned enums, I get these complete bundles (Catalog - Roblox) as the result and not the single body parts.

Code for case LeftLeg:

local AvatarEditorService = game:GetService("AvatarEditorService")

local searchParameters = CatalogSearchParams.new()
searchParameters.SearchKeyword = ""
searchParameters.AssetTypes = { Enum.AvatarAssetType.LeftLeg }
searchParameters.BundleTypes = { Enum.BundleType.BodyParts }
local catalogPages = AvatarEditorService:SearchCatalog(searchParameters)
local currentPage = catalogPages:GetCurrentPage()

Debug:

What is causing this mistake in my searchParameters?

Searching for a BundleType with Enum.BundleType.BodyParts will return bundles that contain body parts, and not the body parts themselves.

To get the ids of the body parts themselves you need to use AssetService to get the bundle details.

local AssetService = game:GetService("AssetService")
local details = AssetService:GetBundleDetailsAsync(<BundleId>)
for i, value in pairs(details.Items) do
    local limbId = value.Id
end

Searching for both AvatarAssetType.LeftLeg, and BundleType.BodyParts will return a mixed result containing both BodyParts bundles, and LeftLeg assets.

If you only want LeftLeg assets you don’t need to include the BundleType in your search parameters.

local catalogParameters = CatalogSearchParams.new()
catalogParameters.AssetTypes = { Enum.AvatarAssetType.LeftLeg }
catalogParameters.IncludeOffSale = true -- AssetType sold as part of bundle and considered off sale.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.