Some odd behavior, probably a bug with 3d search path.
I added a footprint and a STEP model to my usual directory, and associated the footprint with it. Added the path to the 3d search path, and the name of the step file in the “3d model(s)” list. Looked fine on preview.
Leave the preview window, go back to the PCB.
3d model does not appear with the PCB in a 3d view.
Re-open the footprint editor. 3d preview shows a blank pcb (just outline and holes)
Click on “Configure Paths” - my path is still there under “3d search path”. Change nothing.
Hit “OK”. The 3d model magically appears!
Hit “OK”, to get back to pcbnew
3d viewer looks right, includes the part correctly
Make any change to the PCB (move a different part for example)
3d model is now gone.
This is very strange, it seems to be losing the path or reference to the 3d file, even with no changes.
However, if I add a full path to the 3D Model field (using an environment variable or full path), it works properly.
It appears that there’s a bug in the “3d search path” or something related? I’d expect it to either find the step file, or not - I wouldn’t expect it to find it until the PCB changes in some unrelated way.
Restarting KiCad makes the 3d models disappear from the PCB 3d view. The preview is also gone on the footprint properties (blank pcb with holes).
Double-clicking on the footprint, and going to the 3d tab, still shows the file in the table (not an entire path).
If I click “configure paths” and then “ok” (without changes) it does recognize the part, and restores the preview, and then the PCB renders correctly. This is as before. Seems that closing/opening is similar behavior as changing something on the pcb.
It looks like there’s a bug in the paths part. When using a complete path, even with an environment variable, it works correctly.
How are your relative paths defined?
I do not really use relative paths myself, and I think this is the intended way for KiCad.
If you look at: KiCad / Preferences / Configure paths
Then you see something like:
The KICAD_USER_TEMPLATE_DIR is an “official” variable that I once used while experimenting with templates. the “KIDATASHEET” variable however, I added myself, and then in the schematic symbols I use this KIDATASHEET var as a building block to make an absolute path;
Maybe a similar way is adaptable for your personal 3D component libraries.
If you look at: Eeschema / Help / Eeschema Manual Chapter 5.1.5 you see the KIPRJMOD environment variable, which always points to the root of the current project.
${MY_FOOTPRINT_DIR}/mymodel.STEP (where MY_FOOTPRINT_DIR is of course defined as an environment variable)
or
e:\kicad stuff\mymodel.step
An incomplete path is just the filename
mymodel.step
The incomplete path (filename) should still work, because the location in the list of 3d search paths, no? And it does work - briefly - until the file is reopened or the PCB is changed.
Since Windose is backwards , all your slashes should probably also be backwards, but anyway, mixing them is not a good idea.
Another thing to watch out for is whether you use a final slash in the MY_FOOTPRINT_DIR variable, to get to a final string without double, or missing (back) slashes.
Kicad doesn’t seem to care about which kind of slash is used, but I was actually using the windows backslash in all cases.
The ending slash is not used anywhere in kicad that I’ve seen, when describing directories. It’s also not included when using the browser tool to select a folder. And it’s removed when typed manually.
KiCad probably tries to be agnostic to whether user enters slashes or back slashes, just as with dots and comma’s in numbers, and one or 2 weeks ago a bug fix for this was submitted, cause the dot and comma substitution did not always work well due to locale issues.
When debugging problems, it’s usually best to exclude possible problems by not relying on such convenience features. (Or make explicit use of them for testing purposes).