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
path: root/source
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2020-01-16 17:52:53 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2020-01-16 17:52:53 +0300
commit59d3e4357a9054fd65be455198051634e4b40156 (patch)
tree3d59a49e5c778e62609952f3b7b918fad5ec6b80 /source
parent7fc7df1bd3d81f7dd7440a958b420e356c2bf732 (diff)
parent216291ddb39e3460361b8bd7350878a30e34945b (diff)
Merge branch 'blender-v2.82-release'
Diffstat (limited to 'source')
-rw-r--r--source/blender/makesrna/intern/rna_particle.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 4da42eb6bba..d1cb7ad0604 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -286,6 +286,11 @@ static void rna_Particle_uv_on_emitter(ParticleData *particle,
psmd, part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, co, nor, 0, 0, sd.orco, 0);
# endif
+ if (modifier->mesh_final == NULL) {
+ BKE_report(reports, RPT_ERROR, "uv_on_emitter() requires a modifier from an evaluated object");
+ return;
+ }
+
/* get uvco & mcol */
int num = particle->num_dmcache;
int from = modifier->psys->part->from;
@@ -1763,9 +1768,14 @@ static void rna_def_particle(BlenderRNA *brna)
/* UVs */
func = RNA_def_function(srna, "uv_on_emitter", "rna_Particle_uv_on_emitter");
- RNA_def_function_ui_description(func, "Obtain uv for particle on derived mesh");
+ RNA_def_function_ui_description(func,
+ "Obtain UV coordinates for a particle on an evaluated mesh.");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm = RNA_def_pointer(func, "modifier", "ParticleSystemModifier", "", "Particle modifier");
+ parm = RNA_def_pointer(func,
+ "modifier",
+ "ParticleSystemModifier",
+ "",
+ "Particle modifier from an evaluated object");
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
parm = RNA_def_property(func, "uv", PROP_FLOAT, PROP_COORDS);
RNA_def_property_array(parm, 2);