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_main_api.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_main_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index d8169e529aa..673f7acbd6a 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -74,6 +74,7 @@
#include "BKE_lattice.h"
#include "BKE_mball.h"
#include "BKE_world.h"
+#include "BKE_particle.h"
#include "BKE_paint.h"
#include "BKE_font.h"
#include "BKE_node.h"
@@ -99,6 +100,7 @@
#include "DNA_lattice_types.h"
#include "DNA_meta_types.h"
#include "DNA_world_types.h"
+#include "DNA_particle_types.h"
#include "DNA_vfont_types.h"
#include "DNA_node_types.h"
#include "DNA_movieclip_types.h"
@@ -442,6 +444,13 @@ static bAction *rna_Main_actions_new(Main *bmain, const char *name)
return act;
}
+static ParticleSettings *rna_Main_particles_new(Main *bmain, const char *name)
+{
+ ParticleSettings *part = psys_new_settings(name, bmain);
+ id_us_min(&part->id);
+ return part;
+}
+
static Palette *rna_Main_palettes_new(Main *bmain, const char *name)
{
Palette *palette = BKE_palette_add(bmain, name);
@@ -520,6 +529,7 @@ RNA_MAIN_ID_TAG_FUNCS_DEF(speakers, speaker, ID_SPK)
RNA_MAIN_ID_TAG_FUNCS_DEF(sounds, sound, ID_SO)
RNA_MAIN_ID_TAG_FUNCS_DEF(armatures, armature, ID_AR)
RNA_MAIN_ID_TAG_FUNCS_DEF(actions, action, ID_AC)
+RNA_MAIN_ID_TAG_FUNCS_DEF(particles, particle, ID_PA)
RNA_MAIN_ID_TAG_FUNCS_DEF(palettes, palettes, ID_PAL)
RNA_MAIN_ID_TAG_FUNCS_DEF(gpencil, gpencil, ID_GD)
RNA_MAIN_ID_TAG_FUNCS_DEF(movieclips, movieclip, ID_MC)
@@ -1468,6 +1478,42 @@ void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_actions_is_updated_get", NULL);
}
+void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+ FunctionRNA *func;
+ PropertyRNA *parm;
+ PropertyRNA *prop;
+
+ RNA_def_property_srna(cprop, "BlendDataParticles");
+ srna = RNA_def_struct(brna, "BlendDataParticles", NULL);
+ RNA_def_struct_sdna(srna, "Main");
+ RNA_def_struct_ui_text(srna, "Main Particle Settings", "Collection of particle settings");
+
+ func = RNA_def_function(srna, "new", "rna_Main_particles_new");
+ RNA_def_function_ui_description(func, "Add a new particle settings instance to the main database");
+ parm = RNA_def_string(func, "name", "ParticleSettings", 0, "", "New name for the data-block");
+ RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
+ /* return type */
+ parm = RNA_def_pointer(func, "particle", "ParticleSettings", "", "New particle settings data-block");
+ RNA_def_function_return(func, parm);
+
+ func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_ui_description(func, "Remove a particle settings instance from the current blendfile");
+ parm = RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove");
+ RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
+ RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
+ RNA_def_boolean(func, "do_unlink", true, "", "Unlink all usages of those particle settings before deleting them");
+
+ func = RNA_def_function(srna, "tag", "rna_Main_particles_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
+ RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
+
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_boolean_funcs(prop, "rna_Main_particles_is_updated_get", NULL);
+}
void RNA_def_main_palettes(BlenderRNA *brna, PropertyRNA *cprop)
{