I'm trying to create a set of scripts, with one "metashape_util.py" script which is loaded in each of my individual scripts so that I don't have to rewrite much of the code
One big issue I am running into now is that if for example "toolset1.py" has the following code:
Then when I load "metashape_util.py" with the load script button in the console GUI, I get this error:
2020-03-19 21:44:57 Traceback (most recent call last):
2020-03-19 21:44:57 File "[...]/src/metashape_gliht_tools.py", line 20, in
2020-03-19 21:44:57 import metashape_util as mu
2020-03-19 21:44:57 File "[...]/src/metashape_util.py", line 8, in
2020-03-19 21:44:57 found_major_version = ".".join(Metashape.app.version.split('.')[:2]) #1.5 or 1.6
2020-03-19 21:44:57 NameError: name 'Metashape' is not defined
2020-03-19 21:44:57 Error: name 'Metashape' is not defined
I'm trying to create a set of scripts, with one "metashape_util.py" script which is loaded in each of my individual scripts so that I don't have to rewrite much of the code
One big issue I am running into now is that if for example "toolset1.py" has the following code:
import metashape_util
and "metashape_util.py" has the following code:
found_major_version = ".".join(Metashape.app.version.split('.')[:2])
Then when I load "metashape_util.py" with the load script button in the console GUI, I get this error:
Is there any suggested work around for this?