Forum

Author Topic: "Saving is disabled"  (Read 5991 times)

lsnrc

  • Newbie
  • *
  • Posts: 6
    • View Profile
"Saving is disabled"
« on: February 15, 2019, 10:02:56 PM »
Hi,

I am writing a Python script to build a dense point cloud from a set of images. Everything seems to be working fine, except for exporting (exportPoints) and saving the Metashape document. In fact, just a simple code as follows returns an OSError: DOcument.save(): saving is disabled.

import Metashape
doc    = Metashape.Document()
doc.save('test_001.psx')
chunk    = doc.addChunk()
doc.save()

I have checked the doc.read_only, it is set to False.
Any help would be appreciated.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14753
    • View Profile
Re: "Saving is disabled"
« Reply #1 on: February 16, 2019, 12:46:07 PM »
Hello lsnrc,

Is Metashape Pro activated?
Code: [Select]
print(Metashape.app.activated)
Best regards,
Alexey Pasumansky,
Agisoft LLC

lsnrc

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: "Saving is disabled"
« Reply #2 on: February 18, 2019, 04:33:37 PM »
Hi Alexey,

print(Metashape.app.activated) is returning False. I guess this is the reason. But how do I activate it ?
Thanks again !

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14753
    • View Profile
Re: "Saving is disabled"
« Reply #3 on: February 18, 2019, 04:57:47 PM »
Hello lsnrc,

You can activate either from the GUI (if possible) or using the following terminal command:

metashape.sh --activate 11111-22222-33333-44444-55555
or
metashape.exe --activate 11111-22222-33333-44444-55555
Best regards,
Alexey Pasumansky,
Agisoft LLC

lsnrc

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: "Saving is disabled"
« Reply #4 on: February 18, 2019, 05:02:56 PM »
Thank you Alexey.
In fact I wasn't running the python script from the GUI, so that is why my license was not activated.

3DWinter

  • Full Member
  • ***
  • Posts: 103
    • View Profile
Re: "Saving is disabled"
« Reply #5 on: November 17, 2020, 11:51:51 PM »
I have a similar problem. My Metashape GUI is active, but when I type
Code: [Select]
print(Metashape.app.activated)
False

So a. why do I need to activate it twice(is it to activate the installed wheel)?
b.  I have multiple licenses but on different computers; how do I get the license on the computer running the script?

Thanks

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14753
    • View Profile
Re: "Saving is disabled"
« Reply #6 on: November 18, 2020, 07:52:28 PM »
Hello 3DWinter,

When using a stand-alone Metashape Python module on the computer, where Metashape Pro license is already activated via GUI, I can suggest to define agisoft_LICENSE environment variable as a path to the directory where the valid .lic file is present (most likely - Metashape Pro installation folder).
Best regards,
Alexey Pasumansky,
Agisoft LLC

3DWinter

  • Full Member
  • ***
  • Posts: 103
    • View Profile
Re: "Saving is disabled"
« Reply #7 on: November 19, 2020, 11:09:40 PM »
Metashape.License.activate(key=activation key is a string)  not a file path.  I was thinking of opening the .lic file and read the line "# Activation key" , but there are two problems with that:
a. There is a pound sign at the beginning of the line, so it will be masked from python reading it.
b. the Activation key has is ****-****-*****-*****-some numbers and letters. Not sure why the key is obstructed by star '*' !?

Is this activation need to run every time I run a standalone python script running Metashape?


I did find the activation key in my email and tried the example above
Code: [Select]
metashape.exe --activate key-key-key-key
Activation successful
And still when I went back to python code I got
Code: [Select]
print(Metashape.app.activated)
False

*I am testing on my laptop, which has the Agisoft Pro license
« Last Edit: November 20, 2020, 12:42:49 AM by 3DWinter »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14753
    • View Profile
Re: "Saving is disabled"
« Reply #8 on: November 20, 2020, 01:36:07 PM »
Hello 3DWinter,

Have you tried the approach with setting up the agisoft_LICENSE environment variable on your laptop?

If you need to recover your license key based on the .lic file, please send the file to support@agisoft.com. The key is not shown in the file itself for security reasons in order to avoid accidental leak of the license key information.

When you are using metashape.exe --activate command, the license file will be written to the Metashape Pro installation directory (where from the executable is run), it does have nothing to do with the stand-alone Python module, which may we looking for the license file in the Python working directory, for example.
But if still do not want to use suggested way of setting up agisoft_LICENSE variable, you need to re-activate the license from the Python module using the following line from the script started using stand-alone module (not via metashape.exe -r script.py), where the valid license key should be input as string to the .activate command:
Code: [Select]
Metashape.License().activate("AAAAA-BBBBB-CCCCC-DDDDD-EEEEE")
Best regards,
Alexey Pasumansky,
Agisoft LLC

3DWinter

  • Full Member
  • ***
  • Posts: 103
    • View Profile
Re: "Saving is disabled"
« Reply #9 on: November 24, 2020, 01:47:15 AM »
Thanks that work. I did Metashape.License.activate(license_key) instead of Metashape.License().activate(license_key)

thanks