I’ve been building up a local footprint library in a git repo and that is mostly going fine. I have a directory in that repo for 3D models and I added it as a new path environment variable so that others using the repo can easily use the library and adapt to whatever local PC location they’re using for their repo.
This mostly seems to work except when I try to export a STEP file. Only the 3D models that are either in the standard KICAD7_3DMODEL_DIR location or ones that are (accidentally) entered with their absolute path show up in the step. All models in my custom path variable location cause a message saying that it “Could not add 3D model to … File not found.” If I hand edit the path to be absolute it then works.
The interesting thing is that these models show up in the 3D Viewer and also in the VRML export. I’ve only found it to be a problem in the STEP export.
I wonder if the step export is not substituting the environment variables prior to loading the model files?
I’m using 7.0.10 on Windows.
Note that I’ve been checking STEP files and VRML files using FreeCAD.
I can’t reproduce this (7.0.10 on linux). My custom vars work fine for step export.
- I put 3 resistors onto a board.
- I left one of them with the default model path (
- I changed one of them to point to a copy of the default WRL in a new location, using a new environment variable that I just added.
- I changed the last one to point to a copy of the default STEP in a new location, also using my new environment variable.
- I exported step with the “subsitute similarly named models” open checked, although this should only be required for the two footprints that point to WRL models, not the one that points to a STEP file.
All 3 footprints show a model in the footprint 3D preview, the board 3D viewer, and in the board STEP export.
Can you add some screenshots of your path setup? Here’s what I have in the footprint properties and in the Configure Paths dialog:
Can you make a simple test project for this?
For example with one default footprint that exports properly (to verify STEP export works) and one of your own footprints (with it’s 3D model in a sub directory) to show that this does not work.
Such a test project helps a lot with independently verifying that there is a problem (or bug) and with fixing the bug too.
Ok. I started a test project and added two parts. One part was a part that referenced a 3D model from the KiCad model place. The other referenced my location specified by my path environment variable. I checked the 3D viewer: two parts. I then exported a step and opened in FreeCAD.
And it worked. That’s frustrating. At this rate I’m going to get a reputation for crying wolf!
Thanks again for being so responsive. I guess I’ll need to figure out what it is about my other project that made it not work. That’s two odd things I need to follow up on now.
I just opened my project again - the one that had the problem I reported. It works now. It’s like KiCad is gaslighting me. Maybe it was all a dream?
If you can reproduce the issue again, take some screenshots of your paths (but I hope you never see the problem again).