[Bf-blender-cvs] [8246246bda2] master: UI: editor menu, swap Text and node editors

Aaron Carlisle noreply at git.blender.org
Wed May 10 18:22:35 CEST 2017


Commit: 8246246bda2f04af9dbeb6eb17b9622051419716
Author: Aaron Carlisle
Date:   Wed May 10 11:27:20 2017 -0400
Branches: master
https://developer.blender.org/rB8246246bda2f04af9dbeb6eb17b9622051419716

UI: editor menu, swap Text and node editors

Proposed by @sebastian_k and approved by @severin over IRC.

Follows up on rB0f561da5fb77540626aec7a995314271a91acdf6

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

M	source/blender/makesrna/intern/rna_space.c

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

diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index d39364b55cb..7bb17adbc5a 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -73,8 +73,8 @@ EnumPropertyItem rna_enum_space_type_items[] = {
 	{SPACE_IMAGE, "IMAGE_EDITOR", ICON_IMAGE_COL, "UV/Image Editor", "View and edit images and UV Maps"},
 	{SPACE_CLIP, "CLIP_EDITOR", ICON_CLIP, "Movie Clip Editor", "Motion tracking tools"},
 	{SPACE_SEQ, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequence Editor", "Video editing tools"},
-	{SPACE_TEXT, "TEXT_EDITOR", ICON_TEXT, "Text Editor", "Edit scripts and in-file documentation"},
 	{SPACE_NODE, "NODE_EDITOR", ICON_NODETREE, "Node Editor", "Editor for node-based shading and compositing tools"},
+	{SPACE_TEXT, "TEXT_EDITOR", ICON_TEXT, "Text Editor", "Edit scripts and in-file documentation"},
 	{SPACE_LOGIC, "LOGIC_EDITOR", ICON_LOGIC, "Logic Editor", "Game logic editing"},
 	{0, "", ICON_NONE, NULL, NULL},
 	{SPACE_BUTS, "PROPERTIES", ICON_BUTS, "Properties", "Edit properties of active object and related data-blocks"},
@@ -492,7 +492,7 @@ static void rna_View3D_CursorLocation_get(PointerRNA *ptr, float *values)
 	bScreen *sc = (bScreen *)ptr->id.data;
 	Scene *scene = (Scene *)sc->scene;
 	const float *loc = ED_view3d_cursor3d_get(scene, v3d);
-	
+
 	copy_v3_v3(values, loc);
 }
 
@@ -502,7 +502,7 @@ static void rna_View3D_CursorLocation_set(PointerRNA *ptr, const float *values)
 	bScreen *sc = (bScreen *)ptr->id.data;
 	Scene *scene = (Scene *)sc->scene;
 	float *cursor = ED_view3d_cursor3d_get(scene, v3d);
-	
+
 	copy_v3_v3(cursor, values);
 }
 
@@ -518,7 +518,7 @@ static float rna_View3D_GridScaleUnit_get(PointerRNA *ptr)
 static void rna_SpaceView3D_layer_set(PointerRNA *ptr, const int *values)
 {
 	View3D *v3d = (View3D *)(ptr->data);
-	
+
 	v3d->lay = ED_view3d_scene_layer_set(v3d->lay, values, &v3d->layact);
 }
 
@@ -545,16 +545,16 @@ static void rna_SpaceView3D_viewport_shade_update(Main *bmain, Scene *scene, Poi
 static void rna_SpaceView3D_matcap_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 {
 	View3D *v3d = (View3D *)(ptr->data);
-	
+
 	if (v3d->defmaterial) {
 		Material *ma = v3d->defmaterial;
-		
+
 		if (ma->preview)
 			BKE_previewimg_free(&ma->preview);
-		
+
 		if (ma->gpumaterial.first)
 			GPU_material_free(&ma->gpumaterial);
-		
+
 		WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ma);
 	}
 }
@@ -562,7 +562,7 @@ static void rna_SpaceView3D_matcap_update(Main *UNUSED(bmain), Scene *UNUSED(sce
 static void rna_SpaceView3D_matcap_enable(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 {
 	View3D *v3d = (View3D *)(ptr->data);
-	
+
 	if (v3d->matcap_icon < ICON_MATCAP_01 ||
 	    v3d->matcap_icon > ICON_MATCAP_24)
 	{
@@ -719,7 +719,7 @@ static EnumPropertyItem *rna_SpaceView3D_viewport_shade_itemf(bContext *UNUSED(C
 {
 	Scene *scene = ((bScreen *)ptr->id.data)->scene;
 	RenderEngineType *type = RE_engines_find(scene->r.engine);
-	
+
 	EnumPropertyItem *item = NULL;
 	int totitem = 0;
 
@@ -728,7 +728,7 @@ static EnumPropertyItem *rna_SpaceView3D_viewport_shade_itemf(bContext *UNUSED(C
 	RNA_enum_items_add_value(&item, &totitem, rna_enum_viewport_shade_items, OB_SOLID);
 	RNA_enum_items_add_value(&item, &totitem, rna_enum_viewport_shade_items, OB_TEXTURE);
 	RNA_enum_items_add_value(&item, &totitem, rna_enum_viewport_shade_items, OB_MATERIAL);
-	
+
 	if (type && type->view_draw)
 		RNA_enum_items_add_value(&item, &totitem, rna_enum_viewport_shade_items, OB_RENDER);
 
@@ -844,7 +844,7 @@ static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *UNUS
 	int zbuf, alpha, totitem = 0;
 
 	ibuf = ED_space_image_acquire_buffer(sima, &lock);
-	
+
 	alpha = ibuf && (ibuf->channels == 4);
 	zbuf = ibuf && (ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels == 1));
 
@@ -895,14 +895,14 @@ static void rna_SpaceImageEditor_zoom_get(PointerRNA *ptr, float *values)
 static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *values)
 {
 	SpaceImage *sima = (SpaceImage *)ptr->data;
-	
+
 	if (sima->flag & SI_COORDFLOATS) {
 		copy_v2_v2(values, sima->cursor);
 	}
 	else {
 		int w, h;
 		ED_space_image_get_size(sima, &w, &h);
-		
+
 		values[0] = sima->cursor[0] * w;
 		values[1] = sima->cursor[1] * h;
 	}
@@ -911,14 +911,14 @@ static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *val
 static void rna_SpaceImageEditor_cursor_location_set(PointerRNA *ptr, const float *values)
 {
 	SpaceImage *sima = (SpaceImage *)ptr->data;
-	
+
 	if (sima->flag & SI_COORDFLOATS) {
 		copy_v2_v2(sima->cursor, values);
 	}
 	else {
 		int w, h;
 		ED_space_image_get_size(sima, &w, &h);
-		
+
 		sima->cursor[0] = values[0] / w;
 		sima->cursor[1] = values[1] / h;
 	}
@@ -947,7 +947,7 @@ static void rna_SpaceImageEditor_scopes_update(struct bContext *C, struct Pointe
 	SpaceImage *sima = (SpaceImage *)ptr->data;
 	ImBuf *ibuf;
 	void *lock;
-	
+
 	ibuf = ED_space_image_acquire_buffer(sima, &lock);
 	if (ibuf) {
 		ED_space_image_scopes_update(C, sima, ibuf, true);
@@ -1026,12 +1026,12 @@ static void rna_SpaceProperties_pin_id_update(Main *UNUSED(bmain), Scene *UNUSED
 {
 	SpaceButs *sbuts = (SpaceButs *)(ptr->data);
 	ID *id = sbuts->pinid;
-	
+
 	if (id == NULL) {
 		sbuts->flag &= ~SB_PIN_CONTEXT;
 		return;
 	}
-	
+
 	switch (GS(id->name)) {
 		case ID_MA:
 			WM_main_add_notifier(NC_MATERIAL | ND_SHADING, NULL);
@@ -1052,7 +1052,7 @@ static void rna_SpaceProperties_pin_id_update(Main *UNUSED(bmain), Scene *UNUSED
 static void rna_SpaceProperties_context_set(PointerRNA *ptr, int value)
 {
 	SpaceButs *sbuts = (SpaceButs *)(ptr->data);
-	
+
 	sbuts->mainb = value;
 	sbuts->mainbuser = value;
 }
@@ -1203,7 +1203,7 @@ static void rna_ConsoleLine_body_set(PointerRNA *ptr, const char *value)
 {
 	ConsoleLine *ci = (ConsoleLine *)ptr->data;
 	int len = strlen(value);
-	
+
 	if ((len >= ci->len_alloc) || (len * 2 < ci->len_alloc) ) { /* allocate a new string */
 		MEM_freeN(ci->line);
 		ci->line = MEM_mallocN((len + 1) * sizeof(char), "rna_consoleline");
@@ -1231,7 +1231,7 @@ static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA valu
 {
 	SpaceAction *saction = (SpaceAction *)(ptr->data);
 	bAction *act = (bAction *)value.data;
-	
+
 	if ((act == NULL) || (act->idroot == 0)) {
 		/* just set if we're clearing the action or if the action is "amorphous" still */
 		saction->action = act;
@@ -1268,7 +1268,7 @@ static void rna_SpaceDopeSheetEditor_action_update(Main *bmain, Scene *scene, Po
 	/* we must set this action to be the one used by active object (if not pinned) */
 	if (obact /* && saction->pin == 0*/) {
 		AnimData *adt = NULL;
-		
+
 		if (saction->mode == SACTCONT_ACTION) {
 			/* TODO: context selector could help decide this with more control? */
 			adt = BKE_animdata_add_id(&obact->id); /* this only adds if non-existent */
@@ -1278,7 +1278,7 @@ static void rna_SpaceDopeSheetEditor_action_update(Main *bmain, Scene *scene, Po
 			if (key)
 				adt = BKE_animdata_add_id(&key->id);  /* this only adds if non-existent */
 		}
-		
+
 		/* set action */
 		// FIXME: this overlaps a lot with the BKE_animdata_set_action() API method
 		if (adt) {
@@ -1286,11 +1286,11 @@ static void rna_SpaceDopeSheetEditor_action_update(Main *bmain, Scene *scene, Po
 			if (adt->action != saction->action) {
 				/* NLA Tweak Mode needs special handling... */
 				if (adt->flag & ADT_NLA_EDIT_ON) {
-					/* Exit editmode first - we cannot change actions while in tweakmode 
+					/* Exit editmode first - we cannot change actions while in tweakmode
 					 * NOTE: This will clear the action ref properly
 					 */
 					BKE_nla_tweakmode_exit(adt);
-					
+
 					/* Assign new action, and adjust the usercounts accordingly */
 					adt->action = saction->action;
 					id_us_plus((ID *)adt->action);
@@ -1300,7 +1300,7 @@ static void rna_SpaceDopeSheetEditor_action_update(Main *bmain, Scene *scene, Po
 					if (adt->action) {
 						/* Fix id-count of action we're replacing */
 						id_us_min(&adt->action->id);
-						
+
 						/* To prevent data loss (i.e. if users flip between actions using the Browse menu),
 						 * stash this action if nothing else uses it.
 						 *
@@ -1317,17 +1317,17 @@ static void rna_SpaceDopeSheetEditor_action_update(Main *bmain, Scene *scene, Po
 							BKE_nla_action_stash(adt);
 						}
 					}
-					
+
 					/* Assign new action, and adjust the usercounts accordingly */
 					adt->action = saction->action;
 					id_us_plus((ID *)adt->action);
 				}
 			}
-			
+
 			/* Force update of animdata */
 			adt->recalc |= ADT_RECALC_ANIM;
 		}
-		
+
 		/* force depsgraph flush too */
 		DAG_id_tag_update(&obact->id, OB_RECALC_OB | OB_RECALC_DATA);
 		/* Update relations as well, so new time source dependency is added. */
@@ -1339,17 +1339,17 @@ static void rna_SpaceDopeSheetEditor_mode_update(Main *UNUSED(bmain), Scene *sce
 {
 	SpaceAction *saction = (SpaceAction *)(ptr->data);
 	Object *obact = (scene->basact) ? scene->basact->object : NULL;
-	
+
 	/* special exceptions for ShapeKey Editor mode */
 	if (saction->mode == SACTCONT_SHAPEKEY) {
 		Key *key = BKE_key_from_object(obact);
-		
+
 		/* 1)	update the action stored for the editor */
 		if (key)
 			saction->action = (key->adt) ? key->adt->action : NULL;
 		else
 			saction->action = NULL;
-		
+
 		/* 2)	enable 'show sliders' by default, since one of the main
 		 *		points of the ShapeKey Editor is to provide a one-stop shop
 		 *		for controlling the shapekeys, whose main control is the value
@@ -1365,7 +1365,7 @@ static void rna_SpaceDopeSheetEditor_mode_update(Main *UNUSED(bmain), Scene *sce
 		else
 			saction->action = NULL;
 	}
-	
+
 	/* recalculate extents of channel list */
 	saction->flag |= SACTION_TEMP_NEEDCHANSYNC;
 }
@@ -1375,7 +1375,7 @@ static void rna_SpaceDopeSheetEditor_mode_update(Main *UNUSED(bmain), Scene *sce
 static void rna_SpaceGraphEditor_display_mode_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 {
 	ScrArea *sa = rna_area_from_space(ptr);
-	
+
 	/* after changing view mode, must force recalculation of F-Curve colors
 	 * which can only be ach

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list