[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42550] trunk/blender/source/blender/ modifiers/intern/MOD_hook.c: Bugfix [#29567] Second Hook Modifier fails on Curve Object

Joshua Leung aligorith at gmail.com
Sat Dec 10 04:37:44 CET 2011


Revision: 42550
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42550
Author:   aligorith
Date:     2011-12-10 03:37:37 +0000 (Sat, 10 Dec 2011)
Log Message:
-----------
Bugfix [#29567] Second Hook Modifier fails on Curve Object

This was broken in r.42515. In particular, rigs with Spline IK would break,
since they often use curves with hook modifiers controlling the control-points
of those curves.

Modified Paths:
--------------
    trunk/blender/source/blender/modifiers/intern/MOD_hook.c

Modified: trunk/blender/source/blender/modifiers/intern/MOD_hook.c
===================================================================
--- trunk/blender/source/blender/modifiers/intern/MOD_hook.c	2011-12-10 03:24:19 UTC (rev 42549)
+++ trunk/blender/source/blender/modifiers/intern/MOD_hook.c	2011-12-10 03:37:37 UTC (rev 42550)
@@ -185,22 +185,20 @@
 		const float fac_orig= hmd->force;
 		float fac;
 		const int *origindex_ar;
-
-		/* if DerivedMesh is present and has original index data,
-		* use it
-		*/
+		
+		/* if DerivedMesh is present and has original index data, use it */
 		if(dm && (origindex_ar= dm->getVertDataArray(dm, CD_ORIGINDEX))) {
 			for(i= 0, index_pt= hmd->indexar; i < hmd->totindex; i++, index_pt++) {
 				if(*index_pt < numVerts) {
 					int j;
-
+					
 					for(j = 0; j < numVerts; j++) {
 						if(origindex_ar[j] == *index_pt) {
 							float *co = vertexCos[j];
 							if((fac= hook_falloff(hmd->cent, co, falloff_squared, fac_orig))) {
 								if(dvert)
 									fac *= defvert_find_weight(dvert+j, defgrp_index);
-
+								
 								if(fac) {
 									mul_v3_m4v3(vec, mat, co);
 									interp_v3_v3v3(co, co, vec, fac);
@@ -218,7 +216,7 @@
 					if((fac= hook_falloff(hmd->cent, co, falloff_squared, fac_orig))) {
 						if(dvert)
 							fac *= defvert_find_weight(dvert+(*index_pt), defgrp_index);
-
+						
 						if(fac) {
 							mul_v3_m4v3(vec, mat, co);
 							interp_v3_v3v3(co, co, vec, fac);
@@ -230,11 +228,11 @@
 	}
 	else if(dvert) {	/* vertex group hook */
 		const float fac_orig= hmd->force;
-
+		
 		for(i = 0; i < max_dvert; i++, dvert++) {
 			float fac;
 			float *co = vertexCos[i];
-
+			
 			if((fac= hook_falloff(hmd->cent, co, falloff_squared, fac_orig))) {
 				fac *= defvert_find_weight(dvert, defgrp_index);
 				if(fac) {
@@ -251,12 +249,8 @@
                         int UNUSED(useRenderParams), int UNUSED(isFinalCalc))
 {
 	HookModifierData *hmd = (HookModifierData*) md;
-	DerivedMesh *dm = get_dm(ob, NULL, derivedData, NULL, 0);
-
-	deformVerts_do(hmd, ob, dm, vertexCos, numVerts);
-
-	if(derivedData != dm)
-		dm->release(dm);
+	
+	deformVerts_do(hmd, ob, derivedData, vertexCos, numVerts);
 }
 
 static void deformVertsEM(ModifierData *md, Object *ob, struct EditMesh *editData,




More information about the Bf-blender-cvs mailing list