From 8204dffe8a73271bc99eeeaeaed56ac0bed46e6a Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 3 Oct 2009 11:23:31 +0000 Subject: [PATCH] UI: Bugfixes * #19529: Saving in edit mode causes problems in mode buttons when reopening * Fixed compiler warning in writefile for mingw * AnimData for Lamp data was not recognised by RNA --- source/blender/blenloader/intern/readfile.c | 5 ++++- source/blender/blenloader/intern/writefile.c | 2 +- source/blender/makesrna/intern/rna_lamp.c | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index b40c7e453c0..9367e2f4247 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3902,7 +3902,10 @@ static void direct_link_object(FileData *fd, Object *ob) /* weak weak... this was only meant as draw flag, now is used in give_base too */ ob->flag &= ~OB_FROMGROUP; - + + /* editmode doesn't get saved in files, so should get cleared when reloading... */ + ob->mode &= ~OB_MODE_EDIT; + ob->disp.first=ob->disp.last= NULL; ob->adt= newdataadr(fd, ob->adt); diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 3bd8b24eeb6..1f46446dc2a 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1102,7 +1102,7 @@ static void write_pose(WriteData *wd, bPose *pose) /* write IK param */ if (pose->ikparam) { - const char *structname = get_ikparam_name(pose); + char *structname = (char *)get_ikparam_name(pose); if (structname) writestruct(wd, DATA, structname, 1, pose->ikparam); } diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index 4315a118c84..06fecec6fb6 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -377,7 +377,10 @@ static void rna_def_lamp(BlenderRNA *brna) RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_DIFF); RNA_def_property_ui_text(prop, "Diffuse", "Lamp does diffuse shading."); RNA_def_property_update(prop, 0, "rna_Lamp_update"); - + + /* common */ + rna_def_animdata_common(srna); + /* textures */ rna_def_mtex_common(srna, "rna_Lamp_mtex_begin", "rna_Lamp_active_texture_get", "rna_Lamp_active_texture_set", "LampTextureSlot", "rna_Lamp_update");