From 54fd70a8bbcee7bea1c1dea7ede7689f4d783a62 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 16 Feb 2008 19:13:40 +0000 Subject: [PATCH] sculptmode mtex texture pointers are now duplicated too, should resolve scene copy errors. --- source/blender/makesdna/DNA_scene_types.h | 2 ++ source/blender/src/edit.c | 2 +- source/blender/src/header_info.c | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index a87722c42df..b9d061b6a96 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -450,6 +450,8 @@ typedef struct BrushData struct SculptSession; typedef struct SculptData { + /* Note! all pointers in this struct must be duplicated header_info.c's copy_scene function */ + /* Data stored only from entering sculptmode until exiting sculptmode */ struct SculptSession *session; diff --git a/source/blender/src/edit.c b/source/blender/src/edit.c index 11837cc3433..8d609514a1b 100644 --- a/source/blender/src/edit.c +++ b/source/blender/src/edit.c @@ -1828,7 +1828,7 @@ void snapmenu() { short event; - event = pupmenu("Snap %t|Selection -> Grid%x1|Selection -> Cursor%x2|Cursor-> Grid%x3|Cursor-> Selection%x4|Selection-> Center%x5|Cursor-> Active%x6"); + event = pupmenu("Snap %t|Selection -> Grid%x1|Selection -> Cursor%x2|Cursor -> Grid%x3|Cursor -> Selection%x4|Selection -> Center%x5|Cursor -> Active%x6"); switch (event) { case 1: /*Selection to grid*/ diff --git a/source/blender/src/header_info.c b/source/blender/src/header_info.c index d94442dacfc..4679df9f9ba 100644 --- a/source/blender/src/header_info.c +++ b/source/blender/src/header_info.c @@ -337,7 +337,14 @@ Scene *copy_scene(Scene *sce, int level) /* sculpt data */ sce->sculptdata.session = NULL; if (sce->sculptdata.cumap) { + int a; scen->sculptdata.cumap = curvemapping_copy(sce->sculptdata.cumap); + scen->sculptdata.session = NULL; /* this is only for temp data storage anyway */ + for(a=0; asculptdata.mtex[a]) { + scen->sculptdata.mtex[a]= MEM_dupallocN(sce->sculptdata.mtex[a]); + } + } } }