[Bf-blender-cvs] [99efebd2dd2] blender2.8: Merge branch 'master' into blender2.8

Campbell Barton noreply at git.blender.org
Sat Jan 20 15:37:44 CET 2018


Commit: 99efebd2dd24a8e0827cf0f13bc40c2844946676
Author: Campbell Barton
Date:   Sun Jan 21 01:47:49 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB99efebd2dd24a8e0827cf0f13bc40c2844946676

Merge branch 'master' into blender2.8

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



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

diff --cc source/blender/editors/screen/screen_ops.c
index d0cdf77d3cc,0496acb6ea2..a69f9188f59
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@@ -583,13 -552,46 +555,52 @@@ int ED_operator_mask(bContext *C
  	return false;
  }
  
 +int ED_operator_camera(bContext *C)
 +{
 +	struct Camera *cam = CTX_data_pointer_get_type(C, "camera", &RNA_Camera).data;
 +	return (cam != NULL);
 +}
 +
- /* *************************** action zone operator ************************** */
+ /** \} */
+ 
+ /* -------------------------------------------------------------------- */
+ /** \name Internal Screen Utilities
+  * \{ */
+ 
+ static int screen_active_editable(bContext *C)
+ {
+ 	if (ED_operator_screenactive(C)) {
+ 		/* no full window splitting allowed */
+ 		if (CTX_wm_screen(C)->state != SCREENNORMAL)
+ 			return 0;
+ 		return 1;
+ 	}
+ 	return 0;
+ }
+ 
+ static ARegion *screen_find_region_type(bContext *C, int type)
+ {
+ 	ARegion *ar = CTX_wm_region(C);
+ 
+ 	/* find the header region
+ 	 * - try context first, but upon failing, search all regions in area...
+ 	 */
+ 	if ((ar == NULL) || (ar->regiontype != type)) {
+ 		ScrArea *sa = CTX_wm_area(C);
+ 		ar = BKE_area_find_region_type(sa, type);
+ 	}
+ 	else {
+ 		ar = NULL;
+ 	}
+ 
+ 	return ar;
+ }
+ 
+ /** \} */
+ 
+ /* -------------------------------------------------------------------- */
+ /** \name Action Zone Operator
+  * \{ */
  
  /* operator state vars used:  
   * none
@@@ -2468,8 -2494,23 +2513,12 @@@ static void SCREEN_OT_marker_jump(wmOpe
  	RNA_def_boolean(ot->srna, "next", true, "Next Marker", "");
  }
  
- /* ************** switch screen operator ***************************** */
+ /** \} */
+ 
+ /* -------------------------------------------------------------------- */
+ /** \name Set Screen Operator
+  * \{ */
  
 -static bool screen_set_is_ok(bScreen *screen, bScreen *screen_prev)
 -{
 -	return ((screen->winid == 0) &&
 -	        /* in typical usage these should have a nonzero winid
 -	         * (all temp screens should be used, or closed & freed). */
 -	        (screen->temp == false) &&
 -	        (screen->state == SCREENNORMAL) &&
 -	        (screen != screen_prev) &&
 -	        (screen->id.name[2] != '.' || !(U.uiflag & USER_HIDE_DOT)));
 -}
 -
  /* function to be called outside UI context, or for redo */
  static int screen_set_exec(bContext *C, wmOperator *op)
  {
@@@ -3954,7 -4108,108 +4087,11 @@@ static void SCREEN_OT_delete(wmOperator
  	ot->exec = screen_delete_exec;
  }
  
- /* ***************** region alpha blending ***************** */
+ /** \} */
+ 
 -/* -------------------------------------------------------------------- */
 -/** \name New Scene Operator
 - * \{ */
 -
 -static int scene_new_exec(bContext *C, wmOperator *op)
 -{
 -	Scene *newscene, *scene = CTX_data_scene(C);
 -	Main *bmain = CTX_data_main(C);
 -	int type = RNA_enum_get(op->ptr, "type");
 -
 -	if (type == SCE_COPY_NEW) {
 -		newscene = BKE_scene_add(bmain, DATA_("Scene"));
 -	}
 -	else { /* different kinds of copying */
 -		newscene = BKE_scene_copy(bmain, scene, type);
 -
 -		/* these can't be handled in blenkernel currently, so do them here */
 -		if (type == SCE_COPY_LINK_DATA) {
 -			ED_object_single_users(bmain, newscene, false, true);
 -		}
 -		else if (type == SCE_COPY_FULL) {
 -			ED_editors_flush_edits(C, false);
 -			ED_object_single_users(bmain, newscene, true, true);
 -		}
 -	}
 -	
 -	ED_screen_set_scene(C, CTX_wm_screen(C), newscene);
 -	
 -	WM_event_add_notifier(C, NC_SCENE | ND_SCENEBROWSE, newscene);
 -	
 -	return OPERATOR_FINISHED;
 -}
 -
 -static void SCENE_OT_new(wmOperatorType *ot)
 -{
 -	static const EnumPropertyItem type_items[] = {
 -		{SCE_COPY_NEW, "NEW", 0, "New", "Add new scene"},
 -		{SCE_COPY_EMPTY, "EMPTY", 0, "Copy Settings", "Make a copy without any objects"},
 -		{SCE_COPY_LINK_OB, "LINK_OBJECTS", 0, "Link Objects", "Link to the objects from the current scene"},
 -		{SCE_COPY_LINK_DATA, "LINK_OBJECT_DATA", 0, "Link Object Data", "Copy objects linked to data from the current scene"},
 -		{SCE_COPY_FULL, "FULL_COPY", 0, "Full Copy", "Make a full copy of the current scene"},
 -		{0, NULL, 0, NULL, NULL}};
 -	
 -	/* identifiers */
 -	ot->name = "New Scene";
 -	ot->description = "Add new scene by type";
 -	ot->idname = "SCENE_OT_new";
 -	
 -	/* api callbacks */
 -	ot->exec = scene_new_exec;
 -	ot->invoke = WM_menu_invoke;
 -	
 -	/* flags */
 -	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 -	
 -	/* properties */
 -	ot->prop = RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "");
 -}
 -
 -/** \} */
 -
 -/* -------------------------------------------------------------------- */
 -/** \name Delete Screen Operator
 - * \{ */
 -
 -static int scene_delete_exec(bContext *C, wmOperator *UNUSED(op))
 -{
 -	Scene *scene = CTX_data_scene(C);
 -
 -	if (ED_screen_delete_scene(C, scene) == false) {
 -		return OPERATOR_CANCELLED;
 -	}
 -
 -	if (G.debug & G_DEBUG)
 -		printf("scene delete %p\n", scene);
 -
 -	WM_event_add_notifier(C, NC_SCENE | NA_REMOVED, scene);
 -
 -	return OPERATOR_FINISHED;
 -}
 -
 -static void SCENE_OT_delete(wmOperatorType *ot)
 -{
 -	/* identifiers */
 -	ot->name = "Delete Scene";
 -	ot->description = "Delete active scene";
 -	ot->idname = "SCENE_OT_delete";
 -	
 -	/* api callbacks */
 -	ot->exec = scene_delete_exec;
 -	
 -	/* flags */
 -	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 -}
 -
 -/** \} */
 -
+ /* -------------------------------------------------------------------- */
+ /** \name Region Alpha Blending Operator
+  * \{ */
  
  /* implementation note: a disappearing region needs at least 1 last draw with 100% backbuffer
   * texture over it- then triple buffer will clear it entirely.



More information about the Bf-blender-cvs mailing list