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:
authorCampbell Barton <ideasman42@gmail.com>2010-01-12 16:40:29 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-01-12 16:40:29 +0300
commit70942f9a8321e27d5c7dc2036301989364f9a5aa (patch)
tree8d62610aad63da64fd0e3b74b1373f2234ec3c33 /source
parentf1a542b6b80b8a7dcce0484dd4146d2ede72831d (diff)
last commit was no good since pe_get_current was running recalc_emitter_field on mousemove and poll() functions.
run on entering particle editmode only.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_pointcache.h2
-rw-r--r--source/blender/editors/physics/particle_edit.c20
-rw-r--r--source/blender/makesrna/intern/rna_particle.c3
3 files changed, 15 insertions, 10 deletions
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h
index 4b26eaa6d76..6686d10bb31 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -213,7 +213,7 @@ typedef struct PTCacheEdit {
struct ParticleSystem *psys;
struct ParticleData *particles;
struct KDTree *emitter_field;
- float *emitter_cosnos;
+ float *emitter_cosnos; /* localspace face centers and normals (average of its verts), from the derived mesh */
int *mirror_cache;
struct ParticleCacheKey **pathcache; /* path cache (runtime) */
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index c1846c6a493..400bb05d2b4 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -194,7 +194,10 @@ ParticleEditSettings *PE_settings(Scene *scene)
return &scene->toolsettings->particle;
}
-/* always gets atleast the first particlesystem even if PSYS_CURRENT flag is not set */
+/* always gets atleast the first particlesystem even if PSYS_CURRENT flag is not set
+ *
+ * note: this function runs on poll, therefor it can runs many times a second
+ * keep it fast! */
static PTCacheEdit *pe_get_current(Scene *scene, Object *ob, int create)
{
ParticleEditSettings *pset= PE_settings(scene);
@@ -266,13 +269,8 @@ static PTCacheEdit *pe_get_current(Scene *scene, Object *ob, int create)
}
}
- if(edit) {
+ if(edit)
edit->pid = *pid;
-
- /* mesh may have changed since last entering editmode.
- * note, this may have run before if the edit data was just created, so could avoid this and speed up a little */
- recalc_emitter_field(ob, edit->psys);
- }
BLI_freelistN(&pidlist);
@@ -3909,8 +3907,14 @@ static int particle_edit_toggle_exec(bContext *C, wmOperator *op)
Object *ob= CTX_data_active_object(C);
if(!(ob->mode & OB_MODE_PARTICLE_EDIT)) {
+ PTCacheEdit *edit;
ob->mode |= OB_MODE_PARTICLE_EDIT;
- PE_create_current(scene, ob);
+ edit= PE_create_current(scene, ob);
+
+ /* mesh may have changed since last entering editmode.
+ * note, this may have run before if the edit data was just created, so could avoid this and speed up a little */
+ recalc_emitter_field(ob, edit->psys);
+
toggle_particle_cursor(C, 1);
WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_PARTICLE, NULL);
}
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 543965a337e..344ba7ef064 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -658,7 +658,8 @@ static void rna_def_particle_hair_key(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Time", "Relative time of key over hair length.");
prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_UNSIGNED);
- RNA_def_property_ui_text(prop, "Weight", "Weight for softbody simulation.");
+ RNA_def_property_range(prop, 0.0, 1.0);
+ RNA_def_property_ui_text(prop, "Weight", "Weight for cloth simulation.");
}
static void rna_def_particle_key(BlenderRNA *brna)