| 
									
										
										
										
											2011-02-23 10:52:22 +00:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  |  * ***** 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 | 
					
						
							| 
									
										
										
										
											2011-11-29 10:54:47 +00:00
										 |  |  |  * of the License, or (at your option) any later version. | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2011-11-29 10:54:47 +00:00
										 |  |  |  * This program is distributed in the hope that it will be useful, | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  |  * 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 | 
					
						
							| 
									
										
										
										
											2011-11-29 10:54:47 +00:00
										 |  |  |  * along with this program; if not, write to the Free Software Foundation, | 
					
						
							| 
									
										
										
										
											2010-08-10 21:22:26 +00:00
										 |  |  |  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * The Original Code is Copyright (C) 2005 Blender Foundation. | 
					
						
							|  |  |  |  * All rights reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * The Original Code is: all of this file. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Contributor(s): Ben Batt | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * ***** END GPL LICENSE BLOCK ***** | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-25 13:57:17 +00:00
										 |  |  | /** \file blender/modifiers/intern/MOD_util.c
 | 
					
						
							|  |  |  |  *  \ingroup modifiers | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-13 15:26:37 +00:00
										 |  |  | #include <string.h>
 | 
					
						
							| 
									
										
										
										
											2010-04-12 22:33:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-04-10 14:11:45 +00:00
										 |  |  | #include "DNA_image_types.h"
 | 
					
						
							|  |  |  | #include "DNA_meshdata_types.h"
 | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  | #include "DNA_modifier_types.h"
 | 
					
						
							|  |  |  | #include "DNA_object_types.h"
 | 
					
						
							| 
									
										
										
										
											2012-04-10 14:11:45 +00:00
										 |  |  | #include "DNA_scene_types.h"
 | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-07 18:36:47 +00:00
										 |  |  | #include "BLI_utildefines.h"
 | 
					
						
							| 
									
										
										
										
											2011-05-01 15:16:59 +00:00
										 |  |  | #include "BLI_math_vector.h"
 | 
					
						
							|  |  |  | #include "BLI_math_matrix.h"
 | 
					
						
							| 
									
										
										
										
											2011-01-07 18:36:47 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  | #include "BKE_cdderivedmesh.h"
 | 
					
						
							| 
									
										
										
										
											2011-07-11 09:15:20 +00:00
										 |  |  | #include "BKE_deform.h"
 | 
					
						
							| 
									
										
										
										
											2012-04-10 14:11:45 +00:00
										 |  |  | #include "BKE_image.h"
 | 
					
						
							| 
									
										
										
										
											2011-07-11 09:15:20 +00:00
										 |  |  | #include "BKE_lattice.h"
 | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  | #include "BKE_mesh.h"
 | 
					
						
							| 
									
										
										
										
											2011-01-07 19:18:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-25 01:10:03 +00:00
										 |  |  | #include "BKE_modifier.h"
 | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-12 22:33:43 +00:00
										 |  |  | #include "MOD_util.h"
 | 
					
						
							| 
									
										
										
										
											2010-04-25 01:10:03 +00:00
										 |  |  | #include "MOD_modifiertypes.h"
 | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-12 22:33:43 +00:00
										 |  |  | #include "MEM_guardedalloc.h"
 | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-01-30 13:06:48 +01:00
										 |  |  | #ifdef OPENNL_THREADING_HACK
 | 
					
						
							|  |  |  | #include "BLI_threads.h"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-04-10 14:11:45 +00:00
										 |  |  | void modifier_init_texture(Scene *scene, Tex *tex) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	if (!tex) | 
					
						
							|  |  |  | 		return; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-01-14 04:59:58 +11:00
										 |  |  | 	if (tex->ima && BKE_image_is_animated(tex->ima)) { | 
					
						
							| 
									
										
										
										
											2012-05-05 16:03:57 +00:00
										 |  |  | 		BKE_image_user_frame_calc(&tex->iuser, scene->r.cfra, 0); | 
					
						
							| 
									
										
										
										
											2014-01-14 04:59:58 +11:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2012-04-10 14:11:45 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-05-01 15:16:59 +00:00
										 |  |  | void get_texture_coords(MappingInfoModifierData *dmd, Object *ob, | 
					
						
							|  |  |  |                         DerivedMesh *dm, | 
					
						
							|  |  |  |                         float (*co)[3], float (*texco)[3], | 
					
						
							|  |  |  |                         int numVerts) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	int i; | 
					
						
							|  |  |  | 	int texmapping = dmd->texmapping; | 
					
						
							|  |  |  | 	float mapob_imat[4][4]; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-24 06:24:53 +00:00
										 |  |  | 	if (texmapping == MOD_DISP_MAP_OBJECT) { | 
					
						
							|  |  |  | 		if (dmd->map_object) | 
					
						
							| 
									
										
										
										
											2011-05-01 15:16:59 +00:00
										 |  |  | 			invert_m4_m4(mapob_imat, dmd->map_object->obmat); | 
					
						
							|  |  |  | 		else /* if there is no map object, default to local */ | 
					
						
							|  |  |  | 			texmapping = MOD_DISP_MAP_LOCAL; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* UVs need special handling, since they come from faces */ | 
					
						
							| 
									
										
										
										
											2012-03-24 06:24:53 +00:00
										 |  |  | 	if (texmapping == MOD_DISP_MAP_UV) { | 
					
						
							|  |  |  | 		if (CustomData_has_layer(&dm->loopData, CD_MLOOPUV)) { | 
					
						
							| 
									
										
										
										
											2012-01-04 21:36:06 +00:00
										 |  |  | 			MPoly *mpoly = dm->getPolyArray(dm); | 
					
						
							|  |  |  | 			MPoly *mp; | 
					
						
							|  |  |  | 			MLoop *mloop = dm->getLoopArray(dm); | 
					
						
							| 
									
										
										
										
											2011-05-01 15:16:59 +00:00
										 |  |  | 			char *done = MEM_callocN(sizeof(*done) * numVerts, | 
					
						
							|  |  |  | 			                         "get_texture_coords done"); | 
					
						
							| 
									
										
										
										
											2012-01-04 21:36:06 +00:00
										 |  |  | 			int numPolys = dm->getNumPolys(dm); | 
					
						
							| 
									
										
										
										
											2012-01-11 08:51:06 +00:00
										 |  |  | 			char uvname[MAX_CUSTOMDATA_LAYER_NAME]; | 
					
						
							| 
									
										
										
										
											2012-01-04 21:36:06 +00:00
										 |  |  | 			MLoopUV *mloop_uv; | 
					
						
							| 
									
										
										
										
											2011-05-01 15:16:59 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-01-04 21:36:06 +00:00
										 |  |  | 			CustomData_validate_layer_name(&dm->loopData, CD_MLOOPUV, dmd->uvlayer_name, uvname); | 
					
						
							|  |  |  | 			mloop_uv = CustomData_get_layer_named(&dm->loopData, CD_MLOOPUV, uvname); | 
					
						
							| 
									
										
										
										
											2011-05-01 15:16:59 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 			/* verts are given the UV from the first face that uses them */ | 
					
						
							| 
									
										
										
										
											2012-03-24 06:24:53 +00:00
										 |  |  | 			for (i = 0, mp = mpoly; i < numPolys; ++i, ++mp) { | 
					
						
							| 
									
										
										
										
											2012-05-06 13:38:33 +00:00
										 |  |  | 				unsigned int fidx = mp->totloop - 1; | 
					
						
							| 
									
										
										
										
											2012-01-04 06:20:10 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 				do { | 
					
						
							| 
									
										
										
										
											2012-05-06 13:38:33 +00:00
										 |  |  | 					unsigned int lidx = mp->loopstart + fidx; | 
					
						
							|  |  |  | 					unsigned int vidx = mloop[lidx].v; | 
					
						
							| 
									
										
										
										
											2012-01-04 06:20:10 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 					if (done[vidx] == 0) { | 
					
						
							|  |  |  | 						/* remap UVs from [0, 1] to [-1, 1] */ | 
					
						
							| 
									
										
										
										
											2012-01-04 21:36:06 +00:00
										 |  |  | 						texco[vidx][0] = (mloop_uv[lidx].uv[0] * 2.0f) - 1.0f; | 
					
						
							|  |  |  | 						texco[vidx][1] = (mloop_uv[lidx].uv[1] * 2.0f) - 1.0f; | 
					
						
							| 
									
										
										
										
											2012-01-04 06:20:10 +00:00
										 |  |  | 						done[vidx] = 1; | 
					
						
							|  |  |  | 					} | 
					
						
							| 
									
										
										
										
											2011-05-01 15:16:59 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-01-04 06:20:10 +00:00
										 |  |  | 				} while (fidx--); | 
					
						
							| 
									
										
										
										
											2011-05-01 15:16:59 +00:00
										 |  |  | 			} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			MEM_freeN(done); | 
					
						
							|  |  |  | 			return; | 
					
						
							| 
									
										
										
										
											2012-03-24 06:24:53 +00:00
										 |  |  | 		} | 
					
						
							|  |  |  | 		else /* if there are no UVs, default to local */ | 
					
						
							| 
									
										
										
										
											2011-05-01 15:16:59 +00:00
										 |  |  | 			texmapping = MOD_DISP_MAP_LOCAL; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-24 06:24:53 +00:00
										 |  |  | 	for (i = 0; i < numVerts; ++i, ++co, ++texco) { | 
					
						
							| 
									
										
										
										
											2012-04-28 06:31:57 +00:00
										 |  |  | 		switch (texmapping) { | 
					
						
							| 
									
										
										
										
											2012-05-06 13:38:33 +00:00
										 |  |  | 			case MOD_DISP_MAP_LOCAL: | 
					
						
							|  |  |  | 				copy_v3_v3(*texco, *co); | 
					
						
							|  |  |  | 				break; | 
					
						
							|  |  |  | 			case MOD_DISP_MAP_GLOBAL: | 
					
						
							|  |  |  | 				mul_v3_m4v3(*texco, ob->obmat, *co); | 
					
						
							|  |  |  | 				break; | 
					
						
							|  |  |  | 			case MOD_DISP_MAP_OBJECT: | 
					
						
							|  |  |  | 				mul_v3_m4v3(*texco, ob->obmat, *co); | 
					
						
							|  |  |  | 				mul_m4_v3(mapob_imat, *texco); | 
					
						
							|  |  |  | 				break; | 
					
						
							| 
									
										
										
										
											2011-05-01 15:16:59 +00:00
										 |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  | void modifier_vgroup_cache(ModifierData *md, float (*vertexCos)[3]) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2012-05-06 13:38:33 +00:00
										 |  |  | 	while ((md = md->next) && md->type == eModifierType_Armature) { | 
					
						
							|  |  |  | 		ArmatureModifierData *amd = (ArmatureModifierData *) md; | 
					
						
							|  |  |  | 		if (amd->multi && amd->prevCos == NULL) | 
					
						
							|  |  |  | 			amd->prevCos = MEM_dupallocN(vertexCos); | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  | 		else | 
					
						
							|  |  |  | 			break; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	/* lattice/mesh modifier too */ | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* returns a cdderivedmesh if dm == NULL or is another type of derivedmesh */ | 
					
						
							| 
									
										
										
										
											2013-07-16 08:24:53 +00:00
										 |  |  | DerivedMesh *get_cddm(Object *ob, struct BMEditMesh *em, DerivedMesh *dm, float (*vertexCos)[3], bool use_normals) | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-07-16 08:24:53 +00:00
										 |  |  | 	if (dm) { | 
					
						
							|  |  |  | 		if (dm->type != DM_TYPE_CDDM) { | 
					
						
							|  |  |  | 			dm = CDDM_copy(dm); | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2015-01-30 12:48:49 +01:00
										 |  |  | 		CDDM_apply_vert_coords(dm, vertexCos); | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-07-16 08:24:53 +00:00
										 |  |  | 		if (use_normals) { | 
					
						
							|  |  |  | 			DM_ensure_normals(dm); | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2013-07-16 08:24:53 +00:00
										 |  |  | 		dm = get_dm(ob, em, dm, vertexCos, use_normals, false); | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return dm; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* returns a derived mesh if dm == NULL, for deforming modifiers that need it */ | 
					
						
							| 
									
										
										
										
											2013-07-16 08:24:53 +00:00
										 |  |  | DerivedMesh *get_dm(Object *ob, struct BMEditMesh *em, DerivedMesh *dm, | 
					
						
							|  |  |  |                     float (*vertexCos)[3], bool use_normals, bool use_orco) | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-07-16 08:24:53 +00:00
										 |  |  | 	if (dm) { | 
					
						
							|  |  |  | 		/* pass */ | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else if (ob->type == OB_MESH) { | 
					
						
							| 
									
										
										
										
											2014-01-23 14:50:50 +01:00
										 |  |  | 		if (em) dm = CDDM_from_editbmesh(em, false, false); | 
					
						
							| 
									
										
										
										
											2013-12-26 08:26:41 +11:00
										 |  |  | 		else dm = CDDM_from_mesh((struct Mesh *)(ob->data)); | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-24 06:24:53 +00:00
										 |  |  | 		if (vertexCos) { | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  | 			CDDM_apply_vert_coords(dm, vertexCos); | 
					
						
							| 
									
										
										
										
											2013-05-30 17:36:43 +00:00
										 |  |  | 			dm->dirty |= DM_DIRTY_NORMALS; | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  | 		} | 
					
						
							|  |  |  | 		 | 
					
						
							| 
									
										
										
										
											2013-07-16 08:24:53 +00:00
										 |  |  | 		if (use_orco) { | 
					
						
							| 
									
										
										
										
											2012-05-05 21:28:12 +00:00
										 |  |  | 			DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, BKE_mesh_orco_verts_get(ob)); | 
					
						
							| 
									
										
										
										
											2013-07-16 08:24:53 +00:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2014-07-20 01:30:29 +10:00
										 |  |  | 	else if (ELEM(ob->type, OB_FONT, OB_CURVE, OB_SURF)) { | 
					
						
							| 
									
										
										
										
											2012-05-06 13:38:33 +00:00
										 |  |  | 		dm = CDDM_from_curve(ob); | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-07-16 08:24:53 +00:00
										 |  |  | 	if (use_normals) { | 
					
						
							|  |  |  | 		if (LIKELY(dm)) { | 
					
						
							|  |  |  | 			DM_ensure_normals(dm); | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-11 22:12:30 +00:00
										 |  |  | 	return dm; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2010-04-25 01:10:03 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-12-26 17:24:42 +06:00
										 |  |  | /* Get derived mesh for other object, which is used as an operand for the modifier,
 | 
					
						
							|  |  |  |  * i.e. second operand for boolean modifier. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | DerivedMesh *get_dm_for_modifier(Object *ob, ModifierApplyFlag flag) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	if (flag & MOD_APPLY_RENDER) { | 
					
						
							|  |  |  | 		/* TODO(sergey): Use proper derived render in the future. */ | 
					
						
							|  |  |  | 		return ob->derivedFinal; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							|  |  |  | 		return ob->derivedFinal; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-07-11 09:15:20 +00:00
										 |  |  | void modifier_get_vgroup(Object *ob, DerivedMesh *dm, const char *name, MDeformVert **dvert, int *defgrp_index) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	*defgrp_index = defgroup_name_index(ob, name); | 
					
						
							|  |  |  | 	*dvert = NULL; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-22 17:19:05 +00:00
										 |  |  | 	if (*defgrp_index != -1) { | 
					
						
							| 
									
										
										
										
											2012-03-24 06:24:53 +00:00
										 |  |  | 		if (ob->type == OB_LATTICE) | 
					
						
							| 
									
										
										
										
											2012-05-05 16:03:57 +00:00
										 |  |  | 			*dvert = BKE_lattice_deform_verts_get(ob); | 
					
						
							| 
									
										
										
										
											2012-03-24 06:24:53 +00:00
										 |  |  | 		else if (dm) | 
					
						
							| 
									
										
										
										
											2011-07-11 09:15:20 +00:00
										 |  |  | 			*dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-01-30 13:06:48 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #ifdef OPENNL_THREADING_HACK
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static ThreadMutex opennl_context_mutex = BLI_MUTEX_INITIALIZER; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void modifier_opennl_lock(void) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	BLI_mutex_lock(&opennl_context_mutex); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void modifier_opennl_unlock(void) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	BLI_mutex_unlock(&opennl_context_mutex); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-25 01:10:03 +00:00
										 |  |  | /* only called by BKE_modifier.h/modifier.c */ | 
					
						
							| 
									
										
										
										
											2010-10-14 06:29:17 +00:00
										 |  |  | void modifier_type_init(ModifierTypeInfo *types[]) | 
					
						
							| 
									
										
										
										
											2010-04-25 01:10:03 +00:00
										 |  |  | { | 
					
						
							|  |  |  | #define INIT_TYPE(typeName) (types[eModifierType_##typeName] = &modifierType_##typeName)
 | 
					
						
							|  |  |  | 	INIT_TYPE(None); | 
					
						
							|  |  |  | 	INIT_TYPE(Curve); | 
					
						
							|  |  |  | 	INIT_TYPE(Lattice); | 
					
						
							|  |  |  | 	INIT_TYPE(Subsurf); | 
					
						
							|  |  |  | 	INIT_TYPE(Build); | 
					
						
							|  |  |  | 	INIT_TYPE(Array); | 
					
						
							|  |  |  | 	INIT_TYPE(Mirror); | 
					
						
							|  |  |  | 	INIT_TYPE(EdgeSplit); | 
					
						
							|  |  |  | 	INIT_TYPE(Bevel); | 
					
						
							|  |  |  | 	INIT_TYPE(Displace); | 
					
						
							|  |  |  | 	INIT_TYPE(UVProject); | 
					
						
							|  |  |  | 	INIT_TYPE(Decimate); | 
					
						
							|  |  |  | 	INIT_TYPE(Smooth); | 
					
						
							|  |  |  | 	INIT_TYPE(Cast); | 
					
						
							|  |  |  | 	INIT_TYPE(Wave); | 
					
						
							|  |  |  | 	INIT_TYPE(Armature); | 
					
						
							|  |  |  | 	INIT_TYPE(Hook); | 
					
						
							|  |  |  | 	INIT_TYPE(Softbody); | 
					
						
							|  |  |  | 	INIT_TYPE(Cloth); | 
					
						
							|  |  |  | 	INIT_TYPE(Collision); | 
					
						
							|  |  |  | 	INIT_TYPE(Boolean); | 
					
						
							|  |  |  | 	INIT_TYPE(MeshDeform); | 
					
						
							| 
									
										
										
										
											2011-11-13 12:17:27 +00:00
										 |  |  | 	INIT_TYPE(Ocean); | 
					
						
							| 
									
										
										
										
											2010-04-25 01:10:03 +00:00
										 |  |  | 	INIT_TYPE(ParticleSystem); | 
					
						
							|  |  |  | 	INIT_TYPE(ParticleInstance); | 
					
						
							|  |  |  | 	INIT_TYPE(Explode); | 
					
						
							|  |  |  | 	INIT_TYPE(Shrinkwrap); | 
					
						
							|  |  |  | 	INIT_TYPE(Fluidsim); | 
					
						
							|  |  |  | 	INIT_TYPE(Mask); | 
					
						
							|  |  |  | 	INIT_TYPE(SimpleDeform); | 
					
						
							|  |  |  | 	INIT_TYPE(Multires); | 
					
						
							|  |  |  | 	INIT_TYPE(Surface); | 
					
						
							|  |  |  | 	INIT_TYPE(Smoke); | 
					
						
							|  |  |  | 	INIT_TYPE(ShapeKey); | 
					
						
							|  |  |  | 	INIT_TYPE(Solidify); | 
					
						
							|  |  |  | 	INIT_TYPE(Screw); | 
					
						
							| 
									
										
										
										
											2011-05-01 15:16:59 +00:00
										 |  |  | 	INIT_TYPE(Warp); | 
					
						
							| 
									
										
										
										
											2011-07-25 15:27:01 +00:00
										 |  |  | 	INIT_TYPE(WeightVGEdit); | 
					
						
							|  |  |  | 	INIT_TYPE(WeightVGMix); | 
					
						
							|  |  |  | 	INIT_TYPE(WeightVGProximity); | 
					
						
							| 
									
										
										
										
											2011-05-24 07:08:58 +00:00
										 |  |  | 	INIT_TYPE(DynamicPaint); | 
					
						
							| 
									
										
										
										
											2011-12-30 21:11:40 +00:00
										 |  |  | 	INIT_TYPE(Remesh); | 
					
						
							| 
									
										
										
										
											2012-05-22 15:29:01 +00:00
										 |  |  | 	INIT_TYPE(Skin); | 
					
						
							| 
									
										
										
										
											2012-10-24 10:39:11 +00:00
										 |  |  | 	INIT_TYPE(LaplacianSmooth); | 
					
						
							| 
									
										
										
										
											2012-11-19 20:40:08 +00:00
										 |  |  | 	INIT_TYPE(Triangulate); | 
					
						
							| 
									
										
										
										
											2012-12-14 04:07:30 +00:00
										 |  |  | 	INIT_TYPE(UVWarp); | 
					
						
							| 
									
										
										
										
											2013-01-21 15:41:00 +00:00
										 |  |  | 	INIT_TYPE(MeshCache); | 
					
						
							| 
									
										
										
										
											2013-11-24 07:00:49 +11:00
										 |  |  | 	INIT_TYPE(LaplacianDeform); | 
					
						
							| 
									
										
										
										
											2013-12-22 07:08:35 +11:00
										 |  |  | 	INIT_TYPE(Wireframe); | 
					
						
							| 
									
										
										
										
											2015-01-09 21:19:12 +01:00
										 |  |  | 	INIT_TYPE(DataTransfer); | 
					
						
							| 
									
										
										
										
											2010-04-25 01:10:03 +00:00
										 |  |  | #undef INIT_TYPE
 | 
					
						
							|  |  |  | } |