24 #include "../gpencil_io.h"
46 static bool is_keyframe_included(
bGPdata *gpd_,
const int32_t framenum,
const bool use_selected)
54 if (gpf->framenum == framenum) {
55 if ((!use_selected) || (use_selected && (gpf->flag &
GP_FRAME_SELECT))) {
70 switch (iparams.
mode) {
89 GpencilExporterPDF *exporter,
96 exporter->frame_number_set(iparams->
frame_cur);
97 result |= exporter->new_document();
101 exporter->prepare_camera_params(
scene, iparams);
102 exporter->add_newpage();
103 exporter->add_body();
104 result = exporter->write();
111 (!is_keyframe_included(gpd_eval, i,
true))) {
117 exporter->prepare_camera_params(
scene, iparams);
118 exporter->frame_number_set(i);
119 exporter->add_newpage();
120 exporter->add_body();
122 result = exporter->write();
124 exporter->frame_number_set(iparams->
frame_cur);
140 static bool gpencil_io_export_frame_svg(GpencilExporterSVG *exporter,
148 exporter->frame_number_set(iparams->
frame_cur);
149 exporter->prepare_camera_params(
scene, iparams);
152 result |= exporter->add_newpage();
155 result |= exporter->add_body();
158 result = exporter->write();
179 switch (iparams->
mode) {
182 GpencilExporterSVG exporter = GpencilExporterSVG(filepath, iparams);
183 return gpencil_io_export_frame_svg(&exporter, scene_, iparams,
true,
true,
true);
189 GpencilExporterPDF exporter = GpencilExporterPDF(filepath, iparams);
190 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)
bool BKE_scene_camera_switch_update(struct Scene *scene)
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
static bool gpencil_io_import_frame(void *in_importer, const GpencilIOParams &iparams)
bool gpencil_io_import(const char *filepath, GpencilIOParams *iparams)
bool gpencil_io_export(const char *filepath, GpencilIOParams *iparams)