KISYS3DMOD path change not working

I got tired of answer yes to the windows pain in the ar*s warning that I am dumping files in the program files folder. So I decided to move the pcb libraries and 3d packages to my google drive.

So I set the preferences-Configure paths up as;

If I then enter into the PCB file, edit a component to set up the 3D file, it has this;

So it still shows the old folder as the one it is referencing for the 3D packages. Why?
So it seems that the config file is not updating…or being referenced right or whatever. Anyone got a fix for it?

I did restart Kicad after changing it. This is after a restart of the computer as well. Still no change.

What happens when you hit [Remove 3D Shape] and then [Add 3D Shape] and use ‘absolute path’ (or relative? pff… :hushed:) when it asks you after you navigated to the 3D file?

PS: the link to the 3D shapes is stored with the footprint (.kicad_mod) in the .pretty folders.
Depending on what you had set up before you did the change KiCAD does what is stored in there…
To make it work without removing/adding the 3d models one by one you’d have to edit those footprint files manually and modify the last bit in the file (been there, done that, got the T-shirt ;-).

Example for KiCAD having a working KISYS3DMOD path variable and the 3D shape being stored in a subfolder of that folder (important bit in bold face) for a .kicad_mod file:


(pad 8 smd rect (at -7 9.25 270) (size 1.2 2.6) (layers F.Cu F.Paste F.Mask))
(model Modules/ESP07.wrl
(at (xyz 0 0 0))
(scale (xyz 1 1 1))
(rotate (xyz 0 0 0))
)
)

Path to 3D model for above example:

E:\Data_KiCAD_KiCAD_3D-Models\Modules\ESP07.wrl

KISYS3DMOD:

E:\Data_KiCAD_KiCAD_3D-Models

PPS: yes, I store the 3d models in subfolders that have the same names as the .pretty folders for the footprints.

The Path configuration dialog window suggest that KISYS3DMOD is declared elsewhere (grayed). So it’s 100% override outside KiCad environment.

What are your paths in %APPDATA%\kicad\kicad_common configuration file? Is there a KISYS3DMOD in Windows paths (Call cmd.exe and enter SET command)? Do you run KiCad via kicad.exe or RunKiCad.bat (provided by alternative installer)?

I run Kicad from the desktop short cut. It has the Target as “C:\Program Files\KiCad\bin\kicad.exe”.

Running the Set command shows;

The kicad-common also lists;

WorkingDir=C:\Program Files\KiCad
ShowEnvVarWarningDialog=1
kicad_fplib_url=https://github.com/KiCad
kicad_fplib_last_download_dir=C:\Users\Colin\Google Drive\Midworld08 GDrive\Kicad\PCBLibraries
Editor=C:\Program Files (x86)\Notepad++\notepad++.exe
[EnvironmentVariables]
KICAD_PTEMPLATES=C:\Program Files\KiCad\share\kicad\template\
KIGITHUB=https://github.com/KiCad
KISYS3DMOD=C:\Program Files\KiCad\share\kicad\modules\packages3d\
KISYSMOD=C:\Program Files\KiCad\share\kicad\modules\

So where do I start? Getting the SET command sorted, then edit the kicad-common file?

@ Joan.

If I delete the 3D model and then add it again, and use absolute path then it displays. But what a pain, hopefully getting the set command and kicad-common will be the solution.

Cheers

1 Like

That dialog is misleading; the issue is that the “Path Configuration” does not really affect the environment variables; it does not create a “KISYS3DMOD” env var. However, if a KISYS3DMOD env var exists, its value will be used to populate that entry. As far as I can tell the only way to get this to work at the moment is to work out how to define an environment variable for kicad when it is run. Many years ago this could be done by right-clicking the executable within the file browser, selecting “properties” and setting the variables via one of the tabs. In this case you might edit the “shortcut” properties.

Unfortunately, thought it may be difficult to believe, that problem is not easily fixed in the Stable series. I’ve just submitted a patch to fix that issue in the development branch, but the fix cannot be back-ported.

1 Like

Go to Control Panel… bla bla… where you set the Environment variable in Windows… DELETE KISYS3DMOD.
I just did that to test it - see it’s missing now:

Now my KiCAD Path config looks like this:

As KISYSMOD is still configured in Windows, not KiCAD - it’s still greyed out.
KISYS3DMOD is defined by KiCAD now when it starts - so it’s editable.

And the 3d shapes still work for me.
It doesn’t matter if Windows or KiCAD is defining it from my point of view/experience.

Again, your problem must be the former configuration that is stored in the .kicad_mod files (footprints) in the .pretty folders and you have to edit them… one by one - there is no way around that afaik (if that is the problem).

Can you please post the last bit of a .kicad_mod file that doesn’t work when you set the KISYS3DMOD path correctly and one that does work (the one where you removed/added the 3d shape)?
So we can compare…

1 Like

Sorry pal. You’re wrong. :yum: If KiCad related env variables isn’t defined elsewhere then KiCad Manager create those variables for his workspace. It is very easy to prove this.
Go to the Preferences, set cmd.exe as default text editor. From project tree select any item and try to edit it with text editor. The command shell should pop-up. Type set and you will see all KiCad variables declared in this dialog.

This way we can also debug variables while KiCad is running.

1 Like

You’re right - when I was looking through the source code I missed the part where the environment variables were set.

Beside of this the Path Configuration window still have minor issues. To delete any entry, you have to select whole row and default KiCad variables aren’t protected.

Well it all works good now.

Removed the Environment variable, and that stopped the greyed out can’t edit problem. Then set the folder to the new location and bingo the 3d visualization now works all good.

I haven’t needed to set anything in the kicad_mod file Joan its all working…

Now to get stepup going.

2 Likes

Hello i just had same problem and solve it. After i install on my win 10 laptop d:\ direction got same problem. when u open project file directly software its not running as an administrator cant reach user/folders in c:/ and show default paths. Because when i open it directly from kicad.exe as admin it shows correct paths. Solution was so simple…
not from shortcut from kicad.exe in ur installation path go properties/compatibility/run this program as an administrator do the same for all users just below. then apply thats it problem solved. Shame on me :smiley: i should know that .