Index: trunk/src/hid_cam.c =================================================================== --- trunk/src/hid_cam.c (revision 37319) +++ trunk/src/hid_cam.c (revision 37320) @@ -263,6 +263,8 @@ dst->flip_x = 1; else if (strcmp(curr, "flip_y") == 0) dst->flip_y = 1; + else if (strcmp(curr, "force_nonempty") == 0) + dst->force_nonempty = 1; else rnd_message(RND_MSG_ERROR, "CAM: ignoring unknown global parameter [%s]\n", curr); } @@ -361,6 +363,13 @@ return -1; } +rnd_bool pcb_cam_layergrp_is_empty(pcb_cam_t *dst, pcb_board_t *PCB, rnd_layergrp_id_t group) +{ + if (dst->force_nonempty) + return 0; + return pcb_layergrp_is_empty(PCB, group); +} + int pcb_cam_end(pcb_cam_t *dst) { free(dst->inst); Index: trunk/src/hid_cam.h =================================================================== --- trunk/src/hid_cam.h (revision 37319) +++ trunk/src/hid_cam.h (revision 37320) @@ -23,6 +23,7 @@ unsigned int okempty_group:1; /* do not warn if no group exported */ unsigned flip_x:1; unsigned flip_y:1; + unsigned force_nonempty:1; /* export even if layer group is empty */ /* private/internal/cache */ const char *fn_template; @@ -97,4 +98,8 @@ directly, instead of manipulating an attribute */ char *pcb_derive_default_filename_(const char *pcbfile, const char *suffix); +/* Returns whether the layer groups hould be considered empty; most of the times + this matches pcb_layergrp_is_empty(), but cam may override this */ +rnd_bool pcb_cam_layergrp_is_empty(pcb_cam_t *dst, pcb_board_t *PCB, rnd_layergrp_id_t group); + #endif