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:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-01-26 14:50:55 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-01-26 14:50:55 +0300
commit8126b0222d11e68b62f1d3d975ec6396b7e87af2 (patch)
tree125442ce2af8d610665f7412b34d57879e97b94c /source/blender/makesrna/intern/rna_nodetree.c
parent0095c2dad2e66a2906fd60c417c845b35a645cf7 (diff)
Fix T47214: Keyed Particles don't render correctly when used for point density input
The issue was caused by different AABB used by Cycles and texture sampler. Instead of trying to keep this two functions in sync we now do have an utility call in the point density node to query the AABB.
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 798f3cb9af3..14014186e0f 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -3100,6 +3100,22 @@ void rna_ShaderNodePointDensity_density_calc(bNode *self,
BKE_texture_pointdensity_free_data(pd);
}
+void rna_ShaderNodePointDensity_density_minmax(bNode *self,
+ Scene *scene,
+ int settings,
+ float r_min[3],
+ float r_max[3])
+{
+ NodeShaderTexPointDensity *shader_point_density = self->storage;
+ PointDensity *pd = &shader_point_density->pd;
+ if (scene == NULL) {
+ zero_v3(r_min);
+ zero_v3(r_max);
+ return;
+ }
+ RE_minmac_point_density(scene, pd, settings == 1, r_min, r_max);
+}
+
#else
static EnumPropertyItem prop_image_layer_items[] = {
@@ -4054,6 +4070,19 @@ static void def_sh_tex_pointdensity(StructRNA *srna)
prop = RNA_def_float_array(func, "rgba_values", 1, NULL, 0, 0, "", "RGBA Values", 0, 0);
RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_function_output(func, prop);
+
+ func = RNA_def_function(srna, "calc_point_density_minmax", "rna_ShaderNodePointDensity_density_minmax");
+ RNA_def_function_ui_description(func, "Calculate point density");
+ RNA_def_pointer(func, "scene", "Scene", "", "");
+ RNA_def_enum(func, "settings", calc_mode_items, 1, "", "Calculate density for rendering");
+ prop = RNA_def_property(func, "min", PROP_FLOAT, PROP_COORDS);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_flag(prop, PROP_THICK_WRAP);
+ RNA_def_function_output(func, prop);
+ prop = RNA_def_property(func, "max", PROP_FLOAT, PROP_COORDS);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_flag(prop, PROP_THICK_WRAP);
+ RNA_def_function_output(func, prop);
}
static void def_glossy(StructRNA *srna)