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:
authorLukas Tönne <lukas.toenne@gmail.com>2016-12-28 19:30:58 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2016-12-28 19:30:58 +0300
commit6ecab6dd8e48d564a2b43e0e81e79d079e8b4c77 (patch)
tree618e2d24eb34a05a81f726dd52eb2b7468e9296d /source/blender/makesrna/intern/rna_texture.c
parent605263177b8eea24c1449e4dbf0138175ec3dddf (diff)
Revert particle system and point cache removal in blender2.8 branch.
This reverts commit 5aa19be91263a249ffae75573e3b32f24269d890 and b4a721af694817fa921b119df83d33ede7d7fed0. Due to postponement of particle system rewrite it was decided to put particle code back into the 2.8 branch for the time being.
Diffstat (limited to 'source/blender/makesrna/intern/rna_texture.c')
-rw-r--r--source/blender/makesrna/intern/rna_texture.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index 959f30170f5..1e88585a286 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -35,6 +35,7 @@
#include "DNA_texture_types.h"
#include "DNA_world_types.h"
#include "DNA_node_types.h"
+#include "DNA_particle_types.h"
#include "DNA_scene_types.h" /* MAXFRAME only */
#include "BLI_utildefines.h"
@@ -252,6 +253,20 @@ void rna_TextureSlot_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
case ID_LS:
WM_main_add_notifier(NC_LINESTYLE, id);
break;
+ case ID_PA:
+ {
+ MTex *mtex = ptr->data;
+ int recalc = OB_RECALC_DATA;
+
+ if (mtex->mapto & PAMAP_INIT)
+ recalc |= PSYS_RECALC_RESET;
+ if (mtex->mapto & PAMAP_CHILD)
+ recalc |= PSYS_RECALC_CHILD;
+
+ DAG_id_tag_update(id, recalc);
+ WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL);
+ break;
+ }
}
}
@@ -421,6 +436,29 @@ static void rna_Envmap_update_generic(Main *bmain, Scene *scene, PointerRNA *ptr
rna_Texture_update(bmain, scene, ptr);
}
+static PointerRNA rna_PointDensity_psys_get(PointerRNA *ptr)
+{
+ PointDensity *pd = ptr->data;
+ Object *ob = pd->object;
+ ParticleSystem *psys = NULL;
+ PointerRNA value;
+
+ if (ob && pd->psys)
+ psys = BLI_findlink(&ob->particlesystem, pd->psys - 1);
+
+ RNA_pointer_create(&ob->id, &RNA_ParticleSystem, psys, &value);
+ return value;
+}
+
+static void rna_PointDensity_psys_set(PointerRNA *ptr, PointerRNA value)
+{
+ PointDensity *pd = ptr->data;
+ Object *ob = pd->object;
+
+ if (ob && value.id.data == ob)
+ pd->psys = BLI_findindex(&ob->particlesystem, value.data) + 1;
+}
+
static char *rna_PointDensity_path(PointerRNA *UNUSED(ptr))
{
return BLI_sprintfN("point_density");
@@ -1661,6 +1699,13 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, 0, "rna_Texture_update");
+ prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Particle System", "Particle System to render as points");
+ RNA_def_property_struct_type(prop, "ParticleSystem");
+ RNA_def_property_pointer_funcs(prop, "rna_PointDensity_psys_get", "rna_PointDensity_psys_set", NULL, NULL);
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
+
prop = RNA_def_property(srna, "particle_cache_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "psys_cache_space");
RNA_def_property_enum_items(prop, particle_cache_items);