[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17963] branches/blender2.5/blender/source /blender/editors: 2.5 - Start of porting of Animation Editors

Joshua Leung aligorith at gmail.com
Sat Dec 20 09:24:25 CET 2008


Revision: 17963
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17963
Author:   aligorith
Date:     2008-12-20 09:24:24 +0100 (Sat, 20 Dec 2008)

Log Message:
-----------
2.5 - Start of porting of Animation Editors

* Added new 'Animation' submodule under Editors. This will be used to house all code + features that are used by many different Animation Editors (Action/Dopesheet and IPO) as well as other parts of Blender. 

* Added back some of the core code need by the Action/Dopesheet editor, which will also be used by IPO Editor.
* Brought back file for keyframing management code (i.e. keyframing.c), but there's still quite a lot of missing stuff that I'll need to restore, so in the meantime, it's #if 0'd out.

* Moved markers code to this new module (I'm not sure whether SVN will recognise this change, as TortoiseSVN doesn't seem to have any obvious copy/move commands)

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/SConscript
    branches/blender2.5/blender/source/blender/editors/space_action/SConscript
    branches/blender2.5/blender/source/blender/editors/space_action/space_action.c
    branches/blender2.5/blender/source/blender/editors/space_time/space_time.c
    branches/blender2.5/blender/source/blender/editors/space_time/time_ops.c

Added Paths:
-----------
    branches/blender2.5/blender/source/blender/editors/animation/
    branches/blender2.5/blender/source/blender/editors/animation/Makefile
    branches/blender2.5/blender/source/blender/editors/animation/SConscript
    branches/blender2.5/blender/source/blender/editors/animation/anim_draw.c
    branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c
    branches/blender2.5/blender/source/blender/editors/animation/anim_keyframing.c
    branches/blender2.5/blender/source/blender/editors/animation/anim_markers.c
    branches/blender2.5/blender/source/blender/editors/include/ED_anim_api.h
    branches/blender2.5/blender/source/blender/editors/include/ED_keyframing.h

Removed Paths:
-------------
    branches/blender2.5/blender/source/blender/editors/util/ed_markers.c

Modified: branches/blender2.5/blender/source/blender/editors/SConscript
===================================================================
--- branches/blender2.5/blender/source/blender/editors/SConscript	2008-12-20 07:12:38 UTC (rev 17962)
+++ branches/blender2.5/blender/source/blender/editors/SConscript	2008-12-20 08:24:24 UTC (rev 17963)
@@ -6,6 +6,7 @@
 			'space_api/SConscript',
 			'util/SConscript',
 			'interface/SConscript',
+			'animation/SConscript',
 			'mesh/SConscript',
 			'object/SConscript',
 			'space_buttons/SConscript',
@@ -23,5 +24,5 @@
 			'space_script/SConscript',
 			'space_text/SConscript',
 			'space_sequencer/SConscript',
-			'transform/SConscript',
+			'transform/SConscript',		# XXX this should be moved near start of list, as many modules depend on this?
 			'screen/SConscript'])

Added: branches/blender2.5/blender/source/blender/editors/animation/Makefile
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/Makefile	                        (rev 0)
+++ branches/blender2.5/blender/source/blender/editors/animation/Makefile	2008-12-20 08:24:24 UTC (rev 17963)
@@ -0,0 +1,54 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version. 
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_animation
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../makesrna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../python
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include 
+
+CPPFLAGS += -I../include 

Added: branches/blender2.5/blender/source/blender/editors/animation/SConscript
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/SConscript	                        (rev 0)
+++ branches/blender2.5/blender/source/blender/editors/animation/SConscript	2008-12-20 08:24:24 UTC (rev 17963)
@@ -0,0 +1,9 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf'
+incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
+
+env.BlenderLib ( 'bf_editors_animation', sources, Split(incs), [], libtype=['core','intern'], priority=[35, 40] )

Added: branches/blender2.5/blender/source/blender/editors/animation/anim_draw.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/anim_draw.c	                        (rev 0)
+++ branches/blender2.5/blender/source/blender/editors/animation/anim_draw.c	2008-12-20 08:24:24 UTC (rev 17963)
@@ -0,0 +1,174 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. 
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ * 
+ * Contributor(s): Joshua Leung
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+ 
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_action_types.h"
+#include "DNA_curve_types.h"
+#include "DNA_ipo_types.h"
+#include "DNA_object_types.h"
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_context.h"
+#include "BKE_global.h"
+#include "BKE_screen.h"
+#include "BKE_utildefines.h"
+
+#include "ED_anim_api.h"
+#include "ED_util.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+/* *************************************************** */
+/* CURRENT FRAME DRAWING */
+
+/* Draw current frame number in a little green box beside the current frame indicator */
+static void draw_cfra_number (View2D *v2d, float cfra, short time)
+{
+	float xscale, yscale, yspace, ypixels, x;
+	short slen;
+	char str[32];
+	
+	/* because the frame number text is subject to the same scaling as the contents of the view */
+	UI_view2d_getscale(v2d, &xscale, &yscale);
+	glScalef(1.0/xscale, 1.0, 1.0);
+	
+	if (time) 
+		sprintf(str, "   %.2f", FRA2TIME(CFRA));
+	else 
+		sprintf(str, "   %d", CFRA);
+	slen= UI_GetStringWidth(G.font, str, 0);
+	
+	/* get starting coordinates for drawing */
+	x= cfra * xscale;
+	
+	/* draw green box around/behind text */
+	UI_ThemeColor(TH_CFRAME);
+	UI_ThemeColorShadeAlpha(TH_CFRAME, 0, -100);
+	glRectf(x, 0,  x+slen,  15);
+	
+	/* draw current frame number - black text */
+	UI_ThemeColor(TH_TEXT);
+	ui_rasterpos_safe(x-5, 17, 1.0);
+	UI_DrawString(G.fonts, str, 0);
+	
+	/* restore view transform */
+	glScalef(xscale, yscale, 1.0);
+}
+
+/* General call for drawing current frame indicator in a */
+void ANIM_draw_cfra (const bContext *C, View2D *v2d, short flag)
+{
+	Scene *scene= CTX_data_scene(C);
+	float vec[2];
+	
+	/* Draw a light green line to indicate current frame */
+	vec[0]= (float)(scene->r.cfra * scene->r.framelen);
+	
+	UI_ThemeColor(TH_CFRAME);
+	glLineWidth(2.0);
+	
+	glBegin(GL_LINE_STRIP);
+		vec[1]= v2d->cur.ymin;
+		glVertex2fv(vec);
+		
+		vec[1]= v2d->cur.ymax;
+		glVertex2fv(vec);
+	glEnd();
+	
+	/* Draw dark green line if slow-parenting/time-offset is enabled */
+	if (flag & DRAWCFRA_SHOW_TIMEOFS) {
+		Object *ob= (scene->basact) ? (scene->basact->object) : 0;
+		if ((ob) && (ob->ipoflag & OB_OFFS_OB) && (give_timeoffset(ob)!=0.0)) {
+			vec[0]-= give_timeoffset(ob); /* could avoid calling twice */
+			
+			UI_ThemeColorShade(TH_CFRAME, -30);
+			
+			glBegin(GL_LINE_STRIP);
+				/*vec[1]= v2d->cur.ymax;*/ // this is set already. this line is only included
+				glVertex2fv(vec);
+				
+				vec[1]= v2d->cur.ymin;
+				glVertex2fv(vec);
+			glEnd();
+		}
+	}
+	
+	glLineWidth(1.0);
+	
+	/* Draw current frame number in a little box */
+	if (flag & DRAWCFRA_SHOW_NUMBOX) {
+		UI_view2d_view_orthoSpecial(C, v2d, 1);
+		draw_cfra_number(v2d, vec[0], (flag & DRAWCFRA_UNIT_SECONDS));
+	}
+}
+
+/* *************************************************** */
+/* PREVIEW RANGE 'CURTAINS' */
+
+/* Draw preview range 'curtains' for highlighting where the animation data is */
+void ANIM_draw_previewrange (const bContext *C, View2D *v2d)
+{
+	Scene *scene= CTX_data_scene(C);
+	
+	/* only draw this if preview range is set */
+	if (scene->r.psfra) {
+		glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+		glEnable(GL_BLEND);
+		glColor4f(0.0f, 0.0f, 0.0f, 0.4f);
+		
+		/* only draw two separate 'curtains' if there's no overlap between them */
+		if (PSFRA < PEFRA) {
+			glRectf(v2d->cur.xmin, v2d->cur.ymin, PSFRA, v2d->cur.ymax);
+			glRectf(PEFRA, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);	
+		} 
+		else {
+			glRectf(v2d->cur.xmin, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
+		}
+		
+		glDisable(GL_BLEND);
+	}
+}
+
+/* *************************************************** */

Added: branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c	                        (rev 0)
+++ branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c	2008-12-20 08:24:24 UTC (rev 17963)
@@ -0,0 +1,208 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. 
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ * 
+ * Contributor(s): Joshua Leung
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/* This file defines the system for filtering data into a form suitable for
+ * use by the Animation Editors, thus acting as a means by which the Animation 
+ * Editors maintain a level of abstraction from the data they actually manipulate.

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list