And for sure forgot to commit another cleaup patch
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 19 Aug 2013 10:54:15 +0000 (10:54 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 19 Aug 2013 10:54:15 +0000 (10:54 +0000)
--
svn merge -r59259:59260  ^/branches/soc-2013-depsgraph_mt

48 files changed:
release/datafiles/startup.blend
release/scripts/startup/bl_ui/properties_data_curve.py
release/scripts/startup/bl_ui/properties_render.py
source/blender/blenkernel/BKE_curve.h
source/blender/blenkernel/BKE_depsgraph.h
source/blender/blenkernel/BKE_displist.h
source/blender/blenkernel/BKE_mball.h
source/blender/blenkernel/BKE_scene.h
source/blender/blenkernel/depsgraph_private.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/font.c
source/blender/blenkernel/intern/mball.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/scene.c
source/blender/blenlib/BLI_task.h [deleted file]
source/blender/blenlib/BLI_threads.h
source/blender/blenlib/CMakeLists.txt
source/blender/blenlib/intern/sort.c
source/blender/blenlib/intern/task.c [deleted file]
source/blender/blenlib/intern/threads.c
source/blender/blenloader/intern/readfile.c
source/blender/bmesh/intern/bmesh_queries.c
source/blender/bmesh/intern/bmesh_queries.h
source/blender/bmesh/tools/bmesh_edgesplit.c
source/blender/compositor/intern/COM_MemoryBuffer.cpp
source/blender/editors/curve/curve_intern.h
source/blender/editors/curve/curve_ops.c
source/blender/editors/curve/editcurve.c
source/blender/editors/mesh/editmesh_rip.c
source/blender/editors/object/object_edit.c
source/blender/editors/render/render_internal.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_view3d/drawobject.c
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_windowmanager_types.h
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_scene_api.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_playanim.c
source/creator/creator.c
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp

index 8b58493fe3a4a1b8e404ee214d1610104aabbab8..c604d16829ce6a5106e895002102e33bd2a83707 100644 (file)
Binary files a/release/datafiles/startup.blend and b/release/datafiles/startup.blend differ
index 1d90535b46f9c80789a11904cc76f69205062696..117a662cd072421c59b908f6bfbb99ea4f8ff472 100644 (file)
@@ -140,8 +140,6 @@ class DATA_PT_curve_texture_space(CurveButtonsPanel, Panel):
         row.column().prop(curve, "texspace_location", text="Location")
         row.column().prop(curve, "texspace_size", text="Size")
 
-        layout.operator("curve.match_texture_space")
-
 
 class DATA_PT_geometry_curve(CurveButtonsPanel, Panel):
     bl_label = "Geometry"
index bf4975f2e43ab4f3b2f54e6cc41cc3a507a76e21..799c109ae0cd0606ce2260c4dc6b786277538132 100644 (file)
@@ -70,7 +70,6 @@ class RENDER_PT_render(RenderButtonsPanel, Panel):
         row.operator("render.play_rendered_anim", text="Play", icon='PLAY')
 
         layout.prop(rd, "display_mode", text="Display")
-        layout.prop(rd, "use_lock_interface")
 
 
 class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
index 1d48063e1439a8736130e2d797d8ec4e5269857d..94469381a35018a7369f679beb55ee76f005690b 100644 (file)
@@ -71,12 +71,11 @@ short BKE_curve_type_get(struct Curve *cu);
 void BKE_curve_type_test(struct Object *ob);
 void BKE_curve_curve_dimension_update(struct Curve *cu);
 
-void BKE_curve_boundbox_calc(struct Curve *cu, float r_loc[3], float r_size[3]);
 struct BoundBox *BKE_curve_boundbox_get(struct Object *ob);
 void BKE_curve_texspace_calc(struct Curve *cu);
 void BKE_curve_texspace_get(struct Curve *cu, float r_loc[3], float r_rot[3], float r_size[3]);
 
-bool BKE_curve_minmax(struct Curve *cu, bool use_radius, float min[3], float max[3]);
+bool BKE_curve_minmax(struct Curve *cu, float min[3], float max[3]);
 bool BKE_curve_center_median(struct Curve *cu, float cent[3]);
 bool BKE_curve_center_bounds(struct Curve *cu, float cent[3]);
 void BKE_curve_translate(struct Curve *cu, float offset[3], int do_keys);
@@ -120,7 +119,7 @@ void BKE_nurb_free(struct Nurb *nu);
 struct Nurb *BKE_nurb_duplicate(struct Nurb *nu);
 
 void BKE_nurb_test2D(struct Nurb *nu);
-void BKE_nurb_minmax(struct Nurb *nu, bool use_radius, float min[3], float max[3]);
+void BKE_nurb_minmax(struct Nurb *nu, float min[3], float max[3]);
 
 void BKE_nurb_makeFaces(struct Nurb *nu, float *coord_array, int rowstride, int resolu, int resolv);
 void BKE_nurb_makeCurve(struct Nurb *nu, float *coord_array, float *tilt_array, float *radius_array, float *weight_array, int resolu, int stride);
index e8ebf88d98cd43041ca67c154f44335f062291d6..6baf20aeb2c89e4423cbbe35cbd57c9d8c23cef4 100644 (file)
@@ -48,7 +48,6 @@ struct ID;
 struct Main;
 struct Object;
 struct Scene;
-struct ListBase;
 
 /* Build and Update
  *
@@ -116,28 +115,6 @@ void DAG_pose_sort(struct Object *ob);
 void DAG_editors_update_cb(void (*id_func)(struct Main *bmain, struct ID *id),
                            void (*scene_func)(struct Main *bmain, struct Scene *scene, int updated));
 
-/* ** Threaded update ** */
-
-/* Global initialization/deinitialization */
-void DAG_threaded_init(void);
-void DAG_threaded_exit(void);
-
-/* Initialize the DAG for threaded update. */
-void DAG_threaded_update_begin(struct Scene *scene);
-
-/* Run a callback for every node which is ready for update. */
-void DAG_threaded_update_foreach_ready_node(struct Scene *scene,
-                                            void (*func)(void *node, void *user_data),
-                                            void *user_data);
-
-struct Object *DAG_threaded_update_get_node_object(void *node_v);
-
-const char *DAG_threaded_update_get_node_name(void *node_v);
-
-void DAG_threaded_update_handle_node_updated(void *node_v,
-                                             void (*func)(void *node, void *user_data),
-                                             void *user_data);
-
 /* Debugging: print dependency graph for scene or armature object to console */
 
 void DAG_print_dependencies(struct Main *bmain, struct Scene *scene, struct Object *ob);
index e82d3dbf1a8387b41de497df464095151a0be7d9..1cf77c68345e637d1b89a1a1fe18fc62f65ff435 100644 (file)
@@ -28,8 +28,6 @@
 #ifndef __BKE_DISPLIST_H__
 #define __BKE_DISPLIST_H__
 
-struct ListBase;
-
 /** \file BKE_displist.h
  *  \ingroup bke
  *  \brief display list (or rather multi purpose list) stuff.
@@ -104,6 +102,4 @@ float BKE_displist_calc_taper(struct Scene *scene, struct Object *taperobj, int
 /* add Orco layer to the displist object which has got derived mesh and return orco */
 float *BKE_displist_make_orco(struct Scene *scene, struct Object *ob, struct DerivedMesh *derivedFinal, int forRender, int renderResolution);
 
-void BKE_displist_minmax(struct ListBase *dispbase, float min[3], float max[3]);
-
 #endif
index 7665e1b54dc6df497daf6cb9ff84889f9f329a38..44459300c5640b8d7f6574e373b3b0e4ed97636e 100644 (file)
@@ -47,7 +47,7 @@ void BKE_mball_make_local(struct MetaBall *mb);
 
 void BKE_mball_cubeTable_free(void);
 
-void BKE_mball_polygonize(struct Scene *scene, struct Object *ob, struct ListBase *dispbase, bool for_render);
+void BKE_mball_polygonize(struct Scene *scene, struct Object *ob, struct ListBase *dispbase);
 bool BKE_mball_is_basis_for(struct Object *ob1, struct Object *ob2);
 bool BKE_mball_is_basis(struct Object *ob);
 struct Object *BKE_mball_basis_find(struct Scene *scene, struct Object *ob);
index 8242e30ad05e90de55c1c9a5e0ba3d9f7d68dca9..61f665be5860a919ff66448edda356d3111ae369 100644 (file)
@@ -111,10 +111,8 @@ float BKE_scene_frame_get(struct Scene *scene);
 float BKE_scene_frame_get_from_ctime(struct Scene *scene, const float frame);
 void  BKE_scene_frame_set(struct Scene *scene, double cfra);
 
-void BKE_scene_update_tagged_ex(struct Main *bmain, struct Scene *scene, bool use_threads);
 void BKE_scene_update_tagged(struct Main *bmain, struct Scene *sce);
 
-void BKE_scene_update_for_newframe_ex(struct Main *bmain, struct Scene *sce, unsigned int lay, bool use_threads);
 void BKE_scene_update_for_newframe(struct Main *bmain, struct Scene *sce, unsigned int lay);
 
 struct SceneRenderLayer *BKE_scene_add_render_layer(struct Scene *sce, const char *name);
index cd63d9dd08c1f335423173240c30a45baaef488c..c8ce2bb2a773376e2bfc10280bf235db020c0178 100644 (file)
@@ -92,13 +92,6 @@ typedef struct DagNode {
        struct DagAdjList *child;
        struct DagAdjList *parent;
        struct DagNode *next;
-
-       /* Threaded evaluation routines */
-       uint32_t valency;  /* valency of the node is a number of parents which are not updated yet
-                           * this node has got.
-                           * Used by threaded update for faster detect whether node could be
-                           * updated aready.
-                           */
 } DagNode;
 
 typedef struct DagNodeQueueElem {
index 32cf7dda3c292a88a5a12a3503dd695478506f31..7e069c20c24f1567b76a08705af9e043727873c3 100644 (file)
@@ -48,7 +48,6 @@
 #include "BLI_memarena.h"
 #include "BLI_utildefines.h"
 #include "BLI_linklist.h"
-#include "BLI_threads.h"
 
 #include "BKE_pbvh.h"
 #include "BKE_cdderivedmesh.h"
index 71837cc41383615ff3f9b5bcd9d76aa05e3ea02e..26f481e5341efb853e948622d1b066c93455cddb 100644 (file)
@@ -120,7 +120,6 @@ void free_blender(void)
        
        IMB_exit();
        BKE_images_exit();
-       DAG_threaded_exit();
 
        BKE_brush_system_exit();
 
index 128c197d10da6b00254ea3b506bc6b4bbd1b2b1c..c0d0ce595f2afdd35a30368a5adb65b8f85179dd 100644 (file)
@@ -364,34 +364,39 @@ void BKE_curve_type_test(Object *ob)
                BKE_curve_curve_dimension_update((Curve *)ob->data);
 }
 
-void BKE_curve_boundbox_calc(Curve *cu, float r_loc[3], float r_size[3])
+void BKE_curve_texspace_calc(Curve *cu)
 {
-       BoundBox *bb;
+       BoundBox *bb = cu->bb;
        float min[3], max[3];
-       float mloc[3], msize[3];
 
-       if (cu->bb == NULL) cu->bb = MEM_callocN(sizeof(BoundBox), "boundbox");
-       bb = cu->bb;
+       /* Curve's undeformed bounding box is calculated in displist.c,
+        * as a part of display list calculation.
+        */
+       copy_v3_v3(min, bb->vec[0]);
+       copy_v3_v3(max, bb->vec[6]);
 
-       if (!r_loc) r_loc = mloc;
-       if (!r_size) r_size = msize;
+       if (cu->texflag & CU_AUTOSPACE) {
+               mid_v3_v3v3(cu->loc, min, max);
+               cu->size[0] = (max[0] - min[0]) / 2.0f;
+               cu->size[1] = (max[1] - min[1]) / 2.0f;
+               cu->size[2] = (max[2] - min[2]) / 2.0f;
 
-       INIT_MINMAX(min, max);
-       /* TODO(sergey): makecode aware of radius and bevel somehow.. */
-       if (!BKE_curve_minmax(cu, true, min, max)) {
-               min[0] = min[1] = min[2] = -1.0f;
-               max[0] = max[1] = max[2] = 1.0f;
-       }
+               zero_v3(cu->rot);
 
-       mid_v3_v3v3(r_loc, min, max);
+               if (cu->size[0] == 0.0f) cu->size[0] = 1.0f;
+               else if (cu->size[0] > 0.0f && cu->size[0] < 0.00001f) cu->size[0] = 0.00001f;
+               else if (cu->size[0] < 0.0f && cu->size[0] > -0.00001f) cu->size[0] = -0.00001f;
 
-       r_size[0] = (max[0] - min[0]) / 2.0f;
-       r_size[1] = (max[1] - min[1]) / 2.0f;
-       r_size[2] = (max[2] - min[2]) / 2.0f;
+               if (cu->size[1] == 0.0f) cu->size[1] = 1.0f;
+               else if (cu->size[1] > 0.0f && cu->size[1] < 0.00001f) cu->size[1] = 0.00001f;
+               else if (cu->size[1] < 0.0f && cu->size[1] > -0.00001f) cu->size[1] = -0.00001f;
 
-       BKE_boundbox_init_from_minmax(bb, min, max);
+               if (cu->size[2] == 0.0f) cu->size[2] = 1.0f;
+               else if (cu->size[2] > 0.0f && cu->size[2] < 0.00001f) cu->size[2] = 0.00001f;
+               else if (cu->size[2] < 0.0f && cu->size[2] > -0.00001f) cu->size[2] = -0.00001f;
+       }
 
-       bb->flag &= ~BOUNDBOX_DIRTY;
+       cu->bb->flag &= ~BOUNDBOX_DIRTY;
 }
 
 BoundBox *BKE_curve_boundbox_get(Object *ob)
@@ -408,26 +413,6 @@ BoundBox *BKE_curve_boundbox_get(Object *ob)
        return cu->bb;
 }
 
-void BKE_curve_texspace_calc(Curve *cu)
-{
-       float loc[3], size[3];
-       int a;
-
-       BKE_curve_boundbox_calc(cu, loc, size);
-
-       if (cu->texflag & CU_AUTOSPACE) {
-               for (a = 0; a < 3; a++) {
-                       if (size[a] == 0.0f) size[a] = 1.0f;
-                       else if (size[a] > 0.0f && size[a] < 0.00001f) size[a] = 0.00001f;
-                       else if (size[a] < 0.0f && size[a] > -0.00001f) size[a] = -0.00001f;
-               }
-
-               copy_v3_v3(cu->loc, loc);
-               copy_v3_v3(cu->size, size);
-               zero_v3(cu->rot);
-       }
-}
-
 void BKE_curve_texspace_get(Curve *cu, float r_loc[3], float r_rot[3], float r_size[3])
 {
        if (cu->bb == NULL || (cu->bb->flag & BOUNDBOX_DIRTY)) {
@@ -625,34 +610,18 @@ void BKE_nurb_test2D(Nurb *nu)
        }
 }
 
-/* if use_radius is truth, minmax will take points' radius into account,
- * which will make boundbox closer to bevelled curve.
- */
-void BKE_nurb_minmax(Nurb *nu, bool use_radius, float min[3], float max[3])
+void BKE_nurb_minmax(Nurb *nu, float min[3], float max[3])
 {
        BezTriple *bezt;
        BPoint *bp;
        int a;
-       float point[3];
 
        if (nu->type == CU_BEZIER) {
                a = nu->pntsu;
                bezt = nu->bezt;
                while (a--) {
-                       if (use_radius) {
-                               float radius_vector[3];
-                               radius_vector[0] = radius_vector[1] = radius_vector[2] = bezt->radius;
-
-                               add_v3_v3v3(point, bezt->vec[1], radius_vector);
-                               minmax_v3v3_v3(min, max, point);
-
-                               sub_v3_v3v3(point, bezt->vec[1], radius_vector);
-                               minmax_v3v3_v3(min, max, point);
-                       }
-                       else {
-                               minmax_v3v3_v3(min, max, bezt->vec[1]);
-                       }
                        minmax_v3v3_v3(min, max, bezt->vec[0]);
+                       minmax_v3v3_v3(min, max, bezt->vec[1]);
                        minmax_v3v3_v3(min, max, bezt->vec[2]);
                        bezt++;
                }
@@ -661,20 +630,7 @@ void BKE_nurb_minmax(Nurb *nu, bool use_radius, float min[3], float max[3])
                a = nu->pntsu * nu->pntsv;
                bp = nu->bp;
                while (a--) {
-                       if (nu->pntsv == 1 && use_radius) {
-                               float radius_vector[3];
-                               radius_vector[0] = radius_vector[1] = radius_vector[2] = bp->radius;
-
-                               add_v3_v3v3(point, bp->vec, radius_vector);
-                               minmax_v3v3_v3(min, max, point);
-
-                               sub_v3_v3v3(point, bp->vec, radius_vector);
-                               minmax_v3v3_v3(min, max, point);
-                       }
-                       else {
-                               /* Surfaces doesn't use bevel, so no need to take radius into account. */
-                               minmax_v3v3_v3(min, max, bp->vec);
-                       }
+                       minmax_v3v3_v3(min, max, bp->vec);
                        bp++;
                }
        }
@@ -3779,13 +3735,13 @@ ListBase *BKE_curve_nurbs_get(Curve *cu)
 
 
 /* basic vertex data functions */
-bool BKE_curve_minmax(Curve *cu, bool use_radius, float min[3], float max[3])
+bool BKE_curve_minmax(Curve *cu, float min[3], float max[3])
 {
        ListBase *nurb_lb = BKE_curve_nurbs_get(cu);
        Nurb *nu;
 
        for (nu = nurb_lb->first; nu; nu = nu->next)
-               BKE_nurb_minmax(nu, use_radius, min, max);
+               BKE_nurb_minmax(nu, min, max);
 
        return (nurb_lb->first != NULL);
 }
@@ -3832,7 +3788,7 @@ bool BKE_curve_center_bounds(Curve *cu, float cent[3])
 {
        float min[3], max[3];
        INIT_MINMAX(min, max);
-       if (BKE_curve_minmax(cu, false, min, max)) {
+       if (BKE_curve_minmax(cu, min, max)) {
                mid_v3_v3v3(cent, min, max);
                return true;
        }
index 5995e2a9539674cab2ecc4a60469c5f4ecaf272f..f786f842be37f65e938fd104eac9844fa165d913 100644 (file)
@@ -42,7 +42,6 @@
 #include "BLI_utildefines.h"
 #include "BLI_listbase.h"
 #include "BLI_ghash.h"
-#include "BLI_threads.h"
 
 #include "DNA_anim_types.h"
 #include "DNA_camera_types.h"
@@ -79,8 +78,6 @@
 #include "BKE_screen.h"
 #include "BKE_tracking.h"
 
-#include "atomic_ops.h"
-
 #include "depsgraph_private.h"
  
 /* Queue and stack operations for dag traversal 
@@ -2657,130 +2654,6 @@ void DAG_pose_sort(Object *ob)
        ugly_hack_sorry = 1;
 }
 
-/* ************************  DAG FOR THREADED UPDATE  ********************* */
-
-static SpinLock threaded_update_lock;
-
-void DAG_threaded_init(void)
-{
-       BLI_spin_init(&threaded_update_lock);
-}
-
-void DAG_threaded_exit(void)
-{
-       BLI_spin_end(&threaded_update_lock);
-}
-
-/* Initialize the DAG for threaded update.
- *
- * Sets up all the data needed for faster check whether DAG node is
- * updatable already (whether all the dependencies are met).
- */
-void DAG_threaded_update_begin(Scene *scene)
-{
-       DagNode *node;
-
-       /* We reset valency to zero first... */
-       for (node = scene->theDag->DagNode.first; node; node = node->next) {
-               node->valency = 0;
-               node->color = DAG_WHITE;
-       }
-
-       /* ... and then iterate over all the nodes and
-        * increase valency for node childs.
-        */
-       for (node = scene->theDag->DagNode.first; node; node = node->next) {
-               DagAdjList *itA;
-
-               for (itA = node->child; itA; itA = itA->next) {
-                       if (itA->node != node) {
-                               itA->node->valency++;
-                       }
-               }
-       }
-}
-
-/* Call functor for every node in the graph which is ready for
- * update (all it's dependencies are met). Quick check for this
- * is valency == 0.
- */
-void DAG_threaded_update_foreach_ready_node(Scene *scene,
-                                            void (*func)(void *node, void *user_data),
-                                            void *user_data)
-{
-       DagNode *node;
-
-       for (node = scene->theDag->DagNode.first; node; node = node->next) {
-               if (node->valency == 0) {
-                       bool need_schedule;
-
-                       BLI_spin_lock(&threaded_update_lock);
-                       need_schedule = node->color == DAG_WHITE;
-                       node->color = DAG_BLACK;
-                       BLI_spin_unlock(&threaded_update_lock);
-
-                       if (need_schedule) {
-                               func(node, user_data);
-                       }
-               }
-       }
-}
-
-/* Will return Object ID if node represents Object,
- * and will return NULL otherwise.
- */
-Object *DAG_threaded_update_get_node_object(void *node_v)
-{
-       DagNode *node = node_v;
-
-       if (node->type == ID_OB) {
-               return node->ob;
-       }
-
-       return NULL;
-}
-
-/* Returns node name, used for debug output only, atm. */
-const char *DAG_threaded_update_get_node_name(void *node_v)
-{
-       DagNode *node = node_v;
-
-       return dag_node_name(node);
-}
-
-/* This function is called when handling node is done.
- *
- * This function updates valency for all childs and
- * schedules them if they're ready.
- */
-void DAG_threaded_update_handle_node_updated(void *node_v,
-                                             void (*func)(void *node, void *user_data),
-                                             void *user_data)
-{
-       DagNode *node = node_v;
-       DagAdjList *itA;
-
-       for (itA = node->child; itA; itA = itA->next) {
-               DagNode *child_node = itA->node;
-               if (child_node != node) {
-                       atomic_sub_uint32(&child_node->valency, 1);
-
-                       if (child_node->valency == 0) {
-                               bool need_schedule;
-
-                               BLI_spin_lock(&threaded_update_lock);
-                               need_schedule = child_node->color == DAG_WHITE;
-                               child_node->color = DAG_BLACK;
-                               BLI_spin_unlock(&threaded_update_lock);
-
-                               if (need_schedule) {
-                                       func(child_node, user_data);
-                               }
-                       }
-               }
-       }
-}
-
 /* ************************ DAG DEBUGGING ********************* */
 
 void DAG_print_dependencies(Main *bmain, Scene *scene, Object *ob)
@@ -2799,3 +2672,4 @@ void DAG_print_dependencies(Main *bmain, Scene *scene, Object *ob)
        
        dag_print_dependencies = 0;
 }
+
index 5089cb84fe739991ff79c03a8e9fd9ffaf495fcb..6bcf6b148a3a36b886c620bd8e0a6be32f1d70fa 100644 (file)
@@ -62,6 +62,7 @@
 
 #include "BLI_sys_types.h" // for intptr_t support
 
+static void boundbox_dispbase(BoundBox *bb, ListBase *dispbase);
 static void boundbox_displist_object(Object *ob);
 
 void BKE_displist_elem_free(DispList *dl)
@@ -711,6 +712,12 @@ void BKE_displist_make_mball(Scene *scene, Object *ob)
        if (!ob || ob->type != OB_MBALL)
                return;
 
+       /* XXX: mball stuff uses plenty of global variables
+        *      while this is unchanged updating during render is unsafe
+        */
+       if (G.is_rendering)
+               return;
+
        if (ob->curve_cache) {
                BKE_displist_free(&(ob->curve_cache->disp));
        }
@@ -720,7 +727,7 @@ void BKE_displist_make_mball(Scene *scene, Object *ob)
 
        if (ob->type == OB_MBALL) {
                if (ob == BKE_mball_basis_find(scene, ob)) {
-                       BKE_mball_polygonize(scene, ob, &ob->curve_cache->disp, false);
+                       BKE_mball_polygonize(scene, ob, &ob->curve_cache->disp);
                        BKE_mball_texspace_calc(ob);
 
                        object_deform_mball(ob, &ob->curve_cache->disp);
@@ -732,7 +739,7 @@ void BKE_displist_make_mball(Scene *scene, Object *ob)
 
 void BKE_displist_make_mball_forRender(Scene *scene, Object *ob, ListBase *dispbase)
 {
-       BKE_mball_polygonize(scene, ob, dispbase, true);
+       BKE_mball_polygonize(scene, ob, dispbase);
        BKE_mball_texspace_calc(ob);
 
        object_deform_mball(ob, dispbase);
@@ -1268,6 +1275,17 @@ void BKE_displist_make_surf(Scene *scene, Object *ob, ListBase *dispbase,
                }
        }
 
+       /* Calculate curve's boundig box from non-modified display list. */
+       /* TODO(sergey): not thread-safe. */
+       if (cu->bb == NULL) {
+               cu->bb = MEM_callocN(sizeof(BoundBox), "boundbox");
+       }
+       boundbox_dispbase(cu->bb, dispbase);
+
+       if (!forRender) {
+               BKE_curve_texspace_calc(cu);
+       }
+
        if (!forOrco) {
                curve_calc_modifiers_post(scene, ob, &nubase, dispbase, derivedFinal,
                                          forRender, renderResolution);
@@ -1567,6 +1585,17 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
                if ((cu->flag & CU_PATH) && !forOrco)
                        calc_curvepath(ob, &nubase);
 
+               /* Calculate curve's boundig box from non-modified display list. */
+               /* TODO(sergey): not thread-safe. */
+               if (cu->bb == NULL) {
+                       cu->bb = MEM_callocN(sizeof(BoundBox), "boundbox");
+               }
+               boundbox_dispbase(cu->bb, dispbase);
+
+               if (!forRender) {
+                       BKE_curve_texspace_calc(cu);
+               }
+
                if (!forOrco)
                        curve_calc_modifiers_post(scene, ob, &nubase, dispbase, derivedFinal, forRender, renderResolution);
 
@@ -1588,9 +1617,10 @@ void BKE_displist_make_curveTypes(Scene *scene, Object *ob, int forOrco)
        if (!ELEM3(ob->type, OB_SURF, OB_CURVE, OB_FONT))
                return;
 
-       BKE_object_free_derived_caches(ob);
-
-       if (!ob->curve_cache) {
+       if (ob->curve_cache) {
+               BKE_displist_free(&(ob->curve_cache->disp));
+       }
+       else {
                ob->curve_cache = MEM_callocN(sizeof(CurveCache), "CurveCache for curve types");
        }
 
@@ -1633,13 +1663,16 @@ float *BKE_displist_make_orco(Scene *scene, Object *ob, DerivedMesh *derivedFina
        return orco;
 }
 
-void BKE_displist_minmax(ListBase *dispbase, float min[3], float max[3])
+static void boundbox_dispbase(BoundBox *bb, ListBase *dispbase)
 {
+       float min[3], max[3];
        DispList *dl;
        float *vert;
        int a, tot = 0;
        int doit = 0;
 
+       INIT_MINMAX(min, max);
+
        for (dl = dispbase->first; dl; dl = dl->next) {
                tot = (dl->type == DL_INDEX3) ? dl->nr : dl->nr * dl->parts;
                vert = dl->verts;
@@ -1654,6 +1687,8 @@ void BKE_displist_minmax(ListBase *dispbase, float min[3], float max[3])
                zero_v3(min);
                zero_v3(max);
        }
+
+       BKE_boundbox_init_from_minmax(bb, min, max);
 }
 
 /* this is confusing, there's also min_max_object, appplying the obmat... */
@@ -1672,11 +1707,7 @@ static void boundbox_displist_object(Object *ob)
                        DM_set_object_boundbox(ob, ob->derivedFinal);
                }
                else {
-                       float min[3], max[3];
-
-                       INIT_MINMAX(min, max);
-                       BKE_displist_minmax(&ob->curve_cache->disp, min, max);
-                       BKE_boundbox_init_from_minmax(ob->bb, min, max);
+                       boundbox_dispbase(ob->bb, &ob->curve_cache->disp);
                }
        }
 }
index f24d84df2e87cd8f8342e6cc5b41a3d14f184710..c899ae1f16c5b86d78666b6d1bd9fabf5e13d1cb 100644 (file)
@@ -1,4 +1,5 @@
 /*
+
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * This program is free software; you can redistribute it and/or
index 5d5231ae258148db8e029fb633fafbbcd18b958a..7d44337bc1430f59acfedf7efcb3c8d8d8bdfc62 100644 (file)
@@ -2280,7 +2280,7 @@ static void mball_count(PROCESS *process, Scene *scene, Object *basis)
        }
 }
 
-void BKE_mball_polygonize(Scene *scene, Object *ob, ListBase *dispbase, bool for_render)
+void BKE_mball_polygonize(Scene *scene, Object *ob, ListBase *dispbase)
 {
        MetaBall *mb;
        DispList *dl;
@@ -2293,7 +2293,7 @@ void BKE_mball_polygonize(Scene *scene, Object *ob, ListBase *dispbase, bool for
        mball_count(&process, scene, ob);
 
        if (process.totelem == 0) return;
-       if ((for_render == FALSE) && (mb->flag == MB_UPDATE_NEVER)) return;
+       if ((G.is_rendering == FALSE) && (mb->flag == MB_UPDATE_NEVER)) return;
        if ((G.moving & (G_TRANSFORM_OBJ | G_TRANSFORM_EDIT)) && mb->flag == MB_UPDATE_FAST) return;
 
        process.thresh = mb->thresh;
@@ -2331,7 +2331,7 @@ void BKE_mball_polygonize(Scene *scene, Object *ob, ListBase *dispbase, bool for
        }
 
        /* width is size per polygonize cube */
-       if (for_render) {
+       if (G.is_rendering) {
                width = mb->rendersize;
        }
        else {
index 8f64ce6bef7e410ec7ef405f89f51e572ac87dce..6d2f1a4622ac167afb7fadf559ed578538b19b07 100644 (file)
@@ -2321,7 +2321,7 @@ BoundBox *BKE_object_boundbox_get(Object *ob)
                bb = BKE_mesh_boundbox_get(ob);
        }
        else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
-               bb = BKE_curve_boundbox_get(ob);
+               bb = ob->bb ? ob->bb : ((Curve *)ob->data)->bb;
        }
        else if (ob->type == OB_MBALL) {
                bb = ob->bb;
index 344882ea5a03543b291684c7a17b2008e1c5a96a..1874523dac9908ffaf4089999885dbddd2771512 100644 (file)
@@ -57,7 +57,6 @@
 #include "BLI_callbacks.h"
 #include "BLI_string.h"
 #include "BLI_threads.h"
-#include "BLI_task.h"
 
 #include "BLF_translation.h"
 
@@ -87,8 +86,6 @@
 
 #include "RE_engine.h"
 
-#include "PIL_time.h"
-
 #include "IMB_colormanagement.h"
 
 //XXX #include "BIF_previewrender.h"
@@ -1162,318 +1159,32 @@ static void scene_do_rb_simulation_recursive(Scene *scene, float ctime)
                BKE_rigidbody_do_simulation(scene, ctime);
 }
 
-/* Used to visualize CPU threads activity during threaded object update,
- * would pollute STDERR with whole bunch of timing information which then
- * could be parsed and nicely visualized.
- */
-#undef DETAILED_ANALYSIS_OUTPUT
-
-typedef struct StatisicsEntry {
-       struct StatisicsEntry *next, *prev;
-       Object *object;
-       double start_time;
-       double duration;
-} StatisicsEntry;
-
-typedef struct ThreadedObjectUpdateState {
-       Scene *scene;
-       Scene *scene_parent;
-       double base_time;
-
-       /* Execution statistics */
-       ListBase statistics[BLENDER_MAX_THREADS];
-       bool has_updated_objects;
-} ThreadedObjectUpdateState;
-
-static void scene_update_object_add_task(void *node, void *user_data);
-
-static void scene_update_all_bases(Scene *scene, Scene *scene_parent)
+static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scene_parent)
 {
        Base *base;
+       
+       scene->customdata_mask = scene_parent->customdata_mask;
 
+       /* sets first, we allow per definition current scene to have
+        * dependencies on sets, but not the other way around. */
+       if (scene->set)
+               scene_update_tagged_recursive(bmain, scene->set, scene_parent);
+       
+       /* scene objects */
        for (base = scene->base.first; base; base = base->next) {
-               Object *object = base->object;
-
-               BKE_object_handle_update_ex(scene_parent, object, scene->rigidbody_world);
-
-               if (object->dup_group && (object->transflag & OB_DUPLIGROUP))
-                       BKE_group_handle_recalc_and_update(scene_parent, object, object->dup_group);
-
+               Object *ob = base->object;
+               
+               BKE_object_handle_update_ex(scene_parent, ob, scene->rigidbody_world);
+               
+               if (ob->dup_group && (ob->transflag & OB_DUPLIGROUP))
+                       BKE_group_handle_recalc_and_update(scene_parent, ob, ob->dup_group);
+                       
                /* always update layer, so that animating layers works (joshua july 2010) */
                /* XXX commented out, this has depsgraph issues anyway - and this breaks setting scenes
                 * (on scene-set, the base-lay is copied to ob-lay (ton nov 2012) */
                // base->lay = ob->lay;
        }
-}
-
-static void scene_update_object_func(TaskPool *pool, void *taskdata, int threadid)
-{
-/* Disable print for now in favor of summary statistics at the end of update. */
-#define PRINT if (false) printf
-
-       ThreadedObjectUpdateState *state = (ThreadedObjectUpdateState *) BLI_task_pool_userdata(pool);
-       void *node = taskdata;
-       Object *object = DAG_threaded_update_get_node_object(node);
-       Scene *scene = state->scene;
-       Scene *scene_parent = state->scene_parent;
-
-       if (object) {
-               double start_time = 0.0;
-               bool add_to_stats = false;
-
-               PRINT("Thread %d: update object %s\n", threadid, object->id.name);
-
-               if ((object->id.flag & LIB_DOIT) == 0) {
-                       if (object->recalc & OB_RECALC_ALL) {
-                               printf("Unneeded update %s\n", object->id.name + 2);
-                       }
-               }
-
-#ifdef DETAILED_ANALYSIS_OUTPUT
-               {
-#else
-               if (G.debug & G_DEBUG) {
-#endif
-                       start_time = PIL_check_seconds_timer();
-
-                       if (object->recalc & OB_RECALC_ALL) {
-                               state->has_updated_objects = true;
-                               add_to_stats = true;
-                       }
-               }
-
-               /* We only update object itself here, dupli-group will be updated
-                * separately from main thread because of we've got no idea about
-                * dependnecies inside the group.
-                */
-               BKE_object_handle_update_ex(scene_parent, object, scene->rigidbody_world);
-
-               /* Calculate statistics. */
-               if (add_to_stats) {
-                       StatisicsEntry *entry;
-
-                       entry = MEM_mallocN(sizeof(StatisicsEntry), "update thread statistics");
-                       entry->object = object;
-                       entry->start_time = start_time;
-                       entry->duration = PIL_check_seconds_timer() - start_time;
-
-                       BLI_addtail(&state->statistics[threadid], entry);
-               }
-       }
-       else {
-               PRINT("Threda %d: update node %s\n", threadid,
-                     DAG_threaded_update_get_node_name(node));
-       }
-
-       /* Update will decrease child's valency and schedule child with zero valency. */
-       DAG_threaded_update_handle_node_updated(node,scene_update_object_add_task, pool);
-
-#undef PRINT
-}
-
-static void scene_update_object_add_task(void *node, void *user_data)
-{
-       TaskPool *task_pool = user_data;
-
-       BLI_task_pool_push(task_pool, scene_update_object_func, node, false, TASK_PRIORITY_LOW);
-}
-
-#ifdef DETAILED_ANALYSIS_OUTPUT
-static void print_thread_statistics_for_analysis(ThreadedObjectUpdateState *state)
-{
-       if (state->has_updated_objects) {
-               int i, tot_thread = BLI_system_thread_count();
-
-               fprintf(stderr, "objects update base time %f\n", state->base_time);
-
-               for (i = 0; i < tot_thread; i++) {
-                       StatisicsEntry *entry;
-                       for (entry = state->statistics[i].first;
-                            entry;
-                            entry = entry->next)
-                       {
-                               fprintf(stderr, "thread %d object %s start_time %f duration %f\n",
-                                       i, entry->object->id.name + 2,
-                                       entry->start_time, entry->duration);
-                       }
-                       BLI_freelistN(&state->statistics[i]);
-               }
-       }
-}
-#else
-static void print_threads_statistics(ThreadedObjectUpdateState *state)
-{
-       int i, tot_thread;
-
-       if ((G.debug & G_DEBUG) == 0) {
-               return;
-       }
-
-       tot_thread = BLI_system_thread_count();
-
-       for (i = 0; i < tot_thread; i++) {
-               int total_objects = 0;
-               double total_time = 0.0;
-               StatisicsEntry *entry;
-
-               if (state->has_updated_objects) {
-                       /* Don't pollute output if no objects were updated. */
-                       for (entry = state->statistics[i].first;
-                            entry;
-                            entry = entry->next)
-                       {
-                               total_objects++;
-                               total_time += entry->duration;
-                       }
-
-                       printf("Thread %d: total %d objects in %f sec.\n", i, total_objects, total_time);
-
-                       for (entry = state->statistics[i].first;
-                            entry;
-                            entry = entry->next)
-                       {
-                               printf("  %s in %f sec\n", entry->object->id.name + 2, entry->duration);
-                       }
-               }
-
-               BLI_freelistN(&state->statistics[i]);
-       }
-}
-#endif
-
-static void scene_update_objects(Main *bmain, Scene *scene, Scene *scene_parent, bool use_threads)
-{
-       TaskScheduler *task_scheduler = BLI_task_scheduler_get();
-       TaskPool *task_pool;
-       ThreadedObjectUpdateState state;
-
-       if (use_threads == false) {
-               scene_update_all_bases(scene, scene_parent);
-               return;
-       }
-
-       /* Ensure malloc will go go fine from threads,
-        * this is needed because we could be in main thread here
-        * and malloc could be non-threda safe at this point because
-        * no other jobs are running.
-        */
-       BLI_begin_threaded_malloc();
-
-       state.scene = scene;
-       state.scene_parent = scene_parent;
-       memset(state.statistics, 0, sizeof(state.statistics));
-       state.has_updated_objects = false;
-       state.base_time = PIL_check_seconds_timer();
-
-       task_pool = BLI_task_pool_create(task_scheduler, &state);
-
-       /* Initialize run-time data in the graph needed for traversing it
-        * from multiple threads.
-        *
-        * This will mark DAG nodes as object/non-object and will calculate
-        * "valency" of nodes (which is how many non-updated parents node
-        * have, which helps a lot checking whether node could be scheduled
-        * already or not).
-        */
-       DAG_threaded_update_begin(scene);
-
-       {
-               Base *base;
-               Object *object;
-
-               for (object = bmain->object.first; object; object = object->id.next) {
-                       object->id.flag &= ~LIB_DOIT;
-               }
-
-               for (base = scene->base.first; base; base = base->next) {
-                       object = base->object;
-                       object->id.flag |= LIB_DOIT;
-
-                       if (object->dup_group && (object->transflag & OB_DUPLIGROUP)) {
-                               GroupObject *go;
-                               for (go = object->dup_group->gobject.first; go; go = go->next) {
-                                       if (go->ob) {
-                                               go->ob->id.flag |= LIB_DOIT;
-                                       }
-                               }
-                       }
-               }
-       }
-
-       /* Put all nodes which are already ready for schedule to the task pool.
-        * usually its just a Scene node.
-        *
-        * We do lock here so no tthreads will start updating nodes valency
-        * while we're still fillign the queue in. Otherwise it's possible
-        * to run into situations when the same task is adding twice to the
-        * queue due to non-safe nature of function below.
-        */
-       DAG_threaded_update_foreach_ready_node(scene, scene_update_object_add_task, task_pool);
-
-       /* work and wait until tasks are done */
-       BLI_task_pool_work_and_wait(task_pool);
-
-       /* free */
-       BLI_task_pool_free(task_pool);
-
-       BLI_end_threaded_malloc();
-
-#ifdef DETAILED_ANALYSIS_OUTPUT
-       print_thread_statistics_for_analysis(&state);
-#else
-       if (G.debug & G_DEBUG) {
-               print_threads_statistics(&state);
-       }
-#endif
-
-       /* XXX: Weak, very weak!
-        *
-        * We update dupligroups in single thread! :S
-        *
-        * This is because we've got absolutely no idea about dependencies
-        * inside the group and we only know order of objects in which we
-        * need to perform objects update.
-        *
-        * We even can not update different groups in different threads,
-        * because groups could share the objects and detecting whether
-        * object is updating in multiple threads is not so much easy.
-        *
-        * This is solvable with local group dependency graph or expanding
-        * current dependency graph to be aware of dependencies inside
-        * groups.
-        *
-        * P.S. Objects from the dup_group are very much likely in scene's
-        *      dependency graph and were alreayd updated in threaded tasks
-        *      scheduler already.
-        *
-        *      So objects from the dupli_groups are likely don't have
-        *      OB_RECALC_ALL flag here, but it seems they still do have
-        *      non-zero recalc flags, and here we make sure things are
-        *      100% by calling BKE_group_handle_recalc_and_update.
-        */
-       {
-               Base *base;
-               for (base = scene->base.first; base; base = base->next) {
-                       Object *object = base->object;
-
-                       if (object->dup_group && (object->transflag & OB_DUPLIGROUP))
-                               BKE_group_handle_recalc_and_update(scene_parent, object, object->dup_group);
-               }
-       }
-}
-
-static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scene_parent, bool use_threads)
-{
-       scene->customdata_mask = scene_parent->customdata_mask;
-
-       /* sets first, we allow per definition current scene to have
-        * dependencies on sets, but not the other way around. */
-       if (scene->set)
-               scene_update_tagged_recursive(bmain, scene->set, scene_parent, use_threads);
-
-       /* scene objects */
-       scene_update_objects(bmain, scene, scene_parent, use_threads);
-
+       
        /* scene drivers... */
        scene_update_drivers(bmain, scene);
 
@@ -1486,7 +1197,7 @@ static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scen
 }
 
 /* this is called in main loop, doing tagged updates before redraw */
-void BKE_scene_update_tagged_ex(Main *bmain, Scene *scene, bool use_threads)
+void BKE_scene_update_tagged(Main *bmain, Scene *scene)
 {
        Scene *sce_iter;
        
@@ -1513,7 +1224,7 @@ void BKE_scene_update_tagged_ex(Main *bmain, Scene *scene, bool use_threads)
         *
         * in the future this should handle updates for all datablocks, not
         * only objects and scenes. - brecht */
-       scene_update_tagged_recursive(bmain, scene, scene, use_threads);
+       scene_update_tagged_recursive(bmain, scene, scene);
 
        /* extra call here to recalc scene animation (for sequencer) */
        {
@@ -1532,19 +1243,11 @@ void BKE_scene_update_tagged_ex(Main *bmain, Scene *scene, bool use_threads)
        DAG_ids_clear_recalc(bmain);
 }
 
-void BKE_scene_update_tagged(Main *bmain, Scene *scene)
-{
-       BKE_scene_update_tagged_ex(bmain, scene, true);
-}
-
 /* applies changes right away, does all sets too */
-void BKE_scene_update_for_newframe_ex(Main *bmain, Scene *sce, unsigned int lay, bool use_threads)
+void BKE_scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay)
 {
        float ctime = BKE_scene_frame_get(sce);
        Scene *sce_iter;
-#ifdef DETAILED_ANALYSIS_OUTPUT
-       double start_time = PIL_check_seconds_timer();
-#endif
 
        /* keep this first */
        BLI_callback_exec(bmain, &sce->id, BLI_CB_EVT_FRAME_CHANGE_PRE);
@@ -1599,7 +1302,7 @@ void BKE_scene_update_for_newframe_ex(Main *bmain, Scene *sce, unsigned int lay,
        scene_do_rb_simulation_recursive(sce, ctime);
 
        /* BKE_object_handle_update() on all objects, groups and sets */
-       scene_update_tagged_recursive(bmain, sce, sce, use_threads);
+       scene_update_tagged_recursive(bmain, sce, sce);
 
        scene_depsgraph_hack(sce, sce);
 
@@ -1611,15 +1314,6 @@ void BKE_scene_update_for_newframe_ex(Main *bmain, Scene *sce, unsigned int lay,
 
        /* clear recalc flags */
        DAG_ids_clear_recalc(bmain);
-
-#ifdef DETAILED_ANALYSIS_OUTPUT
-       fprintf(stderr, "frame update start_time %f duration %f\n", start_time, PIL_check_seconds_timer() - start_time);
-#endif
-}
-
-void BKE_scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay)
-{
-       BKE_scene_update_for_newframe_ex(bmain, sce, lay, true);
 }
 
 /* return default layer, also used to patch old files */
diff --git a/source/blender/blenlib/BLI_task.h b/source/blender/blenlib/BLI_task.h
deleted file mode 100644 (file)
index f57d428..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef __BLI_TASK_H__
-#define __BLI_TASK_H__ 
-
-/** \file BLI_task.h
- *  \ingroup bli
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "BLI_threads.h"
-#include "BLI_utildefines.h"
-
-/* Task Scheduler
- * 
- * Central scheduler that holds running threads ready to execute tasks. A single
- * queue holds the task from all pools.
- *
- * Init/exit must be called before/after any task pools are created/freed, and
- * must be called from the main threads. All other scheduler and pool functions
- * are thread-safe. */
-
-typedef struct TaskScheduler TaskScheduler;
-
-enum {
-       TASK_SCHEDULER_AUTO_THREADS = 0,
-       TASK_SCHEDULER_SINGLE_THREAD = 1
-};
-
-TaskScheduler *BLI_task_scheduler_create(int num_threads);
-void BLI_task_scheduler_free(TaskScheduler *scheduler);
-
-int BLI_task_scheduler_num_threads(TaskScheduler *scheduler);
-
-/* Task Pool
- *
- * Pool of tasks that will be executed by the central TaskScheduler. For each
- * pool, we can wait for all tasks to be done, or cancel them before they are
- * done.
- *
- * Running tasks may spawn new tasks.
- *
- * Pools may be nested, i.e. a thread running a task can create another task
- * pool with smaller tasks. When other threads are busy they will continue
- * working on their own tasks, if not they will join in, no new threads will
- * be launched.
- */
-
-typedef enum TaskPriority {
-       TASK_PRIORITY_LOW,
-       TASK_PRIORITY_HIGH
-} TaskPriority;
-
-typedef struct TaskPool TaskPool;
-typedef void (*TaskRunFunction)(TaskPool *pool, void *taskdata, int threadid);
-
-TaskPool *BLI_task_pool_create(TaskScheduler *scheduler, void *userdata);
-void BLI_task_pool_free(TaskPool *pool);
-
-void BLI_task_pool_push(TaskPool *pool, TaskRunFunction run,
-       void *taskdata, bool free_taskdata, TaskPriority priority);
-
-/* work and wait until all tasks are done */
-void BLI_task_pool_work_and_wait(TaskPool *pool);
-/* cancel all tasks, keep worker threads running */
-void BLI_task_pool_cancel(TaskPool *pool);
-/* stop all worker threads */
-void BLI_task_pool_stop(TaskPool *pool);
-
-/* for worker threads, test if cancelled */
-bool BLI_task_pool_cancelled(TaskPool *pool);
-
-/* optional userdata pointer to pass along to run function */
-void *BLI_task_pool_userdata(TaskPool *pool);
-
-/* optional mutex to use from run function */
-ThreadMutex *BLI_task_pool_user_mutex(TaskPool *pool);
-
-/* number of tasks done, for stats, don't use this to make decisions */
-size_t BLI_task_pool_tasks_done(TaskPool *pool);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
index 3e2e819a1e6d177c46c3427ead336485954f9ed8..38ad08272461871b460a830edd9cb5d90c62334d 100644 (file)
@@ -45,7 +45,6 @@ extern "C" {
 #define BLENDER_MAX_THREADS     64
 
 struct ListBase;
-struct TaskScheduler;
 
 /* Threading API */
 
@@ -53,8 +52,6 @@ struct TaskScheduler;
 void BLI_threadapi_init(void);
 void BLI_threadapi_exit(void);
 
-struct TaskScheduler *BLI_task_scheduler_get(void);
-
 void    BLI_init_threads(struct ListBase *threadbase, void *(*do_thread)(void *), int tot);
 int     BLI_available_threads(struct ListBase *threadbase);
 int     BLI_available_thread_index(struct ListBase *threadbase);
@@ -104,7 +101,6 @@ ThreadMutex *BLI_mutex_alloc(void);
 void BLI_mutex_free(ThreadMutex *mutex);
 
 void BLI_mutex_lock(ThreadMutex *mutex);
-bool BLI_mutex_trylock(ThreadMutex *mutex);
 void BLI_mutex_unlock(ThreadMutex *mutex);
 
 /* Spin Lock */
@@ -187,16 +183,6 @@ int BLI_thread_queue_size(ThreadQueue *queue);
 void BLI_thread_queue_wait_finish(ThreadQueue *queue);
 void BLI_thread_queue_nowait(ThreadQueue *queue);
 
-/* Condition */
-
-typedef pthread_cond_t ThreadCondition;
-
-void BLI_condition_init(ThreadCondition *cond);
-void BLI_condition_wait(ThreadCondition *cond, ThreadMutex *mutex);
-void BLI_condition_notify_one(ThreadCondition *cond);
-void BLI_condition_notify_all(ThreadCondition *cond);
-void BLI_condition_end(ThreadCondition *cond);
-
 #ifdef __cplusplus
 }
 #endif
index c5e013a75639fceb93c4550ee3375c962d005d0f..70665521ca8550b5d62940a9522ef47c0eb4525b 100644 (file)
@@ -92,7 +92,6 @@ set(SRC
        intern/string.c
        intern/string_cursor_utf8.c
        intern/string_utf8.c
-       intern/task.c
        intern/threads.c
        intern/time.c
        intern/uvproject.c
@@ -155,7 +154,6 @@ set(SRC
        BLI_string_cursor_utf8.h
        BLI_string_utf8.h
        BLI_sys_types.h
-       BLI_task.h
        BLI_threads.h
        BLI_utildefines.h
        BLI_uvproject.h
index 1743a0ba6c885a37dd504665b3e0c0d9d491e01f..5ba608e5ec2a74fc79b9505de564b5fdeaff2ccd 100644 (file)
@@ -30,8 +30,6 @@
  *  \ingroup bli
  */
 
-#include <stdlib.h>
-
 #include "BLI_utildefines.h"
 
 #include "BLI_sort.h"
diff --git a/source/blender/blenlib/intern/task.c b/source/blender/blenlib/intern/task.c
deleted file mode 100644 (file)
index 5d0b5ff..0000000
+++ /dev/null
@@ -1,414 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_listbase.h"
-#include "BLI_task.h"
-#include "BLI_threads.h"
-
-/* Types */
-
-typedef struct Task {
-       struct Task *next, *prev;
-
-       TaskRunFunction run;
-       void *taskdata;
-       bool free_taskdata;
-       TaskPool *pool;
-} Task;
-
-struct TaskPool {
-       TaskScheduler *scheduler;
-
-       volatile size_t num;
-       volatile size_t done;
-       ThreadMutex num_mutex;
-       ThreadCondition num_cond;
-
-       void *userdata;
-       ThreadMutex user_mutex;
-
-       volatile bool do_cancel;
-};
-
-struct TaskScheduler {
-       pthread_t *threads;
-       struct TaskThread *task_threads;
-       int num_threads;
-
-       ListBase queue;
-       ThreadMutex queue_mutex;
-       ThreadCondition queue_cond;
-
-       volatile bool do_exit;
-};
-
-typedef struct TaskThread {
-       TaskScheduler *scheduler;
-       int id;
-} TaskThread;
-
-/* Task Scheduler */
-
-static void task_pool_num_decrease(TaskPool *pool, size_t done)
-{
-       BLI_mutex_lock(&pool->num_mutex);
-
-       BLI_assert(pool->num >= done);
-
-       pool->num -= done;
-       pool->done += done;
-
-       if (pool->num == 0)
-               BLI_condition_notify_all(&pool->num_cond);
-
-       BLI_mutex_unlock(&pool->num_mutex);
-}
-
-static void task_pool_num_increase(TaskPool *pool)
-{
-       BLI_mutex_lock(&pool->num_mutex);
-
-       pool->num++;
-       BLI_condition_notify_all(&pool->num_cond);
-
-       BLI_mutex_unlock(&pool->num_mutex);
-}
-
-static bool task_scheduler_thread_wait_pop(TaskScheduler *scheduler, Task **task)
-{
-       BLI_mutex_lock(&scheduler->queue_mutex);
-
-       while (!scheduler->queue.first && !scheduler->do_exit)
-               BLI_condition_wait(&scheduler->queue_cond, &scheduler->queue_mutex);
-
-       if (!scheduler->queue.first) {
-               BLI_mutex_unlock(&scheduler->queue_mutex);
-               BLI_assert(scheduler->do_exit);
-               return false;
-       }
-       
-       *task = scheduler->queue.first;
-       BLI_remlink(&scheduler->queue, *task);
-
-       BLI_mutex_unlock(&scheduler->queue_mutex);
-
-       return true;
-}
-
-static void *task_scheduler_thread_run(void *thread_p)
-{
-       TaskThread *thread = (TaskThread *) thread_p;
-       TaskScheduler *scheduler = thread->scheduler;
-       int thread_id = thread->id;
-       Task *task;
-
-       /* keep popping off tasks */
-       while (task_scheduler_thread_wait_pop(scheduler, &task)) {
-               TaskPool *pool = task->pool;
-
-               /* run task */
-               task->run(pool, task->taskdata, thread_id);
-
-               /* delete task */
-               if (task->free_taskdata)
-                       MEM_freeN(task->taskdata);
-               MEM_freeN(task);
-
-               /* notify pool task was done */
-               task_pool_num_decrease(pool, 1);
-       }
-
-       return NULL;
-}
-
-TaskScheduler *BLI_task_scheduler_create(int num_threads)
-{
-       TaskScheduler *scheduler = MEM_callocN(sizeof(TaskScheduler), "TaskScheduler");
-
-       /* multiple places can use this task scheduler, sharing the same
-        * threads, so we keep track of the number of users. */
-       scheduler->do_exit = false;
-
-       scheduler->queue.first = scheduler->queue.last = NULL;
-       BLI_mutex_init(&scheduler->queue_mutex);
-       BLI_condition_init(&scheduler->queue_cond);
-
-       if (num_threads == 0) {
-               /* automatic number of threads will be main thread + num cores */
-               num_threads = BLI_system_thread_count();
-       }
-
-       /* main thread will also work, so we count it too */
-       num_threads -= 1;
-
-       /* launch threads that will be waiting for work */
-       if (num_threads > 0) {
-               int i;
-
-               scheduler->num_threads = num_threads;
-               scheduler->threads = MEM_callocN(sizeof(pthread_t) * num_threads, "TaskScheduler threads");
-               scheduler->task_threads = MEM_callocN(sizeof(TaskThread) * num_threads, "TaskScheduler task threads");
-
-               for (i = 0; i < num_threads; i++) {
-                       TaskThread *thread = &scheduler->task_threads[i];
-                       thread->scheduler = scheduler;
-                       thread->id = i + 1;
-
-                       if (pthread_create(&scheduler->threads[i], NULL, task_scheduler_thread_run, thread) != 0) {
-                               fprintf(stderr, "TaskScheduler failed to launch thread %d/%d\n", i, num_threads);
-                               MEM_freeN(thread);
-                       }
-               }
-       }
-       
-       return scheduler;
-}
-
-void BLI_task_scheduler_free(TaskScheduler *scheduler)
-{
-       Task *task;
-
-       /* stop all waiting threads */
-       BLI_mutex_lock(&scheduler->queue_mutex);
-       scheduler->do_exit = true;
-       BLI_condition_notify_all(&scheduler->queue_cond);
-       BLI_mutex_unlock(&scheduler->queue_mutex);
-
-       /* delete threads */
-       if (scheduler->threads) {
-               int i;
-
-               for (i = 0; i < scheduler->num_threads; i++) {
-                       if (pthread_join(scheduler->threads[i], NULL) != 0)
-                               fprintf(stderr, "TaskScheduler failed to join thread %d/%d\n", i, scheduler->num_threads);
-               }
-
-               MEM_freeN(scheduler->threads);
-       }
-
-       /* Delete task thread data */
-       if (scheduler->task_threads) {
-               MEM_freeN(scheduler->task_threads);
-       }
-
-       /* delete leftover tasks */
-       for (task = scheduler->queue.first; task; task = task->next) {
-               if (task->free_taskdata)
-                       MEM_freeN(task->taskdata);
-       }
-       BLI_freelistN(&scheduler->queue);
-
-       /* delete mutex/condition */
-       BLI_mutex_end(&scheduler->queue_mutex);
-       BLI_condition_end(&scheduler->queue_cond);
-
-       MEM_freeN(scheduler);
-}
-
-int BLI_task_scheduler_num_threads(TaskScheduler *scheduler)
-{
-       return scheduler->num_threads + 1;
-}
-
-static void task_scheduler_push(TaskScheduler *scheduler, Task *task, TaskPriority priority)
-{
-       task_pool_num_increase(task->pool);
-
-       /* add task to queue */
-       BLI_mutex_lock(&scheduler->queue_mutex);
-
-       if (priority == TASK_PRIORITY_HIGH)
-               BLI_addhead(&scheduler->queue, task);
-       else
-               BLI_addtail(&scheduler->queue, task);
-
-       BLI_condition_notify_one(&scheduler->queue_cond);
-       BLI_mutex_unlock(&scheduler->queue_mutex);
-}
-
-static void task_scheduler_clear(TaskScheduler *scheduler, TaskPool *pool)
-{
-       Task *task, *nexttask;
-       size_t done = 0;
-
-       BLI_mutex_lock(&scheduler->queue_mutex);
-
-       /* free all tasks from this pool from the queue */
-       for (task = scheduler->queue.first; task; task = nexttask) {
-               nexttask = task->next;
-
-               if (task->pool == pool) {
-                       if (task->free_taskdata)
-                               MEM_freeN(task->taskdata);
-                       BLI_freelinkN(&scheduler->queue, task);
-
-                       done++;
-               }
-       }
-
-       BLI_mutex_unlock(&scheduler->queue_mutex);
-
-       /* notify done */
-       task_pool_num_decrease(pool, done);
-}
-
-/* Task Pool */
-
-TaskPool *BLI_task_pool_create(TaskScheduler *scheduler, void *userdata)
-{
-       TaskPool *pool = MEM_callocN(sizeof(TaskPool), "TaskPool");
-
-       pool->scheduler = scheduler;
-       pool->num = 0;
-       pool->do_cancel = false;
-
-       BLI_mutex_init(&pool->num_mutex);
-       BLI_condition_init(&pool->num_cond);
-
-       pool->userdata = userdata;
-       BLI_mutex_init(&pool->user_mutex);
-
-       return pool;
-}
-
-void BLI_task_pool_free(TaskPool *pool)
-{
-       BLI_task_pool_stop(pool);
-
-       BLI_mutex_end(&pool->num_mutex);
-       BLI_condition_end(&pool->num_cond);
-
-       BLI_mutex_end(&pool->user_mutex);
-
-       MEM_freeN(pool);
-}
-
-void BLI_task_pool_push(TaskPool *pool, TaskRunFunction run,
-       void *taskdata, bool free_taskdata, TaskPriority priority)
-{
-       Task *task = MEM_callocN(sizeof(Task), "Task");
-
-       task->run = run;
-       task->taskdata = taskdata;
-       task->free_taskdata = free_taskdata;
-       task->pool = pool;
-
-       task_scheduler_push(pool->scheduler, task, priority);
-}
-
-void BLI_task_pool_work_and_wait(TaskPool *pool)
-{
-       TaskScheduler *scheduler = pool->scheduler;
-
-       BLI_mutex_lock(&pool->num_mutex);
-
-       while (pool->num != 0) {
-               Task *task, *work_task = NULL;
-               bool found_task = false;
-
-               BLI_mutex_unlock(&pool->num_mutex);
-
-               BLI_mutex_lock(&scheduler->queue_mutex);
-
-               /* find task from this pool. if we get a task from another pool,
-                * we can get into deadlock */
-
-               for (task = scheduler->queue.first; task; task = task->next) {
-                       if (task->pool == pool) {
-                               work_task = task;
-                               found_task = true;
-                               BLI_remlink(&scheduler->queue, task);
-                               break;
-                       }
-               }
-
-               BLI_mutex_unlock(&scheduler->queue_mutex);
-
-               /* if found task, do it, otherwise wait until other tasks are done */
-               if (found_task) {
-                       /* run task */
-                       work_task->run(pool, work_task->taskdata, 0);
-
-                       /* delete task */
-                       if (work_task->free_taskdata)
-                               MEM_freeN(work_task->taskdata);
-                       MEM_freeN(work_task);
-
-                       /* notify pool task was done */
-                       task_pool_num_decrease(pool, 1);
-               }
-
-               BLI_mutex_lock(&pool->num_mutex);
-               if (pool->num == 0)
-                       break;
-
-               if (!found_task)
-                       BLI_condition_wait(&pool->num_cond, &pool->num_mutex);
-       }
-
-       BLI_mutex_unlock(&pool->num_mutex);
-}
-
-void BLI_task_pool_cancel(TaskPool *pool)
-{
-       pool->do_cancel = true;
-
-       task_scheduler_clear(pool->scheduler, pool);
-
-       /* wait until all entries are cleared */
-       BLI_mutex_lock(&pool->num_mutex);
-       while (pool->num)
-               BLI_condition_wait(&pool->num_cond, &pool->num_mutex);
-       BLI_mutex_unlock(&pool->num_mutex);
-
-       pool->do_cancel = false;
-}
-
-void BLI_task_pool_stop(TaskPool *pool)
-{
-       task_scheduler_clear(pool->scheduler, pool);
-
-       BLI_assert(pool->num == 0);
-}
-
-bool BLI_task_pool_cancelled(TaskPool *pool)
-{
-       return pool->do_cancel;
-}
-
-void *BLI_task_pool_userdata(TaskPool *pool)
-{
-       return pool->userdata;
-}
-
-ThreadMutex *BLI_task_pool_user_mutex(TaskPool *pool)
-{
-       return &pool->user_mutex;
-}
-
-size_t BLI_task_pool_tasks_done(TaskPool *pool)
-{
-       return pool->done;
-}
-
index 1b0250cd0a34b7dfae462bd82706cfd2067bb0cf..c8b84d9310af091fd858d4551222dcfd5a5cb2ab 100644 (file)
@@ -37,7 +37,6 @@
 
 #include "BLI_listbase.h"
 #include "BLI_gsqueue.h"
-#include "BLI_task.h"
 #include "BLI_threads.h"
 
 #include "PIL_time.h"
@@ -64,9 +63,6 @@ extern pthread_key_t gomp_tls_key;
 static void *thread_tls_data;
 #endif
 
-/* We're using one global task scheduler for all kind of tasks. */
-static TaskScheduler *task_scheduler = NULL;
-
 /* ********** basic thread control API ************ 
  * 
  * Many thread cases have an X amount of jobs, and only an Y amount of
@@ -155,24 +151,9 @@ void BLI_threadapi_init(void)
 
 void BLI_threadapi_exit(void)
 {
-       BLI_task_scheduler_free(task_scheduler);
        BLI_spin_end(&_malloc_lock);
 }
 
-TaskScheduler *BLI_task_scheduler_get(void)
-{
-       if (task_scheduler == NULL) {
-               int tot_thread = BLI_system_thread_count();
-
-               /* Do a lazy initialization, so it happes after
-                * command line arguments parsing
-                */
-               task_scheduler = BLI_task_scheduler_create(tot_thread);
-       }
-
-       return task_scheduler;
-}
-
 /* tot = 0 only initializes malloc mutex in a safe way (see sequence.c)
  * problem otherwise: scene render will kill of the mutex!
  */
@@ -438,11 +419,6 @@ void BLI_mutex_unlock(ThreadMutex *mutex)
        pthread_mutex_unlock(mutex);
 }
 
-bool BLI_mutex_trylock(ThreadMutex *mutex)
-{
-       return (pthread_mutex_trylock(mutex) == 0);
-}
-
 void BLI_mutex_end(ThreadMutex *mutex)
 {
        pthread_mutex_destroy(mutex);
@@ -849,32 +825,6 @@ void BLI_thread_queue_wait_finish(ThreadQueue *queue)
        pthread_mutex_unlock(&queue->mutex);
 }
 
-/* Condition */
-void BLI_condition_init(ThreadCondition *cond)
-{
-       pthread_cond_init(cond, NULL);
-}
-
-void BLI_condition_wait(ThreadCondition *cond, ThreadMutex *mutex)
-{
-       pthread_cond_wait(cond, mutex);
-}
-
-void BLI_condition_notify_one(ThreadCondition *cond)
-{
-       pthread_cond_signal(cond);
-}
-
-void BLI_condition_notify_all(ThreadCondition *cond)
-{
-       pthread_cond_broadcast(cond);
-}
-
-void BLI_condition_end(ThreadCondition *cond)
-{
-       pthread_cond_destroy(cond);
-}
-
 /* ************************************************ */
 
 void BLI_begin_threaded_malloc(void)
@@ -897,3 +847,4 @@ void BLI_end_threaded_malloc(void)
        if (thread_levels == 0)
                MEM_set_lock_callback(NULL, NULL);
 }
+
index 2aa7e615d4add55d5974a975fe841cf123427ef3..a16b1a72739df55d8ae2bb5789804a9aa6b9a714 100644 (file)
@@ -5524,7 +5524,6 @@ static void direct_link_windowmanager(FileData *fd, wmWindowManager *wm)
        wm->winactive = NULL;
        wm->initialized = 0;
        wm->op_undo_depth = 0;
-       wm->is_interface_locked = 0;
 }
 
 static void lib_link_windowmanager(FileData *fd, Main *main)
index 930ae7da4c7aea68c0df982c4b5f4f0038f468c8..9b4f34d18f241e620c5f65811eedc66b99a2c98c 100644 (file)
@@ -991,6 +991,25 @@ BMVert *BM_edge_share_vert(BMEdge *e1, BMEdge *e2)
        }
 }
 
+/**
+ * \brief Return the Loop Shared by Edge and Vert
+ *
+ * Finds the loop used which uses \a  in face loop \a l
+ *
+ * \note this function takes a loop rather then an edge
+ * so we can select the face that the loop should be from.
+ */
+BMLoop *BM_edge_vert_share_loop(BMLoop *l, BMVert *v)
+{
+       BLI_assert(BM_vert_in_edge(l->e, v));
+       if (l->v == v) {
+               return l;
+       }
+       else {
+               return l->next;
+       }
+}
+
 /**
  * \brief Return the Loop Shared by Face and Vertex
  *
index e52e59102db4af2e987d986d63cd6d70ce9295f2..a057d120be18fb7ea35a79918c18c4dcf8101c25 100644 (file)
@@ -106,6 +106,7 @@ bool    BM_edge_share_quad_check(BMEdge *e1, BMEdge *e2);
 bool    BM_edge_share_vert_check(BMEdge *e1, BMEdge *e2);
 
 BMVert *BM_edge_share_vert(BMEdge *e1, BMEdge *e2);
+BMLoop *BM_edge_vert_share_loop(BMLoop *l, BMVert *v);
 BMLoop *BM_face_vert_share_loop(BMFace *f, BMVert *v);
 BMLoop *BM_face_edge_share_loop(BMFace *f, BMEdge *e);
 
index aad600d13fa9e527afba68a97feb3a07c9f48f5c..412253aafe929c7451d9b4c316cd396db5f914d4 100644 (file)
@@ -193,11 +193,13 @@ void BM_mesh_edgesplit(BMesh *bm, const bool use_verts, const bool tag_only, con
 
                                                bmesh_vert_separate(bm, v, &vtar, &vtar_len, copy_select);
 
-                                               if (vtar_len) {
+                                               /* first value is always in 'v' */
+                                               if (vtar_len > 1) {
                                                        BMEditSelection *ese = BLI_ghash_lookup(ese_gh, v);
+                                                       BLI_assert(v == vtar[0]);
                                                        if (UNLIKELY(ese)) {
                                                                int j;
-                                                               for (j = 0; j < vtar_len; j++) {
+                                                               for (j = 1; j < vtar_len; j++) {
                                                                        BLI_assert(v != vtar[j]);
                                                                        BM_select_history_store_after_notest(bm, ese, vtar[j]);
                                                                }
index 357a4c1d4c028fe8abfd0f26137a813432022a7b..4bebf004a893208fb7de1c825b8628d13004f58f 100644 (file)
@@ -335,8 +335,7 @@ void MemoryBuffer::readEWA(float result[4], float fx, float fy, float dx, float
                                float tc[4];
                                const float wt = EWA_WTS[(Q < 0.f) ? 0 : (unsigned int)Q];
                                read(tc, clipuv(u, width), clipuv(v, height));
-                               madd_v3_v3fl(result, tc, wt);
-                               result[3] += result[3] ? tc[3] * wt : 0.f;
+                               madd_v4_v4fl(result, tc, wt);
                                d += wt;
                        }
                        Q += DQ;
@@ -346,9 +345,5 @@ void MemoryBuffer::readEWA(float result[4], float fx, float fy, float dx, float
        
        // d should hopefully never be zero anymore
        d = 1.f / d;
-       result[0] *= d;
-       result[1] *= d;
-       result[2] *= d;
-       // clipping can be ignored if alpha used, texr->ta already includes filtered edge
-       result[3] = result[3] ? result[3] * d : 1.f;
+       mul_v4_fl(result, d);
 }
index bee31be0de29e2c03961c94bc12c888746e459e0..d197697e60b5f027c7f1fcc479c4bb34facd81e8 100644 (file)
@@ -126,7 +126,5 @@ void CURVE_OT_vertex_add(struct wmOperatorType *ot);
 void CURVE_OT_extrude(struct wmOperatorType *ot);
 void CURVE_OT_cyclic_toggle(struct wmOperatorType *ot);
 
-void CURVE_OT_match_texture_space(struct wmOperatorType *ot);
-
 #endif /* ED_UTIL_INTERN_H */
 
index 217ec57297ffe700f64aee942837163d722a0e48..2452a5d1a4bb6b7d5321a21467d3ff36d8f9695f 100644 (file)
@@ -136,8 +136,6 @@ void ED_operatortypes_curve(void)
        WM_operatortype_append(CURVE_OT_vertex_add);
        WM_operatortype_append(CURVE_OT_extrude);
        WM_operatortype_append(CURVE_OT_cyclic_toggle);
-
-       WM_operatortype_append(CURVE_OT_match_texture_space);
 }
 
 void ED_operatormacros_curve(void)
index 6d573c5e13c190d0c3d33bdcf4655e05b65dace0..660f8098a38fae73876dfc9a0a89da09f9f6baf1 100644 (file)
@@ -59,7 +59,6 @@
 #include "BKE_context.h"
 #include "BKE_curve.h"
 #include "BKE_depsgraph.h"
-#include "BKE_displist.h"
 #include "BKE_fcurve.h"
 #include "BKE_global.h"
 #include "BKE_key.h"
@@ -7179,65 +7178,3 @@ int ED_curve_actSelection(Curve *cu, float center[3])
 
        return 1;
 }
-
-/******************** Match texture space operator ***********************/
-
-static int match_texture_space_poll(bContext *C)
-{
-       Object *object = CTX_data_active_object(C);
-
-       return object && ELEM3(object->type, OB_CURVE, OB_SURF, OB_FONT);
-}
-
-static int match_texture_space_exec(bContext *C, wmOperator *UNUSED(op))
-{
-       Scene *scene = CTX_data_scene(C);
-       Object *object = CTX_data_active_object(C);
-       Curve *curve = (Curve *) object->data;
-       float min[3], max[3], size[3], loc[3];
-       int a;
-
-       if (ELEM(NULL, object->curve_cache, object->curve_cache->disp.first)) {
-               BKE_displist_make_curveTypes(scene, object, FALSE);
-       }
-
-       INIT_MINMAX(min, max);
-       BKE_displist_minmax(&object->curve_cache->disp, min, max);
-
-       mid_v3_v3v3(loc, min, max);
-
-       size[0] = (max[0] - min[0]) / 2.0f;
-       size[1] = (max[1] - min[1]) / 2.0f;
-       size[2] = (max[2] - min[2]) / 2.0f;
-
-       for (a = 0; a < 3; a++) {
-               if (size[a] == 0.0f) size[a] = 1.0f;
-               else if (size[a] > 0.0f && size[a] < 0.00001f) size[a] = 0.00001f;
-               else if (size[a] < 0.0f && size[a] > -0.00001f) size[a] = -0.00001f;
-       }
-
-       copy_v3_v3(curve->loc, loc);
-       copy_v3_v3(curve->size, size);
-       zero_v3(curve->rot);
-
-       curve->texflag &= ~CU_AUTOSPACE;
-
-       WM_event_add_notifier(C, NC_GEOM | ND_DATA, curve);
-
-       return OPERATOR_FINISHED;
-}
-
-void CURVE_OT_match_texture_space(wmOperatorType *ot)
-{
-       /* identifiers */
-       ot->name = "Match Texture Space";
-       ot->idname = "CURVE_OT_match_texture_space";
-       ot->description = "Match texture space to object's bounding box";
-
-       /* api callbacks */
-       ot->exec = match_texture_space_exec;
-       ot->poll = match_texture_space_poll;
-
-       /* flags */
-       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-}
index 1360a180b2d02a136a962486fb94f6c69888dac2..cbea45e2c2ee2a952006a5ba7f4b5647bf7d2c07 100644 (file)
  * point and would result in the same distance.
  */
 #define INSET_DEFAULT 0.00001f
-static float edbm_rip_edgedist(ARegion *ar, float mat[4][4],
-                               const float co1[3], const float co2[3], const float mvalf[2],
-                               const float inset)
+static float edbm_rip_edgedist_squared(ARegion *ar, float mat[4][4],
+                                       const float co1[3], const float co2[3], const float mvalf[2],
+                                       const float inset)
 {
-       float vec1[2], vec2[2];
+       float vec1[2], vec2[2], dist_sq;
 
        ED_view3d_project_float_v2_m4(ar, co1, vec1, mat);
        ED_view3d_project_float_v2_m4(ar, co2, vec2, mat);
 
        if (inset != 0.0f) {
-               const float dist = inset / len_v2v2(vec1, vec2);
-               interp_v2_v2v2(vec1, vec1, vec2, dist);
-               interp_v2_v2v2(vec2, vec2, vec1, dist);
+               const float dist_2d = len_v2v2(vec1, vec2);
+               if (dist_2d > FLT_EPSILON) {
+                       const float dist = inset / dist_2d;
+                       BLI_assert(isfinite(dist));
+                       interp_v2_v2v2(vec1, vec1, vec2, dist);
+                       interp_v2_v2v2(vec2, vec2, vec1, dist);
+               }
        }
 
-       /* TODO: use dist_squared_to_line_segment_v2() looks like we only ever use for comparison */
-       return dist_to_line_segment_v2(mvalf, vec1, vec2);
+       dist_sq = dist_squared_to_line_segment_v2(mvalf, vec1, vec2);
+       BLI_assert(isfinite(dist_sq));
+
+       return dist_sq;
 }
 
 #if 0
@@ -525,11 +531,11 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
        BMIter iter, liter;
        BMLoop *l;
        BMEdge *e, *e2;
-       BMVert *v, *ripvert = NULL;
+       BMVert *v;
        const int totvert_orig = bm->totvert;
        int i;
        float projectMat[4][4], fmval[3] = {event->mval[0], event->mval[1]};
-       float dist = FLT_MAX;
+       float dist_sq = FLT_MAX;
        float d;
        bool is_wire;
 
@@ -562,15 +568,15 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
        if (v->e) {
                /* find closest edge to mouse cursor */
                BM_ITER_ELEM (e, &iter, v, BM_EDGES_OF_VERT) {
-                       int is_boundary = BM_edge_is_boundary(e);
+                       const bool is_boundary = BM_edge_is_boundary(e);
                        /* consider wire as boundary for this purpose,
                         * otherwise we can't a face away from a wire edge */
                        totboundary_edge += (is_boundary != 0 || BM_edge_is_wire(e));
                        if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN)) {
                                if (is_boundary == false && BM_edge_is_manifold(e)) {
-                                       d = edbm_rip_edgedist(ar, projectMat, e->v1->co, e->v2->co, fmval, INSET_DEFAULT);
-                                       if (d < dist) {
-                                               dist = d;
+                                       d = edbm_rip_edgedist_squared(ar, projectMat, e->v1->co, e->v2->co, fmval, INSET_DEFAULT);
+                                       if ((e2 == NULL) || (d < dist_sq)) {
+                                               dist_sq = d;
                                                e2 = e;
                                        }
                                }
@@ -596,10 +602,9 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
                                float l_mid_co[3];
                                l = l_all[i1];
                                edbm_calc_loop_co(l, l_mid_co);
-                               d = edbm_rip_edgedist(ar, projectMat, l->v->co, l_mid_co, fmval, INSET_DEFAULT);
-
-                               if (d < dist) {
-                                       dist = d;
+                               d = edbm_rip_edgedist_squared(ar, projectMat, l->v->co, l_mid_co, fmval, INSET_DEFAULT);
+                               if ((e2 == NULL) || (d < dist_sq)) {
+                                       dist_sq = d;
 
                                        /* find the edge that is not in this loop */
                                        e2 = NULL;
@@ -647,7 +652,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
                                BM_select_history_remove(bm, ese.ele);
                        }
 
-                       dist = FLT_MAX;
+                       dist_sq = FLT_MAX;
 
                        /* in the loop below we find the best vertex to drag based on its connected geometry,
                         * either by its face corner, or connected edge (when no faces are attached) */
@@ -658,12 +663,12 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
                                        BM_ITER_ELEM (l, &iter, vout[i], BM_LOOPS_OF_VERT) {
                                                if (!BM_elem_flag_test(l->f, BM_ELEM_HIDDEN)) {
                                                        float l_mid_co[3];
-                                                       edbm_calc_loop_co(l, l_mid_co);
 
-                                                       d = edbm_rip_edgedist(ar, projectMat, v->co, l_mid_co, fmval, INSET_DEFAULT);
+                                                       edbm_calc_loop_co(l, l_mid_co);
+                                                       d = edbm_rip_edgedist_squared(ar, projectMat, v->co, l_mid_co, fmval, INSET_DEFAULT);
 
-                                                       if (d < dist) {
-                                                               dist = d;
+                                                       if (d < dist_sq) {
+                                                               dist_sq = d;
                                                                vi_best = i;
                                                        }
                                                }
@@ -674,12 +679,12 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
                                        BM_ITER_ELEM (e, &iter, vout[i], BM_EDGES_OF_VERT) {
                                                if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN)) {
                                                        float e_mid_co[3];
-                                                       mid_v3_v3v3(e_mid_co, e->v1->co, e->v2->co);
 
-                                                       d = edbm_rip_edgedist(ar, projectMat, v->co, e_mid_co, fmval, INSET_DEFAULT);
+                                                       mid_v3_v3v3(e_mid_co, e->v1->co, e->v2->co);
+                                                       d = edbm_rip_edgedist_squared(ar, projectMat, v->co, e_mid_co, fmval, INSET_DEFAULT);
 
-                                                       if (d < dist) {
-                                                               dist = d;
+                                                       if (d < dist_sq) {
+                                                               dist_sq = d;
                                                                vi_best = i;
                                                        }
                                                }
@@ -730,19 +735,36 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
        /* rip two adjacent edges */
        if (BM_edge_is_boundary(e2) || BM_vert_face_count(v) == 2) {
                /* Don't run the edge split operator in this case */
+               BMVert *v_rip;
+
+               l = BM_edge_vert_share_loop(e2->l, v);
 
-               BM_elem_flag_enable(e2, BM_ELEM_TAG);  /* only for face-fill (we don't call the operator) */
+               /* only tag for face-fill (we don't call the operator) */
+               if (BM_edge_is_boundary(e2)) {
+                       BM_elem_flag_enable(e2, BM_ELEM_TAG);
+               }
+               else {
+                       BM_elem_flag_enable(l->e, BM_ELEM_TAG);
+                       BM_elem_flag_enable(l->prev->e, BM_ELEM_TAG);
+               }
 
                /* keep directly before edgesplit */
                if (do_fill) {
                        fill_uloop_pairs = edbm_tagged_loop_pairs_to_fill(bm);
                }
 
-               l = e2->l;
-               ripvert = BM_face_vert_separate(bm, l->f, v);
+#if 0
+               v_rip = BM_face_vert_separate(bm, l->f, v);
+#else
+               v_rip = BM_face_loop_separate(bm, l);
+#endif
+
+               BLI_assert(v_rip);
 
-               BLI_assert(ripvert);
-               if (!ripvert) {
+               if (v_rip) {
+                       BM_vert_select_set(bm, v_rip, true);
+               }
+               else {
                        if (fill_uloop_pairs) MEM_freeN(fill_uloop_pairs);
                        return OPERATOR_CANCELLED;
                }
@@ -769,37 +791,28 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
                BM_mesh_edgesplit(em->bm, true, true, true);
        }
 
-       dist = FLT_MAX;
+       dist_sq = FLT_MAX;
 
        {
                /* --- select which vert --- */
                BMVert *v_best = NULL;
-               float l_prev_co[3], l_next_co[3], l_corner_co[3];
-               float scale;
+               float l_corner_co[3];
 
-               dist = FLT_MAX;
+               dist_sq = FLT_MAX;
                BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
                        if (BM_elem_flag_test(v, BM_ELEM_SELECT)) {
                                /* disable by default, re-enable winner at end */
                                BM_vert_select_set(bm, v, false);
+                               BM_select_history_remove(bm, v);
 
                                BM_ITER_ELEM (l, &liter, v, BM_LOOPS_OF_VERT) {
-                                       /* calculate a point in the face, rather then calculate the middle,
-                                        * make a vector pointing between the 2 edges attached to this loop */
-                                       sub_v3_v3v3(l_prev_co, l->prev->v->co, l->v->co);
-                                       sub_v3_v3v3(l_next_co, l->next->v->co, l->v->co);
-
-                                       scale = normalize_v3(l_prev_co) + normalize_v3(l_next_co);
-                                       mul_v3_fl(l_prev_co, scale);
-                                       mul_v3_fl(l_next_co, scale);
-
-                                       add_v3_v3v3(l_corner_co, l_prev_co, l_next_co);
-                                       add_v3_v3(l_corner_co, l->v->co);
 
-                                       d = edbm_rip_edgedist(ar, projectMat, l->v->co, l_corner_co, fmval, INSET_DEFAULT);
-                                       if (d < dist) {
+                                       /* check if v_best is null in the _rare_ case there are numeric issues */
+                                       edbm_calc_loop_co(l, l_corner_co);
+                                       d = edbm_rip_edgedist_squared(ar, projectMat, l->v->co, l_corner_co, fmval, INSET_DEFAULT);
+                                       if ((v_best == NULL) || (d < dist_sq)) {
                                                v_best = v;
-                                               dist = d;
+                                               dist_sq = d;
                                        }
                                }
                        }
@@ -965,7 +978,7 @@ static int edbm_rip_invoke(bContext *C, wmOperator *op, const wmEvent *event)
        BMesh *bm = em->bm;
        BMIter iter;
        BMEdge *e;
-       int singlesel = (bm->totvertsel == 1 && bm->totedgesel == 0 && bm->totfacesel == 0);
+       const bool singlesel = (bm->totvertsel == 1 && bm->totedgesel == 0 && bm->totfacesel == 0);
        int ret;
 
        /* running in face mode hardly makes sense, so convert to region loop and rip */
index 47e13f0293419aca2908096f5c7b9e34e5aff634..7f7a0777bbf80354dc07b0f11c4e1b5ce08b2ec6 100644 (file)
@@ -1417,9 +1417,8 @@ static void UNUSED_FUNCTION(image_aspect) (Scene *scene, View3D *v3d)
                                                                        space = size[0] / size[1];
                                                                }
                                                                else if (ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF)) {
-                                                                       float size[3];
-                                                                       BKE_curve_texspace_get(ob->data, NULL, NULL, size);
-                                                                       space = size[0] / size[1];
+                                                                       Curve *cu = ob->data;
+                                                                       space = cu->size[0] / cu->size[1];
                                                                }
                                                        
                                                                x = ibuf->x / space;
index 4b081d41ef3d9193940aee683d853920d231051d..3a6bd05df0bd1eacd3e5bc0f8323cd01c0633e27 100644 (file)
@@ -274,7 +274,6 @@ typedef struct RenderJob {
        short *do_update;
        float *progress;
        ReportList *reports;
-       bool interface_locked;
 } RenderJob;
 
 static void render_freejob(void *rjv)
@@ -502,15 +501,6 @@ static void render_endjob(void *rjv)
 
                BKE_image_release_ibuf(ima, ibuf, lock);
        }
-
-       /* Finally unlock the user interface (if it was locked). */
-       if (rj->interface_locked) {
-               /* Interface was locked, so window manager couldn't have been changed
-                * and using one from Global will unlock exactly the same manager as
-                * was locked before running the job.
-                */
-               WM_set_locked_interface(G.main->wm.first, false);
-       }
 }
 
 /* called by render, check job 'stop' value or the global */
@@ -536,14 +526,10 @@ static int render_break(void *UNUSED(rjv))
 
 /* runs in thread, no cursor setting here works. careful with notifiers too (malloc conflicts) */
 /* maybe need a way to get job send notifer? */
-static void render_drawlock(void *rjv, int lock)
+static void render_drawlock(void *UNUSED(rjv), int lock)
 {
-       RenderJob *rj = rjv;
-
-       /* If interface is locked, renderer callback shall do nothing. */
-       if (!rj->interface_locked) {
-               BKE_spacedata_draw_locks(lock);
-       }
+       BKE_spacedata_draw_locks(lock);
+       
 }
 
 /* catch esc */
@@ -671,23 +657,6 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even
                        rj->lay |= v3d->localvd->lay;
        }
 
-       /* Lock the user interface depending on render settings. */
-       if (scene->r.use_lock_interface) {
-               WM_set_locked_interface(CTX_wm_manager(C), true);
-
-               /* Set flag interface need to be unlocked.
-                *
-                * This is so because we don't have copy of render settings
-                * accessible from render job and copy is needed in case
-                * of non-locked rendering, so we wouldn't try to unlock
-                * anything if option was initially unset but then was
-                * enabled during rendering.
-                */
-               rj->interface_locked = true;
-
-               /* TODO(sergey): clean memory used by viewport? */
-       }
-
        /* setup job */
        if (RE_seq_render_active(scene, &scene->r)) name = "Sequence Render";
        else name = "Render";
index a32ab4c56578593d8321f15d7dc723247ff18f46..2da3f3adb67ead60332ee3a2890703ca01c13f8f 100644 (file)
@@ -360,7 +360,7 @@ void IMAGE_OT_view_pan(wmOperatorType *ot)
        ot->poll = space_image_main_area_poll;
 
        /* flags */
-       ot->flag = OPTYPE_BLOCKING | OPTYPE_GRAB_POINTER | OPTYPE_ALLOW_LOCKED;
+       ot->flag = OPTYPE_BLOCKING | OPTYPE_GRAB_POINTER;
        
        /* properties */
        RNA_def_float_vector(ot->srna, "offset", 2, NULL, -FLT_MAX, FLT_MAX,
@@ -575,7 +575,7 @@ void IMAGE_OT_view_zoom(wmOperatorType *ot)
        ot->poll = space_image_main_area_poll;
 
        /* flags */
-       ot->flag = OPTYPE_BLOCKING | OPTYPE_ALLOW_LOCKED;
+       ot->flag = OPTYPE_BLOCKING;
        
        /* properties */
        RNA_def_float(ot->srna, "factor", 0.0f, -FLT_MAX, FLT_MAX,
@@ -638,9 +638,6 @@ void IMAGE_OT_view_ndof(wmOperatorType *ot)
        
        /* api callbacks */
        ot->invoke = image_view_ndof_invoke;
-
-       /* flags */
-       ot->flag = OPTYPE_ALLOW_LOCKED;
 }
 
 /********************** view all operator *********************/
@@ -696,9 +693,6 @@ void IMAGE_OT_view_all(wmOperatorType *ot)
        /* api callbacks */
        ot->exec = image_view_all_exec;
        ot->poll = space_image_main_area_poll;
-
-       /* flags */
-       ot->flag = OPTYPE_GRAB_POINTER;
 }
 
 /********************** view selected operator *********************/
@@ -761,9 +755,6 @@ void IMAGE_OT_view_selected(wmOperatorType *ot)
        /* api callbacks */
        ot->exec = image_view_selected_exec;
        ot->poll = image_view_selected_poll;
-
-       /* flags */
-       ot->flag = OPTYPE_GRAB_POINTER;
 }
 
 /********************** view zoom in/out operator *********************/
@@ -806,9 +797,6 @@ void IMAGE_OT_view_zoom_in(wmOperatorType *ot)
        ot->exec = image_view_zoom_in_exec;
        ot->poll = space_image_main_area_poll;
 
-       /* flags */
-       ot->flag = OPTYPE_ALLOW_LOCKED;
-
        /* properties */
        RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, "Location", "Cursor location in screen coordinates", -10.0f, 10.0f);
 }
@@ -851,9 +839,6 @@ void IMAGE_OT_view_zoom_out(wmOperatorType *ot)
        ot->exec = image_view_zoom_out_exec;
        ot->poll = space_image_main_area_poll;
 
-       /* flags */
-       ot->flag = OPTYPE_ALLOW_LOCKED;
-
        /* properties */
        RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, "Location", "Cursor location in screen coordinates", -10.0f, 10.0f);
 }
@@ -895,10 +880,7 @@ void IMAGE_OT_view_zoom_ratio(wmOperatorType *ot)
        /* api callbacks */
        ot->exec = image_view_zoom_ratio_exec;
        ot->poll = space_image_main_area_poll;
-
-       /* flags */
-       ot->flag = OPTYPE_ALLOW_LOCKED;
-
+       
        /* properties */
        RNA_def_float(ot->srna, "ratio", 0.0f, -FLT_MAX, FLT_MAX,
                      "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out", -FLT_MAX, FLT_MAX);
index a40e32af3669c7ec8ad288c8ab3801dbd9e3ccd4..e02e285ee589acec22e2386c443665b31c5ecd71 100644 (file)
@@ -6251,7 +6251,7 @@ static void draw_bounding_volume(Scene *scene, Object *ob, char type)
                bb = BKE_mesh_boundbox_get(ob);
        }
        else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
-               bb = BKE_curve_boundbox_get(ob);
+               bb = ob->bb ? ob->bb : ( (Curve *)ob->data)->bb;
        }
        else if (ob->type == OB_MBALL) {
                if (BKE_mball_is_basis(ob)) {
@@ -6286,7 +6286,9 @@ static void drawtexspace(Object *ob)
                BKE_mesh_texspace_get(ob->data, loc, NULL, size);
        }
        else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
-               BKE_curve_texspace_get(ob->data, loc, NULL, size);
+               Curve *cu = ob->data;
+               copy_v3_v3(size, cu->size);
+               copy_v3_v3(loc, cu->loc);
        }
        else if (ob->type == OB_MBALL) {
                MetaBall *mb = ob->data;
index 5d6ccc92475f7bbd1ba16e758d920e188ce35d54..002d77fb0e62c01ce95562499899ec43585c1d3f 100644 (file)
@@ -431,8 +431,7 @@ typedef struct RenderData {
         * Render to image editor, fullscreen or to new window.
         */
        short displaymode;
-       char use_lock_interface;
-       char pad7;
+       short pad7;
 
        /**
         * Flags for render settings. Use bit-masking to access the settings.
index 29fac36ddd078030b854496a8c44a605704b2474..27aef3b8ec63715969d37b88dfa05bdc4dd999d8 100644 (file)
@@ -151,9 +151,6 @@ typedef struct wmWindowManager {
 
        ListBase timers;                                        /* active timers */
        struct wmTimer *autosavetimer;          /* timer for auto save */
-
-       char is_interface_locked;               /* indicates whether interface is locked for user interaction */
-       char par[7];
 } wmWindowManager;
 
 /* wmWindowManager.initialized */
index 49098a1d8c4b9e298317d0bea69addceca8debfd..83dbd79024e246ecdab2451c3bb8056a6b2d97f6 100644 (file)
@@ -4558,12 +4558,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
        RNA_def_property_enum_items(prop, display_mode_items);
        RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed");
        RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
-
-       prop = RNA_def_property(srna, "use_lock_interface", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "use_lock_interface", 1);
-       RNA_def_property_ui_text(prop, "Lock Interface", "Lock interface during rendering in favor of giving more memory to the renderer");
-       RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
-
+       
        prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
        RNA_def_property_string_sdna(prop, NULL, "pic");
        RNA_def_property_ui_text(prop, "Output Path",
index 502f959ce2c09105dfecb991e68ecf17bb468b53..375b31e058612a67431d62197c65dd3373eff093 100644 (file)
@@ -61,7 +61,7 @@ static void rna_Scene_frame_set(Scene *scene, int frame, float subframe)
        CLAMP(cfra, MINAFRAME, MAXFRAME);
        BKE_scene_frame_set(scene, cfra);
 
-       BKE_scene_update_for_newframe_ex(G.main, scene, (1 << 20) - 1, false);
+       BKE_scene_update_for_newframe(G.main, scene, (1 << 20) - 1);
        BKE_scene_camera_switch_update(scene);
 
        /* don't do notifier when we're rendering, avoid some viewport crashes
@@ -78,7 +78,7 @@ static void rna_Scene_frame_set(Scene *scene, int frame, float subframe)
 
 static void rna_Scene_update_tagged(Scene *scene)
 {
-       BKE_scene_update_tagged_ex(G.main, scene, false);
+       BKE_scene_update_tagged(G.main, scene);
 }
 
 static void rna_SceneRender_get_frame_path(RenderData *rd, int frame, char *name)
index ac92e733028928cbc5912eb338b2e669a728a53f..8894be111e7e08ff09c7bfa9c2ee2ce481e32cb7 100644 (file)
@@ -425,9 +425,6 @@ void        WM_main_playanim(int argc, const char **argv);
 /* debugging only, convenience function to write on crash */
 int write_crash_blend(void);
 
-                       /* Lock the interface for any communication */
-void        WM_set_locked_interface(struct wmWindowManager *wm, bool lock);
-
 #ifdef __cplusplus
 }
 #endif
index 2364c4b13bb71ad78f53d54732224d1093275400..f1932c8aa97f2bbb6a205482150c2403765d581d 100644 (file)
@@ -133,7 +133,6 @@ struct ImBuf;
                                                                 * and don't make sense to be accessed from the
                                                                 * search menu, even if poll() returns TRUE.
                                                                 * currently only used for the search toolbox */
-#define OPTYPE_ALLOW_LOCKED    128     /* Allow operator to run when interface is locked */
 
 /* context to call operator in for WM_operator_name_call */
 /* rna_ui.c contains EnumPropertyItem's of these, keep in sync */
index 8d7152fb98b756603da8400e1773643c8630b522..b4f193bdbe6256a16291d34e053a5b2b1db78f1a 100644 (file)
@@ -1463,22 +1463,6 @@ static void wm_event_modalkeymap(const bContext *C, wmOperator *op, wmEvent *eve
        }
 }
 
-/* Check whether operator is allowed to run in case interface is locked,
- * If interface is unlocked, will always return truth.
- */
-static bool wm_operator_check_locked_interface(bContext *C, wmOperatorType *ot)
-{
-       wmWindowManager *wm = CTX_wm_manager(C);
-
-       if (wm->is_interface_locked) {
-               if ((ot->flag & OPTYPE_ALLOW_LOCKED) == 0) {
-                       return false;
-               }
-       }
-
-       return true;
-}
-
 /* bad hacking event system... better restore event type for checking of KM_CLICK for example */
 /* XXX modal maps could use different method (ton) */
 static void wm_event_modalmap_end(wmEvent *event)
@@ -1505,12 +1489,7 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
                wmOperator *op = handler->op;
                wmOperatorType *ot = op->type;
 
-               if (!wm_operator_check_locked_interface(C, ot)) {
-                       /* Interface is locked and pperator is not allowed to run,
-                        * nothing to do in this case.
-                        */
-               }
-               else if (ot->modal) {
+               if (ot->modal) {
                        /* we set context to where modal handler came from */
                        wmWindowManager *wm = CTX_wm_manager(C);
                        ScrArea *area = CTX_wm_area(C);
@@ -1582,9 +1561,7 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
                wmOperatorType *ot = WM_operatortype_find(event->keymap_idname, 0);
 
                if (ot) {
-                       if (wm_operator_check_locked_interface(C, ot)) {
-                               retval = wm_operator_invoke(C, ot, event, properties, NULL, FALSE);
-                       }
+                       retval = wm_operator_invoke(C, ot, event, properties, NULL, FALSE);
                }
        }
        /* Finished and pass through flag as handled */
@@ -1790,11 +1767,7 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers
                /* comment this out to flood the console! (if you really want to test) */
                !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)
                ;
-#    define PRINT if (do_debug_handler) printf
-#else
-#  define PRINT(format, ...)
 #endif
-
        wmWindowManager *wm = CTX_wm_manager(C);
        wmEventHandler *handler, *nexthandler;
        int action = WM_HANDLER_CONTINUE;
@@ -1830,16 +1803,28 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers
                                wmKeyMap *keymap = WM_keymap_active(wm, handler->keymap);
                                wmKeyMapItem *kmi;
 
-                               PRINT("%s:   checking '%s' ...", __func__, keymap->idname);
+#ifndef NDEBUG
+                               if (do_debug_handler) {
+                                       printf("%s:   checking '%s' ...", __func__, keymap->idname);
+                               }
+#endif
 
                                if (!keymap->poll || keymap->poll(C)) {
 
-                                       PRINT("pass\n");
+#ifndef NDEBUG
+                                       if (do_debug_handler) {
+                                               printf("pass\n");
+                                       }
+#endif
 
                                        for (kmi = keymap->items.first; kmi; kmi = kmi->next) {
                                                if (wm_eventmatch(event, kmi)) {
 
-                                                       PRINT("%s:     item matched '%s'\n", __func__, kmi->idname);
+#ifndef NDEBUG
+                                                       if (do_debug_handler) {
+                                                               printf("%s:     item matched '%s'\n", __func__, kmi->idname);
+                                                       }
+#endif
 
                                                        /* weak, but allows interactive callback to not use rawkey */
                                                        event->keymap_idname = kmi->idname;
@@ -1858,28 +1843,32 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers
                                                                        if (G.debug & (G_DEBUG_EVENTS | G_DEBUG_HANDLERS))
                                                                                printf("%s:       handled - and pass on! '%s'\n", __func__, kmi->idname);
                                                                
-                                                                       PRINT("%s:       un-handled '%s'...", __func__, kmi->idname);
+#ifndef NDEBUG
+                                                               if (do_debug_handler) {
+                                                                       printf("%s:       un-handled '%s'...", __func__, kmi->idname);
+                                                               }
+#endif
                                                        }
                                                }
                                        }
                                }
                                else {
-                                       PRINT("fail\n");
+#ifndef NDEBUG
+                                       if (do_debug_handler) {
+                                               printf("fail\n");
+                                       }
+#endif
                                }
                        }
                        else if (handler->ui_handle) {
-                               if (!wm->is_interface_locked) {
-                                       action |= wm_handler_ui_call(C, handler, event, always_pass);
-                               }
+                               action |= wm_handler_ui_call(C, handler, event, always_pass);
                        }
                        else if (handler->type == WM_HANDLER_FILESELECT) {
-                               if (!wm->is_interface_locked) {
-                                       /* screen context changes here */
-                                       action |= wm_handler_fileselect_call(C, handlers, handler, event);
-                               }
+                               /* screen context changes here */
+                               action |= wm_handler_fileselect_call(C, handlers, handler, event);
                        }
                        else if (handler->dropboxes) {
-                               if (!wm->is_interface_locked && event->type == EVT_DROP) {
+                               if (event->type == EVT_DROP) {
                                        wmDropBox *drop = handler->dropboxes->first;
                                        for (; drop; drop = drop->next) {
                                                /* other drop custom types allowed */
@@ -1945,8 +1934,6 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers
        if (action == (WM_HANDLER_BREAK | WM_HANDLER_MODAL))
                wm_cursor_arrow_move(CTX_wm_window(C), event);
 
-#undef PRINT
-
        return action;
 }
 
@@ -3256,24 +3243,3 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
        WM_event_print(&event);
 #endif
 }
-
-void WM_set_locked_interface(wmWindowManager *wm, bool lock)
-{
-       /* This will prevent events from being handled while interface is locked
-        *
-        * Use a "local" flag for now, because currently no other areas could
-        * benefit of locked interface anyway (aka using G.is_interface_locked
-        * wouldn't be useful anywhere outside of window manager, so let's not
-        * pollute global context with such an information for now).
-        */
-       wm->is_interface_locked = lock ? 1 : 0;
-
-       /* This will prevent drawing regions which uses non-threadsafe data.
-        * Currently it'll be just a 3D viewport.
-        *
-        * TODO(sergey): Make it different locked states, so different jobs
-        *               could lock different areas of blender and allow
-        *               interation with others?
-        */
-       BKE_spacedata_draw_locks(lock);
-}
index 2663b3e8c7645837d36b3aa4fa99073f05edda39..4e9b849af408d07a06e9141a0c79f9566e819a96 100644 (file)
@@ -518,7 +518,7 @@ void WM_exit_ext(bContext *C, const short do_python)
                MEM_printmemlist();
        }
        wm_autosave_delete();
-
+       
        printf("\nBlender quit\n");
        
 #ifdef WIN32   
index 31b44915ad4572f23d4661f5a8ff26630d3622df..e8ab1fef8b700a850f0910f3d2b6e09aa5d4cd43 100644 (file)
@@ -60,7 +60,6 @@
 #include "IMB_imbuf.h"
 
 #include "BKE_blender.h"
-#include "BKE_depsgraph.h"
 #include "BKE_global.h"
 #include "BKE_image.h"
 
@@ -1199,7 +1198,6 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
        
        IMB_exit();
        BKE_images_exit();
-       DAG_threaded_exit();
 
        totblock = MEM_get_memory_blocks_in_use();
        if (totblock != 0) {
index ff8b91f9c1e2f3d50651358e552820403e93b378..27fd9427da781270a3409d722d9d664bd87be04c 100644 (file)
@@ -1519,7 +1519,6 @@ int main(int argc, const char **argv)
        IMB_init();
        BKE_images_init();
        BKE_modifier_init();
-       DAG_threaded_init();
 
        BKE_brush_system_init();
 
index e63d37020ef4dde90b2626981cf75218375bfb4c..30df0e8db233ad606f47f2d402982f85e2731d02 100644 (file)
@@ -459,7 +459,6 @@ int main(int argc, char** argv)
        IMB_init();
        BKE_images_init();
        BKE_modifier_init();
-       DAG_threaded_init();
 
 #ifdef WITH_FFMPEG
        IMB_ffmpeg_init();
@@ -1083,7 +1082,6 @@ int main(int argc, char** argv)
 
        IMB_exit();
        BKE_images_exit();
-       DAG_threaded_exit();
 
        SYS_DeleteSystem(syshandle);