LDraw_Importer_Unity icon indicating copy to clipboard operation
LDraw_Importer_Unity copied to clipboard

Missing part or wrong part with sub-file reference

Open vjeffPeters opened this issue 5 years ago • 0 comments

When trying to import a model with a part that has a sub-file reference in the parts/s folder, I receive the error "Missing part or wrong part ! Find it in the url from debug console"

It only seems to do it when there are sub-file references even when the file does exist in the /s folder. When getting the filename for the key in the _Parts dictionary, the extra path is not taken into account.

Fixed issue in the LDrawConfig.cs file in the InitParts().

if (!file.Contains(".meta")) { string fileName = file.Replace(_BasePartsPath, "").Split('.')[0];

                //Start fix
                if (fileName.Contains("\\"))
                    fileName = fileName.Split('\\')[1];
                //End fix

                if (!_Parts.ContainsKey(fileName))
                    _Parts.Add(fileName, file);
            }

vjeffPeters avatar May 11 '20 01:05 vjeffPeters