[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44288] trunk/blender: remove NGon Interp modifier (which was merged as apart of BMesh),

Campbell Barton ideasman42 at gmail.com
Tue Feb 21 00:25:05 CET 2012


Revision: 44288
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44288
Author:   campbellbarton
Date:     2012-02-20 23:24:57 +0000 (Mon, 20 Feb 2012)
Log Message:
-----------
remove NGon Interp modifier (which was merged as apart of BMesh),
this didnt really give any advantage over subsurf's Simple-Subdiv mode.

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/properties_data_modifier.py
    trunk/blender/source/blender/makesdna/DNA_modifier_types.h
    trunk/blender/source/blender/makesrna/intern/rna_modifier.c
    trunk/blender/source/blender/modifiers/CMakeLists.txt
    trunk/blender/source/blender/modifiers/intern/MOD_util.c

Removed Paths:
-------------
    trunk/blender/source/blender/modifiers/intern/MOD_ngoninterp.c

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_data_modifier.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_data_modifier.py	2012-02-20 23:03:36 UTC (rev 44287)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_data_modifier.py	2012-02-20 23:24:57 UTC (rev 44288)
@@ -46,11 +46,7 @@
     # the mt.type enum is (ab)used for a lookup on function names
     # ...to avoid lengthy if statements
     # so each type must have a function here.
-	
-    def NGONINTERP(self, layout, ob, md):
-        split = layout.split()
-        split.prop(md, "resolution")
-        
+
     def ARMATURE(self, layout, ob, md):
         split = layout.split()
 

Modified: trunk/blender/source/blender/makesdna/DNA_modifier_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_modifier_types.h	2012-02-20 23:03:36 UTC (rev 44287)
+++ trunk/blender/source/blender/makesdna/DNA_modifier_types.h	2012-02-20 23:24:57 UTC (rev 44288)
@@ -77,7 +77,6 @@
 	eModifierType_Ocean,
 	eModifierType_DynamicPaint,
 	eModifierType_Remesh,
-	eModifierType_NgonInterp,
 	NUM_MODIFIER_TYPES
 } ModifierType;
 

Modified: trunk/blender/source/blender/makesrna/intern/rna_modifier.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_modifier.c	2012-02-20 23:03:36 UTC (rev 44287)
+++ trunk/blender/source/blender/makesrna/intern/rna_modifier.c	2012-02-20 23:24:57 UTC (rev 44288)
@@ -74,7 +74,6 @@
 	{eModifierType_Screw, "SCREW", ICON_MOD_SCREW, "Screw", ""},
 	{eModifierType_Solidify, "SOLIDIFY", ICON_MOD_SOLIDIFY, "Solidify", ""},
 	{eModifierType_Subsurf, "SUBSURF", ICON_MOD_SUBSURF, "Subdivision Surface", ""},
-	{eModifierType_NgonInterp, "NGONINTERP", ICON_MOD_LATTICE, "Precision UV Interpolation", ""},
 	{0, "", 0, "Deform", ""},
 	{eModifierType_Armature, "ARMATURE", ICON_MOD_ARMATURE, "Armature", ""},
 	{eModifierType_Cast, "CAST", ICON_MOD_CAST, "Cast", ""},
@@ -184,8 +183,6 @@
 			return &RNA_MultiresModifier;
 		case eModifierType_Surface:
 			return &RNA_SurfaceModifier;
-		case eModifierType_NgonInterp:
-			return &RNA_NgonInterpModifier;
 		case eModifierType_Smoke:
 			return &RNA_SmokeModifier;
 		case eModifierType_Solidify:
@@ -3082,28 +3079,6 @@
 	// XXX how to update?
 }
 
-
-
-static void rna_def_modifier_ngoninterp(BlenderRNA *brna)
-{
-	StructRNA *srna;
-	PropertyRNA *prop;
-
-	srna= RNA_def_struct(brna, "NgonInterpModifier", "Modifier");
-	RNA_def_struct_ui_text(srna, "Precision UV Modifier", "Precision UV interpolation");
-	RNA_def_struct_sdna(srna, "NgonInterpModifierData");
-	RNA_def_struct_ui_icon(srna, ICON_MOD_SCREW);
-
-	prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_UNSIGNED);
-	RNA_def_property_range(prop, 1, 10000);
-	RNA_def_property_ui_range(prop, 1, 100, 1, 0);
-	RNA_def_property_ui_text(prop, "Resolution", "Size of interpolation grids");
-	RNA_def_property_update(prop, 0, "rna_Modifier_update");
-
-}
-
-
-
 void RNA_def_modifier(BlenderRNA *brna)
 {
 	StructRNA *srna;
@@ -3207,9 +3182,6 @@
 	rna_def_modifier_dynamic_paint(brna);
 	rna_def_modifier_ocean(brna);
 	rna_def_modifier_remesh(brna);
-
-	/* BMESH_ONLY */
-	rna_def_modifier_ngoninterp(brna);
 }
 
 #endif

Modified: trunk/blender/source/blender/modifiers/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/modifiers/CMakeLists.txt	2012-02-20 23:03:36 UTC (rev 44287)
+++ trunk/blender/source/blender/modifiers/CMakeLists.txt	2012-02-20 23:24:57 UTC (rev 44288)
@@ -67,7 +67,6 @@
 	intern/MOD_meshdeform.c
 	intern/MOD_mirror.c
 	intern/MOD_multires.c
-	intern/MOD_ngoninterp.c
 	intern/MOD_none.c
 	intern/MOD_ocean.c
 	intern/MOD_particleinstance.c

Deleted: trunk/blender/source/blender/modifiers/intern/MOD_ngoninterp.c
===================================================================
--- trunk/blender/source/blender/modifiers/intern/MOD_ngoninterp.c	2012-02-20 23:03:36 UTC (rev 44287)
+++ trunk/blender/source/blender/modifiers/intern/MOD_ngoninterp.c	2012-02-20 23:24:57 UTC (rev 44288)
@@ -1,331 +0,0 @@
-/*
- * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2005 by the Blender Foundation.
- * All rights reserved.
- *
- * Contributor(s): Daniel Dunbar
- *                 Ton Roosendaal,
- *                 Ben Batt,
- *                 Brecht Van Lommel,
- *                 Campbell Barton
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- */
-
-/** \file blender/modifiers/intern/MOD_mask.c
- *  \ingroup modifiers
- */
-
-#include <string.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_utildefines.h"
-#include "BLI_ghash.h"
-#include "BLI_array.h"
-#include "BLI_edgehash.h"
-#include "BLI_math.h"
-
-#include "DNA_armature_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-
-#include "BKE_cdderivedmesh.h"
-#include "BKE_mesh.h"
-#include "BKE_modifier.h"
-#include "BKE_deform.h"
-
-#include "depsgraph_private.h"
-
-#include "MOD_util.h"
-
-static void copyData(ModifierData *md, ModifierData *target)
-{
-	NgonInterpModifierData *mmd = (NgonInterpModifierData*) md;
-	NgonInterpModifierData *tmmd = (NgonInterpModifierData*) target;
-	
-	tmmd->resolution = mmd->resolution;
-}
-
-static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
-						DerivedMesh *derivedData,
-						int UNUSED(useRenderParams),
-						int UNUSED(isFinalCalc))
-{
-	NgonInterpModifierData *nmd= (NgonInterpModifierData *)md;
-	DerivedMesh *dm= derivedData;
-	DerivedMesh *cddm, *dummy;
-	MFace *mf;
-	MPoly *mpoly;
-	MLoop *mloop;
-	MFace *mface = NULL, *mf2;
-	MVert *mvert = NULL, *omvert;
-	BLI_array_declare(mface);
-	BLI_array_declare(mvert);
-	int *verts=NULL, *loops=NULL;
-	BLI_array_declare(verts);
-	BLI_array_declare(loops);
-	float *w = NULL, (*cos)[3] = NULL;
-	BLI_array_declare(w);
-	BLI_array_declare(cos);
-	int *origv = NULL, *origf = NULL, *of, *ov;
-	BLI_array_declare(origv);
-	BLI_array_declare(origf);
-	DerivedMesh *copy = NULL;
-	int i;
-
-	int numTex;
-	int numCol;
-	int hasWCol;
-	int hasOrigSpace;
-
-	if (nmd->resolution <= 0)
-		return dm;
-	
-	if (!CDDM_Check(dm)) {
-		dm = copy = CDDM_copy(dm);
-	}
-	
-	CDDM_recalc_tesselation(dm);
-	
-	mf = dm->getTessFaceArray(dm);
-	of = dm->getTessFaceDataArray(dm, CD_ORIGINDEX);
-	mpoly = CDDM_get_polys(dm);
-	mloop = CDDM_get_loops(dm);
-	
-	/*eek!*/
-	if (!of)
-		return dm;
-
-	/*create a dummy mesh to compute interpolated loops on*/
-	dummy = CDDM_from_template(dm, 0, 0, 0, 3, 0);
-
-	/* CustomData we check must match what is passed to mesh_loops_to_mface_corners() */
-	numTex = CustomData_number_of_layers(&dm->polyData, CD_MTEXPOLY);
-	numCol = CustomData_number_of_layers(&dummy->loopData, CD_MLOOPCOL);
-	hasWCol = CustomData_has_layer(&dummy->loopData, CD_WEIGHT_MLOOPCOL);
-	hasOrigSpace = CustomData_has_layer(&dummy->loopData, CD_ORIGSPACE_MLOOP);
-
-	/*copy original verts here, so indices stay correct*/
-	omvert = dm->getVertArray(dm);
-	ov = dm->getVertDataArray(dm, CD_ORIGINDEX);
-	for (i=0; i<dm->numVertData; i++) {
-		BLI_array_append(mvert, omvert[i]);
-		BLI_array_append(origv, ov ? ov[i] : i);
-	}
-	
-	for (i=0; i<dm->numTessFaceData; i++, mf++, of++) {
-		int x, y, x2;
-		float fac;
-		
-		BLI_array_empty(verts);
-		
-#define NG_MAKE_VERT(orig)\
-		BLI_array_append(mvert, omvert[orig]);\
-		BLI_array_append(origv, ov ? ov[orig] : orig);\
-		BLI_array_append(verts, BLI_array_count(mvert)-1);
-
-#define NG_MAKE_VERTCO(orig, coord) NG_MAKE_VERT(orig); copy_v3_v3(mvert[BLI_array_count(mvert)-1].co, coord)
-
-		y = 0;
-		fac = 1.0f / (float)(nmd->resolution + 1);
-		for (x=0; x<nmd->resolution+2; x++) {
-			float co1[3], co2[3], co3[3];
-			
-			sub_v3_v3v3(co1, omvert[mf->v1].co, omvert[mf->v3].co);
-			sub_v3_v3v3(co2, omvert[mf->v2].co, omvert[mf->v3].co);
-			
-			mul_v3_fl(co1, 1.0f - fac*x);
-			mul_v3_fl(co2, 1.0f - fac*x);
-			
-			add_v3_v3(co1, omvert[mf->v3].co);
-			add_v3_v3(co2, omvert[mf->v3].co);
-
-			if (x == 0) {
-				BLI_array_append(verts, mf->v1);
-			} else if (x == nmd->resolution+1) {
-				BLI_array_append(verts, mf->v3);
-			} else {
-				NG_MAKE_VERTCO(mf->v1, co1);
-			}
-			
-			for (x2=0; x2<(nmd->resolution-x); x2++) {
-				sub_v3_v3v3(co3, co1, co2);
-				mul_v3_fl(co3, 1.0f - (1.0f/(float)(nmd->resolution-x+1))*(x2+1));
-				add_v3_v3(co3, co2);
-				
-				NG_MAKE_VERTCO(mf->v2, co3);
-			}
-			
-			if (x == 0) {
-				BLI_array_append(verts, mf->v2);
-			} else if (x != nmd->resolution+1) {
-				NG_MAKE_VERTCO(mf->v1, co2);
-			}
-		}
-		
-		y = 0;
-		for (x=0; x<BLI_array_count(verts)-2; x++) {
-			int v1, v2, v3;
-			
-			if (x2 == nmd->resolution-y+1) {
-				x2 = 0;
-				y++;
-				continue;
-			} else {
-				/*int lindex[3] = {0, 1, 2};*/ /*UNUSED*/
-				
-				v1 = verts[x];
-				v2 = verts[x+1];
-				v3 = verts[x+(nmd->resolution-y)+2];
-				
-				BLI_array_growone(mface);
-				BLI_array_growone(origf);
-				
-				/*make first face*/
-				origf[BLI_array_count(origf)-1] = *of;
-				mf2 = mface + BLI_array_count(mface)-1;
-				*mf2 = *mf;
-				
-				mf2->v1 = v1;
-				mf2->v2 = v2;
-				mf2->v3 = v3;
-				mf2->v4 = 0;
-				
-				if (x2 != nmd->resolution-y) {
-					/*make second face*/
-					BLI_array_growone(mface);
-					BLI_array_growone(origf);
-					
-					origf[BLI_array_count(origf)-1] = *of;
-					mf2 = mface + BLI_array_count(mface)-1;
-					*mf2 = *mf;
-					
-					mf2->v1 = verts[x+(nmd->resolution-y)+3];
-					mf2->v2 = v3;
-					mf2->v3 = v2;
-					mf2->v4 = 0;
-				}
-			}
-			
-			x2++;
-		}
-	}
-		
-	cddm = CDDM_from_template(dm, BLI_array_count(mvert), dm->numEdgeData, BLI_array_count(mface), 0, 0);
-	
-	mf2 = mface;

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list