Fix for [#19781] smoke domain displayed in wire even after removed it

Now it resets back to Shaded display, which still may not be what you want, but there's more chance of it, and it's the default.
This commit is contained in:
2009-11-11 11:49:46 +00:00
parent 5bedc65d61
commit 52e4b9d020
2 changed files with 14 additions and 2 deletions

View File

@@ -174,6 +174,9 @@ int ED_object_modifier_remove(ReportList *reports, Scene *scene, Object *ob, Mod
DAG_scene_sort(scene);
}
else if(md->type == eModifierType_Smoke) {
ob->dt = OB_SHADED;
}
BLI_remlink(&ob->modifiers, md);
modifier_free(md);

View File

@@ -216,8 +216,17 @@ static void rna_Smoke_set_type(bContext *C, PointerRNA *ptr)
smokeModifier_free(smd); // XXX TODO: completely free all 3 pointers
smokeModifier_createType(smd); // create regarding of selected type
if(smd->type & MOD_SMOKE_TYPE_DOMAIN)
ob->dt = OB_WIRE;
switch (smd->type) {
case MOD_SMOKE_TYPE_DOMAIN:
ob->dt = OB_WIRE;
break;
case MOD_SMOKE_TYPE_FLOW:
case MOD_SMOKE_TYPE_COLL:
case 0:
default:
ob->dt = OB_SHADED;
break;
}
// update dependancy since a domain - other type switch could have happened
rna_Modifier_dependency_update(C, ptr);