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 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 (${KICAD6_3DMODEL_DIR}/Resistor_SMD.3dshapes/R_1206_3216Metric.wrl).
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:
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.