diff --git a/projectfiles/blender/src/BL_src.dsp b/projectfiles/blender/src/BL_src.dsp index d55a732a072..d6a1c3945e9 100644 --- a/projectfiles/blender/src/BL_src.dsp +++ b/projectfiles/blender/src/BL_src.dsp @@ -43,7 +43,7 @@ RSC=rc.exe LINK32=link.exe -lib MTL=midl.exe # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\..\lib\windows\sdl\include\\" /I "..\..\..\source\blender\img" /I "..\..\..\source\blender\renderui" /I "..\..\..\..\lib\windows\soundsystem\include\\" /I "..\..\..\..\lib\windows\python\include\python2.0\\" /I "..\..\..\..\lib\windows\bmfont\include" /I "..\..\..\source\blender\ftfont" /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\renderconverter" /I "..\..\..\source\blender\verify" /I "..\..\..\source\blender\readstreamglue" /I "..\..\..\source\gameengine\soundsystem\snd_openal" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\blender\quicktime" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\misc" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\radiosity\extern\include" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\gameengine\network" /I "..\..\..\..\lib\windows\decimation\include" /I "..\..\..\source\blender\blenpluginapi\\" /I "..\..\..\..\lib\windows\blenkey\include" /I "..\..\..\..\lib\windows\ghost\include" /I "..\..\..\..\lib\windows\bsp\include" /I "..\..\..\..\lib\windows\opennl\include" /I "..\..\..\intern\elbeem\extern" /I "..\..\..\..\lib\windows\memutil\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "_CONSOLE" /D "xGAMEBLENDER" /D "WITH_QUICKTIME" /D "INTERNATIONAL" /FR /J /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\..\lib\windows\sdl\include\\" /I "..\..\..\source\blender\img" /I "..\..\..\source\blender\renderui" /I "..\..\..\..\lib\windows\soundsystem\include\\" /I "..\..\..\..\lib\windows\python\include\python2.0\\" /I "..\..\..\..\lib\windows\bmfont\include" /I "..\..\..\source\blender\ftfont" /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\renderconverter" /I "..\..\..\source\blender\verify" /I "..\..\..\source\blender\readstreamglue" /I "..\..\..\source\gameengine\soundsystem\snd_openal" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\blender\quicktime" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\misc" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\radiosity\extern\include" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\gameengine\network" /I "..\..\..\..\lib\windows\decimation\include" /I "..\..\..\source\blender\blenpluginapi\\" /I "..\..\..\..\lib\windows\blenkey\include" /I "..\..\..\..\lib\windows\ghost\include" /I "..\..\..\..\lib\windows\bsp\include" /I "..\..\..\..\lib\windows\opennl\include" /I "..\..\..\intern\elbeem\extern" /I "..\..\..\..\lib\windows\memutil\include" /I "..\..\..\..\lib\windows\pthreads\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "_CONSOLE" /D "xGAMEBLENDER" /D "WITH_QUICKTIME" /D "INTERNATIONAL" /FR /J /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -68,7 +68,7 @@ LIB32=link.exe -lib LINK32=link.exe -lib MTL=midl.exe # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\lib\windows\sdl\include\\" /I "..\..\..\source\blender\img" /I "..\..\..\source\blender\renderui" /I "..\..\..\..\lib\windows\soundsystem\include\\" /I "..\..\..\..\lib\windows\python\include\python2.0\\" /I "..\..\..\..\lib\windows\bmfont\include" /I "..\..\..\source\blender\ftfont" /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\renderconverter" /I "..\..\..\source\blender\verify" /I "..\..\..\source\blender\readstreamglue" /I "..\..\..\source\gameengine\soundsystem\snd_openal" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\blender\quicktime" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\misc" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\radiosity\extern\include" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\gameengine\network" /I "..\..\..\..\lib\windows\decimation\include" /I "..\..\..\source\blender\blenpluginapi\\" /I "..\..\..\..\lib\windows\blenkey\include" /I "..\..\..\..\lib\windows\ghost\include" /I "..\..\..\..\lib\windows\bsp\include" /I "..\..\..\..\lib\windows\opennl\include" /I "..\..\..\intern\elbeem\extern" /I "..\..\..\..\lib\windows\memutil\include" /D "WIN32" /D "_MBCS" /D "_LIB" /D "_CONSOLE" /D "xGAMEBLENDER" /D "WITH_QUICKTIME" /D "INTERNATIONAL" /U "_DEBUG" /J /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\lib\windows\sdl\include\\" /I "..\..\..\source\blender\img" /I "..\..\..\source\blender\renderui" /I "..\..\..\..\lib\windows\soundsystem\include\\" /I "..\..\..\..\lib\windows\python\include\python2.0\\" /I "..\..\..\..\lib\windows\bmfont\include" /I "..\..\..\source\blender\ftfont" /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\renderconverter" /I "..\..\..\source\blender\verify" /I "..\..\..\source\blender\readstreamglue" /I "..\..\..\source\gameengine\soundsystem\snd_openal" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\blender\quicktime" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\misc" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\radiosity\extern\include" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\gameengine\network" /I "..\..\..\..\lib\windows\decimation\include" /I "..\..\..\source\blender\blenpluginapi\\" /I "..\..\..\..\lib\windows\blenkey\include" /I "..\..\..\..\lib\windows\ghost\include" /I "..\..\..\..\lib\windows\bsp\include" /I "..\..\..\..\lib\windows\opennl\include" /I "..\..\..\intern\elbeem\extern" /I "..\..\..\..\lib\windows\memutil\include" /I "..\..\..\..\lib\windows\pthreads\include" /D "WIN32" /D "_MBCS" /D "_LIB" /D "_CONSOLE" /D "xGAMEBLENDER" /D "WITH_QUICKTIME" /D "INTERNATIONAL" /U "_DEBUG" /J /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/projectfiles/blender/src/BL_src_cre.dsp b/projectfiles/blender/src/BL_src_cre.dsp index ea1992c33d4..1705b45a96f 100644 --- a/projectfiles/blender/src/BL_src_cre.dsp +++ b/projectfiles/blender/src/BL_src_cre.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Target_Dir "" LINK32=link.exe -lib # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\renderui" /I "..\..\..\source\gameengine\soundsystem\\" /I "..\..\..\..\lib\windows\python\include\python2.2\\" /I "..\..\..\source\blender\renderconverter" /I "..\..\..\source\blender\verify" /I "..\..\..\source\blender\readstreamglue" /I "..\..\..\source\gameengine\soundsystem\snd_openal" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\misc" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\radiosity\extern\include" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\gameengine\network" /I "..\..\..\..\lib\windows\decimation\include" /I "..\..\..\source\blender\blenpluginapi\\" /I "..\..\..\..\lib\windows\blenkey\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "_CONSOLE" /D "NAN_GAME" /D "GAME" /J /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\renderui" /I "..\..\..\source\gameengine\soundsystem\\" /I "..\..\..\..\lib\windows\python\include\python2.2\\" /I "..\..\..\source\blender\renderconverter" /I "..\..\..\source\blender\verify" /I "..\..\..\source\blender\readstreamglue" /I "..\..\..\source\gameengine\soundsystem\snd_openal" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\misc" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\radiosity\extern\include" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\gameengine\network" /I "..\..\..\..\lib\windows\decimation\include" /I "..\..\..\source\blender\blenpluginapi\\" /I "..\..\..\..\lib\windows\blenkey\include" /I "..\..\..\..\lib\windows\pthreads\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "_CONSOLE" /D "NAN_GAME" /D "GAME" /J /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -66,7 +66,7 @@ LIB32=link.exe -lib # PROP Target_Dir "" LINK32=link.exe -lib # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\renderui" /I "..\..\..\source\gameengine\soundsystem\\" /I "..\..\..\..\lib\windows\python\include\python2.2\\" /I "..\..\..\source\blender\renderconverter" /I "..\..\..\source\blender\verify" /I "..\..\..\source\blender\readstreamglue" /I "..\..\..\source\gameengine\soundsystem\snd_openal" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\misc" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\radiosity\extern\include" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\gameengine\network" /I "..\..\..\..\lib\windows\decimation\include" /I "..\..\..\source\blender\blenpluginapi\\" /I "..\..\..\..\lib\windows\blenkey\include" /D "WIN32" /D "_MBCS" /D "_LIB" /D "_CONSOLE" /D "NAN_GAME" /D "GAME" /U "_DEBUG" /J /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\renderui" /I "..\..\..\source\gameengine\soundsystem\\" /I "..\..\..\..\lib\windows\python\include\python2.2\\" /I "..\..\..\source\blender\renderconverter" /I "..\..\..\source\blender\verify" /I "..\..\..\source\blender\readstreamglue" /I "..\..\..\source\gameengine\soundsystem\snd_openal" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\misc" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\radiosity\extern\include" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\gameengine\network" /I "..\..\..\..\lib\windows\decimation\include" /I "..\..\..\source\blender\blenpluginapi\\" /I "..\..\..\..\lib\windows\blenkey\include" /I "..\..\..\..\lib\windows\pthreads\include" /D "WIN32" /D "_MBCS" /D "_LIB" /D "_CONSOLE" /D "NAN_GAME" /D "GAME" /U "_DEBUG" /J /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/projectfiles_vc7/blender/src/BL_src.vcproj b/projectfiles_vc7/blender/src/BL_src.vcproj index b3a92ed98bd..621788a7249 100644 --- a/projectfiles_vc7/blender/src/BL_src.vcproj +++ b/projectfiles_vc7/blender/src/BL_src.vcproj @@ -21,7 +21,7 @@ v3; edgecollpair.p12 = face1->v1; - i+=5; // get out of here! + i+=5; // get out of here after this edge pair is handled } } else if(i == 3) @@ -790,9 +790,7 @@ void cloth_collision_moving_edges(ClothModifierData *clmd, ClothModifierData *co } } } - } - - + } } diff --git a/source/blender/blenlib/BLI_blenlib.h b/source/blender/blenlib/BLI_blenlib.h index c73d0212869..3306be76c47 100644 --- a/source/blender/blenlib/BLI_blenlib.h +++ b/source/blender/blenlib/BLI_blenlib.h @@ -102,13 +102,14 @@ void BLI_join_dirfile(char *string, const char *dir, const char *file); int BLI_testextensie(const char *str, const char *ext); void addlisttolist(ListBase *list1, ListBase *list2); void BLI_insertlink(struct ListBase *listbase, void *vprevlink, void *vnewlink); -void * BLI_findlink(struct ListBase *listbase, int number); +void *BLI_findlink(struct ListBase *listbase, int number); +int BLI_findindex(struct ListBase *listbase, void *vlink); void BLI_freelistN(struct ListBase *listbase); void BLI_addtail(struct ListBase *listbase, void *vlink); void BLI_remlink(struct ListBase *listbase, void *vlink); void BLI_newname(char * name, int add); -int BLI_stringdec(char *string, char *kop, char *staart, unsigned short *numlen); -void BLI_stringenc(char *string, char *kop, char *staart, unsigned short numlen, int pic); +int BLI_stringdec(char *string, char *kop, char *start, unsigned short *numlen); +void BLI_stringenc(char *string, char *kop, char *start, unsigned short numlen, int pic); void BLI_addhead(struct ListBase *listbase, void *vlink); void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink); void BLI_freelist(struct ListBase *listbase); @@ -173,7 +174,7 @@ void BLI_clean(char *path); * @param str The string to be duplicated * @retval Returns the duplicated string */ -char* BLI_strdup(const char *str); +char *BLI_strdup(const char *str); /** * Duplicates the first @a len bytes of cstring @a str @@ -184,7 +185,7 @@ char* BLI_strdup(const char *str); * @param len The number of bytes to duplicate * @retval Returns the duplicated string */ -char* BLI_strdupn(const char *str, int len); +char *BLI_strdupn(const char *str, int len); /** * Like strncpy but ensures dst is always @@ -196,7 +197,7 @@ char* BLI_strdupn(const char *str, int len); * the size of dst) * @retval Returns dst */ -char* BLI_strncpy(char *dst, const char *src, int maxncpy); +char *BLI_strncpy(char *dst, const char *src, int maxncpy); /* * Replacement for snprintf @@ -262,15 +263,15 @@ char* BLI_getbundle(void); #endif #ifdef WIN32 -int BLI_getInstallationDir( char * str ); +int BLI_getInstallationDir(char *str); #endif /* BLI_storage.h */ int BLI_filesize(int file); double BLI_diskfree(char *dir); -char * BLI_getwdN(char * dir); +char *BLI_getwdN(char *dir); void BLI_hide_dot_files(int set); -unsigned int BLI_getdir(char *dirname, struct direntry **filelist); +unsigned int BLI_getdir(char *dirname, struct direntry **filelist); /** * @attention Do not confuse with BLI_exists @@ -303,12 +304,12 @@ char *BLI_last_slash(char *string); * * @return True if @a rect is empty. */ -int BLI_rcti_is_empty(struct rcti * rect); +int BLI_rcti_is_empty(struct rcti *rect); void BLI_init_rctf(struct rctf *rect, float xmin, float xmax, float ymin, float ymax); void BLI_init_rcti(struct rcti *rect, int xmin, int xmax, int ymin, int ymax); void BLI_translate_rctf(struct rctf *rect, float x, float y); void BLI_translate_rcti(struct rcti *rect, int x, int y); -int BLI_in_rcti(struct rcti * rect, int x, int y); +int BLI_in_rcti(struct rcti *rect, int x, int y); int BLI_in_rctf(struct rctf *rect, float x, float y); int BLI_isect_rctf(struct rctf *src1, struct rctf *src2, struct rctf *dest); int BLI_isect_rcti(struct rcti *src1, struct rcti *src2, struct rcti *dest); diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 1efc6a0b240..f5ba3c34b18 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -90,31 +90,29 @@ static int add_win32_extension(char *name); /* implementation */ -/* Ripped this from blender.c - */ +/* Ripped this from blender.c */ void addlisttolist(ListBase *list1, ListBase *list2) { + if (list2->first==0) return; - if(list2->first==0) return; - - if(list1->first==0) { + if (list1->first==0) { list1->first= list2->first; list1->last= list2->last; } else { - ((struct Link *)list1->last)->next= list2->first; - ((struct Link *)list2->first)->prev= list1->last; + ((Link *)list1->last)->next= list2->first; + ((Link *)list2->first)->prev= list1->last; list1->last= list2->last; } list2->first= list2->last= 0; } -int BLI_stringdec(char *string, char *kop, char *staart, unsigned short *numlen) +int BLI_stringdec(char *string, char *kop, char *start, unsigned short *numlen) { unsigned short len, len2, nums = 0, nume = 0; short i, found = 0; - len2 = len = strlen( string); + len2 = len = strlen(string); if (len > 6) { if (BLI_strncasecmp(string + len - 6, ".blend", 6) == 0) len -= 6; @@ -125,7 +123,6 @@ int BLI_stringdec(char *string, char *kop, char *staart, unsigned short *numlen) if (BLI_strncasecmp(string + len - 9, ".blend.gz", 9) == 0) len -= 9; } - if (len == len2) { if (len > 4) { /* handle .jf0 en .jf1 for jstreams */ @@ -143,7 +140,7 @@ int BLI_stringdec(char *string, char *kop, char *staart, unsigned short *numlen) } } - for (i = len - 1; i >= 0; i--){ + for (i = len - 1; i >= 0; i--) { if (string[i] == '/') break; if (isdigit(string[i])) { if (found){ @@ -155,12 +152,12 @@ int BLI_stringdec(char *string, char *kop, char *staart, unsigned short *numlen) found = 1; } } - else{ + else { if (found) break; } } if (found){ - if (staart) strcpy(staart,&string[nume+1]); + if (start) strcpy(start,&string[nume+1]); if (kop) { strcpy(kop,string); kop[nums]=0; @@ -168,7 +165,7 @@ int BLI_stringdec(char *string, char *kop, char *staart, unsigned short *numlen) if (numlen) *numlen = nume-nums+1; return ((int)atoi(&(string[nums]))); } - if (staart) strcpy(staart, string + len); + if (start) strcpy(start, string + len); if (kop) { strncpy(kop, string, len); kop[len] = 0; @@ -178,7 +175,7 @@ int BLI_stringdec(char *string, char *kop, char *staart, unsigned short *numlen) } -void BLI_stringenc(char *string, char *kop, char *staart, unsigned short numlen, int pic) +void BLI_stringenc(char *string, char *kop, char *start, unsigned short numlen, int pic) { char numstr[10]=""; unsigned short len,i; @@ -187,17 +184,17 @@ void BLI_stringenc(char *string, char *kop, char *staart, unsigned short numlen, if (pic>0 || numlen==4) { len= sprintf(numstr,"%d",pic); - + for(i=len;inext = listbase->first; - link->prev = 0; + link->prev = NULL; - if (listbase->first) ((struct Link *)listbase->first)->prev = link; - if (listbase->last == 0) listbase->last = link; + if (listbase->first) ((Link *)listbase->first)->prev = link; + if (listbase->last == NULL) listbase->last = link; listbase->first = link; } void BLI_addtail(ListBase *listbase, void *vlink) { - struct Link *link= vlink; + Link *link= vlink; - if (link == 0) return; - if (listbase == 0) return; + if (link == NULL) return; + if (listbase == NULL) return; - link->next = 0; + link->next = NULL; link->prev = listbase->last; - if (listbase->last) ((struct Link *)listbase->last)->next = link; + if (listbase->last) ((Link *)listbase->last)->next = link; if (listbase->first == 0) listbase->first = link; listbase->last = link; } @@ -254,10 +251,10 @@ void BLI_addtail(ListBase *listbase, void *vlink) void BLI_remlink(ListBase *listbase, void *vlink) { - struct Link *link= vlink; + Link *link= vlink; - if (link == 0) return; - if (listbase == 0) return; + if (link == NULL) return; + if (listbase == NULL) return; if (link->next) link->next->prev = link->prev; if (link->prev) link->prev->next = link->next; @@ -269,10 +266,10 @@ void BLI_remlink(ListBase *listbase, void *vlink) void BLI_freelinkN(ListBase *listbase, void *vlink) { - struct Link *link= vlink; + Link *link= vlink; - if (link == 0) return; - if (listbase == 0) return; + if (link == NULL) return; + if (listbase == NULL) return; BLI_remlink(listbase,link); MEM_freeN(link); @@ -281,19 +278,23 @@ void BLI_freelinkN(ListBase *listbase, void *vlink) void BLI_insertlink(ListBase *listbase, void *vprevlink, void *vnewlink) { - struct Link *prevlink= vprevlink, *newlink= vnewlink; + Link *prevlink= vprevlink; + Link *newlink= vnewlink; /* newlink comes after prevlink */ - - if (newlink == 0) return; - if (listbase == 0) return; - - if(listbase->first==0) { /* empty list */ + if (newlink == NULL) return; + if (listbase == NULL) return; + + /* empty list */ + if (listbase->first == NULL) { + listbase->first= newlink; listbase->last= newlink; return; } - if (prevlink== 0) { /* insert before first element */ + + /* insert before first element */ + if (prevlink == NULL) { newlink->next= listbase->first; newlink->prev= 0; newlink->next->prev= newlink; @@ -301,96 +302,106 @@ void BLI_insertlink(ListBase *listbase, void *vprevlink, void *vnewlink) return; } - if (listbase->last== prevlink) /* at end of list */ + /* at end of list */ + if (listbase->last== prevlink) listbase->last = newlink; newlink->next= prevlink->next; prevlink->next= newlink; - if(newlink->next) newlink->next->prev= newlink; + if (newlink->next) newlink->next->prev= newlink; newlink->prev= prevlink; } void BLI_insertlinkbefore(ListBase *listbase, void *vnextlink, void *vnewlink) { - struct Link *nextlink= vnextlink, *newlink= vnewlink; + Link *nextlink= vnextlink; + Link *newlink= vnewlink; /* newlink before nextlink */ + if (newlink == NULL) return; + if (listbase == NULL) return; - if (newlink == 0) return; - if (listbase == 0) return; - - if(listbase->first==0) { /* empty list */ + /* empty list */ + if (listbase->first == NULL) { listbase->first= newlink; listbase->last= newlink; return; } - if (nextlink== 0) { /* insert at end of list */ + + /* insert at end of list */ + if (nextlink == NULL) { newlink->prev= listbase->last; newlink->next= 0; - ((struct Link *)listbase->last)->next= newlink; + ((Link *)listbase->last)->next= newlink; listbase->last= newlink; return; } - if (listbase->first== nextlink) /* at beginning of list */ + /* at beginning of list */ + if (listbase->first== nextlink) listbase->first = newlink; newlink->next= nextlink; newlink->prev= nextlink->prev; nextlink->prev= newlink; - if(newlink->prev) newlink->prev->next= newlink; + if (newlink->prev) newlink->prev->next= newlink; } void BLI_freelist(ListBase *listbase) { - struct Link *link,*next; + Link *link, *next; - if (listbase == 0) return; + if (listbase == NULL) + return; + link= listbase->first; - while(link) { + while (link) { next= link->next; free(link); link= next; } - listbase->first=0; - listbase->last=0; + + listbase->first= NULL; + listbase->last= NULL; } void BLI_freelistN(ListBase *listbase) { - struct Link *link,*next; + Link *link, *next; - if (listbase == 0) return; + if (listbase == NULL) return; + link= listbase->first; - while(link) { + while (link) { next= link->next; MEM_freeN(link); link= next; } - listbase->first=0; - listbase->last=0; + + listbase->first= NULL; + listbase->last= NULL; } int BLI_countlist(ListBase *listbase) { - Link * link; + Link *link; int count = 0; - if (listbase){ + if (listbase) { link = listbase->first; - while(link) { + while (link) { count++; link= link->next; } } - return(count); + return count; } -void * BLI_findlink(ListBase *listbase, int number) +void *BLI_findlink(ListBase *listbase, int number) { - Link * link = NULL; + Link *link = NULL; if (number >= 0) { link = listbase->first; @@ -400,7 +411,27 @@ void * BLI_findlink(ListBase *listbase, int number) } } - return (link); + return link; +} + +int BLI_findindex(ListBase *listbase, void *vlink) +{ + Link *link= NULL; + int number= 0; + + if (listbase == NULL) return -1; + if (vlink == NULL) return -1; + + link= listbase->first; + while (link) { + if (link == vlink) + return number; + + number++; + link= link->next; + } + + return -1; } /*=====================================================================================*/ @@ -1195,7 +1226,7 @@ void BLI_split_dirfile(const char *string, char *dir, char *file) strcat(dir,string); BLI_strncpy(string,dir,FILE_MAXDIR+FILE_MAXFILE); } - + // BLI_exist doesn't recognize a slashed dirname as a dir // check if a trailing slash exists, and remove it. Do not do this // when we are already at root. -jesterKing @@ -1221,11 +1252,11 @@ void BLI_split_dirfile(const char *string, char *dir, char *file) else BLI_strncpy(file,string,FILE_MAXFILE); - if (strrchr(string,'\\')){ + if (strrchr(string,'\\')) { BLI_strncpy(file,strrchr(string,'\\')+1,FILE_MAXFILE); } - - if (a = strlen(dir)) { + + if ( (a = strlen(dir)) ) { if (dir[a-1] != '\\') strcat(dir,"\\"); } } diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index dfa06ebdeb8..ef287428a19 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -233,7 +233,7 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype) for (bhead= blo_firstbhead(fd); bhead; bhead= blo_nextbhead(fd, bhead)) { if (bhead->code==ofblocktype) { ID *id= (ID*) (bhead+1); - if (GS(id->name) == ID_MA) { + if ( (GS(id->name) == ID_MA) || (GS(id->name) == ID_TE)) { new_prv = MEM_callocN(sizeof(PreviewImage), "newpreview"); BLI_linklist_prepend(&previews, new_prv); looking = 1; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 38e11928c7d..c3ba4b9e292 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6516,7 +6516,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if(main->versionfile <= 244) { Scene *sce; bScreen *sc; - Object *ob; Lamp *la; World *wrld; @@ -6566,12 +6565,43 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } } - if (main->versionfile != 244 || main->subversionfile < 3) { - for(ob = main->object.first; ob; ob= ob->id.next) { + if (main->versionfile != 244 || main->subversionfile < 3) { + /* constraints recode version patch used to be here. Moved to 245 now... */ + + + for(wrld=main->world.first; wrld; wrld= wrld->id.next) { + if (wrld->mode & WO_AMB_OCC) + wrld->ao_samp_method = WO_AOSAMP_CONSTANT; + else + wrld->ao_samp_method = WO_AOSAMP_HAMMERSLEY; + + wrld->ao_adapt_thresh = 0.005; + } + + for(la=main->lamp.first; la; la= la->id.next) { + if (la->type == LA_AREA) + la->ray_samp_method = LA_SAMP_CONSTANT; + else + la->ray_samp_method = LA_SAMP_HALTON; + + la->adapt_thresh = 0.001; + } + } + } + if(main->versionfile <= 245) { + bScreen *sc; + Object *ob; + Image *ima; + Lamp *la; + Material *ma; + + /* unless the file was created 2.44.3 but not 2.45, update the constraints */ + if (!(main->versionfile==244 && main->subversionfile==3)) { + for (ob = main->object.first; ob; ob= ob->id.next) { ListBase *list; list = &ob->constraints; - /* fix up constraints due to constraint recode changes */ + /* fix up constraints due to constraint recode changes (originally at 2.44.3) */ if (list) { bConstraint *curcon; for (curcon = list->first; curcon; curcon=curcon->next) { @@ -6605,7 +6635,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* correctly initialise constinv matrix */ Mat4One(ob->constinv); - + if (ob->type == OB_ARMATURE) { if (ob->pose) { bConstraint *curcon; @@ -6647,31 +6677,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } } - - for(wrld=main->world.first; wrld; wrld= wrld->id.next) { - if (wrld->mode & WO_AMB_OCC) - wrld->ao_samp_method = WO_AOSAMP_CONSTANT; - else - wrld->ao_samp_method = WO_AOSAMP_HAMMERSLEY; - - wrld->ao_adapt_thresh = 0.005; - } - - for(la=main->lamp.first; la; la= la->id.next) { - if (la->type == LA_AREA) - la->ray_samp_method = LA_SAMP_CONSTANT; - else - la->ray_samp_method = LA_SAMP_HALTON; - - la->adapt_thresh = 0.001; - } } - } - if(main->versionfile <= 245) { - bScreen *sc; - Image* ima; - Lamp *la; - Material *ma; /* fix all versions before 2.45 */ if (main->versionfile != 245) { @@ -6687,7 +6693,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) sa= sc->areabase.first; while(sa) { SpaceLink *sl; - + for (sl= sa->spacedata.first; sl; sl= sl->next) { if(sl->spacetype==SPACE_IMASEL) { SpaceImaSel *simasel= (SpaceImaSel*) sl; @@ -6716,7 +6722,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) simasel->flag = 7; /* ??? elubie */ strcpy (simasel->dir, U.textudir); /* TON */ strcpy (simasel->file, ""); - + simasel->returnfunc = 0; simasel->title[0] = 0; } diff --git a/source/blender/include/BIF_drawimage.h b/source/blender/include/BIF_drawimage.h index ca7a25304ab..44e40b8cabb 100644 --- a/source/blender/include/BIF_drawimage.h +++ b/source/blender/include/BIF_drawimage.h @@ -39,11 +39,14 @@ struct Render; struct Image; struct ImBuf; struct uiBlock; +struct MTFace; void do_imagebuts(unsigned short event); void calc_image_view(struct SpaceImage *sima, char mode); void drawimagespace(struct ScrArea *sa, void *spacedata); void image_changed(struct SpaceImage *sima, struct Image *image); +int draw_uvs_face_check(void); +void tface_center(struct MTFace *tf, float cent[2], void * isquad); void draw_uvs_sima(void); void image_set_tile(struct SpaceImage *sima, int dotile); void image_home(void); diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 4c6cecba070..13e35c3c1d5 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -466,17 +466,25 @@ typedef struct SpaceImaSel { #define SI_TEXTURE 0 #define SI_SHOW 1 +/* SpaceImage->dt_uv */ #define SI_UVDT_DASH 0 #define SI_UVDT_BLACK 1 #define SI_UVDT_WHITE 2 #define SI_UVDT_OUTLINE 3 +/* SpaceImage->sticky + * Note DISABLE should be 0, however would also need to re-arrange icon order, + * also, sticky loc is the default mode so this means we dont need to 'do_versons' */ +#define SI_STICKY_LOC 0 +#define SI_STICKY_DISABLE 1 +#define SI_STICKY_VERTEX 2 + /* SpaceImage->flag */ #define SI_BE_SQUARE 1<<0 #define SI_EDITTILE 1<<1 #define SI_CLIP_UV 1<<2 #define SI_DRAWTOOL 1<<3 -#define SI_DEPRECATED1 1<<4 /* stick UVs to others in the same location */ +#define SI_DEPRECATED1 1<<4 /* stick UVs to others in the same location */ #define SI_DRAWSHADOW 1<<5 #define SI_SELACTFACE 1<<6 #define SI_DEPRECATED2 1<<7 @@ -589,8 +597,12 @@ typedef struct SpaceImaSel { #define SNLA_DRAWTIME 4 /* time->flag */ + /* show timing in frames instead of in seconds */ #define TIME_DRAWFRAMES 1 + /* temporary flag set when scrubbing time */ #define TIME_CFRA_NUM 2 + /* only keyframes from active/selected channels get shown */ +#define TIME_ONLYACTSEL 4 /* time->redraws */ #define TIME_LEFTMOST_3D_WIN 1 diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 77767467d05..dfcecbe50dd 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -815,7 +815,7 @@ void init_lamp_hammersley(LampRen *lar) void init_render_hammersley(Render *re) { - re->qsa = QMC_initSampler(SAMP_TYPE_HAMMERSLEY, R.wrld.aosamp*R.wrld.aosamp); + re->qsa = QMC_initSampler(SAMP_TYPE_HAMMERSLEY, (re->wrld.aosamp * re->wrld.aosamp)); } void free_lamp_qmcsampler(LampRen *lar) diff --git a/source/blender/src/CMakeLists.txt b/source/blender/src/CMakeLists.txt index d4a0cbf7c3d..176ec036ada 100644 --- a/source/blender/src/CMakeLists.txt +++ b/source/blender/src/CMakeLists.txt @@ -63,6 +63,10 @@ IF(WITH_FFMPEG) ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) +IF(WIN32) + SET(INC ${INC} ${PTHREADS_INC}) +ENDIF(WIN32) + IF(WITH_VERSE) SET(INC ${INC} ${VERSE_INC}) ADD_DEFINITIONS(-DWITH_VERSE) diff --git a/source/blender/src/Makefile b/source/blender/src/Makefile index d8f053d7766..5038c294bc6 100644 --- a/source/blender/src/Makefile +++ b/source/blender/src/Makefile @@ -117,6 +117,10 @@ ifeq ($(WITH_FFMPEG),true) CPPFLAGS += $(NAN_FFMPEGCFLAGS) endif +ifdef NAN_PTHREADS + CPPFLAGS += -I$(NAN_PTHREADS)/include +endif + ifeq ($(WITH_OPENEXR),true) CPPFLAGS += -DWITH_OPENEXR endif diff --git a/source/blender/src/SConscript b/source/blender/src/SConscript index 415e5ac4be4..ba3e03ea1eb 100644 --- a/source/blender/src/SConscript +++ b/source/blender/src/SConscript @@ -50,6 +50,9 @@ if env['WITH_BF_FFMPEG'] == 1: defs.append('WITH_FFMPEG') incs += ' ' + env['BF_FFMPEG_INC'] +if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'): + incs += ' ' + env['BF_PTHREADS_INC'] + if env['WITH_BF_VERSE']: defs.append('WITH_VERSE') incs += ' ' + env['BF_VERSE_INCLUDE'] diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 0567cd6fb67..f73983be440 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -105,6 +105,7 @@ #include "BIF_editfont.h" #include "BIF_editkey.h" #include "BIF_editmesh.h" +#include "BIF_imasel.h" #include "BIF_interface.h" #include "BIF_meshtools.h" #include "BIF_mywindow.h" @@ -2581,6 +2582,7 @@ void do_fontbuts(unsigned short event) } } +#ifdef INTERNATIONAL static void editing_panel_char_type(Object *ob, Curve *cu) { uiBlock *block; @@ -2606,6 +2608,7 @@ static void editing_panel_char_type(Object *ob, Curve *cu) uiDefButI(block, BUT, B_SETUPCHAR, "U", 280, 185, 15, 15, &G.charstart, 0, 0xffff, 0, 0, "Scroll character table up"); uiDefButI(block, BUT, B_SETDOWNCHAR, "D", 280, 0, 15, 15, &G.charstart, 0, 0xffff, 0, 0, "Scroll character table down"); } +#endif static void editing_panel_font_type(Object *ob, Curve *cu) { @@ -3793,13 +3796,13 @@ static void editing_panel_armature_bones(Object *ob, bArmature *arm) uiBlockBeginAlign(block); for(a=0; a<8; a++) { short dx= 21; - but= uiDefButBitS(block, TOG, 1<layer, 0, 0, 0, 0, "Don't draw this layer for group-duplicators"); + but= uiDefButBitS(block, TOG, 1<layer, 0, 0, 0, 0, "Armature layer that bone exists on"); uiButSetFunc(but, armature_layer_cb, &curBone->layer, (void *)(1<layer, 0, 0, 0, 0, "Don't draw this layer for group-duplicators"); + but= uiDefButBitS(block, TOG, 1<layer, 0, 0, 0, 0, "Armature layer that bone exists on"); uiButSetFunc(but, armature_layer_cb, &curBone->layer, (void *)(1<layer, 0, 0, 0, 0, ""); + but= uiDefButBitS(block, TOG, 1<layer, 0, 0, 0, 0, "Armature layer that bone exists on"); uiButSetFunc(but, armature_layer_cb, &curBone->layer, (void *)(1<layer, 0, 0, 0, 0, ""); + but= uiDefButBitS(block, TOG, 1<layer, 0, 0, 0, 0, "Armature layer that bone exists on"); uiButSetFunc(but, armature_layer_cb, &curBone->layer, (void *)(1<menunr==-2) { MTex *mtex= brush->mtex[brush->texact]; ID *id= (ID*)((mtex)? mtex->tex: NULL); - activate_databrowse(id, ID_TE, 0, B_BTEXBROWSE, &G.buts->menunr, do_global_buttons); + if(G.qual & LR_CTRLKEY) { + activate_databrowse_imasel(id, ID_TE, 0, B_BTEXBROWSE, &G.buts->menunr, do_fpaintbuts); + } else { + activate_databrowse(id, ID_TE, 0, B_BTEXBROWSE, &G.buts->menunr, do_fpaintbuts); + } break; } else if(G.buts->menunr < 0) break; diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index 3faf298db0e..c0925f4eae1 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -2869,6 +2869,13 @@ static void object_softbodies_II(Object *ob) uiBlock *block; static int val; if(!_can_softbodies_at_all(ob)) return; + /*bah that is ugly! creating missing data members in UI code*/ + if(ob->pd == NULL){ + ob->pd= MEM_callocN(sizeof(PartDeflect), "PartDeflect"); + ob->pd->pdef_sbdamp = 0.1f; + ob->pd->pdef_sbift = 0.2f; + ob->pd->pdef_sboft = 0.02f; + } block= uiNewBlock(&curarea->uiblocks, "object_softbodies_II", UI_EMBOSS, UI_HELV, curarea->win); uiNewPanelTabbed("Soft Body", "Physics"); if(uiNewPanel(curarea, block, "Soft Body Collision", "Physics", 651, 0, 318, 204)==0) return; @@ -2887,7 +2894,7 @@ static void object_softbodies_II(Object *ob) uiDefButBitS(block, TOG, 1, B_REDR, "Deflection",10,50,150,20, &ob->pd->deflect, 0, 0, 0, 0, "Makes this object visible to softbody objects"); if(ob->pd->deflect) { uiDefButF(block, NUM, B_FIELD_CHANGE, "Damping:", 160,50,150,20, &ob->pd->pdef_sbdamp, 0.0, 1.0, 10, 0, "Amount of damping during soft body collision"); - uiDefButBitS(block, TOG,OB_SB_COLLFINAL , B_DIFF, "Ev.M.Stack",10,30,150,20, &ob->softflag, 0, 0, 0, 0, "Pick collision object from modifier stack"); + uiDefButBitS(block, TOG,OB_SB_COLLFINAL , B_DIFF, "Ev.M.Stack",10,30,150,20, &ob->softflag, 0, 0, 0, 0, "Pick collision object from modifier stack"); uiDefButF(block, NUM, B_FIELD_CHANGE, "Inner:", 160,30,150,20, &ob->pd->pdef_sbift, 0.001, 1.0, 10, 0, "Inner face thickness"); uiDefButF(block, NUM, B_FIELD_CHANGE, "Outer:", 160,10,150,20, &ob->pd->pdef_sboft, 0.001, 1.0, 10, 0, "Outer face thickness"); } @@ -2932,7 +2939,7 @@ static void object_softbodies_II(Object *ob) uiDefButBitS(block, TOG, 1, B_REDR, "Deflection",10,50,150,20, &ob->pd->deflect, 0, 0, 0, 0, "Makes this object visible to other softbody objects"); if(ob->pd->deflect) { uiDefButF(block, NUM, B_DIFF, "Damping:", 160,50,150,20, &ob->pd->pdef_sbdamp, 0.0, 1.0, 10, 0, "Amount of damping during soft body collision"); - uiDefButBitS(block, TOG,OB_SB_COLLFINAL , B_DIFF, "Ev.M.Stack",10,30,150,20, &ob->softflag, 0, 0, 0, 0, "Pick collision object from modifier stack"); + uiDefButBitS(block, TOG,OB_SB_COLLFINAL , B_DIFF, "Ev.M.Stack",10,30,150,20, &ob->softflag, 0, 0, 0, 0, "Pick collision object from modifier stack"); uiDefButF(block, NUM, B_DIFF, "Inner:", 160,30,150,20, &ob->pd->pdef_sbift, 0.001, 1.0, 10, 0, "Inner face thickness"); uiDefButF(block, NUM, B_DIFF, "Outer:", 160,10,150,20, &ob->pd->pdef_sboft, 0.001, 1.0, 10, 0, "Outer face thickness"); } diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c index b6f13f76426..8a9841ce70d 100644 --- a/source/blender/src/drawaction.c +++ b/source/blender/src/drawaction.c @@ -61,7 +61,9 @@ #include "DNA_key_types.h" #include "BKE_action.h" +#include "BKE_depsgraph.h" #include "BKE_ipo.h" +#include "BKE_key.h" #include "BKE_global.h" #include "BKE_utildefines.h" @@ -69,6 +71,7 @@ #include "BIF_editaction.h" #include "BIF_editkey.h" +#include "BIF_editnla.h" #include "BIF_interface.h" #include "BIF_interface_icons.h" #include "BIF_gl.h" @@ -197,23 +200,32 @@ static void icu_slider_func(void *voidicu, void *voidignore) /* create the bezier triple if one doesn't exist, * otherwise modify it's value */ - if (!bezt) { + if (bezt == NULL) { insert_vert_icu(icu, cfra, icu->curval, 0); } else { bezt->vec[1][1] = icu->curval; } - /* make sure the Ipo's are properly process and + /* make sure the Ipo's are properly processed and * redraw as necessary */ sort_time_ipocurve(icu); testhandles_ipocurve(icu); - allqueue (REDRAWVIEW3D, 0); - allqueue (REDRAWACTION, 0); - allqueue (REDRAWNLA, 0); - allqueue (REDRAWIPO, 0); + /* nla-update (in case this affects anything) */ + synchronize_action_strips(); + + /* do redraw pushes, and also the depsgraph flushes */ + if (OBACT->pose || ob_get_key(OBACT)) + DAG_object_flush_update(G.scene, OBACT, OB_RECALC); + else + DAG_object_flush_update(G.scene, OBACT, OB_RECALC_OB); + + allqueue(REDRAWVIEW3D, 0); + allqueue(REDRAWACTION, 0); + allqueue(REDRAWNLA, 0); + allqueue(REDRAWIPO, 0); allspace(REMAKEIPO, 0); allqueue(REDRAWBUTSALL, 0); } diff --git a/source/blender/src/drawimage.c b/source/blender/src/drawimage.c index 27862091a45..c9d6b8a649b 100644 --- a/source/blender/src/drawimage.c +++ b/source/blender/src/drawimage.c @@ -446,7 +446,7 @@ static void drawcursor_sima(float xuser_asp, float yuser_asp) } // checks if we are selecting only faces -static int draw_uvs_face_check(void) +int draw_uvs_face_check(void) { if (G.sima==NULL) return 0; diff --git a/source/blender/src/drawtime.c b/source/blender/src/drawtime.c index 493d2a88685..237c42e328d 100644 --- a/source/blender/src/drawtime.c +++ b/source/blender/src/drawtime.c @@ -54,6 +54,7 @@ #include "BKE_utildefines.h" #include "BKE_global.h" +#include "BIF_editaction.h" #include "BIF_gl.h" #include "BIF_interface.h" #include "BIF_interface_icons.h" @@ -96,7 +97,8 @@ static void draw_cfra_time(SpaceTime *stime) float x, y; float xscale, yscale; char str[32]; - /* little box with frame */ + + /* little box with frame drawn beside */ glFlush(); // huhh... without this glColor won't work for the text... getmouseco_areawin(mval); @@ -277,66 +279,84 @@ static void draw_key_list(ListBase elems, char col[3]) } } +/* This function draws keyframes that the active object has (as long as + * it is not in EditMode). Some filters are available to optimise the + * drawing efficiency. + */ static void draw_ob_keys() { - /*mostly copied from drawobject.c, draw_object() */ - Object *ob; - bActionChannel *achan; - bAction *act; - ListBase elems; - int a; + /* mostly copied from drawobject.c, draw_object() */ + SpaceTime *stime= curarea->spacedata.first; + ListBase elems= {0, 0}; + + Object *ob= OBACT; + short filter, ok; char col[3]; + int a; - if (OBACT) { - ob = OBACT; + if (ob && ob!=G.obedit) { + /* Object's IPO block - show all keys */ + if (ob->ipo) { + /* convert the ipo to a list of 'current frame elements' */ + elems.first= elems.last= NULL; + make_cfra_list(ob->ipo, &elems); + + /* draw the list of current frame elements */ + col[0] = 0xDD; col[1] = 0xD7; col[2] = 0x00; + draw_key_list(elems, col); + + BLI_freelistN(&elems); + } - if(ob) { - if(ob!=G.obedit) { - if(ob->ipo) { - /* convert the ipo to a list of 'current frame elements' */ - + /* Object's Action block - may be filtered in some cases */ + if (ob->action) { + bAction *act = ob->action; + bActionChannel *achan; + + /* only apply filter if action is likely to be for pose channels + filter is on */ + filter= ((stime->flag & TIME_ONLYACTSEL) && + (ob->pose) && (ob->flag & OB_POSEMODE)); + + /* go through each channel in the action */ + for (achan=act->chanbase.first; achan; achan=achan->next) { + /* if filtering, check if this channel passes */ + if (filter) { + ok= (SEL_ACHAN(achan))? 1 : 0; + } + else ok= 1; + + /* convert the ipo to a list of 'current frame elements' */ + if (achan->ipo && ok) { elems.first= elems.last= NULL; - make_cfra_list(ob->ipo, &elems); + make_cfra_list(achan->ipo, &elems); - /* draw the list of current frame elements */ - col[0] = 0xDD; col[1] = 0xD7; col[2] = 0x00; + col[0] = 0x00; col[1] = 0x82; col[2] = 0x8B; draw_key_list(elems, col); BLI_freelistN(&elems); } + } + } + + /* Materials (only relevant for geometry objects) - some filtering might occur */ + filter= (stime->flag & TIME_ONLYACTSEL); + for (a=0; atotcol; a++) { + Material *ma= give_current_material(ob, a+1); + + /* the only filter we apply right now is only showing the active material */ + if (filter) { + ok= (ob->actcol==a)? 1 : 0; + } + else ok= 1; + + if (ma && ma->ipo && ok) { + elems.first= elems.last= NULL; + make_cfra_list(ma->ipo, &elems); - if(ob->action) { - act = ob->action; - - /* go through each channel in the action */ - for (achan=act->chanbase.first; achan; achan=achan->next){ - /* convert the ipo to a list of 'current frame elements' */ - if(achan->ipo) { - elems.first= elems.last= NULL; - make_cfra_list(achan->ipo, &elems); - - col[0] = 0x00; col[1] = 0x82; col[2] = 0x8B; - draw_key_list(elems, col); - - BLI_freelistN(&elems); - } - } - } - - for(a=0; atotcol; a++) { - Material *ma= give_current_material(ob, a+1); - - if(ma && ma->ipo) { - elems.first= elems.last= NULL; - make_cfra_list(ma->ipo, &elems); - - col[0] = 0xDD; col[1] = 0xA7; col[2] = 0x00; - draw_key_list(elems, col); - - BLI_freelistN(&elems); - } - } + col[0] = 0xDD; col[1] = 0xA7; col[2] = 0x00; + draw_key_list(elems, col); + BLI_freelistN(&elems); } } } diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c index adc0b908703..ea5117a3991 100644 --- a/source/blender/src/editaction.c +++ b/source/blender/src/editaction.c @@ -464,17 +464,17 @@ Key *get_action_mesh_key(void) Key *key; ob = OBACT; - if (!ob) return NULL; + if (ob == NULL) + return NULL; if (G.saction->pin) return NULL; - if (ob->type==OB_MESH ) { + if (ob->type==OB_MESH) key = ((Mesh *)ob->data)->key; - } - else if (ob->type==OB_LATTICE ) { + else if (ob->type==OB_LATTICE) key = ((Lattice *)ob->data)->key; - } - else return NULL; + else + return NULL; if (key) { if (key->type == KEY_RELATIVE) @@ -533,7 +533,7 @@ void *get_nearest_act_channel (short mval[], short *ret_type) } /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_CHANNELS); + filter= (ACTFILTER_FORDRAWING | ACTFILTER_VISIBLE | ACTFILTER_CHANNELS); actdata_filter(&act_data, filter, data, datatype); for (ale= act_data.first; ale; ale= ale->next) { @@ -1399,83 +1399,55 @@ void sethandles_action_keys (int code) /* ----------------------------------------- */ -static void clever_keyblock_names (Key *key, short *mval) +/* this gets called when nkey is pressed (no Transform Properties panel yet) */ +static void numbuts_action () { - KeyBlock *kb; - int but=0, keynum; - char str[64]; - float x; + void *data; + short datatype; - /* get the keynum cooresponding to the y value - * of the mouse pointer, return if this is - * an invalid key number (and we don't deal - * with the speed ipo). - */ - - keynum = get_nearest_key_num(key, mval, &x); - if ( (keynum < 1) || (keynum >= key->totkey) ) - return; - - kb= key_get_keyblock(key, keynum); - if (kb == NULL) - return; - - if (kb->name[0] == '\0') - sprintf(str, "Key %d", keynum); - else - strcpy(str, kb->name); - - if ( (kb->slidermin >= kb->slidermax) ) { - kb->slidermin = 0.0; - kb->slidermax = 1.0; - } - - add_numbut(but++, TEX, "KB: ", 0, 24, str, - "Does this really need a tool tip?"); - add_numbut(but++, NUM|FLO, "Slider Min:", - -10000, kb->slidermax, &kb->slidermin, 0); - add_numbut(but++, NUM|FLO, "Slider Max:", - kb->slidermin, 10000, &kb->slidermax, 0); - - if (do_clever_numbuts(str, but, REDRAW)) { - strcpy(kb->name, str); - allqueue (REDRAWACTION, 0); - allspace(REMAKEIPO, 0); - allqueue (REDRAWIPO, 0); - } -} - -static void clever_achannel_names (short *mval) -{ void *act_channel; + short chantype; + bActionChannel *achan= NULL; bConstraintChannel *conchan= NULL; IpoCurve *icu= NULL; + KeyBlock *kb= NULL; + + short mval[2]; int but=0; char str[64]; - short chantype; short expand, protect, mute; float slidermin, slidermax; + + /* determine what type of data we are operating on */ + data = get_action_context(&datatype); + if (data == NULL) return; + /* figure out what is under cursor */ + getmouseco_areawin(mval); + if (mval[0] < NAMEWIDTH) + return; act_channel= get_nearest_act_channel(mval, &chantype); /* create items for clever-numbut */ if (chantype == ACTTYPE_ACHAN) { + /* Action Channel */ achan= (bActionChannel *)act_channel; strcpy(str, achan->name); protect= (achan->flag & ACHAN_PROTECTED); expand = (achan->flag & ACHAN_EXPANDED); mute = (achan->ipo)? (achan->ipo->muteipo): 0; - + add_numbut(but++, TEX, "ActChan: ", 0, 31, str, "Name of Action Channel"); add_numbut(but++, TOG|SHO, "Expanded", 0, 24, &expand, "Action Channel is Expanded"); add_numbut(but++, TOG|SHO, "Muted", 0, 24, &mute, "Channel is Muted"); add_numbut(but++, TOG|SHO, "Protected", 0, 24, &protect, "Channel is Protected"); } else if (chantype == ACTTYPE_CONCHAN) { + /* Constraint Channel */ conchan= (bConstraintChannel *)act_channel; strcpy(str, conchan->name); @@ -1487,6 +1459,7 @@ static void clever_achannel_names (short *mval) add_numbut(but++, TOG|SHO, "Protected", 0, 24, &protect, "Channel is Protected"); } else if (chantype == ACTTYPE_ICU) { + /* IPO Curve */ icu= (IpoCurve *)act_channel; if (G.saction->pin) @@ -1515,6 +1488,31 @@ static void clever_achannel_names (short *mval) add_numbut(but++, TOG|SHO, "Muted", 0, 24, &mute, "Channel is Muted"); //add_numbut(but++, TOG|SHO, "Protected", 0, 24, &protect, "Channel is Protected"); } + else if (chantype == ACTTYPE_SHAPEKEY) { + /* Shape Key */ + kb= (KeyBlock *)act_channel; + + if (kb->name[0] == '\0') { + Key *key= (Key *)data; + int keynum= BLI_findindex(&key->block, kb); + + sprintf(str, "Key %d", keynum); + } + else + strcpy(str, kb->name); + + if (kb->slidermin >= kb->slidermax) { + kb->slidermin = 0.0; + kb->slidermax = 1.0; + } + + add_numbut(but++, TEX, "KB: ", 0, 24, str, + "Does this really need a tool tip?"); + add_numbut(but++, NUM|FLO, "Slider Min:", + -10000, kb->slidermax, &kb->slidermin, 0); + add_numbut(but++, NUM|FLO, "Slider Max:", + kb->slidermin, 10000, &kb->slidermax, 0); + } else { /* nothing under-cursor */ return; @@ -1554,35 +1552,13 @@ static void clever_achannel_names (short *mval) achan->ipo->muteipo = mute; } - allqueue (REDRAWACTION, 0); - allqueue (REDRAWVIEW3D, 0); + allqueue(REDRAWACTION, 0); + allspace(REMAKEIPO, 0); + allqueue(REDRAWIPO, 0); + allqueue(REDRAWVIEW3D, 0); } } -/* this gets called when nkey is pressed (no Transform Properties panel yet) */ -static void numbuts_action (void) -{ - /* now called from action window event loop, plus reacts on mouseclick */ - /* removed Hos grunts for that reason! :) (ton) */ - void *data; - short datatype; - short mval[2]; - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - getmouseco_areawin(mval); - - if (mval[0] < NAMEWIDTH) { - switch (datatype) { - case ACTCONT_ACTION: - clever_achannel_names(mval); - break; - case ACTCONT_SHAPEKEY: - clever_keyblock_names(data, mval); - break; - } - } -} /* **************************************************** */ @@ -2406,12 +2382,13 @@ static void mouse_actionchannels (short mval[]) return; } - allqueue (REDRAWIPO, 0); - allqueue (REDRAWVIEW3D, 0); - allqueue (REDRAWACTION, 0); - allqueue (REDRAWNLA, 0); - allqueue (REDRAWOOPS, 0); - allqueue (REDRAWBUTSALL, 0); + allqueue(REDRAWIPO, 0); + allqueue(REDRAWVIEW3D, 0); + allqueue(REDRAWACTION, 0); + allqueue(REDRAWNLA, 0); + allqueue(REDRAWTIME, 0); + allqueue(REDRAWOOPS, 0); + allqueue(REDRAWBUTSALL, 0); } /* **************************************************** */ @@ -2884,7 +2861,7 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt) if (datatype == ACTCONT_ACTION) { /* mouse is over action channels */ if (G.qual & LR_CTRLKEY) - clever_achannel_names(mval); + numbuts_action(); else mouse_actionchannels(mval); } diff --git a/source/blender/src/editcurve.c b/source/blender/src/editcurve.c index 31083d860fc..489cfba37ea 100644 --- a/source/blender/src/editcurve.c +++ b/source/blender/src/editcurve.c @@ -2702,6 +2702,7 @@ void addvert_Nurb(int mode) newbp->f1= 1; MEM_freeN(nu->bp); nu->bp= newbp; + bp= newbp + 1; } else if(bp== (nu->bp+nu->pntsu-1)) { /* last */ bp->f1= 0; @@ -2713,15 +2714,16 @@ void addvert_Nurb(int mode) nu->bp= newbp; newbp+= nu->pntsu; newbp->f1= 1; + bp= newbp - 1; } else bp= 0; if(bp) { nu->pntsu++; - + if(nu->resolu<3) nu->resolu++; makeknots(nu, 1, nu->flagu>>1); - + if(mode=='e') { VECCOPY(newbp->vec, bp->vec); } diff --git a/source/blender/src/editimasel.c b/source/blender/src/editimasel.c index c2058bf96fd..ed5465e938f 100644 --- a/source/blender/src/editimasel.c +++ b/source/blender/src/editimasel.c @@ -619,7 +619,7 @@ static void do_imasel_buttons(short event, SpaceImaSel *simasel) simasel->file[0] = '\0'; simasel->scrollpos = 0; simasel->active_file = -1; - scrarea_queue_winredraw(curarea); + scrarea_queue_redraw(curarea); } simasel->active_file = -1; @@ -632,7 +632,7 @@ static void do_imasel_buttons(short event, SpaceImaSel *simasel) simasel->file[0] = '\0'; simasel->active_file = -1; simasel->scrollpos = 0; - scrarea_queue_winredraw(curarea); + scrarea_queue_redraw(curarea); } else if(event== B_FS_LOAD) { if(simasel->type) @@ -812,6 +812,7 @@ void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt) char str[FILE_MAXDIR+FILE_MAXFILE+12]; short mval[2]; short do_draw = 0; + short do_headdraw = 0; int numfiles; struct direntry *file; float scrollstep = 0; @@ -931,6 +932,7 @@ void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt) simasel->active_file = -1; simasel->scrollpos = 0; do_draw = 1; + do_headdraw = 1; } else if (file) @@ -972,7 +974,7 @@ void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt) simasel->file[0] = '\0'; simasel->scrollpos = 0; simasel->active_file = -1; - scrarea_queue_winredraw(curarea); + do_headdraw = 1; } } } else { @@ -1054,6 +1056,7 @@ void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt) simasel->file[0] = '\0'; simasel->active_file = -1; simasel->scrollpos = 0; + do_headdraw = 1; } do_draw = 1; break; @@ -1089,7 +1092,10 @@ void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt) /* XXX, stupid patch, curarea can become undone * because of file loading... fixme zr */ - if(do_draw && curarea) scrarea_queue_winredraw(curarea); + if(curarea) { + if(do_draw) scrarea_queue_winredraw(curarea); + if(do_headdraw) scrarea_queue_headredraw(curarea); + } } diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c index 025dfcc7886..b329bfcce76 100644 --- a/source/blender/src/editipo.c +++ b/source/blender/src/editipo.c @@ -4887,20 +4887,21 @@ void make_ipo_transdata (TransInfo *t) if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) { if ( (ei->flag & IPO_EDIT) || G.sipo->showkey) { if (ei->icu->bezt) { + short onlytime= (ei->disptype==IPO_DISPBITS) ? 1 : (G.sipo->showkey) ? 1 : 0; bezt= ei->icu->bezt; for (b=0; b < ei->icu->totvert; b++, bezt++) { /* only include handles if selected, and interpolaton mode uses beztriples */ if (ei->icu->ipo==IPO_BEZ) { if (bezt->f1 & 1) - bezt_to_transdata(td++, td2d++, bezt->vec[0], bezt->vec[1], 1, (ei->disptype==IPO_DISPBITS)); + bezt_to_transdata(td++, td2d++, bezt->vec[0], bezt->vec[1], 1, onlytime); if (bezt->f3 & 1) - bezt_to_transdata(td++, td2d++, bezt->vec[2], bezt->vec[1], 1, (ei->disptype==IPO_DISPBITS)); + bezt_to_transdata(td++, td2d++, bezt->vec[2], bezt->vec[1], 1, onlytime); } /* only include main vert if selected */ if (bezt->f2 & 1) { - bezt_to_transdata(td++, td2d++, bezt->vec[1], bezt->vec[1], 1, (ei->disptype==IPO_DISPBITS)); + bezt_to_transdata(td++, td2d++, bezt->vec[1], bezt->vec[1], 1, onlytime); } } } @@ -4915,17 +4916,19 @@ void make_ipo_transdata (TransInfo *t) /* only include curves that are visible and selected */ if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_SELECT, icu)) { if (ei->icu->bezt) { + short onlytime= (ei->disptype==IPO_DISPBITS) ? 1 : (G.sipo->showkey) ? 1 : 0; bezt= ei->icu->bezt; b= ei->icu->totvert; + for (b=0; b < ei->icu->totvert; b++, bezt++) { /* only include handles if interpolation mode is bezier not bpoint */ if (ei->icu->ipo==IPO_BEZ) { - bezt_to_transdata(td++, td2d++, bezt->vec[0], bezt->vec[1], 1, (ei->disptype==IPO_DISPBITS)); - bezt_to_transdata(td++, td2d++, bezt->vec[2], bezt->vec[1], 1, (ei->disptype==IPO_DISPBITS)); + bezt_to_transdata(td++, td2d++, bezt->vec[0], bezt->vec[1], 1, onlytime); + bezt_to_transdata(td++, td2d++, bezt->vec[2], bezt->vec[1], 1, onlytime); } /* always include the main handle */ - bezt_to_transdata(td++, td2d++, bezt->vec[1], bezt->vec[1], 1, (ei->disptype==IPO_DISPBITS)); + bezt_to_transdata(td++, td2d++, bezt->vec[1], bezt->vec[1], 1, onlytime); } } } @@ -4940,12 +4943,8 @@ typedef struct BeztMap { BezTriple *bezt; int oldIndex; int newIndex; - short handles; } BeztMap; -#define BEZM_FLIPH 1 -#define BEZM_CLEARH1 2 -#define BEZM_CLEARH2 4 /* This function converts an IpoCurve's BezTriple array to a BeztMap array * NOTE: this allocates memory that will need to get freed later @@ -4996,15 +4995,6 @@ static void sort_time_beztmaps (BeztMap *bezms, int totvert) } } - /* swap order of handles or snap handles to centre-point? */ - if (bezm->bezt->vec[0][0]>bezm->bezt->vec[1][0] && bezm->bezt->vec[2][0]bezt->vec[1][0]) { - bezm->handles ^= BEZM_FLIPH; - } - else { - if (bezm->bezt->vec[0][0]>bezm->bezt->vec[1][0]) bezm->handles ^= BEZM_CLEARH1; - if (bezm->bezt->vec[2][0]bezt->vec[1][0]) bezm->handles ^= BEZM_CLEARH2; - } - bezm++; } } diff --git a/source/blender/src/editsima.c b/source/blender/src/editsima.c index 3da7a72f249..a53e9dade2d 100644 --- a/source/blender/src/editsima.c +++ b/source/blender/src/editsima.c @@ -616,14 +616,14 @@ void find_nearest_uv(MTFace **nearesttf, EditFace **nearestefa, unsigned int *ne } } -void mouse_select_sima(void) /* TODO - SYNCSEL */ +void mouse_select_sima(void) { EditMesh *em = G.editMesh; EditFace *efa; MTFace *tf, *nearesttf; EditFace *nearestefa=NULL; int a, selectsticky, actface, nearestuv, i; - char sticky; + char sticky= 0; short flush = 0; /* 0 == dont flush, 1 == sel, -1 == desel; only use when selection sync is enabled */ unsigned int hitv[4], nearestv; float *hituv[4], limit[2]; @@ -646,13 +646,13 @@ void mouse_select_sima(void) /* TODO - SYNCSEL */ actface= (G.qual & LR_ALTKEY || G.sima->flag & SI_SELACTFACE); switch(G.sima->sticky) { - case 0: + case SI_STICKY_LOC: sticky=2; break; - case 1: + case SI_STICKY_DISABLE: sticky=0; break; - case 2: + case SI_STICKY_VERTEX: if(G.qual & LR_CTRLKEY) { sticky=0; } else { diff --git a/source/blender/src/editview.c b/source/blender/src/editview.c index 84acf51b164..a4fac8f866f 100644 --- a/source/blender/src/editview.c +++ b/source/blender/src/editview.c @@ -480,14 +480,50 @@ static void do_lasso_select_mesh_uv(short mcords[][2], short moves, short select lasso_select_boundbox(&rect, mcords, moves); - for (efa= em->faces.first; efa; efa= efa->next) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (SIMA_FACEDRAW_CHECK(efa, tf)) { - nverts= efa->v4? 4: 3; - for(i=0; iuv[i], screenUV); - if (BLI_in_rcti(&rect, screenUV[0], screenUV[1]) && lasso_inside(mcords, moves, screenUV[0], screenUV[1])) { + if (draw_uvs_face_check()) { /* Face Center Sel */ + float cent[2]; + + /* selecting UV Faces with some modes requires us to change + * the selection in other faces (depending on the stickt mode) + * + * This only needs to be done when the Mesh is not used for selection + * (So for sticky modes - vertex or location based) + * This shoud be a generic function - so Ill make one but it will + * Only be used by this at the moment. + * */ + + if ((G.sima->flag & SI_SYNC_UVSEL)==0 && G.sima->sticky == SI_STICKY_VERTEX) { + /* tag all verts as untouched, + * then touch the ones that have a face center in the loop + * and select all MTFace UV's that use a touched vert */ + + EditVert *eve; + + for (eve= em->verts.first; eve; eve= eve->next) + eve->tmp.l = 0; + + for (efa= em->faces.first; efa; efa= efa->next) { + tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); + if (SIMA_FACEDRAW_CHECK(efa, tf)) { + if ((select) != (SIMA_FACESEL_CHECK(efa, tf))) { + tface_center(tf, cent, (void *)efa->v4); + uvco_to_areaco_noclip(cent, screenUV); + if (BLI_in_rcti(&rect, screenUV[0], screenUV[1]) && lasso_inside(mcords, moves, screenUV[0], screenUV[1])) { + if (efa->v4) { + efa->v1->tmp.l= efa->v2->tmp.l= efa->v3->tmp.l= efa->v4->tmp.l=1; + } else { + efa->v1->tmp.l= efa->v2->tmp.l= efa->v3->tmp.l= 1; + } + } + } + } + } + /* now select tagged verts */ + for (efa= em->faces.first; efa; efa= efa->next) { + tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); + nverts= efa->v4? 4: 3; + for(i=0; iv1 + i))->tmp.l) { if (select) { SIMA_UVSEL_SET(efa, tf, i); } else { @@ -496,9 +532,120 @@ static void do_lasso_select_mesh_uv(short mcords[][2], short moves, short select } } } + } else if ((G.sima->flag & SI_SYNC_UVSEL)==0 && G.sima->sticky == SI_STICKY_LOC) { + + /* This is not that nice! + * + * do a proximity based sticky selecion, + * need to do some odd stuff here + */ + int j, face_count=0, coord_end = 0; /* so we know what the last coord is */ + float *coords, limit[2]; + + get_connected_limit_tface_uv(limit); + + /* count and index */ + /* would be nice to do this within a draw loop but most below are optional, so it would involve too many checks */ + for (efa= em->faces.first; efa; efa= efa->next) { + tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); + if (SIMA_FACEDRAW_CHECK(efa, tf)) { + efa->tmp.p = tf; + face_count++; + } else { + efa->tmp.p = NULL; + } + } + /* assumes worst case where all quads are selected */ + coords = MEM_mallocN(sizeof(float) * face_count * 8, "lasso sticky coords"); + + + for (efa= em->faces.first; efa; efa= efa->next) { + if ((tf=(MTFace *)efa->tmp.p)) { + if ((select) != (SIMA_FACESEL_CHECK(efa, tf))) { + tface_center(tf, cent, (void *)efa->v4); + uvco_to_areaco_noclip(cent, screenUV); + if (BLI_in_rcti(&rect, screenUV[0], screenUV[1]) && lasso_inside(mcords, moves, screenUV[0], screenUV[1])) { + + /* select now so as to avoid a location lookup later on */ + if (select) { + SIMA_FACESEL_SET(efa, tf); + } else { + SIMA_FACESEL_UNSET(efa, tf); + } + + /* add this face's coords so we can select close coords later on */ + nverts= efa->v4? 4: 3; + for(j=0; juv[j][0]; + coords[coord_end++] = tf->uv[j][1]; + + } + } + } + } + } + + /* now select verts based on proximity to existing coords */ + for (efa= em->faces.first; efa; efa= efa->next) { + if ((tf=(MTFace *)efa->tmp.p)) { + nverts= efa->v4? 4: 3; + for(i=0; iuv[i][0]) < limit[0] && + fabs(coords[j+1]-tf->uv[i][1]) < limit[1] ) { + if (select) + tf->flag |= TF_SEL_MASK(i); + else + tf->flag &= ~TF_SEL_MASK(i); + break; + } + } + } + } + } + } + MEM_freeN(coords); + + } else { /* SI_STICKY_DISABLE or G.sima->flag & SI_SYNC_UVSEL */ + + for (efa= em->faces.first; efa; efa= efa->next) { + if ((tf=(MTFace *)efa->tmp.p)) { + if ((select) != (SIMA_FACESEL_CHECK(efa, tf))) { + tface_center(tf, cent, (void *)efa->v4); + uvco_to_areaco_noclip(cent, screenUV); + if (BLI_in_rcti(&rect, screenUV[0], screenUV[1]) && lasso_inside(mcords, moves, screenUV[0], screenUV[1])) { + if (select) { + SIMA_FACESEL_SET(efa, tf); + } else { + SIMA_FACESEL_UNSET(efa, tf); + } + } + } + } + } + } + } else { /* Vert Sel*/ + for (efa= em->faces.first; efa; efa= efa->next) { + tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); + if (SIMA_FACEDRAW_CHECK(efa, tf)) { + nverts= efa->v4? 4: 3; + for(i=0; iuv[i], screenUV); + if (BLI_in_rcti(&rect, screenUV[0], screenUV[1]) && lasso_inside(mcords, moves, screenUV[0], screenUV[1])) { + if (select) { + SIMA_UVSEL_SET(efa, tf, i); + } else { + SIMA_UVSEL_UNSET(efa, tf, i); + } + } + } + } + } } } - if (G.sima->flag & SI_SYNC_UVSEL) { if (select) EM_select_flush(); else EM_deselect_flush(); diff --git a/source/blender/src/filelist.c b/source/blender/src/filelist.c index 23a5e73f7cd..54fab06f811 100644 --- a/source/blender/src/filelist.c +++ b/source/blender/src/filelist.c @@ -265,12 +265,18 @@ static int compare_extension(const void *a1, const void *a2) { void BIF_filelist_filter(FileList* filelist) { + char dir[FILE_MAX], group[GROUP_MAX]; int num_filtered = 0; int i, j; - + if (!filelist->filelist) return; + if ( ( (filelist->type == FILE_LOADLIB) && BIF_filelist_islibrary(filelist, dir, group)) + || (filelist->type == FILE_MAIN) ) { + filelist->filter = 0; + } + if (!filelist->filter) { if (filelist->fidx) { MEM_freeN(filelist->fidx); @@ -912,6 +918,9 @@ void BIF_filelist_from_library(struct FileList* filelist) BIF_filelist_sort(filelist, FILE_SORTALPHA); BLI_strncpy(G.sce, filename, sizeof(filename)); // prevent G.sce to change + + filelist->filter = 0; + BIF_filelist_filter(filelist); } void BIF_filelist_append_library(struct FileList *filelist, char *dir, char *file, short flag, int idcode) @@ -1066,6 +1075,8 @@ void BIF_filelist_from_main(struct FileList *filelist) qsort(firstlib, totlib, sizeof(struct direntry), compare_name); } } + filelist->filter = 0; + BIF_filelist_filter(filelist); } diff --git a/source/blender/src/header_image.c b/source/blender/src/header_image.c index 86a53ba2b3d..5b8c33309a0 100644 --- a/source/blender/src/header_image.c +++ b/source/blender/src/header_image.c @@ -69,6 +69,7 @@ #include "BIF_butspace.h" #include "BIF_drawimage.h" #include "BIF_editsima.h" +#include "BIF_imasel.h" #include "BIF_interface.h" #include "BIF_resources.h" #include "BIF_screen.h" @@ -117,8 +118,13 @@ void do_image_buttons(unsigned short event) case B_SIMABROWSE: if(G.sima->imanr== -2) { - activate_databrowse((ID *)G.sima->image, ID_IM, 0, B_SIMABROWSE, + if(G.qual & LR_CTRLKEY) { + activate_databrowse_imasel((ID *)G.sima->image, ID_IM, 0, B_SIMABROWSE, &G.sima->imanr, do_image_buttons); + } else { + activate_databrowse((ID *)G.sima->image, ID_IM, 0, B_SIMABROWSE, + &G.sima->imanr, do_image_buttons); + } return; } if(G.sima->imanr < 0) break; @@ -308,7 +314,11 @@ void do_image_buttons(unsigned short event) if(G.sima->menunr==-2) { MTex *mtex= brush->mtex[brush->texact]; ID *id= (ID*)((mtex)? mtex->tex: NULL); - activate_databrowse(id, ID_TE, 0, B_SIMABTEXBROWSE, &G.sima->menunr, do_global_buttons); + if(G.qual & LR_CTRLKEY) { + activate_databrowse_imasel(id, ID_TE, 0, B_SIMABTEXBROWSE, &G.sima->menunr, do_image_buttons); + } else { + activate_databrowse(id, ID_TE, 0, B_SIMABTEXBROWSE, &G.sima->menunr, do_image_buttons); + } break; } else if(G.sima->menunr < 0) break; @@ -1189,11 +1199,15 @@ void image_buttons(void) uiDefIconButBitI(block, TOGN, SI_SYNC_UVSEL, B_REDR, ICON_NO_GO_LEFT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Mesh independant selection"); xco+= XIC; if ((G.sima->flag & SI_SYNC_UVSEL)==0) { + + /* would use these if const's could go in strings + * SI_STICKY_LOC SI_STICKY_DISABLE SI_STICKY_VERTEX */ ubut = uiDefIconTextButC(block, ICONTEXTROW, B_REDR, ICON_STICKY_UVS_LOC, "Sticky UV Selection: %t|Disable%x1|Shared Location%x0|Shared Vertex%x2", xco,0,XIC+10,YIC, &(G.sima->sticky), 0, 3.0, 0, 0, "Sticky UV Selection (Hotkeys: Shift C, Alt C, Ctrl C)"); xco+= XIC + 16; + } else { xco+= 6; } diff --git a/source/blender/src/header_imasel.c b/source/blender/src/header_imasel.c index 1897e5d82f6..1402e8c244e 100644 --- a/source/blender/src/header_imasel.c +++ b/source/blender/src/header_imasel.c @@ -44,7 +44,10 @@ #endif #include "BMF_Api.h" -#include "BIF_language.h" + +#include "BKE_global.h" +#include "BKE_main.h" +#include "BKE_utildefines.h" #include "DNA_ID.h" #include "DNA_screen_types.h" @@ -55,10 +58,9 @@ #include "BIF_gl.h" #include "BIF_imasel.h" #include "BIF_interface.h" +#include "BIF_language.h" #include "BIF_resources.h" #include "BIF_screen.h" -#include "BKE_global.h" -#include "BKE_main.h" #include "BSE_headerbuttons.h" #include "blendef.h" @@ -102,6 +104,9 @@ void imasel_buttons(void) uiBlock *block; short xco, xcotitle; char naam[256]; + char dir[FILE_MAXDIR], group[32]; + short type; + int do_filter = 0; simasel= curarea->spacedata.first; @@ -148,20 +153,28 @@ void imasel_buttons(void) uiDefIconButBitS(block, TOG, FILE_HIDE_DOT, B_RELOADIMASELDIR, ICON_GHOST,xco+=XIC,0,XIC,YIC, &simasel->flag, 0, 0, 0, 0, "Hides dot files"); uiBlockEndAlign(block); xco+=20; - - uiDefIconButBitS(block, TOG, FILE_FILTER, B_FILTERIMASELDIR, ICON_SORTBYEXT,xco+=XIC,0,XIC,YIC, &simasel->flag, 0, 0, 0, 0, "Filter files"); - if (simasel->flag & FILE_FILTER) { - xco+=4; - uiBlockBeginAlign(block); - uiDefIconButBitS(block, TOG, IMAGEFILE, B_FILTERIMASELDIR, ICON_IMAGE_COL,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show images"); - uiDefIconButBitS(block, TOG, BLENDERFILE, B_FILTERIMASELDIR, ICON_BLENDER,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show .blend files"); - uiDefIconButBitS(block, TOG, MOVIEFILE, B_FILTERIMASELDIR, ICON_SEQUENCE,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show movies"); - uiDefIconButBitS(block, TOG, PYSCRIPTFILE, B_FILTERIMASELDIR, ICON_PYTHON,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show python scripts"); - uiDefIconButBitS(block, TOG, FTFONTFILE, B_FILTERIMASELDIR, ICON_SYNTAX,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show fonts"); - uiDefIconButBitS(block, TOG, SOUNDFILE, B_FILTERIMASELDIR, ICON_SOUND,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show sound files"); - uiDefIconButBitS(block, TOG, TEXTFILE, B_FILTERIMASELDIR, ICON_TEXT,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show text files"); - uiDefIconButBitS(block, TOG, FOLDERFILE, B_FILTERIMASELDIR, ICON_FILESEL,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show folders"); - uiBlockEndAlign(block); + + type = simasel->type; + if (type == FILE_LOADLIB) { + do_filter = !BIF_filelist_islibrary(simasel->files, dir, group); + } else { + do_filter = (type != FILE_MAIN); + } + if ( do_filter ) { + uiDefIconButBitS(block, TOG, FILE_FILTER, B_FILTERIMASELDIR, ICON_SORTBYEXT,xco+=XIC,0,XIC,YIC, &simasel->flag, 0, 0, 0, 0, "Filter files"); + if (simasel->flag & FILE_FILTER) { + xco+=4; + uiBlockBeginAlign(block); + uiDefIconButBitS(block, TOG, IMAGEFILE, B_FILTERIMASELDIR, ICON_IMAGE_COL,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show images"); + uiDefIconButBitS(block, TOG, BLENDERFILE, B_FILTERIMASELDIR, ICON_BLENDER,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show .blend files"); + uiDefIconButBitS(block, TOG, MOVIEFILE, B_FILTERIMASELDIR, ICON_SEQUENCE,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show movies"); + uiDefIconButBitS(block, TOG, PYSCRIPTFILE, B_FILTERIMASELDIR, ICON_PYTHON,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show python scripts"); + uiDefIconButBitS(block, TOG, FTFONTFILE, B_FILTERIMASELDIR, ICON_SYNTAX,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show fonts"); + uiDefIconButBitS(block, TOG, SOUNDFILE, B_FILTERIMASELDIR, ICON_SOUND,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show sound files"); + uiDefIconButBitS(block, TOG, TEXTFILE, B_FILTERIMASELDIR, ICON_TEXT,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show text files"); + uiDefIconButBitS(block, TOG, FOLDERFILE, B_FILTERIMASELDIR, ICON_FILESEL,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show folders"); + uiBlockEndAlign(block); + } } uiDefButBitS(block, TOG, FILE_STRINGCODE, 0, "Relative Paths", xco+=XIC+20,0,100,YIC, &simasel->flag, 0, 0, 0, 0, "Makes sure returned paths are relative to the current .blend file"); diff --git a/source/blender/src/header_time.c b/source/blender/src/header_time.c index 00ce8987d27..70dbf60b0a0 100644 --- a/source/blender/src/header_time.c +++ b/source/blender/src/header_time.c @@ -241,6 +241,9 @@ static void do_time_viewmenu(void *arg, int event) if(G.v2d->flag & V2D_VIEWLOCK) view2d_do_locks(curarea, 0); break; + case 12: /* only show keyframes from selected data */ + stime->flag ^= TIME_ONLYACTSEL; + break; } allqueue(REDRAWVIEW3D, 0); } @@ -265,6 +268,9 @@ static uiBlock *time_viewmenu(void *arg_unused) else uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Frames|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + uiDefIconTextBut(block, BUTM, 1, (stime->flag & TIME_ONLYACTSEL)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, + "Only Selected Data Keys|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Next Marker|PageUp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c index add58a2a2ef..d95cb13832e 100644 --- a/source/blender/src/header_view3d.c +++ b/source/blender/src/header_view3d.c @@ -3703,12 +3703,20 @@ static void do_view3d_edit_armaturemenu(void *arg, int event) case 13: /* flip left and right names */ armature_flip_names(); break; - break; case 15: /* subdivide multi */ if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return; waitcursor(1); subdivide_armature(numcuts); + break; + case 16: /* Alt-S transform (BoneSize) */ + initTransform(TFM_BONESIZE, CTX_NONE); + Transform(); + break; + case 17: /* move to layer */ + pose_movetolayer(); + break; } + allqueue(REDRAWVIEW3D, 0); } @@ -3765,6 +3773,11 @@ static uiBlock *view3d_edit_armaturemenu(void *arg_unused) uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_armature_rollmenu, NULL, ICON_RIGHTARROW_THIN, "Bone Roll", 0, yco-=20, 120, 19, ""); + if (arm->drawtype==ARM_ENVELOPE) + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale Envelope Distance|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); + else if (arm->drawtype==ARM_B_BONE) + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale B-Bone Width|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extrude|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); @@ -3780,6 +3793,11 @@ static uiBlock *view3d_edit_armaturemenu(void *arg_unused) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide Multi|W, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Flip Left & Right Names|W, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Switch Armature Layers|Shift M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move Bone To Layer|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, ""); + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); uiDefIconTextBlockBut(block, view3d_edit_armature_parentmenu, NULL, ICON_RIGHTARROW_THIN, "Parent", 0, yco-=20, 120, 19, ""); @@ -4013,7 +4031,11 @@ static void do_view3d_pose_armaturemenu(void *arg, int event) } } break; + case 14: /* move bone to layer / change armature layer */ + pose_movetolayer(); + break; } + allqueue(REDRAWVIEW3D, 0); } @@ -4039,7 +4061,7 @@ static uiBlock *view3d_pose_armaturemenu(void *arg_unused) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Current Pose", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Paste Pose", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Paste Flipped Pose", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); uiDefIconTextBlockBut(block, view3d_pose_armature_motionpathsmenu, NULL, ICON_RIGHTARROW_THIN, "Motion Paths", 0, yco-=20, 120, 19, ""); @@ -4051,6 +4073,10 @@ static uiBlock *view3d_pose_armaturemenu(void *arg_unused) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Flip L/R Names|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Attributes...|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Switch Armature Layers|Shift M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move Bone To Layer|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); diff --git a/source/blender/src/headerbuttons.c b/source/blender/src/headerbuttons.c index 617bef705df..2ad1702f1f0 100644 --- a/source/blender/src/headerbuttons.c +++ b/source/blender/src/headerbuttons.c @@ -587,7 +587,10 @@ void do_global_buttons(unsigned short event) ScrArea *sa; Brush *br; int nr= 1; + +#ifdef INTERNATIONAL char buf[FILE_MAX]; +#endif ob= OBACT; @@ -859,8 +862,12 @@ void do_global_buttons(unsigned short event) if(mtex) id= (ID *)mtex->tex; } } - - activate_databrowse(id, ID_TE, 0, B_TEXBROWSE, &G.buts->texnr, do_global_buttons); + if(G.qual & LR_CTRLKEY) { + activate_databrowse_imasel(id, ID_TE, 0, B_TEXBROWSE, &G.buts->texnr, do_global_buttons); + } + else { + activate_databrowse(id, ID_TE, 0, B_TEXBROWSE, &G.buts->texnr, do_global_buttons); + } return; } if(G.buts->texnr < 0) break; diff --git a/source/blender/src/interface_icons.c b/source/blender/src/interface_icons.c index 610ad09ca34..d93834d8d8a 100644 --- a/source/blender/src/interface_icons.c +++ b/source/blender/src/interface_icons.c @@ -1028,7 +1028,7 @@ static void icon_draw_mipmap(float x, float y, int icon_id, float aspect, int mi PreviewImage* pi = BKE_previewimg_get((ID*)icon->obj); if (pi) { - if (!nocreate && pi->changed[miplevel]) /* changed only ever set by dynamic icons */ + if (!nocreate && (pi->changed[miplevel] ||!pi->rect[miplevel])) /* changed only ever set by dynamic icons */ { waitcursor(1); /* create the preview rect if necessary */ diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c index f36b392775e..5e78abd8b41 100644 --- a/source/blender/src/poseobject.c +++ b/source/blender/src/poseobject.c @@ -872,20 +872,23 @@ void pose_activate_flipped_bone(void) } } - +/* This function pops up the move-to-layer popup widgets when the user + * presses either SHIFT-MKEY or MKEY in PoseMode OR EditMode (for Armatures) + */ void pose_movetolayer(void) { Object *ob= OBACT; bArmature *arm; short lay= 0; - if(ob==NULL) return; + if (ob==NULL) return; arm= ob->data; - if(G.qual & LR_SHIFTKEY) { + if (G.qual & LR_SHIFTKEY) { + /* armature layers */ lay= arm->layer; - if( movetolayer_short_buts(&lay, "Armature Layers")==0 ) return; - if(lay==0) return; + if ( movetolayer_short_buts(&lay, "Armature Layers")==0 ) return; + if (lay==0) return; arm->layer= lay; if(ob->pose) ob->pose->proxy_layer= lay; @@ -893,33 +896,59 @@ void pose_movetolayer(void) allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWACTION, 0); allqueue(REDRAWBUTSEDIT, 0); - } - else if(ob->flag & OB_POSEMODE) { + else if (G.obedit) { + /* the check for editbone layer moving needs to occur before posemode one to work */ + EditBone *ebo; + + for (ebo= G.edbo.first; ebo; ebo= ebo->next) { + if (arm->layer & ebo->layer) { + if (ebo->flag & BONE_SELECTED) + lay |= ebo->layer; + } + } + if (lay==0) return; + + if ( movetolayer_short_buts(&lay, "Bone Layers")==0 ) return; + if (lay==0) return; + + for (ebo= G.edbo.first; ebo; ebo= ebo->next) { + if (arm->layer & ebo->layer) { + if (ebo->flag & BONE_SELECTED) + ebo->layer= lay; + } + } + + BIF_undo_push("Move Bone Layer"); + allqueue(REDRAWVIEW3D, 0); + allqueue(REDRAWBUTSEDIT, 0); + } + else if (ob->flag & OB_POSEMODE) { + /* pose-channel layers */ bPoseChannel *pchan; - if(pose_has_protected_selected(ob, 0)) + if (pose_has_protected_selected(ob, 0)) return; - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if(arm->layer & pchan->bone->layer) { - if(pchan->bone->flag & BONE_SELECTED) + for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { + if (arm->layer & pchan->bone->layer) { + if (pchan->bone->flag & BONE_SELECTED) lay |= pchan->bone->layer; } } - if(lay==0) return; + if (lay==0) return; - if( movetolayer_short_buts(&lay, "Bone Layers")==0 ) return; - if(lay==0) return; - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if(arm->layer & pchan->bone->layer) { - if(pchan->bone->flag & BONE_SELECTED) + if ( movetolayer_short_buts(&lay, "Bone Layers")==0 ) return; + if (lay==0) return; + + for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { + if (arm->layer & pchan->bone->layer) { + if (pchan->bone->flag & BONE_SELECTED) pchan->bone->layer= lay; } } - BIF_undo_push("Move Bone layer"); + BIF_undo_push("Move Bone Layer"); allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWACTION, 0); allqueue(REDRAWBUTSEDIT, 0); diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c index 333f3d24e6e..e55cea7de59 100644 --- a/source/blender/src/sequence.c +++ b/source/blender/src/sequence.c @@ -70,6 +70,7 @@ #include "RE_pipeline.h" // talks to entire render API #include "blendef.h" + #include int seqrectx, seqrecty; @@ -1392,14 +1393,14 @@ void give_ibuf_prefetch_request(int rectx, int recty, int cfra, int chanshown) void seq_wait_for_prefetch_ready() { + PrefetchThread *tslot; + if (seq_thread_shutdown) { return; } fprintf(stderr, "SEQ-THREAD: rendering prefetch frames...\n"); - PrefetchThread *tslot; - pthread_mutex_lock(&prefetch_ready_lock); for(;;) { @@ -1497,8 +1498,6 @@ ImBuf * give_ibuf_threaded(int rectx, int recty, int cfra, int chanshown) return e ? e->ibuf : 0; } - - /* Functions to free imbuf and anim data on changes */ static void free_imbuf_strip_elem(StripElem *se) diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 5eceb5ee433..66767b7cdde 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -2086,16 +2086,19 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) break; case MKEY: if(G.obedit){ - if(G.qual==LR_ALTKEY) { + if (ELEM(G.qual, 0, LR_SHIFTKEY) && (G.obedit->type==OB_ARMATURE)) { + pose_movetolayer(); + } + else if (G.qual==LR_ALTKEY) { if(G.obedit->type==OB_MESH) { mergemenu(); DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); } } - else if((G.qual==0) || (G.qual==LR_CTRLKEY)) { + else if ((G.qual==0) || (G.qual==LR_CTRLKEY)) { mirrormenu(); } - if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) { + else if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) { if(G.obedit->type==OB_MESH) select_non_manifold(); } } @@ -4840,13 +4843,13 @@ static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt) } else { /* normal operaton */ if(G.qual==LR_CTRLKEY) { - G.sima->sticky = 2; + G.sima->sticky = SI_STICKY_VERTEX; scrarea_do_headdraw(curarea); } else if(G.qual==LR_SHIFTKEY) { - G.sima->sticky = 1; + G.sima->sticky = SI_STICKY_DISABLE; scrarea_do_headdraw(curarea); } else if(G.qual==LR_ALTKEY) { - G.sima->sticky = 0; + G.sima->sticky = SI_STICKY_LOC; scrarea_do_headdraw(curarea); } else { G.sima->flag ^= SI_SELACTFACE; diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c index b58d5d05735..a2317ba61bb 100644 --- a/source/blender/src/transform.c +++ b/source/blender/src/transform.c @@ -2875,14 +2875,13 @@ void initBoneSize(TransInfo *t) t->mode = TFM_BONESIZE; t->transform = BoneSize; - t->idx_max = 0; - t->num.idx_max = 0; + t->idx_max = 2; + t->num.idx_max = 2; + t->num.flag |= NUM_NULL_ONE; t->snap[0] = 0.0f; t->snap[1] = 0.1f; t->snap[2] = t->snap[1] * 0.1f; - - t->flag |= T_NO_CONSTRAINT; - + t->fac = (float)sqrt( ( ((float)(t->center2d[1] - t->imval[1]))*((float)(t->center2d[1] - t->imval[1])) + @@ -2892,6 +2891,29 @@ void initBoneSize(TransInfo *t) if(t->fac==0.0f) t->fac= 1.0f; // prevent Inf } +static void headerBoneSize(TransInfo *t, float vec[3], char *str) { + char tvec[60]; + if (hasNumInput(&t->num)) { + outputNumInput(&(t->num), tvec); + } + else { + sprintf(&tvec[0], "%.4f", vec[0]); + sprintf(&tvec[20], "%.4f", vec[1]); + sprintf(&tvec[40], "%.4f", vec[2]); + } + + /* hmm... perhaps the y-axis values don't need to be shown? */ + if (t->con.mode & CON_APPLY) { + if (t->num.idx_max == 0) + sprintf(str, "ScaleB: %s%s %s", &tvec[0], t->con.text, t->proptext); + else + sprintf(str, "ScaleB: %s : %s : %s%s %s", &tvec[0], &tvec[20], &tvec[40], t->con.text, t->proptext); + } + else { + sprintf(str, "ScaleB X: %s Y: %s Z: %s%s %s", &tvec[0], &tvec[20], &tvec[40], t->con.text, t->proptext); + } +} + static void ElementBoneSize(TransInfo *t, TransData *td, float mat[3][3]) { float tmat[3][3], smat[3][3], oldy; @@ -2918,7 +2940,7 @@ int BoneSize(TransInfo *t, short mval[2]) float size[3], mat[3][3]; float ratio; int i; - char str[50]; + char str[60]; /* for manipulator, center handle, the scaling can't be done relative to center */ if( (t->flag & T_USES_MANIPULATOR) && t->con.mode==0) { @@ -2966,7 +2988,7 @@ int BoneSize(TransInfo *t, short mval[2]) Mat3CpyMat3(t->mat, mat); // used in manipulator - headerResize(t, size, str); + headerBoneSize(t, size, str); for(i = 0 ; i < t->total; i++, td++) { if (td->flag & TD_NOACTION) @@ -3054,7 +3076,13 @@ int BoneEnvelope(TransInfo *t, short mval[2]) if (td->flag & TD_NOACTION) break; - if(td->val) *td->val= td->ival*ratio; + if (td->val) { + /* if the old/original value was 0.0f, then just use ratio */ + if (td->ival) + *td->val= td->ival*ratio; + else + *td->val= ratio; + } } recalcData(t);