Forum

Author Topic: How do you export to Sketchfab through the Python API?  (Read 5889 times)

nickponline

  • Newbie
  • *
  • Posts: 38
    • View Profile
How do you export to Sketchfab through the Python API?
« on: July 19, 2014, 03:29:21 AM »
How do you export to Sketchfab through the Python API? It doesn't seem to be documented, but I'm sure it can be done :)

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15086
    • View Profile
Re: How do you export to Sketchfab through the Python API?
« Reply #1 on: July 21, 2014, 11:01:41 AM »
Hello nickponline,

Unfortunately, upload to Sketchfab/Verold using Python commands is not possible at the moment.
Best regards,
Alexey Pasumansky,
Agisoft LLC


MarineL

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: How do you export to Sketchfab through the Python API?
« Reply #3 on: April 04, 2023, 03:38:10 AM »
Hi, is it possible now? I have ~100s of models I would like to automatically decimate and upload to Sketchfab
Cheers :)

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15086
    • View Profile
Re: How do you export to Sketchfab through the Python API?
« Reply #4 on: April 12, 2023, 04:17:08 PM »
Hello MarineL,

You can try to use PublishData task for that:

Code: [Select]
publish = Metashape.Tasks.PublishData()
publish.service = Metashape.ServiceType.ServiceSketchfab
publish.source_data = Metashape.DataSource.ModelData
publish.title = "Model title"
publish.description = "Model description"
publish.is_draft = False
publish.is_private = False
publish.token = "*****"

publish.apply(chunk)

You may modify it to ask for the token value:
Code: [Select]
token = Metashape.app.getString("Please, input Sketchfab API token:")so that you do not need to keep the sensible information in the script body.
Best regards,
Alexey Pasumansky,
Agisoft LLC