ousnius / BodySlide-and-Outfit-Studio

BodySlide and Outfit Studio, a tool to convert, create, and customize outfits and bodies for Bethesda games.
GNU General Public License v3.0
286 stars 63 forks source link

BodySlide puts sliders in wrong category when multiple bodies with identical slider names but different categories are installed #472

Closed LenAnderson closed 1 year ago

LenAnderson commented 1 year ago

Description When two or more bodies are installed and sliders with identical names exist in both bodies, but are not assigned to the same categories, the category assignment from the first loaded body will be used for those sliders for all bodies.

Tested with BodySlide 5.6.0 (as well as built from source) and Fallout 4.

How to reproduce

  1. Install CBBE body
  2. Install BodyTalk3 body
  3. Open BodySlide
  4. Select CBBE body
  5. The Hips slider (display name Size) will show up in the otherwise empty category Legs instead of category Hips

If I read this part of BodySlideApp::DisplayActiveSet in src/program/BodySlideApp/ correctly, the slider names from the shape data are compared against the category data from the slider categories xml files. The first category to contain a slider with a matching name is then used for that slider.

In the above example, a slider Hips exists in the category Legs (from BodyTalk's xml) and also in Hips (from CBBE's xml), since BodyTalk was loaded first, CBBE's slider will now show up in Legs.

        // Find the category in the list
        bool regularSlider = true;
        int iter = 0;
        for (auto& cat : sliderCategories) {
            catSliders.push_back(std::vector<int>());
            if (std::find(std::get<1>(cat).begin(), std::get<1>(cat).end(), activeSet[i].name) != std::get<1>(cat).end()) {
                catSliders[iter].push_back(i);
                regularSlider = false;
                break;
            }
            iter++;
        }
ousnius commented 1 year ago

@LenAnderson With the way slider categories currently work, they have no relation to the body mod they came with/for. So it's not possible to say when to put the slider "Hips" into category "Hips" and when to put it into category "Legs" instead.

Authors of category files should make sure their slider's category doesn't conflict.