Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/draw/intern/draw_manager.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index cee00a359c1..10e9b8fbdf0 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -44,6 +44,7 @@
#include "BKE_object.h"
#include "BKE_particle.h"
#include "BKE_paint.h"
+#include "BKE_pbvh.h"
#include "BKE_pointcache.h"
#include "draw_manager.h"
@@ -216,9 +217,26 @@ bool DRW_object_use_hide_faces(const struct Object *ob)
return false;
}
+/* Should we use PBVH drawing or regular mesh drawing
+ * PBVH drawing should be used for
+ * - Multires
+ * - Dyntopo
+ * - Normal sculpt without any active modifiers
+ */
bool DRW_object_use_pbvh_drawing(const struct Object *ob)
{
- return ob->sculpt && (ob->sculpt->mode_type == OB_MODE_SCULPT);
+ SculptSession *ss = ob->sculpt;
+ if (ss == NULL || ss->pbvh == NULL || ob->sculpt->mode_type != OB_MODE_SCULPT) {
+ return false;
+ }
+
+ if (BKE_pbvh_type(ss->pbvh) == PBVH_FACES) {
+ return !(ss->kb || ss->modifiers_active);
+ }
+ else {
+ /* Multires/Dyntopo */
+ return true;
+ }
}
bool DRW_object_is_visible_psys_in_active_context(const Object *object, const ParticleSystem *psys)