[Bf-blender-cvs] [5f25b91] master: Dyntopo should be supported on systems without VBOs now.

Antony Riakiotakis noreply at git.blender.org
Mon Jul 20 12:19:37 CEST 2015


Commit: 5f25b91b65b25559fe46a447efea6728f88235b0
Author: Antony Riakiotakis
Date:   Mon Jul 20 12:14:15 2015 +0200
Branches: master
https://developer.blender.org/rB5f25b91b65b25559fe46a447efea6728f88235b0

Dyntopo should be supported on systems without VBOs now.

===================================================================

M	source/blender/editors/sculpt_paint/sculpt.c

===================================================================

diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index ee7169d..37b37ed 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -4773,10 +4773,6 @@ static int sculpt_dynamic_topology_toggle_exec(bContext *C, wmOperator *UNUSED(o
 	Object *ob = CTX_data_active_object(C);
 	SculptSession *ss = ob->sculpt;
 
-	if (!G.background && !GPU_vertex_buffer_support()) {
-		return OPERATOR_CANCELLED;
-	}
-
 	if (ss->bm) {
 		sculpt_undo_push_begin("Dynamic topology disable");
 		sculpt_undo_push_node(ob, NULL, SCULPT_UNDO_DYNTOPO_END);
@@ -4793,44 +4789,32 @@ static int sculpt_dynamic_topology_toggle_exec(bContext *C, wmOperator *UNUSED(o
 }
 
 
-static int dyntopo_warning_popup(bContext *C, wmOperatorType *ot, bool vdata, bool modifiers, bool novertexbuf)
+static int dyntopo_warning_popup(bContext *C, wmOperatorType *ot, bool vdata, bool modifiers)
 {
-	if (novertexbuf) {
-		uiPopupMenu *pup = UI_popup_menu_begin(C, IFACE_("Error!"), ICON_ERROR);
-		uiLayout *layout = UI_popup_menu_layout(pup);
+	uiPopupMenu *pup = UI_popup_menu_begin(C, IFACE_("Warning!"), ICON_ERROR);
+	uiLayout *layout = UI_popup_menu_layout(pup);
 
-		uiItemL(layout, "Dyntopo is not supported on this system", ICON_INFO);
-		uiItemL(layout, "No vertex buffer support detected", ICON_NONE);
+	if (vdata) {
+		const char *msg_error = TIP_("Vertex Data Detected!");
+		const char *msg = TIP_("Dyntopo will not preserve vertex colors, UVs, or other customdata");
+		uiItemL(layout, msg_error, ICON_INFO);
+		uiItemL(layout, msg, ICON_NONE);
+		uiItemS(layout);
+	}
 
-		uiItemFullO_ptr(layout, ot, IFACE_("OK"), ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, 0);
+	if (modifiers) {
+		const char *msg_error = TIP_("Generative Modifiers Detected!");
+		const char *msg = TIP_("Keeping the modifiers will increase polycount when returning to object mode");
 
-		UI_popup_menu_end(C, pup);
+		uiItemL(layout, msg_error, ICON_INFO);
+		uiItemL(layout, msg, ICON_NONE);
+		uiItemS(layout);
 	}
-	else {
-		uiPopupMenu *pup = UI_popup_menu_begin(C, IFACE_("Warning!"), ICON_ERROR);
-		uiLayout *layout = UI_popup_menu_layout(pup);
-
-		if (vdata) {
-			const char *msg_error = TIP_("Vertex Data Detected!");
-			const char *msg = TIP_("Dyntopo will not preserve vertex colors, UVs, or other customdata");
-			uiItemL(layout, msg_error, ICON_INFO);
-			uiItemL(layout, msg, ICON_NONE);
-			uiItemS(layout);
-		}
 
-		if (modifiers) {
-			const char *msg_error = TIP_("Generative Modifiers Detected!");
-			const char *msg = TIP_("Keeping the modifiers will increase polycount when returning to object mode");
+	uiItemFullO_ptr(layout, ot, IFACE_("OK"), ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, 0);
 
-			uiItemL(layout, msg_error, ICON_INFO);
-			uiItemL(layout, msg, ICON_NONE);
-			uiItemS(layout);
-		}
-
-		uiItemFullO_ptr(layout, ot, IFACE_("OK"), ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, 0);
+	UI_popup_menu_end(C, pup);
 
-		UI_popup_menu_end(C, pup);
-	}
 	return OPERATOR_INTERFACE;
 }
 
@@ -4841,10 +4825,6 @@ static int sculpt_dynamic_topology_toggle_invoke(bContext *C, wmOperator *op, co
 	Mesh *me = ob->data;
 	SculptSession *ss = ob->sculpt;
 
-	if (!GPU_vertex_buffer_support()) {
-		dyntopo_warning_popup(C, op->type, false, false, true);
-	}
-
 	if (!ss->bm) {
 		Scene *scene = CTX_data_scene(C);
 		ModifierData *md;
@@ -4879,7 +4859,7 @@ static int sculpt_dynamic_topology_toggle_invoke(bContext *C, wmOperator *op, co
 
 		if (vdata || modifiers) {
 			/* The mesh has customdata that will be lost, let the user confirm this is OK */
-			return dyntopo_warning_popup(C, op->type, vdata, modifiers, false);
+			return dyntopo_warning_popup(C, op->type, vdata, modifiers);
 		}
 	}




More information about the Bf-blender-cvs mailing list