[Bf-blender-cvs] [3f1f2b30354] master: Cleanup: removed unused 3D view header template.

Brecht Van Lommel noreply at git.blender.org
Thu Jan 24 13:20:26 CET 2019


Commit: 3f1f2b30354a28f4a6a002586b745b3bd34fb66f
Author: Brecht Van Lommel
Date:   Thu Jan 24 13:19:23 2019 +0100
Branches: master
https://developer.blender.org/rB3f1f2b30354a28f4a6a002586b745b3bd34fb66f

Cleanup: removed unused 3D view header template.

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

M	source/blender/editors/space_view3d/view3d_header.c
M	source/blender/makesrna/intern/rna_ui_api.c

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

diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c
index 8f9fb83f785..f54548cee37 100644
--- a/source/blender/editors/space_view3d/view3d_header.c
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -175,7 +175,6 @@ static void uiTemplatePaintModeSelection(uiLayout *layout, struct bContext *C)
 
 void uiTemplateHeader3D_mode(uiLayout *layout, struct bContext *C)
 {
-	/* Extracted from: uiTemplateHeader3D */
 	ViewLayer *view_layer = CTX_data_view_layer(C);
 	Object *ob = OBACT(view_layer);
 	Object *obedit = CTX_data_edit_object(C);
@@ -191,68 +190,3 @@ void uiTemplateHeader3D_mode(uiLayout *layout, struct bContext *C)
 		uiTemplatePaintModeSelection(layout, C);
 	}
 }
-
-void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
-{
-	bScreen *screen = CTX_wm_screen(C);
-	ScrArea *sa = CTX_wm_area(C);
-	View3D *v3d = sa->spacedata.first;
-	Scene *scene = CTX_data_scene(C);
-	ViewLayer *view_layer = CTX_data_view_layer(C);
-	ToolSettings *ts = CTX_data_tool_settings(C);
-	PointerRNA v3dptr, toolsptr, sceneptr;
-	Object *ob = OBACT(view_layer);
-	Object *obedit = CTX_data_edit_object(C);
-	bGPdata *gpd = CTX_data_gpencil_data(C);
-	uiBlock *block;
-	bool is_paint = (
-	        ob && !(gpd && (gpd->flag & GP_DATA_STROKE_EDITMODE)) &&
-	        ELEM(ob->mode,
-	             OB_MODE_SCULPT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, OB_MODE_TEXTURE_PAINT));
-
-	RNA_pointer_create(&screen->id, &RNA_SpaceView3D, v3d, &v3dptr);
-	RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &toolsptr);
-	RNA_pointer_create(&scene->id, &RNA_Scene, scene, &sceneptr);
-
-	block = uiLayoutGetBlock(layout);
-	UI_block_func_handle_set(block, do_view3d_header_buttons, NULL);
-
-	/* other buttons: */
-	UI_block_emboss_set(block, UI_EMBOSS);
-
-	/* moved to topbar */
-#if 0
-	uiLayout *row = uiLayoutRow(layout, true);
-	uiItemR(row, &v3dptr, "pivot_point", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
-	if (!ob || ELEM(ob->mode, OB_MODE_OBJECT, OB_MODE_POSE, OB_MODE_WEIGHT_PAINT)) {
-		uiItemR(row, &v3dptr, "use_pivot_point_align", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
-	}
-#endif
-
-	if (obedit == NULL && is_paint) {
-		/* Currently Python calls this directly. */
-#if 0
-		uiTemplatePaintModeSelection(layout, C);
-#endif
-
-	}
-	else {
-		/* Moved to popover and topbar. */
-#if 0
-		/* Transform widget / gizmos */
-		row = uiLayoutRow(layout, true);
-		uiItemR(row, &v3dptr, "show_gizmo", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
-		uiItemR(row, &sceneptr, "transform_orientation", 0, "", ICON_NONE);
-#endif
-	}
-
-	if (obedit == NULL && v3d->localvd == NULL) {
-		/* Scene lock */
-		uiItemR(layout, &v3dptr, "lock_camera_and_layers", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
-	}
-
-	/* Currently Python calls this directly. */
-#if 0
-	uiTemplateEditModeSelection(layout, C);
-#endif
-}
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 4ab144996eb..8c1bb578349 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -1072,10 +1072,6 @@ void RNA_api_ui_layout(StructRNA *srna)
 
 	RNA_def_function(srna, "template_operator_search", "uiTemplateOperatorSearch");
 
-	func = RNA_def_function(srna, "template_header_3D", "uiTemplateHeader3D");
-	RNA_def_function_flag(func, FUNC_USE_CONTEXT);
-	RNA_def_function_ui_description(func, "Inserts common 3DView header UI (selectors for context mode, shading, etc.)");
-
 	func = RNA_def_function(srna, "template_header_3D_mode", "uiTemplateHeader3D_mode");
 	RNA_def_function_flag(func, FUNC_USE_CONTEXT);
 	RNA_def_function_ui_description(func, "");



More information about the Bf-blender-cvs mailing list