Agisoft Metashape
Agisoft Metashape => Python and Java API => Topic started by: ppkong on June 05, 2014, 05:10:34 AM
-
In my project there are 100 images, I want to use the Python script to disable one of ten images. I have made a txt file to record these ten photos name.
Now I want to use Python scripting to achieve this functionality, including reading txt and disable photo, What should I use class PhotoScan.Camera.enable
-
Additional supplementary, I used the following code, but it does not seem to work
import PhotoScan
doc = PhotoScan.app.document
chunk = PhotoScan.Chunk()
p = PhotoScan.Camera()
p.enabled = False
-
Hello ppkong,
Providing that you have input camera names to be disabled in camera_names list, I can suggest the following code:
import PhotoScan
doc = PhotoScan.app.document
chunk = doc.activeChunk
camera_names = list()
#then you need to populate it with filenames
for camera in chunk.cameras:
if camera.label in camera_names:
camera.enabled = False
In your second post you seem to be using newly created camera instance that has no connection to your project.
-
Aha!Alexey Pasumansky,Thanks very much for your reply!
I have followed your method to solve this problem, thanks again!You are so great!