[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18801] branches/blender2.5/blender/source : 2.5

Ton Roosendaal ton at blender.org
Tue Feb 3 13:04:08 CET 2009


Revision: 18801
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18801
Author:   ton
Date:     2009-02-03 13:04:05 +0100 (Tue, 03 Feb 2009)

Log Message:
-----------
2.5

As creator of the Ipo I also reserve to right to kick it out
definitely :) To honour the wonderful contributions from Joshua
here it is; renamed space_ipo to space_graph!

Note; make, cmake and scons should work, msvc will require some
work now!

Modified Paths:
--------------
    branches/blender2.5/blender/source/Makefile
    branches/blender2.5/blender/source/blender/editors/Makefile
    branches/blender2.5/blender/source/blender/editors/SConscript
    branches/blender2.5/blender/source/blender/editors/space_graph/Makefile
    branches/blender2.5/blender/source/blender/editors/space_graph/SConscript

Added Paths:
-----------
    branches/blender2.5/blender/source/blender/editors/space_graph/
    branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c
    branches/blender2.5/blender/source/blender/editors/space_graph/graph_edit.c
    branches/blender2.5/blender/source/blender/editors/space_graph/graph_header.c
    branches/blender2.5/blender/source/blender/editors/space_graph/graph_intern.h
    branches/blender2.5/blender/source/blender/editors/space_graph/graph_ops.c
    branches/blender2.5/blender/source/blender/editors/space_graph/graph_select.c
    branches/blender2.5/blender/source/blender/editors/space_graph/space_graph.c

Removed Paths:
-------------
    branches/blender2.5/blender/source/blender/editors/space_graph/ipo_draw.c
    branches/blender2.5/blender/source/blender/editors/space_graph/ipo_edit.c
    branches/blender2.5/blender/source/blender/editors/space_graph/ipo_header.c
    branches/blender2.5/blender/source/blender/editors/space_graph/ipo_intern.h
    branches/blender2.5/blender/source/blender/editors/space_graph/ipo_ops.c
    branches/blender2.5/blender/source/blender/editors/space_graph/ipo_select.c
    branches/blender2.5/blender/source/blender/editors/space_graph/space_ipo.c
    branches/blender2.5/blender/source/blender/editors/space_ipo/

Modified: branches/blender2.5/blender/source/Makefile
===================================================================
--- branches/blender2.5/blender/source/Makefile	2009-02-03 10:41:48 UTC (rev 18800)
+++ branches/blender2.5/blender/source/Makefile	2009-02-03 12:04:05 UTC (rev 18801)
@@ -233,7 +233,7 @@
 PULIB += $(OCGDIR)/blender/ed_buttons/libed_buttons.a
 PULIB += $(OCGDIR)/blender/ed_node/libed_node.a
 PULIB += $(OCGDIR)/blender/ed_image/libed_image.a
-PULIB += $(OCGDIR)/blender/ed_ipo/libed_ipo.a
+PULIB += $(OCGDIR)/blender/ed_graph/libed_graph.a
 PULIB += $(OCGDIR)/blender/ed_outliner/libed_outliner.a
 PULIB += $(OCGDIR)/blender/ed_time/libed_time.a
 PULIB += $(OCGDIR)/blender/ed_preview/libed_preview.a

Modified: branches/blender2.5/blender/source/blender/editors/Makefile
===================================================================
--- branches/blender2.5/blender/source/blender/editors/Makefile	2009-02-03 10:41:48 UTC (rev 18800)
+++ branches/blender2.5/blender/source/blender/editors/Makefile	2009-02-03 12:04:05 UTC (rev 18801)
@@ -29,6 +29,6 @@
 # Bounces make to subdirectories.
 
 SOURCEDIR = source/blender/editors
-DIRS = armature mesh animation object sculpt datafiles transform screen curve gpencil physics preview uvedit space_outliner space_time space_view3d interface util  space_api space_ipo space_image space_node space_buttons space_info space_file space_sound space_action space_nla space_script space_text space_sequencer
+DIRS = armature mesh animation object sculpt datafiles transform screen curve gpencil physics preview uvedit space_outliner space_time space_view3d interface util  space_api space_graph space_image space_node space_buttons space_info space_file space_sound space_action space_nla space_script space_text space_sequencer
 
 include nan_subdirs.mk

Modified: branches/blender2.5/blender/source/blender/editors/SConscript
===================================================================
--- branches/blender2.5/blender/source/blender/editors/SConscript	2009-02-03 10:41:48 UTC (rev 18800)
+++ branches/blender2.5/blender/source/blender/editors/SConscript	2009-02-03 12:04:05 UTC (rev 18801)
@@ -18,7 +18,7 @@
 			'space_file/SConscript',
 			'space_image/SConscript',
 			'space_info/SConscript',
-			'space_ipo/SConscript',
+			'space_graph/SConscript',
 			'space_node/SConscript',
 			'space_outliner/SConscript',
 			'space_time/SConscript',

Copied: branches/blender2.5/blender/source/blender/editors/space_graph (from rev 18799, branches/blender2.5/blender/source/blender/editors/space_ipo)

Modified: branches/blender2.5/blender/source/blender/editors/space_graph/Makefile
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_ipo/Makefile	2009-02-03 10:14:29 UTC (rev 18799)
+++ branches/blender2.5/blender/source/blender/editors/space_graph/Makefile	2009-02-03 12:04:05 UTC (rev 18801)
@@ -28,7 +28,7 @@
 #
 # Makes module object directory and bounces make to subdirectories.
 
-LIBNAME = ed_ipo
+LIBNAME = ed_graph
 DIR = $(OCGDIR)/blender/$(LIBNAME)
 
 include nan_compile.mk

Modified: branches/blender2.5/blender/source/blender/editors/space_graph/SConscript
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_ipo/SConscript	2009-02-03 10:14:29 UTC (rev 18799)
+++ branches/blender2.5/blender/source/blender/editors/space_graph/SConscript	2009-02-03 12:04:05 UTC (rev 18801)
@@ -6,4 +6,4 @@
 incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf'
 incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
 
-env.BlenderLib ( 'bf_editors_space_ipo', sources, Split(incs), [], libtype=['core'], priority=[50] )
+env.BlenderLib ( 'bf_editors_space_graph', sources, Split(incs), [], libtype=['core'], priority=[50] )

Copied: branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c (from rev 18799, branches/blender2.5/blender/source/blender/editors/space_ipo/ipo_draw.c)
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c	                        (rev 0)
+++ branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c	2009-02-03 12:04:05 UTC (rev 18801)
@@ -0,0 +1,1094 @@
+/**
+ * $Id: drawipo.c 17512 2008-11-20 05:55:42Z aligorith $
+ *
+ * ***** 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) Blender Foundation
+ *
+ * Contributor(s): Joshua Leung (2009 Recode)
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdio.h>
+#include <math.h>
+#include <string.h>
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifndef _WIN32
+#include <unistd.h>
+#else
+#include <io.h>
+#endif
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+
+#include "DNA_anim_types.h"
+#include "DNA_action_types.h"
+#include "DNA_camera_types.h"
+#include "DNA_curve_types.h"
+#include "DNA_key_types.h"
+#include "DNA_lamp_types.h"
+#include "DNA_material_types.h"
+#include "DNA_object_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_space_types.h"
+#include "DNA_sequence_types.h"
+#include "DNA_userdef_types.h"
+#include "DNA_view2d_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "BKE_animsys.h"
+#include "BKE_context.h"
+#include "BKE_curve.h"
+#include "BKE_depsgraph.h"
+#include "BKE_fcurve.h"
+#include "BKE_global.h"
+#include "BKE_key.h"
+#include "BKE_object.h"
+#include "BKE_screen.h"
+#include "BKE_utildefines.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "ED_anim_api.h"
+#include "ED_util.h"
+
+#include "graph_intern.h"
+
+#include "UI_interface.h"
+#include "UI_interface_icons.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+#include "UI_text.h"
+
+/* XXX */
+extern void ui_rasterpos_safe(float x, float y, float aspect);
+extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad);
+
+/* *************************** */
+/* Curve Drawing */
+
+/* Points ---------------- */
+
+/* helper func - draw keyframe vertices only for an F-Curve */
+static void draw_fcurve_vertices_keyframes (FCurve *fcu, View2D *v2d, short edit, short sel)
+{
+	BezTriple *bezt= fcu->bezt;
+	const float fac= 0.05f * (v2d->cur.xmax - v2d->cur.xmin);
+	int i;
+	
+	/* we use bgl points not standard gl points, to workaround vertex 
+	 * drawing bugs that some drivers have (probably legacy ones only though)
+	 */
+	bglBegin(GL_POINTS);
+	
+	for (i = 0; i < fcu->totvert; i++, bezt++) {
+		/* as an optimisation step, only draw those in view 
+		 *	- we apply a correction factor to ensure that points don't pop in/out due to slight twitches of view size
+		 */
+		if IN_RANGE(bezt->vec[1][0], (v2d->cur.xmin - fac), (v2d->cur.xmax + fac)) {
+			if (edit) {
+				/* 'Keyframe' vertex only, as handle lines and handles have already been drawn
+				 *	- only draw those with correct selection state for the current drawing color
+				 *	- 
+				 */
+				if ((bezt->f2 & SELECT) == sel)
+					bglVertex3fv(bezt->vec[1]);
+			}
+			else {
+				/* no check for selection here, as curve is not editable... */
+				// XXX perhaps we don't want to even draw points?   maybe add an option for that later
+				bglVertex3fv(bezt->vec[1]);
+			}
+		}
+	}
+	
+	bglEnd();
+}
+
+
+/* helper func - draw handle vertex for an F-Curve as a round unfilled circle */
+static void draw_fcurve_handle_control (float x, float y, float xscale, float yscale, float hsize)
+{
+	static GLuint displist=0;
+	
+	/* initialise round circle shape */
+	if (displist == 0) {
+		GLUquadricObj *qobj;
+		
+		displist= glGenLists(1);
+		glNewList(displist, GL_COMPILE);
+		
+		qobj	= gluNewQuadric(); 
+		gluQuadricDrawStyle(qobj, GLU_SILHOUETTE); 
+		gluDisk(qobj, 0,  0.7, 8, 1);
+		gluDeleteQuadric(qobj);  
+		
+		glEndList();
+	}
+	
+	/* adjust view transform before starting */
+	glTranslatef(x, y, 0.0f);
+	glScalef(1.0f/xscale*hsize, 1.0f/yscale*hsize, 1.0f);
+	
+	/* draw! */
+	glCallList(displist);
+	
+	/* restore view transform */
+	glScalef(xscale/hsize, yscale/hsize, 1.0);
+	glTranslatef(-x, -y, 0.0f);
+}
+
+/* helper func - draw handle vertices only for an F-Curve (if it is not protected) */
+static void draw_fcurve_vertices_handles (FCurve *fcu, View2D *v2d, short sel)
+{
+	BezTriple *bezt= fcu->bezt;
+	BezTriple *prevbezt = NULL;
+	float hsize, xscale, yscale;
+	int i;
+	
+	/* get view settings */
+	hsize= UI_GetThemeValuef(TH_HANDLE_VERTEX_SIZE);
+	UI_view2d_getscale(v2d, &xscale, &yscale);
+	
+	/* set handle color */
+	if (sel) UI_ThemeColor(TH_HANDLE_VERTEX_SELECT);
+	else UI_ThemeColor(TH_HANDLE_VERTEX);
+	
+	for (i=0; i < fcu->totvert; i++, prevbezt=bezt, bezt++) {
+		/* Draw the editmode handels for a bezier curve (others don't have handles) 
+		 * if their selection status matches the selection status we're drawing for
+		 *	- first handle only if previous beztriple was bezier-mode
+		 *	- second handle only if current beztriple is bezier-mode
+		 */
+		if ( (!prevbezt && (bezt->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ)) ) {
+			if ((bezt->f1 & SELECT) == sel)/* && v2d->cur.xmin < bezt->vec[0][0] < v2d->cur.xmax)*/
+				draw_fcurve_handle_control(bezt->vec[0][0], bezt->vec[0][1], xscale, yscale, hsize);
+		}
+		
+		if (bezt->ipo==BEZT_IPO_BEZ) {
+			if ((bezt->f3 & SELECT) == sel)/* && v2d->cur.xmin < bezt->vec[2][0] < v2d->cur.xmax)*/
+				draw_fcurve_handle_control(bezt->vec[2][0], bezt->vec[2][1], xscale, yscale, hsize);
+		}
+	}
+}
+
+/* helper func - set color to draw F-Curve data with */

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list