Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesrna/intern/rna_particle.c')
-rw-r--r--source/blender/makesrna/intern/rna_particle.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index e4bddd1f3c7..d9ef30d6f7f 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -212,9 +212,9 @@ static void rna_ParticleHairKey_location_object_get(PointerRNA *ptr, float *valu
if (pa) {
Mesh *hair_mesh = (psmd->psys->flag & PSYS_HAIR_DYNAMICS) ? psmd->psys->hair_out_mesh : NULL;
-
+ const MVert *vertices = BKE_mesh_vertices(hair_mesh);
if (hair_mesh) {
- MVert *mvert = &hair_mesh->mvert[pa->hair_index + (hkey - pa->hair)];
+ const MVert *mvert = &vertices[pa->hair_index + (hkey - pa->hair)];
copy_v3_v3(values, mvert->co);
}
else {
@@ -279,8 +279,8 @@ static void hair_key_location_object_set(HairKey *hair_key,
if (hair_key_index == -1) {
return;
}
-
- MVert *mvert = &hair_mesh->mvert[particle->hair_index + (hair_key_index)];
+ MVert *vertices = BKE_mesh_vertices_for_write(hair_mesh);
+ MVert *mvert = &vertices[particle->hair_index + (hair_key_index)];
copy_v3_v3(mvert->co, src_co);
return;
}
@@ -324,7 +324,8 @@ static void rna_ParticleHairKey_co_object(HairKey *hairkey,
NULL;
if (particle) {
if (hair_mesh) {
- MVert *mvert = &hair_mesh->mvert[particle->hair_index + (hairkey - particle->hair)];
+ const MVert *vertices = BKE_mesh_vertices(hair_mesh);
+ const MVert *mvert = &vertices[particle->hair_index + (hairkey - particle->hair)];
copy_v3_v3(n_co, mvert->co);
}
else {
@@ -402,8 +403,8 @@ static void rna_Particle_uv_on_emitter(ParticleData *particle,
MFace *mface;
MTFace *mtface;
- mface = modifier->mesh_final->mface;
- mtface = modifier->mesh_final->mtface;
+ mface = CustomData_get_layer(&modifier->mesh_final->fdata, CD_MFACE);
+ mtface = CustomData_get_layer(&modifier->mesh_final->fdata, CD_MTFACE);
if (mface && mtface) {
mtface += num;
@@ -567,7 +568,7 @@ static int rna_ParticleSystem_tessfaceidx_on_emitter(ParticleSystem *particlesys
}
else if (part->from == PART_FROM_VERT) {
if (num != DMCACHE_NOTFOUND && num < totvert) {
- MFace *mface = modifier->mesh_final->mface;
+ MFace *mface = CustomData_get_layer(&modifier->mesh_final->fdata, CD_MFACE);
*r_fuv = &particle->fuv;
@@ -610,7 +611,7 @@ static int rna_ParticleSystem_tessfaceidx_on_emitter(ParticleSystem *particlesys
}
else if (part->from == PART_FROM_VERT) {
if (num != DMCACHE_NOTFOUND && num < totvert) {
- MFace *mface = modifier->mesh_final->mface;
+ MFace *mface = CustomData_get_layer(&modifier->mesh_final->fdata, CD_MFACE);
*r_fuv = &parent->fuv;
@@ -660,7 +661,8 @@ static void rna_ParticleSystem_uv_on_emitter(ParticleSystem *particlesystem,
zero_v2(r_uv);
}
else {
- MFace *mface = &modifier->mesh_final->mface[num];
+ MFace *mfaces = CustomData_get_layer(&modifier->mesh_final->fdata, CD_MFACE);
+ MFace *mface = &mfaces[num];
const MTFace *mtface = (const MTFace *)CustomData_get_layer_n(
&modifier->mesh_final->fdata, CD_MTFACE, uv_no);
@@ -694,7 +696,8 @@ static void rna_ParticleSystem_mcol_on_emitter(ParticleSystem *particlesystem,
zero_v3(r_mcol);
}
else {
- MFace *mface = &modifier->mesh_final->mface[num];
+ MFace *mfaces = CustomData_get_layer(&modifier->mesh_final->fdata, CD_MFACE);
+ MFace *mface = &mfaces[num];
const MCol *mc = (const MCol *)CustomData_get_layer_n(
&modifier->mesh_final->fdata, CD_MCOL, vcol_no);
MCol mcol;