I am trying to set the autofocus area for my Nikon D7200
I retrieved the config object and saw this entry in it:
{
"idx": "6,6,0,0",
"ro": 0,
"name": "changeafarea",
"label": "Set Nikon Autofocus area",
"type": 2,
"typestr": "GP_WIDGET_TEXT",
"value": "0x0"
},
I'm not quite sure what parameters to pass into gp_camera_set_single_config()
According to the codebase I need to pass in
gp_camera_set_single_config, ($self, name, widget, context)
In order to change the center of the autofocus to pixel 100x100 (WIDTH x HEIGHT), I've tried the following commands, but not really getting anywhere. Didn't know if anyone happened to know how to pass this param?
import gphoto2 as gp
# setup
camera = gp.check_result(gp.gp_camera_new())
context = None
gp.check_result(gp.gp_camera_init(camera, self.context))
# Method 1
gp.gp_camera_set_single_config(camera, 'changefarea', '100x100')
# Method 2
gp.gp_camera_set_single_config(camera, '--changefarea', '100x100')
# Method 3
gp.gp_camera_set_single_config(camera, 'changefarea', {
"idx": "6,6,0,0",
"ro": 0,
"name": "changeafarea",
"label": "Set Nikon Autofocus area",
"type": 2,
"typestr": "GP_WIDGET_TEXT",
"value": "100x100"
})
# Method 4
gp.gp_camera_set_single_config(camera, '--changefarea', {
"idx": "6,6,0,0",
"ro": 0,
"name": "changeafarea",
"label": "Set Nikon Autofocus area",
"type": 2,
"typestr": "GP_WIDGET_TEXT",
"value": "100x100"
})
UPDATE #1:
In order to set a config you have to first get the config with gp.gp_camera_get_single_config(camera, 'changefarea')
. Still unsure of what params to pass though.