[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17946] branches/blender2.5/blender/source /blender: 2.5
Ton Roosendaal
ton at blender.org
Fri Dec 19 13:14:58 CET 2008
Revision: 17946
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17946
Author: ton
Date: 2008-12-19 13:14:58 +0100 (Fri, 19 Dec 2008)
Log Message:
-----------
2.5
Drawing code for space_view3d module.
It's still not cleaned, have to check on context usage still.
Also missing is editmodes, armatures, and probably more.
Known issue: splitting to 2nd window gives bad opengl lighting.
Picture for fun:
http://www.blender.org/bf/rt2.jpg
Current stat: brought back almost 10k lines! :)
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/editors/include/ED_types.h
branches/blender2.5/blender/source/blender/editors/space_view3d/Makefile
branches/blender2.5/blender/source/blender/editors/space_view3d/SConscript
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_draw.c
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_header.c
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_intern.h
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_view.c
branches/blender2.5/blender/source/blender/windowmanager/SConscript
branches/blender2.5/blender/source/blender/windowmanager/WM_api.h
branches/blender2.5/blender/source/blender/windowmanager/intern/Makefile
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_init_exit.c
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_subwindow.c
Added Paths:
-----------
branches/blender2.5/blender/source/blender/editors/include/BIF_retopo.h
branches/blender2.5/blender/source/blender/editors/space_view3d/drawmesh.c
branches/blender2.5/blender/source/blender/editors/space_view3d/drawobject.c
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_edit.c
Copied: branches/blender2.5/blender/source/blender/editors/include/BIF_retopo.h (from rev 17943, trunk/blender/source/blender/include/BIF_retopo.h)
===================================================================
--- branches/blender2.5/blender/source/blender/editors/include/BIF_retopo.h (rev 0)
+++ branches/blender2.5/blender/source/blender/editors/include/BIF_retopo.h 2008-12-19 12:14:58 UTC (rev 17946)
@@ -0,0 +1,110 @@
+/*
+ * $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) 2006 by Nicholas Bishop
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef BIF_RETOPO_H
+#define BIF_RETOPO_H
+
+#include "DNA_vec_types.h"
+
+/* For bglMats */
+#include "BIF_glutil.h"
+
+struct EditVert;
+struct Mesh;
+struct View3D;
+
+typedef struct RetopoViewData {
+ bglMats mats;
+
+ char queue_matrix_update;
+} RetopoViewData;
+
+typedef struct RetopoPaintPoint {
+ struct RetopoPaintPoint *next, *prev;
+ vec2s loc;
+ short index;
+ float co[3];
+ struct EditVert *eve;
+} RetopoPaintPoint;
+
+typedef struct RetopoPaintLine {
+ struct RetopoPaintLine *next, *prev;
+ ListBase points;
+ ListBase hitlist; /* RetopoPaintHit */
+ RetopoPaintPoint *cyclic;
+} RetopoPaintLine;
+
+typedef struct RetopoPaintSel {
+ struct RetopoPaintSel *next, *prev;
+ RetopoPaintLine *line;
+ char first;
+} RetopoPaintSel;
+
+typedef struct RetopoPaintData {
+ char in_drag;
+ short sloc[2];
+
+ ListBase lines;
+ ListBase intersections; /* RetopoPaintPoint */
+
+ short seldist;
+ RetopoPaintSel nearest;
+
+ struct View3D *paint_v3d;
+} RetopoPaintData;
+
+RetopoPaintData *get_retopo_paint_data(void);
+
+char retopo_mesh_check(void);
+char retopo_curve_check(void);
+
+void retopo_end_okee(void);
+
+void retopo_free_paint_data(RetopoPaintData *rpd);
+void retopo_free_paint(void);
+
+char retopo_mesh_paint_check(void);
+void retopo_paint_view_update(struct View3D *v3d);
+void retopo_force_update(void);
+void retopo_paint_toggle(void*,void*);
+char retopo_paint(const unsigned short event);
+void retopo_draw_paint_lines(void);
+RetopoPaintData *retopo_paint_data_copy(RetopoPaintData *rpd);
+
+void retopo_toggle(void*,void*);
+void retopo_do_vert(struct View3D *v3d, float *v);
+void retopo_do_all(void);
+void retopo_do_all_cb(void *, void *);
+void retopo_queue_updates(struct View3D *v3d);
+
+void retopo_matrix_update(struct View3D *v3d);
+
+void retopo_free_view_data(struct View3D *v3d);
+
+#endif
Modified: branches/blender2.5/blender/source/blender/editors/include/ED_types.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/include/ED_types.h 2008-12-19 11:45:46 UTC (rev 17945)
+++ branches/blender2.5/blender/source/blender/editors/include/ED_types.h 2008-12-19 12:14:58 UTC (rev 17946)
@@ -31,8 +31,9 @@
/* **************** GENERAL EDITOR-WIDE TYPES AND DEFINES ************************** */
/* old blender defines... should be depricated? */
-#define SELECT 1
-#define ACTIVE 2
+#define DESELECT 0
+#define SELECT 1
+#define ACTIVE 2
#endif /* ED_TYPES_H */
Modified: branches/blender2.5/blender/source/blender/editors/space_view3d/Makefile
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_view3d/Makefile 2008-12-19 11:45:46 UTC (rev 17945)
+++ branches/blender2.5/blender/source/blender/editors/space_view3d/Makefile 2008-12-19 12:14:58 UTC (rev 17946)
@@ -48,6 +48,7 @@
CPPFLAGS += -I../../makesdna
CPPFLAGS += -I../../imbuf
CPPFLAGS += -I../../python
+CPPFLAGS += -I../../gpu
CPPFLAGS += -I../../render/extern/include
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
Modified: branches/blender2.5/blender/source/blender/editors/space_view3d/SConscript
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_view3d/SConscript 2008-12-19 11:45:46 UTC (rev 17945)
+++ branches/blender2.5/blender/source/blender/editors/space_view3d/SConscript 2008-12-19 12:14:58 UTC (rev 17946)
@@ -6,5 +6,6 @@
incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
incs += ' ../../render/extern/include #/intern/guardedalloc #intern/bmfont'
+incs += ' ../../gpu'
env.BlenderLib ( 'bf_editors_space_view3d', sources, Split(incs), [], libtype=['core','intern'], priority=[35, 40] )
Copied: branches/blender2.5/blender/source/blender/editors/space_view3d/drawmesh.c (from rev 17944, trunk/blender/source/blender/src/drawmesh.c)
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_view3d/drawmesh.c (rev 0)
+++ branches/blender2.5/blender/source/blender/editors/space_view3d/drawmesh.c 2008-12-19 12:14:58 UTC (rev 17946)
@@ -0,0 +1,579 @@
+/**
+ * $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) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * Contributor(s): Blender Foundation, full update, glsl support
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <math.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_edgehash.h"
+#include "BLI_editVert.h"
+
+#include "IMB_imbuf.h"
+#include "IMB_imbuf_types.h"
+
+#include "DNA_image_types.h"
+#include "DNA_lamp_types.h"
+#include "DNA_material_types.h"
+#include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_object_types.h"
+#include "DNA_property_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_view3d_types.h"
+#include "DNA_userdef_types.h"
+
+#include "BKE_bmfont.h"
+#include "BKE_context.h"
+#include "BKE_displist.h"
+#include "BKE_DerivedMesh.h"
+#include "BKE_effect.h"
+#include "BKE_global.h"
+#include "BKE_image.h"
+#include "BKE_main.h"
+#include "BKE_material.h"
+#include "BKE_mesh.h"
+#include "BKE_object.h"
+#include "BKE_property.h"
+#include "BKE_utildefines.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_resources.h"
+#include "UI_interface_icons.h"
+
+#include "GPU_extensions.h"
+#include "GPU_draw.h"
+
+#include "view3d_intern.h" // own include
+
+/***/
+
+ /* Flags for marked edges */
+enum {
+ eEdge_Visible = (1<<0),
+ eEdge_Select = (1<<1),
+};
+
+ /* Creates a hash of edges to flags indicating
+ * adjacent tface select/active/etc flags.
+ */
+static void get_marked_edge_info__orFlags(EdgeHash *eh, int v0, int v1, int flags)
+{
+ int *flags_p;
+
+ if (!BLI_edgehash_haskey(eh, v0, v1)) {
+ BLI_edgehash_insert(eh, v0, v1, 0);
+ }
+
+ flags_p = (int*) BLI_edgehash_lookup_p(eh, v0, v1);
+ *flags_p |= flags;
+}
+
+static EdgeHash *get_tface_mesh_marked_edge_info(Mesh *me)
+{
+ EdgeHash *eh = BLI_edgehash_new();
+ int i;
+ MFace *mf;
+ MTFace *tf = NULL;
+
+ for (i=0; i<me->totface; i++) {
+ mf = &me->mface[i];
+ if (me->mtface)
+ tf = &me->mtface[i];
+
+ if (mf->v3) {
+ if (!(mf->flag&ME_HIDE)) {
+ unsigned int flags = eEdge_Visible;
+ if (mf->flag&ME_FACE_SEL) flags |= eEdge_Select;
+
+ get_marked_edge_info__orFlags(eh, mf->v1, mf->v2, flags);
+ get_marked_edge_info__orFlags(eh, mf->v2, mf->v3, flags);
+ if (mf->v4) {
+ get_marked_edge_info__orFlags(eh, mf->v3, mf->v4, flags);
+ get_marked_edge_info__orFlags(eh, mf->v4, mf->v1, flags);
+ } else {
+ get_marked_edge_info__orFlags(eh, mf->v3, mf->v1, flags);
+ }
+ }
+ }
+ }
+
+ return eh;
+}
+
+
+static int draw_tfaces3D__setHiddenOpts(void *userData, int index)
+{
+ struct { Mesh *me; EdgeHash *eh; } *data = userData;
+ MEdge *med = &data->me->medge[index];
+ uintptr_t flags = (intptr_t) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
+
+ if((G.f & G_DRAWSEAMS) && (med->flag&ME_SEAM)) {
+ return 0;
+ } else if(G.f & G_DRAWEDGES){
+ if (G.f&G_HIDDENEDGES) {
+ return 1;
+ } else {
+ return (flags & eEdge_Visible);
+ }
+ } else {
+ return (flags & eEdge_Select);
+ }
+}
+static int draw_tfaces3D__setSeamOpts(void *userData, int index)
+{
+ struct { Mesh *me; EdgeHash *eh; } *data = userData;
+ MEdge *med = &data->me->medge[index];
+ uintptr_t flags = (intptr_t) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
+
+ if (med->flag&ME_SEAM) {
+ if (G.f&G_HIDDENEDGES) {
+ return 1;
+ } else {
+ return (flags & eEdge_Visible);
+ }
+ } else {
+ return 0;
+ }
+}
+static int draw_tfaces3D__setSelectOpts(void *userData, int index)
+{
+ struct { Mesh *me; EdgeHash *eh; } *data = userData;
+ MEdge *med = &data->me->medge[index];
+ uintptr_t flags = (intptr_t) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
+
+ return flags & eEdge_Select;
+}
+static int draw_tfaces3D__setActiveOpts(void *userData, int index)
+{
+ struct { Mesh *me; EdgeHash *eh; } *data = userData;
+ MEdge *med = &data->me->medge[index];
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list