Not possible to use environment variables in 3D Search Paths?

Hi,

I just finished wrestling with the way libraries, footprints and the corresponding 3D packages are handled in KiCAD 5 (I was still working with version 3 of KiCAD so far without issues…). Although I must say it’s not the most intuitive design, It’s clear for me now how things have to be approached.

There’s one thing I can’t get to work, though: using an own-defined environment variable in the 3D Search Paths section (you have to open the Configure Paths… dialogue box to see this).

I first defined a new environment variable in the top section. That environment variable is successfully applied/deployed in the - in my case - Manage Footprint Libraries… section to shorten long paths. So, I’m sure the new environment variable is working fine.

I also have one extra item in the 3D Search Paths section. But if I use the environment variable in that section, then my 3D shapes of the components I’m selecting are not shown. I have to remove the environment variable and put the full path in place instead.

This is not working:
${KICAD_WALTER_MODS}\packages3d

Note:
KICAD_WALTER_MODS has the following content: E:\AppData\GitHub\gevanco\kicad-5\kicad_libs_walter\modules

However, this is working:
E:\AppData\GitHub\gevanco\kicad-5\kicad_libs_walter\modules\packages3d

Question: should we be able to use environment variables in the 3D Search Paths section or is that not possible/allowed?

The 3d search path thing is quite new (added in 5.1) so it might have a lot of bugs or missing features. In this case i simply assume that pathvariable parsing is not added to it. I suggest to add a feature request about it.

I also never got an answer on the mailing list what the official library should do with this thing so we opted to stay at the old use of assigning 3d models by using path variables directly in the footprints 3d model path. (This way the library stays compatible with previous versions of kicad.)

The only thing this seems to do is adding the path to the dropdown dialog with which you can open a folder in the tree view in the Select 3D Model dialog. Which means it’s not an environment variable, it’s just like an extra “file history” item.

Don’t really agree with the above. It’s more than “an item” since that variable (I call it “environment variable” since that’s mentioned in the upper part of the Configure Paths dialogue box) is also used in the Manage Footprints Libraries section where it’s used as ${KICAD_WALTER_MODS) prefix. In that scenario, it has nothing to do with file history…

Agree or not, I was talking about facts. “3D Search Paths” is diffent than “Environment Variables”. You may disagree about whether it’s usable or intuitive, not about what it does. In my opinion it’s not intuitive nor represent good usability.

Thanks for some clarification. In the mean time, I will use the real path to overcome the problem until it’s possible to use env vars for the 3D Search Path section too.

But in the mean time I’ve seen a weird situation (which might be related to the above):

When I open the Assign Footprints and I’m selecting one of the extra libraries I got, I initially don’t see the 3D view of the footprint if I select a component, say cnpa_10x33:

If I then “refresh” the path to the 3D packages and reselect that very same item, I get the 3D view too:

If I now select another library and come back to that very same one later on, I lost my 3D views and have to reselect the 3D path again before I see the 3D views. Weather I select the button “Apply, Save Schematic & Continue” or not, that doesn’t make any difference…

Any thoughts?

No need to be blunt…

If you add your path to the Environment Variables section of the dialog instead of the 3D Search Paths, you can use it in your 3D model assignment. I think we talked past each other. You wrote about 3D Search Paths, I told what it actually does. You apparently thought it’s like the environment variables above that section - or am I still wrong? I’m sorry about sounding blunt.

No probs…

I digged a bit deeper into it and what you said about the “preferred folder” that will be opened when you click the small browse button in the 3D Search Path section, you’re right: the folder will be opened at the location defined by the ${blablabla} variable (possibly extended with extra subdirs added to it). So, it’s indeed not the way I thought it was to be used.

Like I mentioned in another post, I’ll use the full path until a better method is provided.

I read again and did some tests. It looks like I didn’t understand your original intention and also what the 3d search paths can do. It’s something like between the old 3d model path and the footprint or symbol library systems.

Adding a library table mechanism for 3D models is in plans for v6, see https://github.com/KiCad/kicad-source-mirror/blob/master/Documentation/development/road-map-r6.md / " 3D Model Improvements". Therefore I’m not sure a feature wish for env var substitution in search paths would be useful.

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