Point Density: Prevent crash when scene is not sent to calc_point_density()

This commit is contained in:
Sergey Sharybin 2015-11-08 10:10:55 +05:00
parent 5f95a4fb33
commit d6059e991a
1 changed files with 5 additions and 0 deletions

View File

@ -3028,6 +3028,11 @@ void rna_ShaderNodePointDensity_density_calc(bNode *self,
NodeShaderTexPointDensity *shader_point_density = self->storage;
PointDensity pd;
if (scene == NULL) {
*length = 0;
return;
}
*length = 4 * shader_point_density->resolution *
shader_point_density->resolution *
shader_point_density->resolution;