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:
authorJoshua Leung <aligorith@gmail.com>2009-10-09 13:48:04 +0400
committerJoshua Leung <aligorith@gmail.com>2009-10-09 13:48:04 +0400
commit9ebcd9c5e46c8addd80c8adb97fcee91a1916d57 (patch)
treeeff71904b7fc984a74ed8c36b3b2702fc19fb68e /source/blender/editors
parentcc4dd3f04e150613e8c160e4d58f4a557e59c63c (diff)
A few bugfixes:
* #19583: Keying Sets list issues Deleting a Keying Set (or a Keying Set Path) set the active index to 0, but that would mean that the first item would be selected but not visible. * #19590: Keyframing properties of a modifier with more than one of it's type the property will highlight in all - Modifiers now always have a unique name, so renaming a modifier should check that the name is unique. Most of the files changed in this commit were just to make sure that modifiers got unique names when they were created - Modifiers path getter was wrapped a bit wrong (missing the "s around the name) * Constraints Bugs - Constraints renaming now also makes sure the names stay unique - Fixed (or attempted to fix) compiler warnings about some enum declaration for distance constraint
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/animation/keyingsets.c9
-rw-r--r--source/blender/editors/interface/interface_templates.c2
-rw-r--r--source/blender/editors/object/object_edit.c8
-rw-r--r--source/blender/editors/object/object_hook.c1
-rw-r--r--source/blender/editors/object/object_modifier.c22
5 files changed, 30 insertions, 12 deletions
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c
index d1ac624ec6f..a044e867d56 100644
--- a/source/blender/editors/animation/keyingsets.c
+++ b/source/blender/editors/animation/keyingsets.c
@@ -177,9 +177,10 @@ static int remove_active_keyingset_exec (bContext *C, wmOperator *op)
/* free KeyingSet's data, then remove it from the scene */
BKE_keyingset_free(ks);
-
BLI_freelinkN(&scene->keyingsets, ks);
- scene->active_keyingset= 0;
+
+ /* the active one should now be the previously second-to-last one */
+ scene->active_keyingset--;
return OPERATOR_FINISHED;
}
@@ -258,8 +259,8 @@ static int remove_active_ks_path_exec (bContext *C, wmOperator *op)
BLI_freelinkN(&ks->paths, ksp);
}
- /* fix active path index */
- ks->active_path= 0;
+ /* the active path should now be the previously second-to-last active one */
+ ks->active_path--;
}
else {
BKE_report(op->reports, RPT_ERROR, "No active Keying Set Path to remove");
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index d94d2be3a94..24bff19555f 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -458,6 +458,8 @@ static void modifiers_convertToReal(bContext *C, void *ob_v, void *md_v)
nmd->mode &= ~eModifierMode_Virtual;
BLI_addhead(&ob->modifiers, nmd);
+
+ modifier_unique_name(&ob->modifiers, nmd);
ob->partype = PAROBJECT;
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 268cd3b3542..55f95f451d2 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -848,6 +848,7 @@ void special_editmenu(Scene *scene, View3D *v3d)
BooleanModifierData *bmd = NULL;
bmd = (BooleanModifierData *)modifier_new(eModifierType_Boolean);
BLI_addtail(&ob->modifiers, bmd);
+ modifier_unique_name(&ob->modifiers, bmd);
bmd->object = base_select->object;
bmd->modifier.mode |= eModifierMode_Realtime;
switch(nr){
@@ -978,9 +979,10 @@ static void object_flip_subdivison_particles(Scene *scene, Object *ob, int *set,
}
else if(depth == 0 && *set != 0) {
SubsurfModifierData *smd = (SubsurfModifierData*) modifier_new(eModifierType_Subsurf);
-
+
BLI_addtail(&ob->modifiers, smd);
-
+ modifier_unique_name(&ob->modifiers, smd);
+
if (level!=-1) {
smd->levels = level;
}
@@ -1197,6 +1199,7 @@ static void copymenu_modifiers(Scene *scene, View3D *v3d, Object *ob)
nmd = modifier_new(md->type);
modifier_copyData(md, nmd);
BLI_addtail(&base->object->modifiers, nmd);
+ modifier_unique_name(&base->object->modifiers, nmd);
}
copy_object_particlesystems(base->object, ob);
@@ -1220,6 +1223,7 @@ static void copymenu_modifiers(Scene *scene, View3D *v3d, Object *ob)
mdn = modifier_new(event);
BLI_addtail(&base->object->modifiers, mdn);
+ modifier_unique_name(&base->object->modifiers, mdn);
modifier_copyData(md, mdn);
}
diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c
index ab7bcbc989d..63182e943bb 100644
--- a/source/blender/editors/object/object_hook.c
+++ b/source/blender/editors/object/object_hook.c
@@ -480,6 +480,7 @@ void add_hook(Scene *scene, View3D *v3d, int mode)
hmd = (HookModifierData*) modifier_new(eModifierType_Hook);
BLI_insertlinkbefore(&obedit->modifiers, md, hmd);
sprintf(hmd->modifier.name, "Hook-%s", ob->id.name+2);
+ modifier_unique_name(&obedit->modifiers, hmd);
}
else if (hmd->indexar) MEM_freeN(hmd->indexar); /* reassign, hook was set */
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 7f0f1876417..252fdb5522a 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -76,7 +76,7 @@
int ED_object_modifier_add(ReportList *reports, Scene *scene, Object *ob, int type)
{
- ModifierData *md;
+ ModifierData *md=NULL, *new_md=NULL;
ModifierTypeInfo *mti = modifierType_getInfo(type);
if(mti->flags&eModifierTypeFlag_Single) {
@@ -87,19 +87,28 @@ int ED_object_modifier_add(ReportList *reports, Scene *scene, Object *ob, int ty
}
if(type == eModifierType_ParticleSystem) {
+ /* don't need to worry about the new modifier's name, since that is set to the number
+ * of particle systems which shouldn't have too many duplicates
+ */
object_add_particle_system(scene, ob);
}
else {
+ /* get new modifier data to add */
+ new_md= modifier_new(type);
+
if(mti->flags&eModifierTypeFlag_RequiresOriginalData) {
md = ob->modifiers.first;
-
+
while(md && modifierType_getInfo(md->type)->type==eModifierTypeType_OnlyDeform)
md = md->next;
-
- BLI_insertlinkbefore(&ob->modifiers, md, modifier_new(type));
+
+ BLI_insertlinkbefore(&ob->modifiers, md, new_md);
}
else
- BLI_addtail(&ob->modifiers, modifier_new(type));
+ BLI_addtail(&ob->modifiers, new_md);
+
+ /* make sure modifier data has unique name */
+ modifier_unique_name(&ob->modifiers, new_md);
/* special cases */
if(type == eModifierType_Softbody) {
@@ -111,7 +120,7 @@ int ED_object_modifier_add(ReportList *reports, Scene *scene, Object *ob, int ty
else if(type == eModifierType_Collision) {
if(!ob->pd)
ob->pd= object_add_collision_fields(0);
-
+
ob->pd->deflect= 1;
DAG_scene_sort(scene);
}
@@ -400,6 +409,7 @@ int ED_object_modifier_copy(ReportList *reports, Object *ob, ModifierData *md)
nmd = modifier_new(md->type);
modifier_copyData(md, nmd);
BLI_insertlink(&ob->modifiers, md, nmd);
+ modifier_unique_name(&ob->modifiers, nmd);
return 1;
}