sculptmode mtex texture pointers are now duplicated too, should resolve scene copy errors.

This commit is contained in:
2008-02-16 19:13:40 +00:00
parent 2c11523b39
commit 54fd70a8bb
3 changed files with 10 additions and 1 deletions

View File

@@ -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;

View File

@@ -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*/

View File

@@ -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; a<MAX_MTEX; ++a) {
if (sce->sculptdata.mtex[a]) {
scen->sculptdata.mtex[a]= MEM_dupallocN(sce->sculptdata.mtex[a]);
}
}
}
}