[gegl] gegl: add GEGL_SERIALIZE_BAKE_ANIM flag



commit 2f2aaf703879b66841106273f16daca90e9e3817
Author: Øyvind Kolås <pippin gimp org>
Date:   Mon May 13 11:33:57 2019 +0200

    gegl: add GEGL_SERIALIZE_BAKE_ANIM flag
    
    This serializes the currently set animated property values - instead of the
    full keyframed animation. This will enable rendered frame caching in the UI.

 gegl/buffer/gegl-buffer-index.h | 2 +-
 gegl/gegl-serialize.c           | 9 ++++++++-
 gegl/gegl-utils.h               | 3 ++-
 3 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-index.h b/gegl/buffer/gegl-buffer-index.h
index 10116c407..cb1c5eed9 100644
--- a/gegl/buffer/gegl-buffer-index.h
+++ b/gegl/buffer/gegl-buffer-index.h
@@ -114,7 +114,7 @@ GeglBufferTile * gegl_tile_entry_new (gint x,
 
 /* intializing the header causes the format to be written out
  * as well as a hidden comment after the zero terminated format
- * with additional human readable information about the header.
+ * with additional human readable version of information from the header.
  */
 void gegl_buffer_header_init (GeglBufferHeader *header,
                               gint              tile_width,
diff --git a/gegl/gegl-serialize.c b/gegl/gegl-serialize.c
index ce35d6ed1..dcfcaa168 100644
--- a/gegl/gegl-serialize.c
+++ b/gegl/gegl-serialize.c
@@ -24,6 +24,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include "property-types/gegl-paramspecs.h"
+#include "property-types/gegl-audio-fragment.h"
 
 #ifdef G_OS_WIN32
 #include <direct.h>
@@ -860,6 +861,7 @@ gegl_serialize2 (GeglNode         *start,
 {
   char *ret = NULL;
   gboolean trim_defaults = flags & GEGL_SERIALIZE_TRIM_DEFAULTS;
+  gboolean bake_anim = flags & GEGL_SERIALIZE_BAKE_ANIM;
   GeglNode *iter;
 
   GString *str = g_string_new ("");
@@ -955,7 +957,8 @@ gegl_serialize2 (GeglNode         *start,
                 anim_quark = g_quark_from_string (tmpbuf);
                 sprintf (tmpbuf, "%s-rel", property_name);
                 rel_quark = g_quark_from_string (tmpbuf);
-                anim_path = g_object_get_qdata (G_OBJECT (iter), anim_quark);
+                if (!bake_anim)
+                  anim_path = g_object_get_qdata (G_OBJECT (iter), anim_quark);
                 rel_orig = g_object_get_qdata (G_OBJECT (iter), rel_quark);
 
                 if (property_type == G_TYPE_FLOAT)
@@ -1167,6 +1170,10 @@ gegl_serialize2 (GeglNode         *start,
                         printed = TRUE;
                       }
                   }
+                else if (property_type == GEGL_TYPE_AUDIO_FRAGMENT)
+                  {
+                    /* ignore */
+                  }
                 else
                   {
                     g_warning (
diff --git a/gegl/gegl-utils.h b/gegl/gegl-utils.h
index 58839011f..439fbd953 100644
--- a/gegl/gegl-utils.h
+++ b/gegl/gegl-utils.h
@@ -25,7 +25,8 @@ G_BEGIN_DECLS
 typedef enum GeglSerializeFlag {
   GEGL_SERIALIZE_TRIM_DEFAULTS = (1<<0),
   GEGL_SERIALIZE_VERSION       = (1<<1),
-  GEGL_SERIALIZE_INDENT        = (1<<2)
+  GEGL_SERIALIZE_INDENT        = (1<<2),
+  GEGL_SERIALIZE_BAKE_ANIM     = (1<<3),
 } GeglSerializeFlag;
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]