Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Mon, 10 Jul 2017 07:48:57 +0000 (17:48 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 10 Jul 2017 07:48:57 +0000 (17:48 +1000)
source/blender/editors/io/io_cache.c
source/blender/windowmanager/intern/wm_playanim.c

index af6f55d7a643b2de593796de22da793a7fb7da58..a5e90ebbe7a1ee302b40ebdaa263b218de1ce7ad 100644 (file)
@@ -97,22 +97,24 @@ static int cachefile_open_exec(bContext *C, wmOperator *op)
        BLI_strncpy(cache_file->filepath, filename, FILE_MAX);
        BKE_cachefile_reload(bmain, cache_file);
 
-       /* hook into UI */
-       PropertyPointerRNA *pprop = op->customdata;
-
-       if (pprop->prop) {
-               /* when creating new ID blocks, use is already 1, but RNA
-                * pointer se also increases user, so this compensates it */
-               id_us_min(&cache_file->id);
-
-               PointerRNA idptr;
-               RNA_id_pointer_create(&cache_file->id, &idptr);
-               RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr);
-               RNA_property_update(C, &pprop->ptr, pprop->prop);
+       /* Will be set when running invoke, not exec directly. */
+       if (op->customdata != NULL) {
+               /* hook into UI */
+               PropertyPointerRNA *pprop = op->customdata;
+               if (pprop->prop) {
+                       /* when creating new ID blocks, use is already 1, but RNA
+                        * pointer se also increases user, so this compensates it */
+                       id_us_min(&cache_file->id);
+
+                       PointerRNA idptr;
+                       RNA_id_pointer_create(&cache_file->id, &idptr);
+                       RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr);
+                       RNA_property_update(C, &pprop->ptr, pprop->prop);
+               }
+
+               MEM_freeN(op->customdata);
        }
 
-       MEM_freeN(op->customdata);
-
        return OPERATOR_FINISHED;
 }
 
index e2e0d7dd4509556df18bc801d2f978dd851686e6..fdcded8e50a0bff02acd95b08c01d551639e75d8 100644 (file)
@@ -1437,8 +1437,7 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
 
                        ps.next_frame = ps.direction;
 
-
-                       while ((hasevent = GHOST_ProcessEvents(g_WS.ghost_system, 0)) || ps.wait2) {
+                       while ((hasevent = GHOST_ProcessEvents(g_WS.ghost_system, ps.wait2))) {
                                if (hasevent) {
                                        GHOST_DispatchEvents(g_WS.ghost_system);
                                }