This commit is contained in:
Campbell Barton 2011-08-11 05:04:01 +00:00
commit ef18ec335f
63 changed files with 6767 additions and 6743 deletions

@ -253,14 +253,22 @@ if 'blenderlite' in B.targets:
if k not in B.arguments:
env[k] = v
# detect presence of 3D_CONNEXION_CLIENT_LIBRARY for OSX
# Extended OSX_SDK and 3D_CONNEXION_CLIENT_LIBRARY detection for OSX
if env['OURPLATFORM']=='darwin':
envi = Environment()
conf = Configure(envi)
if not conf.CheckCHeader('ConnexionClientAPI.h'): # CheckCXXHeader if it is c++ !
print B.bc.OKGREEN + "Detected Xcode version: -- " + B.bc.ENDC + env['XCODE_CUR_VER'][:9] + " --"
print "Available " + env['MACOSX_SDK_CHECK']
if not 'Mac OS X 10.5' in env['MACOSX_SDK_CHECK']:
print B.bc.OKGREEN + "MacOSX10.5.sdk not available:" + B.bc.ENDC + " using MacOSX10.6.sdk"
else:
print B.bc.OKGREEN + "Found recommended sdk :" + B.bc.ENDC + " using MacOSX10.5.sdk"
# for now, Mac builders must download and install the driver framework from 3Dconnexion
# necessary header file lives here when installed:
# /Library/Frameworks/3DconnexionClient.framework/Versions/Current/Headers/ConnexionClientAPI.h
if env['WITH_BF_3DMOUSE'] == 1 and not os.path.exists('/Library/Frameworks/3DconnexionClient.framework'):
print "3D_CONNEXION_CLIENT_LIBRARY not found, disabling WITH_BF_3DMOUSE" # avoid build errors !
env['WITH_BF_3DMOUSE'] = 0
envi = conf.Finish()
env['FOUND_NDOF_DRIVERS'] = 0
if env['WITH_BF_OPENMP'] == 1:

@ -134,7 +134,7 @@ else:
scons_options.append('BF_FFMPEG_LIB=' + (' '.join(ffmpeg_lib)))
scons_options.append('BF_FFMPEG_DLL=' + (' '.join(ffmpeg_dll)))
scons_options.append('BF_BITNESS='+bitness)
scons_options.append('BF_BITNESS=' + bitness)
retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options)
sys.exit(retcode)

@ -98,7 +98,7 @@ if builder.find('scons') != -1:
scons_options.append('BF_FFMPEG_LIB=' + (' '.join(ffmpeg_lib)))
scons_options.append('BF_FFMPEG_DLL=' + (' '.join(ffmpeg_dll)))
scons_options.append('BF_BITNESS='+bitness)
scons_options.append('BF_BITNESS=' + bitness)
retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options)
sys.exit(retcode)

@ -62,6 +62,10 @@ macro(blender_include_dirs
foreach(_INC ${ARGV})
get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
list(APPEND _ALL_INCS ${_ABS_INC})
# for checking for invalid includes, disable for regular use
##if(NOT EXISTS "${_ABS_INC}/")
## message(FATAL_ERROR "Include not found: ${_ABS_INC}/")
##endif()
endforeach()
include_directories(${_ALL_INCS})
unset(_INC)
@ -75,6 +79,9 @@ macro(blender_include_dirs_sys
foreach(_INC ${ARGV})
get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
list(APPEND _ALL_INCS ${_ABS_INC})
##if(NOT EXISTS "${_ABS_INC}/")
## message(FATAL_ERROR "Include not found: ${_ABS_INC}/")
##endif()
endforeach()
include_directories(SYSTEM ${_ALL_INCS})
unset(_INC)

@ -21,17 +21,23 @@ cmd = 'uname -p'
MAC_PROC=commands.getoutput(cmd)
cmd = 'uname -r'
cmd_res=commands.getoutput(cmd)
MAC_CUR_VER='10.5' # by default (test below fails on my 10.5 PowerPC)
if cmd_res[:2]=='7':
if cmd_res[:1]=='7':
MAC_CUR_VER='10.3'
elif cmd_res[:2]=='8':
elif cmd_res[:1]=='8':
MAC_CUR_VER='10.4'
elif cmd_res[:2]=='9':
elif cmd_res[:1]=='9':
MAC_CUR_VER='10.5'
elif cmd_res[:2]=='10':
MAC_CUR_VER='10.6'
elif cmd_res[:2]=='11':
MAC_CUR_VER='10.7'
cmd = 'xcodebuild -version'
cmd_xcode=commands.getoutput(cmd)
XCODE_CUR_VER=cmd_xcode
cmd = 'xcodebuild -showsdks'
cmd_sdk=commands.getoutput(cmd)
MACOSX_SDK_CHECK=cmd_sdk
if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'ppc64':
USE_QTKIT=True # Carbon quicktime is not available for 64bit
@ -60,21 +66,23 @@ elif MACOSX_ARCHITECTURE == 'i386' and MAC_CUR_VER == '10.4':
LCGDIR = '#../lib/darwin-8.x.i386'
CC = 'gcc-4.0'
CXX = 'g++-4.0'
elif MAC_CUR_VER >= '10.6':
# OSX 10.6 and 10.7 developer tools do not come with sdk < 10.6 anymore !
MAC_MIN_VERS = '10.6'
MACOSX_DEPLOYMENT_TARGET = '10.6'
MACOSX_SDK='/Developer/SDKs/MacOSX10.6.sdk'
LCGDIR = '#../lib/darwin-9.x.universal'
CC = 'llvm-gcc-4.2'
CXX = 'llvm-g++-4.2'
else :
MAC_MIN_VERS = '10.5'
MACOSX_DEPLOYMENT_TARGET = '10.5'
MACOSX_SDK='/Developer/SDKs/MacOSX10.5.sdk'
LCGDIR = '#../lib/darwin-9.x.universal'
CC = 'gcc-4.2'
CXX = 'g++-4.2'
if 'Mac OS X 10.5' in MACOSX_SDK_CHECK:
# OSX 10.5/6 with Xcode 3.x
MAC_MIN_VERS = '10.5'
MACOSX_DEPLOYMENT_TARGET = '10.5'
MACOSX_SDK='/Developer/SDKs/MacOSX10.5.sdk'
LCGDIR = '#../lib/darwin-9.x.universal'
CC = 'gcc-4.2'
CXX = 'g++-4.2'
else:
# OSX 10.6/7 with Xcode 4.x
MAC_MIN_VERS = '10.6'
MACOSX_DEPLOYMENT_TARGET = '10.6'
MACOSX_SDK='/Developer/SDKs/MacOSX10.6.sdk'
LCGDIR = '#../lib/darwin-9.x.universal'
CC = 'gcc-4.2'
CXX = 'g++-4.2'
LIBDIR = '${LCGDIR}'
@ -199,8 +207,8 @@ BF_GETTEXT_INC = '${BF_GETTEXT}/include'
BF_GETTEXT_LIB = 'intl'
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE=True
WITH_BF_PLAYER = False
WITH_BF_GAMEENGINE = True
WITH_BF_PLAYER = True
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
@ -251,7 +259,7 @@ BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
BF_OPENGL_LINKFLAGS = ['-framework', 'OpenGL']
#OpenCollada flags
WITH_BF_COLLADA = False
WITH_BF_COLLADA = True
BF_COLLADA = '#source/blender/collada'
BF_COLLADA_INC = '${BF_COLLADA}'
BF_COLLADA_LIB = 'bf_collada'
@ -277,7 +285,7 @@ elif MACOSX_ARCHITECTURE == 'x86_64':
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-msse2']
# SpaceNavigator and related 3D mice
WITH_BF_3DMOUSE = False
WITH_BF_3DMOUSE = True
#############################################################################
################### various compile settings and flags ##################
@ -296,31 +304,31 @@ CPPFLAGS = []+ARCH_FLAGS
CCFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS
CXXFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS
if WITH_GHOST_COCOA==True:
if WITH_GHOST_COCOA:
PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Cocoa','-framework','Carbon','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']+ARCH_FLAGS
else:
PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Carbon','-framework','AGL','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']+ARCH_FLAGS
if WITH_BF_QUICKTIME == True:
if USE_QTKIT == True:
if WITH_BF_QUICKTIME:
if USE_QTKIT:
PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','QTKit']
else:
PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','QuickTime']
if WITH_BF_3DMOUSE:
if FOUND_NDOF_DRIVERS:
PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS + ['-weak_framework','3DconnexionClient']
#note to build succesfully on 10.3.9 SDK you need to patch 10.3.9 by adding the SystemStubs.a lib from 10.4
LLIBS = ['stdc++', 'SystemStubs']
# some flags shuffling for different Os versions
# some flags shuffling for different OS versions
if MAC_MIN_VERS == '10.3':
CFLAGS = ['-fuse-cxa-atexit']+CFLAGS
CXXFLAGS = ['-fuse-cxa-atexit']+CXXFLAGS
PLATFORM_LINKFLAGS = ['-fuse-cxa-atexit']+PLATFORM_LINKFLAGS
LLIBS.append('crt3.o')
if USE_SDK==True:
if USE_SDK:
SDK_FLAGS=['-isysroot', MACOSX_SDK,'-mmacosx-version-min='+MAC_MIN_VERS,'-arch',MACOSX_ARCHITECTURE]
PLATFORM_LINKFLAGS = ['-mmacosx-version-min='+MAC_MIN_VERS,'-Wl','-isysroot',MACOSX_SDK,'-arch',MACOSX_ARCHITECTURE]+PLATFORM_LINKFLAGS
CCFLAGS=SDK_FLAGS+CCFLAGS

@ -136,7 +136,7 @@ def validate_arguments(args, bc):
'BF_NO_ELBEEM',
'WITH_BF_CXX_GUARDEDALLOC',
'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC',
'BUILDBOT_BRANCH', 'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC'
'BUILDBOT_BRANCH', 'WITH_BF_3DMOUSE', 'FOUND_NDOF_DRIVERS', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC'
]
# Have options here that scons expects to be lists
@ -149,7 +149,7 @@ def validate_arguments(args, bc):
'BF_PROFILE_CFLAGS', 'BF_PROFILE_CCFLAGS', 'BF_PROFILE_CXXFLAGS', 'BF_PROFILE_LINKFLAGS',
'BF_DEBUG_CFLAGS', 'BF_DEBUG_CCFLAGS', 'BF_DEBUG_CXXFLAGS',
'C_WARN', 'CC_WARN', 'CXX_WARN',
'LLIBS', 'PLATFORM_LINKFLAGS','MACOSX_ARCHITECTURE',
'LLIBS', 'PLATFORM_LINKFLAGS','MACOSX_ARCHITECTURE', 'MACOSX_SDK_CHECK', 'XCODE_CUR_VER',
]
@ -439,6 +439,7 @@ def read_opts(env, cfg, args):
(BoolVariable('WITH_BF_NOBLENDER', 'Do not build blender if true', False)),
(BoolVariable('WITH_BF_3DMOUSE', 'Build blender with support of 3D mouses', False)),
(BoolVariable('FOUND_NDOF_DRIVERS', 'We detected NDOF libs or framework', False)),
(BoolVariable('WITH_BF_STATIC3DMOUSE', 'Staticly link to 3d mouse library', False)),
('BF_3DMOUSE', '3d mouse library base path', ''),
('BF_3DMOUSE_INC', '3d mouse library include path', ''),
@ -462,6 +463,8 @@ def read_opts(env, cfg, args):
('LLIBS', 'Platform libs', []),
('PLATFORM_LINKFLAGS', 'Platform linkflags', []),
('MACOSX_ARCHITECTURE', 'python_arch.zip select', ''),
('MACOSX_SDK_CHECK', 'detect available OSX sdk`s', ''),
('XCODE_CUR_VER', 'detect XCode version', ''),
(BoolVariable('BF_PROFILE', 'Add profiling information if true', False)),
('BF_PROFILE_CFLAGS', 'C only profiling flags', []),

@ -31,7 +31,7 @@ PROJECT_NAME = Blender
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = "V2.58"
PROJECT_NUMBER = "V2.59"
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer

@ -217,6 +217,12 @@ General functions
Loads a scene into the game engine.
.. note::
This function is not effective immediately, the scene is queued
and added on the next logic cycle where it will be available
from `getSceneList`
:arg name: The name of the scene
:type name: string
:arg overlay: Overlay or underlay (optional)

@ -149,6 +149,10 @@ if(WITH_HEADLESS OR WITH_GHOST_SDL)
intern/GHOST_SystemPathsX11.cpp
intern/GHOST_SystemPathsX11.h
)
if(NOT WITH_INSTALL_PORTABLE)
add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
endif()
elseif(WIN32)
list(APPEND SRC
@ -204,10 +208,6 @@ elseif(APPLE)
elseif(UNIX)
if(WITH_X11_XINPUT)
add_definitions(-DWITH_X11_XINPUT)
endif()
list(APPEND INC_SYS
${X11_X11_INCLUDE_PATH}
)
@ -224,10 +224,6 @@ elseif(UNIX)
intern/GHOST_WindowX11.h
)
if(NOT WITH_INSTALL_PORTABLE)
add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
endif()
if(X11_XF86keysym_INCLUDE_PATH)
add_definitions(-DWITH_XF86KEYSYM)
list(APPEND INC_SYS
@ -243,6 +239,14 @@ elseif(UNIX)
)
endif()
if(NOT WITH_INSTALL_PORTABLE)
add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
endif()
if(WITH_X11_XINPUT)
add_definitions(-DWITH_X11_XINPUT)
endif()
elseif(WIN32)
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")

@ -375,7 +375,7 @@ void GHOST_NDOFManager::setDeadZone(float dz)
static bool atHomePosition(GHOST_TEventNDOFMotionData* ndof)
{
#define HOME(foo) (ndof->foo == 0)
#define HOME(foo) (ndof->foo == 0.f)
return HOME(tx) && HOME(ty) && HOME(tz) && HOME(rx) && HOME(ry) && HOME(rz);
#undef HOME
}
@ -386,9 +386,9 @@ static bool nearHomePosition(GHOST_TEventNDOFMotionData* ndof, float threshold)
return atHomePosition(ndof);
}
else {
#define HOME1(foo) (fabsf(ndof->foo) < threshold)
return HOME1(tx) && HOME1(ty) && HOME1(tz) && HOME1(rx) && HOME1(ry) && HOME1(rz);
#undef HOME1
#define HOME(foo) (fabsf(ndof->foo) < threshold)
return HOME(tx) && HOME(ty) && HOME(tz) && HOME(rx) && HOME(ry) && HOME(rz);
#undef HOME
}
}
@ -423,17 +423,17 @@ bool GHOST_NDOFManager::sendMotionEvent()
data->dt = 0.001f * (m_motionTime - m_prevMotionTime); // in seconds
bool handMotion = !nearHomePosition(data, m_deadZone);
bool weHaveMotion = !nearHomePosition(data, m_deadZone);
// determine what kind of motion event to send (Starting, InProgress, Finishing)
// and where that leaves this NDOF manager (NotStarted, InProgress, Finished)
switch (m_motionState) {
case GHOST_kNotStarted:
case GHOST_kFinished:
if (handMotion) {
if (weHaveMotion) {
data->progress = GHOST_kStarting;
m_motionState = GHOST_kInProgress;
// prev motion time will be ancient, so just make up something reasonable
// prev motion time will be ancient, so just make up a reasonable time delta
data->dt = 0.0125f;
}
else {
@ -443,9 +443,9 @@ bool GHOST_NDOFManager::sendMotionEvent()
}
break;
case GHOST_kInProgress:
if (handMotion) {
if (weHaveMotion) {
data->progress = GHOST_kInProgress;
// keep InProgress state
// remain 'InProgress'
}
else {
data->progress = GHOST_kFinishing;
@ -453,7 +453,7 @@ bool GHOST_NDOFManager::sendMotionEvent()
}
break;
default:
break;
; // will always be one of the above
}
#ifdef DEBUG_NDOF_MOTION

@ -22,10 +22,12 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef _GHOST_NDOFMANAGERCOCOA_H_
#define _GHOST_NDOFMANAGERCOCOA_H_
#ifdef WITH_INPUT_NDOF
#include "GHOST_NDOFManager.h"
// Event capture is handled within the NDOF manager on Macintosh,
@ -47,4 +49,5 @@ private:
};
#endif
#endif // WITH_INPUT_NDOF
#endif // #include guard

@ -22,7 +22,9 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifdef WITH_INPUT_NDOF
#include "GHOST_NDOFManagerCocoa.h"
#include "GHOST_SystemCocoa.h"
@ -170,3 +172,5 @@ bool GHOST_NDOFManagerCocoa::available()
return InstallConnexionHandlers != NULL;
// this means that the driver is installed and dynamically linked to blender
}
#endif // WITH_INPUT_NDOF

@ -22,7 +22,9 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifdef WITH_INPUT_NDOF
#include "GHOST_NDOFManagerX11.h"
#include "GHOST_SystemX11.h"
#include <spnav.h>
@ -34,14 +36,14 @@ GHOST_NDOFManagerX11::GHOST_NDOFManagerX11(GHOST_System& sys)
GHOST_NDOFManager(sys),
m_available(false)
{
setDeadZone(0.1f); // how to calibrate on Linux? throw away slight motion!
setDeadZone(0.1f); /* how to calibrate on Linux? throw away slight motion! */
if (spnav_open() != -1) {
// determine exactly which device (if any) is plugged in
/* determine exactly which device (if any) is plugged in */
#define MAX_LINE_LENGTH 100
// look for USB devices with Logitech's vendor ID
/* look for USB devices with Logitech's vendor ID */
FILE* command_output = popen("lsusb -d 046d:","r");
if (command_output) {
char line[MAX_LINE_LENGTH] = {0};
@ -50,15 +52,15 @@ GHOST_NDOFManagerX11::GHOST_NDOFManagerX11(GHOST_System& sys)
if (sscanf(line, "Bus %*d Device %*d: ID %hx:%hx", &vendor_id, &product_id) == 2)
if (setDevice(vendor_id, product_id)) {
m_available = true;
break; // stop looking once the first 3D mouse is found
break; /* stop looking once the first 3D mouse is found */
}
}
pclose(command_output);
}
}
else {
printf("ndof: spacenavd not found\n");
// This isn't a hard error, just means the user doesn't have a 3D mouse.
puts("ndof: spacenavd not found");
/* This isn't a hard error, just means the user doesn't have a 3D mouse. */
}
}
@ -73,11 +75,6 @@ bool GHOST_NDOFManagerX11::available()
return m_available;
}
//bool GHOST_NDOFManagerX11::identifyDevice()
//{
//
//}
bool GHOST_NDOFManagerX11::processEvents()
{
GHOST_TUns64 now = m_system.getMilliSeconds();
@ -88,7 +85,7 @@ bool GHOST_NDOFManagerX11::processEvents()
switch (e.type) {
case SPNAV_EVENT_MOTION:
{
// convert to blender view coords
/* convert to blender view coords */
short t[3] = {e.motion.x, e.motion.y, -e.motion.z};
short r[3] = {-e.motion.rx, -e.motion.ry, e.motion.rz};
@ -104,3 +101,5 @@ bool GHOST_NDOFManagerX11::processEvents()
}
return anyProcessed;
}
#endif /* WITH_INPUT_NDOF */

@ -26,6 +26,8 @@
#ifndef _GHOST_NDOFMANAGERX11_H_
#define _GHOST_NDOFMANAGERX11_H_
#ifdef WITH_INPUT_NDOF
#include "GHOST_NDOFManager.h"
/* Event capture is handled within the NDOF manager on Linux,
@ -40,10 +42,9 @@ public:
bool processEvents();
private:
// bool identifyDevice();
bool m_available;
};
#endif
#endif /* WITH_INPUT_NDOF */
#endif /* #include guard */

@ -21,8 +21,8 @@
*
* The Original Code is: all of this file.
*
* Contributor(s): Maarten Gribnau 05/2001
* Damien Plisson 09/2009
* Contributors: Maarten Gribnau 05/2001
* Damien Plisson 09/2009
*
* ***** END GPL LICENSE BLOCK *****
*/
@ -43,16 +43,17 @@
#include "GHOST_EventButton.h"
#include "GHOST_EventCursor.h"
#include "GHOST_EventWheel.h"
#include "GHOST_EventNDOF.h"
#include "GHOST_EventTrackpad.h"
#include "GHOST_EventDragnDrop.h"
#include "GHOST_EventString.h"
#include "GHOST_TimerManager.h"
#include "GHOST_TimerTask.h"
#include "GHOST_WindowManager.h"
#include "GHOST_WindowCocoa.h"
#ifdef WITH_INPUT_NDOF
#include "GHOST_NDOFManagerCocoa.h"
#endif
#include "AssertMacros.h"
#pragma mark KeyMap, mouse converters

@ -43,7 +43,11 @@
#include <stdio.h> // for fprintf only
#include <cstdlib> // for exit
using namespace std;
#ifdef PREFIX
static const char *static_path= PREFIX "/share" ;
#else
static const char *static_path= NULL;
#endif
GHOST_SystemPathsX11::GHOST_SystemPathsX11()
{
@ -56,21 +60,12 @@ GHOST_SystemPathsX11::~GHOST_SystemPathsX11()
const GHOST_TUns8* GHOST_SystemPathsX11::getSystemDir() const
{
/* no prefix assumes a portable build which only uses bundled scripts */
#ifdef PREFIX
return (GHOST_TUns8*) PREFIX "/share";
#else
return NULL;
#endif
return (const GHOST_TUns8 *)static_path;
}
const GHOST_TUns8* GHOST_SystemPathsX11::getUserDir() const
{
const char* env = getenv("HOME");
if(env) {
return (GHOST_TUns8*) env;
} else {
return NULL;
}
return (const GHOST_TUns8 *)getenv("HOME");
}
const GHOST_TUns8* GHOST_SystemPathsX11::getBinaryDir() const

@ -146,7 +146,7 @@ convertSDLKey(SDL_Scancode key)
if ((key >= SDL_SCANCODE_A) && (key <= SDL_SCANCODE_Z)) {
type= GHOST_TKey( key - SDL_SCANCODE_A + int(GHOST_kKeyA));
} else if ((key >= SDL_SCANCODE_1) && (key <= SDL_SCANCODE_0)) {
type= GHOST_TKey(key - SDL_SCANCODE_1 + int(GHOST_kKey0));
type= (key == SDL_SCANCODE_0) ? GHOST_kKey0 : GHOST_TKey(key - SDL_SCANCODE_1 + int(GHOST_kKey1));
} else if ((key >= SDL_SCANCODE_F1) && (key <= SDL_SCANCODE_F12)) {
type= GHOST_TKey(key - SDL_SCANCODE_F1 + int(GHOST_kKeyF1));
} else if ((key >= SDL_SCANCODE_F13) && (key <= SDL_SCANCODE_F24)) {
@ -167,6 +167,8 @@ convertSDLKey(SDL_Scancode key)
GXMAP(type,SDL_SCANCODE_APOSTROPHE, GHOST_kKeyQuote);
GXMAP(type,SDL_SCANCODE_GRAVE, GHOST_kKeyAccentGrave);
GXMAP(type,SDL_SCANCODE_MINUS, GHOST_kKeyMinus);
GXMAP(type,SDL_SCANCODE_EQUALS, GHOST_kKeyEqual);
GXMAP(type,SDL_SCANCODE_SLASH, GHOST_kKeySlash);
GXMAP(type,SDL_SCANCODE_BACKSLASH, GHOST_kKeyBackslash);
GXMAP(type,SDL_SCANCODE_KP_EQUALS, GHOST_kKeyEqual);
@ -198,6 +200,7 @@ convertSDLKey(SDL_Scancode key)
GXMAP(type,SDL_SCANCODE_CAPSLOCK, GHOST_kKeyCapsLock);
GXMAP(type,SDL_SCANCODE_SCROLLLOCK, GHOST_kKeyScrollLock);
GXMAP(type,SDL_SCANCODE_NUMLOCKCLEAR, GHOST_kKeyNumLock);
GXMAP(type,SDL_SCANCODE_PRINTSCREEN, GHOST_kKeyPrintScreen);
/* keypad events */

@ -42,8 +42,10 @@
#include "GHOST_EventKey.h"
#include "GHOST_EventButton.h"
#include "GHOST_EventWheel.h"
#include "GHOST_NDOFManagerX11.h"
#include "GHOST_DisplayManagerX11.h"
#ifdef WITH_INPUT_NDOF
#include "GHOST_NDOFManagerX11.h"
#endif
#include "GHOST_Debug.h"
@ -815,22 +817,6 @@ GHOST_SystemX11::processEvent(XEvent *xe)
}
}
#if 0 // obsolete SpaceNav code
void *
GHOST_SystemX11::
prepareNdofInfo(volatile GHOST_TEventNDOFData *currentNdofValues)
{
const vector<GHOST_IWindow*>& v(m_windowManager->getWindows());
if (v.size() > 0)
sNdofInfo.window = static_cast<GHOST_WindowX11*>(v[0])->getXWindow();
sNdofInfo.display = m_display;
sNdofInfo.currValues = currentNdofValues;
return (void*)&sNdofInfo;
}
#endif
GHOST_TSuccess
GHOST_SystemX11::
getModifierKeys(

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 KiB

After

Width:  |  Height:  |  Size: 200 KiB

@ -379,7 +379,7 @@ def path_reference(filepath,
is_relative = filepath.startswith("//")
filepath_abs = os.path.normpath(bpy.path.abspath(filepath, base_src))
if mode in ('ABSOLUTE', 'RELATIVE', 'STRIP'):
if mode in {'ABSOLUTE', 'RELATIVE', 'STRIP'}:
pass
elif mode == 'MATCH':
mode = 'RELATIVE' if is_relative else 'ABSOLUTE'

@ -294,7 +294,7 @@ def ngon_tesselate(from_data, indices, fix_loops=True):
'''
Normal single concave loop filling
'''
if type(from_data) in (tuple, list):
if type(from_data) in {tuple, list}:
verts = [Vector(from_data[i]) for ii, i in enumerate(indices)]
else:
verts = [from_data.vertices[i].co for ii, i in enumerate(indices)]
@ -312,7 +312,7 @@ def ngon_tesselate(from_data, indices, fix_loops=True):
used twice. This is used by lightwave LWO files a lot
'''
if type(from_data) in (tuple, list):
if type(from_data) in {tuple, list}:
verts = [vert_treplet(Vector(from_data[i]), ii)
for ii, i in enumerate(indices)]
else:

@ -120,7 +120,7 @@ def fromxml(data):
py_item = (xml_node.tagName, _fromxml_kwargs(xml_node), [])
#_fromxml_iter(py_item, xml_node.childNodes)
for xml_node_child in xml_node.childNodes:
if xml_node_child.nodeType not in (xml_node_child.TEXT_NODE, xml_node_child.COMMENT_NODE):
if xml_node_child.nodeType not in {xml_node_child.TEXT_NODE, xml_node_child.COMMENT_NODE}:
py_item[CHILDREN].append(_fromxml(xml_node_child))
return py_item

@ -40,13 +40,13 @@ def _parse_rna(prop, value):
elif prop.type == 'INT':
value = int(value)
elif prop.type == 'BOOLEAN':
if value in (True, False):
if value in {True, False}:
pass
else:
if value not in ("True", "False"):
if value not in {"True", "False"}:
raise Exception("invalid bool value: %s" % value)
value = bool(value == "True")
elif prop.type in ('STRING', 'ENUM'):
elif prop.type in {'STRING', 'ENUM'}:
pass
elif prop.type == 'POINTER':
value = eval("_bpy." + value)

@ -148,7 +148,7 @@ class InfoStructRNA:
import types
functions = []
for identifier, attr in self._get_py_visible_attrs():
if type(attr) in (types.FunctionType, types.MethodType):
if type(attr) in {types.FunctionType, types.MethodType}:
functions.append((identifier, attr))
return functions
@ -156,7 +156,7 @@ class InfoStructRNA:
import types
functions = []
for identifier, attr in self._get_py_visible_attrs():
if type(attr) in (types.BuiltinMethodType, types.BuiltinFunctionType):
if type(attr) in {types.BuiltinMethodType, types.BuiltinFunctionType}:
functions.append((identifier, attr))
return functions
@ -260,7 +260,7 @@ class InfoPropertyRNA:
if self.array_length:
type_str += " array of %d items" % (self.array_length)
if self.type in ("float", "int"):
if self.type in {"float", "int"}:
type_str += " in [%s, %s]" % (range_str(self.min), range_str(self.max))
elif self.type == "enum":
if self.is_enum_flag:
@ -595,7 +595,7 @@ def BuildRNAInfo():
for prop in rna_info.properties:
# ERROR CHECK
default = prop.default
if type(default) in (float, int):
if type(default) in {float, int}:
if default < prop.min or default > prop.max:
print("\t %s.%s, %s not in [%s - %s]" % (rna_info.identifier, prop.identifier, default, prop.min, prop.max))

@ -61,13 +61,19 @@ class EditExternally(bpy.types.Operator):
def execute(self, context):
import os
import subprocess
filepath = os.path.normpath(bpy.path.abspath(self.filepath))
filepath = self.filepath
if not filepath:
self.report({'ERROR'}, "Image path not set")
return {'CANCELLED'}
filepath = os.path.normpath(bpy.path.abspath(filepath))
if not os.path.exists(filepath):
self.report({'ERROR'},
"Image path %r not found, image may be packed or "
"unsaved." % filepath)
return {'CANCELLED'}
cmd = self._editor_guess(context) + [filepath]

@ -23,7 +23,15 @@ import mathutils
class prettyface(object):
__slots__ = "uv", "width", "height", "children", "xoff", "yoff", "has_parent", "rot"
__slots__ = ("uv",
"width",
"height",
"children",
"xoff",
"yoff",
"has_parent",
"rot",
)
def __init__(self, data):
self.has_parent = False
@ -263,10 +271,9 @@ def lightmap_uvpack(meshes,
del trylens
def trilensdiff(t1, t2):
return\
abs(t1[1][t1[2][0]] - t2[1][t2[2][0]]) + \
abs(t1[1][t1[2][1]] - t2[1][t2[2][1]]) + \
abs(t1[1][t1[2][2]] - t2[1][t2[2][2]])
return (abs(t1[1][t1[2][0]] - t2[1][t2[2][0]]) +
abs(t1[1][t1[2][1]] - t2[1][t2[2][1]]) +
abs(t1[1][t1[2][2]] - t2[1][t2[2][2]]))
while tri_lengths:
tri1 = tri_lengths.pop()
@ -520,7 +527,7 @@ def unwrap(operator, context, **kwargs):
if obj and obj.type == 'MESH':
meshes = [obj.data]
else:
meshes = {me.name: me for obj in context.selected_objects if obj.type == 'MESH' for me in (obj.data,) if not me.library if len(me.faces)}.values()
meshes = list({me for obj in context.selected_objects if obj.type == 'MESH' for me in (obj.data,) if me.faces and me.library is None})
if not meshes:
operator.report({'ERROR'}, "No mesh object.")
@ -543,22 +550,51 @@ class LightMapPack(bpy.types.Operator):
bl_options = {'REGISTER', 'UNDO'}
PREF_CONTEXT = bpy.props.EnumProperty(
name="Selection",
description="",
items=(("SEL_FACES", "Selected Faces", "Space all UVs evently"),
("ALL_FACES", "All Faces", "Average space UVs edge length of each loop"),
("ALL_OBJECTS", "Selected Mesh Object", "Average space UVs edge length of each loop")
),
name="Selection",
description="")
)
# Image & UVs...
PREF_PACK_IN_ONE = BoolProperty(name="Share Tex Space", default=True, description="Objects Share texture space, map all objects into 1 uvmap")
PREF_NEW_UVLAYER = BoolProperty(name="New UV Layer", default=False, description="Create a new UV layer for every mesh packed")
PREF_APPLY_IMAGE = BoolProperty(name="New Image", default=False, description="Assign new images for every mesh (only one if shared tex space enabled)")
PREF_IMG_PX_SIZE = IntProperty(name="Image Size", min=64, max=5000, default=512, description="Width and Height for the new image")
PREF_PACK_IN_ONE = BoolProperty(
name="Share Tex Space",
description=("Objects Share texture space, map all objects "
"into 1 uvmap"),
default=True,
)
PREF_NEW_UVLAYER = BoolProperty(
name="New UV Layer",
description="Create a new UV layer for every mesh packed",
default=False,
)
PREF_APPLY_IMAGE = BoolProperty(
name="New Image",
description=("Assign new images for every mesh (only one if "
"shared tex space enabled)"),
default=False,
)
PREF_IMG_PX_SIZE = IntProperty(
name="Image Size",
description="Width and Height for the new image",
min=64, max=5000,
default=512,
)
# UV Packing...
PREF_BOX_DIV = IntProperty(name="Pack Quality", min=1, max=48, default=12, description="Pre Packing before the complex boxpack")
PREF_MARGIN_DIV = FloatProperty(name="Margin", min=0.001, max=1.0, default=0.1, description="Size of the margin as a division of the UV")
PREF_BOX_DIV = IntProperty(
name="Pack Quality",
description="Pre Packing before the complex boxpack",
min=1, max=48,
default=12,
)
PREF_MARGIN_DIV = FloatProperty(
name="Margin",
description="Size of the margin as a division of the UV",
min=0.001, max=1.0,
default=0.1,
)
def execute(self, context):
kwargs = self.as_keywords()

@ -586,7 +586,7 @@ class WM_OT_context_modal_mouse(bpy.types.Operator):
self._values_clear()
return {'FINISHED'}
elif event_type in ('RIGHTMOUSE', 'ESC'):
elif event_type in {'RIGHTMOUSE', 'ESC'}:
self._values_restore()
return {'FINISHED'}
@ -839,7 +839,7 @@ class WM_OT_properties_edit(bpy.types.Operator):
prop_ui = rna_idprop_ui_prop_get(item, prop)
if prop_type in (float, int):
if prop_type in {float, int}:
prop_ui['soft_min'] = prop_ui['min'] = prop_type(self.min)
prop_ui['soft_max'] = prop_ui['max'] = prop_type(self.max)

@ -361,7 +361,7 @@ class DATA_PT_paragraph(CurveButtonsPanel, bpy.types.Panel):
col.prop(text, "offset_y", text="Y")
class DATA_PT_textboxes(CurveButtonsPanel, bpy.types.Panel):
class DATA_PT_text_boxes(CurveButtonsPanel, bpy.types.Panel):
bl_label = "Text Boxes"
@classmethod

@ -462,7 +462,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, bpy.types.Panel):
col.prop(part, "mass")
col.prop(part, "use_multiply_size_mass", text="Multiply mass with size")
if part.physics_type in ('NEWTON', 'FLUID'):
if part.physics_type in {'NEWTON', 'FLUID'}:
split = layout.split()
col = split.column()
@ -921,7 +921,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel):
col = row.column()
col.label(text="")
if part.render_type in ('OBJECT', 'GROUP') and not part.use_advanced_hair:
if part.render_type in {'OBJECT', 'GROUP'} and not part.use_advanced_hair:
row = layout.row(align=True)
row.prop(part, "particle_size")
row.prop(part, "size_random", slider=True)

@ -355,7 +355,7 @@ class INFO_MT_help(bpy.types.Menu):
layout = self.layout
layout.operator("wm.url_open", text="Manual", icon='HELP').url = 'http://wiki.blender.org/index.php/Doc:Manual'
layout.operator("wm.url_open", text="Release Log", icon='URL').url = 'http://www.blender.org/development/release-logs/blender-258/'
layout.operator("wm.url_open", text="Release Log", icon='URL').url = 'http://www.blender.org/development/release-logs/blender-259/'
layout.separator()

@ -1077,17 +1077,25 @@ class WM_OT_addon_enable(bpy.types.Operator):
bl_idname = "wm.addon_enable"
bl_label = "Enable Add-On"
module = StringProperty(name="Module", description="Module name of the addon to enable")
module = StringProperty(
name="Module",
description="Module name of the addon to enable",
)
def execute(self, context):
mod = addon_utils.enable(self.module)
if mod:
# check if add-on is written for current blender version, or raise a warning
info = addon_utils.module_bl_info(mod)
if info.get("blender", (0, 0, 0)) > bpy.app.version:
self.report("WARNING','This script was written for a newer version of Blender and might not function (correctly).\nThe script is enabled though.")
info_ver = info.get("blender", (0, 0, 0))
if info_ver > bpy.app.version:
self.report({'WARNING'}, ("This script was written Blender "
"version %d.%d.%d and might not "
"function (correctly).\n"
"The script is enabled though.") %
info_ver)
return {'FINISHED'}
else:
return {'CANCELLED'}

@ -542,22 +542,24 @@ class WM_OT_keyconfig_import(bpy.types.Operator):
def execute(self, context):
from os.path import basename
import shutil
if not self.filepath:
raise Exception("Filepath not set")
f = open(self.filepath, "r")
if not f:
raise Exception("Could not open file")
if not self.filepath:
self.report({'ERROR'}, "Filepath not set")
return {'CANCELLED'}
config_name = basename(self.filepath)
path = bpy.utils.user_resource('SCRIPTS', os.path.join("presets", "keyconfig"), create=True)
path = os.path.join(path, config_name)
if self.keep_original:
shutil.copy(self.filepath, path)
else:
shutil.move(self.filepath, path)
try:
if self.keep_original:
shutil.copy(self.filepath, path)
else:
shutil.move(self.filepath, path)
except Exception as e:
self.report({'ERROR'}, "Installing keymap failed: %s" % e)
return {'CANCELLED'}
# sneaky way to check we're actually running the code.
bpy.utils.keyconfig_set(path)

@ -18,7 +18,7 @@ class ModalOperator(bpy.types.Operator):
elif event.type == 'LEFTMOUSE':
return {'FINISHED'}
elif event.type in ('RIGHTMOUSE', 'ESC'):
elif event.type in {'RIGHTMOUSE', 'ESC'}:
context.object.location.x = self.first_value
return {'CANCELLED'}
@ -47,4 +47,4 @@ if __name__ == "__main__":
register()
# test call
bpy.ops.object.modal_operator()
bpy.ops.object.modal_operator('INVOKE_DEFAULT')

@ -45,7 +45,7 @@ class ModalDrawOperator(bpy.types.Operator):
context.region.callback_remove(self._handle)
return {'FINISHED'}
elif event.type in ('RIGHTMOUSE', 'ESC'):
elif event.type in {'RIGHTMOUSE', 'ESC'}:
context.region.callback_remove(self._handle)
return {'CANCELLED'}

@ -10,7 +10,7 @@ class ModalTimerOperator(bpy.types.Operator):
def modal(self, context, event):
if event.type == 'ESC':
return self.cancel()
return self.cancel(context)
if event.type == 'TIMER':
# change theme color, silly!

@ -29,7 +29,7 @@ class ViewOperator(bpy.types.Operator):
context.area.header_text_set()
return {'FINISHED'}
elif event.type in ('RIGHTMOUSE', 'ESC'):
elif event.type in {'RIGHTMOUSE', 'ESC'}:
rv3d.view_location = self._initial_location
context.area.header_text_set()
return {'CANCELLED'}

@ -12,22 +12,22 @@
</style>
</head>
<body>
<p class="title"><b>Blender 2.58</b></p>
<p class="title"><b>Blender 2.59</b></p>
<p><br></p>
<p class="header"><b>About</b></p>
<p class="body">Welcome to Blender, the free, open source 3D application for modeling, animation, rendering, compositing, video editing and game creation. Blender is available for Linux, Mac OS X, Windows, Solaris and FreeBSD and has a large world-wide community.</p>
<p class="body">Blender can be used freely for any purpose, including commercial use and distribution. It's free and open-source software, released under the GNU GPL licence. The entire source code is available on our website.</p>
<p class="body">For more information, visit <a href="http://www.blender.org">blender.org</a>.</p>
<p><br></p>
<p class="header"><b>2.58</b></p>
<p class="body">The Blender Foundation and online developer community is proud to present Blender 2.58. This release is the second official stable release of the Blender 2.5 series, and represents the culmination of many years of redesign and development work. <a href="http://www.blender.org/development/release-logs/blender-258/">More information about this release</a>.</p>
<p class="header"><b>2.59</b></p>
<p class="body">The Blender Foundation and online developer community is proud to present Blender 2.59. This release is the third official stable release of the Blender 2.5 series, and represents the culmination of many years of redesign and development work. <a href="http://www.blender.org/development/release-logs/blender-259/">More information about this release</a>.</p>
<p class="body">What to Expect:</p>
<p class="body"> • Big improvements - This is our most exciting version to date, already a significant improvement in many ways over 2.49</p>
<p class="body"> • Missing/Incomplete Features - Although most of it is there, not all functionality from pre-2.5 versions has been restored yet. Some functionality may be re-implemented a different way.</p>
<p class="body"> • Changes - If you're used to the old Blenders, Blender 2.5 may seem quite different at first, but it won't be long before it grows on you even more than before.</p>
<p><br></p>
<p class="header"><b>Bugs</b></p>
<p class="body">Although Blender 2.58 is considered a stable release, you may encounter a bug. If you do, please help us by posting it in the bug tracker or using Help → Report a Bug from inside Blender 2.58. If it wasnt reported yet, please log in (or register) and fill in detailed information about the error. Please post detailed instructions on how to reproduce it or post a .blend file showcasing the bug.</p>
<p class="body">Although Blender 2.59 is considered a stable release, you may encounter a bug. If you do, please help us by posting it in the bug tracker or using Help → Report a Bug from inside Blender 2.59. If it wasnt reported yet, please log in (or register) and fill in detailed information about the error. Please post detailed instructions on how to reproduce it or post a .blend file showcasing the bug.</p>
<p><br></p>
<p class="header"><b>Package Contents</b></p>
<p class="body">The downloaded Blender package includes:</p>
@ -51,11 +51,11 @@
<p class="header"><b>Links</b></p>
<p class="body">Users:</p>
<p class="body"> General information <a href="http://www.blender.org">www.blender.org</a> <br>
Full release log <a href="http://www.blender.org/development/release-logs/blender-258/">www.blender.org/development/release-logs/blender-258/</a><br>
Full release log <a href="http://www.blender.org/development/release-logs/blender-259/">www.blender.org/development/release-logs/blender-259/</a><br>
Tutorials <a href="http://www.blender.org/education-help/">www.blender.org/education-help/</a> <br>
Manual <a href="http://wiki.blender.org/index.php/Doc:Manual">wiki.blender.org/index.php/Doc:Manual</a><br>
User Forum <a href="http://www.blenderartists.org">www.blenderartists.org</a><br>
IRC <a href="irc://irc.freenode.net/#blender">#blender on irc.freenode.net</a><br>
IRC <a href="irc://irc.freenode.net/#blenderchat">#blenderchat on irc.freenode.net</a><br>
</p>
<p class="body">Developers:</p>
<p class="body"> Development <a href="http://www.blender.org/development/">www.blender.org/development/</a><br>

@ -43,17 +43,17 @@ extern "C" {
/* these lines are grep'd, watch out for our not-so-awesome regex
* and keep comment above the defines.
* Use STRINGIFY() rather than defining with quotes */
#define BLENDER_VERSION 258
#define BLENDER_SUBVERSION 1
#define BLENDER_VERSION 259
#define BLENDER_SUBVERSION 0
#define BLENDER_MINVERSION 250
#define BLENDER_MINSUBVERSION 0
/* used by packaging tools */
/* can be left blank, otherwise a,b,c... etc with no quotes */
#define BLENDER_VERSION_CHAR a
#define BLENDER_VERSION_CHAR
/* alpha/beta/rc/release, docs use this */
#define BLENDER_VERSION_CYCLE beta
#define BLENDER_VERSION_CYCLE release
struct ListBase;
struct MemFile;

@ -4389,6 +4389,7 @@ void psys_get_dupli_path_transform(ParticleSimulationData *sim, ParticleData *pa
copy_m3_m4(nmat, ob->imat);
transpose_m3(nmat);
mul_m3_v3(nmat, nor);
normalize_v3(nor);
/* make sure that we get a proper side vector */
if(fabs(dot_v3v3(nor,vec))>0.999999) {

@ -657,10 +657,12 @@ static int start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty, Report
switch(ffmpeg_type) {
case FFMPEG_AVI:
case FFMPEG_MOV:
case FFMPEG_OGG:
case FFMPEG_MKV:
fmt->video_codec = ffmpeg_codec;
break;
case FFMPEG_OGG:
fmt->video_codec = CODEC_ID_THEORA;
break;
case FFMPEG_DV:
fmt->video_codec = CODEC_ID_DVVIDEO;
break;
@ -1313,6 +1315,9 @@ void ffmpeg_verify_image_type(RenderData *rd)
/* Don't set preset, disturbs render resolution.
* ffmpeg_set_preset(rd, FFMPEG_PRESET_DVD); */
}
if(rd->ffcodecdata.type == FFMPEG_OGG) {
rd->ffcodecdata.type = FFMPEG_MPEG2;
}
audio= 1;
}

File diff suppressed because it is too large Load Diff

@ -1722,13 +1722,18 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event)
/* standard undo/redo shouldn't be allowed to execute or else it causes crashes, so catch it here */
// FIXME: this is a hardcoded hotkey that can't be changed
// TODO: catch redo as well, but how?
if (event->type == ZKEY) {
if (event->type == ZKEY && event->val == KM_RELEASE) {
/* oskey = cmd key on macs as they seem to use cmd-z for undo as well? */
if ((event->ctrl) || (event->oskey)) {
/* just delete last stroke, which will look like undo to the end user */
//printf("caught attempted undo event... deleting last stroke \n");
gpencil_frame_delete_laststroke(p->gpl, p->gpf);
/* undoing the last line can free p->gpf
* note, could do this in a bit more of an elegant way then a search but it at least prevents a crash */
if(BLI_findindex(&p->gpl->frames, p->gpf) == -1) {
p->gpf= NULL;
}
/* event handled, so force refresh */
ED_region_tag_redraw(p->ar); /* just active area for now, since doing whole screen is too slow */
estate = OPERATOR_RUNNING_MODAL;

@ -108,7 +108,7 @@ int ED_object_add_generic_get_opts(struct bContext *C, struct wmOperator *op, fl
struct Object *ED_object_add_type(struct bContext *C, int type, float *loc, float *rot, int enter_editmode, unsigned int layer);
void ED_object_single_users(struct Main *bmain, struct Scene *scene, int full);
void ED_object_single_user(struct Scene *scene, struct Object *ob);
/* object motion paths */
void ED_objects_clear_paths(struct bContext *C);

@ -2745,6 +2745,25 @@ void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op,in
uiItemL(layout, "* Redo Unsupported *", ICON_NONE); // XXX, could give some nicer feedback or not show redo panel at all?
}
/* menu */
if(op->type->flag & OPTYPE_PRESET) {
/* XXX, no simple way to get WM_MT_operator_presets.bl_label from python! Label remains the same always! */
PointerRNA op_ptr;
uiLayout *row;
row= uiLayoutRow(layout, TRUE);
uiItemM(row, (bContext *)C, "WM_MT_operator_presets", NULL, ICON_NONE);
WM_operator_properties_create(&op_ptr, "WM_OT_operator_preset_add");
RNA_string_set(&op_ptr, "operator", op->type->idname);
op_ptr= uiItemFullO(row, "WM_OT_operator_preset_add", "", ICON_ZOOMIN, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0);
WM_operator_properties_create(&op_ptr, "WM_OT_operator_preset_add");
RNA_string_set(&op_ptr, "operator", op->type->idname);
RNA_boolean_set(&op_ptr, "remove_active", 1);
op_ptr= uiItemFullO(row, "WM_OT_operator_preset_add", "", ICON_ZOOMOUT, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0);
}
if(op->type->ui) {
op->layout= layout;
op->type->ui((bContext*)C, op);
@ -2759,25 +2778,6 @@ void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op,in
RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr);
/* menu */
if(op->type->flag & OPTYPE_PRESET) {
/* XXX, no simple way to get WM_MT_operator_presets.bl_label from python! Label remains the same always! */
PointerRNA op_ptr;
uiLayout *row;
row= uiLayoutRow(layout, TRUE);
uiItemM(row, (bContext *)C, "WM_MT_operator_presets", NULL, ICON_NONE);
WM_operator_properties_create(&op_ptr, "WM_OT_operator_preset_add");
RNA_string_set(&op_ptr, "operator", op->type->idname);
op_ptr= uiItemFullO(row, "WM_OT_operator_preset_add", "", ICON_ZOOMIN, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0);
WM_operator_properties_create(&op_ptr, "WM_OT_operator_preset_add");
RNA_string_set(&op_ptr, "operator", op->type->idname);
RNA_boolean_set(&op_ptr, "remove_active", 1);
op_ptr= uiItemFullO(row, "WM_OT_operator_preset_add", "", ICON_ZOOMOUT, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0);
}
/* main draw call */
empty= uiDefAutoButsRNA(layout, &ptr, check_prop, label_align) == 0;

@ -54,6 +54,7 @@
#include "BKE_displist.h"
#include "ED_screen.h"
#include "ED_object.h"
#include "ED_render.h"
#include "RNA_access.h"
@ -276,8 +277,22 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
}
break;
case UI_ID_ALONE:
if(id)
id_single_user(C, id, &template->ptr, template->prop);
if(id) {
const int do_scene_obj= (GS(id->name) == ID_OB) &&
(template->ptr.type == &RNA_SceneObjects);
/* make copy */
if(do_scene_obj) {
Scene *scene= CTX_data_scene(C);
ED_object_single_user(scene, (struct Object *)id);
WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, scene);
}
else {
if(id) {
id_single_user(C, id, &template->ptr, template->prop);
}
}
}
break;
#if 0
case UI_ID_AUTO_NAME:
@ -395,10 +410,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
sprintf(str, "%d", id->us);
if(id->us<10)
but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Displays number of users of this data. Click to make a single-user copy.");
else
but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X+10,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Displays number of users of this data. Click to make a single-user copy.");
but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X + ((id->us < 10) ? 0:10), UI_UNIT_Y, NULL, 0, 0, 0, 0, "Displays number of users of this data. Click to make a single-user copy.");
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ALONE));
if(!id_copy(id, NULL, 1 /* test only */) || (idfrom && idfrom->lib) || !editable)
@ -2093,7 +2105,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
}
else if(itemptr->type == &RNA_ShapeKey) {
Object *ob= (Object*)activeptr->data;
Key *key= (Key*)itemptr->data;
Key *key= (Key*)itemptr->id.data;
split= uiLayoutSplit(sub, 0.75f, 0);

@ -1404,6 +1404,20 @@ static void single_object_users(Scene *scene, View3D *v3d, int flag)
set_sca_new_poins();
}
/* not an especially efficient function, only added so the single user
* button can be functional.*/
void ED_object_single_user(Scene *scene, Object *ob)
{
Base *base;
for(base= FIRSTBASE; base; base= base->next) {
if(base->object == ob) base->flag |= OB_DONE;
else base->flag &= ~OB_DONE;
}
single_object_users(scene, NULL, OB_DONE);
}
static void new_id_matar(Material **matar, int totcol)
{
ID *id;

@ -5781,7 +5781,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
/* if( ((int)ob->ctime) != F_(scene->r.cfra)) where_is_object(scene, ob); */
/* draw motion paths (in view space) */
if (ob->mpath) {
if (ob->mpath && (v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
bAnimVizSettings *avs= &ob->avs;
/* setup drawing environment for paths */

@ -41,7 +41,6 @@ set(SRC
transform_generics.c
transform_input.c
transform_manipulator.c
transform_ndofinput.c
transform_ops.c
transform_orientations.c
transform_snap.c

@ -1006,11 +1006,6 @@ int transformEvent(TransInfo *t, wmEvent *event)
else view_editmove(event->type);
t->redraw= 1;
break;
#if 0
case NDOF_MOTION:
// should have been caught by tranform_modal
return OPERATOR_PASS_THROUGH;
#endif
default:
handled = 0;
break;

@ -67,14 +67,6 @@ struct wmTimer;
struct ARegion;
struct ReportList;
typedef struct NDofInput {
int flag;
int axis;
float fval[7];
float factor[3];
} NDofInput;
/*
The ctrl value has different meaning:
0 : No value has been typed
@ -273,7 +265,6 @@ typedef struct TransInfo {
TransCon con; /* transformed constraint */
TransSnap tsnap;
NumInput num; /* numerical input */
NDofInput ndof; /* ndof input */
MouseInput mouse; /* mouse input */
char redraw; /* redraw flag */
float prop_size; /* proportional circle radius */
@ -340,9 +331,6 @@ typedef struct TransInfo {
/* ******************** Macros & Prototypes *********************** */
/* NDOFINPUT FLAGS */
#define NDOF_INIT 1
/* transinfo->state */
#define TRANS_STARTING 0
#define TRANS_RUNNING 1
@ -683,20 +671,6 @@ void calculatePropRatio(TransInfo *t);
void getViewVector(TransInfo *t, float coord[3], float vec[3]);
/*********************** NDofInput ********************************/
void initNDofInput(NDofInput *n);
int hasNDofInput(NDofInput *n);
void applyNDofInput(NDofInput *n, float *vec);
int handleNDofInput(NDofInput *n, struct wmEvent *event);
/* handleNDofInput return values */
#define NDOF_REFRESH 1
#define NDOF_NOMOVE 2
#define NDOF_CONFIRM 3
#define NDOF_CANCEL 4
/*********************** Transform Orientations ******************************/
void initTransformOrientation(struct bContext *C, TransInfo *t);

@ -1189,7 +1189,6 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
setTransformViewMatrices(t);
initNumInput(&t->num);
initNDofInput(&t->ndof);
return 1;
}

@ -1,162 +0,0 @@
/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is: all of this file.
*
* Contributor(s): Martin Poirier
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/editors/transform/transform_ndofinput.c
* \ingroup edtransform
*/
#include <math.h> /* fabs */
#include <stdio.h> /* for sprintf */
#include "BLI_utildefines.h"
#include "BKE_global.h" /* for G */
/* ABS */
#include "WM_types.h"
#include "transform.h"
#if 0
static int updateNDofMotion(NDofInput *n); // return 0 when motion is null
#endif
static void resetNDofInput(NDofInput *n);
void initNDofInput(NDofInput *n)
{
int i;
n->flag = 0;
n->axis = 0;
resetNDofInput(n);
for(i = 0; i < 3; i++)
{
n->factor[i] = 1.0f;
}
}
static void resetNDofInput(NDofInput *n)
{
int i;
for(i = 0; i < 6; i++)
{
n->fval[i] = 0.0f;
}
}
int handleNDofInput(NDofInput *UNUSED(n), wmEvent *UNUSED(event))
{
int retval = 0;
// TRANSFORM_FIX_ME
#if 0
switch(event)
{
case NDOFMOTION:
if (updateNDofMotion(n) == 0)
{
retval = NDOF_NOMOVE;
}
else
{
retval = NDOF_REFRESH;
}
break;
case NDOFBUTTON:
if (val == 1)
{
retval = NDOF_CONFIRM;
}
else if (val == 2)
{
retval = NDOF_CANCEL;
resetNDofInput(n);
n->flag &= ~NDOF_INIT;
}
break;
}
#endif
return retval;
}
int hasNDofInput(NDofInput *n)
{
return (n->flag & NDOF_INIT) == NDOF_INIT;
}
void applyNDofInput(NDofInput *n, float *vec)
{
if (hasNDofInput(n))
{
int i, j;
for (i = 0, j = 0; i < 6; i++)
{
if (n->axis & (1 << i))
{
vec[j] = n->fval[i] * n->factor[j];
j++;
}
}
}
}
// TRANSFORM_FIX_ME
#if 0
static int updateNDofMotion(NDofInput *n)
{
float fval[7];
int i;
int retval = 0;
getndof(fval);
if (G.vd->ndoffilter)
filterNDOFvalues(fval);
for(i = 0; i < 6; i++)
{
if (!retval && fval[i] != 0.0f)
{
retval = 1;
}
n->fval[i] += fval[i] / 1024.0f;
}
n->flag |= NDOF_INIT;
return retval;
}
#endif

@ -360,17 +360,14 @@ static int transform_modal(bContext *C, wmOperator *op, wmEvent *event)
TransInfo *t = op->customdata;
#if 0
#if 0
// stable 2D mouse coords map to different 3D coords while the 3D mouse is active
// in other words, 2D deltas are no longer good enough!
// disable until individual 'transformers' behave better
if (event->type == NDOF_MOTION)
{
/* puts("transform_modal: passing through NDOF_MOTION"); */
return OPERATOR_PASS_THROUGH;
}
#endif
#endif
/* XXX insert keys are called here, and require context */
t->context= C;

@ -392,6 +392,7 @@ extern StructRNA RNA_Scene;
extern StructRNA RNA_SceneGameData;
extern StructRNA RNA_SceneRenderLayer;
extern StructRNA RNA_SceneSequence;
extern StructRNA RNA_SceneObjects;
extern StructRNA RNA_Scopes;
extern StructRNA RNA_Screen;
extern StructRNA RNA_ScrewModifier;

@ -659,7 +659,7 @@ static char *rna_TextBox_path(PointerRNA *ptr)
int index= (int)(tb - cu->tb);
if (index >= 0 && index < cu->totbox)
return BLI_sprintfN("textboxes[%d]", index);
return BLI_sprintfN("text_boxes[%d]", index);
else
return BLI_strdup("");
}

@ -2789,7 +2789,7 @@ static void rna_def_userdef_input(BlenderRNA *brna)
prop= RNA_def_property(srna, "ndof_orbit_invert_axes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ORBIT_INVERT_AXES);
RNA_def_property_ui_text(prop, "Invert Axes", "Toggle between moving the viewpoint or moving the scene being viewed");
/* in 3Dx docs, this is called 'object mode' vs. 'target camera mode'
/* in 3Dx docs, this is called 'object mode' vs. 'target camera mode' */
/* 3D view: fly */
prop= RNA_def_property(srna, "ndof_lock_horizon", PROP_BOOLEAN, PROP_NONE);

@ -285,17 +285,20 @@ static char *copy_values(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, int
int totdim= RNA_property_array_dimension(ptr, prop, NULL);
const int seq_size= PySequence_Size(seq);
/* General note for 'data' being NULL or PySequence_GetItem() failing.
/* Regarding PySequence_GetItem() failing.
*
* This should never be NULL since we validated it, _but_ some triky python
* developer could write their own sequence type which succeeds on
* validating but fails later somehow, so include checks for safety. */
* validating but fails later somehow, so include checks for safety.
*/
/* Note that 'data can be NULL' */
if(seq_size == -1) {
return NULL;
}
for (i= 0; (i < seq_size) && data; i++) {
for (i= 0; i < seq_size; i++) {
PyObject *item= PySequence_GetItem(seq, i);
if(item) {
if (dim + 1 < totdim) {

@ -67,6 +67,7 @@ set(SRC
intern/wm_window.c
WM_api.h
WM_keymap.h
WM_types.h
wm.h
wm_cursors.h

@ -389,8 +389,14 @@ typedef struct wmNDOFMotionData {
/* awfully similar to GHOST_TEventNDOFMotionData... */
// Each component normally ranges from -1 to +1, but can exceed that.
// These use blender standard view coordinates, with positive rotations being CCW about the axis.
float tvec[3]; // translation
float rvec[3]; // rotation:
union {
float tvec[3]; // translation
struct { float tx, ty, tz; };
};
union {
float rvec[3]; // rotation:
struct { float rx, ry, rz; };
};
// axis = (rx,ry,rz).normalized
// amount = (rx,ry,rz).magnitude [in revolutions, 1.0 = 360 deg]
float dt; // time since previous NDOF Motion event

@ -2329,29 +2329,32 @@ static void attach_ndof_data(wmEvent* event, const GHOST_TEventNDOFMotionData* g
const float s = U.ndof_sensitivity;
data->tvec[0]= s * ghost->tx;
data->tx = s * ghost->tx;
data->rvec[0]= s * ghost->rx;
data->rvec[1]= s * ghost->ry;
data->rvec[2]= s * ghost->rz;
data->rx = s * ghost->rx;
data->ry = s * ghost->ry;
data->rz = s * ghost->rz;
if (U.ndof_flag & NDOF_ZOOM_UPDOWN)
{
// rotate so Y is where Z was (maintain handed-ness)
data->tvec[1]= s * ghost->tz;
data->tvec[2]= s * -ghost->ty;
/* rotate so Y is where Z was */
data->ty = s * ghost->tz;
data->tz = s * ghost->ty;
/* maintain handed-ness? or just do what feels right? */
// should this affect rotation also?
// initial guess is 'yes', but get user feedback immediately!
#if 0 // after turning this on, my guess becomes 'no'
data->rvec[1]= s * ghost->rz;
data->rvec[2]= s * ghost->ry;
/* should this affect rotation also?
* initial guess is 'yes', but get user feedback immediately!
*/
#if 0
/* after turning this on, my guess becomes 'no' */
data->ry = s * ghost->rz;
data->rz = s * ghost->ry;
#endif
}
else
{
data->tvec[1]= s * ghost->ty;
data->tvec[2]= s * ghost->tz;
data->ty = s * ghost->ty;
data->tz = s * ghost->tz;
}
data->dt = ghost->dt;

@ -1247,7 +1247,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
col = uiLayoutColumn(split, 0);
uiItemL(col, "Links", ICON_NONE);
uiItemStringO(col, "Donations", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/blenderorg/blender-foundation/donation-payment/");
uiItemStringO(col, "Release Log", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-258/");
uiItemStringO(col, "Release Log", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-259/");
uiItemStringO(col, "Manual", ICON_URL, "WM_OT_url_open", "url", "http://wiki.blender.org/index.php/Doc:2.5/Manual");
uiItemStringO(col, "Blender Website", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/");
uiItemStringO(col, "User Community", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/community/user-community/"); //

@ -111,7 +111,7 @@ add_test(export_obj_all_objects ${TEST_BLENDER_EXE}
--run={'FINISHED'}&bpy.ops.export_scene.obj\(filepath='${TEST_OUT_DIR}/export_obj_all_objects.obj',use_selection=False,use_nurbs=True\)
--md5_source=${TEST_OUT_DIR}/export_obj_all_objects.obj
--md5_source=${TEST_OUT_DIR}/export_obj_all_objects.mtl
--md5=01c123948efadc6a71ab2c09a5925756 --md5_method=FILE
--md5=04b3ed97cede07a19548fc518ce9f8ca --md5_method=FILE
)
@ -196,7 +196,7 @@ add_test(export_x3d_cube ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.x3d\(filepath='${TEST_OUT_DIR}/export_x3d_cube.x3d',use_selection=False\)
--md5_source=${TEST_OUT_DIR}/export_x3d_cube.x3d
--md5=5e804c689896116331fa190a9fabbad4 --md5_method=FILE
--md5=2621d8cc2cc1d34f6711c54519907dac --md5_method=FILE
)
add_test(export_x3d_nurbs ${TEST_BLENDER_EXE}
@ -204,7 +204,7 @@ add_test(export_x3d_nurbs ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.x3d\(filepath='${TEST_OUT_DIR}/export_x3d_nurbs.x3d',use_selection=False\)
--md5_source=${TEST_OUT_DIR}/export_x3d_nurbs.x3d
--md5=2d5bcf43cf7b6fbbef1c8cc566968fe5 --md5_method=FILE
--md5=d56b3736bab063d101d42079bd276f01 --md5_method=FILE
)
add_test(export_x3d_all_objects ${TEST_BLENDER_EXE}
@ -212,7 +212,7 @@ add_test(export_x3d_all_objects ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.x3d\(filepath='${TEST_OUT_DIR}/export_x3d_all_objects.x3d',use_selection=False\)
--md5_source=${TEST_OUT_DIR}/export_x3d_all_objects.x3d
--md5=2809ec13a4cab55d265ce7525c5db1b7 --md5_method=FILE
--md5=0914c9a7fcdbfc5741c1269497e9068b --md5_method=FILE
)
@ -273,7 +273,7 @@ add_test(export_fbx_cube ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.fbx\(filepath='${TEST_OUT_DIR}/export_fbx_cube.fbx',use_selection=False,use_metadata=False\)
--md5_source=${TEST_OUT_DIR}/export_fbx_cube.fbx
--md5=83dca99a0cb338852b8c85951a44c68a --md5_method=FILE
--md5=86da2495dffd7c270e682f599be6b3d1 --md5_method=FILE
)
add_test(export_fbx_nurbs ${TEST_BLENDER_EXE}
@ -281,7 +281,7 @@ add_test(export_fbx_nurbs ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.fbx\(filepath='${TEST_OUT_DIR}/export_fbx_nurbs.fbx',use_selection=False,use_metadata=False\)
--md5_source=${TEST_OUT_DIR}/export_fbx_nurbs.fbx
--md5=c7d9491ffa6264e820ed1e12df63f871 --md5_method=FILE
--md5=88a263ddb5181e6522dc214debb92ced --md5_method=FILE
)
add_test(export_fbx_all_objects ${TEST_BLENDER_EXE}
@ -289,5 +289,5 @@ add_test(export_fbx_all_objects ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.fbx\(filepath='${TEST_OUT_DIR}/export_fbx_all_objects.fbx',use_selection=False,use_metadata=False\)
--md5_source=${TEST_OUT_DIR}/export_fbx_all_objects.fbx
--md5=22867f82e1615fd1eae18cfaac8ba035 --md5_method=FILE
--md5=e6f75fe7de9aa366896456e13eafc76a --md5_method=FILE
)

@ -70,7 +70,7 @@ def run_ops(operators, setup_func=None):
setup_func()
for mode in ('EXEC_DEFAULT', 'INVOKE_DEFAULT'):
for mode in {'EXEC_DEFAULT', 'INVOKE_DEFAULT'}:
try:
op(mode)
except: