[Bf-blender-cvs] [5374865523f] blender2.8: Dopesheet-Timeline: Removal of Timeline Editor!

Joshua Leung noreply at git.blender.org
Fri Apr 20 19:07:00 CEST 2018


Commit: 5374865523faf253a524a002ebcbefe05172fd8d
Author: Joshua Leung
Date:   Fri Apr 20 17:17:10 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB5374865523faf253a524a002ebcbefe05172fd8d

Dopesheet-Timeline: Removal of Timeline Editor!

This commit removes all references to the old timeline editor.

Unfortuantely, the removal of the Timeline spacetype defining
functions has ended up breaking the version patching code I'd
been working on earlier (as now, the editor gets marked as
"unknown/info" before we get a chance to patch it!)

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

M	release/scripts/startup/bl_ui/space_time.py
M	source/blender/blenkernel/BKE_context.h
M	source/blender/blenkernel/intern/context.c
M	source/blender/blenloader/intern/versioning_250.c
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/editors/CMakeLists.txt
M	source/blender/editors/animation/anim_markers.c
M	source/blender/editors/animation/anim_ops.c
M	source/blender/editors/include/ED_screen.h
M	source/blender/editors/include/ED_space_api.h
M	source/blender/editors/interface/resources.c
M	source/blender/editors/screen/area.c
M	source/blender/editors/screen/screen_edit.c
M	source/blender/editors/screen/screen_ops.c
M	source/blender/editors/space_api/spacetypes.c
D	source/blender/editors/space_time/CMakeLists.txt
D	source/blender/editors/space_time/space_time.c
D	source/blender/editors/space_time/time_intern.h
D	source/blender/editors/space_time/time_ops.c
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesrna/RNA_access.h
M	source/blender/makesrna/intern/rna_screen.c
M	source/blender/makesrna/intern/rna_space.c
M	source/blender/makesrna/intern/rna_userdef.c
M	source/blender/python/intern/bpy_rna_callback.c
M	source/blender/python/simple_enum_gen.py
M	source/blender/windowmanager/intern/wm_keymap.c

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

diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py
index c2ebd65316f..c1c73c35258 100644
--- a/release/scripts/startup/bl_ui/space_time.py
+++ b/release/scripts/startup/bl_ui/space_time.py
@@ -21,24 +21,10 @@ import bpy
 from bpy.types import Header, Menu
 
 
-class TIME_HT_header(Header):
-    bl_space_type = 'TIMELINE'
-
-    def draw(self, context):
-        layout = self.layout
-
-        row = layout.row(align=True)
-        row.template_header()
-
-        TIME_MT_editor_menus.draw_collapsible(context, layout)
-        TIME_HT_editor_buttons.draw_header(context, layout)
-
-
-# Header buttons for actual timeline editor header
-# XXX: Temporary, until we have editor submodes in the actual editors menu
+# Header buttons for timeline header (play, etc.)
 class TIME_HT_editor_buttons(Header):
     bl_idname = "TIME_HT_editor_buttons"
-    bl_space_type = 'TIMELINE' # XXX: Change this to 'DOPESHEET_EDITOR'
+    bl_space_type = 'DOPESHEET_EDITOR'
     bl_label = ""
 
     def draw(self, context):
@@ -285,7 +271,6 @@ def marker_menu_generic(layout):
 
 
 classes = (
-    TIME_HT_header,
     TIME_HT_editor_buttons,
     TIME_MT_editor_menus,
     TIME_MT_marker,
diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h
index 6d857c93630..e50c33e258c 100644
--- a/source/blender/blenkernel/BKE_context.h
+++ b/source/blender/blenkernel/BKE_context.h
@@ -171,7 +171,6 @@ struct SpaceFile *CTX_wm_space_file(const bContext *C);
 struct SpaceSeq *CTX_wm_space_seq(const bContext *C);
 struct SpaceOops *CTX_wm_space_outliner(const bContext *C);
 struct SpaceNla *CTX_wm_space_nla(const bContext *C);
-struct SpaceTime *CTX_wm_space_time(const bContext *C);
 struct SpaceNode *CTX_wm_space_node(const bContext *C);
 struct SpaceIpo *CTX_wm_space_graph(const bContext *C);
 struct SpaceAction *CTX_wm_space_action(const bContext *C);
diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c
index 4efd6dee6f6..72832e9f897 100644
--- a/source/blender/blenkernel/intern/context.c
+++ b/source/blender/blenkernel/intern/context.c
@@ -775,14 +775,6 @@ struct SpaceNla *CTX_wm_space_nla(const bContext *C)
 	return NULL;
 }
 
-struct SpaceTime *CTX_wm_space_time(const bContext *C)
-{
-	ScrArea *sa = CTX_wm_area(C);
-	if (sa && sa->spacetype == SPACE_TIME)
-		return sa->spacedata.first;
-	return NULL;
-}
-
 struct SpaceNode *CTX_wm_space_node(const bContext *C)
 {
 	ScrArea *sa = CTX_wm_area(C);
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c
index cc8073c67a7..2610f57f124 100644
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@ -285,19 +285,6 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
 					//ar->v2d.flag |= V2D_IS_INITIALISED;
 				}
 				break;
-			case SPACE_TIME:
-				{
-					SpaceTime *stime = (SpaceTime *)sl;
-					memcpy(&ar->v2d, &stime->v2d, sizeof(View2D));
-
-					ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
-					ar->v2d.align |= V2D_ALIGN_NO_NEG_Y;
-					ar->v2d.keepofs |= V2D_LOCKOFS_Y;
-					ar->v2d.keepzoom |= V2D_LOCKZOOM_Y;
-					ar->v2d.tot.ymin = ar->v2d.cur.ymin = -10.0;
-					ar->v2d.min[1] = ar->v2d.max[1] = 20.0;
-				}
-				break;
 			case SPACE_IPO:
 				{
 					SpaceIpo *sipo = (SpaceIpo *)sl;
@@ -1613,14 +1600,6 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
 							}
 						}
 					}
-					else if (sl->spacetype == SPACE_TIME) {
-						SpaceTime *stime = (SpaceTime *) sl;
-
-						/* enable all cache display */
-						stime->cache_display |= TIME_CACHE_DISPLAY;
-						stime->cache_display |= (TIME_CACHE_SOFTBODY|TIME_CACHE_PARTICLES);
-						stime->cache_display |= (TIME_CACHE_CLOTH|TIME_CACHE_SMOKE|TIME_CACHE_DYNAMICPAINT);
-					}
 				}
 			}
 		}
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 9a46bff6644..2f0173f1c32 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -637,7 +637,8 @@ void do_versions_after_linking_280(Main *main)
 			for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) {
 				/* Convert timelines to dopesheet editors with timelines */
 				if (sa->spacetype == SPACE_TIME) {
-					SpaceTime *stime = sa->spacedata.first;
+					//SpaceTime *stime = sa->spacedata.first;
+					SpaceLink *stime = sa->spacedata.first;
 					ARegion *main_region = NULL;
 					ARegion *ar = NULL;
 					
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index ea6a18b2b48..e78c32e9eda 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2856,9 +2856,6 @@ static void write_area_regions(WriteData *wd, ScrArea *area)
 				writestruct(wd, DATA, bDopeSheet, 1, snla->ads);
 			}
 		}
-		else if (sl->spacetype == SPACE_TIME) {
-			writestruct(wd, DATA, SpaceTime, 1, sl);
-		}
 		else if (sl->spacetype == SPACE_NODE) {
 			SpaceNode *snode = (SpaceNode *)sl;
 			bNodeTreePath *path;
diff --git a/source/blender/editors/CMakeLists.txt b/source/blender/editors/CMakeLists.txt
index f6ceda9bc5a..358f82499c2 100644
--- a/source/blender/editors/CMakeLists.txt
+++ b/source/blender/editors/CMakeLists.txt
@@ -55,7 +55,6 @@ if(WITH_BLENDER)
 	add_subdirectory(space_script)
 	add_subdirectory(space_sequencer)
 	add_subdirectory(space_text)
-	add_subdirectory(space_time)
 	add_subdirectory(space_topbar)
 	add_subdirectory(space_userpref)
 	add_subdirectory(space_view3d)
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index e43735c51fb..96da87cd8cc 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -583,12 +583,10 @@ static int ed_markers_opwrap_invoke_custom(bContext *C, wmOperator *op, const wm
 	else
 		BKE_report(op->reports, RPT_ERROR, "Programming error: operator does not actually have code to do anything!");
 		
-	/* return status modifications - for now, make this spacetype dependent as above */
-	if (sa->spacetype != SPACE_TIME) {
-		/* unless successful, must add "pass-through" to let normal operator's have a chance at tackling this event */
-		if ((retval & (OPERATOR_FINISHED | OPERATOR_INTERFACE)) == 0) {
-			retval |= OPERATOR_PASS_THROUGH;
-		}
+	
+	/* unless successful, must add "pass-through" to let normal operator's have a chance at tackling this event */
+	if ((retval & (OPERATOR_FINISHED | OPERATOR_INTERFACE)) == 0) {
+		retval |= OPERATOR_PASS_THROUGH;
 	}
 	
 	return retval;
@@ -690,8 +688,7 @@ typedef struct MarkerMove {
 
 static bool ed_marker_move_use_time(MarkerMove *mm)
 {
-	if (((mm->slink->spacetype == SPACE_TIME) && !(((SpaceTime *)mm->slink)->flag & TIME_DRAWFRAMES)) ||
-	    ((mm->slink->spacetype == SPACE_SEQ) && !(((SpaceSeq *)mm->slink)->flag & SEQ_DRAWFRAMES)) ||
+	if (((mm->slink->spacetype == SPACE_SEQ) && !(((SpaceSeq *)mm->slink)->flag & SEQ_DRAWFRAMES)) ||
 	    ((mm->slink->spacetype == SPACE_ACTION) && (((SpaceAction *)mm->slink)->flag & SACTION_DRAWTIME)) ||
 	    ((mm->slink->spacetype == SPACE_IPO) && !(((SpaceIpo *)mm->slink)->flag & SIPO_DRAWTIME)) ||
 	    ((mm->slink->spacetype == SPACE_NLA) && !(((SpaceNla *)mm->slink)->flag & SNLA_DRAWTIME)))
@@ -935,10 +932,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, const wmEvent *even
 						mm->evtx = event->x;
 						fac = ((float)(event->x - mm->firstx) * dx);
 
-						if (mm->slink->spacetype == SPACE_TIME)
-							apply_keyb_grid(event->shift, event->ctrl, &fac, 0.0, FPS, 0.1 * FPS, 0);
-						else
-							apply_keyb_grid(event->shift, event->ctrl, &fac, 0.0, 1.0, 0.1, 0 /*was: U.flag & USER_AUTOGRABGRID*/);
+						apply_keyb_grid(event->shift, event->ctrl, &fac, 0.0, 1.0, 0.1, 0 /*was: U.flag & USER_AUTOGRABGRID*/);
 
 						RNA_int_set(op->ptr, "frames", (int)fac);
 						ed_marker_move_apply(C, op);
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c
index 08d7d1d6780..8ea46e55b49 100644
--- a/source/blender/editors/animation/anim_ops.c
+++ b/source/blender/editors/animation/anim_ops.c
@@ -75,7 +75,7 @@ static int change_frame_poll(bContext *C)
 	 * this shouldn't show up in 3D editor (or others without 2D timeline view) via search
 	 */
 	if (sa) {
-		if (ELEM(sa->spacetype, SPACE_TIME, SPACE_ACTION, SPACE_NLA, SPACE_SEQ, SPACE_CLIP)) {
+		if (ELEM(sa->spacetype, SPACE_ACTION, SPACE_NLA, SPACE_SEQ, SPACE_CLIP)) {
 			return true;
 		}
 		else if (sa->spacetype == SPACE_IPO) {
@@ -86,7 +86,7 @@ static int change_frame_poll(bContext *C)
 		}
 	}
 	
-	CTX_wm_operator_poll_msg_set(C, "Expected an timeline/animation area to be active");
+	CTX_wm_operator_poll_msg_set(C, "Expected an animation area to be active");
 	return false;
 }
 
@@ -279,6 +279,26 @@ static void ANIM_OT_change_frame(wmOperatorType *ot)
 
 /* ****************** Start/End Frame Operators *******************************/
 
+static int anim_set_end_frames_poll(bContext *C)
+{
+	ScrArea *sa = CTX_wm_area(C);
+	
+	/* XXX temp? prevent changes during render */
+	if (G.is_rendering) return false;
+	
+	/* although it's only included in keymaps for regions using ED_KEYMAP_ANIMATION,
+	 * this shouldn't show up in 3D editor (or others without 2D timeline view) via search
+	 */
+	if (sa) {
+		if (ELEM(sa->spacetype, SPACE_ACTION, SPACE_IPO, SPACE_NLA, SPACE_SEQ, SPACE_CLIP)) {
+			return true;
+		}
+	}
+	
+	CTX_wm_operator_poll_msg_set(C, "Expected an animation area to be active");
+	return false;
+}
+
 static int anim_set_sfra_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	Scene *scene = CTX_data_scene(C);
@@ -316,7 +336,7 @@ static void ANIM_OT_start_frame_set(wmOperatorType *ot)
 	
 	/* api callbacks */
 	ot->exec = anim_set_sfra_exec;
-	ot->poll = ED_operator_timeline_active;
+	ot->poll = anim_set_end_frames_poll;
 	
 	/* flags */
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -360,7 +380,7 @@ static void ANIM_OT_end_frame

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list