diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-13 15:17:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-13 15:17:21 +0300 |
commit | e5be23c141a4d5e857cd1d08b9a5151f4eb74d9e (patch) | |
tree | ceafa7a10f244d8a52149877992e7d3720651f3d /source/blender/blenkernel/intern/modifier.c | |
parent | 3c888b63f0e7dfeff5003a80857a0285b29395c1 (diff) |
check if the layer exists rather then getting the array.
Diffstat (limited to 'source/blender/blenkernel/intern/modifier.c')
-rw-r--r-- | source/blender/blenkernel/intern/modifier.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 2985eb7774b..7fffd7fc223 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -3617,7 +3617,7 @@ static void get_texture_coords(DisplaceModifierData *dmd, Object *ob, /* UVs need special handling, since they come from faces */ if(texmapping == MOD_DISP_MAP_UV) { - if(dm->getFaceDataArray(dm, CD_MTFACE)) { + if(CustomData_has_layer(&dm->faceData, CD_MTFACE)) { MFace *mface = dm->getFaceArray(dm); MFace *mf; char *done = MEM_callocN(sizeof(*done) * numVerts, @@ -3699,8 +3699,8 @@ static void get_texture_value(Tex *texture, float *tex_co, TexResult *texres) * if the texture didn't give an RGB value, copy the intensity across */ if(result_type & TEX_RGB) - texres->tin = (0.35 * texres->tr + 0.45 * texres->tg - + 0.2 * texres->tb); + texres->tin = (0.35f * texres->tr + 0.45f * texres->tg + + 0.2f * texres->tb); else texres->tr = texres->tg = texres->tb = texres->tin; } @@ -3924,7 +3924,8 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd, if(num_projectors == 0) return dm; /* make sure there are UV layers available */ - if(!dm->getFaceDataArray(dm, CD_MTFACE)) return dm; + + if(!CustomData_has_layer(&dm->faceData, CD_MTFACE)) return dm; /* make sure we're using an existing layer */ validate_layer_name(&dm->faceData, CD_MTFACE, umd->uvlayer_name, uvname); @@ -5185,7 +5186,7 @@ static void wavemod_get_texture_coords(WaveModifierData *wmd, Object *ob, /* UVs need special handling, since they come from faces */ if(texmapping == MOD_WAV_MAP_UV) { - if(dm->getFaceDataArray(dm, CD_MTFACE)) { + if(CustomData_has_layer(&dm->faceData, CD_MTFACE)) { MFace *mface = dm->getFaceArray(dm); MFace *mf; char *done = MEM_callocN(sizeof(*done) * numVerts, |