[3D models] More flexible about relative dirs

- When solving a relative path accept it to be relative to the
  PCB or relative to the current working directory.
This commit is contained in:
Salvador E. Tropea 2022-09-20 13:42:06 -03:00
parent e2fdf87d6b
commit dff7d9d299
1 changed files with 4 additions and 0 deletions

View File

@ -35,6 +35,10 @@ def do_expand_env(fname, used_extra, extra_debug):
if extra_debug:
logger.debug("- Expanded {} -> {}".format(fname, full_name))
if os.path.isfile(full_name) or ':' not in fname or GS.global_disable_3d_alias_as_env:
full_name_cwd = KiConf.expand_env(fname, used_extra, ref_dir=os.getcwd())
if os.path.isfile(full_name_cwd):
full_name = full_name_cwd
force_used_extra = True
if force_used_extra:
used_extra[0] = True
return full_name