diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_particle.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_particle.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 3fc98d769b6..40e7f6e65c2 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -212,10 +212,10 @@ 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 *verts = BKE_mesh_verts(hair_mesh); if (hair_mesh) { - MVert *mvert = &hair_mesh->mvert[pa->hair_index + (hkey - pa->hair)]; - copy_v3_v3(values, mvert->co); + const MVert *mv = &verts[pa->hair_index + (hkey - pa->hair)]; + copy_v3_v3(values, mv->co); } else { float hairmat[4][4]; @@ -279,9 +279,9 @@ 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)]; - copy_v3_v3(mvert->co, src_co); + MVert *verts = BKE_mesh_verts_for_write(hair_mesh); + MVert *mv = &verts[particle->hair_index + (hair_key_index)]; + copy_v3_v3(mv->co, src_co); return; } @@ -324,8 +324,9 @@ 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)]; - copy_v3_v3(n_co, mvert->co); + const MVert *verts = BKE_mesh_verts(hair_mesh); + const MVert *mv = &verts[particle->hair_index + (hairkey - particle->hair)]; + copy_v3_v3(n_co, mv->co); } else { float hairmat[4][4]; @@ -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; @@ -1044,7 +1047,7 @@ static float rna_PartSetting_linelenhead_get(struct PointerRNA *ptr) return settings->draw_line[1]; } -static int rna_PartSettings_is_fluid_get(PointerRNA *ptr) +static bool rna_PartSettings_is_fluid_get(PointerRNA *ptr) { ParticleSettings *part = ptr->data; return (ELEM(part->type, @@ -2686,6 +2689,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop = RNA_def_property(srna, "use_parent_particles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_PARENT); RNA_def_property_ui_text(prop, "Parents", "Render parent particles"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_PARTICLESETTINGS); RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop = RNA_def_property(srna, "show_number", PROP_BOOLEAN, PROP_NONE); |