branches/blender-2.47

Merge from trunk:
	Revision: 15187
	Revision: 15195
	Revision: 15197
	Revision: 15199
This commit is contained in:
Diego Borghetti 2008-06-12 03:00:24 +00:00
parent 391feda374
commit 01c34696bc
5 changed files with 43 additions and 18 deletions

View File

@ -934,7 +934,7 @@ int new_id(ListBase *lb, ID *id, const char *tname)
}
/* if result > 21, strncpy don't put the final '\0' to name. */
if( result > 21 ) name[21]= 0;
if( result >= 21 ) name[21]= 0;
result = check_for_dupid( lb, id, name );
strcpy( id->name+2, name );

View File

@ -879,6 +879,15 @@ void BLI_cleanup_file(const char *relabase, char *dir)
if (relabase) {
BLI_convertstringcode(dir, relabase);
}
/* Note
* memmove( start, eind, strlen(eind)+1 );
* is the same as
* strcpy( start, eind );
* except strcpy should not be used because there is overlap,
* so use memmove's slightly more obscure syntax - Campbell
*/
#ifdef WIN32
if(dir[0]=='.') { /* happens for example in FILE_MAIN */
get_default_root(dir);
@ -892,17 +901,18 @@ void BLI_cleanup_file(const char *relabase, char *dir)
if (dir[a] == '\\') break;
a--;
}
strcpy(dir+a,eind);
memmove( dir+a, eind, strlen(eind)+1 );
}
while ( (start = strstr(dir,"\\.\\")) ){
eind = start + strlen("\\.\\") - 1;
strcpy(start,eind);
memmove( start, eind, strlen(eind)+1 );
}
while ( (start = strstr(dir,"\\\\" )) ){
eind = start + strlen("\\\\") - 1;
strcpy(start,eind);
memmove( start, eind, strlen(eind)+1 );
}
if((a = strlen(dir))){ /* remove the '\\' at the end */
@ -925,17 +935,17 @@ void BLI_cleanup_file(const char *relabase, char *dir)
if (dir[a] == '/') break;
a--;
}
strcpy(dir+a,eind);
memmove( dir+a, eind, strlen(eind)+1 );
}
while ( (start = strstr(dir,"/./")) ){
eind = start + strlen("/./") - 1;
strcpy(start,eind);
memmove( start, eind, strlen(eind)+1 );
}
while ( (start = strstr(dir,"//" )) ){
eind = start + strlen("//") - 1;
strcpy(start,eind);
memmove( start, eind, strlen(eind)+1 );
}
if( (a = strlen(dir)) ){ /* remove all '/' at the end */

View File

@ -1154,13 +1154,17 @@ static void unlink_script( Script * script )
if( sl->spacetype == SPACE_SCRIPT ) {
SpaceScript *sc = ( SpaceScript * ) sl;
if( sc->script == script ) {
if( sc->script == script ) {
sc->script = NULL;
if( sc ==
area->spacedata.first ) {
scrarea_queue_redraw
( area );
if( sc == area->spacedata.first ) {
scrarea_queue_redraw( area );
}
if (sc->but_refs) {
BPy_Set_DrawButtonsList(sc->but_refs);
BPy_Free_DrawButtonsList();
sc->but_refs = NULL;
}
}
}

View File

@ -2199,18 +2199,25 @@ UvVertMap *make_uv_vert_map_EM(int selected, int do_face_idx_array, float *limit
if(!selected || ((!efa->h) && (efa->f & SELECT)))
totuv += (efa->v4)? 4: 3;
if(totuv==0)
if(totuv==0) {
if (do_face_idx_array)
EM_free_index_arrays();
return NULL;
}
vmap= (UvVertMap*)MEM_callocN(sizeof(*vmap), "UvVertMap");
if (!vmap)
if (!vmap) {
if (do_face_idx_array)
EM_free_index_arrays();
return NULL;
}
vmap->vert= (UvMapVert**)MEM_callocN(sizeof(*vmap->vert)*totverts, "UvMapVert*");
buf= vmap->buf= (UvMapVert*)MEM_callocN(sizeof(*vmap->buf)*totuv, "UvMapVert");
if (!vmap->vert || !vmap->buf) {
free_uv_vert_map(vmap);
if (do_face_idx_array)
EM_free_index_arrays();
return NULL;
}

View File

@ -2077,15 +2077,16 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
vgroup_operation_with_menu();
}
}
else if((G.qual==LR_SHIFTKEY))
else if((G.qual==LR_SHIFTKEY)) {
if(G.obedit) {
if(G.obedit->type==OB_MESH)
select_mesh_group_menu();
}
else if(ob && (ob->flag & OB_POSEMODE))
pose_select_grouped_menu();
else
else if (ob)
select_object_grouped_menu();
}
else if((G.obedit==0) && G.qual==LR_ALTKEY) {
if(okee("Clear location")) {
clear_object('g');
@ -6331,7 +6332,10 @@ void duplicatespacelist(ScrArea *newarea, ListBase *lb1, ListBase *lb2)
SpaceNode *snode= (SpaceNode *)sl;
snode->nodetree= NULL;
}
else if(sl->spacetype==SPACE_SCRIPT) {
SpaceScript *sc = ( SpaceScript * ) sl;
sc->but_refs = NULL;
}
sl= sl->next;
}