[Copy_Files] Made 3D models use the project path as base
- To avoid problems when KiCad is running from other place
This commit is contained in:
parent
dff7d9d299
commit
82229e126d
|
|
@ -71,7 +71,7 @@ class FilesList(Optionable):
|
||||||
dest = os.path.basename(fname)
|
dest = os.path.basename(fname)
|
||||||
else:
|
else:
|
||||||
dest = os.path.relpath(fname, os.getcwd())
|
dest = os.path.relpath(fname, os.getcwd())
|
||||||
return os.path.join(self.output_dir, dest)
|
return '${KIPRJMOD}/'+os.path.join(self.output_dir, dest)
|
||||||
|
|
||||||
|
|
||||||
class Copy_FilesOptions(Base3DOptions):
|
class Copy_FilesOptions(Base3DOptions):
|
||||||
|
|
|
||||||
|
|
@ -1464,7 +1464,8 @@ def test_copy_files_2(test_dir):
|
||||||
for m in MODELS:
|
for m in MODELS:
|
||||||
ctx.expect_out_file(m, sub=True)
|
ctx.expect_out_file(m, sub=True)
|
||||||
# Make sure the PCB points to them
|
# Make sure the PCB points to them
|
||||||
ctx.search_in_file(prj+'.kicad_pcb', ['model "{}"'.format(m) for m in MODELS if m.endswith('wrl')], sub=True)
|
ctx.search_in_file(prj+'.kicad_pcb', ['model "{}"'.format(r'\$\{KIPRJMOD\}/'+m) for m in MODELS if m.endswith('wrl')],
|
||||||
|
sub=True)
|
||||||
# Some warnings
|
# Some warnings
|
||||||
ctx.search_err(r'WARNING:\(W098\) 2 3D models downloaded') # 2 models are missing and they are downloaded
|
ctx.search_err(r'WARNING:\(W098\) 2 3D models downloaded') # 2 models are missing and they are downloaded
|
||||||
ctx.search_err(r'WARNING:\(W100\)', invert=True) # 2 models has the same name, but goes to different target
|
ctx.search_err(r'WARNING:\(W100\)', invert=True) # 2 models has the same name, but goes to different target
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue