LDraw.org Discussion Forums
[LDView] Extra search directories not working? - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html)
+--- Forum: LDraw Editors and Viewers (https://forums.ldraw.org/forum-11.html)
+--- Thread: [LDView] Extra search directories not working? (/thread-26090.html)



Extra search directories not working? - N. W. Perry - 2022-02-27

I have a number of extra search directories set in my preferences, but LDView does not appear to be searching them so all those parts are missing. I know the directories are valid because if I set one of them as the main ldraw library, its parts (and only its parts) will appear just fine. Have I forgotten to tick a simple box somewhere, or is something amiss?

This is LDView 4.4.1 on MacOS by the way.


RE: Extra search directories not working? - Travis Cobbs - 2022-02-27

(2022-02-27, 5:06)N. W. Perry Wrote: I have a number of extra search directories set in my preferences, but LDView does not appear to be searching them so all those parts are missing. I know the directories are valid because if I set one of them as the main ldraw library, its parts (and only its parts) will appear just fine. Have I forgotten to tick a simple box somewhere, or is something amiss?

This is LDView 4.4.1 on MacOS by the way.

You shouldn't have to do anything, and the feature is working for me with the official 4.4.1 release on macOS. What result do you get when you run the following command from Terminal.app?

Quote:defaults read com.cobbsville.LDView | grep ExtraSearchDirs



RE: Extra search directories not working? - N. W. Perry - 2022-02-28

(2022-02-27, 23:40)Travis Cobbs Wrote: You shouldn't have to do anything, and the feature is working for me with the official 4.4.1 release on macOS. What result do you get when you run the following command from Terminal.app?


Code:
"ExtraSearchDirs/Dir001" = "/Users/nwperry/.local/share/Stud.io/CustomParts";
    "ExtraSearchDirs/Dir002" = "/Applications/ldraw/User";
    "ExtraSearchDirs/Dir003" = "/Applications/ldraw/Unofficial";



RE: Extra search directories not working? - Travis Cobbs - 2022-03-01

(2022-02-28, 0:49)N. W. Perry Wrote:
Code:
    "ExtraSearchDirs/Dir001" = "/Users/nwperry/.local/share/Stud.io/CustomParts";
    "ExtraSearchDirs/Dir002" = "/Applications/ldraw/User";
    "ExtraSearchDirs/Dir003" = "/Applications/ldraw/Unofficial";

Two things:

First of all, there appears to be a bug in LDView, in that it doesn't properly load the errors and warnings dialog after initially loading the file without the extra directories configured, and then having it automatically reload once they are configured. I will investigate this; I suspect that it is a Mac-only bug.

The second problem is that LDView's extra search directories aren't extra LDraw directories, so LDView will not search any sub-directories. I looked at the CustomParts.zip that you sent me, and it appears that you are treating it as if it were an LDraw directory. In order to find these parts in LDView, you need to add the following as extra search directories:

/Users/nwperry/.local/share/Stud.io/CustomParts/parts
/Users/nwperry/.local/share/Stud.io/CustomParts/Unofficial/parts


RE: Extra search directories not working? - N. W. Perry - 2022-03-01

(2022-03-01, 2:52)Travis Cobbs Wrote: Two things:

First of all, there appears to be a bug in LDView, in that it doesn't properly load the errors and warnings dialog after initially loading the file without the extra directories configured, and then having it automatically reload once they are configured. I will investigate this; I suspect that it is a Mac-only bug.

The second problem is that LDView's extra search directories aren't extra LDraw directories, so LDView will not search any sub-directories. I looked at the CustomParts.zip that you sent me, and it appears that you are treating it as if it were an LDraw directory. In order to find these parts in LDView, you need to add the following as extra search directories:

/Users/nwperry/.local/share/Stud.io/CustomParts/parts
/Users/nwperry/.local/share/Stud.io/CustomParts/Unofficial/parts

That worked!

Actually I only added the /parts directory, not the /Unofficial one because I don't use it. Actually, I'm a bit confused by it since I've never seen it before. Studio created that folder itself, and I see that it seems to contain parts from a model I opened that are in the official library, but maybe have unofficial updates? (I'll have to investigate that separately. Maybe Philo knows.) Wink

On a similar note, is there a way to make LDView display unofficial updates to official parts in the main ldraw directory, other than embedding them? Or is that how it's designed to work?


RE: Extra search directories not working? - Travis Cobbs - 2022-03-01

(2022-03-01, 15:51)N. W. Perry Wrote: On a similar note, is there a way to make LDView display unofficial updates to official parts in the main ldraw directory, other than embedding them? Or is that how it's designed to work?

It should technically be possible to force LDView to look for Unofficial files before looking for official ones, but doing so is not recommended. The problem is that once an unofficial file becomes official, it is no longer present as an unofficial file on the LDraw parts tracker. You are then stuck with whatever the last version of the file was that you downloaded into your Unofficial directory (which may not be the last update that was posted there).

If you still want LDView to do that, you should be able to create a ~/.ldrawrc with the following contents:

Code:
[LDrawSearch]
1=<MODELDIR>
2=<UNOFFIC><HIDE><DEFPRIM><LDRAWDIR>\\Unofficial\\P
3=<UNOFFIC><DEFPART><LDRAWDIR>\\Unofficial\\PARTS
4=<HIDE><DEFPRIM><LDRAWDIR>\\P
5=<DEFPART><LDRAWDIR>\\PARTS
6=<LDRAWDIR>\\MODELS

Note: I don't think I've ever tested this. The above is in LDraw.ini format, and the parsing in LDView is done by Lars C. Hassing's LDrawIni library. Please see there for details on the format of the information.

Also note that the above uses LDView's default Unofficial directory. I'm not sure what happens if you replace <LDRAWDIR>\\Unofficial\\PARTS with the full path to your Unofficial directory. I think that LDView's automatic downloads of Unofficial parts only works in <LDRAWDIR>\\Unofficial, but it's been so long since I even looked at that code, that I can't remember for sure. However, if you simply add the Stud.io Unofficial/parts and Unofficial/p directories as new entries in the LDrawSearch path above (omitting the <UNOFFIC> tag), and then put the above <UNOFFIC> entries at the end of the list (as 7 and 8), it might do what you want.

Note: paths in ~/.ldrawrc need to use \\ as path separators, not /.


RE: Extra search directories not working? - N. W. Perry - 2022-03-01

(2022-03-01, 18:05)Travis Cobbs Wrote: It should technically be possible to force LDView to look for Unofficial files before looking for official ones, but doing so is not recommended. The problem is that once an unofficial file becomes official, it is no longer present as an unofficial file on the LDraw parts tracker. You are then stuck with whatever the last version of the file was that you downloaded into your Unofficial directory (which may not be the last update that was posted there).

If you still want LDView to do that, you should be able to create a ~/.ldrawrc with the following contents:

Code:
[LDrawSearch]
1=<MODELDIR>
2=<UNOFFIC><HIDE><DEFPRIM><LDRAWDIR>\\Unofficial\\P
3=<UNOFFIC><DEFPART><LDRAWDIR>\\Unofficial\\PARTS
4=<HIDE><DEFPRIM><LDRAWDIR>\\P
5=<DEFPART><LDRAWDIR>\\PARTS
6=<LDRAWDIR>\\MODELS

Note: I don't think I've ever tested this. The above is in LDraw.ini format, and the parsing in LDView is done by Lars C. Hassing's LDrawIni library. Please see there for details on the format of the information.

Also note that the above uses LDView's default Unofficial directory. I'm not sure what happens if you replace <LDRAWDIR>\\Unofficial\\PARTS with the full path to your Unofficial directory. I think that LDView's automatic downloads of Unofficial parts only works in <LDRAWDIR>\\Unofficial, but it's been so long since I even looked at that code, that I can't remember for sure. However, if you simply add the Stud.io Unofficial/parts and Unofficial/p directories as new entries in the LDrawSearch path above (omitting the <UNOFFIC> tag), and then put the above <UNOFFIC> entries at the end of the list (as 7 and 8), it might do what you want.

Note: paths in ~/.ldrawrc need to use \\ as path separators, not /.

It's an age-old question, how to handle unofficial part updates. :-) I don't mind just keeping my Unofficial folder as current as possible, but now that I think of it, I've had more success just OMR-izing the file in MPDCenter, so that everything I need is simply embedded in the file.