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:
authorBastien Montagne <montagne29@wanadoo.fr>2016-03-14 23:04:30 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-03-14 23:04:30 +0300
commita078fe35396a34c8f6440e22c37a3b27e0c1f61a (patch)
treedd498f7ce1daaf77940b38c015e608937d40a853 /source/blender/editors/physics/particle_object.c
parent00166ff62e689b7caebdd3a0c4f9051b2739826a (diff)
Fix T47750: Edited hair: disconnect (and connect!) operator do not support redo.
As suggested by Sergey, do not register those anymore, this way we keep undo step, but user cannot 'redo' them (does not work, since cached DM in particle modifier data is not yet re-created by depsgraph update after undo when operator is redone). UI now has two buttons, one to (dic)connect current psys, the other to (dis)connect all. Also fixed similar issue with Connect Hair op.
Diffstat (limited to 'source/blender/editors/physics/particle_object.c')
-rw-r--r--source/blender/editors/physics/particle_object.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c
index 7aa4c245f11..1297133e1a2 100644
--- a/source/blender/editors/physics/particle_object.c
+++ b/source/blender/editors/physics/particle_object.c
@@ -649,7 +649,7 @@ void PARTICLE_OT_disconnect_hair(wmOperatorType *ot)
ot->exec = disconnect_hair_exec;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO; /* No REGISTER, redo does not work due to missing update, see T47750. */
RNA_def_boolean(ot->srna, "all", 0, "All hair", "Disconnect all hair systems from the emitter mesh");
}
@@ -862,7 +862,6 @@ static int connect_hair_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
Object *ob= ED_object_context(C);
- PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
ParticleSystem *psys= NULL;
const bool all = RNA_boolean_get(op->ptr, "all");
bool any_connected = false;
@@ -876,12 +875,13 @@ static int connect_hair_exec(bContext *C, wmOperator *op)
}
}
else {
- psys = ptr.data;
+ psys = psys_get_current(ob);
any_connected |= connect_hair(scene, ob, psys);
}
if (!any_connected) {
- BKE_report(op->reports, RPT_ERROR, "Can't disconnect hair if particle system modifier is disabled");
+ BKE_report(op->reports, RPT_WARNING,
+ "No hair connected (can't connect hair if particle system modifier is disabled)");
return OPERATOR_CANCELLED;
}
@@ -900,7 +900,7 @@ void PARTICLE_OT_connect_hair(wmOperatorType *ot)
ot->exec = connect_hair_exec;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO; /* No REGISTER, redo does not work due to missing update, see T47750. */
RNA_def_boolean(ot->srna, "all", 0, "All hair", "Connect all hair systems to the emitter mesh");
}