40 #include "../gpencil_io.h"
62 static bool is_keyframe_included(
bGPdata *gpd_,
const int32_t framenum,
const bool use_selected)
70 if (gpf->framenum == framenum) {
71 if ((!use_selected) || (use_selected && (gpf->flag &
GP_FRAME_SELECT))) {
86 switch (iparams.
mode) {
105 GpencilExporterPDF *exporter,
112 exporter->frame_number_set(iparams->
frame_cur);
113 result |= exporter->new_document();
116 if (use_frame_selected) {
118 if (!is_keyframe_included(gpd_eval, i, use_frame_selected)) {
124 exporter->prepare_camera_params(iparams);
125 exporter->frame_number_set(i);
126 exporter->add_newpage();
127 exporter->add_body();
129 result = exporter->write();
131 exporter->frame_number_set(iparams->
frame_cur);
136 exporter->prepare_camera_params(iparams);
137 exporter->add_newpage();
138 exporter->add_body();
139 result = exporter->write();
148 static bool gpencil_io_export_frame_svg(GpencilExporterSVG *exporter,
155 exporter->frame_number_set(iparams->
frame_cur);
156 exporter->prepare_camera_params(iparams);
159 result |= exporter->add_newpage();
162 result |= exporter->add_body();
165 result = exporter->write();
188 switch (iparams->
mode) {
191 GpencilExporterSVG exporter = GpencilExporterSVG(filename, iparams);
192 return gpencil_io_export_frame_svg(&exporter, iparams,
true,
true,
true);
198 GpencilExporterPDF exporter = GpencilExporterPDF(filename, iparams);
199 return gpencil_io_export_pdf(depsgraph_, scene_, ob, &exporter, iparams);
struct Scene * CTX_data_scene(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
void BKE_scene_graph_update_for_newframe(struct Depsgraph *depsgraph)
#define LISTBASE_FOREACH(type, var, list)
struct Depsgraph Depsgraph
struct ID * DEG_get_evaluated_id(const struct Depsgraph *depsgraph, struct ID *id)
const Depsgraph * depsgraph
@ GP_EXPORT_FRAME_SELECTED
bool gpencil_io_export(const char *filename, GpencilIOParams *iparams)
bool gpencil_io_import(const char *filename, GpencilIOParams *iparams)
static bool gpencil_io_import_frame(void *in_importer, const GpencilIOParams &iparams)