[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16095] branches/soc-2008-nicholasbishop/ source/blender: Removed *yet more!* old crufty multires stuff.

Nicholas Bishop nicholasbishop at gmail.com
Thu Aug 14 03:14:48 CEST 2008


Revision: 16095
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16095
Author:   nicholasbishop
Date:     2008-08-14 03:14:46 +0200 (Thu, 14 Aug 2008)

Log Message:
-----------
Removed *yet more!* old crufty multires stuff. I think this is all of it now.

Modified Paths:
--------------
    branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h
    branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/mesh.c
    branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/modifier.c
    branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c
    branches/soc-2008-nicholasbishop/source/blender/makesdna/DNA_meshdata_types.h
    branches/soc-2008-nicholasbishop/source/blender/render/intern/include/render_types.h
    branches/soc-2008-nicholasbishop/source/blender/render/intern/source/convertblender.c
    branches/soc-2008-nicholasbishop/source/blender/src/buttons_editing.c
    branches/soc-2008-nicholasbishop/source/blender/src/editface.c
    branches/soc-2008-nicholasbishop/source/blender/src/editkey.c
    branches/soc-2008-nicholasbishop/source/blender/src/editmesh_mods.c
    branches/soc-2008-nicholasbishop/source/blender/src/editobject.c
    branches/soc-2008-nicholasbishop/source/blender/src/meshtools.c

Removed Paths:
-------------
    branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires-firstlevel.c

Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h
===================================================================
--- branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h	2008-08-14 00:42:54 UTC (rev 16094)
+++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h	2008-08-14 01:14:46 UTC (rev 16095)
@@ -37,7 +37,6 @@
 struct Object;
 
 /* Level access */
-struct MultiresLevel *current_level(struct Multires *mr);
 struct MultiresLevel *multires_level_n(struct Multires *mr, int n);
 
 /* Level control */

Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/mesh.c
===================================================================
--- branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/mesh.c	2008-08-14 00:42:54 UTC (rev 16094)
+++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/mesh.c	2008-08-14 01:14:46 UTC (rev 16095)
@@ -58,7 +58,6 @@
 #include "BKE_DerivedMesh.h"
 #include "BKE_global.h"
 #include "BKE_mesh.h"
-#include "BKE_multires.h"
 #include "BKE_subsurf.h"
 #include "BKE_displist.h"
 #include "BKE_library.h"
@@ -182,8 +181,6 @@
 	
 	if(me->bb) MEM_freeN(me->bb);
 	if(me->mselect) MEM_freeN(me->mselect);
-
-	if(me->mr) multires_free(me->mr);
 }
 
 void copy_dverts(MDeformVert *dst, MDeformVert *src, int copycount)
@@ -271,9 +268,6 @@
 		}
 	}
 	
-	if(me->mr)
-		men->mr= multires_copy(me->mr);
-
 	men->mselect= NULL;
 
 	men->bb= MEM_dupallocN(men->bb);

Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/modifier.c
===================================================================
--- branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/modifier.c	2008-08-14 00:42:54 UTC (rev 16094)
+++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/modifier.c	2008-08-14 01:14:46 UTC (rev 16095)
@@ -5709,7 +5709,6 @@
 	DerivedMesh *dm = derivedData;
 	ParticleSystemModifierData *psmd= (ParticleSystemModifierData*) md;
 	ParticleSystem * psys=0;
-	Mesh *me;
 	int needsFree=0;
 
 	if(ob->particlesystem.first)
@@ -5717,14 +5716,6 @@
 	else
 		return;
 	
-	/* multires check */
-	if(ob->type == OB_MESH) {
-		me= (Mesh*)ob->data;
-		if(me->mr && me->mr->current != 1)
-			modifier_setError(md,
-				"Particles only supported on first multires level.");
-	}
-
 	if(!psys_check_enabled(ob, psys))
 		return;
 

Deleted: branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires-firstlevel.c
===================================================================
--- branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires-firstlevel.c	2008-08-14 00:42:54 UTC (rev 16094)
+++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires-firstlevel.c	2008-08-14 01:14:46 UTC (rev 16095)
@@ -1,409 +0,0 @@
-/*
- * $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 *****
- *
- * Deals with the first-level data in multires (edge flags, weights, and UVs)
- *
- * multires.h
- *
- */
-
-#include "DNA_customdata_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-
-#include "BIF_editmesh.h"
-
-#include "BKE_customdata.h"
-#include "BKE_global.h"
-#include "BKE_mesh.h"
-#include "BKE_multires.h"
-
-#include "BLI_editVert.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "blendef.h"
-
-#include <string.h>
-
-MDeformVert *subdivide_dverts(MDeformVert *src, MultiresLevel *lvl);
-MTFace *subdivide_mtfaces(MTFace *src, MultiresLevel *lvl);
-void multires_update_edge_flags(Mesh *me, EditMesh *em);
-void eed_to_medge_flag(EditEdge *eed, short *flag, char *crease);
-
-/***********    Generic     ***********/
-
-CustomDataMask cdmask(const int type)
-{
-	if(type == CD_MDEFORMVERT)
-		return CD_MASK_MDEFORMVERT;
-	else if(type == CD_MTFACE)
-		return CD_MASK_MTFACE;
-	return -1;
-}
-
-char type_ok(const int type)
-{
-	return (type == CD_MDEFORMVERT) || (type == CD_MTFACE);
-}
-
-/* Copy vdata or fdata from Mesh or EditMesh to Multires. */
-void multires_update_customdata(MultiresLevel *lvl1, EditMesh *em, CustomData *src, CustomData *dst, const int type)
-{
-	if(src && dst && type_ok(type)) {
-		const int tot= (type == CD_MDEFORMVERT ? lvl1->totvert : lvl1->totface);
-		int i;
-		
-		CustomData_free(dst, tot);
-		
-		if(CustomData_has_layer(src, type)) {
-			if(em) {
-				EditVert *eve= G.editMesh->verts.first;
-				EditFace *efa= G.editMesh->faces.first;
-				CustomData_copy(src, dst, cdmask(type), CD_CALLOC, tot);
-				for(i=0; i<tot; ++i) {
-					if(type == CD_MDEFORMVERT) {
-						CustomData_from_em_block(&G.editMesh->vdata, dst, eve->data, i);
-						eve= eve->next;
-					}
-					else if(type == CD_MTFACE) {
-						CustomData_from_em_block(&G.editMesh->fdata, dst, efa->data, i);
-						efa= efa->next;
-					}
-				}
-			}
-			else
-				CustomData_copy(src, dst, cdmask(type), CD_DUPLICATE, tot);
-		}
-	}
-}
-
-/* Uses subdivide_dverts or subdivide_mtfaces to subdivide src to match lvl_end. Does not free src. */
-void *subdivide_customdata_to_level(void *src, MultiresLevel *lvl_start,
-                                    MultiresLevel *lvl_end, const int type)
-{
-	if(src && lvl_start && lvl_end && type_ok(type)) {
-		MultiresLevel *lvl;
-		void *cr_data= NULL, *pr_data= NULL;
-		
-		pr_data= src;
-		for(lvl= lvl_start; lvl && lvl != lvl_end; lvl= lvl->next) {
-			if(type == CD_MDEFORMVERT)
-				cr_data= subdivide_dverts(pr_data, lvl);
-			else if(type == CD_MTFACE)
-				cr_data= subdivide_mtfaces(pr_data, lvl);
-			
-			/* Free previous subdivision level's data */
-			if(lvl != lvl_start) {
-				if(type == CD_MDEFORMVERT)
-					free_dverts(pr_data, lvl->totvert);
-				else if(type == CD_MTFACE)
-					MEM_freeN(pr_data);
-			}
-
-			pr_data= cr_data;
-			cr_data= NULL;
-		}
-		
-		return pr_data;
-	}
-	
-	return NULL;
-}
-
-/* Directly copy src into dst (handles both Mesh and EditMesh) */
-void customdata_to_mesh(Mesh *me, EditMesh *em, CustomData *src, CustomData *dst, const int tot, const int type)
-{
-	if(me && me->mr && src && dst && type_ok(type)) {
-		if(em) {
-			int i;
-			EditVert *eve= em->verts.first;
-			EditFace *efa= em->faces.first;
-			CustomData_copy(src, dst, cdmask(type), CD_CALLOC, 0);
-			
-			for(i=0; i<tot; ++i) {
-				if(type == CD_MDEFORMVERT) {
-					CustomData_to_em_block(src, dst, i, &eve->data);
-					eve= eve->next;
-				}
-				else if(type == CD_MTFACE) {
-					CustomData_to_em_block(src, dst, i, &efa->data);
-					efa= efa->next;
-				}
-			}
-		} else {
-			CustomData_merge(src, dst, cdmask(type), CD_DUPLICATE, tot);
-		}
-	}
-}
-
-/* Subdivide vdata or fdata from Multires into either Mesh or EditMesh. */
-void multires_customdata_to_mesh(Mesh *me, EditMesh *em, MultiresLevel *lvl, CustomData *src,
-                                 CustomData *dst, const int type)
-{	
-	if(me && me->mr && lvl && src && dst && type_ok(type) &&
-	   CustomData_has_layer(src, type)) {
-		const int tot= (type == CD_MDEFORMVERT ? lvl->totvert : lvl->totface);
-		if(lvl == me->mr->levels.first) {
-			customdata_to_mesh(me, em, src, dst, tot, type);
-		}
-		else {
-			CustomData cdf;
-			const int count = CustomData_number_of_layers(src, type);
-			int i;
-			
-			/* Construct a new CustomData containing the subdivided data */
-			CustomData_copy(src, &cdf, cdmask(type), CD_ASSIGN, tot);
-			for(i=0; i<count; ++i) {
-				void *layer= CustomData_get_layer_n(&cdf, type, i);
-				CustomData_set_layer_n(&cdf, type, i,
-					subdivide_customdata_to_level(layer, me->mr->levels.first, lvl, type));
-			}
-			
-			customdata_to_mesh(me, em, &cdf, dst, tot, type);
-			CustomData_free(&cdf, tot);
-		}
-	}
-}
-
-/* Subdivide the first-level customdata up to cr_lvl, then delete the original data */
-void multires_del_lower_customdata(Multires *mr, MultiresLevel *cr_lvl)
-{
-	MultiresLevel *lvl1= mr->levels.first;
-	MDeformVert *dverts= NULL;
-	CustomData cdf;
-	int i;
-
-	/* dverts */
-	dverts= subdivide_customdata_to_level(CustomData_get(&mr->vdata, 0, CD_MDEFORMVERT),
-	                                      lvl1, cr_lvl, CD_MDEFORMVERT);
-	if(dverts) {
-		CustomData_free_layers(&mr->vdata, CD_MDEFORMVERT, lvl1->totvert);
-		CustomData_add_layer(&mr->vdata, CD_MDEFORMVERT, CD_ASSIGN, dverts, cr_lvl->totvert);
-	}
-	
-	/* mtfaces */
-	CustomData_copy(&mr->fdata, &cdf, CD_MASK_MTFACE, CD_ASSIGN, cr_lvl->totface);
-	for(i=0; i<CustomData_number_of_layers(&mr->fdata, CD_MTFACE); ++i) {
-		MTFace *mtfaces=
-			subdivide_customdata_to_level(CustomData_get_layer_n(&mr->fdata, CD_MTFACE, i),
-			                              lvl1, cr_lvl, CD_MTFACE);
-		if(mtfaces)
-			CustomData_set_layer_n(&cdf, CD_MTFACE, i, mtfaces);
-	}
-	
-	CustomData_free(&mr->fdata, lvl1->totface);
-	mr->fdata= cdf;
-}
-
-/* Update all special first-level data, if the first-level is active */
-void multires_update_first_level(Mesh *me, EditMesh *em)
-{
-	if(me && me->mr && me->mr->current == 1) {
-		multires_update_customdata(me->mr->levels.first, em, em ? &em->vdata : &me->vdata,
-		                           &me->mr->vdata, CD_MDEFORMVERT);
-		multires_update_customdata(me->mr->levels.first, em, em ? &em->fdata : &me->fdata,
-		                           &me->mr->fdata, CD_MTFACE);
-		multires_update_edge_flags(me, em);
-	}
-}
-
-/*********** Multires.edge_flags ***********/
-void multires_update_edge_flags(Mesh *me, EditMesh *em)
-{
-	MultiresLevel *lvl= me->mr->levels.first;
-	EditEdge *eed= NULL;
-	int i;
-	
-	if(em) eed= em->edges.first;
-	for(i=0; i<lvl->totedge; ++i) {
-		if(em) {

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list