Forum

Author Topic: Addressing multiple Models and Dense clouds  (Read 3027 times)

wojtek

  • Sr. Member
  • ****
  • Posts: 284
    • View Profile
Addressing multiple Models and Dense clouds
« on: April 05, 2019, 02:52:01 PM »
I'm struggling to figure out how to address 3D Models and Dense Clouds that are not "Set as Default"

Is there a method for addressing those in Python api that i missed?

For example there is no exportModel method for chunk.models list and I have not found a way to "Set as Default" from python.

Major Domo

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Addressing multiple Models and Dense clouds
« Reply #1 on: April 06, 2019, 12:58:08 AM »
Hi Wojtek,

You can cycle trough dense clouds with something like this:

Code: [Select]
import Metashape
chunk = Metashape.app.document.chunk

for each in chunk.dense_clouds:
    print(each.label)


and choose the default with something like this:


Code: [Select]
import Metashape
chunk = Metashape.app.document.chunk

chunk.dense_cloud = chunk.dense_clouds[-1] #This selects the last dense cloud,, but you can use whatever index suits you.

chunk.dense_cloud.label = "Hello there." #just to prove it works

The same applies to chunk.model and chunk.models

Hope this helps!

wojtek

  • Sr. Member
  • ****
  • Posts: 284
    • View Profile
Re: Addressing multiple Models and Dense clouds
« Reply #2 on: April 06, 2019, 11:42:58 AM »
Ah, derp.

Thanks a lot!