diff --git a/CMakeLists.txt b/CMakeLists.txt index 5632d211415..89fe482d7ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -161,8 +161,6 @@ if(UNIX AND NOT APPLE) option(WITH_X11_XINPUT "Enable X11 Xinput (tablet support and unicode input)" ON) option(WITH_X11_XF86VMODE "Enable X11 video mode switching" ON) option(WITH_BUILTIN_GLEW "Use GLEW OpenGL wrapper library bundled with blender" ON) - option(WITH_XDG_USER_DIRS "Build with XDG Base Directory Specification (only config and documents for now)" OFF) - mark_as_advanced(WITH_XDG_USER_DIRS) # freebsd doesn't seems to support XDND if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") diff --git a/doc/python_api/rst/bge.render.rst b/doc/python_api/rst/bge.render.rst index ddc05ac1d8c..a253b6df26f 100644 --- a/doc/python_api/rst/bge.render.rst +++ b/doc/python_api/rst/bge.render.rst @@ -11,39 +11,41 @@ Intro .. code-block:: python # Example Uses an L{SCA_MouseSensor}, and two L{KX_ObjectActuator}s to implement MouseLook:: - # To use a mouse movement sensor "Mouse" and a + # To use a mouse movement sensor "Mouse" and a # motion actuator to mouse look: - import bge.render - import bge.logic + import bge # scale sets the speed of motion scale = 1.0, 0.5 - + co = bge.logic.getCurrentController() - obj = co.getOwner() - mouse = co.getSensor("Mouse") - lmotion = co.getActuator("LMove") - wmotion = co.getActuator("WMove") - + obj = co.owner + mouse = co.sensors["Mouse"] + lmotion = co.actuators["LMove"] + wmotion = co.actuators["WMove"] + # Transform the mouse coordinates to see how far the mouse has moved. def mousePos(): - x = (bge.render.getWindowWidth() / 2 - mouse.getXPosition()) * scale[0] - y = (bge.render.getWindowHeight() / 2 - mouse.getYPosition()) * scale[1] + x = (bge.render.getWindowWidth() / 2 - mouse.position[0]) * scale[0] + y = (bge.render.getWindowHeight() / 2 - mouse.position[1]) * scale[1] return (x, y) - + pos = mousePos() - + # Set the amount of motion: X is applied in world coordinates... - lmotion.setTorque(0.0, 0.0, pos[0], False) + wmotion.useLocalTorque = False + wmotion.torque = ((0.0, 0.0, pos[0])) + # ...Y is applied in local coordinates - wmotion.setTorque(-pos[1], 0.0, 0.0, True) - + lmotion.useLocalTorque = True + lmotion.torque = ((-pos[1], 0.0, 0.0)) + # Activate both actuators - bge.logic.addActiveActuator(lmotion, True) - bge.logic.addActiveActuator(wmotion, True) - + co.activate(lmotion) + co.activate(wmotion) + # Centre the mouse - bge.render.setMousePosition(bge.render.getWindowWidth() / 2, bge.render.getWindowHeight() / 2) + bge.render.setMousePosition(int(bge.render.getWindowWidth() / 2), int(bge.render.getWindowHeight() / 2)) ********* Constants diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt index eeb924d7bf0..277b14e2c66 100644 --- a/intern/ghost/CMakeLists.txt +++ b/intern/ghost/CMakeLists.txt @@ -108,10 +108,6 @@ if(WITH_INPUT_NDOF) ) endif() -if(WITH_XDG_USER_DIRS) - add_definitions(-DWITH_XDG_USER_DIRS) -endif() - if(WITH_HEADLESS OR WITH_GHOST_SDL) if(WITH_HEADLESS) list(APPEND SRC diff --git a/intern/ghost/GHOST_ISystemPaths.h b/intern/ghost/GHOST_ISystemPaths.h index f610fde4582..ee8bd9d1eda 100644 --- a/intern/ghost/GHOST_ISystemPaths.h +++ b/intern/ghost/GHOST_ISystemPaths.h @@ -72,17 +72,17 @@ protected: public: /** * Determine the base dir in which shared resources are located. It will first try to use - * "unpack and run" path, then look for properly installed path, not including versioning. + * "unpack and run" path, then look for properly installed path, including versioning. * @return Unsigned char string pointing to system dir (eg /usr/share/blender/). */ - virtual const GHOST_TUns8 *getSystemDir() const = 0; + virtual const GHOST_TUns8 *getSystemDir(int version, const char *versionstr) const = 0; /** - * Determine the base dir in which user configuration is stored, not including versioning. + * Determine the base dir in which user configuration is stored, including versioning. * If needed, it will create the base directory. * @return Unsigned char string pointing to user dir (eg ~/.blender/). */ - virtual const GHOST_TUns8 *getUserDir() const = 0; + virtual const GHOST_TUns8 *getUserDir(int version, const char *versionstr) const = 0; /** * Determine the directory of the current binary diff --git a/intern/ghost/GHOST_Path-api.h b/intern/ghost/GHOST_Path-api.h index 811f39bb023..a037f2e3760 100644 --- a/intern/ghost/GHOST_Path-api.h +++ b/intern/ghost/GHOST_Path-api.h @@ -55,16 +55,16 @@ extern GHOST_TSuccess GHOST_DisposeSystemPaths(void); /** * Determine the base dir in which shared resources are located. It will first try to use - * "unpack and run" path, then look for properly installed path, not including versioning. + * "unpack and run" path, then look for properly installed path, including versioning. * @return Unsigned char string pointing to system dir (eg /usr/share/blender/). */ -extern const GHOST_TUns8 *GHOST_getSystemDir(void); +extern const GHOST_TUns8 *GHOST_getSystemDir(int version, const char *versionstr); /** - * Determine the base dir in which user configuration is stored, not including versioning. + * Determine the base dir in which user configuration is stored, including versioning. * @return Unsigned char string pointing to user dir (eg ~). */ -extern const GHOST_TUns8 *GHOST_getUserDir(void); +extern const GHOST_TUns8 *GHOST_getUserDir(int version, const char *versionstr); /** diff --git a/intern/ghost/intern/GHOST_Path-api.cpp b/intern/ghost/intern/GHOST_Path-api.cpp index e92623352b4..2bc58517e75 100644 --- a/intern/ghost/intern/GHOST_Path-api.cpp +++ b/intern/ghost/intern/GHOST_Path-api.cpp @@ -45,16 +45,16 @@ GHOST_TSuccess GHOST_DisposeSystemPaths(void) return GHOST_ISystemPaths::dispose(); } -const GHOST_TUns8 *GHOST_getSystemDir() +const GHOST_TUns8 *GHOST_getSystemDir(int version, const char *versionstr) { GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get(); - return systemPaths ? systemPaths->getSystemDir() : 0; + return systemPaths ? systemPaths->getSystemDir(version, versionstr) : 0; } -const GHOST_TUns8 *GHOST_getUserDir() +const GHOST_TUns8 *GHOST_getUserDir(int version, const char *versionstr) { GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get(); - return systemPaths ? systemPaths->getUserDir() : 0; /* shouldn't be NULL */ + return systemPaths ? systemPaths->getUserDir(version, versionstr) : 0; /* shouldn't be NULL */ } const GHOST_TUns8 *GHOST_getBinaryDir() diff --git a/intern/ghost/intern/GHOST_SystemPaths.h b/intern/ghost/intern/GHOST_SystemPaths.h index a8c43ff7e09..75acbf885e3 100644 --- a/intern/ghost/intern/GHOST_SystemPaths.h +++ b/intern/ghost/intern/GHOST_SystemPaths.h @@ -52,17 +52,17 @@ public: /** * Determine the base dir in which shared resources are located. It will first try to use - * "unpack and run" path, then look for properly installed path, not including versioning. + * "unpack and run" path, then look for properly installed path, including versioning. * @return Unsigned char string pointing to system dir (eg /usr/share/blender/). */ - virtual const GHOST_TUns8 *getSystemDir() const = 0; + virtual const GHOST_TUns8 *getSystemDir(int version, const char *versionstr) const = 0; - /** - * Determine the base dir in which user configuration is stored, not including versioning. - * If needed, it will create the base directory. - * @return Unsigned char string pointing to user dir (eg ~/.blender/). - */ - virtual const GHOST_TUns8 *getUserDir() const = 0; + /** + * Determine the base dir in which user configuration is stored, including versioning. + * If needed, it will create the base directory. + * @return Unsigned char string pointing to user dir (eg ~/.blender/). + */ + virtual const GHOST_TUns8 *getUserDir(int version, const char *versionstr) const = 0; /** * Determine the directory of the current binary diff --git a/intern/ghost/intern/GHOST_SystemPathsCarbon.cpp b/intern/ghost/intern/GHOST_SystemPathsCarbon.cpp index f4be03ac2f3..7d43392a79c 100644 --- a/intern/ghost/intern/GHOST_SystemPathsCarbon.cpp +++ b/intern/ghost/intern/GHOST_SystemPathsCarbon.cpp @@ -44,21 +44,23 @@ GHOST_SystemPathsCarbon::~GHOST_SystemPathsCarbon() { } -const GHOST_TUns8 *GHOST_SystemPathsCarbon::getSystemDir() const +const GHOST_TUns8 *GHOST_SystemPathsCarbon::getSystemDir(int, const char *versionstr) const { - return (GHOST_TUns8 *)"/Library/Application Support"; + static char systemPath[1024]; + + snprintf(systemPath, sizeof(systemPath), "/Library/Application Support/Blender/%s", versionstr); + + return (GHOST_TUns8*)systemPath; } -const GHOST_TUns8 *GHOST_SystemPathsCarbon::getUserDir() const +const GHOST_TUns8 *GHOST_SystemPathsCarbon::getUserDir(int, const char *versionstr) const { - static char usrPath[256] = ""; + static char usrPath[1024]; char *env = getenv("HOME"); if (env) { - strncpy(usrPath, env, 245); - usrPath[245] = 0; - strcat(usrPath, "/Library/Application Support"); - return (GHOST_TUns8 *) usrPath; + snprintf(usrPath, sizeof(usrPath), "%s/Library/Application Support/Blender/%s", env, versionstr); + return (GHOST_TUns8*)usrPath; } else return NULL; diff --git a/intern/ghost/intern/GHOST_SystemPathsCarbon.h b/intern/ghost/intern/GHOST_SystemPathsCarbon.h index c005f373726..6a94c1d6606 100644 --- a/intern/ghost/intern/GHOST_SystemPathsCarbon.h +++ b/intern/ghost/intern/GHOST_SystemPathsCarbon.h @@ -60,17 +60,17 @@ public: /** * Determine the base dir in which shared resources are located. It will first try to use - * "unpack and run" path, then look for properly installed path, not including versioning. + * "unpack and run" path, then look for properly installed path, including versioning. * @return Unsigned char string pointing to system dir (eg /usr/share/blender/). */ - virtual const GHOST_TUns8 *getSystemDir() const; + virtual const GHOST_TUns8 *getSystemDir(int version, const char *versionstr) const; /** - * Determine the base dir in which user configuration is stored, not including versioning. + * Determine the base dir in which user configuration is stored, including versioning. * If needed, it will create the base directory. * @return Unsigned char string pointing to user dir (eg ~/.blender/). */ - virtual const GHOST_TUns8 *getUserDir() const; + virtual const GHOST_TUns8 *getUserDir(int version, const char *versionstr) const; /** * Determine the directory of the current binary diff --git a/intern/ghost/intern/GHOST_SystemPathsCocoa.h b/intern/ghost/intern/GHOST_SystemPathsCocoa.h index 77efbf2dd1b..ad44396c3ff 100644 --- a/intern/ghost/intern/GHOST_SystemPathsCocoa.h +++ b/intern/ghost/intern/GHOST_SystemPathsCocoa.h @@ -54,17 +54,17 @@ public: /** * Determine the base dir in which shared resources are located. It will first try to use - * "unpack and run" path, then look for properly installed path, not including versioning. + * "unpack and run" path, then look for properly installed path, including versioning. * @return Unsigned char string pointing to system dir (eg /usr/share/blender/). */ - virtual const GHOST_TUns8 *getSystemDir() const; + virtual const GHOST_TUns8 *getSystemDir(int version, const char *versionstr) const; /** - * Determine the base dir in which user configuration is stored, not including versioning. + * Determine the base dir in which user configuration is stored, including versioning. * If needed, it will create the base directory. * @return Unsigned char string pointing to user dir (eg ~/.blender/). */ - virtual const GHOST_TUns8 *getUserDir() const; + virtual const GHOST_TUns8 *getUserDir(int version, const char *versionstr) const; /** * Determine the directory of the current binary diff --git a/intern/ghost/intern/GHOST_SystemPathsCocoa.mm b/intern/ghost/intern/GHOST_SystemPathsCocoa.mm index cce07c223e8..50ad91eeb99 100644 --- a/intern/ghost/intern/GHOST_SystemPathsCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemPathsCocoa.mm @@ -50,9 +50,9 @@ GHOST_SystemPathsCocoa::~GHOST_SystemPathsCocoa() #pragma mark Base directories retrieval -const GHOST_TUns8* GHOST_SystemPathsCocoa::getSystemDir() const +const GHOST_TUns8* GHOST_SystemPathsCocoa::getSystemDir(int, const char *versionstr) const { - static GHOST_TUns8 tempPath[512] = ""; + static char tempPath[512] = ""; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSString *basePath; NSArray *paths; @@ -66,15 +66,15 @@ const GHOST_TUns8* GHOST_SystemPathsCocoa::getSystemDir() const return NULL; } - strcpy((char*)tempPath, [basePath cStringUsingEncoding:NSASCIIStringEncoding]); + snprintf(tempPath, sizeof(tempPath), "%s/Blender/%s", [basePath cStringUsingEncoding:NSASCIIStringEncoding], versionstr); [pool drain]; - return tempPath; + return (GHOST_TUns8*)tempPath; } -const GHOST_TUns8* GHOST_SystemPathsCocoa::getUserDir() const +const GHOST_TUns8* GHOST_SystemPathsCocoa::getUserDir(int, const char *versionstr) const { - static GHOST_TUns8 tempPath[512] = ""; + static char tempPath[512] = ""; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSString *basePath; NSArray *paths; @@ -88,10 +88,10 @@ const GHOST_TUns8* GHOST_SystemPathsCocoa::getUserDir() const return NULL; } - strcpy((char*)tempPath, [basePath cStringUsingEncoding:NSASCIIStringEncoding]); + snprintf(tempPath, sizeof(tempPath), "%s/Blender/%s", [basePath cStringUsingEncoding:NSASCIIStringEncoding], versionstr); [pool drain]; - return tempPath; + return (GHOST_TUns8*)tempPath; } const GHOST_TUns8* GHOST_SystemPathsCocoa::getBinaryDir() const diff --git a/intern/ghost/intern/GHOST_SystemPathsWin32.cpp b/intern/ghost/intern/GHOST_SystemPathsWin32.cpp index ecf10463079..3a313c792d0 100644 --- a/intern/ghost/intern/GHOST_SystemPathsWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemPathsWin32.cpp @@ -69,9 +69,9 @@ GHOST_SystemPathsWin32::~GHOST_SystemPathsWin32() { } -const GHOST_TUns8 *GHOST_SystemPathsWin32::getSystemDir() const +const GHOST_TUns8 *GHOST_SystemPathsWin32::getSystemDir(int, const char *versionstr) const { - static char knownpath[MAX_PATH * 3] = {0}; /* 1 utf-16 might translante into 3 utf-8. 2 utf-16 translates into 4 utf-8*/ + static char knownpath[MAX_PATH * 3 + 128] = {0}; /* 1 utf-16 might translante into 3 utf-8. 2 utf-16 translates into 4 utf-8*/ wchar_t knownpath_16[MAX_PATH]; HRESULT hResult = SHGetFolderPathW(NULL, CSIDL_COMMON_APPDATA, NULL, SHGFP_TYPE_CURRENT, knownpath_16); @@ -79,15 +79,17 @@ const GHOST_TUns8 *GHOST_SystemPathsWin32::getSystemDir() const if (hResult == S_OK) { conv_utf_16_to_8(knownpath_16, knownpath, MAX_PATH * 3); - return (GHOST_TUns8 *)knownpath; + strcat(knownpath, "\\Blender Foundation\\Blender\\"); + strcat(knownpath, versionstr); + return (GHOST_TUns8*)knownpath; } return NULL; } -const GHOST_TUns8 *GHOST_SystemPathsWin32::getUserDir() const +const GHOST_TUns8 *GHOST_SystemPathsWin32::getUserDir(int, const char *versionstr) const { - static char knownpath[MAX_PATH * 3] = {0}; + static char knownpath[MAX_PATH * 3 + 128] = {0}; wchar_t knownpath_16[MAX_PATH]; HRESULT hResult = SHGetFolderPathW(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, knownpath_16); @@ -95,7 +97,9 @@ const GHOST_TUns8 *GHOST_SystemPathsWin32::getUserDir() const if (hResult == S_OK) { conv_utf_16_to_8(knownpath_16, knownpath, MAX_PATH * 3); - return (GHOST_TUns8 *)knownpath; + strcat(knownpath, "\\Blender Foundation\\Blender\\"); + strcat(knownpath, versionstr); + return (GHOST_TUns8*)knownpath; } return NULL; diff --git a/intern/ghost/intern/GHOST_SystemPathsWin32.h b/intern/ghost/intern/GHOST_SystemPathsWin32.h index 133aa2cacab..3a243f8be16 100644 --- a/intern/ghost/intern/GHOST_SystemPathsWin32.h +++ b/intern/ghost/intern/GHOST_SystemPathsWin32.h @@ -64,17 +64,17 @@ public: /** * Determine the base dir in which shared resources are located. It will first try to use - * "unpack and run" path, then look for properly installed path, not including versioning. + * "unpack and run" path, then look for properly installed path, including versioning. * @return Unsigned char string pointing to system dir (eg /usr/share/). */ - const GHOST_TUns8 *getSystemDir() const; + const GHOST_TUns8 *getSystemDir(int version, const char *versionstr) const; /** - * Determine the base dir in which user configuration is stored, not including versioning. + * Determine the base dir in which user configuration is stored, including versioning. * If needed, it will create the base directory. * @return Unsigned char string pointing to user dir (eg ~/). */ - const GHOST_TUns8 *getUserDir() const; + const GHOST_TUns8 *getUserDir(int version, const char *versionstr) const; /** * Determine the directory of the current binary diff --git a/intern/ghost/intern/GHOST_SystemPathsX11.cpp b/intern/ghost/intern/GHOST_SystemPathsX11.cpp index c148a16d5fc..95f82fe0e60 100644 --- a/intern/ghost/intern/GHOST_SystemPathsX11.cpp +++ b/intern/ghost/intern/GHOST_SystemPathsX11.cpp @@ -41,10 +41,8 @@ #include // for fprintf only #include // for exit -#ifdef WITH_XDG_USER_DIRS -# include // for get home without use getenv() -# include // for PATH_MAX -#endif +#include // for get home without use getenv() +#include // for PATH_MAX #ifdef PREFIX static const char *static_path = PREFIX "/share"; @@ -60,35 +58,51 @@ GHOST_SystemPathsX11::~GHOST_SystemPathsX11() { } -const GHOST_TUns8 *GHOST_SystemPathsX11::getSystemDir() const +const GHOST_TUns8 *GHOST_SystemPathsX11::getSystemDir(int, const char *versionstr) const { /* no prefix assumes a portable build which only uses bundled scripts */ - return (const GHOST_TUns8 *)static_path; + if(static_path) { + static char system_path[PATH_MAX]; + snprintf(system_path, sizeof(system_path), "%s/blender/%s", static_path, versionstr); + return (GHOST_TUns8*)system_path; + } + + return NULL; } -const GHOST_TUns8 *GHOST_SystemPathsX11::getUserDir() const +const GHOST_TUns8 *GHOST_SystemPathsX11::getUserDir(int version, const char *versionstr) const { -#ifndef WITH_XDG_USER_DIRS - return (const GHOST_TUns8 *)getenv("HOME"); -#else /* WITH_XDG_USER_DIRS */ - const char *home = getenv("XDG_CONFIG_HOME"); + static char user_path[PATH_MAX]; - if (home) { - return (const GHOST_TUns8 *)home; - } - else { - static char user_path[PATH_MAX]; + /* in blender 2.64, we migrate to XDG. to ensure the copy previous settings + * operator works we give a different path depending on the requested version */ + if(version < 264) { + const char *home = getenv("HOME"); - home = getenv("HOME"); - - if (home == NULL) { - home = getpwuid(getuid())->pw_dir; + if(home) { + snprintf(user_path, sizeof(user_path), "%s/.blender/%s", home, versionstr); + return (GHOST_TUns8*)user_path; + } + + return NULL; + } + else { + const char *home= getenv("XDG_CONFIG_HOME"); + + if (home) { + snprintf(user_path, sizeof(user_path), "%s/blender/%s", home, versionstr); + } + else { + home= getenv("HOME"); + + if (home == NULL) + home= getpwuid(getuid())->pw_dir; + + snprintf(user_path, sizeof(user_path), "%s/.config/blender/%s", home, versionstr); } - snprintf(user_path, sizeof(user_path), "%s/.config", home); return (const GHOST_TUns8 *)user_path; } -#endif /* WITH_XDG_USER_DIRS */ } const GHOST_TUns8 *GHOST_SystemPathsX11::getBinaryDir() const diff --git a/intern/ghost/intern/GHOST_SystemPathsX11.h b/intern/ghost/intern/GHOST_SystemPathsX11.h index 8ded9a35276..db6d5a6c6ea 100644 --- a/intern/ghost/intern/GHOST_SystemPathsX11.h +++ b/intern/ghost/intern/GHOST_SystemPathsX11.h @@ -52,17 +52,17 @@ public: /** * Determine the base dir in which shared resources are located. It will first try to use - * "unpack and run" path, then look for properly installed path, not including versioning. + * "unpack and run" path, then look for properly installed path, including versioning. * @return Unsigned char string pointing to system dir (eg /usr/share/blender/). */ - const GHOST_TUns8 *getSystemDir() const; + const GHOST_TUns8 *getSystemDir(int version, const char *versionstr) const; /** - * Determine the base dir in which user configuration is stored, not including versioning. + * Determine the base dir in which user configuration is stored, including versioning. * If needed, it will create the base directory. * @return Unsigned char string pointing to user dir (eg ~/.blender/). */ - const GHOST_TUns8 *getUserDir() const; + const GHOST_TUns8 *getUserDir(int version, const char *versionstr) const; /** * Determine the directory of the current binary diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c index bb3a1c66ddc..10ac93d1c3d 100644 --- a/intern/guardedalloc/intern/mallocn.c +++ b/intern/guardedalloc/intern/mallocn.c @@ -27,33 +27,28 @@ /** \file guardedalloc/intern/mallocn.c * \ingroup MEM - */ - - -/** - - * Copyright (C) 2001 NaN Technologies B.V. + * * Guarded memory allocation, and boundary-write detection. */ #include -#include /* memcpy */ +#include /* memcpy */ #include #include /* Blame Microsoft for LLP64 and no inttypes.h, quick workaround needed: */ #if defined(WIN64) -#define SIZET_FORMAT "%I64u" -#define SIZET_ARG(a) ((unsigned long long)(a)) +# define SIZET_FORMAT "%I64u" +# define SIZET_ARG(a) ((unsigned long long)(a)) #else -#define SIZET_FORMAT "%lu" -#define SIZET_ARG(a) ((unsigned long)(a)) +# define SIZET_FORMAT "%lu" +# define SIZET_ARG(a) ((unsigned long)(a)) #endif /* mmap exception */ #if defined(WIN32) -#include "mmap_win.h" +# include "mmap_win.h" #else -#include +# include #endif #include "MEM_guardedalloc.h" @@ -65,7 +60,8 @@ // #define DEBUG_MEMCOUNTER #ifdef DEBUG_MEMCOUNTER -#define DEBUG_MEMCOUNTER_ERROR_VAL 0 /* set this to the value that isn't being freed */ + /* set this to the value that isn't being freed */ +# define DEBUG_MEMCOUNTER_ERROR_VAL 0 static int _mallocn_count = 0; /* breakpoint here */ @@ -79,25 +75,23 @@ static void memcount_raise(const char *name) /* Data definition */ /* --------------------------------------------------------------------- */ /* all memory chunks are put in linked lists */ -typedef struct localLink -{ - struct localLink *next,*prev; +typedef struct localLink { + struct localLink *next, *prev; } localLink; -typedef struct localListBase -{ +typedef struct localListBase { void *first, *last; } localListBase; - /* note: keep this struct aligned (e.g., irix/gcc) - Hos */ +/* note: keep this struct aligned (e.g., irix/gcc) - Hos */ typedef struct MemHead { int tag1; size_t len; - struct MemHead *next,*prev; - const char * name; - const char * nextname; + struct MemHead *next, *prev; + const char *name; + const char *nextname; int tag2; - int mmap; /* if true, memory was mmapped */ + int mmap; /* if true, memory was mmapped */ #ifdef DEBUG_MEMCOUNTER int _count; #endif @@ -123,9 +117,9 @@ static const char *check_memlist(MemHead *memh); /* --------------------------------------------------------------------- */ #ifdef __BIG_ENDIAN__ -# define MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) ) +# define MAKE_ID(a, b, c, d) ((int)(a) << 24 | (int)(b) << 16 | (c) << 8 | (d)) #else -# define MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) ) +# define MAKE_ID(a, b, c, d) ((int)(d) << 24 | (int)(c) << 16 | (b) << 8 | (a)) #endif #define MEMTAG1 MAKE_ID('M', 'E', 'M', 'O') @@ -133,15 +127,16 @@ static const char *check_memlist(MemHead *memh); #define MEMTAG3 MAKE_ID('O', 'C', 'K', '!') #define MEMFREE MAKE_ID('F', 'R', 'E', 'E') -#define MEMNEXT(x) ((MemHead *)(((char *) x) - ((char *) & (((MemHead *)0)->next)))) +#define MEMNEXT(x) \ + ((MemHead *)(((char *) x) - ((char *) &(((MemHead *)0)->next)))) /* --------------------------------------------------------------------- */ /* vars */ /* --------------------------------------------------------------------- */ -static volatile int totblock= 0; -static volatile uintptr_t mem_in_use= 0, mmap_in_use= 0, peak_mem = 0; +static volatile int totblock = 0; +static volatile uintptr_t mem_in_use = 0, mmap_in_use = 0, peak_mem = 0; static volatile struct localListBase _membase; static volatile struct localListBase *membase = &_membase; @@ -149,7 +144,7 @@ static void (*error_callback)(const char *) = NULL; static void (*thread_lock_callback)(void) = NULL; static void (*thread_unlock_callback)(void) = NULL; -static int malloc_debug_memset= 0; +static int malloc_debug_memset = 0; #ifdef malloc #undef malloc @@ -195,8 +190,8 @@ static void mem_unlock_thread(void) int MEM_check_memory_integrity(void) { - const char* err_val = NULL; - MemHead* listend; + const char *err_val = NULL; + MemHead *listend; /* check_memlist starts from the front, and runs until it finds * the requested chunk. For this test, that's the last one. */ listend = membase->last; @@ -221,32 +216,34 @@ void MEM_set_lock_callback(void (*lock)(void), void (*unlock)(void)) void MEM_set_memory_debug(void) { - malloc_debug_memset= 1; + malloc_debug_memset = 1; } size_t MEM_allocN_len(void *vmemh) { if (vmemh) { - MemHead *memh= vmemh; + MemHead *memh = vmemh; memh--; return memh->len; - } else + } + else { return 0; + } } void *MEM_dupallocN(void *vmemh) { - void *newp= NULL; + void *newp = NULL; if (vmemh) { - MemHead *memh= vmemh; + MemHead *memh = vmemh; memh--; if (memh->mmap) - newp= MEM_mapallocN(memh->len, "dupli_mapalloc"); + newp = MEM_mapallocN(memh->len, "dupli_mapalloc"); else - newp= MEM_mallocN(memh->len, "dupli_alloc"); + newp = MEM_mallocN(memh->len, "dupli_alloc"); if (newp == NULL) return NULL; @@ -258,13 +255,13 @@ void *MEM_dupallocN(void *vmemh) void *MEM_reallocN(void *vmemh, size_t len) { - void *newp= NULL; + void *newp = NULL; if (vmemh) { - MemHead *memh= vmemh; + MemHead *memh = vmemh; memh--; - newp= MEM_mallocN(len, memh->name); + newp = MEM_mallocN(len, memh->name); if (newp) { if (len < memh->len) memcpy(newp, vmemh, len); @@ -292,7 +289,7 @@ static void make_memhead_header(MemHead *memh, size_t len, const char *str) memt = (MemTail *)(((char *) memh) + sizeof(MemHead) + len); memt->tag3 = MEMTAG3; - addtail(membase,&memh->next); + addtail(membase, &memh->next); if (memh->next) memh->nextname = MEMNEXT(memh->next)->name; totblock++; @@ -307,25 +304,26 @@ void *MEM_mallocN(size_t len, const char *str) mem_lock_thread(); - len = (len + 3 ) & ~3; /* allocate in units of 4 */ + len = (len + 3) & ~3; /* allocate in units of 4 */ - memh= (MemHead *)malloc(len+sizeof(MemHead)+sizeof(MemTail)); + memh = (MemHead *)malloc(len + sizeof(MemHead) + sizeof(MemTail)); if (memh) { make_memhead_header(memh, len, str); mem_unlock_thread(); if (malloc_debug_memset && len) - memset(memh+1, 255, len); + memset(memh + 1, 255, len); #ifdef DEBUG_MEMCOUNTER - if (_mallocn_count==DEBUG_MEMCOUNTER_ERROR_VAL) + if (_mallocn_count == DEBUG_MEMCOUNTER_ERROR_VAL) memcount_raise(__func__); - memh->_count= _mallocn_count++; + memh->_count = _mallocn_count++; #endif return (++memh); } mem_unlock_thread(); - print_error("Malloc returns null: len=" SIZET_FORMAT " in %s, total %u\n", SIZET_ARG(len), str, mem_in_use); + print_error("Malloc returns null: len=" SIZET_FORMAT " in %s, total %u\n", + SIZET_ARG(len), str, mem_in_use); return NULL; } @@ -335,22 +333,23 @@ void *MEM_callocN(size_t len, const char *str) mem_lock_thread(); - len = (len + 3 ) & ~3; /* allocate in units of 4 */ + len = (len + 3) & ~3; /* allocate in units of 4 */ - memh= (MemHead *)calloc(len+sizeof(MemHead)+sizeof(MemTail),1); + memh = (MemHead *)calloc(len + sizeof(MemHead) + sizeof(MemTail), 1); if (memh) { make_memhead_header(memh, len, str); mem_unlock_thread(); #ifdef DEBUG_MEMCOUNTER - if (_mallocn_count==DEBUG_MEMCOUNTER_ERROR_VAL) + if (_mallocn_count == DEBUG_MEMCOUNTER_ERROR_VAL) memcount_raise(__func__); - memh->_count= _mallocn_count++; + memh->_count = _mallocn_count++; #endif return (++memh); } mem_unlock_thread(); - print_error("Calloc returns null: len=" SIZET_FORMAT " in %s, total %u\n", SIZET_ARG(len), str, mem_in_use); + print_error("Calloc returns null: len=" SIZET_FORMAT " in %s, total %u\n", + SIZET_ARG(len), str, mem_in_use); return NULL; } @@ -361,27 +360,29 @@ void *MEM_mapallocN(size_t len, const char *str) mem_lock_thread(); - len = (len + 3 ) & ~3; /* allocate in units of 4 */ + len = (len + 3) & ~3; /* allocate in units of 4 */ - memh= mmap(NULL, len+sizeof(MemHead)+sizeof(MemTail), - PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANON, -1, 0); + memh = mmap(NULL, len + sizeof(MemHead) + sizeof(MemTail), + PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0); - if (memh!=(MemHead *)-1) { + if (memh != (MemHead *)-1) { make_memhead_header(memh, len, str); - memh->mmap= 1; + memh->mmap = 1; mmap_in_use += len; peak_mem = mmap_in_use > peak_mem ? mmap_in_use : peak_mem; mem_unlock_thread(); #ifdef DEBUG_MEMCOUNTER - if (_mallocn_count==DEBUG_MEMCOUNTER_ERROR_VAL) + if (_mallocn_count == DEBUG_MEMCOUNTER_ERROR_VAL) memcount_raise(__func__); - memh->_count= _mallocn_count++; + memh->_count = _mallocn_count++; #endif return (++memh); } else { mem_unlock_thread(); - print_error("Mapalloc returns null, fallback to regular malloc: len=" SIZET_FORMAT " in %s, total %u\n", SIZET_ARG(len), str, mmap_in_use); + print_error("Mapalloc returns null, fallback to regular malloc: " + "len=" SIZET_FORMAT " in %s, total %u\n", + SIZET_ARG(len), str, mmap_in_use); return MEM_callocN(len, str); } } @@ -395,16 +396,16 @@ typedef struct MemPrintBlock { static int compare_name(const void *p1, const void *p2) { - const MemPrintBlock *pb1= (const MemPrintBlock*)p1; - const MemPrintBlock *pb2= (const MemPrintBlock*)p2; + const MemPrintBlock *pb1 = (const MemPrintBlock *)p1; + const MemPrintBlock *pb2 = (const MemPrintBlock *)p2; return strcmp(pb1->name, pb2->name); } static int compare_len(const void *p1, const void *p2) { - const MemPrintBlock *pb1= (const MemPrintBlock*)p1; - const MemPrintBlock *pb2= (const MemPrintBlock*)p2; + const MemPrintBlock *pb1 = (const MemPrintBlock *)p1; + const MemPrintBlock *pb2 = (const MemPrintBlock *)p2; if (pb1->len < pb2->len) return 1; @@ -423,30 +424,30 @@ void MEM_printmemlist_stats(void) mem_lock_thread(); /* put memory blocks into array */ - printblock= malloc(sizeof(MemPrintBlock)*totblock); + printblock = malloc(sizeof(MemPrintBlock) * totblock); - pb= printblock; - totpb= 0; + pb = printblock; + totpb = 0; membl = membase->first; if (membl) membl = MEMNEXT(membl); while (membl) { - pb->name= membl->name; - pb->len= membl->len; - pb->items= 1; + pb->name = membl->name; + pb->len = membl->len; + pb->items = 1; totpb++; pb++; if (membl->next) - membl= MEMNEXT(membl->next); + membl = MEMNEXT(membl->next); else break; } /* sort by name and add together blocks with the same name */ qsort(printblock, totpb, sizeof(MemPrintBlock), compare_name); - for (a = 0, b=0; aitems, (double)pb->len/(double)(1024*1024), (double)pb->len/1024.0/(double)pb->items, pb->name); - + for (a = 0, pb = printblock; a < totpb; a++, pb++) { + printf("%6d (%8.3f %8.3f) %s\n", + pb->items, (double)pb->len / (double)(1024 * 1024), + (double)pb->len / 1024.0 / (double)pb->items, pb->name); + } free(printblock); mem_unlock_thread(); @@ -477,8 +481,28 @@ void MEM_printmemlist_stats(void) #endif } +static const char mem_printmemlist_pydict_script[] = +"mb_userinfo = {}\n" +"totmem = 0\n" +"for mb_item in membase:\n" +" mb_item_user_size = mb_userinfo.setdefault(mb_item['name'], [0,0])\n" +" mb_item_user_size[0] += 1 # Add a user\n" +" mb_item_user_size[1] += mb_item['len'] # Increment the size\n" +" totmem += mb_item['len']\n" +"print('(membase) items:', len(membase), '| unique-names:',\n" +" len(mb_userinfo), '| total-mem:', totmem)\n" +"mb_userinfo_sort = list(mb_userinfo.items())\n" +"for sort_name, sort_func in (('size', lambda a: -a[1][1]),\n" +" ('users', lambda a: -a[1][0]),\n" +" ('name', lambda a: a[0])):\n" +" print('\\nSorting by:', sort_name)\n" +" mb_userinfo_sort.sort(key = sort_func)\n" +" for item in mb_userinfo_sort:\n" +" print('name:%%s, users:%%i, len:%%i' %%\n" +" (item[0], item[1][0], item[1][1]))\n"; + /* Prints in python syntax for easy */ -static void MEM_printmemlist_internal( int pydict ) +static void MEM_printmemlist_internal(int pydict) { MemHead *membl; @@ -489,46 +513,39 @@ static void MEM_printmemlist_internal( int pydict ) if (pydict) { print_error("# membase_debug.py\n"); - print_error("membase = [\\\n"); + print_error("membase = [\n"); } while (membl) { if (pydict) { - fprintf(stderr, "{'len':" SIZET_FORMAT ", 'name':'''%s''', 'pointer':'%p'},\\\n", SIZET_ARG(membl->len), membl->name, (void *)(membl+1)); - } else { + fprintf(stderr, + " {'len':" SIZET_FORMAT ", " + "'name':'''%s''', " + "'pointer':'%p'},\n", + SIZET_ARG(membl->len), membl->name, (void *)(membl + 1)); + } + else { #ifdef DEBUG_MEMCOUNTER - print_error("%s len: " SIZET_FORMAT " %p, count: %d\n", membl->name, SIZET_ARG(membl->len), membl+1, membl->_count); + print_error("%s len: " SIZET_FORMAT " %p, count: %d\n", + membl->name, SIZET_ARG(membl->len), membl + 1, + membl->_count); #else - print_error("%s len: " SIZET_FORMAT " %p\n", membl->name, SIZET_ARG(membl->len), membl+1); + print_error("%s len: " SIZET_FORMAT " %p\n", + membl->name, SIZET_ARG(membl->len), membl + 1); #endif } if (membl->next) - membl= MEMNEXT(membl->next); + membl = MEMNEXT(membl->next); else break; } if (pydict) { fprintf(stderr, "]\n\n"); - fprintf(stderr, -"mb_userinfo = {}\n" -"totmem = 0\n" -"for mb_item in membase:\n" -"\tmb_item_user_size = mb_userinfo.setdefault(mb_item['name'], [0,0])\n" -"\tmb_item_user_size[0] += 1 # Add a user\n" -"\tmb_item_user_size[1] += mb_item['len'] # Increment the size\n" -"\ttotmem += mb_item['len']\n" -"print '(membase) items:', len(membase), '| unique-names:', len(mb_userinfo), '| total-mem:', totmem\n" -"mb_userinfo_sort = mb_userinfo.items()\n" -"for sort_name, sort_func in (('size', lambda a: -a[1][1]), ('users', lambda a: -a[1][0]), ('name', lambda a: a[0])):\n" -"\tprint '\\nSorting by:', sort_name\n" -"\tmb_userinfo_sort.sort(key = sort_func)\n" -"\tfor item in mb_userinfo_sort:\n" -"\t\tprint 'name:%%s, users:%%i, len:%%i' %% (item[0], item[1][0], item[1][1])\n" - ); + fprintf(stderr, mem_printmemlist_pydict_script); } mem_unlock_thread(); } -void MEM_callbackmemlist(void (*func)(void*)) { +void MEM_callbackmemlist(void (*func)(void *)) { MemHead *membl; mem_lock_thread(); @@ -537,9 +554,9 @@ void MEM_callbackmemlist(void (*func)(void*)) { if (membl) membl = MEMNEXT(membl); while (membl) { - func(membl+1); + func(membl + 1); if (membl->next) - membl= MEMNEXT(membl->next); + membl = MEMNEXT(membl->next); else break; } @@ -555,13 +572,13 @@ short MEM_testN(void *vmemh) { if (membl) membl = MEMNEXT(membl); while (membl) { - if (vmemh == membl+1) { + if (vmemh == membl + 1) { mem_unlock_thread(); return 1; } if (membl->next) - membl= MEMNEXT(membl->next); + membl = MEMNEXT(membl->next); else break; } @@ -571,47 +588,50 @@ short MEM_testN(void *vmemh) { return 0; } -void MEM_printmemlist( void ) { +void MEM_printmemlist(void) { MEM_printmemlist_internal(0); } -void MEM_printmemlist_pydict( void ) { +void MEM_printmemlist_pydict(void) { MEM_printmemlist_internal(1); } -short MEM_freeN(void *vmemh) /* anders compileertie niet meer */ +short MEM_freeN(void *vmemh) /* anders compileertie niet meer */ { short error = 0; MemTail *memt; - MemHead *memh= vmemh; + MemHead *memh = vmemh; const char *name; if (memh == NULL) { - MemorY_ErroR("free","attempt to free NULL pointer"); + MemorY_ErroR("free", "attempt to free NULL pointer"); /* print_error(err_stream, "%d\n", (memh+4000)->tag1); */ return(-1); } - if (sizeof(intptr_t)==8) { + if (sizeof(intptr_t) == 8) { if (((intptr_t) memh) & 0x7) { - MemorY_ErroR("free","attempt to free illegal pointer"); + MemorY_ErroR("free", "attempt to free illegal pointer"); return(-1); } } else { if (((intptr_t) memh) & 0x3) { - MemorY_ErroR("free","attempt to free illegal pointer"); + MemorY_ErroR("free", "attempt to free illegal pointer"); return(-1); } } memh--; if (memh->tag1 == MEMFREE && memh->tag2 == MEMFREE) { - MemorY_ErroR(memh->name,"double free"); + MemorY_ErroR(memh->name, "double free"); return(-1); } mem_lock_thread(); - if ((memh->tag1 == MEMTAG1) && (memh->tag2 == MEMTAG2) && ((memh->len & 0x3) == 0)) { + if ((memh->tag1 == MEMTAG1) && + (memh->tag2 == MEMTAG2) && + ((memh->len & 0x3) == 0)) + { memt = (MemTail *)(((char *) memh) + sizeof(MemHead) + memh->len); if (memt->tag3 == MEMTAG3) { @@ -626,18 +646,19 @@ short MEM_freeN(void *vmemh) /* anders compileertie niet meer */ return(0); } error = 2; - MemorY_ErroR(memh->name,"end corrupt"); + MemorY_ErroR(memh->name, "end corrupt"); name = check_memlist(memh); if (name != NULL) { - if (name != memh->name) MemorY_ErroR(name,"is also corrupt"); + if (name != memh->name) MemorY_ErroR(name, "is also corrupt"); } - } else{ + } + else { error = -1; name = check_memlist(memh); if (name == NULL) - MemorY_ErroR("free","pointer not in memlist"); + MemorY_ErroR("free", "pointer not in memlist"); else - MemorY_ErroR(name,"error in header"); + MemorY_ErroR(name, "error in header"); } totblock--; @@ -654,7 +675,7 @@ short MEM_freeN(void *vmemh) /* anders compileertie niet meer */ static void addtail(volatile localListBase *listbase, void *vlink) { - struct localLink *link= vlink; + struct localLink *link = vlink; if (link == NULL) return; if (listbase == NULL) return; @@ -669,7 +690,7 @@ static void addtail(volatile localListBase *listbase, void *vlink) static void remlink(volatile localListBase *listbase, void *vlink) { - struct localLink *link= vlink; + struct localLink *link = vlink; if (link == NULL) return; if (listbase == NULL) return; @@ -683,7 +704,7 @@ static void remlink(volatile localListBase *listbase, void *vlink) static void rem_memblock(MemHead *memh) { - remlink(membase,&memh->next); + remlink(membase, &memh->next); if (memh->prev) { if (memh->next) MEMNEXT(memh->prev)->nextname = MEMNEXT(memh->next)->name; @@ -701,14 +722,14 @@ static void rem_memblock(MemHead *memh) } else { if (malloc_debug_memset && memh->len) - memset(memh+1, 255, memh->len); + memset(memh + 1, 255, memh->len); free(memh); } } static void MemorY_ErroR(const char *block, const char *error) { - print_error("Memoryblock %s: %s\n",block, error); + print_error("Memoryblock %s: %s\n", block, error); #ifdef WITH_ASSERT_ABORT abort(); @@ -717,7 +738,7 @@ static void MemorY_ErroR(const char *block, const char *error) static const char *check_memlist(MemHead *memh) { - MemHead *forw,*back,*forwok,*backok; + MemHead *forw, *back, *forwok, *backok; const char *name; forw = membase->first; @@ -743,7 +764,7 @@ static const char *check_memlist(MemHead *memh) if (forw != back) return ("MORE THAN 1 MEMORYBLOCK CORRUPT"); if (forw == NULL && back == NULL) { - /* geen foute headers gevonden dan maar op zoek naar memblock*/ + /* no wrong headers found then but in search of memblock */ forw = membase->first; if (forw) forw = MEMNEXT(forw); @@ -773,27 +794,30 @@ static const char *check_memlist(MemHead *memh) else name = "No name found"; if (forw == memh) { - /* voor alle zekerheid wordt dit block maar uit de lijst gehaald */ + /* to be sure but this block is removed from the list */ if (forwok) { if (backok) { forwok->next = (MemHead *)&backok->next; backok->prev = (MemHead *)&forwok->next; forwok->nextname = backok->name; - } else{ + } + else { forwok->next = NULL; membase->last = (struct localLink *) &forwok->next; -/* membase->last = (struct Link *) &forwok->next; */ } - } else{ + } + else { if (backok) { backok->prev = NULL; membase->first = &backok->next; - } else{ + } + else { membase->first = membase->last = NULL; } } - } else{ - MemorY_ErroR(name,"Additional error in header"); + } + else { + MemorY_ErroR(name, "Additional error in header"); return("Additional error in header"); } @@ -823,7 +847,7 @@ uintptr_t MEM_get_memory_in_use(void) uintptr_t _mem_in_use; mem_lock_thread(); - _mem_in_use= mem_in_use; + _mem_in_use = mem_in_use; mem_unlock_thread(); return _mem_in_use; @@ -834,7 +858,7 @@ uintptr_t MEM_get_mapped_memory_in_use(void) uintptr_t _mmap_in_use; mem_lock_thread(); - _mmap_in_use= mmap_in_use; + _mmap_in_use = mmap_in_use; mem_unlock_thread(); return _mmap_in_use; @@ -845,7 +869,7 @@ int MEM_get_memory_blocks_in_use(void) int _totblock; mem_lock_thread(); - _totblock= totblock; + _totblock = totblock; mem_unlock_thread(); return _totblock; @@ -855,7 +879,7 @@ int MEM_get_memory_blocks_in_use(void) const char *MEM_name_ptr(void *vmemh) { if (vmemh) { - MemHead *memh= vmemh; + MemHead *memh = vmemh; memh--; return memh->name; } diff --git a/release/plugins/sequence/color-correction-hsv.c b/release/plugins/sequence/color-correction-hsv.c index b9ffd88b26c..f77acd2ce93 100644 --- a/release/plugins/sequence/color-correction-hsv.c +++ b/release/plugins/sequence/color-correction-hsv.c @@ -19,24 +19,24 @@ #include "plugin.h" #include -char name[]= "Color Correction"; +char name[] = "Color Correction"; -VarStruct varstr[]= { - { NUMSLI|FLO, "St Y:", 0.0, -1.0, 1.0, "Setup Y"}, - { NUMSLI|FLO, "Gn Y:", 1.0, 0.0, 10.0,"Gain Y"}, - { NUMSLI|FLO, "Ga Y:", 1.0, 0.0, 10.0, "Gamma Y"}, +VarStruct varstr[] = { + { NUMSLI | FLO, "St Y:", 0.0, -1.0, 1.0, "Setup Y"}, + { NUMSLI | FLO, "Gn Y:", 1.0, 0.0, 10.0, "Gain Y"}, + { NUMSLI | FLO, "Ga Y:", 1.0, 0.0, 10.0, "Gamma Y"}, - { NUMSLI|FLO, "Lo S:", 1.0, 0.0, 10.0,"Saturation Shadows"}, - { NUMSLI|FLO, "Md S:", 1.0, 0.0, 10.0,"Saturation Midtones"}, - { NUMSLI|FLO, "Hi S:", 1.0, 0.0, 10.0,"Saturation Highlights"}, + { NUMSLI | FLO, "Lo S:", 1.0, 0.0, 10.0, "Saturation Shadows"}, + { NUMSLI | FLO, "Md S:", 1.0, 0.0, 10.0, "Saturation Midtones"}, + { NUMSLI | FLO, "Hi S:", 1.0, 0.0, 10.0, "Saturation Highlights"}, - { NUMSLI|FLO, "MA S:", 1.0, 0.0, 10.0,"Master Saturation"}, + { NUMSLI | FLO, "MA S:", 1.0, 0.0, 10.0, "Master Saturation"}, - { NUMSLI|FLO, "Lo T:", 0.25, 0.0, 1.0, + { NUMSLI | FLO, "Lo T:", 0.25, 0.0, 1.0, "Saturation Shadow Thres"}, - { NUMSLI|FLO, "Hi T:", 0.75, 0.0, 1.0, + { NUMSLI | FLO, "Hi T:", 0.75, 0.0, 1.0, "Saturation Highlights Thres"}, - { TOG|INT, "Debug", 0.0, 0.0, 1.0, + { TOG | INT, "Debug", 0.0, 0.0, 1.0, "Show curves as overlay"}, }; @@ -58,25 +58,28 @@ float cfra; void plugin_seq_doit(Cast *, float, float, int, int, ImBuf *, ImBuf *, ImBuf *, ImBuf *); -int plugin_seq_getversion(void) { return B_PLUGIN_VERSION;} +int plugin_seq_getversion(void) +{ + return B_PLUGIN_VERSION; +} void plugin_but_changed(int but) {} void plugin_init() {} void plugin_getinfo(PluginInfo *info) { - info->name= name; - info->nvars= sizeof(varstr)/sizeof(VarStruct); - info->cfra= &cfra; + info->name = name; + info->nvars = sizeof(varstr) / sizeof(VarStruct); + info->cfra = &cfra; - info->varstr= varstr; + info->varstr = varstr; - info->init= plugin_init; - info->seq_doit= (SeqDoit) plugin_seq_doit; - info->callback= plugin_but_changed; + info->init = plugin_init; + info->seq_doit = (SeqDoit) plugin_seq_doit; + info->callback = plugin_but_changed; } -static void hsv_to_rgb (double h, double s, double v, - double *r, double *g, double *b) +static void hsv_to_rgb(double h, double s, double v, + double *r, double *g, double *b) { int i; double f, w, q, t; @@ -90,8 +93,7 @@ static void hsv_to_rgb (double h, double s, double v, *g = v; *b = v; } - else - { + else { if (h == 360.0) h = 0.0; h = h / 60.0; @@ -103,42 +105,42 @@ static void hsv_to_rgb (double h, double s, double v, switch (i) { - case 0: - *r = v; - *g = t; - *b = w; - break; - case 1: - *r = q; - *g = v; - *b = w; - break; - case 2: - *r = w; - *g = v; - *b = t; - break; - case 3: - *r = w; - *g = q; - *b = v; - break; - case 4: - *r = t; - *g = w; - *b = v; - break; - case 5: - *r = v; - *g = w; - *b = q; - break; + case 0: + *r = v; + *g = t; + *b = w; + break; + case 1: + *r = q; + *g = v; + *b = w; + break; + case 2: + *r = w; + *g = v; + *b = t; + break; + case 3: + *r = w; + *g = q; + *b = v; + break; + case 4: + *r = t; + *g = w; + *b = v; + break; + case 5: + *r = v; + *g = w; + *b = q; + break; } } } -static void rgb_to_hsv (double r, double g, double b, - double *h, double *s, double *v) +static void rgb_to_hsv(double r, double g, double b, + double *h, double *s, double *v) { double max, min, delta; @@ -163,8 +165,7 @@ static void rgb_to_hsv (double r, double g, double b, if (*s == 0.0) *h = -1.0; - else - { + else { delta = max - min; if (r == max) @@ -182,7 +183,8 @@ static void rgb_to_hsv (double r, double g, double b, } void plugin_seq_doit(Cast *cast, float facf0, float facf1, int width, - int height, ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *out, ImBuf *use) { + int height, ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *out, ImBuf *use) +{ char *dest, *src1; int x, y, c; double gamma_table[256]; @@ -192,18 +194,19 @@ void plugin_seq_doit(Cast *cast, float facf0, float facf1, int width, if (!ibuf1) return; - dest= (char *) out->rect; - src1= (char *) ibuf1->rect; - src1f= ibuf1->rect_float; + dest = (char *) out->rect; + src1 = (char *) ibuf1->rect; + src1f = ibuf1->rect_float; for (y = 0; y < 256; y++) { float v = 1.0 * y / 255; v += cast->setup_y; v *= cast->gain_y; v = pow(v, cast->gamma_y); - if ( v > 1.0) { + if (v > 1.0) { v = 1.0; - } else if (v < 0.0) { + } + else if (v < 0.0) { v = 0.0; } gamma_table[y] = v * 255; @@ -214,9 +217,11 @@ void plugin_seq_doit(Cast *cast, float facf0, float facf1, int width, v *= cast->master_sat; if (y < cast->lo_thres * 255) { v *= cast->sat_shadows; - } else if (y > cast->hi_thres * 255) { + } + else if (y > cast->hi_thres * 255) { v *= cast->sat_highlights; - } else { + } + else { v *= cast->sat_midtones; } uv_table[y] = v; @@ -225,15 +230,15 @@ void plugin_seq_doit(Cast *cast, float facf0, float facf1, int width, for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { - double h,s,v,r,g,b; + double h, s, v, r, g, b; double fac; if (ibuf1->rect_float) rgb_to_hsv(src1f[0], src1f[1], - src1f[2],&h,&s,&v); - else rgb_to_hsv((double) src1[0]/255.0, - (double) src1[1]/255.0, - (double) src1[2]/255.0, - &h, &s, &v); + src1f[2], &h, &s, &v); + else rgb_to_hsv((double) src1[0] / 255.0, + (double) src1[1] / 255.0, + (double) src1[2] / 255.0, + &h, &s, &v); v = gamma_table[(int) (v * 255.0)] / 255.0; fac = uv_table[(int) (255.0 * v)]; @@ -242,18 +247,19 @@ void plugin_seq_doit(Cast *cast, float facf0, float facf1, int width, if (s >= 1.0) { s = 1.0; } - hsv_to_rgb(h,s,v, &r, &g, &b); + hsv_to_rgb(h, s, v, &r, &g, &b); if (out->rect_float) { destf[0] = r; destf[1] = g; destf[2] = b; destf = destf + 4; - src1f +=4; - } else { - dest[0] = r*255.0; - dest[1] = g*255.0; - dest[2] = b*255.0; + src1f += 4; + } + else { + dest[0] = r * 255.0; + dest[1] = g * 255.0; + dest[2] = b * 255.0; dest += 4; } @@ -262,7 +268,7 @@ void plugin_seq_doit(Cast *cast, float facf0, float facf1, int width, } if (cast->debug) { - dest= (char *) out->rect; + dest = (char *) out->rect; for (c = 0; c < 10; c++) { x = 0; for (y = 0; y < 256; y++) { @@ -279,7 +285,7 @@ void plugin_seq_doit(Cast *cast, float facf0, float facf1, int width, for (c = 0; c < 10; c++) { x = 0; for (y = 0; y < 256; y++) { - char val = uv_table[y] * 255.0/10.0; + char val = uv_table[y] * 255.0 / 10.0; while (x < y * width / 255) { *dest++ = val; *dest++ = val; diff --git a/release/scripts/presets/operator/wm.collada_export/second_life.py b/release/scripts/presets/operator/wm.collada_export/second_life.py new file mode 100644 index 00000000000..5e04903470b --- /dev/null +++ b/release/scripts/presets/operator/wm.collada_export/second_life.py @@ -0,0 +1,7 @@ +import bpy +op = bpy.context.active_operator + +op.selected = True +op.apply_modifiers = True +op.include_bone_children = False +op.second_life = True diff --git a/release/scripts/startup/bl_operators/anim.py b/release/scripts/startup/bl_operators/anim.py index 2689cfda8eb..5a428467f12 100644 --- a/release/scripts/startup/bl_operators/anim.py +++ b/release/scripts/startup/bl_operators/anim.py @@ -223,6 +223,11 @@ class BakeAction(Operator): return {'FINISHED'} def invoke(self, context, event): + scene = context.scene + self.frame_start = scene.frame_start + self.frame_end = scene.frame_end + self.bake_types = {'POSE'} if context.mode == 'POSE' else {'OBJECT'} + wm = context.window_manager return wm.invoke_props_dialog(self) diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 2b820add10e..6fa7cbd0abd 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -1803,7 +1803,7 @@ class WM_OT_addon_remove(Operator): path, isdir = WM_OT_addon_remove.path_from_addon(self.module) if path is None: - self.report('WARNING', "Addon path %r could not be found" % path) + self.report({'WARNING'}, "Addon path %r could not be found" % path) return {'CANCELLED'} # in case its enabled diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 72429743c93..2e980f776a1 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -682,6 +682,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): row = row.row() row.active = md.use_rim row.prop(md, "material_offset_rim", text="Rim") + sub.prop(md, "use_flip_normals") def SUBSURF(self, layout, ob, md): layout.row().prop(md, "subdivision_type", expand=True) diff --git a/source/blender/blenkernel/intern/image_gen.c b/source/blender/blenkernel/intern/image_gen.c index f135bebb8ce..d460368784a 100644 --- a/source/blender/blenkernel/intern/image_gen.c +++ b/source/blender/blenkernel/intern/image_gen.c @@ -78,7 +78,9 @@ void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int widt float *rect_float_orig = rect_float; - float h = 0.0, hoffs = 0.0, hue = 0.0, s = 0.9, v = 0.9, r, g, b; + float h = 0.0, hoffs = 0.0; + float hsv[3] = {0.0f, 0.9f, 0.9f}; + float rgb[3]; /* checkers */ for (y = 0; y < height; y++) { @@ -128,20 +130,20 @@ void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int widt if ((fabs((x % checkerwidth) - (checkerwidth / 2)) < 1) || (fabs((y % checkerwidth) - (checkerwidth / 2)) < 1)) { - hue = fmodf(fabs(h - hoffs), 1.0f); - hsv_to_rgb(hue, s, v, &r, &g, &b); + hsv[0] = fmodf(fabs(h - hoffs), 1.0f); + hsv_to_rgb_v(hsv, rgb); if (rect) { - rect[0] = (char)(r * 255.0f); - rect[1] = (char)(g * 255.0f); - rect[2] = (char)(b * 255.0f); + rect[0] = (char)(rgb[0] * 255.0f); + rect[1] = (char)(rgb[1] * 255.0f); + rect[2] = (char)(rgb[2] * 255.0f); rect[3] = 255; } if (rect_float) { - rect_float[0] = r; - rect_float[1] = g; - rect_float[2] = b; + rect_float[0] = rgb[0]; + rect_float[1] = rgb[1]; + rect_float[2] = rgb[2]; rect_float[3] = 1.0f; } } @@ -162,33 +164,33 @@ void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int widt static void checker_board_color_fill(unsigned char *rect, float *rect_float, int width, int height) { int hue_step, y, x; - float hue, val, sat, r, g, b; + float hsv[3], rgb[3]; - sat = 1.0; + hsv[1] = 1.0; hue_step = power_of_2_max_i(width / 8); if (hue_step < 8) hue_step = 8; for (y = 0; y < height; y++) { - val = 0.1 + (y * (0.4 / height)); /* use a number lower then 1.0 else its too bright */ + hsv[2] = 0.1 + (y * (0.4 / height)); /* use a number lower then 1.0 else its too bright */ for (x = 0; x < width; x++) { - hue = (float)((double)(x / hue_step) * 1.0 / width * hue_step); - hsv_to_rgb(hue, sat, val, &r, &g, &b); + hsv[0] = (float)((double)(x / hue_step) * 1.0 / width * hue_step); + hsv_to_rgb_v(hsv, rgb); if (rect) { - rect[0] = (char)(r * 255.0f); - rect[1] = (char)(g * 255.0f); - rect[2] = (char)(b * 255.0f); + rect[0] = (char)(rgb[0] * 255.0f); + rect[1] = (char)(rgb[1] * 255.0f); + rect[2] = (char)(rgb[2] * 255.0f); rect[3] = 255; rect += 4; } if (rect_float) { - rect_float[0] = r; - rect_float[1] = g; - rect_float[2] = b; + rect_float[0] = rgb[0]; + rect_float[1] = rgb[1]; + rect_float[2] = rgb[2]; rect_float[3] = 1.0f; rect_float += 4; diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index b33ae202f1a..edb4348dc5a 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -1809,7 +1809,7 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM if((int)smd->time == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0)) { // create shadows straight after domain initialization so we get nice shadows for startframe, too if(get_lamp(scene, light)) - smoke_calc_transparency(sds->shadow, smoke_get_density(sds->fluid), sds->p0, sds->p1, sds->res, sds->dx * sds->scale, light, calc_voxel_transp, -7.0*sds->dx * sds->scale); + smoke_calc_transparency(sds->shadow, smoke_get_density(sds->fluid), sds->p0, sds->p1, sds->res, sds->dx, light, calc_voxel_transp, -7.0*sds->dx); if(sds->wt) { @@ -1840,7 +1840,7 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM // create shadows before writing cache so they get stored if(get_lamp(scene, light)) - smoke_calc_transparency(sds->shadow, smoke_get_density(sds->fluid), sds->p0, sds->p1, sds->res, sds->dx * sds->scale, light, calc_voxel_transp, -7.0*sds->dx * sds->scale); + smoke_calc_transparency(sds->shadow, smoke_get_density(sds->fluid), sds->p0, sds->p1, sds->res, sds->dx, light, calc_voxel_transp, -7.0*sds->dx); if(sds->wt) { diff --git a/source/blender/blenlib/BLI_math_color.h b/source/blender/blenlib/BLI_math_color.h index afdb5d40bd5..746a2b958ea 100644 --- a/source/blender/blenlib/BLI_math_color.h +++ b/source/blender/blenlib/BLI_math_color.h @@ -54,6 +54,7 @@ extern "C" { /******************* Conversion to RGB ********************/ void hsv_to_rgb(float h, float s, float v, float *r, float *g, float *b); +void hsv_to_rgb_v(const float hsv[3], float r_rgb[3]); void hex_to_rgb(char *hexcol, float *r, float *g, float *b); void yuv_to_rgb(float y, float u, float v, float *lr, float *lg, float *lb); void ycc_to_rgb(float y, float cb, float cr, float *lr, float *lg, float *lb, int colorspace); @@ -65,7 +66,9 @@ void cpack_to_rgb(unsigned int col, float *r, float *g, float *b); void rgb_to_yuv(float r, float g, float b, float *ly, float *lu, float *lv); void rgb_to_ycc(float r, float g, float b, float *ly, float *lcb, float *lcr, int colorspace); void rgb_to_hsv(float r, float g, float b, float *lh, float *ls, float *lv); +void rgb_to_hsv_v(const float rgb[3], float r_hsv[3]); void rgb_to_hsv_compat(float r, float g, float b, float *lh, float *ls, float *lv); +void rgb_to_hsv_compat_v(const float rgb[3], float r_hsv[3]); unsigned int rgb_to_cpack(float r, float g, float b); unsigned int hsv_to_cpack(float h, float s, float v); diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt index d4b9bc3d2bc..d535e190314 100644 --- a/source/blender/blenlib/CMakeLists.txt +++ b/source/blender/blenlib/CMakeLists.txt @@ -157,10 +157,6 @@ if(WITH_OPENMP) add_definitions(-DPARALLEL=1) endif() -if(WITH_XDG_USER_DIRS) - add_definitions(-DWITH_XDG_USER_DIRS) -endif() - if(WIN32) list(APPEND INC ../../../intern/utfconv diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c index abd9c1ea5b8..152fc98945f 100644 --- a/source/blender/blenlib/intern/math_color.c +++ b/source/blender/blenlib/intern/math_color.c @@ -90,6 +90,12 @@ void hsv_to_rgb(float h, float s, float v, float *r, float *g, float *b) } } +/* convenience function for now */ +void hsv_to_rgb_v(const float hsv[3], float r_rgb[3]) +{ + hsv_to_rgb(hsv[0], hsv[1], hsv[2], &r_rgb[0], &r_rgb[1], &r_rgb[2]); +} + void rgb_to_yuv(float r, float g, float b, float *ly, float *lu, float *lv) { float y, u, v; @@ -252,6 +258,12 @@ void rgb_to_hsv(float r, float g, float b, float *lh, float *ls, float *lv) *lv = v; } +/* convenience function for now */ +void rgb_to_hsv_v(const float rgb[3], float r_hsv[3]) +{ + rgb_to_hsv(rgb[0], rgb[1], rgb[2], &r_hsv[0], &r_hsv[1], &r_hsv[2]); +} + void rgb_to_hsv_compat(float r, float g, float b, float *lh, float *ls, float *lv) { float orig_h = *lh; @@ -272,6 +284,12 @@ void rgb_to_hsv_compat(float r, float g, float b, float *lh, float *ls, float *l } } +/* convenience function for now */ +void rgb_to_hsv_compat_v(const float rgb[3], float r_hsv[3]) +{ + rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], &r_hsv[0], &r_hsv[1], &r_hsv[2]); +} + /*http://brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html */ void xyz_to_rgb(float xc, float yc, float zc, float *r, float *g, float *b, int colorspace) diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index ed3eedb8e10..3c7e66f280a 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -77,22 +77,6 @@ # endif #endif /* WIN32 */ -/* standard paths */ -#ifdef WIN32 -# define BLENDER_USER_FORMAT "%s\\Blender Foundation\\Blender\\%s" -# define BLENDER_SYSTEM_FORMAT "%s\\Blender Foundation\\Blender\\%s" -#elif defined(__APPLE__) -# define BLENDER_USER_FORMAT "%s/Blender/%s" -# define BLENDER_SYSTEM_FORMAT "%s/Blender/%s" -#else /* UNIX */ -# ifndef WITH_XDG_USER_DIRS /* oldschool unix ~/.blender/ */ -# define BLENDER_USER_FORMAT "%s/.blender/%s" -# else /* new XDG ~/blender/.config/ */ -# define BLENDER_USER_FORMAT "%s/blender/%s" -# endif // WITH_XDG_USER_DIRS -# define BLENDER_SYSTEM_FORMAT "%s/blender/%s" -#endif - /* local */ #define UNIQUE_NAME_MAX 128 @@ -822,16 +806,12 @@ void BLI_getlastdir(const char *dir, char *last, const size_t maxlen) const char *BLI_getDefaultDocumentFolder(void) { #ifndef WIN32 + const char *xdg_documents_dir= getenv("XDG_DOCUMENTS_DIR"); -#ifdef WITH_XDG_USER_DIRS - const char *xdg_documents_dir = getenv("XDG_DOCUMENTS_DIR"); - if (xdg_documents_dir) { + if (xdg_documents_dir) return xdg_documents_dir; - } -#endif return getenv("HOME"); - #else /* Windows */ static char documentfolder[MAXPATHLEN]; HRESULT hResult; @@ -969,10 +949,9 @@ static int get_path_user(char *targetpath, const char *folder_name, const char * } } - user_base_path = (const char *)GHOST_getUserDir(); - if (user_base_path) { - BLI_snprintf(user_path, FILE_MAX, BLENDER_USER_FORMAT, user_base_path, blender_version_decimal(ver)); - } + user_base_path = (const char *)GHOST_getUserDir(ver, blender_version_decimal(ver)); + if (user_base_path) + BLI_strncpy(user_path, user_base_path, FILE_MAX); if (!user_path[0]) return 0; @@ -1040,10 +1019,9 @@ static int get_path_system(char *targetpath, const char *folder_name, const char } } - system_base_path = (const char *)GHOST_getSystemDir(); - if (system_base_path) { - BLI_snprintf(system_path, FILE_MAX, BLENDER_SYSTEM_FORMAT, system_base_path, blender_version_decimal(ver)); - } + system_base_path = (const char *)GHOST_getSystemDir(ver, blender_version_decimal(ver)); + if (system_base_path) + BLI_strncpy(system_path, system_base_path, FILE_MAX); if (!system_path[0]) return 0; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 207223126bd..34cebe1a968 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -533,8 +533,9 @@ static void read_file_version(FileData *fd, Main *main) } -static Main *blo_find_main(FileData *fd, ListBase *mainlist, const char *filepath, const char *relabase) +static Main *blo_find_main(FileData *fd, const char *filepath, const char *relabase) { + ListBase *mainlist = fd->mainlist; Main *m; Library *lib; char name1[FILE_MAX]; @@ -5946,14 +5947,14 @@ static void direct_link_library(FileData *fd, Library *lib, Main *main) { Main *newmain; - for (newmain = fd->mainlist.first; newmain; newmain = newmain->next) { + for (newmain = fd->mainlist->first; newmain; newmain = newmain->next) { if (newmain->curlib) { if (BLI_path_cmp(newmain->curlib->filepath, lib->filepath) == 0) { BKE_reportf_wrap(fd->reports, RPT_WARNING, "Library '%s', '%s' had multiple instances, save and reload!", lib->name, lib->filepath); - change_idid_adr(&fd->mainlist, fd, lib, newmain->curlib); + change_idid_adr(fd->mainlist, fd, lib, newmain->curlib); // change_idid_adr_fd(fd, lib, newmain->curlib); BLI_remlink(&main->library, lib); @@ -5973,7 +5974,7 @@ static void direct_link_library(FileData *fd, Library *lib, Main *main) /* new main */ newmain= MEM_callocN(sizeof(Main), "directlink"); - BLI_addtail(&fd->mainlist, newmain); + BLI_addtail(fd->mainlist, newmain); newmain->curlib = lib; lib->parent = NULL; @@ -7593,7 +7594,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Smoke) { SmokeModifierData *smd = (SmokeModifierData *)md; - if((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) { + if ((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) { int maxres = MAX3(smd->domain->res[0], smd->domain->res[1], smd->domain->res[2]); smd->domain->scale = smd->domain->dx * maxres; smd->domain->dx = 1.0f / smd->domain->scale; @@ -7794,10 +7795,12 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath) { BHead *bhead = blo_firstbhead(fd); BlendFileData *bfd; + ListBase mainlist = {NULL, NULL}; bfd = MEM_callocN(sizeof(BlendFileData), "blendfiledata"); bfd->main = MEM_callocN(sizeof(Main), "readfile_Main"); - BLI_addtail(&fd->mainlist, bfd->main); + BLI_addtail(&mainlist, bfd->main); + fd->mainlist = &mainlist; bfd->main->versionfile = fd->fileversion; @@ -7841,7 +7844,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath) /* always adds to the most recently loaded * ID_LI block, see direct_link_library. * this is part of the file format definition. */ - bhead = read_libblock(fd, fd->mainlist.last, bhead, LIB_READ+LIB_EXTERN, NULL); + bhead = read_libblock(fd, mainlist.last, bhead, LIB_READ+LIB_EXTERN, NULL); break; /* in 2.50+ files, the file identifier for screens is patched, forward compatibility */ @@ -7857,9 +7860,9 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath) // if (fd->memfile==NULL) (the mesh shuffle hacks don't work yet? ton) do_versions(fd, NULL, bfd->main); - read_libraries(fd, &fd->mainlist); + read_libraries(fd, &mainlist); - blo_join_main(&fd->mainlist); + blo_join_main(&mainlist); lib_link_all(fd, bfd->main); //do_versions_after_linking(fd, NULL, bfd->main); // XXX: not here (or even in this function at all)! this causes crashes on many files - Aligorith (July 04, 2010) @@ -7977,7 +7980,7 @@ static void expand_doit(FileData *fd, Main *mainvar, void *old) if (bheadlib) { Library *lib = read_struct(fd, bheadlib, "Library"); - Main *ptr = blo_find_main(fd, &fd->mainlist, lib->name, fd->relabase); + Main *ptr = blo_find_main(fd, lib->name, fd->relabase); id = is_yet_read(fd, ptr, bhead); @@ -8999,12 +9002,14 @@ static void append_id_part(FileData *fd, Main *mainvar, ID *id, ID **id_r) static Main *library_append_begin(Main *mainvar, FileData **fd, const char *filepath) { Main *mainl; + + (*fd)->mainlist = MEM_callocN(sizeof(ListBase), "FileData.mainlist"); /* make mains */ - blo_split_main(&(*fd)->mainlist, mainvar); + blo_split_main((*fd)->mainlist, mainvar); /* which one do we need? */ - mainl = blo_find_main(*fd, &(*fd)->mainlist, filepath, G.main->name); + mainl = blo_find_main(*fd, filepath, G.main->name); /* needed for do_version */ mainl->versionfile = (*fd)->fileversion; @@ -9030,7 +9035,7 @@ static void library_append_end(const bContext *C, Main *mainl, FileData **fd, in expand_main(*fd, mainl); /* do this when expand found other libs */ - read_libraries(*fd, &(*fd)->mainlist); + read_libraries(*fd, (*fd)->mainlist); curlib = mainl->curlib; @@ -9043,8 +9048,9 @@ static void library_append_end(const bContext *C, Main *mainl, FileData **fd, in BLI_path_rel(curlib->name, G.main->name); } - blo_join_main(&(*fd)->mainlist); - mainvar = (*fd)->mainlist.first; + blo_join_main((*fd)->mainlist); + mainvar = (*fd)->mainlist->first; + MEM_freeN((*fd)->mainlist); mainl = NULL; /* blo_join_main free's mainl, cant use anymore */ lib_link_all(*fd, mainvar); @@ -9140,6 +9146,12 @@ static void read_libraries(FileData *basefd, ListBase *mainlist) mainptr->curlib->filepath, mainptr->curlib->name); fd = blo_openblenderfile(mainptr->curlib->filepath, basefd->reports); + + /* share the mainlist, so all libraries are added immediately in a + * single list. it used to be that all FileData's had their own list, + * but with indirectly linking this meant we didn't catch duplicate + * libraries properly */ + fd->mainlist = mainlist; /* allow typing in a new lib path */ if (G.rt == -666) { @@ -9157,6 +9169,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist) cleanup_path(G.main->name, mainptr->curlib->filepath); fd = blo_openblenderfile(mainptr->curlib->filepath, basefd->reports); + fd->mainlist = mainlist; if (fd) { printf("found: '%s', party on macuno!\n", mainptr->curlib->filepath); @@ -9216,14 +9229,6 @@ static void read_libraries(FileData *basefd, ListBase *mainlist) } expand_main(fd, mainptr); - - /* dang FileData... now new libraries need to be appended to original filedata, - * it is not a good replacement for the old global (ton) */ - while (fd->mainlist.first) { - Main *mp = fd->mainlist.first; - BLI_remlink(&fd->mainlist, mp); - BLI_addtail(&basefd->mainlist, mp); - } } } diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h index aa388923f6b..a3aa8e783a0 100644 --- a/source/blender/blenloader/intern/readfile.h +++ b/source/blender/blenloader/intern/readfile.h @@ -87,7 +87,7 @@ typedef struct FileData { struct bheadsort *bheadmap; int tot_bheadmap; - ListBase mainlist; + ListBase *mainlist; /* ick ick, used to return * data through streamglue. diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index 593010fae09..a73651d7664 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -191,9 +191,9 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu) /* used to determine the color of F-Curves with FCURVE_COLOR_AUTO_RAINBOW set */ //void fcurve_rainbow (unsigned int cur, unsigned int tot, float *out) -void getcolor_fcurve_rainbow(int cur, int tot, float *out) +void getcolor_fcurve_rainbow(int cur, int tot, float out[3]) { - float hue, val, sat, fac; + float hsv[3], fac; int grouping; /* we try to divide the color into groupings of n colors, @@ -203,7 +203,7 @@ void getcolor_fcurve_rainbow(int cur, int tot, float *out) * so the base color is simply one of the three primary colors */ grouping = (4 - (tot % 2)); - hue = HSV_BANDWIDTH * (float)(cur % grouping); + hsv[0] = HSV_BANDWIDTH * (float)(cur % grouping); /* 'Value' (i.e. darkness) needs to vary so that larger sets of three will be * 'darker' (i.e. smaller value), so that they don't look that similar to previous ones. @@ -213,16 +213,15 @@ void getcolor_fcurve_rainbow(int cur, int tot, float *out) fac = ((float)cur / (float)tot) * 0.7f; /* the base color can get offset a bit so that the colors aren't so identical */ - hue += fac * HSV_BANDWIDTH; - if (hue > 1.0f) hue = fmod(hue, 1.0f); + hsv[0] += fac * HSV_BANDWIDTH; + if (hsv[0] > 1.0f) hsv[0] = fmod(hsv[0], 1.0f); /* saturation adjustments for more visible range */ - if ((hue > 0.5f) && (hue < 0.8f)) sat = 0.5f; - else sat = 0.6f; + hsv[1] = ((hsv[0] > 0.5f) && (hsv[0] < 0.8f)) ? 0.5f : 0.6f; /* value is fixed at 1.0f, otherwise we cannot clearly see the curves... */ - val = 1.0f; + hsv[2] = 1.0f; /* finally, conver this to RGB colors */ - hsv_to_rgb(hue, sat, val, out, out + 1, out + 2); + hsv_to_rgb_v(hsv, out); } diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index f4d922dba3c..4f24d254cbf 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -509,7 +509,7 @@ short ANIM_fmodifiers_paste_from_buf(ListBase *modifiers, short replace); int getname_anim_fcurve(char *name, struct ID *id, struct FCurve *fcu); /* Automatically determine a color for the nth F-Curve */ -void getcolor_fcurve_rainbow(int cur, int tot, float *out); +void getcolor_fcurve_rainbow(int cur, int tot, float out[3]); /* ----------------- NLA-Mapping ----------------------- */ /* anim_draw.c */ diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 3b93eab3192..4faf82eec36 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -113,10 +113,11 @@ void ED_screen_full_restore(struct bContext *C, ScrArea *sa); struct ScrArea *ED_screen_full_toggle(struct bContext *C, struct wmWindow *win, struct ScrArea *sa); /* anim */ -void ED_update_for_newframe(struct Main *bmain, struct Scene *scene, struct bScreen *screen, int mute); +void ED_update_for_newframe(struct Main *bmain, struct Scene *scene, int mute); void ED_refresh_viewport_fps(struct bContext *C); -int ED_screen_animation_play(struct bContext *C, int sync, int mode); +int ED_screen_animation_play(struct bContext *C, int sync, int mode); +bScreen *ED_screen_animation_playing(const struct wmWindowManager *wm); /* screen keymaps */ void ED_operatortypes_screen(void); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index c0cd17d16d2..5394cb46049 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1437,15 +1437,15 @@ double ui_get_but_val(uiBut *but) } } else if (but->type == HSVSLI) { - float h, s, v, *fp; + float *fp, hsv[3]; fp = (but->editvec) ? but->editvec : (float *)but->poin; - rgb_to_hsv(fp[0], fp[1], fp[2], &h, &s, &v); + rgb_to_hsv_v(fp, hsv); switch (but->str[0]) { - case 'H': value = h; break; - case 'S': value = s; break; - case 'V': value = v; break; + case 'H': value = hsv[0]; break; + case 'S': value = hsv[1]; break; + case 'V': value = hsv[2]; break; } } else if (but->pointype == CHA) { @@ -1513,18 +1513,18 @@ void ui_set_but_val(uiBut *but, double value) } else if (but->pointype == 0) ; else if (but->type == HSVSLI) { - float h, s, v, *fp; + float *fp, hsv[3]; fp = (but->editvec) ? but->editvec : (float *)but->poin; - rgb_to_hsv(fp[0], fp[1], fp[2], &h, &s, &v); + rgb_to_hsv_v(fp, hsv); switch (but->str[0]) { - case 'H': h = value; break; - case 'S': s = value; break; - case 'V': v = value; break; + case 'H': hsv[0] = value; break; + case 'S': hsv[1] = value; break; + case 'V': hsv[2] = value; break; } - hsv_to_rgb(h, s, v, fp, fp + 1, fp + 2); + hsv_to_rgb_v(hsv, fp); } else { diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 428ddb3059f..edb0bdc05f5 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -2953,14 +2953,14 @@ static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, wm float col[3]; ui_get_but_vectorf(but, col); - rgb_to_hsv_compat(col[0], col[1], col[2], hsv, hsv + 1, hsv + 2); + rgb_to_hsv_compat_v(col, hsv); if (event->type == WHEELDOWNMOUSE) hsv[2] = CLAMPIS(hsv[2] - 0.05f, 0.0f, 1.0f); else hsv[2] = CLAMPIS(hsv[2] + 0.05f, 0.0f, 1.0f); - hsv_to_rgb(hsv[0], hsv[1], hsv[2], data->vec, data->vec + 1, data->vec + 2); + hsv_to_rgb_v(hsv, data->vec); ui_set_but_vectorf(but, data->vec); button_activate_state(C, but, BUTTON_STATE_EXIT); @@ -3106,7 +3106,7 @@ static int ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, int mx, ui_get_but_vectorf(but, rgb); - rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2); + rgb_to_hsv_compat_v(rgb, hsv); /* relative position within box */ x = ((float)mx - but->x1) / (but->x2 - but->x1); @@ -3152,7 +3152,7 @@ static int ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, int mx, assert(!"invalid hsv type"); } - hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb + 1, rgb + 2); + hsv_to_rgb_v(hsv, rgb); copy_v3_v3(data->vec, rgb); data->draglastx = mx; @@ -3175,7 +3175,7 @@ static void ui_ndofedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, wmNDOF } ui_get_but_vectorf(but, rgb); - rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2); + rgb_to_hsv_compat_v(rgb, hsv); switch ((int)but->a1) { case UI_GRAD_SV: @@ -3213,7 +3213,7 @@ static void ui_ndofedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, wmNDOF assert(!"invalid hsv type"); } - hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb + 1, rgb + 2); + hsv_to_rgb_v(hsv, rgb); copy_v3_v3(data->vec, rgb); ui_set_but_vectorf(but, data->vec); } @@ -3265,12 +3265,15 @@ static int ui_do_but_HSVCUBE(bContext *C, uiBlock *block, uiBut *but, uiHandleBu def = MEM_callocN(sizeof(float) * len, "reset_defaults - float"); RNA_property_float_get_default_array(&but->rnapoin, but->rnaprop, def); - rgb_to_hsv(def[0], def[1], def[2], def_hsv, def_hsv + 1, def_hsv + 2); + rgb_to_hsv_v(def, def_hsv); ui_get_but_vectorf(but, rgb); - rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2); + rgb_to_hsv_compat_v(rgb, hsv); + + def_hsv[0] = hsv[0]; + def_hsv[1] = hsv[1]; - hsv_to_rgb(hsv[0], hsv[1], def_hsv[2], rgb, rgb + 1, rgb + 2); + hsv_to_rgb_v(def_hsv, rgb); ui_set_but_vectorf(but, rgb); RNA_property_update(C, &but->rnapoin, but->rnaprop); @@ -3314,7 +3317,7 @@ static int ui_numedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, int mx ui_get_but_vectorf(but, rgb); copy_v3_v3(hsv, ui_block_hsv_get(but->block)); - rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2); + rgb_to_hsv_compat_v(rgb, hsv); /* exception, when using color wheel in 'locked' value state: * allow choosing a hue for black values, by giving a tiny increment */ @@ -3334,7 +3337,7 @@ static int ui_numedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, int mx if (but->flag & UI_BUT_COLOR_CUBIC) hsv[1] = 1.0f - sqrt3f(1.0f - hsv[1]); - hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb + 1, rgb + 2); + hsv_to_rgb_v(hsv, rgb); if ((but->flag & UI_BUT_VEC_SIZE_LOCK) && (rgb[0] || rgb[1] || rgb[2])) { normalize_v3(rgb); @@ -3357,7 +3360,7 @@ static void ui_ndofedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, wmND float sensitivity = (shift ? 0.15f : 0.3f) * ndof->dt; ui_get_but_vectorf(but, rgb); - rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2); + rgb_to_hsv_compat_v(rgb, hsv); /* Convert current colour on hue/sat disc to circular coordinates phi, r */ phi = fmodf(hsv[0] + 0.25f, 1.0f) * -2.0f * (float)M_PI; @@ -3391,7 +3394,7 @@ static void ui_ndofedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, wmND if (hsv[2] == 0.0f) hsv[2] = 0.0001f; } - hsv_to_rgb(hsv[0], hsv[1], hsv[2], data->vec, data->vec + 1, data->vec + 2); + hsv_to_rgb_v(hsv, data->vec); if ((but->flag & UI_BUT_VEC_SIZE_LOCK) && (data->vec[0] || data->vec[1] || data->vec[2])) { normalize_v3(data->vec); @@ -3447,12 +3450,15 @@ static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandle def = MEM_callocN(sizeof(float) * len, "reset_defaults - float"); RNA_property_float_get_default_array(&but->rnapoin, but->rnaprop, def); - rgb_to_hsv(def[0], def[1], def[2], def_hsv, def_hsv + 1, def_hsv + 2); + rgb_to_hsv_v(def, def_hsv); ui_get_but_vectorf(but, rgb); - rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2); + rgb_to_hsv_compat_v(rgb, hsv); - hsv_to_rgb(hsv[0], def_hsv[1], hsv[2], rgb, rgb + 1, rgb + 2); + def_hsv[0] = hsv[0]; + def_hsv[2] = hsv[2]; + + hsv_to_rgb_v(def_hsv, rgb); ui_set_but_vectorf(but, rgb); RNA_property_update(C, &but->rnapoin, but->rnaprop); @@ -6546,6 +6552,18 @@ static int ui_handler_popup(bContext *C, wmEvent *event, void *userdata) { uiPopupBlockHandle *menu = userdata; + /* we block all events, this is modal interaction, except for drop events which is described below */ + int retval = WM_UI_HANDLER_BREAK; + + if (event->type == EVT_DROP) { + /* if we're handling drop event we'll want it to be handled by popup callee as well, + * so it'll be possible to perform such operations as opening .blend files by dropping + * them into blender even if there's opened popup like splash screen (sergey) + */ + + retval = WM_UI_HANDLER_CONTINUE; + } + ui_handle_menus_recursive(C, event, menu); /* free if done, does not free handle itself */ @@ -6574,8 +6592,7 @@ static int ui_handler_popup(bContext *C, wmEvent *event, void *userdata) /* delayed apply callbacks */ ui_apply_but_funcs_after(C); - /* we block all events, this is modal interaction */ - return WM_UI_HANDLER_BREAK; + return retval; } static void ui_handler_remove_popup(bContext *C, void *userdata) diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 5459f689e9f..b690d1f9dc9 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -339,13 +339,13 @@ static void rgb_tint(float col[3], float col_hsv_from[3]; float col_hsv_to[3]; - rgb_to_hsv(col[0], col[1], col[2], col_hsv_from + 0, col_hsv_from + 1, col_hsv_from + 2); + rgb_to_hsv_v(col, col_hsv_from); col_hsv_to[0] = h; col_hsv_to[1] = h_strength; col_hsv_to[2] = (col_hsv_from[2] * (1.0f - v_strength)) + (v * v_strength); - hsv_to_rgb(col_hsv_to[0], col_hsv_to[1], col_hsv_to[2], col + 0, col + 1, col + 2); + hsv_to_rgb_v(col_hsv_to, col); } static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *ar) @@ -1847,7 +1847,7 @@ void ui_set_but_hsv(uiBut *but) float col[3]; float *hsv = ui_block_hsv_get(but->block); - hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col + 1, col + 2); + hsv_to_rgb_v(hsv, col); ui_set_but_vectorf(but, col); } @@ -1860,7 +1860,7 @@ static void ui_update_block_buts_rgb(uiBlock *block, const float rgb[3]) /* this is to keep the H and S value when V is equal to zero * and we are working in HSV mode, of course! */ - rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2); + rgb_to_hsv_compat_v(rgb, hsv); // this updates button strings, is hackish... but button pointers are on stack of caller function for (bt = block->buttons.first; bt; bt = bt->next) { @@ -1942,7 +1942,7 @@ static void do_hsv_rna_cb(bContext *UNUSED(C), void *bt1, void *UNUSED(arg)) float rgb[3]; float *hsv = ui_block_hsv_get(but->block); - hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb + 1, rgb + 2); + hsv_to_rgb_v(hsv, rgb); ui_update_block_buts_rgb(but->block, rgb); @@ -2157,7 +2157,7 @@ static void uiBlockPicker(uiBlock *block, float rgba[4], PointerRNA *ptr, Proper uiButSetFunc(bt, do_hex_rna_cb, bt, hexcol); uiDefBut(block, LABEL, 0, IFACE_("(Gamma Corrected)"), 0, -80, butwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); - rgb_to_hsv(rgba[0], rgba[1], rgba[2], hsv, hsv + 1, hsv + 2); + rgb_to_hsv_v(rgba, hsv); picker_new_hide_reveal(block, colormode); } @@ -2178,18 +2178,18 @@ static int ui_picker_small_wheel_cb(const bContext *UNUSED(C), uiBlock *block, w for (but = block->buttons.first; but; but = but->next) { if (but->type == HSVCUBE && but->active == NULL) { uiPopupBlockHandle *popup = block->handle; - float col[3]; + float rgb[3]; float *hsv = ui_block_hsv_get(block); - ui_get_but_vectorf(but, col); + ui_get_but_vectorf(but, rgb); - rgb_to_hsv_compat(col[0], col[1], col[2], hsv, hsv + 1, hsv + 2); + rgb_to_hsv_compat_v(rgb, hsv); hsv[2] = CLAMPIS(hsv[2] + add, 0.0f, 1.0f); - hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col + 1, col + 2); + hsv_to_rgb_v(hsv, rgb); - ui_set_but_vectorf(but, col); + ui_set_but_vectorf(but, rgb); - ui_update_block_buts_rgb(block, col); + ui_update_block_buts_rgb(block, rgb); if (popup) popup->menuretval = UI_RETURN_UPDATE; diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 4d483b69ca2..87c2f2dc20b 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1885,7 +1885,7 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, rcti *rect) /* color */ ui_get_but_vectorf(but, rgb); copy_v3_v3(hsv, ui_block_hsv_get(but->block)); - rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2); + rgb_to_hsv_compat_v(rgb, hsv); copy_v3_v3(hsvo, hsv); /* exception: if 'lock' is set @@ -1911,7 +1911,7 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, rcti *rect) ui_hsvcircle_vals_from_pos(hsv, hsv + 1, rect, centx + co * radius, centy + si * radius); CLAMP(hsv[2], 0.0f, 1.0f); /* for display only */ - hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col + 1, col + 2); + hsv_to_rgb_v(hsv, col); glColor3fv(col); glVertex2f(centx + co * radius, centy + si * radius); } @@ -2081,37 +2081,31 @@ void ui_draw_gradient(rcti *rect, const float hsv[3], int type, float alpha) static void ui_draw_but_HSVCUBE(uiBut *but, rcti *rect) { - float rgb[3], h, s, v; + float rgb[3]; float x = 0.0f, y = 0.0f; float *hsv = ui_block_hsv_get(but->block); - float hsvn[3]; + float hsv_n[3]; - h = hsv[0]; - s = hsv[1]; - v = hsv[2]; + copy_v3_v3(hsv_n, hsv); ui_get_but_vectorf(but, rgb); - rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], &h, &s, &v); - - hsvn[0] = h; - hsvn[1] = s; - hsvn[2] = v; + rgb_to_hsv_compat_v(rgb, hsv_n); - ui_draw_gradient(rect, hsvn, but->a1, 1.f); + ui_draw_gradient(rect, hsv_n, but->a1, 1.0f); switch ((int)but->a1) { case UI_GRAD_SV: - x = v; y = s; break; + x = hsv_n[2]; y = hsv_n[1]; break; case UI_GRAD_HV: - x = h; y = v; break; + x = hsv_n[0]; y = hsv_n[2]; break; case UI_GRAD_HS: - x = h; y = s; break; + x = hsv_n[0]; y = hsv_n[1]; break; case UI_GRAD_H: - x = h; y = 0.5; break; + x = hsv_n[0]; y = 0.5; break; case UI_GRAD_S: - x = s; y = 0.5; break; + x = hsv_n[1]; y = 0.5; break; case UI_GRAD_V: - x = v; y = 0.5; break; + x = hsv_n[2]; y = 0.5; break; } /* cursor */ @@ -2140,7 +2134,7 @@ static void ui_draw_but_HSV_v(uiBut *but, rcti *rect) color_profile = BLI_PR_NONE; ui_get_but_vectorf(but, rgb); - rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2); + rgb_to_hsv_v(rgb, hsv); v = hsv[2]; if (color_profile) diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index fe5fafb0ca0..76967d61b9e 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -107,6 +107,17 @@ #include "object_intern.h" +/* this is an exact copy of the define in rna_lamp.c + * kept here because of linking order */ +EnumPropertyItem lamp_type_items[] = { + {LA_LOCAL, "POINT", 0, "Point", "Omnidirectional point light source"}, + {LA_SUN, "SUN", 0, "Sun", "Constant direction parallel ray light source"}, + {LA_SPOT, "SPOT", 0, "Spot", "Directional cone light source"}, + {LA_HEMI, "HEMI", 0, "Hemi", "180 degree constant light source"}, + {LA_AREA, "AREA", 0, "Area", "Directional area light source"}, + {0, NULL, 0, NULL, NULL} +}; + /************************** Exported *****************************/ void ED_object_location_from_view(bContext *C, float *loc) @@ -742,15 +753,7 @@ static int object_lamp_add_exec(bContext *C, wmOperator *op) } void OBJECT_OT_lamp_add(wmOperatorType *ot) -{ - static EnumPropertyItem lamp_type_items[] = { - {LA_LOCAL, "POINT", ICON_LAMP_POINT, "Point", "Omnidirectional point light source"}, - {LA_SUN, "SUN", ICON_LAMP_SUN, "Sun", "Constant direction parallel ray light source"}, - {LA_SPOT, "SPOT", ICON_LAMP_SPOT, "Spot", "Directional cone light source"}, - {LA_HEMI, "HEMI", ICON_LAMP_HEMI, "Hemi", "180 degree constant light source"}, - {LA_AREA, "AREA", ICON_LAMP_AREA, "Area", "Directional area light source"}, - {0, NULL, 0, NULL, NULL}}; - +{ /* identifiers */ ot->name = "Add Lamp"; ot->description = "Add a lamp object to the scene"; diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 9e891353f35..79a9a29ae8f 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -2023,7 +2023,7 @@ static int ocean_bake_exec(bContext *C, wmOperator *op) * this part of the process before a threaded job is created */ //scene->r.cfra = f; - //ED_update_for_newframe(CTX_data_main(C), scene, CTX_wm_screen(C), 1); + //ED_update_for_newframe(CTX_data_main(C), scene, 1); /* ok, this doesn't work with drivers, but is way faster. * let's use this for now and hope nobody wants to drive the time value... */ diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 0c0611d3d33..b5a0451b507 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -1809,7 +1809,6 @@ static void vgroup_active_remove_verts(Object *ob, const int allverts, bDeformGr } else { MVert *mv; - MDeformVert *dv; int i; if (!me->dvert) { diff --git a/source/blender/editors/physics/dynamicpaint_ops.c b/source/blender/editors/physics/dynamicpaint_ops.c index c82e0459218..ea8718f0e66 100644 --- a/source/blender/editors/physics/dynamicpaint_ops.c +++ b/source/blender/editors/physics/dynamicpaint_ops.c @@ -285,7 +285,7 @@ static int dynamicPaint_bakeImageSequence(bContext *C, DynamicPaintSurface *surf /* Set frame to start point (also inits modifier data) */ frame = surface->start_frame; scene->r.cfra = (int)frame; - ED_update_for_newframe(CTX_data_main(C), scene, win->screen, 1); + ED_update_for_newframe(CTX_data_main(C), scene, 1); /* Init surface */ if (!dynamicPaint_createUVSurface(surface)) return 0; @@ -303,7 +303,7 @@ static int dynamicPaint_bakeImageSequence(bContext *C, DynamicPaintSurface *surf /* calculate a frame */ scene->r.cfra = (int)frame; - ED_update_for_newframe(CTX_data_main(C), scene, win->screen, 1); + ED_update_for_newframe(CTX_data_main(C), scene, 1); if (!dynamicPaint_calculateFrame(surface, scene, cObject, frame)) return 0; /* diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index c8ca75835e4..b31e5c0aea3 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -419,7 +419,7 @@ static void fluid_init_all_channels(bContext *C, Object *UNUSED(fsDomain), Fluid /* Modifying the global scene isn't nice, but we can do it in * this part of the process before a threaded job is created */ scene->r.cfra = (int)eval_time; - ED_update_for_newframe(CTX_data_main(C), scene, CTX_wm_screen(C), 1); + ED_update_for_newframe(CTX_data_main(C), scene, 1); /* now scene data should be current according to animation system, so we fill the channels */ @@ -967,7 +967,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor /* reset to original current frame */ scene->r.cfra = origFrame; - ED_update_for_newframe(CTX_data_main(C), scene, CTX_wm_screen(C), 1); + ED_update_for_newframe(CTX_data_main(C), scene, 1); /* ******** init domain object's matrix ******** */ copy_m4_m4(domainMat, fsDomain->obmat); diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 7b4dda1a48f..b7bd027ba7f 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -236,7 +236,7 @@ static int screen_render_exec(bContext *C, wmOperator *op) RE_SetReports(re, NULL); // no redraw needed, we leave state as we entered it - ED_update_for_newframe(mainp, scene, CTX_wm_screen(C), 1); + ED_update_for_newframe(mainp, scene, 1); WM_event_add_notifier(C, NC_SCENE | ND_RENDER_RESULT, scene); @@ -408,7 +408,7 @@ static void render_endjob(void *rjv) /* else the frame will not update for the original value */ if (!(rj->scene->r.scemode & R_NO_FRAME_UPDATE)) - ED_update_for_newframe(G.main, rj->scene, rj->win->screen, 1); + ED_update_for_newframe(G.main, rj->scene, 1); /* XXX above function sets all tags in nodes */ ntreeCompositClearTags(rj->scene->nodetree); @@ -470,7 +470,6 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) Main *mainp; Scene *scene = CTX_data_scene(C); SceneRenderLayer *srl = NULL; - bScreen *screen = CTX_wm_screen(C); View3D *v3d = CTX_wm_view3d(C); Render *re; wmJob *steve; @@ -507,7 +506,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) mainp = CTX_data_main(C); /* cancel animation playback */ - if (screen->animtimer) + if (ED_screen_animation_playing(CTX_wm_manager(C))) ED_screen_animation_play(C, 0, 0); /* handle UI stuff */ diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index f973d3cc070..37ab87780b5 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1506,7 +1506,7 @@ void ED_screen_set_scene(bContext *C, bScreen *screen, Scene *scene) BKE_scene_set_background(bmain, scene); ED_render_engine_changed(bmain); - ED_update_for_newframe(bmain, scene, screen, 1); + ED_update_for_newframe(bmain, scene, 1); /* complete redraw */ WM_event_add_notifier(C, NC_WINDOW, NULL); @@ -1750,10 +1750,12 @@ void ED_screen_animation_timer(bContext *C, int redraws, int refresh, int sync, wmWindowManager *wm = CTX_wm_manager(C); wmWindow *win = CTX_wm_window(C); Scene *scene = CTX_data_scene(C); + bScreen *stopscreen = ED_screen_animation_playing(wm); - if (screen->animtimer) - WM_event_remove_timer(wm, win, screen->animtimer); - screen->animtimer = NULL; + if (stopscreen) { + WM_event_remove_timer(wm, win, stopscreen->animtimer); + stopscreen->animtimer = NULL; + } if (enable) { ScreenAnimData *sad = MEM_callocN(sizeof(ScreenAnimData), "ScreenAnimData"); @@ -1777,8 +1779,9 @@ void ED_screen_animation_timer(bContext *C, int redraws, int refresh, int sync, screen->animtimer->customdata = sad; } + /* notifier catched by top header, for button */ - WM_event_add_notifier(C, NC_SCREEN | ND_ANIMPLAY, screen); + WM_event_add_notifier(C, NC_SCREEN | ND_ANIMPLAY, NULL); } /* helper for screen_animation_play() - only to be used for TimeLine */ @@ -1821,8 +1824,12 @@ void ED_screen_animation_timer_update(bScreen *screen, int redraws, int refresh) /* results in fully updated anim system * screen can be NULL */ -void ED_update_for_newframe(Main *bmain, Scene *scene, bScreen *screen, int UNUSED(mute)) -{ +void ED_update_for_newframe(Main *bmain, Scene *scene, int UNUSED(mute)) +{ + wmWindowManager *wm = bmain->wm.first; + wmWindow *window; + int layers = 0; + #ifdef DURIAN_CAMERA_SWITCH void *camera = BKE_scene_camera_switch_find(scene); if (camera && scene->camera != camera) { @@ -1843,9 +1850,12 @@ void ED_update_for_newframe(Main *bmain, Scene *scene, bScreen *screen, int UNUS ED_clip_update_frame(bmain, scene->r.cfra); + /* get layers from all windows */ + for (window = wm->windows.first; window; window = window->next) + layers |= BKE_screen_visible_layers(window->screen, scene); + /* this function applies the changes too */ - /* XXX future: do all windows */ - BKE_scene_update_for_newframe(bmain, scene, BKE_screen_visible_layers(screen, scene)); /* BKE_scene.h */ + BKE_scene_update_for_newframe(bmain, scene, layers); /* BKE_scene.h */ //if ( (CFRA>1) && (!mute) && (scene->r.audio.flag & AUDIO_SCRUB)) // audiostream_scrub( CFRA ); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index f8fad8d037a..566d3933408 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2913,6 +2913,8 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *e Scene *scene = CTX_data_scene(C); wmTimer *wt = screen->animtimer; ScreenAnimData *sad = wt->customdata; + wmWindowManager *wm = CTX_wm_manager(C); + wmWindow *window; ScrArea *sa; int sync; float time; @@ -2993,22 +2995,24 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *e sound_seek_scene(bmain, scene); /* since we follow drawflags, we can't send notifier but tag regions ourselves */ - ED_update_for_newframe(CTX_data_main(C), scene, screen, 1); - - for (sa = screen->areabase.first; sa; sa = sa->next) { - ARegion *ar; - for (ar = sa->regionbase.first; ar; ar = ar->next) { - if (ar == sad->ar) - ED_region_tag_redraw(ar); - else - if (match_region_with_redraws(sa->spacetype, ar->regiontype, sad->redraws)) - ED_region_tag_redraw(ar); + ED_update_for_newframe(CTX_data_main(C), scene, 1); + + for (window = wm->windows.first; window; window = window->next) { + for (sa = window->screen->areabase.first; sa; sa = sa->next) { + ARegion *ar; + for (ar = sa->regionbase.first; ar; ar = ar->next) { + if (ar == sad->ar) + ED_region_tag_redraw(ar); + else + if (match_region_with_redraws(sa->spacetype, ar->regiontype, sad->redraws)) + ED_region_tag_redraw(ar); + } + + if (match_area_with_refresh(sa->spacetype, sad->refresh)) + ED_area_tag_refresh(sa); } - - if (match_area_with_refresh(sa->spacetype, sad->refresh)) - ED_area_tag_refresh(sa); } - + /* update frame rate info too * NOTE: this may not be accurate enough, since we might need this after modifiers/etc. * have been calculated instead of just before updates have been done? @@ -3042,13 +3046,25 @@ static void SCREEN_OT_animation_step(wmOperatorType *ot) /* ****************** anim player, starts or ends timer ***************** */ +/* find window that owns the animation timer */ +bScreen *ED_screen_animation_playing(const wmWindowManager *wm) +{ + wmWindow *window; + + for (window = wm->windows.first; window; window = window->next) + if (window->screen->animtimer) + return window->screen; + + return NULL; +} + /* toggle operator */ int ED_screen_animation_play(bContext *C, int sync, int mode) { bScreen *screen = CTX_wm_screen(C); Scene *scene = CTX_data_scene(C); - if (screen->animtimer) { + if (ED_screen_animation_playing(CTX_wm_manager(C))) { /* stop playback now */ ED_screen_animation_timer(C, 0, 0, 0, 0); sound_stop_scene(scene); @@ -3105,9 +3121,9 @@ static void SCREEN_OT_animation_play(wmOperatorType *ot) static int screen_animation_cancel_exec(bContext *C, wmOperator *op) { - bScreen *screen = CTX_wm_screen(C); + bScreen *screen = ED_screen_animation_playing(CTX_wm_manager(C)); - if (screen->animtimer) { + if (screen) { if (RNA_boolean_get(op->ptr, "restore_frame")) { ScreenAnimData *sad = screen->animtimer->customdata; Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 5131b728646..73eb8ee77ff 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -36,6 +36,7 @@ #include "DNA_userdef_types.h" #include "DNA_scene_types.h" /* min/max frames */ +#include "BLI_path_util.h" #include "BLI_utildefines.h" #include "BLI_math.h" @@ -123,7 +124,7 @@ static void sclip_zoom_set_factor_exec(bContext *C, wmEvent *event, float factor static void clip_filesel(bContext *C, wmOperator *op, const char *path) { - RNA_string_set(op->ptr, "filepath", path); + RNA_string_set(op->ptr, "directory", path); WM_event_add_fileselect(C, op); } @@ -153,7 +154,28 @@ static int open_exec(bContext *C, wmOperator *op) MovieClip *clip = NULL; char str[FILE_MAX]; - RNA_string_get(op->ptr, "filepath", str); + if (RNA_collection_length(op->ptr, "files")) { + PointerRNA fileptr; + PropertyRNA *prop; + char dir_only[FILE_MAX], file_only[FILE_MAX]; + int relative = RNA_boolean_get(op->ptr, "relative_path"); + + RNA_string_get(op->ptr, "directory", dir_only); + if (relative) + BLI_path_rel(dir_only, G.main->name); + + prop = RNA_struct_find_property(op->ptr, "files"); + RNA_property_collection_lookup_int(op->ptr, prop, 0, &fileptr); + RNA_string_get(&fileptr, "name", file_only); + + BLI_join_dirfile(str, sizeof(str), dir_only, file_only); + } + else { + BKE_reportf(op->reports, RPT_ERROR, "No files selected to be opened"); + + return OPERATOR_CANCELLED; + } + /* default to frame 1 if there's no scene in context */ errno = 0; @@ -199,14 +221,21 @@ static int open_exec(bContext *C, wmOperator *op) static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { SpaceClip *sc = CTX_wm_space_clip(C); - char *path = U.textudir; + char path[FILE_MAX]; MovieClip *clip = NULL; if (sc) clip = ED_space_clip(sc); - if (clip) - path = clip->name; + if (clip) { + strncpy(path, clip->name, sizeof(path)); + + BLI_path_abs(path, G.main->name); + BLI_parent_dir(path); + } + else { + strncpy(path, U.textudir, sizeof(path)); + } if (!RNA_struct_property_is_set(op->ptr, "relative_path")) RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); @@ -238,7 +267,8 @@ void CLIP_OT_open(wmOperatorType *ot) /* properties */ WM_operator_properties_filesel(ot, FOLDERFILE | IMAGEFILE | MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, - WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY); + WM_FILESEL_RELPATH | WM_FILESEL_FILES | WM_FILESEL_DIRECTORY, + FILE_DEFAULTDISPLAY); } /******************* reload clip operator *********************/ diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index 026493a3059..3f4d329c503 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -1713,7 +1713,7 @@ static void track_markers_freejob(void *tmv) tmj->clip->tracking_context = NULL; tmj->scene->r.cfra = tmj->lastfra; - ED_update_for_newframe(tmj->main, tmj->scene, tmj->screen, 0); + ED_update_for_newframe(tmj->main, tmj->scene, 0); BKE_tracking_sync(tmj->context); BKE_tracking_context_free(tmj->context); diff --git a/source/blender/editors/space_image/CMakeLists.txt b/source/blender/editors/space_image/CMakeLists.txt index 3975a5f56f3..f397f2387d7 100644 --- a/source/blender/editors/space_image/CMakeLists.txt +++ b/source/blender/editors/space_image/CMakeLists.txt @@ -46,6 +46,10 @@ set(SRC image_intern.h ) +if(WITH_INTERNATIONAL) + add_definitions(-DWITH_INTERNATIONAL) +endif() + if(WITH_IMAGE_OPENJPEG) add_definitions(-DWITH_OPENJPEG) endif() diff --git a/source/blender/editors/space_image/SConscript b/source/blender/editors/space_image/SConscript index 759d4592992..737da4aac74 100644 --- a/source/blender/editors/space_image/SConscript +++ b/source/blender/editors/space_image/SConscript @@ -9,6 +9,8 @@ incs += ' ../../bmesh ../../render/extern/include ../../makesrna ../../blenloade defs = [] +if env['WITH_BF_INTERNATIONAL']: + defs.append('WITH_INTERNATIONAL') if env['WITH_BF_OPENEXR']: defs.append('WITH_OPENEXR') if env['WITH_BF_OPENJPEG']: diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index de171bc45f8..f8815c3865e 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -44,6 +44,8 @@ #include "BLI_rand.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "BKE_colortools.h" #include "BKE_context.h" #include "BKE_customdata.h" @@ -104,36 +106,36 @@ static void image_info(Scene *scene, ImageUser *iuser, Image *ima, ImBuf *ibuf, if (ima == NULL) return; if (ibuf == NULL) { - ofs += sprintf(str, "Can't Load Image"); + ofs += sprintf(str, IFACE_("Can't Load Image")); } else { if (ima->source == IMA_SRC_MOVIE) { - ofs += sprintf(str, "Movie"); + ofs += sprintf(str, IFACE_("Movie")); if (ima->anim) - ofs += sprintf(str + ofs, "%d frs", IMB_anim_get_duration(ima->anim, IMB_TC_RECORD_RUN)); + ofs += sprintf(str + ofs, IFACE_("%d frs"), IMB_anim_get_duration(ima->anim, IMB_TC_RECORD_RUN)); } else - ofs += sprintf(str, "Image"); + ofs += sprintf(str, IFACE_("Image")); - ofs += sprintf(str + ofs, ": size %d x %d,", ibuf->x, ibuf->y); + ofs += sprintf(str + ofs, IFACE_(": size %d x %d,"), ibuf->x, ibuf->y); if (ibuf->rect_float) { if (ibuf->channels != 4) { - ofs += sprintf(str + ofs, "%d float channel(s)", ibuf->channels); + ofs += sprintf(str + ofs, IFACE_("%d float channel(s)"), ibuf->channels); } else if (ibuf->planes == R_IMF_PLANES_RGBA) - ofs += sprintf(str + ofs, " RGBA float"); + ofs += sprintf(str + ofs, IFACE_(" RGBA float")); else - ofs += sprintf(str + ofs, " RGB float"); + ofs += sprintf(str + ofs, IFACE_(" RGB float")); } else { if (ibuf->planes == R_IMF_PLANES_RGBA) - ofs += sprintf(str + ofs, " RGBA byte"); + ofs += sprintf(str + ofs, IFACE_(" RGBA byte")); else - ofs += sprintf(str + ofs, " RGB byte"); + ofs += sprintf(str + ofs, IFACE_(" RGB byte")); } if (ibuf->zbuf || ibuf->zbuf_float) - ofs += sprintf(str + ofs, " + Z"); + ofs += sprintf(str + ofs, IFACE_(" + Z")); if (ima->source == IMA_SRC_SEQUENCE) { char *file = BLI_last_slash(ibuf->name); @@ -147,7 +149,7 @@ static void image_info(Scene *scene, ImageUser *iuser, Image *ima, ImBuf *ibuf, if (ima->source == IMA_SRC_SEQUENCE) { /* don't use iuser->framenr directly because it may not be updated if auto-refresh is off */ const int framenr = BKE_image_user_frame_get(iuser, CFRA, 0); - ofs += sprintf(str + ofs, ", Frame: %d", framenr); + ofs += sprintf(str + ofs, IFACE_(", Frame: %d"), framenr); } (void)ofs; @@ -357,11 +359,11 @@ static char *slot_menu(void) str = MEM_callocN(IMA_MAX_RENDER_SLOT * 32, "menu slots"); - strcpy(str, "Slot %t"); + strcpy(str, IFACE_("Slot %t")); a = strlen(str); for (slot = 0; slot < IMA_MAX_RENDER_SLOT; slot++) - a += sprintf(str + a, "|Slot %d %%x%d", slot + 1, slot); + a += sprintf(str + a, IFACE_("|Slot %d %%x%d"), slot + 1, slot); return str; } @@ -374,16 +376,16 @@ static char *layer_menu(RenderResult *rr, short *UNUSED(curlay)) short a, nr = 0; char *str = MEM_callocN(len, "menu layers"); - strcpy(str, "Layer %t"); + strcpy(str, IFACE_("Layer %t")); a = strlen(str); /* compo result */ if (rr->rectf) { - a += sprintf(str + a, "|Composite %%x0"); + a += sprintf(str + a, IFACE_("|Composite %%x0")); nr = 1; } else if (rr->rect32) { - a += sprintf(str + a, "|Sequence %%x0"); + a += sprintf(str + a, IFACE_("|Sequence %%x0")); nr = 1; } for (rl = rr->layers.first; rl; rl = rl->next, nr++) { @@ -403,18 +405,18 @@ static char *pass_menu(RenderLayer *rl, short *curpass) short a, nr = 0; char *str = MEM_callocN(len, "menu layers"); - strcpy(str, "Pass %t"); + strcpy(str, IFACE_("Pass %t")); a = strlen(str); /* rendered results don't have a Combined pass */ if (rl == NULL || rl->rectf) { - a += sprintf(str + a, "|Combined %%x0"); + a += sprintf(str + a, IFACE_("|Combined %%x0")); nr = 1; } if (rl) for (rpass = rl->passes.first; rpass; rpass = rpass->next, nr++) - a += sprintf(str + a, "|%s %%x%d", rpass->name, nr); + a += sprintf(str + a, "|%s %%x%d", IFACE_(rpass->name), nr); if (*curpass >= nr) *curpass = 0; @@ -532,14 +534,14 @@ static void uiblock_layer_pass_buttons(uiLayout *layout, RenderResult *rr, Image /* menu buts */ if (render_slot) { strp = slot_menu(); - but = uiDefButS(block, MENU, 0, strp, 0, 0, wmenu1, UI_UNIT_Y, render_slot, 0, 0, 0, 0, "Select Slot"); + but = uiDefButS(block, MENU, 0, strp, 0, 0, wmenu1, UI_UNIT_Y, render_slot, 0, 0, 0, 0, TIP_("Select Slot")); uiButSetFunc(but, image_multi_cb, rr, iuser); MEM_freeN(strp); } if (rr) { strp = layer_menu(rr, &iuser->layer); - but = uiDefButS(block, MENU, 0, strp, 0, 0, wmenu2, UI_UNIT_Y, &iuser->layer, 0, 0, 0, 0, "Select Layer"); + but = uiDefButS(block, MENU, 0, strp, 0, 0, wmenu2, UI_UNIT_Y, &iuser->layer, 0, 0, 0, 0, TIP_("Select Layer")); uiButSetFunc(but, image_multi_cb, rr, iuser); MEM_freeN(strp); @@ -549,9 +551,9 @@ static void uiblock_layer_pass_buttons(uiLayout *layout, RenderResult *rr, Image rl = BLI_findlink(&rr->layers, layer); /* return NULL is meant to be */ strp = pass_menu(rl, &iuser->pass); - but = uiDefButS(block, MENU, 0, strp, 0, 0, wmenu3, UI_UNIT_Y, &iuser->pass, 0, 0, 0, 0, "Select Pass"); + but = uiDefButS(block, MENU, 0, strp, 0, 0, wmenu3, UI_UNIT_Y, &iuser->pass, 0, 0, 0, 0, TIP_("Select Pass")); uiButSetFunc(but, image_multi_cb, rr, iuser); - MEM_freeN(strp); + MEM_freeN(strp); } } @@ -567,22 +569,22 @@ static void uiblock_layer_pass_arrow_buttons(uiLayout *layout, RenderResult *rr, if (rr == NULL || iuser == NULL) return; if (rr->layers.first == NULL) { - uiItemL(row, "No Layers in Render Result", ICON_NONE); + uiItemL(row, IFACE_("No Layers in Render Result"), ICON_NONE); return; } /* decrease, increase arrows */ - but = uiDefIconBut(block, BUT, 0, ICON_TRIA_LEFT, 0, 0, 17, 20, NULL, 0, 0, 0, 0, "Previous Layer"); + but = uiDefIconBut(block, BUT, 0, ICON_TRIA_LEFT, 0, 0, 17, 20, NULL, 0, 0, 0, 0, TIP_("Previous Layer")); uiButSetFunc(but, image_multi_declay_cb, rr, iuser); - but = uiDefIconBut(block, BUT, 0, ICON_TRIA_RIGHT, 0, 0, 18, 20, NULL, 0, 0, 0, 0, "Next Layer"); + but = uiDefIconBut(block, BUT, 0, ICON_TRIA_RIGHT, 0, 0, 18, 20, NULL, 0, 0, 0, 0, TIP_("Next Layer")); uiButSetFunc(but, image_multi_inclay_cb, rr, iuser); uiblock_layer_pass_buttons(row, rr, iuser, 230 * dpi_fac, render_slot); /* decrease, increase arrows */ - but = uiDefIconBut(block, BUT, 0, ICON_TRIA_LEFT, 0, 0, 17, 20, NULL, 0, 0, 0, 0, "Previous Pass"); + but = uiDefIconBut(block, BUT, 0, ICON_TRIA_LEFT, 0, 0, 17, 20, NULL, 0, 0, 0, 0, TIP_("Previous Pass")); uiButSetFunc(but, image_multi_decpass_cb, rr, iuser); - but = uiDefIconBut(block, BUT, 0, ICON_TRIA_RIGHT, 0, 0, 18, 20, NULL, 0, 0, 0, 0, "Next Pass"); + but = uiDefIconBut(block, BUT, 0, ICON_TRIA_RIGHT, 0, 0, 18, 20, NULL, 0, 0, 0, 0, TIP_("Next Pass")); uiButSetFunc(but, image_multi_incpass_cb, rr, iuser); uiBlockEndAlign(block); @@ -762,21 +764,22 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char col = uiLayoutColumn(split, 0); - BLI_snprintf(str, sizeof(str), "(%d) Frames", iuser->framenr); + BLI_snprintf(str, sizeof(str), IFACE_("(%d) Frames"), iuser->framenr); uiItemR(col, userptr, "frame_duration", 0, str, ICON_NONE); if (ima->anim) { block = uiLayoutGetBlock(col); - but = uiDefBut(block, BUT, 0, "Match Movie Length", 0, 0, UI_UNIT_X * 2, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Set the number of frames to match the movie or sequence"); + but = uiDefBut(block, BUT, 0, IFACE_("Match Movie Length"), 0, 0, UI_UNIT_X * 2, UI_UNIT_Y, + NULL, 0, 0, 0, 0, TIP_("Set the number of frames to match the movie or sequence")); uiButSetFunc(but, set_frames_cb, ima, iuser); } - uiItemR(col, userptr, "frame_start", 0, "Start", ICON_NONE); + uiItemR(col, userptr, "frame_start", 0, IFACE_("Start"), ICON_NONE); uiItemR(col, userptr, "frame_offset", 0, NULL, ICON_NONE); col = uiLayoutColumn(split, 0); row = uiLayoutRow(col, 0); uiLayoutSetActive(row, RNA_boolean_get(&imaptr, "use_fields")); - uiItemR(row, userptr, "fields_per_frame", 0, "Fields", ICON_NONE); + uiItemR(row, userptr, "fields_per_frame", 0, IFACE_("Fields"), ICON_NONE); uiItemR(col, userptr, "use_auto_refresh", 0, NULL, ICON_NONE); uiItemR(col, userptr, "use_cyclic", 0, NULL, ICON_NONE); } @@ -815,7 +818,7 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr) uiItemR(split, imfptr, "file_format", 0, "", ICON_NONE); sub = uiLayoutRow(split, 0); - uiItemR(sub, imfptr, "color_mode", UI_ITEM_R_EXPAND, "Color", ICON_NONE); + uiItemR(sub, imfptr, "color_mode", UI_ITEM_R_EXPAND, IFACE_("Color"), ICON_NONE); /* only display depth setting if multiple depths can be used */ if ((ELEM6(depth_ok, @@ -861,7 +864,7 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr) if (imf->imtype == R_IMF_IMTYPE_CINEON) { #if 1 - uiItemL(col, "Hard coded Non-Linear, Gamma:1.0", ICON_NONE); + uiItemL(col, IFACE_("Hard coded Non-Linear, Gamma: 1.0"), ICON_NONE); #else uiItemR(col, imfptr, "use_cineon_log", 0, NULL, ICON_NONE); uiItemR(col, imfptr, "cineon_black", 0, NULL, ICON_NONE); diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 2543b49a48d..b3b4e47ba81 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -927,11 +927,11 @@ static void UNUSED_FUNCTION(seq_remap_paths) (Scene * scene) return; BLI_strncpy(from, last_seq->strip->dir, sizeof(from)); -// XXX if (0==sbutton(from, 0, sizeof(from)-1, "From: ")) +// XXX if (0 == sbutton(from, 0, sizeof(from)-1, "From: ")) // return; BLI_strncpy(to, from, sizeof(to)); -// XXX if (0==sbutton(to, 0, sizeof(to)-1, "To: ")) +// XXX if (0 == sbutton(to, 0, sizeof(to)-1, "To: ")) // return; if (strcmp(to, from) == 0) @@ -1989,7 +1989,7 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op)) Scene *scene = CTX_data_scene(C); Editing *ed = BKE_sequencer_editing_get(scene, FALSE); - Sequence *seq, *last_seq = BKE_sequencer_active_get(scene); /* last_seq checks ed==NULL */ + Sequence *seq, *last_seq = BKE_sequencer_active_get(scene); /* last_seq checks (ed == NULL) */ if (last_seq == NULL || last_seq->type != SEQ_META) return OPERATOR_CANCELLED; diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 85eda858d24..501e1cad67e 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -128,7 +128,7 @@ static void text_listener(ScrArea *sa, wmNotifier *wmn) switch (wmn->category) { case NC_TEXT: /* check if active text was changed, no need to redraw if text isn't active - * reference==NULL means text was unlinked, should update anyway for this + * (reference == NULL) means text was unlinked, should update anyway for this * case -- no way to know was text active before unlinking or not */ if (wmn->reference && wmn->reference != st->text) break; diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 6a070070379..0de7e2569c0 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -1696,7 +1696,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, bone = pchan->bone; if (bone) { /* 1) bone must be visible, 2) for OpenGL select-drawing cannot have unselectable [#27194] - * NOTE: this is the only case with NO_DEFORM==0 flag, as this is for envelope influence drawing + * NOTE: this is the only case with (NO_DEFORM == 0) flag, as this is for envelope influence drawing */ if ( (bone->flag & (BONE_HIDDEN_P | BONE_NO_DEFORM | BONE_HIDDEN_PG)) == 0 && ((G.f & G_PICKSEL) == 0 || (bone->flag & BONE_UNSELECTABLE) == 0) ) diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index a5f3df4257a..43de6126ffb 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3864,7 +3864,7 @@ static void drawDispListsolid(ListBase *lb, Object *ob, int glsl) glVertexPointer(3, GL_FLOAT, 0, dl->verts); - /* voor polys only one normal needed */ + /* for polys only one normal needed */ if (index3_nors_incr) { glEnableClientState(GL_NORMAL_ARRAY); glNormalPointer(GL_FLOAT, 0, dl->nors); @@ -3949,7 +3949,7 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas int retval = 0; /* backface culling */ - if(v3d->flag2 & V3D_BACKFACE_CULLING) { + if (v3d->flag2 & V3D_BACKFACE_CULLING) { /* not all displists use same in/out normal direction convention */ glEnable(GL_CULL_FACE); glCullFace((ob->type == OB_MBALL) ? GL_BACK : GL_FRONT); @@ -6592,7 +6592,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) if (v3d->zbuf == 0 && dt > OB_WIRE) dt = OB_WIRE; dtx = 0; - /* faceselect exception: also draw solid when dt==wire, except in editmode */ + /* faceselect exception: also draw solid when (dt == wire), except in editmode */ if (is_obact && (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT))) { if (ob->type == OB_MESH) { @@ -6960,7 +6960,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) GPU_create_smoke(smd, 0); draw_volume(ar, smd->domain->tex, smd->domain->p0, smd->domain->p1, - smd->domain->res, smd->domain->dx * smd->domain->scale, + smd->domain->res, smd->domain->dx, smd->domain->tex_shadow); GPU_free_smoke(smd); // #endif @@ -7013,7 +7013,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) GPU_create_smoke(smd, 1); draw_volume(ar, smd->domain->tex, smd->domain->p0, smd->domain->p1, - smd->domain->res_wt, smd->domain->dx_wt * smd->domain->scale, + smd->domain->res_wt, smd->domain->dx_wt, smd->domain->tex_shadow); GPU_free_smoke(smd); } diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index 10ae96d87bf..19cf9d9e20f 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -319,9 +319,9 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float min[3], float max[3], int r for (i = 0; i < 8; i++) { float x, y, z; - x = cv[i][0] - viewnormal[0]; - y = cv[i][1] - viewnormal[1]; - z = cv[i][2] - viewnormal[2]; + x = cv[i][0] - viewnormal[0]*size[0]*0.5f; + y = cv[i][1] - viewnormal[1]*size[1]*0.5f; + z = cv[i][2] - viewnormal[2]*size[2]*0.5f; if ((x >= min[0]) && (x <= max[0]) && (y >= min[1]) && (y <= max[1]) && @@ -373,7 +373,7 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float min[3], float max[3], int r /* d0 = (viewnormal[0]*cv[i][0] + viewnormal[1]*cv[i][1] + viewnormal[2]*cv[i][2]); */ /* UNUSED */ ds = (ABS(viewnormal[0]) * size[0] + ABS(viewnormal[1]) * size[1] + ABS(viewnormal[2]) * size[2]); - dd = 0.05; // ds/512.0f; + dd = ds/96.f; n = 0; good_index = i; diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index f2e585c8f79..ee02f99d5b7 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1863,7 +1863,7 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas /* generate displist */ if (use_displist == -1) { - /* note, since this was added, its checked dob->type==OB_DUPLIGROUP + /* note, since this was added, its checked (dob->type == OB_DUPLIGROUP) * however this is very slow, it was probably needed for the NLA * offset feature (used in group-duplicate.blend but no longer works in 2.5) * so for now it should be ok to - campbell */ @@ -2994,10 +2994,10 @@ static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const static void view3d_main_area_draw_info(const bContext *C, ARegion *ar, const char *grid_unit) { + wmWindowManager *wm = CTX_wm_manager(C); Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d = CTX_wm_region_view3d(C); - bScreen *screen = CTX_wm_screen(C); Object *ob; @@ -3026,7 +3026,7 @@ static void view3d_main_area_draw_info(const bContext *C, ARegion *ar, const cha return; } - if ((U.uiflag & USER_SHOW_FPS) && screen->animtimer) { + if ((U.uiflag & USER_SHOW_FPS) && ED_screen_animation_playing(wm)) { draw_viewport_fps(scene, ar); } else if (U.uiflag & USER_SHOW_VIEWPORTNAME) { diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index 06cae3585cd..95cc37d9f87 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -547,7 +547,7 @@ static void flyEvent(FlyInfo *fly, wmEvent *event) time_currwheel = PIL_check_seconds_timer(); time_wheel = (float)(time_currwheel - fly->time_lastwheel); fly->time_lastwheel = time_currwheel; - /* Mouse wheel delays range from 0.5==slow to 0.01==fast */ + /* Mouse wheel delays range from (0.5 == slow) to (0.01 == fast) */ time_wheel = 1.0f + (10.0f - (20.0f * MIN2(time_wheel, 0.5f))); /* 0-0.5 -> 0-5.0 */ if (fly->speed < 0.0f) { diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index c2d58349075..18c7e975356 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -500,7 +500,7 @@ static void do_lasso_select_curve__doSelect(void *userData, Nurb *UNUSED(nu), BP } else { if (cu->drawflag & CU_HIDE_HANDLES) { - /* can only be beztindex==0 here since handles are hidden */ + /* can only be (beztindex == 0) here since handles are hidden */ bezt->f1 = bezt->f2 = bezt->f3 = data->select ? (bezt->f2 | SELECT) : (bezt->f2 & ~SELECT); } else { @@ -1480,15 +1480,18 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short dese if (extend) { ED_base_object_select(basact, BA_SELECT); } - else if(deselect) { + else if (deselect) { ED_base_object_select(basact, BA_DESELECT); } - else if(toggle) { + else if (toggle) { if (basact->flag & SELECT) { - if (basact == oldbasact) + if (basact == oldbasact) { ED_base_object_select(basact, BA_DESELECT); + } + } + else { + ED_base_object_select(basact, BA_SELECT); } - else ED_base_object_select(basact, BA_SELECT); } else { deselectall_except(scene, basact); @@ -1549,7 +1552,7 @@ static void do_nurbs_box_select__doSelect(void *userData, Nurb *UNUSED(nu), BPoi } else { if (cu->drawflag & CU_HIDE_HANDLES) { - /* can only be beztindex==0 here since handles are hidden */ + /* can only be (beztindex == 0) here since handles are hidden */ bezt->f1 = bezt->f2 = bezt->f3 = data->select ? (bezt->f2 | SELECT) : (bezt->f2 & ~SELECT); } else { @@ -2294,7 +2297,7 @@ static void nurbscurve_circle_doSelect(void *userData, Nurb *UNUSED(nu), BPoint } else { if (cu->drawflag & CU_HIDE_HANDLES) { - /* can only be beztindex==0 here since handles are hidden */ + /* can only be (beztindex == 0) here since handles are hidden */ bezt->f1 = bezt->f2 = bezt->f3 = data->select ? (bezt->f2 | SELECT) : (bezt->f2 & ~SELECT); } else { diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 152576e3303..985a393f238 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -94,6 +94,7 @@ #include "ED_view3d.h" #include "ED_curve.h" /* for curve_editnurbs */ #include "ED_clip.h" +#include "ED_screen.h" //#include "BDR_unwrapper.h" @@ -1055,9 +1056,10 @@ int initTransInfo(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) if (t->spacetype == SPACE_VIEW3D) { View3D *v3d = sa->spacedata.first; + bScreen *animscreen = ED_screen_animation_playing(CTX_wm_manager(C)); t->view = v3d; - t->animtimer= CTX_wm_screen(C)->animtimer; + t->animtimer= (animscreen)? animscreen->animtimer: NULL; /* turn manipulator off during transform */ // FIXME: but don't do this when USING the manipulator... diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index 9aaccb57fe2..18610d57bbd 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -129,7 +129,7 @@ void undo_editmode_push(bContext *C, const char *name, /* at first here was code to prevent an "original" key to be inserted twice * this was giving conflicts for example when mesh changed due to keys or apply */ - /* remove all undos after (also when curundo==NULL) */ + /* remove all undos after (also when curundo == NULL) */ while (undobase.last != curundo) { uel = undobase.last; uel->freedata(uel->undodata); diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index fb277815878..7ae4aa550f9 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -1254,7 +1254,7 @@ int GPU_enable_material(int nr, void *attribs) if (GMS.is_alpha_pass) glDepthMask(1); if (GMS.backface_culling) { - if(mat->game.flag) + if (mat->game.flag) glEnable(GL_CULL_FACE); else glDisable(GL_CULL_FACE); diff --git a/source/blender/ikplugin/intern/iksolver_plugin.c b/source/blender/ikplugin/intern/iksolver_plugin.c index c726102247a..b9980b1401d 100644 --- a/source/blender/ikplugin/intern/iksolver_plugin.c +++ b/source/blender/ikplugin/intern/iksolver_plugin.c @@ -57,47 +57,47 @@ /* Note: detecting the IK chain is duplicate code... in drawarmature.c and in transform_conversions.c */ static void initialize_posetree(struct Object *UNUSED(ob), bPoseChannel *pchan_tip) { - bPoseChannel *curchan, *pchan_root=NULL, *chanlist[256], **oldchan; + bPoseChannel *curchan, *pchan_root = NULL, *chanlist[256], **oldchan; PoseTree *tree; PoseTarget *target; bConstraint *con; bKinematicConstraint *data; - int a, t, segcount= 0, size, newsize, *oldparent, parent; + int a, t, segcount = 0, size, newsize, *oldparent, parent; /* find IK constraint, and validate it */ - for (con= pchan_tip->constraints.first; con; con= con->next) { - if (con->type==CONSTRAINT_TYPE_KINEMATIC) { - data=(bKinematicConstraint*)con->data; + for (con = pchan_tip->constraints.first; con; con = con->next) { + if (con->type == CONSTRAINT_TYPE_KINEMATIC) { + data = (bKinematicConstraint *)con->data; if (data->flag & CONSTRAINT_IK_AUTO) break; - if (data->tar==NULL) continue; - if (data->tar->type==OB_ARMATURE && data->subtarget[0]==0) continue; - if ((con->flag & (CONSTRAINT_DISABLE|CONSTRAINT_OFF))==0 && (con->enforce != 0.0f)) break; + if (data->tar == NULL) continue; + if (data->tar->type == OB_ARMATURE && data->subtarget[0] == 0) continue; + if ((con->flag & (CONSTRAINT_DISABLE | CONSTRAINT_OFF)) == 0 && (con->enforce != 0.0f)) break; } } - if (con==NULL) return; + if (con == NULL) return; /* exclude tip from chain? */ if (!(data->flag & CONSTRAINT_IK_TIP)) - pchan_tip= pchan_tip->parent; + pchan_tip = pchan_tip->parent; /* Find the chain's root & count the segments needed */ - for (curchan = pchan_tip; curchan; curchan=curchan->parent) { + for (curchan = pchan_tip; curchan; curchan = curchan->parent) { pchan_root = curchan; - curchan->flag |= POSE_CHAIN; // don't forget to clear this - chanlist[segcount]=curchan; + curchan->flag |= POSE_CHAIN; // don't forget to clear this + chanlist[segcount] = curchan; segcount++; - if (segcount==data->rootbone || segcount>255) break; // 255 is weak + if (segcount == data->rootbone || segcount > 255) break; // 255 is weak } if (!segcount) return; /* setup the chain data */ /* we make tree-IK, unless all existing targets are in this chain */ - for (tree= pchan_root->iktree.first; tree; tree= tree->next) { - for (target= tree->targets.first; target; target= target->next) { - curchan= tree->pchan[target->tip]; + for (tree = pchan_root->iktree.first; tree; tree = tree->next) { + for (target = tree->targets.first; target; target = target->next) { + curchan = tree->pchan[target->tip]; if (curchan->flag & POSE_CHAIN) curchan->flag &= ~POSE_CHAIN; else @@ -107,52 +107,52 @@ static void initialize_posetree(struct Object *UNUSED(ob), bPoseChannel *pchan_t } /* create a target */ - target= MEM_callocN(sizeof(PoseTarget), "posetarget"); - target->con= con; + target = MEM_callocN(sizeof(PoseTarget), "posetarget"); + target->con = con; pchan_tip->flag &= ~POSE_CHAIN; - if (tree==NULL) { + if (tree == NULL) { /* make new tree */ - tree= MEM_callocN(sizeof(PoseTree), "posetree"); + tree = MEM_callocN(sizeof(PoseTree), "posetree"); - tree->type= CONSTRAINT_TYPE_KINEMATIC; + tree->type = CONSTRAINT_TYPE_KINEMATIC; - tree->iterations= data->iterations; - tree->totchannel= segcount; + tree->iterations = data->iterations; + tree->totchannel = segcount; tree->stretch = (data->flag & CONSTRAINT_IK_STRETCH); - tree->pchan= MEM_callocN(segcount*sizeof(void*), "ik tree pchan"); - tree->parent= MEM_callocN(segcount*sizeof(int), "ik tree parent"); - for (a=0; apchan[a]= chanlist[segcount-a-1]; - tree->parent[a]= a-1; + tree->pchan = MEM_callocN(segcount * sizeof(void *), "ik tree pchan"); + tree->parent = MEM_callocN(segcount * sizeof(int), "ik tree parent"); + for (a = 0; a < segcount; a++) { + tree->pchan[a] = chanlist[segcount - a - 1]; + tree->parent[a] = a - 1; } - target->tip= segcount-1; + target->tip = segcount - 1; /* AND! link the tree to the root */ BLI_addtail(&pchan_root->iktree, tree); } else { - tree->iterations= MAX2(data->iterations, tree->iterations); - tree->stretch= tree->stretch && !(data->flag & CONSTRAINT_IK_STRETCH); + tree->iterations = MAX2(data->iterations, tree->iterations); + tree->stretch = tree->stretch && !(data->flag & CONSTRAINT_IK_STRETCH); /* skip common pose channels and add remaining*/ - size= MIN2(segcount, tree->totchannel); + size = MIN2(segcount, tree->totchannel); a = t = 0; - while (atotchannel) { + while (a < size && t < tree->totchannel) { // locate first matching channel - for (;ttotchannel && tree->pchan[t]!=chanlist[segcount-a-1];t++); - if (t>=tree->totchannel) + for (; t < tree->totchannel && tree->pchan[t] != chanlist[segcount - a - 1]; t++) ; + if (t >= tree->totchannel) break; - for (; atotchannel && tree->pchan[t]==chanlist[segcount-a-1]; a++, t++); + for (; a < size && t < tree->totchannel && tree->pchan[t] == chanlist[segcount - a - 1]; a++, t++) ; } - segcount= segcount-a; - target->tip= tree->totchannel + segcount - 1; + segcount = segcount - a; + target->tip = tree->totchannel + segcount - 1; if (segcount > 0) { for (parent = a - 1; parent < tree->totchannel; parent++) - if (tree->pchan[parent] == chanlist[segcount-1]->parent) + if (tree->pchan[parent] == chanlist[segcount - 1]->parent) break; /* shouldn't happen, but could with dependency cycles */ @@ -160,25 +160,25 @@ static void initialize_posetree(struct Object *UNUSED(ob), bPoseChannel *pchan_t parent = a - 1; /* resize array */ - newsize= tree->totchannel + segcount; - oldchan= tree->pchan; - oldparent= tree->parent; + newsize = tree->totchannel + segcount; + oldchan = tree->pchan; + oldparent = tree->parent; - tree->pchan= MEM_callocN(newsize*sizeof(void*), "ik tree pchan"); - tree->parent= MEM_callocN(newsize*sizeof(int), "ik tree parent"); - memcpy(tree->pchan, oldchan, sizeof(void*)*tree->totchannel); - memcpy(tree->parent, oldparent, sizeof(int)*tree->totchannel); + tree->pchan = MEM_callocN(newsize * sizeof(void *), "ik tree pchan"); + tree->parent = MEM_callocN(newsize * sizeof(int), "ik tree parent"); + memcpy(tree->pchan, oldchan, sizeof(void *) * tree->totchannel); + memcpy(tree->parent, oldparent, sizeof(int) * tree->totchannel); MEM_freeN(oldchan); MEM_freeN(oldparent); /* add new pose channels at the end, in reverse order */ - for (a=0; apchan[tree->totchannel+a]= chanlist[segcount-a-1]; - tree->parent[tree->totchannel+a]= tree->totchannel+a-1; + for (a = 0; a < segcount; a++) { + tree->pchan[tree->totchannel + a] = chanlist[segcount - a - 1]; + tree->parent[tree->totchannel + a] = tree->totchannel + a - 1; } - tree->parent[tree->totchannel]= parent; + tree->parent[tree->totchannel] = parent; - tree->totchannel= newsize; + tree->totchannel = newsize; } /* move tree to end of list, for correct evaluation order */ @@ -199,7 +199,7 @@ static void make_dmats(bPoseChannel *pchan) if (pchan->parent) { float iR_parmat[4][4]; invert_m4_m4(iR_parmat, pchan->parent->pose_mat); - mult_m4_m4m4(pchan->chan_mat, iR_parmat, pchan->pose_mat); // delta mat + mult_m4_m4m4(pchan->chan_mat, iR_parmat, pchan->pose_mat); // delta mat } else copy_m4_m4(pchan->chan_mat, pchan->pose_mat); } @@ -241,27 +241,27 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree) float goal[4][4], goalinv[4][4]; float irest_basis[3][3], full_basis[3][3]; float end_pose[4][4], world_pose[4][4]; - float length, basis[3][3], rest_basis[3][3], start[3], *ikstretch=NULL; - float resultinf=0.0f; - int a, flag, hasstretch=0, resultblend=0; + float length, basis[3][3], rest_basis[3][3], start[3], *ikstretch = NULL; + float resultinf = 0.0f; + int a, flag, hasstretch = 0, resultblend = 0; bPoseChannel *pchan; IK_Segment *seg, *parent, **iktree, *iktarget; IK_Solver *solver; PoseTarget *target; - bKinematicConstraint *data, *poleangledata=NULL; + bKinematicConstraint *data, *poleangledata = NULL; Bone *bone; if (tree->totchannel == 0) return; - iktree= MEM_mallocN(sizeof(void*)*tree->totchannel, "ik tree"); + iktree = MEM_mallocN(sizeof(void *) * tree->totchannel, "ik tree"); - for (a=0; atotchannel; a++) { - pchan= tree->pchan[a]; - bone= pchan->bone; + for (a = 0; a < tree->totchannel; a++) { + pchan = tree->pchan[a]; + bone = pchan->bone; /* set DoF flag */ - flag= 0; + flag = 0; if (!(pchan->ikflag & BONE_IK_NO_XDOF) && !(pchan->ikflag & BONE_IK_NO_XDOF_TEMP)) flag |= IK_XDOF; if (!(pchan->ikflag & BONE_IK_NO_YDOF) && !(pchan->ikflag & BONE_IK_NO_YDOF_TEMP)) @@ -274,13 +274,13 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree) hasstretch = 1; } - seg= iktree[a]= IK_CreateSegment(flag); + seg = iktree[a] = IK_CreateSegment(flag); /* find parent */ if (a == 0) - parent= NULL; + parent = NULL; else - parent= iktree[tree->parent[a]]; + parent = iktree[tree->parent[a]]; IK_SetParent(seg, parent); @@ -299,10 +299,10 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree) sub_v3_v3v3(start, pchan->pose_head, pchan->parent->pose_tail); else /* only root bone (a = 0) has no parent */ - start[0]= start[1]= start[2]= 0.0f; + start[0] = start[1] = start[2] = 0.0f; /* change length based on bone size */ - length= bone->length*len_v3(R_bonemat[1]); + length = bone->length * len_v3(R_bonemat[1]); /* compute rest basis and its inverse */ copy_m3_m3(rest_basis, bone->bone_mat); @@ -335,18 +335,18 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree) IK_SetStiffness(seg, IK_Z, pchan->stiffness[2]); if (tree->stretch && (pchan->ikstretch > 0.0f)) { - float ikstretch = pchan->ikstretch*pchan->ikstretch; - IK_SetStiffness(seg, IK_TRANS_Y, MIN2(1.0f-ikstretch, 0.99f)); + float ikstretch = pchan->ikstretch * pchan->ikstretch; + IK_SetStiffness(seg, IK_TRANS_Y, MIN2(1.0f - ikstretch, 0.99f)); IK_SetLimit(seg, IK_TRANS_Y, 0.001, 1e10); } } - solver= IK_CreateSolver(iktree[0]); + solver = IK_CreateSolver(iktree[0]); /* set solver goals */ /* first set the goal inverse transform, assuming the root of tree was done ok! */ - pchan= tree->pchan[0]; + pchan = tree->pchan[0]; if (pchan->parent) { /* transform goal by parent mat, so this rotation is not part of the * segment's basis. otherwise rotation limits do not work on the @@ -363,11 +363,11 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree) mult_m4_m4m4(imat, ob->obmat, rootmat); invert_m4_m4(goalinv, imat); - for (target=tree->targets.first; target; target=target->next) { + for (target = tree->targets.first; target; target = target->next) { float polepos[3]; - int poleconstrain= 0; + int poleconstrain = 0; - data= (bKinematicConstraint*)target->con->data; + data = (bKinematicConstraint *)target->con->data; /* 1.0=ctime, we pass on object for auto-ik (owner-type here is object, even though * strictly speaking, it is a posechannel) @@ -391,16 +391,16 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree) else { mult_m4_m4m4(goal, goalinv, rootmat); copy_v3_v3(polepos, goal[3]); - poleconstrain= 1; + poleconstrain = 1; /* for pole targets, we blend the result of the ik solver * instead of the target position, otherwise we can't get * a smooth transition */ - resultblend= 1; - resultinf= target->con->enforce; + resultblend = 1; + resultinf = target->con->enforce; if (data->flag & CONSTRAINT_IK_GETANGLE) { - poleangledata= data; + poleangledata = data; data->flag &= ~CONSTRAINT_IK_GETANGLE; } } @@ -409,10 +409,10 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree) /* do we need blending? */ if (!resultblend && target->con->enforce != 1.0f) { float q1[4], q2[4], q[4]; - float fac= target->con->enforce; - float mfac= 1.0f-fac; + float fac = target->con->enforce; + float mfac = 1.0f - fac; - pchan= tree->pchan[target->tip]; + pchan = tree->pchan[target->tip]; /* end effector in world space */ copy_m4_m4(end_pose, pchan->pose_mat); @@ -420,9 +420,9 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree) mul_serie_m4(world_pose, goalinv, ob->obmat, end_pose, NULL, NULL, NULL, NULL, NULL); /* blend position */ - goalpos[0]= fac*goalpos[0] + mfac*world_pose[3][0]; - goalpos[1]= fac*goalpos[1] + mfac*world_pose[3][1]; - goalpos[2]= fac*goalpos[2] + mfac*world_pose[3][2]; + goalpos[0] = fac * goalpos[0] + mfac * world_pose[3][0]; + goalpos[1] = fac * goalpos[1] + mfac * world_pose[3][1]; + goalpos[2] = fac * goalpos[2] + mfac * world_pose[3][2]; /* blend rotation */ mat3_to_quat(q1, goalrot); @@ -431,65 +431,65 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree) quat_to_mat3(goalrot, q); } - iktarget= iktree[target->tip]; + iktarget = iktree[target->tip]; if (data->weight != 0.0f) { if (poleconstrain) IK_SolverSetPoleVectorConstraint(solver, iktarget, goalpos, - polepos, data->poleangle, (poleangledata == data)); + polepos, data->poleangle, (poleangledata == data)); IK_SolverAddGoal(solver, iktarget, goalpos, data->weight); } if ((data->flag & CONSTRAINT_IK_ROT) && (data->orientweight != 0.0f)) - if ((data->flag & CONSTRAINT_IK_AUTO)==0) + if ((data->flag & CONSTRAINT_IK_AUTO) == 0) IK_SolverAddGoalOrientation(solver, iktarget, goalrot, - data->orientweight); + data->orientweight); } /* solve */ IK_Solve(solver, 0.0f, tree->iterations); if (poleangledata) - poleangledata->poleangle= IK_SolverGetPoleAngle(solver); + poleangledata->poleangle = IK_SolverGetPoleAngle(solver); IK_FreeSolver(solver); /* gather basis changes */ - tree->basis_change= MEM_mallocN(sizeof(float[3][3])*tree->totchannel, "ik basis change"); + tree->basis_change = MEM_mallocN(sizeof(float[3][3]) * tree->totchannel, "ik basis change"); if (hasstretch) - ikstretch= MEM_mallocN(sizeof(float)*tree->totchannel, "ik stretch"); + ikstretch = MEM_mallocN(sizeof(float) * tree->totchannel, "ik stretch"); - for (a=0; atotchannel; a++) { + for (a = 0; a < tree->totchannel; a++) { IK_GetBasisChange(iktree[a], tree->basis_change[a]); if (hasstretch) { /* have to compensate for scaling received from parent */ float parentstretch, stretch; - pchan= tree->pchan[a]; - parentstretch= (tree->parent[a] >= 0)? ikstretch[tree->parent[a]]: 1.0f; + pchan = tree->pchan[a]; + parentstretch = (tree->parent[a] >= 0) ? ikstretch[tree->parent[a]] : 1.0f; if (tree->stretch && (pchan->ikstretch > 0.0f)) { float trans[3], length; IK_GetTranslationChange(iktree[a], trans); - length= pchan->bone->length*len_v3(pchan->pose_mat[1]); + length = pchan->bone->length * len_v3(pchan->pose_mat[1]); - ikstretch[a]= (length == 0.0f)? 1.0f: (trans[1]+length)/length; + ikstretch[a] = (length == 0.0f) ? 1.0f : (trans[1] + length) / length; } else ikstretch[a] = 1.0; - stretch= (parentstretch == 0.0f)? 1.0f: ikstretch[a]/parentstretch; + stretch = (parentstretch == 0.0f) ? 1.0f : ikstretch[a] / parentstretch; mul_v3_fl(tree->basis_change[a][0], stretch); mul_v3_fl(tree->basis_change[a][1], stretch); mul_v3_fl(tree->basis_change[a][2], stretch); } - if (resultblend && resultinf!=1.0f) { + if (resultblend && resultinf != 1.0f) { unit_m3(identity); blend_m3_m3m3(tree->basis_change[a], identity, - tree->basis_change[a], resultinf); + tree->basis_change[a], resultinf); } IK_FreeSegment(iktree[a]); @@ -515,9 +515,9 @@ void iksolver_initialize_tree(struct Scene *UNUSED(scene), struct Object *ob, fl { bPoseChannel *pchan; - for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { + for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { if (pchan->constflag & PCHAN_HAS_IK) // flag is set on editing constraints - initialize_posetree(ob, pchan); // will attach it to root! + initialize_posetree(ob, pchan); // will attach it to root! } ob->pose->flag &= ~POSE_WAS_REBUILT; } @@ -525,7 +525,7 @@ void iksolver_initialize_tree(struct Scene *UNUSED(scene), struct Object *ob, fl void iksolver_execute_tree(struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan, float ctime) { while (pchan->iktree.first) { - PoseTree *tree= pchan->iktree.first; + PoseTree *tree = pchan->iktree.first; int a; /* stop on the first tree that isn't a standard IK chain */ @@ -533,8 +533,8 @@ void iksolver_execute_tree(struct Scene *scene, struct Object *ob, struct bPose return; /* 4. walk over the tree for regular solving */ - for (a=0; atotchannel; a++) { - if (!(tree->pchan[a]->flag & POSE_DONE)) // successive trees can set the flag + for (a = 0; a < tree->totchannel; a++) { + if (!(tree->pchan[a]->flag & POSE_DONE)) // successive trees can set the flag BKE_pose_where_is_bone(scene, ob, tree->pchan[a], ctime, 1); // tell blender that this channel was controlled by IK, it's cleared on each BKE_pose_where_is() tree->pchan[a]->flag |= POSE_CHAIN; @@ -544,11 +544,11 @@ void iksolver_execute_tree(struct Scene *scene, struct Object *ob, struct bPose /* 6. apply the differences to the channels, * we need to calculate the original differences first */ - for (a=0; atotchannel; a++) { + for (a = 0; a < tree->totchannel; a++) { make_dmats(tree->pchan[a]); } - for (a=0; atotchannel; a++) { + for (a = 0; a < tree->totchannel; a++) { /* sets POSE_DONE */ where_is_ik_bone(tree->pchan[a], tree->basis_change[a]); } diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index b702e59bc16..c5b637eea5b 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -1157,9 +1157,9 @@ static void free_anim_redcode(struct anim *anim) #endif -/* probeer volgende plaatje te lezen */ -/* Geen plaatje, probeer dan volgende animatie te openen */ -/* gelukt, haal dan eerste plaatje van animatie */ +/* Try next picture to read */ +/* No picture, try to open next animation */ +/* Succeed, remove first image from animation */ static ImBuf *anim_getnew(struct anim *anim) { diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c index 062c7a9368d..279fd5d59be 100644 --- a/source/blender/imbuf/intern/divers.c +++ b/source/blender/imbuf/intern/divers.c @@ -764,7 +764,7 @@ void IMB_saturation(ImBuf *ibuf, float sat) float rgb[3]; for (i = ibuf->x * ibuf->y; i > 0; i--, rct += 4) { rgb_uchar_to_float(rgb, rct); - rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2); + rgb_to_hsv_v(rgb, hsv); hsv_to_rgb(hsv[0], hsv[1] * sat, hsv[2], rgb, rgb + 1, rgb + 2); rgb_float_to_uchar(rct, rgb); } @@ -772,7 +772,7 @@ void IMB_saturation(ImBuf *ibuf, float sat) if (rctf) { for (i = ibuf->x * ibuf->y; i > 0; i--, rctf += 4) { - rgb_to_hsv(rctf[0], rctf[1], rctf[2], hsv, hsv + 1, hsv + 2); + rgb_to_hsv_v(rctf, hsv); hsv_to_rgb(hsv[0], hsv[1] * sat, hsv[2], rctf, rctf + 1, rctf + 2); } } diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index a5a540ff6b4..cf8b08549f6 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -728,11 +728,12 @@ typedef struct SolidifyModifierData { short mat_ofs_rim; } SolidifyModifierData; -#define MOD_SOLIDIFY_RIM (1<<0) -#define MOD_SOLIDIFY_EVEN (1<<1) -#define MOD_SOLIDIFY_NORMAL_CALC (1<<2) -#define MOD_SOLIDIFY_VGROUP_INV (1<<3) -#define MOD_SOLIDIFY_RIM_MATERIAL (1<<4) /* deprecated, used in do_versions */ +#define MOD_SOLIDIFY_RIM (1 << 0) +#define MOD_SOLIDIFY_EVEN (1 << 1) +#define MOD_SOLIDIFY_NORMAL_CALC (1 << 2) +#define MOD_SOLIDIFY_VGROUP_INV (1 << 3) +#define MOD_SOLIDIFY_RIM_MATERIAL (1 << 4) /* deprecated, used in do_versions */ +#define MOD_SOLIDIFY_FLIP (1 << 5) typedef struct ScrewModifierData { ModifierData modifier; diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index f202bcb132f..bce8f9bb2bc 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -286,7 +286,7 @@ static int add_name(const char *str) additional_slen_offset = 0; - if (str[0] == 0 /* || (str[1]==0) */) return -1; + if (str[0] == 0 /* || (str[1] == 0) */) return -1; if (str[0] == '(' && str[1] == '*') { /* we handle function pointer and special array cases here, e.g. diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 9d5eadf73c0..3d92f6b0ec1 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -821,7 +821,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr if (prop->flag & PROP_ID_SELF_CHECK) { rna_print_id_get(f, dp); - fprintf(f, " if (id==value.data) return;\n\n"); + fprintf(f, " if (id == value.data) return;\n\n"); } if (prop->flag & PROP_ID_REFCOUNT) { diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 659c04015df..21a01cf43a8 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -2553,8 +2553,11 @@ static void rna_def_modifier_solidify(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_VGROUP_INV); RNA_def_property_ui_text(prop, "Vertex Group Invert", "Invert the vertex group influence"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - - + + prop = RNA_def_property(srna, "use_flip_normals", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_FLIP); + RNA_def_property_ui_text(prop, "Flip Normals", "Invert the face direction"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_screw(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index d179612ae04..8cf3b718c30 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -1754,7 +1754,6 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "distr"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_enum_items(prop, part_dist_items); - RNA_def_property_enum_items(prop, part_draw_as_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_dist_itemf"); RNA_def_property_ui_text(prop, "Distribution", "How to distribute particles on selected element"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index e442de6fc7c..71133634a96 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -94,8 +94,7 @@ static void rna_Screen_redraw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), static int rna_Screen_is_animation_playing_get(PointerRNA *ptr) { - bScreen *sc = (bScreen *)ptr->data; - return (sc->animtimer != NULL); + return (ED_screen_animation_playing(G.main->wm.first) != NULL); } static int rna_Screen_fullscreen_get(PointerRNA *ptr) diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c index 5d31420da86..745cf1304bd 100644 --- a/source/blender/modifiers/intern/MOD_solidify.c +++ b/source/blender/modifiers/intern/MOD_solidify.c @@ -18,11 +18,8 @@ * The Original Code is Copyright (C) 2005 by the Blender Foundation. * All rights reserved. * - * Contributor(s): Daniel Dunbar - * Ton Roosendaal, - * Ben Batt, - * Brecht Van Lommel, - * Campbell Barton + * Contributor(s): Campbell Barton + * Shinsuke Irie * * ***** END GPL LICENSE BLOCK ***** * @@ -50,19 +47,14 @@ #include "MOD_modifiertypes.h" #include "MOD_util.h" +/* *** derived mesh high quality normal calculation function *** */ +/* could be exposed for other functions to use */ + typedef struct EdgeFaceRef { int f1; /* init as -1 */ int f2; } EdgeFaceRef; -/* spesific function for solidify - define locally */ -BLI_INLINE void madd_v3v3short_fl(float r[3], const short a[3], const float f) -{ - r[0] += (float)a[0] * f; - r[1] += (float)a[1] * f; - r[2] += (float)a[2] * f; -} - static void dm_calc_normal(DerivedMesh *dm, float (*temp_nors)[3]) { int i, numVerts, numEdges, numFaces; @@ -80,7 +72,7 @@ static void dm_calc_normal(DerivedMesh *dm, float (*temp_nors)[3]) mpoly = dm->getPolyArray(dm); mvert = dm->getVertArray(dm); mloop = dm->getLoopArray(dm); - + /* we don't want to overwrite any referenced layers */ /* Doesn't work here! */ @@ -112,7 +104,7 @@ static void dm_calc_normal(DerivedMesh *dm, float (*temp_nors)[3]) unsigned int ml_v1; unsigned int ml_v2; int j; - + f_no = face_nors[i]; if (calc_face_nors) mesh_calc_poly_normal(mp, mloop + mp->loopstart, mvert, f_no); @@ -207,10 +199,17 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) return dataMask; } +/* spesific function for solidify - define locally */ +BLI_INLINE void madd_v3v3short_fl(float r[3], const short a[3], const float f) +{ + r[0] += (float)a[0] * f; + r[1] += (float)a[1] * f; + r[2] += (float)a[2] * f; +} -static DerivedMesh *applyModifier(ModifierData *md, Object *ob, - DerivedMesh *dm, - ModifierApplyFlag UNUSED(flag)) +static DerivedMesh *applyModifier(ModifierData *md, Object *ob, + DerivedMesh *dm, + ModifierApplyFlag UNUSED(flag)) { int i; DerivedMesh *result; @@ -225,7 +224,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, const int numFaces = dm->getNumPolys(dm); int numLoops = 0, newLoops = 0, newFaces = 0, newEdges = 0; int j; - + /* only use material offsets if we have 2 or more materials */ const short mat_nr_max = ob->totcol > 1 ? ob->totcol - 1 : 0; const short mat_ofs = mat_nr_max ? smd->mat_ofs : 0; @@ -249,6 +248,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, const float ofs_new = smd->offset + ofs_orig; const float offset_fac_vg = smd->offset_fac_vg; const float offset_fac_vg_inv = 1.0f - smd->offset_fac_vg; + const int do_flip = (smd->flag & MOD_SOLIDIFY_FLIP) != 0; /* weights */ MDeformVert *dvert, *dv = NULL; @@ -259,7 +259,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, numLoops = dm->numLoopData; newLoops = 0; - + orig_mvert = dm->getVertArray(dm); orig_medge = dm->getEdgeArray(dm); orig_mloop = dm->getLoopArray(dm); @@ -393,9 +393,9 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, ml2[j].e = ml2[j + 1].e; } ml2[mp->totloop - 1].e = e; - + mp->loopstart += dm->numLoopData; - + for (j = 0; j < mp->totloop; j++) { ml2[j].e += numEdges; ml2[j].v += numVerts; @@ -420,7 +420,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, if (ofs_new != 0.0f) { scalar_short = scalar_short_vgroup = ofs_new / 32767.0f; - mv = mvert + ((ofs_new >= ofs_orig) ? 0 : numVerts); + mv = mvert + (((ofs_new >= ofs_orig) == do_flip) ? numVerts : 0); dv = dvert; for (i = 0; i < numVerts; i++, mv++) { if (dv) { @@ -435,7 +435,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, if (ofs_orig != 0.0f) { scalar_short = scalar_short_vgroup = ofs_orig / 32767.0f; - mv = mvert + ((ofs_new >= ofs_orig) ? numVerts : 0); /* as above but swapped, intentional use 'ofs_new' */ + mv = mvert + (((ofs_new >= ofs_orig) == do_flip) ? 0 : numVerts); /* as above but swapped, intentional use 'ofs_new' */ dv = dvert; for (i = 0; i < numVerts; i++, mv++) { if (dv) { @@ -447,7 +447,6 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, madd_v3v3short_fl(mv->co, mv->no, scalar_short_vgroup); } } - } else { /* make a face normal layer if not present */ @@ -536,7 +535,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, } if (ofs_new) { - mv = mvert + ((ofs_new >= ofs_orig) ? 0 : numVerts); + mv = mvert + (((ofs_new >= ofs_orig) == do_flip) ? numVerts : 0); for (i = 0; i < numVerts; i++, mv++) { if (vert_accum[i]) { /* zero if unselected */ @@ -547,7 +546,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, if (ofs_orig) { /* same as above but swapped, intentional use of 'ofs_new' */ - mv = mvert + ((ofs_new >= ofs_orig) ? numVerts : 0); + mv = mvert + (((ofs_new >= ofs_orig) == do_flip) ? 0 : numVerts); for (i = 0; i < numVerts; i++, mv++) { if (vert_accum[i]) { /* zero if unselected */ @@ -569,16 +568,16 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, } if (smd->flag & MOD_SOLIDIFY_RIM) { - + /* bugger, need to re-calculate the normals for the new edge faces. * This could be done in many ways, but probably the quickest way * is to calculate the average normals for side faces only. * Then blend them with the normals of the edge verts. - * + * * at the moment its easiest to allocate an entire array for every vertex, * even though we only need edge verts - campbell */ - + #define SOLIDIFY_SIDE_NORMALS #ifdef SOLIDIFY_SIDE_NORMALS @@ -649,13 +648,13 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, if (flip == FALSE) { ml[j].v = ed->v1; ml[j++].e = eidx; - + ml[j].v = ed->v2; ml[j++].e = numEdges * 2 + old_vert_arr[ed->v2]; - + ml[j].v = ed->v2 + numVerts; ml[j++].e = eidx + numEdges; - + ml[j].v = ed->v1 + numVerts; ml[j++].e = numEdges * 2 + old_vert_arr[ed->v1]; } @@ -672,7 +671,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, ml[j].v = ed->v2 + numVerts; ml[j++].e = numEdges * 2 + old_vert_arr[ed->v2]; } - + origindex_edge[ml[j - 3].e] = ORIGINDEX_NONE; origindex_edge[ml[j - 1].e] = ORIGINDEX_NONE; @@ -694,7 +693,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, int tcr = *cr + crease_inner; *cr = tcr > 255 ? 255 : tcr; } - + #ifdef SOLIDIFY_SIDE_NORMALS normal_quad_v3(nor, mvert[ml[j - 4].v].co, @@ -710,17 +709,17 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, } #endif } - + #ifdef SOLIDIFY_SIDE_NORMALS ed = medge + (numEdges * 2); for (i = 0; i < newEdges; i++, ed++) { float nor_cpy[3]; short *nor_short; int j; - + /* note, only the first vertex (lower half of the index) is calculated */ normalize_v3_v3(nor_cpy, edge_vert_nos[ed->v1]); - + for (j = 0; j < 2; j++) { /* loop over both verts of the edge */ nor_short = mvert[*(&ed->v1 + j)].no; normal_short_to_float_v3(nor, nor_short); @@ -741,7 +740,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, if (old_vert_arr) MEM_freeN(old_vert_arr); - + /* must recalculate normals with vgroups since they can displace unevenly [#26888] */ if (dvert) { CDDM_calc_normals(result); diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.c b/source/blender/modifiers/intern/MOD_weightvg_util.c index 5097ae8c742..81cdad0d5e5 100644 --- a/source/blender/modifiers/intern/MOD_weightvg_util.c +++ b/source/blender/modifiers/intern/MOD_weightvg_util.c @@ -154,7 +154,7 @@ void weightvg_do_mask(int num, const int *indices, float *org_w, const float *ne for (i = 0; i < num; ++i) { int idx = indices ? indices[i] : i; TexResult texres; - float h, s, v; /* For HSV color space. */ + float hsv[3]; /* For HSV color space. */ texres.nor = NULL; get_texture_value(texture, tex_co[idx], &texres); @@ -173,16 +173,16 @@ void weightvg_do_mask(int num, const int *indices, float *org_w, const float *ne org_w[i] = (new_w[i] * texres.tb * fact) + (org_w[i] * (1.0f - (texres.tb * fact))); break; case MOD_WVG_MASK_TEX_USE_HUE: - rgb_to_hsv(texres.tr, texres.tg, texres.tb, &h, &s, &v); - org_w[i] = (new_w[i] * h * fact) + (org_w[i] * (1.0f - (h * fact))); + rgb_to_hsv_v(&texres.tr, hsv); + org_w[i] = (new_w[i] * hsv[0] * fact) + (org_w[i] * (1.0f - (hsv[0] * fact))); break; case MOD_WVG_MASK_TEX_USE_SAT: - rgb_to_hsv(texres.tr, texres.tg, texres.tb, &h, &s, &v); - org_w[i] = (new_w[i] * s * fact) + (org_w[i] * (1.0f - (s * fact))); + rgb_to_hsv_v(&texres.tr, hsv); + org_w[i] = (new_w[i] * hsv[1] * fact) + (org_w[i] * (1.0f - (hsv[1] * fact))); break; case MOD_WVG_MASK_TEX_USE_VAL: - rgb_to_hsv(texres.tr, texres.tg, texres.tb, &h, &s, &v); - org_w[i] = (new_w[i] * v * fact) + (org_w[i] * (1.0f - (v * fact))); + rgb_to_hsv_v(&texres.tr, hsv); + org_w[i] = (new_w[i] * hsv[2] * fact) + (org_w[i] * (1.0f - (hsv[2] * fact))); break; case MOD_WVG_MASK_TEX_USE_ALPHA: org_w[i] = (new_w[i] * texres.ta * fact) + (org_w[i] * (1.0f - (texres.ta * fact))); diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 1d3099db189..0c88c7d9c81 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -421,9 +421,9 @@ static int python_script_exec(bContext *C, const char *fn, struct Text *text, fclose(fp); - pystring = MEM_mallocN(strlen(fn) + 32, "pystring"); + pystring = MEM_mallocN(strlen(fn) + 36, "pystring"); pystring[0] = '\0'; - sprintf(pystring, "exec(open(r'%s').read())", fn); + sprintf(pystring, "f=open(r'%s');exec(f.read());f.close()", fn); py_result = PyRun_String(pystring, Py_file_input, py_dict, py_dict); MEM_freeN(pystring); } diff --git a/source/blender/python/mathutils/mathutils_Color.c b/source/blender/python/mathutils/mathutils_Color.c index 0f421f1ddea..59c57e916d4 100644 --- a/source/blender/python/mathutils/mathutils_Color.c +++ b/source/blender/python/mathutils/mathutils_Color.c @@ -723,10 +723,10 @@ static int Color_channel_hsv_set(ColorObject *self, PyObject *value, void *type) if (BaseMath_ReadCallback(self) == -1) return -1; - rgb_to_hsv(self->col[0], self->col[1], self->col[2], &(hsv[0]), &(hsv[1]), &(hsv[2])); + rgb_to_hsv_v(self->col, hsv); CLAMP(f, 0.0f, 1.0f); hsv[i] = f; - hsv_to_rgb(hsv[0], hsv[1], hsv[2], &(self->col[0]), &(self->col[1]), &(self->col[2])); + hsv_to_rgb_v(hsv, self->col); if (BaseMath_WriteCallback(self) == -1) return -1; @@ -764,7 +764,7 @@ static int Color_hsv_set(ColorObject *self, PyObject *value, void *UNUSED(closur CLAMP(hsv[1], 0.0f, 1.0f); CLAMP(hsv[2], 0.0f, 1.0f); - hsv_to_rgb(hsv[0], hsv[1], hsv[2], &(self->col[0]), &(self->col[1]), &(self->col[2])); + hsv_to_rgb_v(hsv, self->col); if (BaseMath_WriteCallback(self) == -1) return -1; diff --git a/source/blender/quicktime/apple/quicktime_import.c b/source/blender/quicktime/apple/quicktime_import.c index f3e71feec58..c765e15ef51 100644 --- a/source/blender/quicktime/apple/quicktime_import.c +++ b/source/blender/quicktime/apple/quicktime_import.c @@ -136,7 +136,7 @@ void quicktime_exit(void) #ifdef _WIN32 -char *get_valid_qtname(char *name) +const char *get_valid_qtname(char *name) { TCHAR Buffer[MAX_PATH]; DWORD dwRet; diff --git a/source/blender/quicktime/quicktime_import.h b/source/blender/quicktime/quicktime_import.h index e6f3c821b85..19bdbb4814c 100644 --- a/source/blender/quicktime/quicktime_import.h +++ b/source/blender/quicktime/quicktime_import.h @@ -61,7 +61,7 @@ #endif /* _WIN32 _ */ -char *get_valid_qtname(char *name); +char *get_valid_qtname(const char *name); // quicktime movie import functions diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 3533b8a19f6..fccd3b387f9 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -245,7 +245,7 @@ void wm_event_do_notifiers(bContext *C) if (!G.rendering) { /* depsgraph gets called, might send more notifiers */ - ED_update_for_newframe(CTX_data_main(C), win->screen->scene, win->screen, 1); + ED_update_for_newframe(CTX_data_main(C), win->screen->scene, 1); } } } @@ -1961,7 +1961,7 @@ void wm_event_do_handlers(bContext *C) CTX_wm_screen_set(C, win->screen); CTX_data_scene_set(C, scene); - if (((playing == 1) && (!win->screen->animtimer)) || ((playing == 0) && (win->screen->animtimer))) { + if (((playing == 1) && (!ED_screen_animation_playing(wm))) || ((playing == 0) && (ED_screen_animation_playing(wm)))) { ED_screen_animation_play(C, -1, 1); } @@ -1971,7 +1971,7 @@ void wm_event_do_handlers(bContext *C) int ncfra = sound_sync_scene(scene) * (float)FPS + 0.5f; if (ncfra != scene->r.cfra) { scene->r.cfra = ncfra; - ED_update_for_newframe(CTX_data_main(C), scene, win->screen, 1); + ED_update_for_newframe(CTX_data_main(C), scene, 1); WM_event_add_notifier(C, NC_WINDOW, NULL); } } diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index 16412be42d4..4c45099808c 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -145,8 +145,8 @@ void ibuf_sample(struct ImBuf *ibuf, float fx, float fy, float dx, float dy, flo /* texture.c */ int multitex_thread(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, struct TexResult *texres, short thread, short which_output) {return 0;} -int multitex_ext(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, struct TexResult *texres){return 0;} -int multitex_ext_safe(struct Tex *tex, float *texvec, struct TexResult *texres){return 0;} +int multitex_ext(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, struct TexResult *texres) {return 0;} +int multitex_ext_safe(struct Tex *tex, float *texvec, struct TexResult *texres) {return 0;} int multitex_nodes(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, struct TexResult *texres, short thread, short which_output, struct ShadeInput *shi, struct MTex *mtex) {return 0;} struct Material *RE_init_sample_material(struct Material *orig_mat, struct Scene *scene) {return (struct Material *)NULL;} @@ -155,287 +155,288 @@ void RE_sample_material_color(struct Material *mat, float color[3], float *alpha int face_index, short hit_quad, struct DerivedMesh *orcoDm, struct Object *ob) {} /* nodes */ -struct RenderResult *RE_GetResult(struct Render *re){return (struct RenderResult *) NULL;} -struct Render *RE_GetRender(const char *name){return (struct Render *) NULL;} +struct RenderResult *RE_GetResult(struct Render *re) {return (struct RenderResult *) NULL;} +struct Render *RE_GetRender(const char *name) {return (struct Render *) NULL;} /* blenkernel */ -void RE_FreeRenderResult(struct RenderResult *res){} -void RE_FreeAllRenderResults(void){} -struct RenderResult *RE_MultilayerConvert(void *exrhandle, int rectx, int recty){return (struct RenderResult *) NULL;} -void RE_GetResultImage(struct Render *re, struct RenderResult *rr){} -int RE_RenderInProgress(struct Render *re){return 0;} -struct Scene *RE_GetScene(struct Render *re){return (struct Scene *) NULL;} -void RE_Database_Free(struct Render *re){} -void RE_FreeRender(struct Render *re){} -void RE_DataBase_GetView(struct Render *re, float mat[][4]){} -int externtex(struct MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *tb, float *ta){return 0;} -float texture_value_blend(float tex, float out, float fact, float facg, int blendtype, int flip){return 0.0f;} -void texture_rgb_blend(float *in, float *tex, float *out, float fact, float facg, int blendtype){} +void RE_FreeRenderResult(struct RenderResult *res) {} +void RE_FreeAllRenderResults(void) {} +struct RenderResult *RE_MultilayerConvert(void *exrhandle, int rectx, int recty) {return (struct RenderResult *) NULL;} +void RE_GetResultImage(struct Render *re, struct RenderResult *rr) {} +int RE_RenderInProgress(struct Render *re) {return 0;} +struct Scene *RE_GetScene(struct Render *re) {return (struct Scene *) NULL;} +void RE_Database_Free(struct Render *re) {} +void RE_FreeRender(struct Render *re) {} +void RE_DataBase_GetView(struct Render *re, float mat[][4]) {} +int externtex(struct MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *tb, float *ta) {return 0;} +float texture_value_blend(float tex, float out, float fact, float facg, int blendtype, int flip) {return 0.0f;} +void texture_rgb_blend(float *in, float *tex, float *out, float fact, float facg, int blendtype) {} char stipple_quarttone[1]; //GLubyte stipple_quarttone[128] double elbeemEstimateMemreq(int res, float sx, float sy, float sz, int refine, char *retstr) {return 0.0f;} -struct Render *RE_NewRender(const char *name){return (struct Render*) NULL;} -void RE_SwapResult(struct Render *re, struct RenderResult **rr){} -void RE_BlenderFrame(struct Render *re, struct Scene *scene, int frame){} +struct Render *RE_NewRender(const char *name) {return (struct Render*) NULL;} +void RE_SwapResult(struct Render *re, struct RenderResult **rr) {} +void RE_BlenderFrame(struct Render *re, struct Scene *scene, int frame) {} int RE_WriteEnvmapResult(struct ReportList *reports, struct Scene *scene, struct EnvMap *env, const char *relpath, const char imtype, float layout[12]) { return 0; } /* rna */ -float *give_cursor(struct Scene *scene, struct View3D *v3d){return (float *) NULL;} -void WM_menutype_free(void){} -void WM_menutype_freelink(struct MenuType* mt){} +float *give_cursor(struct Scene *scene, struct View3D *v3d) {return (float *) NULL;} +void WM_menutype_free(void) {} +void WM_menutype_freelink(struct MenuType* mt) {} int WM_menutype_add(struct MenuType *mt) {return 0;} -int WM_operator_props_dialog_popup(struct bContext *C, struct wmOperator *op, int width, int height){return 0;} -int WM_operator_confirm(struct bContext *C, struct wmOperator *op, struct wmEvent *event){return 0;} -struct MenuType *WM_menutype_find(const char *idname, int quiet){return (struct MenuType *) NULL;} +int WM_operator_props_dialog_popup(struct bContext *C, struct wmOperator *op, int width, int height) {return 0;} +int WM_operator_confirm(struct bContext *C, struct wmOperator *op, struct wmEvent *event) {return 0;} +struct MenuType *WM_menutype_find(const char *idname, int quiet) {return (struct MenuType *) NULL;} void WM_operator_stack_clear(struct bContext *C) {} -void WM_autosave_init(struct bContext *C){} -void WM_jobs_stop_all(struct wmWindowManager *wm){} +void WM_autosave_init(struct bContext *C) {} +void WM_jobs_stop_all(struct wmWindowManager *wm) {} -char *WM_clipboard_text_get(int selection){return (char*)0;} -void WM_clipboard_text_set(char *buf, int selection){} +char *WM_clipboard_text_get(int selection) {return (char*)0;} +void WM_clipboard_text_set(char *buf, int selection) {} -struct wmKeyMapItem *WM_keymap_item_find_id(struct wmKeyMap *keymap, int id){return (struct wmKeyMapItem *) NULL;} -int WM_enum_search_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event){return 0;} -void WM_event_add_notifier(const struct bContext *C, unsigned int type, void *reference){} -void WM_main_add_notifier(unsigned int type, void *reference){} -void ED_armature_bone_rename(struct bArmature *arm, char *oldnamep, char *newnamep){} -struct wmEventHandler *WM_event_add_modal_handler(struct bContext *C, struct wmOperator *op){return (struct wmEventHandler *)NULL;} -struct wmTimer *WM_event_add_timer(struct wmWindowManager *wm, struct wmWindow *win, int event_type, double timestep){return (struct wmTimer *)NULL;} -void WM_event_remove_timer(struct wmWindowManager *wm, struct wmWindow *win, struct wmTimer *timer){} -void ED_armature_edit_bone_remove(struct bArmature *arm, struct EditBone *exBone){} -void object_test_constraints(struct Object *owner){} -void ED_object_parent(struct Object *ob, struct Object *par, int type, const char *substr){} -void ED_object_constraint_set_active(struct Object *ob, struct bConstraint *con){} -void ED_node_composit_default(struct Scene *sce){} -void *ED_region_draw_cb_activate(struct ARegionType *art, void(*draw)(const struct bContext *, struct ARegion *, void *), void *custumdata, int type){return 0;} /* XXX this one looks weird */ -void *ED_region_draw_cb_customdata(void *handle){return 0;} /* XXX This one looks wrong also */ -void ED_region_draw_cb_exit(struct ARegionType *art, void *handle){} -void ED_area_headerprint(struct ScrArea *sa, char *str){} +struct wmKeyMapItem *WM_keymap_item_find_id(struct wmKeyMap *keymap, int id) {return (struct wmKeyMapItem *) NULL;} +int WM_enum_search_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event) {return 0;} +void WM_event_add_notifier(const struct bContext *C, unsigned int type, void *reference) {} +void WM_main_add_notifier(unsigned int type, void *reference) {} +void ED_armature_bone_rename(struct bArmature *arm, char *oldnamep, char *newnamep) {} +struct wmEventHandler *WM_event_add_modal_handler(struct bContext *C, struct wmOperator *op) {return (struct wmEventHandler *)NULL;} +struct wmTimer *WM_event_add_timer(struct wmWindowManager *wm, struct wmWindow *win, int event_type, double timestep) {return (struct wmTimer *)NULL;} +void WM_event_remove_timer(struct wmWindowManager *wm, struct wmWindow *win, struct wmTimer *timer) {} +void ED_armature_edit_bone_remove(struct bArmature *arm, struct EditBone *exBone) {} +void object_test_constraints(struct Object *owner) {} +void ED_object_parent(struct Object *ob, struct Object *par, int type, const char *substr) {} +void ED_object_constraint_set_active(struct Object *ob, struct bConstraint *con) {} +void ED_node_composit_default(struct Scene *sce) {} +void *ED_region_draw_cb_activate(struct ARegionType *art, void(*draw)(const struct bContext *, struct ARegion *, void *), void *custumdata, int type) {return 0;} /* XXX this one looks weird */ +void *ED_region_draw_cb_customdata(void *handle) {return 0;} /* XXX This one looks wrong also */ +void ED_region_draw_cb_exit(struct ARegionType *art, void *handle) {} +void ED_area_headerprint(struct ScrArea *sa, char *str) {} -struct EditBone *ED_armature_bone_get_mirrored(struct ListBase *edbo, struct EditBone *ebo){return (struct EditBone *) NULL;} -struct EditBone *ED_armature_edit_bone_add(struct bArmature *arm, char *name){return (struct EditBone*) NULL;} -struct ListBase *get_active_constraints (struct Object *ob){return (struct ListBase *) NULL;} -struct ListBase *get_constraint_lb(struct Object *ob, struct bConstraint *con, struct bPoseChannel **pchan_r){return (struct ListBase *) NULL;} -int ED_pose_channel_in_IK_chain(struct Object *ob, struct bPoseChannel *pchan){return 0;} +struct EditBone *ED_armature_bone_get_mirrored(struct ListBase *edbo, struct EditBone *ebo) {return (struct EditBone *) NULL;} +struct EditBone *ED_armature_edit_bone_add(struct bArmature *arm, char *name) {return (struct EditBone*) NULL;} +struct ListBase *get_active_constraints (struct Object *ob) {return (struct ListBase *) NULL;} +struct ListBase *get_constraint_lb(struct Object *ob, struct bConstraint *con, struct bPoseChannel **pchan_r) {return (struct ListBase *) NULL;} +int ED_pose_channel_in_IK_chain(struct Object *ob, struct bPoseChannel *pchan) {return 0;} -int ED_space_image_show_uvedit(struct SpaceImage *sima, struct Object *obedit){return 0;} -int ED_space_image_show_render(struct SpaceImage *sima){return 0;} -int ED_space_image_show_paint(struct SpaceImage *sima){return 0;} -void ED_space_image_paint_update(struct wmWindowManager *wm, struct ToolSettings *settings){} -void ED_space_image_set(struct SpaceImage *sima, struct Scene *scene, struct Object *obedit, struct Image *ima){} -struct ImBuf *ED_space_image_buffer(struct SpaceImage *sima){return (struct ImBuf *) NULL;} -void ED_space_image_uv_sculpt_update(struct wmWindowManager *wm, struct ToolSettings *settings){} +int ED_space_image_show_uvedit(struct SpaceImage *sima, struct Object *obedit) {return 0;} +int ED_space_image_show_render(struct SpaceImage *sima) {return 0;} +int ED_space_image_show_paint(struct SpaceImage *sima) {return 0;} +void ED_space_image_paint_update(struct wmWindowManager *wm, struct ToolSettings *settings) {} +void ED_space_image_set(struct SpaceImage *sima, struct Scene *scene, struct Object *obedit, struct Image *ima) {} +struct ImBuf *ED_space_image_buffer(struct SpaceImage *sima) {return (struct ImBuf *) NULL;} +void ED_space_image_uv_sculpt_update(struct wmWindowManager *wm, struct ToolSettings *settings) {} -void ED_screen_set_scene(struct bContext *C, struct Scene *scene){} -void ED_space_clip_set(struct bContext *C, struct SpaceClip *sc, struct MovieClip *clip){} +void ED_screen_set_scene(struct bContext *C, struct Scene *scene) {} +void ED_space_clip_set(struct bContext *C, struct SpaceClip *sc, struct MovieClip *clip) {} void ED_space_clip_set_mask(struct bContext *C, struct SpaceClip *sc, struct Mask *mask){} -void ED_area_tag_redraw_regiontype(struct ScrArea *sa, int regiontype){} +void ED_area_tag_redraw_regiontype(struct ScrArea *sa, int regiontype) {} void ED_render_engine_changed(struct Main *bmain) {} -struct PTCacheEdit *PE_get_current(struct Scene *scene, struct Object *ob){return (struct PTCacheEdit *) NULL;} -void PE_current_changed(struct Scene *scene, struct Object *ob){} +struct PTCacheEdit *PE_get_current(struct Scene *scene, struct Object *ob) {return (struct PTCacheEdit *) NULL;} +void PE_current_changed(struct Scene *scene, struct Object *ob) {} /* rna keymap */ -struct wmKeyMap *WM_keymap_active(struct wmWindowManager *wm, struct wmKeyMap *keymap){return (struct wmKeyMap *) NULL;} -struct wmKeyMap *WM_keymap_find(struct wmKeyConfig *keyconf, char *idname, int spaceid, int regionid){return (struct wmKeyMap *) NULL;} -struct wmKeyMap *WM_keymap_add_item(struct wmKeyMap *keymap, char *idname, int type, int val, int modifier, int keymodifier){return (struct wmKeyMap *) NULL;} -struct wmKeyMap *WM_keymap_copy_to_user(struct wmKeyMap *kemap){return (struct wmKeyMap *) NULL;} -struct wmKeyMap *WM_keymap_list_find(struct ListBase *lb, char *idname, int spaceid, int regionid){return (struct wmKeyMap *) NULL;} -struct wmKeyConfig *WM_keyconfig_new(struct wmWindowManager *wm, char *idname){return (struct wmKeyConfig *) NULL;} -struct wmKeyConfig *WM_keyconfig_new_user(struct wmWindowManager *wm, char *idname){return (struct wmKeyConfig *) NULL;} -void WM_keyconfig_remove(struct wmWindowManager *wm, char *idname){} +struct wmKeyMap *WM_keymap_active(struct wmWindowManager *wm, struct wmKeyMap *keymap) {return (struct wmKeyMap *) NULL;} +struct wmKeyMap *WM_keymap_find(struct wmKeyConfig *keyconf, char *idname, int spaceid, int regionid) {return (struct wmKeyMap *) NULL;} +struct wmKeyMap *WM_keymap_add_item(struct wmKeyMap *keymap, char *idname, int type, int val, int modifier, int keymodifier) {return (struct wmKeyMap *) NULL;} +struct wmKeyMap *WM_keymap_copy_to_user(struct wmKeyMap *kemap) {return (struct wmKeyMap *) NULL;} +struct wmKeyMap *WM_keymap_list_find(struct ListBase *lb, char *idname, int spaceid, int regionid) {return (struct wmKeyMap *) NULL;} +struct wmKeyConfig *WM_keyconfig_new(struct wmWindowManager *wm, char *idname) {return (struct wmKeyConfig *) NULL;} +struct wmKeyConfig *WM_keyconfig_new_user(struct wmWindowManager *wm, char *idname) {return (struct wmKeyConfig *) NULL;} +void WM_keyconfig_remove(struct wmWindowManager *wm, char *idname) {} void WM_keyconfig_set_active(struct wmWindowManager *wm, const char *idname) {} -void WM_keymap_remove_item(struct wmKeyMap *keymap, struct wmKeyMapItem *kmi){} -void WM_keymap_restore_to_default(struct wmKeyMap *keymap){} -void WM_keymap_restore_item_to_default(struct bContext *C, struct wmKeyMap *keymap, struct wmKeyMapItem *kmi){} -void WM_keymap_properties_reset(struct wmKeyMapItem *kmi){} +void WM_keymap_remove_item(struct wmKeyMap *keymap, struct wmKeyMapItem *kmi) {} +void WM_keymap_restore_to_default(struct wmKeyMap *keymap) {} +void WM_keymap_restore_item_to_default(struct bContext *C, struct wmKeyMap *keymap, struct wmKeyMapItem *kmi) {} +void WM_keymap_properties_reset(struct wmKeyMapItem *kmi) {} void WM_keyconfig_update_tag(struct wmKeyMap *keymap, struct wmKeyMapItem *kmi) {} -int WM_keymap_item_compare(struct wmKeyMapItem *k1, struct wmKeyMapItem *k2){return 0;} +int WM_keymap_item_compare(struct wmKeyMapItem *k1, struct wmKeyMapItem *k2) {return 0;} /* rna editors */ struct EditMesh; -struct FCurve *verify_fcurve (struct bAction *act, const char group[], const char rna_path[], const int array_index, short add){return (struct FCurve *) NULL;} -int insert_vert_fcurve(struct FCurve *fcu, float x, float y, short flag){return 0;} -void delete_fcurve_key(struct FCurve *fcu, int index, short do_recalc){} -struct KeyingSetInfo *ANIM_keyingset_info_find_name (const char name[]){return (struct KeyingSetInfo *) NULL;} -struct KeyingSet *ANIM_scene_get_active_keyingset (struct Scene *scene){return (struct KeyingSet *) NULL;} -int ANIM_scene_get_keyingset_index(struct Scene *scene, struct KeyingSet *ks){return 0;} +struct FCurve *verify_fcurve (struct bAction *act, const char group[], const char rna_path[], const int array_index, short add) {return (struct FCurve *) NULL;} +int insert_vert_fcurve(struct FCurve *fcu, float x, float y, short flag) {return 0;} +void delete_fcurve_key(struct FCurve *fcu, int index, short do_recalc) {} +struct KeyingSetInfo *ANIM_keyingset_info_find_name (const char name[]) {return (struct KeyingSetInfo *) NULL;} +struct KeyingSet *ANIM_scene_get_active_keyingset (struct Scene *scene) {return (struct KeyingSet *) NULL;} +int ANIM_scene_get_keyingset_index(struct Scene *scene, struct KeyingSet *ks) {return 0;} struct ListBase builtin_keyingsets; -void ANIM_keyingset_info_register(struct KeyingSetInfo *ksi){} -void ANIM_keyingset_info_unregister(const struct bContext *C, struct KeyingSetInfo *ksi){} -short ANIM_validate_keyingset(struct bContext *C, struct ListBase *dsources, struct KeyingSet *ks){return 0;} -short ANIM_add_driver(struct ID *id, const char rna_path[], int array_index, short flag, int type){return 0;} -short ANIM_remove_driver(struct ID *id, const char rna_path[], int array_index, short flag){return 0;} -void ED_space_image_release_buffer(struct SpaceImage *sima, void *lock){} -struct ImBuf *ED_space_image_acquire_buffer(struct SpaceImage *sima, void **lock_r){return (struct ImBuf *) NULL;} +void ANIM_keyingset_info_register(struct KeyingSetInfo *ksi) {} +void ANIM_keyingset_info_unregister(const struct bContext *C, struct KeyingSetInfo *ksi) {} +short ANIM_validate_keyingset(struct bContext *C, struct ListBase *dsources, struct KeyingSet *ks) {return 0;} +short ANIM_add_driver(struct ID *id, const char rna_path[], int array_index, short flag, int type) {return 0;} +short ANIM_remove_driver(struct ID *id, const char rna_path[], int array_index, short flag) {return 0;} +void ED_space_image_release_buffer(struct SpaceImage *sima, void *lock) {} +struct ImBuf *ED_space_image_acquire_buffer(struct SpaceImage *sima, void **lock_r) {return (struct ImBuf *) NULL;} void ED_space_image_zoom(struct SpaceImage *sima, struct ARegion *ar, float *zoomx, float *zoomy) {} -char *ED_info_stats_string(struct Scene *scene){return (char *) NULL;} -void ED_area_tag_redraw(struct ScrArea *sa){} -void ED_area_tag_refresh(struct ScrArea *sa){} -void ED_area_newspace(struct bContext *C, struct ScrArea *sa, int type){} -void ED_region_tag_redraw(struct ARegion *ar){} -void WM_event_add_fileselect(struct bContext *C, struct wmOperator *op){} +char *ED_info_stats_string(struct Scene *scene) {return (char *) NULL;} +void ED_area_tag_redraw(struct ScrArea *sa) {} +void ED_area_tag_refresh(struct ScrArea *sa) {} +void ED_area_newspace(struct bContext *C, struct ScrArea *sa, int type) {} +void ED_region_tag_redraw(struct ARegion *ar) {} +void WM_event_add_fileselect(struct bContext *C, struct wmOperator *op) {} void WM_cursor_wait(int val) {} -void ED_node_texture_default(struct Tex *tx){} -void ED_node_changed_update(struct bContext *C, struct bNode *node){} -void ED_node_generic_update(struct Main *bmain, struct bNodeTree *ntree, struct bNode *node){} -void ED_node_tree_update(struct SpaceNode *snode, struct Scene *scene){} -void ED_view3d_scene_layers_update(struct Main *bmain, struct Scene *scene){} -int ED_view3d_scene_layer_set(int lay, const int *values){return 0;} -void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar){} -void ED_view3d_from_m4(float mat[][4], float ofs[3], float quat[4], float *dist){} -struct BGpic *ED_view3D_background_image_new(struct View3D *v3d){return (struct BGpic *) NULL;} -void ED_view3D_background_image_remove(struct View3D *v3d, struct BGpic *bgpic){} -void ED_view3D_background_image_clear(struct View3D *v3d){} -void ED_view3d_update_viewmat(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, float viewmat[][4], float winmat[][4]){} -void view3d_apply_mat4(float mat[][4], float *ofs, float *quat, float *dist){} -int text_file_modified(struct Text *text){return 0;} -void ED_node_shader_default(struct Material *ma){} -void ED_screen_animation_timer_update(struct bContext *C, int redraws){} -void ED_base_object_select(struct Base *base, short mode){} -int ED_object_modifier_remove(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct ModifierData *md){return 0;} -int ED_object_modifier_add(struct ReportList *reports, struct Scene *scene, struct Object *ob, char *name, int type){return 0;} -void ED_object_modifier_clear(struct Scene *scene, struct Object *ob){} -void ED_object_enter_editmode(struct bContext *C, int flag){} -void ED_object_exit_editmode(struct bContext *C, int flag){} -int uiLayoutGetActive(struct uiLayout *layout){return 0;} -int uiLayoutGetOperatorContext(struct uiLayout *layout){return 0;} -int uiLayoutGetAlignment(struct uiLayout *layout){return 0;} -int uiLayoutGetEnabled(struct uiLayout *layout){return 0;} -float uiLayoutGetScaleX(struct uiLayout *layout){return 0.0f;} -float uiLayoutGetScaleY(struct uiLayout *layout){return 0.0f;} -void uiLayoutSetActive(struct uiLayout *layout, int active){} -void uiLayoutSetOperatorContext(struct uiLayout *layout, int opcontext){} -void uiLayoutSetEnabled(struct uiLayout *layout, int enabled){} -void uiLayoutSetAlignment(struct uiLayout *layout, int alignment){} -void uiLayoutSetScaleX(struct uiLayout *layout, float scale){} -void uiLayoutSetScaleY(struct uiLayout *layout, float scale){} -void ED_base_object_free_and_unlink(struct Scene *scene, struct Base *base){} -void ED_mesh_calc_normals(struct Mesh *me){} -void ED_mesh_geometry_add(struct Mesh *mesh, struct ReportList *reports, int verts, int edges, int faces){} -void ED_mesh_material_add(struct Mesh *me, struct Material *ma){} -void ED_mesh_transform(struct Mesh *me, float *mat){} -void ED_mesh_update(struct Mesh *mesh, struct bContext *C){} -void ED_mesh_vertices_add(struct Mesh *mesh, struct ReportList *reports, int count){} -void ED_mesh_edges_add(struct Mesh *mesh, struct ReportList *reports, int count){} -void ED_mesh_tessfaces_add(struct Mesh *mesh, struct ReportList *reports, int count){} -void ED_mesh_loops_add(struct Mesh *mesh, struct ReportList *reports, int count){} -void ED_mesh_polys_add(struct Mesh *mesh, struct ReportList *reports, int count){} -void ED_mesh_vertices_remove(struct Mesh *mesh, struct ReportList *reports, int count){} -void ED_mesh_edges_remove(struct Mesh *mesh, struct ReportList *reports, int count){} -void ED_mesh_faces_remove(struct Mesh *mesh, struct ReportList *reports, int count){} -void ED_mesh_material_link(struct Mesh *mesh, struct Material *ma){} -int ED_mesh_color_add(struct bContext *C, struct Scene *scene, struct Object *ob, struct Mesh *me){return 0;} -int ED_mesh_uv_texture_add(struct bContext *C, struct Mesh *me){return 0;} -void ED_object_constraint_dependency_update(struct Scene *scene, struct Object *ob){} -void ED_object_constraint_update(struct Object *ob){} -struct bDeformGroup *ED_vgroup_add_name(struct Object *ob, char *name){return (struct bDeformGroup *) NULL;} -void ED_vgroup_vert_add(struct Object *ob, struct bDeformGroup *dg, int vertnum, float weight, int assignmode){} -void ED_vgroup_vert_remove(struct Object *ob, struct bDeformGroup *dg, int vertnum){} -void ED_vgroup_vert_weight(struct Object *ob, struct bDeformGroup *dg, int vertnum){} -void ED_vgroup_delete(struct Object *ob, struct bDeformGroup *defgroup){} -void ED_vgroup_clear(struct Object *ob){} -void ED_vgroup_object_is_edit_mode(struct Object *ob){} +void ED_node_texture_default(struct Tex *tx) {} +void ED_node_changed_update(struct bContext *C, struct bNode *node) {} +void ED_node_generic_update(struct Main *bmain, struct bNodeTree *ntree, struct bNode *node) {} +void ED_node_tree_update(struct SpaceNode *snode, struct Scene *scene) {} +void ED_view3d_scene_layers_update(struct Main *bmain, struct Scene *scene) {} +int ED_view3d_scene_layer_set(int lay, const int *values) {return 0;} +void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar) {} +void ED_view3d_from_m4(float mat[][4], float ofs[3], float quat[4], float *dist) {} +struct BGpic *ED_view3D_background_image_new(struct View3D *v3d) {return (struct BGpic *) NULL;} +void ED_view3D_background_image_remove(struct View3D *v3d, struct BGpic *bgpic) {} +void ED_view3D_background_image_clear(struct View3D *v3d) {} +void ED_view3d_update_viewmat(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, float viewmat[][4], float winmat[][4]) {} +void view3d_apply_mat4(float mat[][4], float *ofs, float *quat, float *dist) {} +int text_file_modified(struct Text *text) {return 0;} +void ED_node_shader_default(struct Material *ma) {} +void ED_screen_animation_timer_update(struct bContext *C, int redraws) {} +void ED_screen_animation_playing(struct wmWindowManager *wm) {} +void ED_base_object_select(struct Base *base, short mode) {} +int ED_object_modifier_remove(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct ModifierData *md) {return 0;} +int ED_object_modifier_add(struct ReportList *reports, struct Scene *scene, struct Object *ob, char *name, int type) {return 0;} +void ED_object_modifier_clear(struct Scene *scene, struct Object *ob) {} +void ED_object_enter_editmode(struct bContext *C, int flag) {} +void ED_object_exit_editmode(struct bContext *C, int flag) {} +int uiLayoutGetActive(struct uiLayout *layout) {return 0;} +int uiLayoutGetOperatorContext(struct uiLayout *layout) {return 0;} +int uiLayoutGetAlignment(struct uiLayout *layout) {return 0;} +int uiLayoutGetEnabled(struct uiLayout *layout) {return 0;} +float uiLayoutGetScaleX(struct uiLayout *layout) {return 0.0f;} +float uiLayoutGetScaleY(struct uiLayout *layout) {return 0.0f;} +void uiLayoutSetActive(struct uiLayout *layout, int active) {} +void uiLayoutSetOperatorContext(struct uiLayout *layout, int opcontext) {} +void uiLayoutSetEnabled(struct uiLayout *layout, int enabled) {} +void uiLayoutSetAlignment(struct uiLayout *layout, int alignment) {} +void uiLayoutSetScaleX(struct uiLayout *layout, float scale) {} +void uiLayoutSetScaleY(struct uiLayout *layout, float scale) {} +void ED_base_object_free_and_unlink(struct Scene *scene, struct Base *base) {} +void ED_mesh_calc_normals(struct Mesh *me) {} +void ED_mesh_geometry_add(struct Mesh *mesh, struct ReportList *reports, int verts, int edges, int faces) {} +void ED_mesh_material_add(struct Mesh *me, struct Material *ma) {} +void ED_mesh_transform(struct Mesh *me, float *mat) {} +void ED_mesh_update(struct Mesh *mesh, struct bContext *C) {} +void ED_mesh_vertices_add(struct Mesh *mesh, struct ReportList *reports, int count) {} +void ED_mesh_edges_add(struct Mesh *mesh, struct ReportList *reports, int count) {} +void ED_mesh_tessfaces_add(struct Mesh *mesh, struct ReportList *reports, int count) {} +void ED_mesh_loops_add(struct Mesh *mesh, struct ReportList *reports, int count) {} +void ED_mesh_polys_add(struct Mesh *mesh, struct ReportList *reports, int count) {} +void ED_mesh_vertices_remove(struct Mesh *mesh, struct ReportList *reports, int count) {} +void ED_mesh_edges_remove(struct Mesh *mesh, struct ReportList *reports, int count) {} +void ED_mesh_faces_remove(struct Mesh *mesh, struct ReportList *reports, int count) {} +void ED_mesh_material_link(struct Mesh *mesh, struct Material *ma) {} +int ED_mesh_color_add(struct bContext *C, struct Scene *scene, struct Object *ob, struct Mesh *me) {return 0;} +int ED_mesh_uv_texture_add(struct bContext *C, struct Mesh *me) {return 0;} +void ED_object_constraint_dependency_update(struct Scene *scene, struct Object *ob) {} +void ED_object_constraint_update(struct Object *ob) {} +struct bDeformGroup *ED_vgroup_add_name(struct Object *ob, char *name) {return (struct bDeformGroup *) NULL;} +void ED_vgroup_vert_add(struct Object *ob, struct bDeformGroup *dg, int vertnum, float weight, int assignmode) {} +void ED_vgroup_vert_remove(struct Object *ob, struct bDeformGroup *dg, int vertnum) {} +void ED_vgroup_vert_weight(struct Object *ob, struct bDeformGroup *dg, int vertnum) {} +void ED_vgroup_delete(struct Object *ob, struct bDeformGroup *defgroup) {} +void ED_vgroup_clear(struct Object *ob) {} +void ED_vgroup_object_is_edit_mode(struct Object *ob) {} long mesh_mirrtopo_table(struct Object *ob, char mode) { return 0; } intptr_t mesh_octree_table(struct Object *ob, struct BMEditMesh *em, float *co, char mode) { return 0; } -void ED_sequencer_update_view(struct bContext *C, int view){} -float ED_rollBoneToVector(struct EditBone *bone, float new_up_axis[3]){return 0.0f;} -void ED_space_image_size(struct SpaceImage *sima, int *width, int *height){} +void ED_sequencer_update_view(struct bContext *C, int view) {} +float ED_rollBoneToVector(struct EditBone *bone, float new_up_axis[3]) {return 0.0f;} +void ED_space_image_size(struct SpaceImage *sima, int *width, int *height) {} -void ED_nurb_set_spline_type(struct Nurb *nu, int type){} +void ED_nurb_set_spline_type(struct Nurb *nu, int type) {} -void make_editLatt(struct Object *obedit){} -void load_editLatt(struct Object *obedit){} +void make_editLatt(struct Object *obedit) {} +void load_editLatt(struct Object *obedit) {} -void load_editNurb(struct Object *obedit){} -void make_editNurb(struct Object *obedit){} +void load_editNurb(struct Object *obedit) {} +void make_editNurb(struct Object *obedit) {} -void uiItemR(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, int flag, char *name, int icon){} +void uiItemR(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, int flag, char *name, int icon) {} -struct PointerRNA uiItemFullO(struct uiLayout *layout, char *idname, char *name, int icon, struct IDProperty *properties, int context, int flag){struct PointerRNA a = {{0}}; return a;} -struct uiLayout *uiLayoutRow(struct uiLayout *layout, int align){return (struct uiLayout *) NULL;} -struct uiLayout *uiLayoutColumn(struct uiLayout *layout, int align){return (struct uiLayout *) NULL;} -struct uiLayout *uiLayoutColumnFlow(struct uiLayout *layout, int number, int align){return (struct uiLayout *) NULL;} -struct uiLayout *uiLayoutBox(struct uiLayout *layout){return (struct uiLayout *) NULL;} -struct uiLayout *uiLayoutSplit(struct uiLayout *layout, float percentage, int align){return (struct uiLayout *) NULL;} -int uiLayoutGetRedAlert(struct uiLayout *layout){return 0;} -void uiLayoutSetRedAlert(struct uiLayout *layout, int redalert){} -void uiItemsEnumR(struct uiLayout *layout, struct PointerRNA *ptr, char *propname){} -void uiItemMenuEnumR(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, char *name, int icon){} -void uiItemEnumR_string(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, char *value, char *name, int icon){} -void uiItemPointerR(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, struct PointerRNA *searchptr, char *searchpropname, char *name, int icon){} -void uiItemPointerSubR(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, char *searchpropname, char *name, int icon){} -void uiItemsEnumO(struct uiLayout *layout, char *opname, char *propname){} -void uiItemEnumO_string(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value_str){} -void uiItemMenuEnumO(struct uiLayout *layout, char *opname, char *propname, char *name, int icon){} -void uiItemBooleanO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, int value){} -void uiItemIntO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, int value){} -void uiItemFloatO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, float value){} -void uiItemStringO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value){} -void uiItemL(struct uiLayout *layout, const char *name, int icon){} -void uiItemM(struct uiLayout *layout, struct bContext *C, char *menuname, char *name, int icon){} -void uiItemS(struct uiLayout *layout){} -void uiItemFullR(struct uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, char *name, int icon){} -void uiLayoutSetContextPointer(struct uiLayout *layout, char *name, struct PointerRNA *ptr){} -char *uiLayoutIntrospect(struct uiLayout *layout){return (char *)NULL;} +struct PointerRNA uiItemFullO(struct uiLayout *layout, char *idname, char *name, int icon, struct IDProperty *properties, int context, int flag) {struct PointerRNA a = {{0}}; return a;} +struct uiLayout *uiLayoutRow(struct uiLayout *layout, int align) {return (struct uiLayout *) NULL;} +struct uiLayout *uiLayoutColumn(struct uiLayout *layout, int align) {return (struct uiLayout *) NULL;} +struct uiLayout *uiLayoutColumnFlow(struct uiLayout *layout, int number, int align) {return (struct uiLayout *) NULL;} +struct uiLayout *uiLayoutBox(struct uiLayout *layout) {return (struct uiLayout *) NULL;} +struct uiLayout *uiLayoutSplit(struct uiLayout *layout, float percentage, int align) {return (struct uiLayout *) NULL;} +int uiLayoutGetRedAlert(struct uiLayout *layout) {return 0;} +void uiLayoutSetRedAlert(struct uiLayout *layout, int redalert) {} +void uiItemsEnumR(struct uiLayout *layout, struct PointerRNA *ptr, char *propname) {} +void uiItemMenuEnumR(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, char *name, int icon) {} +void uiItemEnumR_string(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, char *value, char *name, int icon) {} +void uiItemPointerR(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, struct PointerRNA *searchptr, char *searchpropname, char *name, int icon) {} +void uiItemPointerSubR(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, char *searchpropname, char *name, int icon) {} +void uiItemsEnumO(struct uiLayout *layout, char *opname, char *propname) {} +void uiItemEnumO_string(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value_str) {} +void uiItemMenuEnumO(struct uiLayout *layout, char *opname, char *propname, char *name, int icon) {} +void uiItemBooleanO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, int value) {} +void uiItemIntO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, int value) {} +void uiItemFloatO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, float value) {} +void uiItemStringO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value) {} +void uiItemL(struct uiLayout *layout, const char *name, int icon) {} +void uiItemM(struct uiLayout *layout, struct bContext *C, char *menuname, char *name, int icon) {} +void uiItemS(struct uiLayout *layout) {} +void uiItemFullR(struct uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, char *name, int icon) {} +void uiLayoutSetContextPointer(struct uiLayout *layout, char *name, struct PointerRNA *ptr) {} +char *uiLayoutIntrospect(struct uiLayout *layout) {return (char *)NULL;} void UI_reinit_font(void) {} /* rna template */ -void uiTemplateAnyID(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, char *text){} -void uiTemplatePathBuilder(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, struct PointerRNA *root_ptr, char *text){} -void uiTemplateHeader(struct uiLayout *layout, struct bContext *C, int menus){} -void uiTemplateID(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, char *newop, char *unlinkop){} -struct uiLayout *uiTemplateModifier(struct uiLayout *layout, struct PointerRNA *ptr){return (struct uiLayout *) NULL;} -struct uiLayout *uiTemplateConstraint(struct uiLayout *layout, struct PointerRNA *ptr){return (struct uiLayout *) NULL;} -void uiTemplatePreview(struct uiLayout *layout, struct ID *id, int show_buttons, struct ID *parent, struct MTex *slot){} -void uiTemplateIDPreview(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, char *newop, char *openop, char *unlinkop, int rows, int cols){} -void uiTemplateCurveMapping(struct uiLayout *layout, struct CurveMapping *cumap, int type, int compact){} -void uiTemplateColorRamp(struct uiLayout *layout, struct ColorBand *coba, int expand){} -void uiTemplateLayers(struct uiLayout *layout, struct PointerRNA *ptr, char *propname){} -void uiTemplateImageLayers(struct uiLayout *layout, struct bContext *C, struct Image *ima, struct ImageUser *iuser){} -ListBase uiTemplateList(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, struct PointerRNA *activeptr, char *activepropname, int rows, int listtype){struct ListBase b = {0,0}; return b;} -void uiTemplateRunningJobs(struct uiLayout *layout, struct bContext *C){} -void uiTemplateOperatorSearch(struct uiLayout *layout){} -void uiTemplateHeader3D(struct uiLayout *layout, struct bContext *C){} -void uiTemplateEditModeSelection(struct uiLayout *layout, struct bContext *C){} -void uiTemplateTextureImage(struct uiLayout *layout, struct bContext *C, struct Tex *tex){} -void uiTemplateImage(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, struct PointerRNA *userptr, int compact){} -void uiTemplateDopeSheetFilter(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr){} -void uiTemplateColorWheel(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, int value_slider){} -void uiTemplateHistogram(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand){} -void uiTemplateReportsBanner(struct uiLayout *layout, struct bContext *C, struct wmOperator *op){} -void uiTemplateWaveform(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand){} -void uiTemplateVectorscope(struct uiLayout *_self, struct PointerRNA *data, char* property, int expand){} +void uiTemplateAnyID(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, char *text) {} +void uiTemplatePathBuilder(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, struct PointerRNA *root_ptr, char *text) {} +void uiTemplateHeader(struct uiLayout *layout, struct bContext *C, int menus) {} +void uiTemplateID(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, char *newop, char *unlinkop) {} +struct uiLayout *uiTemplateModifier(struct uiLayout *layout, struct PointerRNA *ptr) {return (struct uiLayout *) NULL;} +struct uiLayout *uiTemplateConstraint(struct uiLayout *layout, struct PointerRNA *ptr) {return (struct uiLayout *) NULL;} +void uiTemplatePreview(struct uiLayout *layout, struct ID *id, int show_buttons, struct ID *parent, struct MTex *slot) {} +void uiTemplateIDPreview(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, char *newop, char *openop, char *unlinkop, int rows, int cols) {} +void uiTemplateCurveMapping(struct uiLayout *layout, struct CurveMapping *cumap, int type, int compact) {} +void uiTemplateColorRamp(struct uiLayout *layout, struct ColorBand *coba, int expand) {} +void uiTemplateLayers(struct uiLayout *layout, struct PointerRNA *ptr, char *propname) {} +void uiTemplateImageLayers(struct uiLayout *layout, struct bContext *C, struct Image *ima, struct ImageUser *iuser) {} +ListBase uiTemplateList(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, struct PointerRNA *activeptr, char *activepropname, int rows, int listtype) {struct ListBase b = {0,0}; return b;} +void uiTemplateRunningJobs(struct uiLayout *layout, struct bContext *C) {} +void uiTemplateOperatorSearch(struct uiLayout *layout) {} +void uiTemplateHeader3D(struct uiLayout *layout, struct bContext *C) {} +void uiTemplateEditModeSelection(struct uiLayout *layout, struct bContext *C) {} +void uiTemplateTextureImage(struct uiLayout *layout, struct bContext *C, struct Tex *tex) {} +void uiTemplateImage(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, struct PointerRNA *userptr, int compact) {} +void uiTemplateDopeSheetFilter(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr) {} +void uiTemplateColorWheel(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, int value_slider) {} +void uiTemplateHistogram(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand) {} +void uiTemplateReportsBanner(struct uiLayout *layout, struct bContext *C, struct wmOperator *op) {} +void uiTemplateWaveform(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand) {} +void uiTemplateVectorscope(struct uiLayout *_self, struct PointerRNA *data, char* property, int expand) {} void uiTemplateNodeLink(struct uiLayout *layout, struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *input) {} void uiTemplateNodeView(struct uiLayout *layout, struct bContext *C, struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *input) {} void uiTemplateTextureUser(struct uiLayout *layout, struct bContext *C) {} void uiTemplateTextureShow(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop) {} -void uiTemplateKeymapItemProperties(struct uiLayout *layout, struct PointerRNA *ptr){} -void uiTemplateMovieClip(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, int compact){} -void uiTemplateTrack(struct uiLayout *layout, struct PointerRNA *ptr, const char *propname){} -void uiTemplateMarker(struct uiLayout *layout, struct PointerRNA *ptr, const char *propname, PointerRNA *userptr, PointerRNA *trackptr, int compact){} -void uiTemplateImageSettings(struct uiLayout *layout, struct PointerRNA *imfptr){} +void uiTemplateKeymapItemProperties(struct uiLayout *layout, struct PointerRNA *ptr) {} +void uiTemplateMovieClip(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, int compact) {} +void uiTemplateTrack(struct uiLayout *layout, struct PointerRNA *ptr, const char *propname) {} +void uiTemplateMarker(struct uiLayout *layout, struct PointerRNA *ptr, const char *propname, PointerRNA *userptr, PointerRNA *trackptr, int compact) {} +void uiTemplateImageSettings(struct uiLayout *layout, struct PointerRNA *imfptr) {} /* rna render */ -struct RenderResult *RE_engine_begin_result(struct RenderEngine *engine, int x, int y, int w, int h){return (struct RenderResult *) NULL;} -struct RenderResult *RE_AcquireResultRead(struct Render *re){return (struct RenderResult *) NULL;} -struct RenderResult *RE_AcquireResultWrite(struct Render *re){return (struct RenderResult *) NULL;} -struct RenderStats *RE_GetStats(struct Render *re){return (struct RenderStats *) NULL;} -void RE_engine_update_result(struct RenderEngine *engine, struct RenderResult *result){} +struct RenderResult *RE_engine_begin_result(struct RenderEngine *engine, int x, int y, int w, int h) {return (struct RenderResult *) NULL;} +struct RenderResult *RE_AcquireResultRead(struct Render *re) {return (struct RenderResult *) NULL;} +struct RenderResult *RE_AcquireResultWrite(struct Render *re) {return (struct RenderResult *) NULL;} +struct RenderStats *RE_GetStats(struct Render *re) {return (struct RenderStats *) NULL;} +void RE_engine_update_result(struct RenderEngine *engine, struct RenderResult *result) {} void RE_engine_update_progress(struct RenderEngine *engine, float progress) {} -void RE_engine_end_result(struct RenderEngine *engine, struct RenderResult *result){} -void RE_engine_update_stats(struct RenderEngine *engine, char *stats, char *info){} -void RE_layer_load_from_file(struct RenderLayer *layer, struct ReportList *reports, char *filename){} -void RE_result_load_from_file(struct RenderResult *result, struct ReportList *reports, char *filename){} -void RE_AcquireResultImage(struct Render *re, struct RenderResult *rr){} -void RE_ReleaseResult(struct Render *re){} -void RE_ReleaseResultImage(struct Render *re){} -int RE_engine_test_break(struct RenderEngine *engine){return 0;} +void RE_engine_end_result(struct RenderEngine *engine, struct RenderResult *result) {} +void RE_engine_update_stats(struct RenderEngine *engine, char *stats, char *info) {} +void RE_layer_load_from_file(struct RenderLayer *layer, struct ReportList *reports, char *filename) {} +void RE_result_load_from_file(struct RenderResult *result, struct ReportList *reports, char *filename) {} +void RE_AcquireResultImage(struct Render *re, struct RenderResult *rr) {} +void RE_ReleaseResult(struct Render *re) {} +void RE_ReleaseResultImage(struct Render *re) {} +int RE_engine_test_break(struct RenderEngine *engine) {return 0;} void RE_engines_init() {} void RE_engines_exit() {} void RE_engine_report(struct RenderEngine *engine, int type, const char *msg) {} @@ -444,43 +445,43 @@ void RE_engine_free(struct RenderEngine *engine) {} struct RenderEngineType *RE_engines_find(const char *idname) { return NULL; } /* python */ -struct wmOperatorType *WM_operatortype_find(const char *idname, int quiet){return (struct wmOperatorType *) NULL;} -struct GHashIterator *WM_operatortype_iter(){return (struct GHashIterator *) NULL;} -struct wmOperatorType *WM_operatortype_exists(const char *idname){return (struct wmOperatorType *) NULL;} -struct wmOperatorTypeMacro *WM_operatortype_macro_define(struct wmOperatorType *ot, const char *idname){return (struct wmOperatorTypeMacro *) NULL;} -int WM_operator_call_py(struct bContext *C, struct wmOperatorType *ot, int context, struct PointerRNA *properties, struct ReportList *reports){return 0;} -int WM_operatortype_remove(const char *idname){return 0;} -int WM_operator_poll(struct bContext *C, struct wmOperatorType *ot){return 0;} -int WM_operator_poll_context(struct bContext *C, struct wmOperatorType *ot, int context){return 0;} -int WM_operator_props_popup(struct bContext *C, struct wmOperator *op, struct wmEvent *event){return 0;} -void WM_operator_properties_free(struct PointerRNA *ptr){} -void WM_operator_properties_create(struct PointerRNA *ptr, const char *opstring){} -void WM_operator_properties_create_ptr(struct PointerRNA *ptr, struct wmOperatorType *ot){} -void WM_operator_properties_sanitize(struct PointerRNA *ptr, const short no_context){}; -void WM_operatortype_append_ptr(void (*opfunc)(struct wmOperatorType*, void*), void *userdata){} -void WM_operatortype_append_macro_ptr(void (*opfunc)(struct wmOperatorType*, void*), void *userdata){} -void WM_operator_bl_idname(char *to, const char *from){} -void WM_operator_py_idname(char *to, const char *from){} -void WM_operator_ui_popup(struct bContext *C, struct wmOperator *op, int width, int height){} -short insert_keyframe(struct ID *id, struct bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short flag){return 0;} -short delete_keyframe(struct ID *id, struct bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short flag){return 0;}; -char *WM_operator_pystring(struct bContext *C, struct wmOperatorType *ot, struct PointerRNA *opptr, int all_args){return (char *)NULL;} -struct wmKeyMapItem *WM_modalkeymap_add_item(struct wmKeyMap *km, int type, int val, int modifier, int keymodifier, int value){return (struct wmKeyMapItem *)NULL;} -struct wmKeyMapItem *WM_modalkeymap_add_item_str(struct wmKeyMap *km, int type, int val, int modifier, int keymodifier, const char *value){return (struct wmKeyMapItem *)NULL;} -struct wmKeyMap *WM_modalkeymap_add(struct wmKeyConfig *keyconf, char *idname, EnumPropertyItem *items){return (struct wmKeyMap *) NULL;} +struct wmOperatorType *WM_operatortype_find(const char *idname, int quiet) {return (struct wmOperatorType *) NULL;} +struct GHashIterator *WM_operatortype_iter() {return (struct GHashIterator *) NULL;} +struct wmOperatorType *WM_operatortype_exists(const char *idname) {return (struct wmOperatorType *) NULL;} +struct wmOperatorTypeMacro *WM_operatortype_macro_define(struct wmOperatorType *ot, const char *idname) {return (struct wmOperatorTypeMacro *) NULL;} +int WM_operator_call_py(struct bContext *C, struct wmOperatorType *ot, int context, struct PointerRNA *properties, struct ReportList *reports) {return 0;} +int WM_operatortype_remove(const char *idname) {return 0;} +int WM_operator_poll(struct bContext *C, struct wmOperatorType *ot) {return 0;} +int WM_operator_poll_context(struct bContext *C, struct wmOperatorType *ot, int context) {return 0;} +int WM_operator_props_popup(struct bContext *C, struct wmOperator *op, struct wmEvent *event) {return 0;} +void WM_operator_properties_free(struct PointerRNA *ptr) {} +void WM_operator_properties_create(struct PointerRNA *ptr, const char *opstring) {} +void WM_operator_properties_create_ptr(struct PointerRNA *ptr, struct wmOperatorType *ot) {} +void WM_operator_properties_sanitize(struct PointerRNA *ptr, const short no_context) {}; +void WM_operatortype_append_ptr(void (*opfunc)(struct wmOperatorType*, void*), void *userdata) {} +void WM_operatortype_append_macro_ptr(void (*opfunc)(struct wmOperatorType*, void*), void *userdata) {} +void WM_operator_bl_idname(char *to, const char *from) {} +void WM_operator_py_idname(char *to, const char *from) {} +void WM_operator_ui_popup(struct bContext *C, struct wmOperator *op, int width, int height) {} +short insert_keyframe(struct ID *id, struct bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short flag) {return 0;} +short delete_keyframe(struct ID *id, struct bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short flag) {return 0;}; +char *WM_operator_pystring(struct bContext *C, struct wmOperatorType *ot, struct PointerRNA *opptr, int all_args) {return (char *)NULL;} +struct wmKeyMapItem *WM_modalkeymap_add_item(struct wmKeyMap *km, int type, int val, int modifier, int keymodifier, int value) {return (struct wmKeyMapItem *)NULL;} +struct wmKeyMapItem *WM_modalkeymap_add_item_str(struct wmKeyMap *km, int type, int val, int modifier, int keymodifier, const char *value) {return (struct wmKeyMapItem *)NULL;} +struct wmKeyMap *WM_modalkeymap_add(struct wmKeyConfig *keyconf, char *idname, EnumPropertyItem *items) {return (struct wmKeyMap *) NULL;} /* RNA COLLADA dependency */ -int collada_export(struct Scene *sce, const char *filepath){ return 0; } +int collada_export(struct Scene *sce, const char *filepath) { return 0; } int sculpt_get_brush_size(struct Brush *brush) {return 0;} void sculpt_set_brush_size(struct Brush *brush, int size) {} -int sculpt_get_lock_brush_size(struct Brush *brush){ return 0;} -float sculpt_get_brush_unprojected_radius(struct Brush *brush){return 0.0f;} -void sculpt_set_brush_unprojected_radius(struct Brush *brush, float unprojected_radius){} -float sculpt_get_brush_alpha(struct Brush *brush){return 0.0f;} -void sculpt_set_brush_alpha(struct Brush *brush, float alpha){} -void ED_sculpt_modifiers_changed(struct Object *ob){} -void ED_mesh_calc_tessface(struct Mesh *mesh){} +int sculpt_get_lock_brush_size(struct Brush *brush) { return 0;} +float sculpt_get_brush_unprojected_radius(struct Brush *brush) {return 0.0f;} +void sculpt_set_brush_unprojected_radius(struct Brush *brush, float unprojected_radius) {} +float sculpt_get_brush_alpha(struct Brush *brush) {return 0.0f;} +void sculpt_set_brush_alpha(struct Brush *brush, float alpha) {} +void ED_sculpt_modifiers_changed(struct Object *ob) {} +void ED_mesh_calc_tessface(struct Mesh *mesh) {} /* bpy/python internal api */ void operator_wrapper(struct wmOperatorType *ot, void *userdata) {} @@ -492,9 +493,9 @@ float BPY_driver_exec(struct ChannelDriver *driver, const float evaltime) {retur void BPY_DECREF(void *pyob_ptr) {} void BPY_pyconstraint_exec(struct bPythonConstraint *con, struct bConstraintOb *cob, struct ListBase *targets) {} void macro_wrapper(struct wmOperatorType *ot, void *userdata) {} -int pyrna_id_FromPyObject(struct PyObject *obj, struct ID **id){ return 0; } +int pyrna_id_FromPyObject(struct PyObject *obj, struct ID **id) { return 0; } struct PyObject *pyrna_id_CreatePyObject(struct ID *id) {return NULL; } -void BPY_context_update(struct bContext *C){}; +void BPY_context_update(struct bContext *C) {}; /* intern/dualcon */ struct DualConMesh; diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp index 99f2431ac1e..f4d3fb75223 100644 --- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp +++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp @@ -588,7 +588,8 @@ void VideoFFmpeg::openCam (char * file, short camIdx) AVInputFormat *inputFormat; AVFormatParameters formatParams; AVRational frameRate; - char *p, filename[28], rateStr[20]; + char filename[28], rateStr[20]; + char *p; do_init_ffmpeg();