This commit is contained in:
Matt Ebb 2009-08-19 11:18:52 +00:00
commit 132277f098
498 changed files with 10819 additions and 6386 deletions

@ -42,17 +42,37 @@ MACRO(SETUP_LIBDIRS)
if(COMMAND cmake_policy)
CMAKE_POLICY(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
LINK_DIRECTORIES(${PYTHON_LIBPATH} ${SDL_LIBPATH} ${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${ICONV_LIBPATH} ${OPENEXR_LIBPATH} ${QUICKTIME_LIBPATH} ${FFMPEG_LIBPATH})
LINK_DIRECTORIES(${FREETYPE_LIBPATH} ${LIBSAMPLERATE_LIBPATH})
LINK_DIRECTORIES(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH} ${LIBSAMPLERATE_LIBPATH})
IF(WITH_PYTHON)
LINK_DIRECTORIES(${PYTHON_LIBPATH})
ENDIF(WITH_PYTHON)
IF(WITH_INTERNATIONAL)
LINK_DIRECTORIES(${ICONV_LIBPATH})
LINK_DIRECTORIES(${GETTEXT_LIBPATH})
ENDIF(WITH_INTERNATIONAL)
IF(WITH_SDL)
LINK_DIRECTORIES(${SDL_LIBPATH})
ENDIF(WITH_SDL)
IF(WITH_FFMPEG)
LINK_DIRECTORIES(${FFMPEG_LIBPATH})
ENDIF(WITH_FFMPEG)
IF(WITH_OPENEXR)
LINK_DIRECTORIES(${OPENEXR_LIBPATH})
ENDIF(WITH_OPENEXR)
IF(WITH_QUICKTIME)
LINK_DIRECTORIES(${QUICKTIME_LIBPATH})
ENDIF(WITH_QUICKTIME)
IF(WITH_OPENAL)
LINK_DIRECTORIES(${OPENAL_LIBPATH})
ENDIF(WITH_OPENAL)
IF(WITH_JACK)
LINK_DIRECTORIES(${JACK_LIBPATH})
ENDIF(WITH_JACK)
IF(WITH_FFTW3)
LINK_DIRECTORIES(${FFTW3_LIBPATH})
ENDIF(WITH_FFTW3)
ENDIF(WITH_FFTW3)
IF(WIN32)
LINK_DIRECTORIES(${PTHREADS_LIBPATH})
@ -62,48 +82,45 @@ ENDMACRO(SETUP_LIBDIRS)
MACRO(SETUP_LIBLINKS
target)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS} ")
#TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LIB} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIB} ${LLIBS})
#TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LIB} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIBRARY} ${LLIBS})
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${FFTW3_LIB} ${JPEG_LIBRARY} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${SDL_LIB} ${LLIBS})
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIBRARY} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${LLIBS})
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
IF(WIN32)
TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
ELSE(WIN32)
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
ENDIF(WIN32)
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIB} ${LLIBS})
TARGET_LINK_LIBRARIES(${target} ${FREETYPE_LIB} ${LIBSAMPLERATE_LIB})
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${LLIBS})
TARGET_LINK_LIBRARIES(${target} ${FREETYPE_LIBRARY} ${LIBSAMPLERATE_LIB})
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
IF(WIN32)
TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
ELSE(WIN32)
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
ELSE(WIN32)
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
ENDIF(WIN32)
IF(WITH_INTERNATIONAL)
TARGET_LINK_LIBRARIES(${target} ${GETTEXT_LIB})
ENDIF(WITH_INTERNATIONAL)
IF(WITH_OPENAL)
TARGET_LINK_LIBRARIES(${target} ${OPENAL_LIB})
TARGET_LINK_LIBRARIES(${target} ${OPENAL_LIBRARY})
ENDIF(WITH_OPENAL)
IF(WITH_FFTW3)
TARGET_LINK_LIBRARIES(${target} ${FFTW3_LIB})
ENDIF(WITH_FFTW3)
IF(WITH_JACK)
TARGET_LINK_LIBRARIES(${target} ${JACK_LIB})
ENDIF(WITH_JACK)
IF(WITH_SDL)
TARGET_LINK_LIBRARIES(${target} ${SDL_LIBRARY})
ENDIF(WITH_SDL)
IF(WIN32)
TARGET_LINK_LIBRARIES(${target} ${ICONV_LIB})
ENDIF(WIN32)
@ -120,3 +137,4 @@ MACRO(SETUP_LIBLINKS
TARGET_LINK_LIBRARIES(${target} ${PTHREADS_LIB})
ENDIF(WIN32)
ENDMACRO(SETUP_LIBLINKS)

@ -60,7 +60,6 @@ B = tools.Blender
platform = sys.platform
quickie = None
quickdebug = None
nsis_build = None
##### BEGIN SETUP #####
@ -425,8 +424,6 @@ if env['OURPLATFORM']=='darwin':
bundle = '%s.app' % prg[0]
bundledir = os.path.dirname(bundle)
for dp, dn, df in os.walk(bundle):
if 'CVS' in dn:
dn.remove('CVS')
if '.svn' in dn:
dn.remove('.svn')
dir=env['BF_INSTALLDIR']+dp[len(bundledir):]
@ -443,8 +440,6 @@ scriptinstall = []
if env['OURPLATFORM']!='darwin':
for dp, dn, df in os.walk('bin/.blender'):
if 'CVS' in dn:
dn.remove('CVS')
if '.svn' in dn:
dn.remove('.svn')
@ -471,8 +466,6 @@ if env['OURPLATFORM']!='darwin':
scriptpaths=['release/scripts', 'release/ui', 'release/io']
for scriptpath in scriptpaths:
for dp, dn, df in os.walk(scriptpath):
if 'CVS' in dn:
dn.remove('CVS')
if '.svn' in dn:
dn.remove('.svn')
dir=env['BF_INSTALLDIR']+'/.blender/'+os.path.basename(scriptpath)+dp[len(scriptpath):]
@ -485,8 +478,6 @@ if env['OURPLATFORM']=='linux2':
icontargetlist = []
for tp, tn, tf in os.walk('release/freedesktop/icons'):
if 'CVS' in tn:
tn.remove('CVS')
if '.svn' in tn:
tn.remove('.svn')
for f in tf:
@ -509,8 +500,6 @@ if env['OURPLATFORM']=='linuxcross':
pluglist = []
plugtargetlist = []
for tp, tn, tf in os.walk('release/plugins'):
if 'CVS' in tn:
tn.remove('CVS')
if '.svn' in tn:
tn.remove('.svn')
for f in tf:
@ -541,8 +530,6 @@ for targetdir,srcfile in zip(plugtargetlist, pluglist):
textlist = []
texttargetlist = []
for tp, tn, tf in os.walk('release/text'):
if 'CVS' in tn:
tn.remove('CVS')
if '.svn' in tn:
tn.remove('.svn')
for f in tf:
@ -599,6 +586,8 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc'):
'${LCGDIR}/ffmpeg/lib/libx264-67.dll',
'${LCGDIR}/ffmpeg/lib/xvidcore.dll',
'${LCGDIR}/ffmpeg/lib/swscale-0.dll']
if env['WITH_BF_JACK']:
dllsources += ['${LCGDIR}/jack/lib/libjack.dll']
windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
allinstall += windlls

@ -66,17 +66,12 @@ IF(UNIX)
gp_common
bf_string
bf_ghost
bf_blenkernel
verse
bf_blenkernel
bf_blenkernel
bf_blenloader
bf_blenpluginapi
bf_blroutines
bf_converter
bf_sumo
bf_ketsji
extern_solid
extern_qhull
bf_bullet
bf_common
bf_dummy
@ -105,10 +100,17 @@ IF(UNIX)
bf_dds
bf_readblenfile
blenkernel_blc
bf_quicktime
extern_binreloc
extern_glew
)
)
IF(WITH_QUICKTIME)
SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} quicktime)
ENDIF(WITH_QUICKTIME)
IF(WITH_CXX_GUARDEDALLOC)
SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_guardedalloc_cpp)
ENDIF(WITH_CXX_GUARDEDALLOC)
FOREACH(SORTLIB ${BLENDER_SORTED_LIBS})
SET(REMLIB ${SORTLIB})

@ -112,6 +112,13 @@ BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
BF_LIBSAMPLERATE_LIB = 'samplerate'
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
# TODO - set proper paths here (add precompiled to lib/ ? )
WITH_BF_JACK = False
BF_JACK = '/usr'
BF_JACK_INC = '${BF_JACK}/include/jack'
BF_JACK_LIB = 'jack'
BF_JACK_LIBPATH = '${BF_JACK}/lib'
WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl' #$(shell sdl-config --prefix)
BF_SDL_INC = '${BF_SDL}/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags)

@ -27,6 +27,12 @@ BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
BF_LIBSAMPLERATE_LIB = 'samplerate'
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
WITH_BF_JACK = False
BF_JACK = '/usr'
BF_JACK_INC = '${BF_JACK}/include/jack'
BF_JACK_LIB = 'jack'
BF_JACK_LIBPATH = '${BF_JACK}/lib'
WITH_BF_SDL = True
BF_SDL = '/usr' #$(shell sdl-config --prefix)
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)

@ -31,6 +31,12 @@ BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
BF_LIBSAMPLERATE_LIB = 'libsamplerate'
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
WITH_BF_JACK = False
BF_JACK = LIBDIR + '/jack'
BF_JACK_INC = '${BF_JACK}/include'
BF_JACK_LIB = 'libjack'
BF_JACK_LIBPATH = '${BF_JACK}/lib'
WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl'
BF_SDL_INC = '${BF_SDL}/include'

@ -37,6 +37,12 @@ BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
BF_LIBSAMPLERATE_LIB = 'libsamplerate'
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
WITH_BF_JACK = False
BF_JACK = LIBDIR + '/jack'
BF_JACK_INC = '${BF_JACK}/include'
BF_JACK_LIB = 'libjack'
BF_JACK_LIBPATH = '${BF_JACK}/lib'
WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl'
BF_SDL_INC = '${BF_SDL}/include'

@ -26,8 +26,13 @@
SET(INC include src)
IF(UNIX)
SET(INC ${INC} ${X11_X11_INCLUDE_PATH})
ENDIF(UNIX)
SET(SRC
src/glew.c
)
BLENDERLIB(extern_glew "${SRC}" "${INC}")

@ -24,7 +24,7 @@
#
# ***** END GPL LICENSE BLOCK *****
SET(INC . src ${FREETYPE_INC})
SET(INC . src)
FILE(GLOB SRC *.c except t1_generate_luts.c)
ADD_DEFINITIONS(-DWITH_OPENJPEG)

@ -31,22 +31,28 @@ IF(WITH_FFMPEG)
ENDIF(WITH_FFMPEG)
IF(WITH_SDL)
SET(INC ${INC} SDL ${SDL_INC})
SET(INC ${INC} SDL ${SDL_INCLUDE_DIR})
FILE(GLOB SDLSRC SDL/*.cpp)
ADD_DEFINITIONS(-DWITH_SDL)
ENDIF(WITH_SDL)
IF(WITH_OPENAL)
SET(INC ${INC} OpenAL ${OPENAL_INC})
SET(INC ${INC} OpenAL ${OPENAL_INCLUDE_DIR})
FILE(GLOB OPENALSRC OpenAL/*.cpp)
ADD_DEFINITIONS(-DWITH_OPENAL)
STRING(REGEX MATCH ".*ramework.*" FRAMEWORK ${OPENAL_INC})
STRING(REGEX MATCH ".*ramework.*" FRAMEWORK ${OPENAL_INCLUDE_DIR})
IF(FRAMEWORK)
ADD_DEFINITIONS(-DAPPLE_FRAMEWORK_FIX)
ENDIF(FRAMEWORK)
ENDIF(WITH_OPENAL)
SET(SRC ${SRC} ${FFMPEGSRC} ${SDLSRC} ${OPENALSRC})
IF(WITH_JACK)
SET(INC ${INC} jack ${JACK_INC})
FILE(GLOB JACKSRC jack/*.cpp)
ADD_DEFINITIONS(-DWITH_JACK)
ENDIF(WITH_JACK)
SET(SRC ${SRC} ${FFMPEGSRC} ${SDLSRC} ${OPENALSRC} ${JACKSRC})
BLENDERLIB(bf_audaspace "${SRC}" "${INC}")

@ -51,8 +51,11 @@ install: $(ALL_OR_DEBUG)
@[ -d $(NAN_AUDASPACE)/include ] || mkdir $(NAN_AUDASPACE)/include
@[ -d $(NAN_AUDASPACE)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)
@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libaudaspace.a $(DIR)/$(DEBUG_DIR)libaud_fx.a $(DIR)/$(DEBUG_DIR)libaud_src.a $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)
ifeq ($(OS),darwin)
ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaudaspace.a
ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_src.a
ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_fx.a
endif
@../tools/cpifdiff.sh intern/*.h $(NAN_AUDASPACE)/include/

@ -21,4 +21,9 @@ if env['WITH_BF_OPENAL']:
incs += ' OpenAL ' + env['BF_OPENAL_INC']
defs.append('WITH_OPENAL')
if env['WITH_BF_JACK']:
sources += env.Glob('jack/*.cpp')
incs += ' jack ' + env['BF_JACK_INC']
defs.append('WITH_JACK')
env.BlenderLib ('bf_audaspace', sources, Split(incs), defs, libtype=['intern'], priority = [25] )

@ -27,13 +27,11 @@
#include "AUD_SDLDevice.h"
#include "AUD_IReader.h"
#include <SDL.h>
// this is the callback function for SDL, it only calls the class
void mixAudio(void *data, Uint8* buffer, int length)
void AUD_SDLDevice::SDL_mix(void *data, Uint8* buffer, int length)
{
AUD_SDLDevice* device = (AUD_SDLDevice*)data;
device->SDLmix((sample_t *)buffer, length);
device->mix((sample_t*)buffer, length/AUD_SAMPLE_SIZE(device->m_specs));
}
AUD_SDLDevice::AUD_SDLDevice(AUD_Specs specs, int buffersize)
@ -56,7 +54,7 @@ AUD_SDLDevice::AUD_SDLDevice(AUD_Specs specs, int buffersize)
format.format = AUDIO_S16SYS;
format.channels = m_specs.channels;
format.samples = buffersize;
format.callback = &mixAudio;
format.callback = AUD_SDLDevice::SDL_mix;
format.userdata = this;
if(SDL_OpenAudio(&format, &obtained) != 0)
@ -86,11 +84,6 @@ AUD_SDLDevice::~AUD_SDLDevice()
destroy();
}
void AUD_SDLDevice::SDLmix(sample_t* buffer, int length)
{
mix(buffer, length/AUD_SAMPLE_SIZE(m_specs));
}
void AUD_SDLDevice::playing(bool playing)
{
SDL_PauseAudio(playing ? 0 : 1);

@ -28,11 +28,22 @@
#include "AUD_SoftwareDevice.h"
#include <SDL.h>
/**
* This device plays back through SDL, the simple direct media layer.
*/
class AUD_SDLDevice : public AUD_SoftwareDevice
{
private:
/**
* Mixes the next bytes into the buffer.
* \param data The SDL device.
* \param buffer The target buffer.
* \param length The length in bytes to be filled.
*/
static void SDL_mix(void *data, Uint8* buffer, int length);
protected:
virtual void playing(bool playing);
@ -50,14 +61,6 @@ public:
* Closes the SDL audio device.
*/
virtual ~AUD_SDLDevice();
/**
* Mixes the next bytes into the buffer.
* \param buffer The target buffer.
* \param length The length in bytes to be filled.
* \warning This function shall not be called from outside!
*/
void SDLmix(sample_t* buffer, int length);
};
#endif //AUD_SDLDEVICE

@ -28,7 +28,7 @@
#
#
LIBNAME = SDLaudaspace
LIBNAME = aud_sdl
DIR = $(OCGDIR)/intern/$(LIBNAME)
include nan_compile.mk

@ -34,7 +34,7 @@ extern "C" {
#include <libavformat/avformat.h>
}
// This function transforms a FFMPEG SampleFormat to or own sample format
// This function transforms a FFMPEG SampleFormat to our own sample format
static inline AUD_SampleFormat FFMPEG_TO_AUD(SampleFormat fmt)
{
switch(fmt)

@ -28,7 +28,7 @@
#
#
LIBNAME = ffmpegaudaspace
LIBNAME = aud_ffmpeg
DIR = $(OCGDIR)/intern/$(LIBNAME)
include nan_compile.mk

@ -23,10 +23,6 @@
* ***** END LGPL LICENSE BLOCK *****
*/
/*#define WITH_SDL
#define WITH_FFMPEG
#define WITH_OPENAL*/
#include "AUD_NULLDevice.h"
#include "AUD_I3DDevice.h"
#include "AUD_StreamBufferFactory.h"
@ -47,6 +43,10 @@
#include "AUD_OpenALDevice.h"
#endif
#ifdef WITH_JACK
#include "AUD_JackDevice.h"
#endif
#ifdef WITH_FFMPEG
#include "AUD_FFMPEGFactory.h"
extern "C" {
@ -97,6 +97,11 @@ int AUD_init(AUD_DeviceType device, AUD_Specs specs, int buffersize)
case AUD_OPENAL_DEVICE:
dev = new AUD_OpenALDevice(specs, buffersize);
break;
#endif
#ifdef WITH_JACK
case AUD_JACK_DEVICE:
dev = new AUD_JackDevice(specs);
break;
#endif
default:
return false;
@ -125,6 +130,9 @@ int* AUD_enumDevices()
#endif
#ifdef WITH_OPENAL
AUD_available_devices[i++] = AUD_OPENAL_DEVICE;
#endif
#ifdef WITH_JACK
AUD_available_devices[i++] = AUD_JACK_DEVICE;
#endif
AUD_available_devices[i++] = AUD_NULL_DEVICE;
return AUD_available_devices;

@ -36,7 +36,8 @@ typedef enum
{
AUD_NULL_DEVICE = 0,
AUD_SDL_DEVICE,
AUD_OPENAL_DEVICE
AUD_OPENAL_DEVICE,
AUD_JACK_DEVICE
} AUD_DeviceType;
typedef struct

@ -60,6 +60,8 @@ AUD_ConverterReader::AUD_ConverterReader(AUD_IReader* reader, AUD_Specs specs) :
case AUD_FORMAT_FLOAT64:
m_convert = AUD_convert_u8_double;
break;
default:
break;
}
break;
case AUD_FORMAT_S16:
@ -86,6 +88,8 @@ AUD_ConverterReader::AUD_ConverterReader(AUD_IReader* reader, AUD_Specs specs) :
case AUD_FORMAT_FLOAT64:
m_convert = AUD_convert_s16_double;
break;
default:
break;
}
break;
case AUD_FORMAT_S24:
@ -110,6 +114,8 @@ AUD_ConverterReader::AUD_ConverterReader(AUD_IReader* reader, AUD_Specs specs) :
case AUD_FORMAT_FLOAT64:
m_convert = AUD_convert_double_s24_be;
break;
default:
break;
}
else
switch(specs.format)
@ -132,6 +138,8 @@ AUD_ConverterReader::AUD_ConverterReader(AUD_IReader* reader, AUD_Specs specs) :
case AUD_FORMAT_FLOAT64:
m_convert = AUD_convert_double_s24_le;
break;
default:
break;
}
break;
case AUD_FORMAT_S32:
@ -158,6 +166,8 @@ AUD_ConverterReader::AUD_ConverterReader(AUD_IReader* reader, AUD_Specs specs) :
case AUD_FORMAT_FLOAT64:
m_convert = AUD_convert_s32_double;
break;
default:
break;
}
break;
case AUD_FORMAT_FLOAT32:
@ -184,6 +194,8 @@ AUD_ConverterReader::AUD_ConverterReader(AUD_IReader* reader, AUD_Specs specs) :
case AUD_FORMAT_FLOAT64:
m_convert = AUD_convert_float_double;
break;
default:
break;
}
break;
case AUD_FORMAT_FLOAT64:
@ -210,8 +222,12 @@ AUD_ConverterReader::AUD_ConverterReader(AUD_IReader* reader, AUD_Specs specs) :
case AUD_FORMAT_FLOAT64:
m_convert = AUD_convert_copy<double>;
break;
default:
break;
}
break;
default:
break;
}
m_specs.format = specs.format;

@ -125,6 +125,8 @@ void AUD_FloatMixer::setSpecs(AUD_Specs specs)
case AUD_FORMAT_FLOAT64:
m_convert = AUD_convert_float_double;
break;
default:
break;
}
}

@ -180,7 +180,8 @@ typedef enum
AUD_ERROR_FILE,
AUD_ERROR_FFMPEG,
AUD_ERROR_SDL,
AUD_ERROR_OPENAL
AUD_ERROR_OPENAL,
AUD_ERROR_JACK
} AUD_Error;
/// Message codes.

@ -0,0 +1,149 @@
/*
* $Id$
*
* ***** BEGIN LGPL LICENSE BLOCK *****
*
* Copyright 2009 Jörg Hermann Müller
*
* This file is part of AudaSpace.
*
* AudaSpace is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AudaSpace 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
*
* ***** END LGPL LICENSE BLOCK *****
*/
#include "AUD_FloatMixer.h"
#include "AUD_JackDevice.h"
#include "AUD_IReader.h"
#include "AUD_Buffer.h"
#include <stdio.h>
#include <stdlib.h>
// AUD_XXX this is not realtime suitable!
int AUD_JackDevice::jack_mix(jack_nframes_t length, void *data)
{
AUD_JackDevice* device = (AUD_JackDevice*)data;
int samplesize = AUD_SAMPLE_SIZE(device->m_specs);
if(device->m_buffer->getSize() < samplesize * length)
device->m_buffer->resize(samplesize * length);
device->mix(device->m_buffer->getBuffer(), length);
float* in = (float*) device->m_buffer->getBuffer();
float* out;
int count = device->m_specs.channels;
for(int i = 0; i < count; i++)
{
out = (float*)jack_port_get_buffer(device->m_ports[i], length);
for(int j = 0; j < length; j++)
out[j] = in[j * count + i];
}
return 0;
}
void AUD_JackDevice::jack_shutdown(void *data)
{
AUD_JackDevice* device = (AUD_JackDevice*)data;
device->m_valid = false;
}
AUD_JackDevice::AUD_JackDevice(AUD_Specs specs)
{
if(specs.channels == AUD_CHANNELS_INVALID)
specs.channels = AUD_CHANNELS_STEREO;
// jack uses floats
m_specs = specs;
m_specs.format = AUD_FORMAT_FLOAT32;
jack_options_t options = JackNullOption;
jack_status_t status;
// open client
m_client = jack_client_open("Blender", options, &status);
if(m_client == NULL)
AUD_THROW(AUD_ERROR_JACK);
m_buffer = new AUD_Buffer(); AUD_NEW("buffer");
// set callbacks
jack_set_process_callback(m_client, AUD_JackDevice::jack_mix, this);
jack_on_shutdown(m_client, AUD_JackDevice::jack_shutdown, this);
// register our output channels which are called ports in jack
m_ports = new jack_port_t*[m_specs.channels]; AUD_NEW("jack_port")
try
{
char portname[64];
for(int i = 0; i < m_specs.channels; i++)
{
sprintf(portname, "out %d", i+1);
m_ports[i] = jack_port_register(m_client, portname,
JACK_DEFAULT_AUDIO_TYPE,
JackPortIsOutput, 0);
if(m_ports[i] == NULL)
AUD_THROW(AUD_ERROR_JACK);
}
m_specs.rate = (AUD_SampleRate)jack_get_sample_rate(m_client);
// activate the client
if(jack_activate(m_client))
AUD_THROW(AUD_ERROR_JACK);
}
catch(AUD_Exception e)
{
jack_client_close(m_client);
delete[] m_ports; AUD_DELETE("jack_port")
delete m_buffer; AUD_DELETE("buffer");
throw;
}
const char** ports = jack_get_ports(m_client, NULL, NULL,
JackPortIsPhysical | JackPortIsInput);
if(ports != NULL)
{
for(int i = 0; i < m_specs.channels && ports[i]; i++)
jack_connect(m_client, jack_port_name(m_ports[i]), ports[i]);
free(ports);
}
m_mixer = new AUD_FloatMixer(); AUD_NEW("mixer")
m_mixer->setSpecs(m_specs);
m_valid = true;
create();
}
AUD_JackDevice::~AUD_JackDevice()
{
lock();
if(m_valid)
jack_client_close(m_client);
delete[] m_ports; AUD_DELETE("jack_port")
delete m_buffer; AUD_DELETE("buffer");
unlock();
destroy();
}
void AUD_JackDevice::playing(bool playing)
{
// Do nothing.
}

@ -0,0 +1,91 @@
/*
* $Id$
*
* ***** BEGIN LGPL LICENSE BLOCK *****
*
* Copyright 2009 Jörg Hermann Müller
*
* This file is part of AudaSpace.
*
* AudaSpace is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AudaSpace 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
*
* ***** END LGPL LICENSE BLOCK *****
*/
#ifndef AUD_JACKDEVICE
#define AUD_JACKDEVICE
#include "AUD_SoftwareDevice.h"
class AUD_Buffer;
#include <jack.h>
/**
* This device plays back through Jack.
*/
class AUD_JackDevice : public AUD_SoftwareDevice
{
private:
/**
* The output ports of jack.
*/
jack_port_t** m_ports;
/**
* The jack client.
*/
jack_client_t* m_client;
/**
* The output buffer.
*/
AUD_Buffer* m_buffer;
/**
* Whether the device is valid.
*/
bool m_valid;
/**
* Invalidates the jack device.
* \param data The jack device that gets invalidet by jack.
*/
static void jack_shutdown(void *data);
/**
* Mixes the next bytes into the buffer.
* \param length The length in samples to be filled.
* \param data A pointer to the jack device.
* \return 0 what shows success.
*/
static int jack_mix(jack_nframes_t length, void *data);
protected:
virtual void playing(bool playing);
public:
/**
* Creates a Jack client for audio output.
* \param specs The wanted audio specification, where only the channel count is important.
* \exception AUD_Exception Thrown if the audio device cannot be opened.
*/
AUD_JackDevice(AUD_Specs specs);
/**
* Closes the Jack client.
*/
virtual ~AUD_JackDevice();
};
#endif //AUD_JACKDEVICE

@ -0,0 +1,40 @@
#
# $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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): GSR
#
# ***** END GPL LICENSE BLOCK *****
#
#
LIBNAME = aud_jack
DIR = $(OCGDIR)/intern/audaspace
include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
CPPFLAGS += -I../intern
CPPFLAGS += -I..
CPPFLAGS += -I.

@ -24,7 +24,7 @@
#
# ***** END GPL LICENSE BLOCK *****
SET(INC ${PNG_INC} ${ZLIB_INC} ${SDL_INC} extern)
SET(INC ${PNG_INC} ${ZLIB_INC} extern)
FILE(GLOB SRC intern/*.cpp)

@ -22,9 +22,9 @@
{
if(doReduce) {
// synchronize global vars
for(int j=0; j<calcListFull.size() ; j++) mListFull.push_back( calcListFull[j] );
for(int j=0; j<calcListEmpty.size(); j++) mListEmpty.push_back( calcListEmpty[j] );
for(int j=0; j<calcListParts.size(); j++) mpParticles->addFullParticle( calcListParts[j] );
for(size_t j=0; j<calcListFull.size() ; j++) mListFull.push_back( calcListFull[j] );
for(size_t j=0; j<calcListEmpty.size(); j++) mListEmpty.push_back( calcListEmpty[j] );
for(size_t j=0; j<calcListParts.size(); j++) mpParticles->addFullParticle( calcListParts[j] );
if(calcMaxVlen>mMaxVlen) {
mMxvx = calcMxvx;
mMxvy = calcMxvy;

@ -24,7 +24,7 @@
#
# ***** END GPL LICENSE BLOCK *****
SET(INC . ../string ${WINTAB_INC})
SET(INC . ../string)
FILE(GLOB SRC intern/*.cpp)
@ -37,6 +37,7 @@ IF(APPLE)
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowX11.cpp")
ELSE(APPLE)
IF(WIN32)
SET(INC ${INC} ${WINTAB_INC})
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCarbon.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCarbon.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCarbon.cpp")
@ -44,6 +45,7 @@ ELSE(APPLE)
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemX11.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowX11.cpp")
ELSE(WIN32)
SET(INC ${INC} ${X11_X11_INCLUDE_PATH})
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerWin32.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemWin32.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowWin32.cpp")

@ -42,6 +42,9 @@
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <string>
// For obscure full screen mode stuuf
// lifted verbatim from blut.
@ -428,7 +431,20 @@ void GHOST_WindowX11::initXInputDevices()
old_handler = XSetErrorHandler(ApplicationErrorHandler) ;
for(int i=0; i<device_count; ++i) {
if(!strcasecmp(device_info[i].name, "stylus")) {
std::string type = "";
if(device_info[i].type) {
const char *orig = XGetAtomName(m_display, device_info[i].type);
// Make a copy so we can convert to lower case
if(orig) {
type = orig;
XFree((void*)orig);
std::transform(type.begin(), type.end(), type.begin(), ::tolower);
}
}
if(type.find("stylus") != std::string::npos) {
m_xtablet.StylusID= device_info[i].id;
m_xtablet.StylusDevice = XOpenDevice(m_display, m_xtablet.StylusID);
@ -453,7 +469,7 @@ void GHOST_WindowX11::initXInputDevices()
m_xtablet.StylusID= 0;
}
}
if(!strcasecmp(device_info[i].name, "eraser")) {
if(type.find("eraser") != std::string::npos) {
m_xtablet.EraserID= device_info[i].id;
m_xtablet.EraserDevice = XOpenDevice(m_display, m_xtablet.EraserID);
if (m_xtablet.EraserDevice == NULL) m_xtablet.EraserID= 0;

@ -82,7 +82,7 @@ typedef unsigned long uintptr_t;
#define _UINTPTR_T_DEFINED
#endif
#elif defined(__linux__)
#elif defined(__linux__) || defined(__NetBSD__)
/* Linux-i386, Linux-Alpha, Linux-ppc */
#include <stdint.h>

@ -29,4 +29,9 @@ SET(INC .)
FILE(GLOB SRC intern/*.c)
BLENDERLIB(bf_guardedalloc "${SRC}" "${INC}")
#, libtype=['intern', 'player'], priority = [10, 175] )
# Override C++ alloc optional
IF(WITH_CXX_GUARDEDALLOC)
FILE(GLOB SRC cpp/*.cpp)
BLENDERLIB(bf_guardedalloc_cpp "${SRC}" "${INC}")
ENDIF(WITH_CXX_GUARDEDALLOC)

@ -0,0 +1,41 @@
/**
* $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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Contributor(s): Campbell Barton
*
* ***** END GPL LICENSE BLOCK *****
*/
#include <new>
#include "../MEM_guardedalloc.h"
void* operator new (size_t size)
{
return MEM_mallocN(size, "c++/anonymous");
}
/* not default but can be used when needing to set a string */
void* operator new (size_t size, const char *str)
{
return MEM_mallocN(size, str);
}
void operator delete (void *p)
{
MEM_freeN(p);
}

@ -83,7 +83,7 @@ typedef unsigned long uintptr_t;
#define _UINTPTR_T_DEFINED
#endif
#elif defined(__linux__)
#elif defined(__linux__) || defined(__NetBSD__)
/* Linux-i386, Linux-Alpha, Linux-ppc */
#include <stdint.h>

@ -26,7 +26,8 @@
void FLUID_3D::solvePressurePre(float* field, float* b, unsigned char* skip)
{
size_t x, y, z, index;
int x, y, z;
size_t index;
// i = 0
int i = 0;
@ -197,7 +198,8 @@ void FLUID_3D::solvePressurePre(float* field, float* b, unsigned char* skip)
//////////////////////////////////////////////////////////////////////
void FLUID_3D::solvePressure(float* field, float* b, unsigned char* skip)
{
size_t x, y, z, index;
int x, y, z;
size_t index;
// i = 0
int i = 0;
@ -348,7 +350,8 @@ void FLUID_3D::solvePressure(float* field, float* b, unsigned char* skip)
//////////////////////////////////////////////////////////////////////
void FLUID_3D::solveHeat(float* field, float* b, unsigned char* skip)
{
size_t x, y, z, index;
int x, y, z;
size_t index;
const float heatConst = _dt * _heatDiffusion / (_dx * _dx);
// i = 0

@ -926,7 +926,9 @@ inline void hsvToRgb( VECTOR_TYPE &V )
//! global string for formatting vector output in utilities.cpp
//extern const char *globVecFormatStr;
#if 0
static const char *globVecFormatStr = "[%6.4f,%6.4f,%6.4f]";
#endif
/*************************************************************************
Outputs the object in human readable form using the format

@ -220,7 +220,7 @@ static bool loadTile(float* const noiseTileData, std::string filename)
}
// dimensions
int gridSize = noiseTileSize * noiseTileSize * noiseTileSize;
size_t gridSize = noiseTileSize * noiseTileSize * noiseTileSize;
// noiseTileData memory is managed by caller
size_t bread = fread((void*)noiseTileData, sizeof(float), gridSize, file);
@ -228,7 +228,7 @@ static bool loadTile(float* const noiseTileData, std::string filename)
printf("Noise tile file '%s' loaded.\n", filename.c_str());
if (bread != gridSize) {
printf("loadTile: Noise tile '%s' is wrong size %d.\n", filename.c_str(), bread);
printf("loadTile: Noise tile '%s' is wrong size %d.\n", filename.c_str(), (int)bread);
return false;
}
return true;

@ -93,15 +93,16 @@ extern "C" void smoke_initBlenderRNA(FLUID_3D *fluid, float *alpha, float *beta)
extern "C" void smoke_dissolve(FLUID_3D *fluid, int speed, int log)
{
float *density = fluid->_density;
float *densityOld = fluid->_densityOld;
//float *densityOld = fluid->_densityOld;
float *heat = fluid->_heat;
if(log)
{
/* max density/speed = dydx */
float dydx = 1.0 / (float)speed;
size_t size= fluid->_xRes * fluid->_yRes * fluid->_zRes;
for(size_t i = 0; i < fluid->_xRes * fluid->_yRes * fluid->_zRes; i++)
for(size_t i = 0; i < size; i++)
{
density[i] *= (1.0 - dydx);
@ -118,8 +119,9 @@ extern "C" void smoke_dissolve(FLUID_3D *fluid, int speed, int log)
{
/* max density/speed = dydx */
float dydx = 1.0 / (float)speed;
size_t size= fluid->_xRes * fluid->_yRes * fluid->_zRes;
for(size_t i = 0; i < fluid->_xRes * fluid->_yRes * fluid->_zRes; i++)
for(size_t i = 0; i < size; i++)
{
density[i] -= dydx;
@ -144,8 +146,9 @@ extern "C" void smoke_dissolve_wavelet(WTURBULENCE *wt, int speed, int log)
{
/* max density/speed = dydx */
float dydx = 1.0 / (float)speed;
size_t size= r[0] * r[1] * r[2];
for(size_t i = 0; i < r[0] * r[1] * r[2]; i++)
for(size_t i = 0; i < size; i++)
{
density[i] *= (1.0 - dydx);
@ -157,8 +160,9 @@ extern "C" void smoke_dissolve_wavelet(WTURBULENCE *wt, int speed, int log)
{
/* max density/speed = dydx */
float dydx = 1.0 / (float)speed;
size_t size= r[0] * r[1] * r[2];
for(size_t i = 0; i < r[0] * r[1] * r[2]; i++)
for(size_t i = 0; i < size; i++)
{
density[i] -= dydx;

@ -35,16 +35,6 @@ BLENDNAME=blender-$(VERSION)-$(CONFIG_GUESS)-py$(NAN_PYTHON_VERSION)$(TYPE)
export DISTDIR=$(NAN_OBJDIR)/$(BLENDNAME)
export CONFDIR=$(DISTDIR)/.blender
ifeq ($(OS),beos)
TAR="zip"
TARFLAGS="-ry9"
EXT0=""
EXT1=".zip"
COMPRESS=""
EXT2=""
NOPLUGINS?=true
endif
ifeq ($(OS),$(findstring $(OS), "freebsd irix linux openbsd solaris"))
TAR="tar"
TARFLAGS="cf"

@ -56,7 +56,7 @@ def write_pov(filename, scene=None, info_callback = None):
(matrix[0][0], matrix[0][1], matrix[0][2], matrix[1][0], matrix[1][1], matrix[1][2], matrix[2][0], matrix[2][1], matrix[2][2], matrix[3][0], matrix[3][1], matrix[3][2]) )
def writeObjectMaterial(material):
if material and material.raytrace_transparency.enabled:
if material and material.transparency_method=='RAYTRACE':
file.write('\tinterior { ior %.6f }\n' % material.raytrace_transparency.ior)
# Other interior args
@ -114,7 +114,7 @@ def write_pov(filename, scene=None, info_callback = None):
# This is written into the object
'''
if material.raytrace_transparency.enabled:
if material and material.transparency_method=='RAYTRACE':
'interior { ior %.3g} ' % material.raytrace_transparency.ior
'''
@ -248,8 +248,8 @@ def write_pov(filename, scene=None, info_callback = None):
if material:
diffuse_color = material.diffuse_color
if material.raytrace_transparency.enabled: trans = 1-material.raytrace_transparency.filter
else: trans = 0.0
if material.transparency and material.transparency_method=='RAYTRACE': trans = 1-material.raytrace_transparency.filter
else: trans = 0.0
file.write(
'pigment {rgbft<%.3g, %.3g, %.3g, %.3g, %.3g>} finish {%s} }\n' % \
@ -425,8 +425,8 @@ def write_pov(filename, scene=None, info_callback = None):
material = me_materials[col[3]]
material_finish = materialNames[material.name]
if material.raytrace_transparency.enabled: trans = 1-material.raytrace_transparency.filter
else: trans = 0.0
if material.transparency and material.transparency_method=='RAYTRACE': trans = 1-material.raytrace_transparency.filter
else: trans = 0.0
else:
material_finish = DEF_MAT_NAME # not working properly,
@ -727,7 +727,7 @@ class PovrayRender(bpy.types.RenderEngine):
result = self.begin_result(0, 0, x, y)
lay = result.layers[0]
# possible the image wont load early on.
try: lay.rect_from_file(self.temp_file_out, 0, 0)
try: lay.load_from_file(self.temp_file_out)
except: pass
self.end_result(result)
@ -791,7 +791,7 @@ for member in dir(buttons_material):
del buttons_material
class RenderButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "scene"
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here

@ -197,7 +197,7 @@ def is_tricyl_facegroup(faces):
is the face group a tri cylinder
Returens a bool, true if the faces make an extruded tri solid
'''
return False
# cube must have 5 faces
if len(faces) != 5:
print '1'

@ -2,7 +2,7 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "data"
@ -43,7 +43,7 @@ class DATA_PT_skeleton(DataButtonsPanel):
col = split.column()
col.itemR(arm, "rest_position")
col.itemL(text="Deform:")
col.itemR(arm, "deform_vertexgroups", text="Vertes Groups")
col.itemR(arm, "deform_vertexgroups", text="Vertex Groups")
col.itemR(arm, "deform_envelope", text="Envelopes")
col.itemR(arm, "deform_quaternion", text="Quaternion")
col.itemR(arm, "deform_bbone_rest", text="B-Bones Rest")

@ -2,7 +2,7 @@
import bpy
class BoneButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "bone"

@ -2,7 +2,7 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "data"

@ -2,7 +2,7 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "data"

@ -2,7 +2,7 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "data"

@ -2,7 +2,7 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "data"
@ -319,4 +319,4 @@ bpy.types.register(DATA_PT_falloff_curve)
bpy.types.register(DATA_PT_area)
bpy.types.register(DATA_PT_spot)
bpy.types.register(DATA_PT_shadow)
bpy.types.register(DATA_PT_sunsky)
bpy.types.register(DATA_PT_sunsky)

@ -2,7 +2,7 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "data"

@ -2,7 +2,7 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "data"

@ -1,7 +1,7 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "data"

@ -2,7 +2,7 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "modifier"

@ -2,7 +2,7 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "data"

@ -2,7 +2,7 @@
import bpy
class PhysicsButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "physics"
@ -35,8 +35,8 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
col.itemR(ob, "restrict_render", text="Invisible") # out of place but useful
col = split.column()
col.itemR(game, "do_fh", text="Use Material Physics")
col.itemR(game, "rotation_fh", text="Rotate From Normal")
col.itemR(game, "material_physics")
col.itemR(game, "rotate_from_normal")
col.itemR(game, "no_sleeping")
layout.itemS()
@ -50,12 +50,15 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
sub.itemR(game, "radius")
sub.itemR(game, "form_factor")
col.itemS()
col = split.column()
sub = col.column()
sub.active = (game.physics_type == 'RIGID_BODY')
sub.itemR(game, "anisotropic_friction")
subsub = sub.column()
subsub.active = game.anisotropic_friction
subsub.itemR(game, "friction_coefficients", text="", slider=True)
col.itemL(text="Damping:")
sub = col.column(align=True)
sub.itemR(game, "damping", text="Translation", slider=True)
sub.itemR(game, "rotation_damping", text="Rotation", slider=True)
split = layout.split()
col = split.column()
col.itemL(text="Velocity:")
@ -63,14 +66,11 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
sub.itemR(game, "minimum_velocity", text="Minimum")
sub.itemR(game, "maximum_velocity", text="Maximum")
col.itemS()
sub = col.column()
sub.active = (game.physics_type == 'RIGID_BODY')
sub.itemR(game, "anisotropic_friction")
subsub = sub.column()
subsub.active = game.anisotropic_friction
subsub.itemR(game, "friction_coefficients", text="", slider=True)
col = split.column()
col.itemL(text="Damping:")
sub = col.column(align=True)
sub.itemR(game, "damping", text="Translation", slider=True)
sub.itemR(game, "rotation_damping", text="Rotation", slider=True)
layout.itemS()
@ -119,10 +119,10 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
col.itemS()
col.itemL(text="Cluster Collision:")
col.itemR(soft, "enable_rs_collision", text="Rigid to Soft Body")
col.itemR(soft, "enable_ss_collision", text="Soft to Soft Body")
col.itemR(soft, "cluster_rigid_to_softbody")
col.itemR(soft, "cluster_soft_to_softbody")
sub = col.column()
sub.active = (soft.enable_rs_collision or soft.enable_ss_collision)
sub.active = (soft.cluster_rigid_to_softbody or soft.cluster_soft_to_softbody)
sub.itemR(soft, "cluster_iterations", text="Iterations")
elif game.physics_type == 'STATIC':
@ -171,7 +171,7 @@ bpy.types.register(PHYSICS_PT_game_physics)
bpy.types.register(PHYSICS_PT_game_collision_bounds)
class SceneButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "scene"
@ -192,7 +192,7 @@ class SCENE_PT_game(SceneButtonsPanel):
row.itemL()
class SCENE_PT_game_player(SceneButtonsPanel):
__label__ = "Player"
__label__ = "Standalone Player"
def draw(self, context):
layout = self.layout
@ -219,8 +219,8 @@ class SCENE_PT_game_player(SceneButtonsPanel):
col = layout.column()
col.itemL(text="Framing:")
col.row().itemR(gs, "framing_type", expand=True)
sub = col.column()
sub.itemR(gs, "framing_color", text="")
if gs.framing_type == 'LETTERBOX':
col.itemR(gs, "framing_color", text="")
class SCENE_PT_game_stereo(SceneButtonsPanel):
__label__ = "Stereo"
@ -271,12 +271,58 @@ class SCENE_PT_game_stereo(SceneButtonsPanel):
layout.itemR(gs, "dome_text")
class SCENE_PT_game_shading(SceneButtonsPanel):
__label__ = "Shading"
def draw(self, context):
layout = self.layout
gs = context.scene.game_data
layout.itemR(gs, "material_mode", expand=True)
if gs.material_mode == 'GLSL':
split = layout.split()
col = split.column()
col.itemR(gs, "glsl_lights", text="Lights")
col.itemR(gs, "glsl_shaders", text="Shaders")
col.itemR(gs, "glsl_shadows", text="Shadows")
col = split.column()
col.itemR(gs, "glsl_ramps", text="Ramps")
col.itemR(gs, "glsl_nodes", text="Nodes")
col.itemR(gs, "glsl_extra_textures", text="Extra Textures")
class SCENE_PT_game_performance(SceneButtonsPanel):
__label__ = "Performance"
def draw(self, context):
layout = self.layout
gs = context.scene.game_data
split = layout.split()
col = split.column()
col.itemL(text="Show:")
col.itemR(gs, "show_debug_properties", text="Debug Properties")
col.itemR(gs, "show_framerate_profile", text="Framerate and Profile")
col.itemR(gs, "show_physics_visualization", text="Physics Visualization")
col.itemR(gs, "deprecation_warnings")
col = split.column()
col.itemL(text="Render:")
col.itemR(gs, "all_frames")
col.itemR(gs, "display_lists")
bpy.types.register(SCENE_PT_game)
bpy.types.register(SCENE_PT_game_player)
bpy.types.register(SCENE_PT_game_stereo)
bpy.types.register(SCENE_PT_game_shading)
bpy.types.register(SCENE_PT_game_performance)
class WorldButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "world"

@ -2,7 +2,7 @@
import bpy
class MaterialButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "material"
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
@ -60,15 +60,16 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
split.template_ID(ob, "active_material", new="material.new")
row = split.row()
if slot:
row.itemR(slot, "link", expand=True)
row.itemR(slot, "link", text="")
else:
row.itemL()
elif mat:
split.template_ID(space, "pin_id")
split.itemS()
layout.itemR(mat, "type", expand=True)
class MATERIAL_PT_material(MaterialButtonsPanel):
__idname__= "MATERIAL_PT_material"
class MATERIAL_PT_shading(MaterialButtonsPanel):
__label__ = "Shading"
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
@ -81,30 +82,34 @@ class MATERIAL_PT_material(MaterialButtonsPanel):
space = context.space_data
if mat:
layout.itemR(mat, "type", expand=True)
if mat.type in ['SURFACE', 'WIRE']:
split = layout.split()
col = split.column()
col.itemR(mat, "alpha", slider=True)
col.itemR(mat, "ambient", slider=True)
col.active = not mat.shadeless
col.itemR(mat, "ambient")
col.itemR(mat, "emit")
col.itemR(mat, "translucency", slider=True)
col.itemR(mat, "translucency")
col = split.column()
col.itemR(mat, "z_transparency")
col.itemR(mat, "shadeless")
col.itemR(mat, "tangent_shading")
col.itemR(mat, "cubic", slider=True)
sub = col.column()
sub.active = not mat.shadeless
sub.itemR(mat, "tangent_shading")
sub.itemR(mat, "cubic")
elif mat.type == 'HALO':
layout.itemR(mat, "alpha", slider=True)
layout.itemR(mat, "alpha")
class MATERIAL_PT_strand(MaterialButtonsPanel):
__label__ = "Strand"
__default_closed__ = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = context.material
return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
def poll(self, context):
return context.material.type in ('SURFACE', 'WIRE', 'HALO')
@ -197,8 +202,9 @@ class MATERIAL_PT_options(MaterialButtonsPanel):
col.itemR(mat, "vertex_color_light")
col.itemR(mat, "object_color")
class MATERIAL_PT_shadows(MaterialButtonsPanel):
__label__ = "Shadows"
class MATERIAL_PT_shadow(MaterialButtonsPanel):
__label__ = "Shadow"
__default_closed__ = True
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
@ -216,7 +222,7 @@ class MATERIAL_PT_shadows(MaterialButtonsPanel):
col.itemR(mat, "transparent_shadows", text="Receive Transparent")
col.itemR(mat, "only_shadow", text="Shadows Only")
col.itemR(mat, "cast_shadows_only", text="Cast Only")
col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha", slider=True)
col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha")
col = split.column()
col.itemR(mat, "cast_buffer_shadows")
@ -248,7 +254,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
col.itemR(mat, "diffuse_color", text="")
sub = col.column()
sub.active = (not mat.shadeless)
sub.itemR(mat, "diffuse_reflection", text="Intensity", slider=True)
sub.itemR(mat, "diffuse_reflection", text="Intensity")
col = split.column()
col.active = (not mat.shadeless)
@ -264,7 +270,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
elif mat.diffuse_shader == 'TOON':
row = col.row()
row.itemR(mat, "diffuse_toon_size", text="Size")
row.itemR(mat, "diffuse_toon_smooth", text="Smooth", slider=True)
row.itemR(mat, "diffuse_toon_smooth", text="Smooth")
elif mat.diffuse_shader == 'FRESNEL':
row = col.row()
row.itemR(mat, "diffuse_fresnel", text="Fresnel")
@ -302,7 +308,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel):
col = split.column()
col.itemR(mat, "specular_color", text="")
col.itemR(mat, "specular_reflection", text="Intensity", slider=True)
col.itemR(mat, "specular_reflection", text="Intensity")
col = split.column()
col.itemR(mat, "specular_shader", text="")
@ -320,7 +326,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel):
elif mat.specular_shader == 'TOON':
row = col.row()
row.itemR(mat, "specular_toon_size", text="Size")
row.itemR(mat, "specular_toon_smooth", text="Smooth", slider=True)
row.itemR(mat, "specular_toon_smooth", text="Smooth")
if mat.use_specular_ramp:
layout.itemS()
@ -363,8 +369,8 @@ class MATERIAL_PT_sss(MaterialButtonsPanel):
col = split.column(align=True)
col.itemR(sss, "color", text="")
col.itemL(text="Blend:")
col.itemR(sss, "color_factor", text="Color", slider=True)
col.itemR(sss, "texture_factor", text="Texture", slider=True)
col.itemR(sss, "color_factor", text="Color")
col.itemR(sss, "texture_factor", text="Texture")
col.itemL(text="Scattering Weight:")
col.itemR(sss, "front")
col.itemR(sss, "back")
@ -376,8 +382,8 @@ class MATERIAL_PT_sss(MaterialButtonsPanel):
col.itemR(sss, "radius", text="RGB Radius")
col.itemR(sss, "error_tolerance")
class MATERIAL_PT_raymir(MaterialButtonsPanel):
__label__ = "Ray Mirror"
class MATERIAL_PT_mirror(MaterialButtonsPanel):
__label__ = "Mirror"
__default_closed__ = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
@ -403,13 +409,13 @@ class MATERIAL_PT_raymir(MaterialButtonsPanel):
split = layout.split()
col = split.column()
col.itemR(raym, "reflect", text="Reflectivity", slider=True)
col.itemR(raym, "reflect", text="Reflectivity")
col.itemR(mat, "mirror_color", text="")
col.itemL(text="Fresnel:")
col.itemR(raym, "fresnel", text="Amount")
sub = col.column()
sub.active = raym.fresnel > 0
sub.itemR(raym, "fresnel_fac", text="Blend", slider=True)
sub.itemR(raym, "fresnel_factor", text="Blend")
col.itemS()
col.itemS()
sub = col.split(percentage=0.4)
@ -420,16 +426,16 @@ class MATERIAL_PT_raymir(MaterialButtonsPanel):
col.itemR(raym, "depth")
col.itemR(raym, "distance", text="Max Dist")
col.itemL(text="Gloss:")
col.itemR(raym, "gloss", text="Amount", slider=True)
col.itemR(raym, "gloss", text="Amount")
sub = col.column()
sub.active = raym.gloss < 1
sub.itemR(raym, "gloss_threshold", slider=True, text="Threshold")
sub.itemR(raym, "gloss_threshold", text="Threshold")
sub.itemR(raym, "gloss_samples", text="Samples")
sub.itemR(raym, "gloss_anisotropic", slider=True, text="Anisotropic")
sub.itemR(raym, "gloss_anisotropic", text="Anisotropic")
class MATERIAL_PT_raytransp(MaterialButtonsPanel):
__label__= "Ray Transparency"
class MATERIAL_PT_transp(MaterialButtonsPanel):
__label__= "Transparency"
__default_closed__ = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
@ -440,9 +446,8 @@ class MATERIAL_PT_raytransp(MaterialButtonsPanel):
def draw_header(self, context):
layout = self.layout
rayt = context.material.raytrace_transparency
layout.itemR(rayt, "enabled", text="")
mat = context.material
layout.itemR(mat, "transparency", text="")
def draw(self, context):
layout = self.layout
@ -450,36 +455,47 @@ class MATERIAL_PT_raytransp(MaterialButtonsPanel):
mat = context.material
rayt = context.material.raytrace_transparency
layout.active = rayt.enabled and (not mat.shadeless)
row= layout.row()
row.itemR(mat, "transparency_method", expand=True)
row.active = mat.transparency and (not mat.shadeless)
split = layout.split()
col = split.column()
col.itemR(rayt, "ior")
col.itemR(rayt, "falloff")
col.itemR(rayt, "limit")
col = split.column()
col.itemR(rayt, "depth")
col.itemR(rayt, "filter", slider=True)
col.itemR(rayt, "specular_opacity", slider=True, text="Spec Opacity")
split = layout.split()
col.itemL(text="Transparency:")
row = col.row()
row.itemR(mat, "alpha")
row.active = mat.transparency
row = col.row()
row.itemR(mat, "specular_alpha", text="Specular")
row.active = mat.transparency and (not mat.shadeless)
col = split.column()
col.active = mat.transparency and (not mat.shadeless)
col.itemL(text="Fresnel:")
col.itemR(rayt, "fresnel", text="Amount")
sub = col.column()
sub.active = rayt.fresnel > 0
sub.itemR(rayt, "fresnel_fac", text="Blend", slider=True)
col = split.column()
col.itemL(text="Gloss:")
col.itemR(rayt, "gloss", text="Amount", slider=True)
sub = col.column()
sub.active = rayt.gloss < 1
sub.itemR(rayt, "gloss_threshold", slider=True, text="Threshold")
sub.itemR(rayt, "gloss_samples", text="Samples")
sub.itemR(rayt, "fresnel_factor", text="Blend")
if mat.transparency_method == 'RAYTRACE':
split = layout.split()
split.active = mat.transparency and (not mat.shadeless)
col = split.column()
col.itemR(rayt, "ior")
col.itemR(rayt, "filter")
col.itemR(rayt, "falloff")
col.itemR(rayt, "limit")
col.itemR(rayt, "depth")
col = split.column()
col.itemL(text="Gloss:")
col.itemR(rayt, "gloss", text="Amount")
sub = col.column()
sub.active = rayt.gloss < 1
sub.itemR(rayt, "gloss_threshold", text="Threshold")
sub.itemR(rayt, "gloss_samples", text="Samples")
class MATERIAL_PT_volume_shading(MaterialButtonsPanel):
__label__ = "Shading"
@ -491,7 +507,7 @@ class MATERIAL_PT_volume_shading(MaterialButtonsPanel):
def draw(self, context):
layout = self.layout
mat = context.material
vol = context.material.volume
@ -599,7 +615,7 @@ class MATERIAL_PT_halo(MaterialButtonsPanel):
col.itemR(mat, "diffuse_color", text="")
col.itemR(halo, "size")
col.itemR(halo, "hardness")
col.itemR(halo, "add", slider=True)
col.itemR(halo, "add")
col.itemL(text="Options:")
col.itemR(halo, "use_texture", text="Texture")
col.itemR(halo, "use_vertex_normal", text="Vertex Normal")
@ -633,11 +649,11 @@ class MATERIAL_PT_halo(MaterialButtonsPanel):
bpy.types.register(MATERIAL_PT_context_material)
bpy.types.register(MATERIAL_PT_preview)
bpy.types.register(MATERIAL_PT_material)
bpy.types.register(MATERIAL_PT_diffuse)
bpy.types.register(MATERIAL_PT_specular)
bpy.types.register(MATERIAL_PT_raymir)
bpy.types.register(MATERIAL_PT_raytransp)
bpy.types.register(MATERIAL_PT_shading)
bpy.types.register(MATERIAL_PT_transp)
bpy.types.register(MATERIAL_PT_mirror)
bpy.types.register(MATERIAL_PT_sss)
bpy.types.register(MATERIAL_PT_volume_shading)
bpy.types.register(MATERIAL_PT_volume_scattering)
@ -646,4 +662,5 @@ bpy.types.register(MATERIAL_PT_halo)
bpy.types.register(MATERIAL_PT_physics)
bpy.types.register(MATERIAL_PT_strand)
bpy.types.register(MATERIAL_PT_options)
bpy.types.register(MATERIAL_PT_shadows)
bpy.types.register(MATERIAL_PT_shadow)

@ -2,7 +2,7 @@
import bpy
class ObjectButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "object"

@ -2,7 +2,7 @@
import bpy
class ConstraintButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "constraint"

@ -11,7 +11,7 @@ def particle_panel_poll(context):
return psys.settings.type in ('EMITTER', 'REACTOR', 'HAIR')
class ParticleButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "particle"
@ -32,7 +32,7 @@ class PARTICLE_PT_particles(ParticleButtonsPanel):
if ob:
row = layout.row()
row.template_list(ob, "particle_systems", ob, "active_particle_system_index")
row.template_list(ob, "particle_systems", ob, "active_particle_system_index", rows=2)
col = row.column(align=True)
col.itemO("object.particle_system_add", icon="ICON_ZOOMIN", text="")
@ -154,7 +154,7 @@ class PARTICLE_PT_cache(ParticleButtonsPanel):
layout.set_context_pointer("PointCache", cache)
row = layout.row()
row.template_list(cache, "point_cache_list", cache, "active_point_cache_index")
row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2 )
col = row.column(align=True)
col.itemO("ptcache.add_new", icon="ICON_ZOOMIN", text="")
col.itemO("ptcache.remove", icon="ICON_ZOOMOUT", text="")
@ -711,9 +711,8 @@ class PARTICLE_PT_draw(ParticleButtonsPanel):
col = row.column()
col.itemR(part, "material_color", text="Use material color")
if (path):
box = col.box()
box.itemR(part, "draw_step")
if (path):
col.itemR(part, "draw_step")
else:
subcol = col.column()
subcol.active = part.material_color==False

@ -2,7 +2,7 @@
import bpy
class PhysicButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "physics"
@ -16,6 +16,7 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
def draw(self, context):
layout = self.layout
md = context.cloth
ob = context.object
@ -41,27 +42,29 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
split = layout.split()
col = split.column()
col.itemR(cloth, "quality", slider=True)
col.itemL(text="Quality:")
col.itemR(cloth, "quality", text="Steps",slider=True)
col.itemL(text="Gravity:")
col.itemR(cloth, "gravity", text="")
col.itemR(cloth, "pin_cloth", text="Pin")
colsub = col.column(align=True)
colsub.active = cloth.pin_cloth
colsub.itemR(cloth, "pin_stiffness", text="Stiffness")
colsub.item_pointerR(cloth, "mass_vertex_group", ob, "vertex_groups", text="")
sub = col.column(align=True)
sub.active = cloth.pin_cloth
sub.itemR(cloth, "pin_stiffness", text="Stiffness")
sub.item_pointerR(cloth, "mass_vertex_group", ob, "vertex_groups", text="")
col = split.column()
col.itemL(text="Presets...")
col.itemL(text="TODO!")
col.itemL(text="Material:")
colsub = col.column(align=True)
colsub.itemR(cloth, "mass")
colsub.itemR(cloth, "structural_stiffness", text="Structural")
colsub.itemR(cloth, "bending_stiffness", text="Bending")
sub = col.column(align=True)
sub.itemR(cloth, "mass")
sub.itemR(cloth, "structural_stiffness", text="Structural")
sub.itemR(cloth, "bending_stiffness", text="Bending")
col.itemL(text="Damping:")
colsub = col.column(align=True)
colsub.itemR(cloth, "spring_damping", text="Spring")
colsub.itemR(cloth, "air_damping", text="Air")
sub = col.column(align=True)
sub.itemR(cloth, "spring_damping", text="Spring")
sub.itemR(cloth, "air_damping", text="Air")
# Disabled for now
"""
@ -150,14 +153,14 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):
layout.active = cloth.enable_collision
col = split.column(align=True)
col = split.column()
col.itemR(cloth, "collision_quality", slider=True, text="Quality")
col.itemR(cloth, "min_distance", slider=True, text="Distance")
col.itemR(cloth, "friction")
col = split.column(align=True)
col = split.column()
col.itemR(cloth, "enable_self_collision", text="Self Collision")
col = col.column(align=True)
col = col.column()
col.active = cloth.enable_self_collision
col.itemR(cloth, "self_collision_quality", slider=True, text="Quality")
col.itemR(cloth, "self_min_distance", slider=True, text="Distance")
@ -186,15 +189,15 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
col = split.column()
col.itemL(text="Structural Stiffness:")
colsub = col.column(align=True)
colsub.itemR(cloth, "structural_stiffness_max", text="Max")
colsub.item_pointerR(cloth, "structural_stiffness_vertex_group", ob, "vertex_groups", text="")
sub = col.column(align=True)
sub.itemR(cloth, "structural_stiffness_max", text="Max")
sub.item_pointerR(cloth, "structural_stiffness_vertex_group", ob, "vertex_groups", text="")
col = split.column()
col.itemL(text="Bending Stiffness:")
colsub = col.column(align=True)
colsub.itemR(cloth, "bending_stiffness_max", text="Max")
colsub.item_pointerR(cloth, "bending_vertex_group", ob, "vertex_groups", text="")
sub = col.column(align=True)
sub.itemR(cloth, "bending_stiffness_max", text="Max")
sub.item_pointerR(cloth, "bending_vertex_group", ob, "vertex_groups", text="")
bpy.types.register(PHYSICS_PT_cloth)
bpy.types.register(PHYSICS_PT_cloth_cache)

@ -2,7 +2,7 @@
import bpy
class PhysicButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "physics"
@ -165,46 +165,66 @@ class PHYSICS_PT_collision(PhysicButtonsPanel):
ob = context.object
rd = context.scene.render_data
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
def draw_header(self, context):
settings = context.object.collision
self.layout.itemR(settings, "enabled", text="")
def draw(self, context):
layout = self.layout
md = context.collision
settings = context.object.collision
layout.active = settings.enabled
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
if md:
# remove modifier + settings
split.set_context_pointer("modifier", md)
split.itemO("object.modifier_remove", text="Remove")
col = split.column()
#row = split.row(align=True)
#row.itemR(md, "render", text="")
#row.itemR(md, "realtime", text="")
coll = md.settings
else:
# add modifier
split.item_enumO("object.modifier_add", "type", 'COLLISION', text="Add")
split.itemL()
coll = None
col = split.column()
col.itemL(text="Particle:")
col.itemR(settings, "permeability", slider=True)
col.itemL(text="Particle Damping:")
sub = col.column(align=True)
sub.itemR(settings, "damping_factor", text="Factor", slider=True)
sub.itemR(settings, "random_damping", text="Random", slider=True)
if coll:
settings = context.object.collision
layout.active = settings.enabled
col.itemL(text="Soft Body and Cloth:")
sub = col.column(align=True)
sub.itemR(settings, "outer_thickness", text="Outer", slider=True)
sub.itemR(settings, "inner_thickness", text="Inner", slider=True)
split = layout.split()
layout.itemL(text="Force Fields:")
layout.itemR(md, "absorption", text="Absorption")
col = split.column()
col.itemL(text="Particle:")
col.itemR(settings, "permeability", slider=True)
col.itemL(text="Particle Damping:")
sub = col.column(align=True)
sub.itemR(settings, "damping_factor", text="Factor", slider=True)
sub.itemR(settings, "random_damping", text="Random", slider=True)
col = split.column()
col.itemL(text="")
col.itemR(settings, "kill_particles")
col.itemL(text="Particle Friction:")
sub = col.column(align=True)
sub.itemR(settings, "friction_factor", text="Factor", slider=True)
sub.itemR(settings, "random_friction", text="Random", slider=True)
col.itemL(text="Soft Body Damping:")
col.itemR(settings, "damping", text="Factor", slider=True)
col.itemL(text="Soft Body and Cloth:")
sub = col.column(align=True)
sub.itemR(settings, "outer_thickness", text="Outer", slider=True)
sub.itemR(settings, "inner_thickness", text="Inner", slider=True)
layout.itemL(text="Force Fields:")
layout.itemR(md, "absorption", text="Absorption")
col = split.column()
col.itemL(text="")
col.itemR(settings, "kill_particles")
col.itemL(text="Particle Friction:")
sub = col.column(align=True)
sub.itemR(settings, "friction_factor", text="Factor", slider=True)
sub.itemR(settings, "random_friction", text="Random", slider=True)
col.itemL(text="Soft Body Damping:")
col.itemR(settings, "damping", text="Factor", slider=True)
bpy.types.register(PHYSICS_PT_field)
bpy.types.register(PHYSICS_PT_collision)

@ -2,7 +2,7 @@
import bpy
class PhysicButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "physics"
@ -51,10 +51,9 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
col = split.column()
col.itemL(text="Resolution:")
sub = col.column()
sub.itemR(fluid, "resolution", text="Final")
sub.itemL(text="Render Display:")
sub.itemR(fluid, "render_display_mode", text="")
col.itemR(fluid, "resolution", text="Final")
col.itemL(text="Render Display:")
col.itemR(fluid, "render_display_mode", text="")
col.itemL(text="Time:")
sub = col.column(align=True)
sub.itemR(fluid, "start_time", text="Start")
@ -66,8 +65,8 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
col.itemL(text="Viewport Display:")
col.itemR(fluid, "viewport_display_mode", text="")
col.itemL()
col.itemR(fluid, "reverse_frames")
col.itemR(fluid, "generate_speed_vectors")
col.itemR(fluid, "reverse_frames")
layout.itemR(fluid, "path", text="")
@ -93,12 +92,12 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
col = split.column()
col.itemL(text="Slip Type:")
sub = col.column(align=True)
sub.itemR(fluid, "slip_type", text="")
col.itemR(fluid, "slip_type", text="")
if fluid.slip_type == 'PARTIALSLIP':
sub.itemR(fluid, "partial_slip_amount", slider=True, text="Amount")
col.itemR(fluid, "partial_slip_amount", slider=True, text="Amount")
col.itemR(fluid, "impact_factor")
col.itemL(text="Impact:")
col.itemR(fluid, "impact_factor", text="Factor")
elif fluid.type == 'INFLOW':
split = layout.split()
@ -124,22 +123,23 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
split.column()
elif fluid.type == 'PARTICLE':
split = layout.split()
split = layout.split(percentage=0.5)
col = split.column()
col.itemL(text="Influence:")
sub = col.column(align=True)
sub.itemR(fluid, "particle_influence", text="Size")
sub.itemR(fluid, "alpha_influence", text="Alpha")
layout.itemR(fluid, "path", text="")
col.itemR(fluid, "particle_influence", text="Size")
col.itemR(fluid, "alpha_influence", text="Alpha")
col = split.column()
col.itemL(text="Type:")
col.itemR(fluid, "drops")
col.itemR(fluid, "floats")
col = split.column()
col.itemL()
col.itemR(fluid, "tracer")
layout.itemR(fluid, "path", text="")
elif fluid.type == 'CONTROL':
split = layout.split()

@ -2,7 +2,7 @@
import bpy
class PhysicButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "physics"
@ -156,4 +156,4 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
bpy.types.register(PHYSICS_PT_smoke)
bpy.types.register(PHYSICS_PT_smoke_highres)
bpy.types.register(PHYSICS_PT_smoke_groups)
bpy.types.register(PHYSICS_PT_smoke_groups)

@ -2,7 +2,7 @@
import bpy
class PhysicButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "physics"

@ -2,7 +2,7 @@
import bpy
class RenderButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "scene"
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
@ -439,12 +439,12 @@ class SCENE_PT_unit(RenderButtonsPanel):
unit = context.scene.unit_settings
col = layout.column()
col.itemR(unit, "system")
col.row().itemR(unit, "system", expand=True)
col = layout.column()
col.active = (unit.system != 'NONE')
col.itemR(unit, "scale_length")
col.itemR(unit, "use_separate")
row = layout.row()
row.active = (unit.system != 'NONE')
row.itemR(unit, "scale_length", text="Scale")
row.itemR(unit, "use_separate")
bpy.types.register(SCENE_PT_render)

@ -2,12 +2,13 @@
import bpy
class TextureButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "texture"
def poll(self, context):
return (context.texture and context.texture.type != 'NONE')
tex = context.texture
return (tex and (tex.type != 'NONE' or tex.use_nodes))
class TEXTURE_PT_preview(TextureButtonsPanel):
__label__ = "Preview"
@ -16,22 +17,23 @@ class TEXTURE_PT_preview(TextureButtonsPanel):
layout = self.layout
tex = context.texture
slot = context.texture_slot
ma = context.material
la = context.lamp
wo = context.world
br = context.brush
if ma:
layout.template_preview(tex, parent=ma)
layout.template_preview(tex, parent=ma, slot=slot)
elif la:
layout.template_preview(tex, parent=la)
layout.template_preview(tex, parent=la, slot=slot)
elif wo:
layout.template_preview(tex, parent=wo)
layout.template_preview(tex, parent=wo, slot=slot)
elif br:
layout.template_preview(tex, parent=br)
layout.template_preview(tex, parent=br, slot=slot)
else:
layout.template_preview(tex)
layout.template_preview(tex, slot=slot)
class TEXTURE_PT_context_texture(TextureButtonsPanel):
__show_header__ = False
@ -61,27 +63,62 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
elif tex:
split.template_ID(space, "pin_id")
if (not space.pin_id) and ( context.sculpt_object or \
context.vertex_paint_object or \
context.weight_paint_object or \
context.texture_paint_object \
):
if (not space.pin_id) and (
context.sculpt_object or
context.vertex_paint_object or
context.weight_paint_object or
context.texture_paint_object
):
split.itemR(space, "brush_texture", text="Brush", toggle=True)
layout.itemS()
if tex:
layout.itemR(tex, "use_nodes")
split = layout.split(percentage=0.2)
split.itemL(text="Type:")
split.itemR(tex, "type", text="")
if tex.use_nodes:
slot = context.texture_slot
split.itemL(text="Output:")
split.itemR(slot, "output_node", text="")
class TEXTURE_PT_mapping(TextureButtonsPanel):
else:
split.itemL(text="Type:")
split.itemR(tex, "type", text="")
class TEXTURE_PT_colors(TextureButtonsPanel):
__label__ = "Colors"
__default_closed__ = True
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemR(tex, "use_color_ramp", text="Ramp")
if tex.use_color_ramp:
layout.template_color_ramp(tex.color_ramp, expand=True)
split = layout.split()
split.itemR(tex, "rgb_factor", text="Multiply RGB")
col = split.column()
col.itemL(text="Adjust:")
col.itemR(tex, "brightness")
col.itemR(tex, "contrast")
# Texture Slot Panels #
class TextureSlotPanel(TextureButtonsPanel):
def poll(self, context):
return (
context.texture_slot and
TextureButtonsPanel.poll(self, context)
)
class TEXTURE_PT_mapping(TextureSlotPanel):
__label__ = "Mapping"
def poll(self, context):
return (context.texture_slot and context.texture and context.texture.type != 'NONE')
def draw(self, context):
layout = self.layout
@ -152,12 +189,9 @@ class TEXTURE_PT_mapping(TextureButtonsPanel):
row.column().itemR(tex, "offset")
row.column().itemR(tex, "size")
class TEXTURE_PT_influence(TextureButtonsPanel):
class TEXTURE_PT_influence(TextureSlotPanel):
__label__ = "Influence"
def poll(self, context):
return (context.texture_slot and context.texture and context.texture.type != 'NONE' and (not context.brush))
def draw(self, context):
layout = self.layout
@ -253,36 +287,16 @@ class TEXTURE_PT_influence(TextureButtonsPanel):
if ma or wo:
col.itemR(tex, "default_value", text="DVar", slider=True)
class TEXTURE_PT_colors(TextureButtonsPanel):
__label__ = "Colors"
__default_closed__ = True
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemR(tex, "use_color_ramp", text="Ramp")
if tex.use_color_ramp:
layout.template_color_ramp(tex.color_ramp, expand=True)
split = layout.split()
split.itemR(tex, "rgb_factor", text="Multiply RGB")
col = split.column()
col.itemL(text="Adjust:")
col.itemR(tex, "brightness")
col.itemR(tex, "contrast")
# Texture Type Panels #
class TEXTURE_PT_clouds(TextureButtonsPanel):
__label__ = "Clouds"
class TextureTypePanel(TextureButtonsPanel):
def poll(self, context):
tex = context.texture
return (tex and tex.type == 'CLOUDS')
return (tex and tex.type == self.tex_type and not tex.use_nodes)
class TEXTURE_PT_clouds(TextureTypePanel):
__label__ = "Clouds"
tex_type = 'CLOUDS'
def draw(self, context):
layout = self.layout
@ -299,12 +313,9 @@ class TEXTURE_PT_clouds(TextureButtonsPanel):
flow.itemR(tex, "noise_depth", text="Depth")
flow.itemR(tex, "nabla", text="Nabla")
class TEXTURE_PT_wood(TextureButtonsPanel):
class TEXTURE_PT_wood(TextureTypePanel):
__label__ = "Wood"
def poll(self, context):
tex = context.texture
return (tex and tex.type == 'WOOD')
tex_type = 'WOOD'
def draw(self, context):
layout = self.layout
@ -326,13 +337,10 @@ class TEXTURE_PT_wood(TextureButtonsPanel):
flow.itemR(tex, "turbulence")
flow.itemR(tex, "nabla")
class TEXTURE_PT_marble(TextureButtonsPanel):
class TEXTURE_PT_marble(TextureTypePanel):
__label__ = "Marble"
tex_type = 'MARBLE'
def poll(self, context):
tex = context.texture
return (tex and tex.type == 'MARBLE')
def draw(self, context):
layout = self.layout
@ -350,13 +358,10 @@ class TEXTURE_PT_marble(TextureButtonsPanel):
flow.itemR(tex, "turbulence")
flow.itemR(tex, "nabla")
class TEXTURE_PT_magic(TextureButtonsPanel):
class TEXTURE_PT_magic(TextureTypePanel):
__label__ = "Magic"
tex_type = 'MAGIC'
def poll(self, context):
tex = context.texture
return (tex and tex.type == 'MAGIC')
def draw(self, context):
layout = self.layout
@ -366,13 +371,10 @@ class TEXTURE_PT_magic(TextureButtonsPanel):
row.itemR(tex, "noise_depth", text="Depth")
row.itemR(tex, "turbulence")
class TEXTURE_PT_blend(TextureButtonsPanel):
class TEXTURE_PT_blend(TextureTypePanel):
__label__ = "Blend"
tex_type = 'BLEND'
def poll(self, context):
tex = context.texture
return (tex and tex.type == 'BLEND')
def draw(self, context):
layout = self.layout
@ -381,13 +383,10 @@ class TEXTURE_PT_blend(TextureButtonsPanel):
layout.itemR(tex, "progression")
layout.itemR(tex, "flip_axis")
class TEXTURE_PT_stucci(TextureButtonsPanel):
class TEXTURE_PT_stucci(TextureTypePanel):
__label__ = "Stucci"
tex_type = 'STUCCI'
def poll(self, context):
tex = context.texture
return (tex and tex.type == 'STUCCI')
def draw(self, context):
layout = self.layout
@ -402,13 +401,10 @@ class TEXTURE_PT_stucci(TextureButtonsPanel):
row.itemR(tex, "noise_size", text="Size")
row.itemR(tex, "turbulence")
class TEXTURE_PT_image(TextureButtonsPanel):
class TEXTURE_PT_image(TextureTypePanel):
__label__ = "Image"
tex_type = 'IMAGE'
def poll(self, context):
tex = context.texture
return (tex and tex.type == 'IMAGE')
def draw(self, context):
layout = self.layout
@ -416,14 +412,11 @@ class TEXTURE_PT_image(TextureButtonsPanel):
layout.template_texture_image(tex)
class TEXTURE_PT_image_sampling(TextureButtonsPanel):
class TEXTURE_PT_image_sampling(TextureTypePanel):
__label__ = "Image Sampling"
__default_closed__ = True
tex_type = 'IMAGE'
def poll(self, context):
tex = context.texture
return (tex and tex.type == 'IMAGE')
def draw(self, context):
layout = self.layout
@ -467,14 +460,11 @@ class TEXTURE_PT_image_sampling(TextureButtonsPanel):
else:
col.itemR(tex, "filter_eccentricity", text="Eccentricity")
class TEXTURE_PT_image_mapping(TextureButtonsPanel):
class TEXTURE_PT_image_mapping(TextureTypePanel):
__label__ = "Image Mapping"
__default_closed__ = True
tex_type = 'IMAGE'
def poll(self, context):
tex = context.texture
return (tex and tex.type == 'IMAGE')
def draw(self, context):
layout = self.layout
@ -517,13 +507,10 @@ class TEXTURE_PT_image_mapping(TextureButtonsPanel):
col.itemR(tex, "crop_max_x", text="X")
col.itemR(tex, "crop_max_y", text="Y")
class TEXTURE_PT_plugin(TextureButtonsPanel):
class TEXTURE_PT_plugin(TextureTypePanel):
__label__ = "Plugin"
tex_type = 'PLUGIN'
def poll(self, context):
tex = context.texture
return (tex and tex.type == 'PLUGIN')
def draw(self, context):
layout = self.layout
@ -531,13 +518,10 @@ class TEXTURE_PT_plugin(TextureButtonsPanel):
layout.itemL(text="Nothing yet")
class TEXTURE_PT_envmap(TextureButtonsPanel):
class TEXTURE_PT_envmap(TextureTypePanel):
__label__ = "Environment Map"
tex_type = 'ENVIRONMENT_MAP'
def poll(self, context):
tex = context.texture
return (tex and tex.type == 'ENVIRONMENT_MAP')
def draw(self, context):
layout = self.layout
@ -545,13 +529,10 @@ class TEXTURE_PT_envmap(TextureButtonsPanel):
layout.itemL(text="Nothing yet")
class TEXTURE_PT_musgrave(TextureButtonsPanel):
class TEXTURE_PT_musgrave(TextureTypePanel):
__label__ = "Musgrave"
tex_type = 'MUSGRAVE'
def poll(self, context):
tex = context.texture
return (tex and tex.type == 'MUSGRAVE')
def draw(self, context):
layout = self.layout
@ -581,12 +562,9 @@ class TEXTURE_PT_musgrave(TextureButtonsPanel):
row.itemR(tex, "noise_size", text="Size")
row.itemR(tex, "nabla")
class TEXTURE_PT_voronoi(TextureButtonsPanel):
class TEXTURE_PT_voronoi(TextureTypePanel):
__label__ = "Voronoi"
def poll(self, context):
tex = context.texture
return (tex and tex.type == 'VORONOI')
tex_type = 'VORONOI'
def draw(self, context):
layout = self.layout
@ -618,13 +596,10 @@ class TEXTURE_PT_voronoi(TextureButtonsPanel):
row.itemR(tex, "noise_size", text="Size")
row.itemR(tex, "nabla")
class TEXTURE_PT_distortednoise(TextureButtonsPanel):
class TEXTURE_PT_distortednoise(TextureTypePanel):
__label__ = "Distorted Noise"
tex_type = 'DISTORTED_NOISE'
def poll(self, context):
tex = context.texture
return (tex and tex.type == 'DISTORTED_NOISE')
def draw(self, context):
layout = self.layout

@ -2,7 +2,7 @@
import bpy
class WorldButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "world"
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here

@ -2,7 +2,7 @@
import bpy
class Buttons_HT_header(bpy.types.Header):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
def draw(self, context):
layout = self.layout
@ -10,18 +10,19 @@ class Buttons_HT_header(bpy.types.Header):
so = context.space_data
scene = context.scene
layout.template_header()
row= layout.row(align=True)
row.template_header()
if context.area.show_menus:
row = layout.row(align=True)
row.itemM("Buttons_MT_view", text="View")
sub = row.row(align=True)
sub.itemM("Buttons_MT_view", text="View")
row = layout.row()
row.itemR(so, "buttons_context", expand=True, text="")
row.itemR(scene, "current_frame")
class Buttons_MT_view(bpy.types.Menu):
__space_type__ = "BUTTONS_WINDOW"
__space_type__ = "PROPERTIES"
__label__ = "View"
def draw(self, context):

@ -12,17 +12,22 @@ class CONSOLE_HT_header(bpy.types.Header):
# text = sc.text
layout = self.layout
layout.template_header()
row= layout.row(align=True)
row.template_header()
row = layout.row()
row.itemR(sc, "console_type", expand=True)
if context.area.show_menus:
sub = row.row(align=True)
if sc.console_type == 'REPORT':
sub.itemM("CONSOLE_MT_report")
else:
sub.itemM("CONSOLE_MT_console")
layout.itemS()
layout.itemR(sc, "console_type", expand=True)
if sc.console_type == 'REPORT':
if context.area.show_menus:
row = layout.row()
row.itemM("CONSOLE_MT_report")
row = layout.row(align=True)
row.itemR(sc, "show_report_debug", text="Debug")
row.itemR(sc, "show_report_info", text="Info")
row.itemR(sc, "show_report_operator", text="Operators")
@ -32,12 +37,6 @@ class CONSOLE_HT_header(bpy.types.Header):
row = layout.row()
row.enabled = sc.show_report_operator
row.itemO("console.report_replay")
else:
if context.area.show_menus:
row = layout.row()
row.itemM("CONSOLE_MT_console")
class CONSOLE_MT_console(bpy.types.Menu):
__space_type__ = "CONSOLE"

@ -10,7 +10,7 @@ class FILEBROWSER_HT_header(bpy.types.Header):
layout = self.layout
params = st.params
layout.template_header()
layout.template_header(menus=False)
row = layout.row(align=True)
row.itemO("file.parent", text="", icon='ICON_FILE_PARENT')

@ -205,23 +205,24 @@ class IMAGE_HT_header(bpy.types.Header):
show_paint = sima.show_paint
show_uvedit = sima.show_uvedit
layout.template_header()
row = layout.row(align=True)
row.template_header()
# menus
if context.area.show_menus:
row = layout.row()
row.itemM("IMAGE_MT_view")
sub = row.row(align=True)
sub.itemM("IMAGE_MT_view")
if show_uvedit:
row.itemM("IMAGE_MT_select")
sub.itemM("IMAGE_MT_select")
if ima and ima.dirty:
row.itemM("IMAGE_MT_image", text="Image*")
sub.itemM("IMAGE_MT_image", text="Image*")
else:
row.itemM("IMAGE_MT_image", text="Image")
sub.itemM("IMAGE_MT_image", text="Image")
if show_uvedit:
row.itemM("IMAGE_MT_uvs")
sub.itemM("IMAGE_MT_uvs")
layout.template_ID(sima, "image", new="image.new")

@ -2,28 +2,29 @@
import bpy
class INFO_HT_header(bpy.types.Header):
__space_type__ = "USER_PREFERENCES"
__space_type__ = "INFO"
def draw(self, context):
layout = self.layout
st = context.space_data
rd = context.scene.render_data
layout.template_header()
row = layout.row(align=True)
row.template_header()
if context.area.show_menus:
row = layout.row()
row.itemM("INFO_MT_file")
row.itemM("INFO_MT_add")
sub = row.row(align=True)
sub.itemM("INFO_MT_file")
sub.itemM("INFO_MT_add")
if rd.use_game_engine:
row.itemM("INFO_MT_game")
sub.itemM("INFO_MT_game")
else:
row.itemM("INFO_MT_render")
row.itemM("INFO_MT_help")
sub.itemM("INFO_MT_render")
sub.itemM("INFO_MT_help")
layout.template_ID(context.window, "screen") #, new="screen.new", open="scene.unlink")
layout.template_ID(context.screen, "scene") #, new="screen.new", unlink="scene.unlink")
layout.template_ID(context.window, "screen", new="screen.new", unlink="screen.delete")
layout.template_ID(context.screen, "scene", new="scene.new", unlink="scene.delete")
if rd.multiple_engines:
layout.itemR(rd, "engine", text="")
@ -34,7 +35,7 @@ class INFO_HT_header(bpy.types.Header):
layout.template_running_jobs()
class INFO_MT_file(bpy.types.Menu):
__space_type__ = "USER_PREFERENCES"
__space_type__ = "INFO"
__label__ = "File"
def draw(self, context):
@ -70,14 +71,14 @@ class INFO_MT_file(bpy.types.Menu):
layout.itemO("wm.exit_blender", text="Quit")
class INFO_MT_file_import(bpy.types.Menu):
__space_type__ = "USER_PREFERENCES"
__space_type__ = "INFO"
__label__ = "Import"
def draw(self, context):
layout = self.layout
class INFO_MT_file_export(bpy.types.Menu):
__space_type__ = "USER_PREFERENCES"
__space_type__ = "INFO"
__label__ = "Export"
def draw(self, context):
@ -86,7 +87,7 @@ class INFO_MT_file_export(bpy.types.Menu):
layout.itemO("export.ply", text="PLY")
class INFO_MT_file_external_data(bpy.types.Menu):
__space_type__ = "USER_PREFERENCES"
__space_type__ = "INFO"
__label__ = "External Data"
def draw(self, context):
@ -103,7 +104,7 @@ class INFO_MT_file_external_data(bpy.types.Menu):
layout.itemO("file.find_missing_files")
class INFO_MT_add(bpy.types.Menu):
__space_type__ = "USER_PREFERENCES"
__space_type__ = "INFO"
__label__ = "Add"
def draw(self, context):
@ -129,16 +130,25 @@ class INFO_MT_add(bpy.types.Menu):
layout.item_enumO("OBJECT_OT_object_add", "type", 'LAMP', icon='ICON_OUTLINER_OB_LAMP')
class INFO_MT_game(bpy.types.Menu):
__space_type__ = "USER_PREFERENCES"
__space_type__ = "INFO"
__label__ = "Game"
def draw(self, context):
layout = self.layout
gs = context.scene.game_data
layout.itemO("view3d.game_start")
layout.itemS()
layout.itemR(gs, "show_debug_properties")
layout.itemR(gs, "show_framerate_profile")
layout.itemR(gs, "show_physics_visualization")
layout.itemR(gs, "deprecation_warnings")
class INFO_MT_render(bpy.types.Menu):
__space_type__ = "USER_PREFERENCES"
__space_type__ = "INFO"
__label__ = "Render"
def draw(self, context):
@ -154,7 +164,7 @@ class INFO_MT_render(bpy.types.Menu):
layout.itemO("screen.render_view_show")
class INFO_MT_help(bpy.types.Menu):
__space_type__ = "USER_PREFERENCES"
__space_type__ = "INFO"
__label__ = "Help"
def draw(self, context):
@ -170,397 +180,6 @@ class INFO_MT_help(bpy.types.Menu):
layout.itemO("help.developer_community")
layout.itemO("help.user_community")
class INFO_PT_tabs(bpy.types.Panel):
__space_type__ = "USER_PREFERENCES"
__show_header__ = False
def draw(self, context):
layout = self.layout
userpref = context.user_preferences
layout.itemR(userpref, "active_section", expand=True)
class INFO_PT_view(bpy.types.Panel):
__space_type__ = "USER_PREFERENCES"
__label__ = "View"
__show_header__ = False
def poll(self, context):
userpref = context.user_preferences
return (userpref.active_section == 'VIEW_CONTROLS')
def draw(self, context):
layout = self.layout
userpref = context.user_preferences
view = userpref.view
split = layout.split()
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
sub1.itemL(text="Display:")
sub1.itemR(view, "tooltips")
sub1.itemR(view, "display_object_info", text="Object Info")
sub1.itemR(view, "use_large_cursors")
sub1.itemR(view, "show_view_name", text="View Name")
sub1.itemR(view, "show_playback_fps", text="Playback FPS")
sub1.itemR(view, "global_scene")
sub1.itemR(view, "pin_floating_panels")
sub1.itemR(view, "object_center_size")
sub1.itemS()
sub1.itemS()
sub1.itemS()
sub1.itemR(view, "show_mini_axis")
sub2 = sub1.column()
sub2.enabled = view.show_mini_axis
sub2.itemR(view, "mini_axis_size")
sub2.itemR(view, "mini_axis_brightness")
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
sub1.itemL(text="View Manipulation:")
sub1.itemR(view, "auto_depth")
sub1.itemR(view, "global_pivot")
sub1.itemR(view, "zoom_to_mouse")
sub1.itemR(view, "rotate_around_selection")
sub1.itemS()
sub1.itemL(text="Zoom Style:")
sub1.row().itemR(view, "viewport_zoom_style", expand=True)
sub1.itemL(text="Orbit Style:")
sub1.row().itemR(view, "view_rotation", expand=True)
sub1.itemR(view, "perspective_orthographic_switch")
sub1.itemR(view, "smooth_view")
sub1.itemR(view, "rotation_angle")
sub1.itemS()
sub1.itemL(text="NDOF Device:")
sub1.itemR(view, "ndof_pan_speed", text="Pan Speed")
sub1.itemR(view, "ndof_rotate_speed", text="Orbit Speed")
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
sub1.itemL(text="Mouse Buttons:")
sub1.itemR(view, "left_mouse_button_select")
sub1.itemR(view, "right_mouse_button_select")
sub1.itemR(view, "emulate_3_button_mouse")
sub1.itemR(view, "use_middle_mouse_paste")
sub1.itemR(view, "middle_mouse_rotate")
sub1.itemR(view, "middle_mouse_pan")
sub1.itemR(view, "wheel_invert_zoom")
sub1.itemR(view, "wheel_scroll_lines")
sub1.itemS()
sub1.itemS()
sub1.itemS()
sub1.itemL(text="Menus:")
sub1.itemR(view, "open_mouse_over")
sub1.itemL(text="Menu Open Delay:")
sub1.itemR(view, "open_toplevel_delay", text="Top Level")
sub1.itemR(view, "open_sublevel_delay", text="Sub Level")
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
#manipulator
sub1.itemR(view, "use_manipulator")
sub2 = sub1.column()
sub2.enabled = view.use_manipulator
sub2.itemR(view, "manipulator_size", text="Size")
sub2.itemR(view, "manipulator_handle_size", text="Handle Size")
sub2.itemR(view, "manipulator_hotspot", text="Hotspot")
sub1.itemS()
sub1.itemS()
sub1.itemS()
sub1.itemL(text="Toolbox:")
sub1.itemR(view, "use_column_layout")
sub1.itemL(text="Open Toolbox Delay:")
sub1.itemR(view, "open_left_mouse_delay", text="Hold LMB")
sub1.itemR(view, "open_right_mouse_delay", text="Hold RMB")
class INFO_PT_edit(bpy.types.Panel):
__space_type__ = "USER_PREFERENCES"
__label__ = "Edit"
__show_header__ = False
def poll(self, context):
userpref = context.user_preferences
return (userpref.active_section == 'EDIT_METHODS')
def draw(self, context):
layout = self.layout
userpref = context.user_preferences
edit = userpref.edit
view = userpref.view
split = layout.split()
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
sub1.itemL(text="Materials:")
sub1.itemR(edit, "material_linked_object", text="Linked to Object")
sub1.itemR(edit, "material_linked_obdata", text="Linked to ObData")
sub1.itemS()
sub1.itemS()
sub1.itemS()
sub1.itemL(text="New Objects:")
sub1.itemR(edit, "enter_edit_mode")
sub1.itemR(edit, "align_to_view")
sub1.itemS()
sub1.itemS()
sub1.itemS()
sub1.itemL(text="Transform:")
sub1.itemR(edit, "drag_immediately")
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
sub1.itemL(text="Snap:")
sub1.itemR(edit, "snap_translate", text="Translate")
sub1.itemR(edit, "snap_rotate", text="Rotate")
sub1.itemR(edit, "snap_scale", text="Scale")
sub1.itemS()
sub1.itemS()
sub1.itemS()
sub1.itemL(text="Grease Pencil:")
sub1.itemR(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance")
sub1.itemR(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance")
sub1.itemR(edit, "grease_pencil_smooth_stroke", text="Smooth Stroke")
# sub1.itemR(edit, "grease_pencil_simplify_stroke", text="Simplify Stroke")
sub1.itemR(edit, "grease_pencil_eraser_radius", text="Eraser Radius")
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
sub1.itemL(text="Keyframing:")
sub1.itemR(edit, "use_visual_keying")
sub1.itemR(edit, "new_interpolation_type")
sub1.itemS()
sub1.itemR(edit, "auto_keying_enable", text="Auto Keyframing")
sub2 = sub1.column()
sub2.enabled = edit.auto_keying_enable
sub2.row().itemR(edit, "auto_keying_mode", expand=True)
sub2.itemR(edit, "auto_keyframe_insert_available", text="Only Insert Available")
sub2.itemR(edit, "auto_keyframe_insert_needed", text="Only Insert Needed")
sub1.itemS()
sub1.itemS()
sub1.itemS()
sub1.itemL(text="Undo:")
sub1.itemR(edit, "global_undo")
sub1.itemR(edit, "undo_steps", text="Steps")
sub1.itemR(edit, "undo_memory_limit", text="Memory Limit")
sub1.itemS()
sub1.itemS()
sub1.itemS()
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
sub1.itemL(text="Duplicate:")
sub1.itemR(edit, "duplicate_mesh", text="Mesh")
sub1.itemR(edit, "duplicate_surface", text="Surface")
sub1.itemR(edit, "duplicate_curve", text="Curve")
sub1.itemR(edit, "duplicate_text", text="Text")
sub1.itemR(edit, "duplicate_metaball", text="Metaball")
sub1.itemR(edit, "duplicate_armature", text="Armature")
sub1.itemR(edit, "duplicate_lamp", text="Lamp")
sub1.itemR(edit, "duplicate_material", text="Material")
sub1.itemR(edit, "duplicate_texture", text="Texture")
sub1.itemR(edit, "duplicate_ipo", text="F-Curve")
sub1.itemR(edit, "duplicate_action", text="Action")
class INFO_PT_system(bpy.types.Panel):
__space_type__ = "USER_PREFERENCES"
__label__ = "System"
__show_header__ = False
def poll(self, context):
userpref = context.user_preferences
return (userpref.active_section == 'SYSTEM_OPENGL')
def draw(self, context):
layout = self.layout
userpref = context.user_preferences
system = userpref.system
lan = userpref.language
split = layout.split()
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
sub1.itemR(system, "emulate_numpad")
sub1.itemS()
sub1.itemS()
#Weight Colors
sub1.itemL(text="Weight Colors:")
sub1.itemR(system, "use_weight_color_range", text="Use Custom Range")
sub2 = sub1.column()
sub2.active = system.use_weight_color_range
sub2.template_color_ramp(system.weight_color_range, expand=True)
sub1.itemS()
sub1.itemS()
#sequencer
sub1.itemL(text="Sequencer:")
sub1.itemR(system, "prefetch_frames")
sub1.itemR(system, "memory_cache_limit")
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub .column()
#System
sub1.itemL(text="System:")
sub1.itemR(lan, "dpi")
sub1.itemR(system, "auto_run_python_scripts")
sub1.itemR(system, "frame_server_port")
sub1.itemR(system, "filter_file_extensions")
sub1.itemR(system, "hide_dot_files_datablocks")
sub1.itemR(lan, "scrollback", text="Console Scrollback")
sub1.itemS()
sub1.itemS()
sub1.itemL(text="Sound:")
sub1.itemR(system, "audio_device")
sub2 = sub1.column()
sub2.active = system.audio_device != 'AUDIO_DEVICE_NULL'
sub2.itemR(system, "enable_all_codecs")
sub2.itemR(system, "game_sound")
sub2.itemR(system, "audio_channels")
sub2.itemR(system, "audio_mixing_buffer")
sub2.itemR(system, "audio_sample_rate")
sub2.itemR(system, "audio_sample_format")
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
#OpenGL
sub1.itemL(text="OpenGL:")
sub1.itemR(system, "clip_alpha", slider=True)
sub1.itemR(system, "use_mipmaps")
sub1.itemL(text="Window Draw Method:")
sub1.row().itemR(system, "window_draw_method", expand=True)
sub1.itemL(text="Textures:")
sub1.itemR(system, "gl_texture_limit", text="Limit Size")
sub1.itemR(system, "texture_time_out", text="Time Out")
sub1.itemR(system, "texture_collection_rate", text="Collection Rate")
class INFO_PT_filepaths(bpy.types.Panel):
__space_type__ = "USER_PREFERENCES"
__label__ = "File Paths"
__show_header__ = False
def poll(self, context):
userpref = context.user_preferences
return (userpref.active_section == 'FILE_PATHS')
def draw(self, context):
layout = self.layout
userpref = context.user_preferences
paths = userpref.filepaths
split = layout.split()
col = split.column()
col.itemL(text="File Paths:")
sub = col.split(percentage=0.3)
sub.itemL(text="Fonts:")
sub.itemR(paths, "fonts_directory", text="")
sub = col.split(percentage=0.3)
sub.itemL(text="Textures:")
sub.itemR(paths, "textures_directory", text="")
sub = col.split(percentage=0.3)
sub.itemL(text="Texture Plugins:")
sub.itemR(paths, "texture_plugin_directory", text="")
sub = col.split(percentage=0.3)
sub.itemL(text="Sequence Plugins:")
sub.itemR(paths, "sequence_plugin_directory", text="")
sub = col.split(percentage=0.3)
sub.itemL(text="Render Output:")
sub.itemR(paths, "render_output_directory", text="")
sub = col.split(percentage=0.3)
sub.itemL(text="Scripts:")
sub.itemR(paths, "python_scripts_directory", text="")
sub = col.split(percentage=0.3)
sub.itemL(text="Sounds:")
sub.itemR(paths, "sounds_directory", text="")
sub = col.split(percentage=0.3)
sub.itemL(text="Temp:")
sub.itemR(paths, "temporary_directory", text="")
col = split.column()
sub = col.split(percentage=0.2)
sub1 = sub.column()
sub2 = sub.column()
sub2.itemL(text="Save & Load:")
sub2.itemR(paths, "use_relative_paths")
sub2.itemR(paths, "compress_file")
sub2.itemL(text="Auto Save:")
sub2.itemR(paths, "save_version")
sub2.itemR(paths, "recent_files")
sub2.itemR(paths, "save_preview_images")
sub2.itemR(paths, "auto_save_temporary_files")
sub3 = sub2.column()
sub3.enabled = paths.auto_save_temporary_files
sub3.itemR(paths, "auto_save_time")
class INFO_PT_language(bpy.types.Panel):
__space_type__ = "USER_PREFERENCES"
__label__ = "Language"
__show_header__ = False
def poll(self, context):
userpref = context.user_preferences
return (userpref.active_section == 'LANGUAGE_COLORS')
def draw(self, context):
layout = self.layout
userpref = context.user_preferences
lan = userpref.language
split = layout.split()
col = split.column()
col.itemR(lan, "language")
col.itemR(lan, "translate_tooltips")
col.itemR(lan, "translate_buttons")
col.itemR(lan, "translate_toolbox")
col.itemR(lan, "use_textured_fonts")
class INFO_PT_bottombar(bpy.types.Panel):
__space_type__ = "USER_PREFERENCES"
__label__ = " "
__show_header__ = False
def draw(self, context):
layout = self.layout
userpref = context.user_preferences
split = layout.split(percentage=0.8)
split.itemL(text="")
layout.operator_context = "EXEC_AREA"
split.itemO("wm.save_homefile", text="Save As Default")
bpy.types.register(INFO_HT_header)
bpy.types.register(INFO_MT_file)
bpy.types.register(INFO_MT_file_import)
@ -570,13 +189,6 @@ bpy.types.register(INFO_MT_add)
bpy.types.register(INFO_MT_game)
bpy.types.register(INFO_MT_render)
bpy.types.register(INFO_MT_help)
bpy.types.register(INFO_PT_tabs)
bpy.types.register(INFO_PT_view)
bpy.types.register(INFO_PT_edit)
bpy.types.register(INFO_PT_system)
bpy.types.register(INFO_PT_filepaths)
bpy.types.register(INFO_PT_language)
bpy.types.register(INFO_PT_bottombar)
# Help operators
@ -631,3 +243,4 @@ bpy.ops.add(HELP_OT_blender_website)
bpy.ops.add(HELP_OT_blender_eshop)
bpy.ops.add(HELP_OT_developer_community)
bpy.ops.add(HELP_OT_user_community)

121
release/ui/space_node.py Normal file

@ -0,0 +1,121 @@
import bpy
class NODE_HT_header(bpy.types.Header):
__space_type__ = "NODE_EDITOR"
def draw(self, context):
layout = self.layout
snode = context.space_data
row = layout.row(align=True)
row.template_header()
if context.area.show_menus:
sub = row.row(align=True)
sub.itemM("NODE_MT_view")
sub.itemM("NODE_MT_select")
sub.itemM("NODE_MT_add")
sub.itemM("NODE_MT_node")
row = layout.row()
row.itemR(snode, "tree_type", text="", expand=True)
if snode.tree_type == 'MATERIAL':
ob = snode.id_from
id = snode.id
if ob:
layout.template_ID(ob, "active_material", new="material.new")
if id:
layout.itemR(id, "use_nodes", toggle=True)
elif snode.tree_type == 'TEXTURE':
row.itemR(snode, "texture_type", text="", expand=True)
id = snode.id
id_from = snode.id_from
if id_from:
layout.template_ID(id_from, "active_texture", new="texture.new")
if id:
layout.itemR(id, "use_nodes", toggle=True)
elif snode.tree_type == 'COMPOSITING':
id = snode.id
layout.itemR(id, "use_nodes", toggle=True)
layout.itemR(id.render_data, "free_unused_nodes", text="Free Unused", toggle=True)
layout.itemR(snode, "backdrop", toggle=True)
class NODE_MT_view(bpy.types.Menu):
__space_type__ = "NODE_EDITOR"
__label__ = "View"
def draw(self, context):
layout = self.layout
# layout.itemO("grease_pencil..")
# layout.itemS()
layout.itemO("view2d.zoom_in")
layout.itemO("view2d.zoom_out")
layout.itemS()
layout.itemO("node.view_all")
layout.itemO("screen.screen_full_area")
class NODE_MT_select(bpy.types.Menu):
__space_type__ = "NODE_EDITOR"
__label__ = "Select"
def draw(self, context):
layout = self.layout
layout.itemO("node.select_border")
# XXX
# layout.itemS()
# layout.itemO("node.select_all")
# layout.itemO("node.select_linked_from")
# layout.itemO("node.select_linked_to")
class NODE_MT_node(bpy.types.Menu):
__space_type__ = "NODE_EDITOR"
__label__ = "Node"
def draw(self, context):
layout = self.layout
layout.itemO("tfm.translate")
layout.itemO("tfm.resize")
layout.itemO("tfm.rotate")
layout.itemS()
layout.itemO("node.duplicate")
layout.itemO("node.delete")
# XXX
# layout.itemS()
# layout.itemO("node.make_link")
# layout.itemS()
# layout.itemO("node.edit_group")
# layout.itemO("node.ungroup")
# layout.itemO("node.group")
# layout.itemO("node.make_link")
layout.itemS()
layout.itemO("node.visibility_toggle")
# XXX
# layout.itemO("node.rename")
# layout.itemS()
# layout.itemO("node.show_cyclic_dependencies")
bpy.types.register(NODE_HT_header)
bpy.types.register(NODE_MT_view)
bpy.types.register(NODE_MT_select)
bpy.types.register(NODE_MT_node)

@ -9,11 +9,12 @@ class OUTLINER_HT_header(bpy.types.Header):
sce = context.scene
layout = self.layout
layout.template_header()
row = layout.row(align=True)
row.template_header()
if context.area.show_menus:
row = layout.row(align=True)
row.itemM("OUTLINER_MT_view")
sub = row.row(align=True)
sub.itemM("OUTLINER_MT_view")
row = layout.row()
row.itemR(so, "display_mode", text="")

@ -10,28 +10,32 @@ class SEQUENCER_HT_header(bpy.types.Header):
__space_type__ = "SEQUENCE_EDITOR"
def draw(self, context):
layout = self.layout
st = context.space_data
layout = self.layout
layout.template_header()
row = layout.row(align=True)
row.template_header()
if context.area.show_menus:
row = layout.row()
row.itemR(st, "display_mode", text="")
row.itemM("SEQUENCER_MT_view")
sub = row.row(align=True)
sub.itemM("SEQUENCER_MT_view")
layout.itemS()
row.itemS()
if st.display_mode == 'SEQUENCER':
row.itemM("SEQUENCER_MT_select")
row.itemM("SEQUENCER_MT_marker")
row.itemM("SEQUENCER_MT_add")
row.itemM("SEQUENCER_MT_strip")
layout.itemS()
row.itemO("sequencer.reload")
else:
row.itemR(st, "display_channel", text=" Channel")
sub.itemM("SEQUENCER_MT_select")
sub.itemM("SEQUENCER_MT_marker")
sub.itemM("SEQUENCER_MT_add")
sub.itemM("SEQUENCER_MT_strip")
layout.itemR(st, "display_mode", text="")
if st.display_mode == 'SEQUENCER':
layout.itemS()
layout.itemO("sequencer.reload")
else:
layout.itemR(st, "display_channel", text="Channel")
class SEQUENCER_MT_view(bpy.types.Menu):
__space_type__ = "SEQUENCE_EDITOR"
@ -39,6 +43,7 @@ class SEQUENCER_MT_view(bpy.types.Menu):
def draw(self, context):
layout = self.layout
st = context.space_data
layout.column()
@ -106,6 +111,7 @@ class SEQUENCER_MT_select(bpy.types.Menu):
def draw(self, context):
layout = self.layout
st = context.space_data
layout.column()
@ -126,17 +132,18 @@ class SEQUENCER_MT_marker(bpy.types.Menu):
def draw(self, context):
layout = self.layout
st = context.space_data
layout.column()
layout.itemO("sequencer.sound_strip_add", text="Add Marker|Ctrl Alt M")
layout.itemO("sequencer.sound_strip_add", text="Duplicate Marker|Ctrl Shift D")
layout.itemO("sequencer.sound_strip_add", text="Delete Marker|Shift X")
layout.itemO("marker.add", text="Add Marker")
layout.itemO("marker.duplicate", text="Duplicate Marker")
layout.itemO("marker.move", text="Grab/Move Marker")
layout.itemO("marker.delete", text="Delete Marker")
layout.itemS()
layout.itemO("sequencer.sound_strip_add", text="(Re)Name Marker|Ctrl M")
layout.itemO("sequencer.sound_strip_add", text="Grab/Move Marker|Ctrl G")
layout.itemS()
layout.itemO("sequencer.sound_strip_add", text="Transform Markers") # toggle, will be rna - (sseq->flag & SEQ_MARKER_TRANS)
layout.itemL(text="ToDo: Name Marker")
#layout.itemO("sequencer.sound_strip_add", text="Transform Markers") # toggle, will be rna - (sseq->flag & SEQ_MARKER_TRANS)
class SEQUENCER_MT_add(bpy.types.Menu):
__space_type__ = "SEQUENCE_EDITOR"
@ -144,6 +151,7 @@ class SEQUENCER_MT_add(bpy.types.Menu):
def draw(self, context):
layout = self.layout
st = context.space_data
layout.column()
@ -154,29 +162,29 @@ class SEQUENCER_MT_add(bpy.types.Menu):
layout.itemM("SEQUENCER_MT_add_effect")
class SEQUENCER_MT_add_effect(bpy.types.Menu):
__space_type__ = "SEQUENCE_EDITOR"
__label__ = "Effect Strip..."
def draw(self, context):
layout = self.layout
st = context.space_data
self.layout.column()
self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'ADD')
self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'SUBTRACT')
self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'ALPHA_OVER')
self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'ALPHA_UNDER')
self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'GAMMA_CROSS')
self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'MULTIPLY')
self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'OVER_DROP')
self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'PLUGIN')
self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'WIPE')
self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'GLOW')
self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'TRANSFORM')
self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'COLOR')
self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'SPEED')
layout.column()
layout.item_enumO("sequencer.effect_strip_add", 'type', 'ADD')
layout.item_enumO("sequencer.effect_strip_add", 'type', 'SUBTRACT')
layout.item_enumO("sequencer.effect_strip_add", 'type', 'ALPHA_OVER')
layout.item_enumO("sequencer.effect_strip_add", 'type', 'ALPHA_UNDER')
layout.item_enumO("sequencer.effect_strip_add", 'type', 'GAMMA_CROSS')
layout.item_enumO("sequencer.effect_strip_add", 'type', 'MULTIPLY')
layout.item_enumO("sequencer.effect_strip_add", 'type', 'OVER_DROP')
layout.item_enumO("sequencer.effect_strip_add", 'type', 'PLUGIN')
layout.item_enumO("sequencer.effect_strip_add", 'type', 'WIPE')
layout.item_enumO("sequencer.effect_strip_add", 'type', 'GLOW')
layout.item_enumO("sequencer.effect_strip_add", 'type', 'TRANSFORM')
layout.item_enumO("sequencer.effect_strip_add", 'type', 'COLOR')
layout.item_enumO("sequencer.effect_strip_add", 'type', 'SPEED')
class SEQUENCER_MT_strip(bpy.types.Menu):
__space_type__ = "SEQUENCE_EDITOR"
@ -184,6 +192,7 @@ class SEQUENCER_MT_strip(bpy.types.Menu):
def draw(self, context):
layout = self.layout
st = context.space_data
layout.operator_context = 'INVOKE_REGION_WIN'
@ -279,8 +288,6 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel):
split.itemR(strip, "blend_mode", text="")
row = layout.row()
if strip.mute == True:
row.itemR(strip, "mute", toggle=True, icon='ICON_RESTRICT_VIEW_ON', text="")
elif strip.mute == False:
@ -396,7 +403,6 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel):
col.itemL(text="Rotation:")
col.itemR(strip, "rotation_start", text="Start")
col.itemR(strip, "rotation_end", text="End")
class SEQUENCER_PT_input(SequencerButtonsPanel):
__label__ = "Strip Input"
@ -416,21 +422,17 @@ class SEQUENCER_PT_input(SequencerButtonsPanel):
strip = act_strip(context)
split = layout.split(percentage=0.3)
sub = split.column()
sub.itemL(text="Directory:")
sub = split.column()
sub.itemR(strip, "directory", text="")
layout.itemR(strip, "directory", text="")
# Current element for the filename
split = layout.split(percentage=0.3)
sub = split.column()
sub.itemL(text="File Name:")
sub = split.column()
col = split.column()
col.itemL(text="File Name:")
col = split.column()
elem = strip.getStripElem(context.scene.current_frame)
if elem:
sub.itemR(elem, "filename", text="") # strip.elements[0] could be a fallback
col.itemR(elem, "filename", text="") # strip.elements[0] could be a fallback
layout.itemR(strip, "use_translation", text="Image Offset:")
if strip.transform:
@ -438,8 +440,7 @@ class SEQUENCER_PT_input(SequencerButtonsPanel):
col.active = strip.use_translation
col.itemR(strip.transform, "offset_x", text="X")
col.itemR(strip.transform, "offset_y", text="Y")
layout.itemR(strip, "use_crop", text="Image Crop:")
if strip.crop:
col = layout.column(align=True)
@ -453,7 +454,6 @@ class SEQUENCER_PT_input(SequencerButtonsPanel):
col.itemL(text="Trim Duration:")
col.itemR(strip, "animation_start_offset", text="Start")
col.itemR(strip, "animation_end_offset", text="End")
class SEQUENCER_PT_filter(SequencerButtonsPanel):
__label__ = "Filter"
@ -472,8 +472,7 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel):
layout = self.layout
strip = act_strip(context)
col = layout.column()
col.itemL(text="Video:")
col.itemR(strip, "strobe")
@ -504,7 +503,6 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel):
col = row.column()
col.itemR(strip.color_balance, "gain")
col.itemR(strip.color_balance, "inverse_gain", text="Inverse")
class SEQUENCER_PT_proxy(SequencerButtonsPanel):
__label__ = "Proxy"
@ -520,36 +518,34 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel):
return strip.type in ('MOVIE', 'IMAGE', 'SCENE', 'META')
def draw_header(self, context):
strip = act_strip(context)
layout = self.layout
strip = act_strip(context)
layout.itemR(strip, "use_proxy", text="")
def draw(self, context):
strip = act_strip(context)
layout = self.layout
strip = act_strip(context)
flow = layout.column_flow()
flow.itemR(strip, "proxy_custom_directory")
if strip.proxy: # TODO - need to add this somehow
flow.itemR(strip.proxy, "directory")
flow.itemR(strip.proxy, "file")
class SEQUENCER_PT_view(SequencerButtonsPanel_Output):
__label__ = "View Settings"
def draw(self, context):
layout = self.layout
st = context.space_data
layout = self.layout
flow = layout.column_flow()
flow.itemR(st, "draw_overexposed") # text="Zebra"
flow.itemR(st, "draw_safe_margin")
col = layout.column()
col.itemR(st, "draw_overexposed") # text="Zebra"
col.itemR(st, "draw_safe_margin")
bpy.types.register(SEQUENCER_HT_header) # header/menu classes
bpy.types.register(SEQUENCER_MT_view)

@ -9,27 +9,28 @@ class TEXT_HT_header(bpy.types.Header):
text = st.text
layout = self.layout
layout.template_header()
row = layout.row(align=True)
row.template_header()
if context.area.show_menus:
row = layout.row()
row.itemM("TEXT_MT_text")
sub = row.row(align=True)
sub.itemM("TEXT_MT_text")
if text:
row.itemM("TEXT_MT_edit")
row.itemM("TEXT_MT_format")
sub.itemM("TEXT_MT_edit")
sub.itemM("TEXT_MT_format")
if text and text.modified:
row = layout.row()
# row.color(redalert)
row.itemO("text.resolve_conflict", text="", icon='ICON_HELP')
layout.template_ID(st, "text", new="text.new", unlink="text.unlink")
row = layout.row(align=True)
row.itemR(st, "line_numbers", text="")
row.itemR(st, "word_wrap", text="")
row.itemR(st, "syntax_highlight", text="")
layout.template_ID(st, "text", new="text.new", unlink="text.unlink")
if text:
row = layout.row()
if text.filename != "":
@ -123,6 +124,10 @@ class TEXT_MT_text(bpy.types.Menu):
# XXX if(BPY_is_pyconstraint(text))
# XXX uiMenuItemO(head, 0, "text.refresh_pyconstraints");
#endif
layout.itemS()
layout.itemO("text.properties", icon="ICON_MENU_PANEL")
#ifndef DISABLE_PYTHON
# XXX layout.column()
@ -219,7 +224,7 @@ class TEXT_MT_edit(bpy.types.Menu):
layout.itemS()
layout.itemO("text.jump")
layout.itemO("text.properties")
layout.itemO("text.properties", text="Find...")
layout.itemS()

@ -9,19 +9,21 @@ class TIME_HT_header(bpy.types.Header):
st = context.space_data
scene = context.scene
rd = context.scene.render_data
tools = context.tool_settings
screen = context.screen
layout.template_header()
row = layout.row(align=True)
row.template_header()
if context.area.show_menus:
row = layout.row()
#row.itemM("TIME_MT_view")
row.itemM("TIME_MT_frame")
row.itemM("TIME_MT_playback")
sub = row.row(align=True)
sub.itemM("TIME_MT_view")
sub.itemM("TIME_MT_frame")
sub.itemM("TIME_MT_playback")
layout.itemR(scene, "use_preview_range", text="PR", toggle=True)
layout.itemS()
row = layout.row(align=True)
if not scene.use_preview_range:
row.itemR(scene, "start_frame", text="Start")
@ -30,27 +32,41 @@ class TIME_HT_header(bpy.types.Header):
row.itemR(scene, "preview_range_start_frame", text="Start")
row.itemR(scene, "preview_range_end_frame", text="End")
layout.itemS()
layout.itemR(scene, "current_frame")
layout.itemS()
# XXX: Pause Button
layout.itemR(scene, "current_frame", text="")
row = layout.row(align=True)
row.itemO("screen.frame_jump", text="", icon='ICON_REW')
row.itemO("screen.keyframe_jump", text="", icon='ICON_PREV_KEYFRAME')
row.item_booleanO("screen.animation_play", "reverse", True, text="", icon='ICON_PLAY_REVERSE')
row.itemO("screen.animation_play", text="", icon='ICON_PLAY')
row.item_booleanO("screen.frame_jump", "end", False, text="", icon='ICON_REW')
row.item_booleanO("screen.keyframe_jump", "next", False, text="", icon='ICON_PREV_KEYFRAME')
if not screen.animation_playing:
row.item_booleanO("screen.animation_play", "reverse", True, text="", icon='ICON_PLAY_REVERSE')
row.itemO("screen.animation_play", text="", icon='ICON_PLAY')
else:
sub = row.row()
sub.scale_x = 2.0
sub.itemO("screen.animation_play", text="", icon='ICON_PAUSE')
row.item_booleanO("screen.keyframe_jump", "next", True, text="", icon='ICON_NEXT_KEYFRAME')
row.item_booleanO("screen.frame_jump", "end", True, text="", icon='ICON_FF')
layout.itemR(scene, "active_keyingset")
layout.itemR(rd, "sync_audio", text="", toggle=True, icon='ICON_SPEAKER')
layout.itemS()
row = layout.row(align=True)
row.itemR(tools, "enable_auto_key", text="", toggle=True, icon='ICON_REC')
sub = row.row()
sub.active = tools.enable_auto_key
sub.itemR(tools, "autokey_mode", text="")
if screen.animation_playing and tools.enable_auto_key:
subsub = row.row()
subsub.itemR(tools, "record_with_nla", toggle=True)
layout.itemS()
row = layout.row(align=True)
row.itemR(scene, "active_keying_set", text="")
row.itemO("anim.insert_keyframe", text="", icon="ICON_KEY_HLT")
row.itemO("anim.delete_keyframe", text="", icon="ICON_KEY_DEHLT")
"""
class TIME_MT_view(bpy.types.Menu):
__space_type__ = "TIMELINE"
__label__ = "View"
@ -59,8 +75,12 @@ class TIME_MT_view(bpy.types.Menu):
layout = self.layout
st = context.space_data
"""
layout.itemO("anim.time_toggle")
layout.itemS()
layout.itemR(st, "only_selected")
class TIME_MT_frame(bpy.types.Menu):
__space_type__ = "TIMELINE"
@ -80,7 +100,6 @@ class TIME_MT_frame(bpy.types.Menu):
layout.itemO("time.start_frame_set")
layout.itemO("time.end_frame_set")
class TIME_MT_playback(bpy.types.Menu):
__space_type__ = "TIMELINE"
__label__ = "Playback"
@ -89,21 +108,17 @@ class TIME_MT_playback(bpy.types.Menu):
layout = self.layout
st = context.space_data
time = st.XXX #ToDo
layout.itemR(time, "play_top_left")
layout.itemR(time, "play_all_3d")
layout.itemR(time, "play_anim")
layout.itemR(time, "play_buttons")
layout.itemR(time, "play_image")
layout.itemR(time, "play_sequencer")
layout.itemR(st, "play_top_left")
layout.itemR(st, "play_all_3d")
layout.itemR(st, "play_anim")
layout.itemR(st, "play_buttons")
layout.itemR(st, "play_image")
layout.itemR(st, "play_sequencer")
layout.itemS()
layout.itemR(time, "continue_physics")
layout.itemR(st, "continue_physics")
bpy.types.register(TIME_HT_header)
#bpy.types.register(TIME_MT_view)
bpy.types.register(TIME_MT_view)
bpy.types.register(TIME_MT_frame)
bpy.types.register(TIME_MT_playback)

@ -0,0 +1,418 @@
import bpy
class USERPREF_HT_header(bpy.types.Header):
__space_type__ = "USER_PREFERENCES"
def draw(self, context):
layout = self.layout
layout.template_header(menus=False)
class USERPREF_MT_view(bpy.types.Menu):
__space_type__ = "USER_PREFERENCES"
__label__ = "View"
def draw(self, context):
layout = self.layout
class USERPREF_PT_tabs(bpy.types.Panel):
__space_type__ = "USER_PREFERENCES"
__show_header__ = False
def draw(self, context):
layout = self.layout
userpref = context.user_preferences
layout.itemR(userpref, "active_section", expand=True)
class USERPREF_PT_view(bpy.types.Panel):
__space_type__ = "USER_PREFERENCES"
__label__ = "View"
__show_header__ = False
def poll(self, context):
userpref = context.user_preferences
return (userpref.active_section == 'VIEW_CONTROLS')
def draw(self, context):
layout = self.layout
userpref = context.user_preferences
view = userpref.view
split = layout.split()
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
sub1.itemL(text="Display:")
sub1.itemR(view, "tooltips")
sub1.itemR(view, "display_object_info", text="Object Info")
sub1.itemR(view, "use_large_cursors")
sub1.itemR(view, "show_view_name", text="View Name")
sub1.itemR(view, "show_playback_fps", text="Playback FPS")
sub1.itemR(view, "global_scene")
sub1.itemR(view, "pin_floating_panels")
sub1.itemR(view, "object_center_size")
sub1.itemS()
sub1.itemS()
sub1.itemS()
sub1.itemR(view, "show_mini_axis")
sub2 = sub1.column()
sub2.enabled = view.show_mini_axis
sub2.itemR(view, "mini_axis_size")
sub2.itemR(view, "mini_axis_brightness")
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
sub1.itemL(text="View Manipulation:")
sub1.itemR(view, "auto_depth")
sub1.itemR(view, "global_pivot")
sub1.itemR(view, "zoom_to_mouse")
sub1.itemR(view, "rotate_around_selection")
sub1.itemS()
sub1.itemL(text="Zoom Style:")
sub1.row().itemR(view, "viewport_zoom_style", expand=True)
sub1.itemL(text="Orbit Style:")
sub1.row().itemR(view, "view_rotation", expand=True)
sub1.itemR(view, "perspective_orthographic_switch")
sub1.itemR(view, "smooth_view")
sub1.itemR(view, "rotation_angle")
sub1.itemS()
sub1.itemL(text="NDOF Device:")
sub1.itemR(view, "ndof_pan_speed", text="Pan Speed")
sub1.itemR(view, "ndof_rotate_speed", text="Orbit Speed")
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
sub1.itemL(text="Mouse Buttons:")
sub1.itemR(view, "left_mouse_button_select")
sub1.itemR(view, "right_mouse_button_select")
sub1.itemR(view, "emulate_3_button_mouse")
sub1.itemR(view, "use_middle_mouse_paste")
sub1.itemR(view, "middle_mouse_rotate")
sub1.itemR(view, "middle_mouse_pan")
sub1.itemR(view, "wheel_invert_zoom")
sub1.itemR(view, "wheel_scroll_lines")
sub1.itemS()
sub1.itemS()
sub1.itemS()
sub1.itemL(text="Menus:")
sub1.itemR(view, "open_mouse_over")
sub1.itemL(text="Menu Open Delay:")
sub1.itemR(view, "open_toplevel_delay", text="Top Level")
sub1.itemR(view, "open_sublevel_delay", text="Sub Level")
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
#manipulator
sub1.itemR(view, "use_manipulator")
sub2 = sub1.column()
sub2.enabled = view.use_manipulator
sub2.itemR(view, "manipulator_size", text="Size")
sub2.itemR(view, "manipulator_handle_size", text="Handle Size")
sub2.itemR(view, "manipulator_hotspot", text="Hotspot")
sub1.itemS()
sub1.itemS()
sub1.itemS()
sub1.itemL(text="Toolbox:")
sub1.itemR(view, "use_column_layout")
sub1.itemL(text="Open Toolbox Delay:")
sub1.itemR(view, "open_left_mouse_delay", text="Hold LMB")
sub1.itemR(view, "open_right_mouse_delay", text="Hold RMB")
class USERPREF_PT_edit(bpy.types.Panel):
__space_type__ = "USER_PREFERENCES"
__label__ = "Edit"
__show_header__ = False
def poll(self, context):
userpref = context.user_preferences
return (userpref.active_section == 'EDIT_METHODS')
def draw(self, context):
layout = self.layout
userpref = context.user_preferences
edit = userpref.edit
view = userpref.view
split = layout.split()
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
sub1.itemL(text="Materials:")
sub1.itemR(edit, "material_linked_object", text="Linked to Object")
sub1.itemR(edit, "material_linked_obdata", text="Linked to ObData")
sub1.itemS()
sub1.itemS()
sub1.itemS()
sub1.itemL(text="New Objects:")
sub1.itemR(edit, "enter_edit_mode")
sub1.itemR(edit, "align_to_view")
sub1.itemS()
sub1.itemS()
sub1.itemS()
sub1.itemL(text="Transform:")
sub1.itemR(edit, "drag_immediately")
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
sub1.itemL(text="Snap:")
sub1.itemR(edit, "snap_translate", text="Translate")
sub1.itemR(edit, "snap_rotate", text="Rotate")
sub1.itemR(edit, "snap_scale", text="Scale")
sub1.itemS()
sub1.itemS()
sub1.itemS()
sub1.itemL(text="Grease Pencil:")
sub1.itemR(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance")
sub1.itemR(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance")
sub1.itemR(edit, "grease_pencil_smooth_stroke", text="Smooth Stroke")
# sub1.itemR(edit, "grease_pencil_simplify_stroke", text="Simplify Stroke")
sub1.itemR(edit, "grease_pencil_eraser_radius", text="Eraser Radius")
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
sub1.itemL(text="Keyframing:")
sub1.itemR(edit, "use_visual_keying")
sub1.itemR(edit, "new_interpolation_type")
sub1.itemS()
sub1.itemR(edit, "auto_keying_enable", text="Auto Keyframing")
sub2 = sub1.column()
sub2.enabled = edit.auto_keying_enable
sub2.row().itemR(edit, "auto_keying_mode", expand=True)
sub2.itemR(edit, "auto_keyframe_insert_available", text="Only Insert Available")
sub2.itemR(edit, "auto_keyframe_insert_needed", text="Only Insert Needed")
sub1.itemS()
sub1.itemS()
sub1.itemS()
sub1.itemL(text="Undo:")
sub1.itemR(edit, "global_undo")
sub1.itemR(edit, "undo_steps", text="Steps")
sub1.itemR(edit, "undo_memory_limit", text="Memory Limit")
sub1.itemS()
sub1.itemS()
sub1.itemS()
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
sub1.itemL(text="Duplicate:")
sub1.itemR(edit, "duplicate_mesh", text="Mesh")
sub1.itemR(edit, "duplicate_surface", text="Surface")
sub1.itemR(edit, "duplicate_curve", text="Curve")
sub1.itemR(edit, "duplicate_text", text="Text")
sub1.itemR(edit, "duplicate_metaball", text="Metaball")
sub1.itemR(edit, "duplicate_armature", text="Armature")
sub1.itemR(edit, "duplicate_lamp", text="Lamp")
sub1.itemR(edit, "duplicate_material", text="Material")
sub1.itemR(edit, "duplicate_texture", text="Texture")
sub1.itemR(edit, "duplicate_ipo", text="F-Curve")
sub1.itemR(edit, "duplicate_action", text="Action")
class USERPREF_PT_system(bpy.types.Panel):
__space_type__ = "USER_PREFERENCES"
__label__ = "System"
__show_header__ = False
def poll(self, context):
userpref = context.user_preferences
return (userpref.active_section == 'SYSTEM_OPENGL')
def draw(self, context):
layout = self.layout
userpref = context.user_preferences
system = userpref.system
lan = userpref.language
split = layout.split()
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
sub1.itemR(system, "emulate_numpad")
sub1.itemS()
sub1.itemS()
#Weight Colors
sub1.itemL(text="Weight Colors:")
sub1.itemR(system, "use_weight_color_range", text="Use Custom Range")
sub2 = sub1.column()
sub2.active = system.use_weight_color_range
sub2.template_color_ramp(system.weight_color_range, expand=True)
sub1.itemS()
sub1.itemS()
#sequencer
sub1.itemL(text="Sequencer:")
sub1.itemR(system, "prefetch_frames")
sub1.itemR(system, "memory_cache_limit")
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub .column()
#System
sub1.itemL(text="System:")
sub1.itemR(lan, "dpi")
sub1.itemR(system, "auto_run_python_scripts")
sub1.itemR(system, "frame_server_port")
sub1.itemR(system, "filter_file_extensions")
sub1.itemR(system, "hide_dot_files_datablocks")
sub1.itemR(lan, "scrollback", text="Console Scrollback")
sub1.itemS()
sub1.itemS()
sub1.itemL(text="Sound:")
sub1.itemR(system, "audio_device")
sub2 = sub1.column()
sub2.active = system.audio_device != 'AUDIO_DEVICE_NULL'
sub2.itemR(system, "enable_all_codecs")
sub2.itemR(system, "game_sound")
sub2.itemR(system, "audio_channels")
sub2.itemR(system, "audio_mixing_buffer")
sub2.itemR(system, "audio_sample_rate")
sub2.itemR(system, "audio_sample_format")
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
#OpenGL
sub1.itemL(text="OpenGL:")
sub1.itemR(system, "clip_alpha", slider=True)
sub1.itemR(system, "use_mipmaps")
sub1.itemL(text="Window Draw Method:")
sub1.row().itemR(system, "window_draw_method", expand=True)
sub1.itemL(text="Textures:")
sub1.itemR(system, "gl_texture_limit", text="Limit Size")
sub1.itemR(system, "texture_time_out", text="Time Out")
sub1.itemR(system, "texture_collection_rate", text="Collection Rate")
class USERPREF_PT_filepaths(bpy.types.Panel):
__space_type__ = "USER_PREFERENCES"
__label__ = "File Paths"
__show_header__ = False
def poll(self, context):
userpref = context.user_preferences
return (userpref.active_section == 'FILE_PATHS')
def draw(self, context):
layout = self.layout
userpref = context.user_preferences
paths = userpref.filepaths
split = layout.split()
col = split.column()
col.itemL(text="File Paths:")
sub = col.split(percentage=0.3)
sub.itemL(text="Fonts:")
sub.itemR(paths, "fonts_directory", text="")
sub = col.split(percentage=0.3)
sub.itemL(text="Textures:")
sub.itemR(paths, "textures_directory", text="")
sub = col.split(percentage=0.3)
sub.itemL(text="Texture Plugins:")
sub.itemR(paths, "texture_plugin_directory", text="")
sub = col.split(percentage=0.3)
sub.itemL(text="Sequence Plugins:")
sub.itemR(paths, "sequence_plugin_directory", text="")
sub = col.split(percentage=0.3)
sub.itemL(text="Render Output:")
sub.itemR(paths, "render_output_directory", text="")
sub = col.split(percentage=0.3)
sub.itemL(text="Scripts:")
sub.itemR(paths, "python_scripts_directory", text="")
sub = col.split(percentage=0.3)
sub.itemL(text="Sounds:")
sub.itemR(paths, "sounds_directory", text="")
sub = col.split(percentage=0.3)
sub.itemL(text="Temp:")
sub.itemR(paths, "temporary_directory", text="")
col = split.column()
sub = col.split(percentage=0.2)
sub1 = sub.column()
sub2 = sub.column()
sub2.itemL(text="Save & Load:")
sub2.itemR(paths, "use_relative_paths")
sub2.itemR(paths, "compress_file")
sub2.itemL(text="Auto Save:")
sub2.itemR(paths, "save_version")
sub2.itemR(paths, "recent_files")
sub2.itemR(paths, "save_preview_images")
sub2.itemR(paths, "auto_save_temporary_files")
sub3 = sub2.column()
sub3.enabled = paths.auto_save_temporary_files
sub3.itemR(paths, "auto_save_time")
class USERPREF_PT_language(bpy.types.Panel):
__space_type__ = "USER_PREFERENCES"
__label__ = "Language"
__show_header__ = False
def poll(self, context):
userpref = context.user_preferences
return (userpref.active_section == 'LANGUAGE_COLORS')
def draw(self, context):
layout = self.layout
userpref = context.user_preferences
lan = userpref.language
split = layout.split()
col = split.column()
col.itemR(lan, "language")
col.itemR(lan, "translate_tooltips")
col.itemR(lan, "translate_buttons")
col.itemR(lan, "translate_toolbox")
col.itemR(lan, "use_textured_fonts")
class USERPREF_PT_bottombar(bpy.types.Panel):
__space_type__ = "USER_PREFERENCES"
__label__ = " "
__show_header__ = False
def draw(self, context):
layout = self.layout
userpref = context.user_preferences
split = layout.split(percentage=0.8)
split.itemL(text="")
layout.operator_context = "EXEC_AREA"
split.itemO("wm.save_homefile", text="Save As Default")
bpy.types.register(USERPREF_HT_header)
bpy.types.register(USERPREF_MT_view)
bpy.types.register(USERPREF_PT_tabs)
bpy.types.register(USERPREF_PT_view)
bpy.types.register(USERPREF_PT_edit)
bpy.types.register(USERPREF_PT_system)
bpy.types.register(USERPREF_PT_filepaths)
bpy.types.register(USERPREF_PT_language)
bpy.types.register(USERPREF_PT_bottombar)

@ -1,45 +1,44 @@
import bpy
# ********** Header ****************
# ********** Header **********
class VIEW3D_HT_header(bpy.types.Header):
__space_type__ = "VIEW_3D"
def draw(self, context):
layout = self.layout
view = context.space_data
mode_string = context.mode
edit_object = context.edit_object
row = layout.row(align=True)
row.template_header()
layout.template_header()
# menus
# Menus
if context.area.show_menus:
row = layout.row()
row.itemM("VIEW3D_MT_view")
sub = row.row(align=True)
sub.itemM("VIEW3D_MT_view")
# Select Menu
if mode_string not in ('EDIT_TEXT', 'SCULPT', 'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE', 'PARTICLE'):
# XXX: Particle Mode has Select Menu.
sub.itemM("VIEW3D_MT_select_%s" % mode_string)
if mode_string == 'OBJECT':
sub.itemM("VIEW3D_MT_object")
elif mode_string == 'SCULPT':
sub.itemM("VIEW3D_MT_sculpt")
elif edit_object:
sub.itemM("VIEW3D_MT_edit_%s" % edit_object.type)
layout.template_header_3D()
# ********** Menu ****************
# ********** Menu **********
class VIEW3D_MT_view_navigation(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Navigation"
def draw(self, context):
layout = self.layout
# layout.itemO("view3d.view_fly_mode")
# layout.itemS()
layout.items_enumO("view3d.view_orbit", "type")
layout.itemS()
layout.items_enumO("view3d.view_pan", "type")
layout.itemS()
layout.item_floatO("view3d.zoom", "delta", 1.0, text="Zoom In")
layout.item_floatO("view3d.zoom", "delta", -1.0, text="Zoom Out")
# ********** View menus **********
class VIEW3D_MT_view(bpy.types.Menu):
__space_type__ = "VIEW_3D"
@ -94,8 +93,848 @@ class VIEW3D_MT_view(bpy.types.Menu):
layout.itemO("screen.region_foursplit", text="Toggle Quad View")
layout.itemO("screen.screen_full_area", text="Toggle Full Screen")
class VIEW3D_MT_view_navigation(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Navigation"
# ********** Panel ****************
def draw(self, context):
layout = self.layout
# layout.itemO("view3d.view_fly_mode")
# layout.itemS()
layout.items_enumO("view3d.view_orbit", "type")
layout.itemS()
layout.items_enumO("view3d.view_pan", "type")
layout.itemS()
layout.item_floatO("view3d.zoom", "delta", 1.0, text="Zoom In")
layout.item_floatO("view3d.zoom", "delta", -1.0, text="Zoom Out")
# ********** Select menus, suffix from context.mode **********
class VIEW3D_MT_select_OBJECT(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Select"
def draw(self, context):
layout = self.layout
layout.itemO("view3d.select_border")
layout.itemS()
layout.itemO("object.select_all_toggle", text="Select/Deselect All")
layout.itemO("object.select_inverse", text="Inverse")
layout.itemO("object.select_random", text="Random")
layout.itemO("object.select_by_layer", text="Select All by Layer")
layout.item_enumO("object.select_by_type", "type", "", text="Select All by Type")
layout.itemO("object.select_grouped", text="Select Grouped")
class VIEW3D_MT_select_POSE(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Select"
def draw(self, context):
layout = self.layout
layout.itemO("view3d.select_border")
layout.itemS()
layout.itemO("pose.select_all_toggle", text="Select/Deselect All")
layout.itemO("pose.select_inverse", text="Inverse")
layout.itemO("pose.select_constraint_target", text="Constraint Target")
layout.itemS()
layout.item_enumO("pose.select_hierarchy", "direction", 'PARENT')
layout.item_enumO("pose.select_hierarchy", "direction", 'CHILD')
layout.itemS()
layout.view3d_select_posemenu()
class VIEW3D_MT_select_PARTICLE(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Select"
def draw(self, context):
layout = self.layout
layout.itemO("view3d.select_border")
layout.itemS()
layout.itemO("particle.select_all_toggle", text="Select/Deselect All")
layout.itemO("particle.select_linked")
layout.itemS()
#layout.itemO("particle.select_last")
#layout.itemO("particle.select_first")
layout.itemO("particle.select_more")
layout.itemO("particle.select_less")
class VIEW3D_MT_select_EDIT_MESH(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Select"
def draw(self, context):
layout = self.layout
layout.itemO("view3d.select_border")
layout.itemS()
layout.itemO("mesh.select_all_toggle", text="Select/Deselect All")
layout.itemO("mesh.select_inverse", text="Inverse")
layout.itemS()
layout.itemO("mesh.select_random", text="Random...")
layout.itemO("mesh.edges_select_sharp", text="Sharp Edges")
layout.itemO("mesh.faces_select_linked_flat", text="Linked Flat Faces")
layout.itemS()
layout.item_enumO("mesh.select_by_number_vertices", "type", 'TRIANGLES', text="Triangles")
layout.item_enumO("mesh.select_by_number_vertices", "type", 'QUADS', text="Quads")
layout.item_enumO("mesh.select_by_number_vertices", "type", 'OTHER', text="Loose Verts/Edges")
layout.itemO("mesh.select_similar", text="Similar...")
layout.itemS()
layout.itemO("mesh.select_less", text="Less")
layout.itemO("mesh.select_more", text="More")
layout.itemS()
layout.itemO("mesh.select_linked", text="Linked")
layout.itemO("mesh.select_vertex_path", text="Vertex Path")
layout.itemO("mesh.loop_multi_select", text="Edge Loop")
layout.item_booleanO("mesh.loop_multi_select", "ring", True, text="Edge Ring")
layout.itemS()
layout.itemO("mesh.loop_to_region")
layout.itemO("mesh.region_to_loop")
class VIEW3D_MT_select_EDIT_CURVE(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Select"
def draw(self, context):
layout = self.layout
layout.itemO("view3d.select_border")
layout.itemO("view3d.select_circle")
layout.itemS()
layout.itemO("curve.select_all_toggle", text="Select/Deselect All")
layout.itemO("curve.select_inverse")
layout.itemO("curve.select_random")
layout.itemO("curve.select_every_nth")
layout.itemS()
layout.itemO("curve.de_select_first")
layout.itemO("curve.de_select_last")
layout.itemO("curve.select_next")
layout.itemO("curve.select_previous")
layout.itemS()
layout.itemO("curve.select_more")
layout.itemO("curve.select_less")
class VIEW3D_MT_select_EDIT_SURFACE(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Select"
def draw(self, context):
layout = self.layout
layout.itemO("view3d.select_border")
layout.itemO("view3d.select_circle")
layout.itemS()
layout.itemO("curve.select_all_toggle", text="Select/Deselect All")
layout.itemO("curve.select_inverse")
layout.itemO("curve.select_random")
layout.itemO("curve.select_every_nth")
layout.itemS()
layout.itemO("curve.select_row")
layout.itemS()
layout.itemO("curve.select_more")
layout.itemO("curve.select_less")
class VIEW3D_MT_select_EDIT_METABALL(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Select"
def draw(self, context):
layout = self.layout
layout.itemO("view3d.select_border")
layout.itemS()
layout.itemL(text="Select/Deselect All")
layout.itemL(text="Inverse")
layout.itemS()
layout.itemL(text="Random")
class VIEW3D_MT_select_EDIT_LATTICE(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Select"
def draw(self, context):
layout = self.layout
layout.itemO("view3d.select_border")
layout.itemS()
layout.itemO("lattice.select_all_toggle", text="Select/Deselect All")
class VIEW3D_MT_select_EDIT_ARMATURE(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Select"
def draw(self, context):
layout = self.layout
layout.itemO("view3d.select_border")
layout.itemS()
layout.itemO("armature.select_all_toggle", text="Select/Deselect All")
layout.itemO("armature.select_inverse", text="Inverse")
layout.itemS()
layout.item_enumO("armature.select_hierarchy", "direction", 'PARENT')
layout.item_enumO("armature.select_hierarchy", "direction", 'CHILD')
layout.itemS()
layout.view3d_select_armaturemenu()
class VIEW3D_MT_select_FACE(bpy.types.Menu):# XXX no matching enum
__space_type__ = "VIEW_3D"
__label__ = "Select"
def draw(self, context):
layout = self.layout
layout.view3d_select_faceselmenu()
# ********** Object menu **********
class VIEW3D_MT_object(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__context__ = "objectmode"
__label__ = "Object"
def draw(self, context):
layout = self.layout
layout.itemM("VIEW3D_MT_object_clear")
layout.itemM("VIEW3D_MT_object_snap")
layout.itemS()
layout.itemO("anim.insert_keyframe_menu")
layout.itemO("anim.delete_keyframe_v3d")
layout.itemS()
layout.itemO("object.duplicate")
layout.item_booleanO("object.duplicate", "linked", True, text="Duplicate Linked")
layout.itemO("object.delete")
layout.itemO("object.proxy_make")
layout.itemS()
layout.itemM("VIEW3D_MT_object_parent")
layout.itemM("VIEW3D_MT_object_track")
layout.itemM("VIEW3D_MT_object_group")
layout.itemM("VIEW3D_MT_object_constraints")
layout.itemS()
layout.itemO("object.join")
layout.itemS()
layout.itemM("VIEW3D_MT_object_show")
class VIEW3D_MT_object_clear(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Clear"
def draw(self, context):
layout = self.layout
layout.itemO("object.location_clear")
layout.itemO("object.rotation_clear")
layout.itemO("object.scale_clear")
layout.itemO("object.origin_clear")
class VIEW3D_MT_object_snap(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Snap"
def draw(self, context):
layout = self.layout
layout.itemO("view3d.snap_selected_to_grid")
layout.itemO("view3d.snap_selected_to_cursor")
layout.itemO("view3d.snap_selected_to_center")
layout.itemS()
layout.itemO("view3d.snap_cursor_to_selected")
layout.itemO("view3d.snap_cursor_to_grid")
layout.itemO("view3d.snap_cursor_to_active")
class VIEW3D_MT_object_parent(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Parent"
def draw(self, context):
layout = self.layout
layout.itemO("object.parent_set")
layout.itemO("object.parent_clear")
class VIEW3D_MT_object_track(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Track"
def draw(self, context):
layout = self.layout
layout.itemO("object.track_set")
layout.itemO("object.track_clear")
class VIEW3D_MT_object_group(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Group"
def draw(self, context):
layout = self.layout
layout.itemO("group.group_create")
layout.itemO("group.objects_remove")
layout.itemS()
layout.itemO("group.objects_add_active")
layout.itemO("group.objects_remove_active")
class VIEW3D_MT_object_constraints(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Constraints"
def draw(self, context):
layout = self.layout
layout.itemO("object.constraint_add_with_targets")
layout.itemO("object.constraints_clear")
class VIEW3D_MT_object_show(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Show/Hide"
def draw(self, context):
layout = self.layout
layout.itemO("object.restrictview_clear")
layout.itemO("object.restrictview_set")
layout.item_booleanO("object.restrictview_set", "unselected", True, text="Hide Unselected")
# ********** Sculpt menu **********
class VIEW3D_MT_sculpt(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Sculpt"
def draw(self, context):
layout = self.layout
sculpt = context.tool_settings.sculpt
brush = context.tool_settings.sculpt.brush
layout.itemR(sculpt, "symmetry_x")
layout.itemR(sculpt, "symmetry_y")
layout.itemR(sculpt, "symmetry_z")
layout.itemS()
layout.itemR(sculpt, "lock_x")
layout.itemR(sculpt, "lock_y")
layout.itemR(sculpt, "lock_z")
layout.itemS()
layout.item_menu_enumO("brush.curve_preset", property="shape")
layout.itemS()
if brush.sculpt_tool != 'GRAB':
layout.itemR(brush, "airbrush")
if brush.sculpt_tool != 'LAYER':
layout.itemR(brush, "anchored")
if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'):
layout.itemR(brush, "flip_direction")
if brush.sculpt_tool == 'LAYER':
layout.itemR(brush, "persistent")
layout.itemO("sculpt.set_persistent_base")
# ********** Edit Menus, suffix from ob.type **********
class VIEW3D_MT_edit_snap(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Snap"
def draw(self, context):
layout = self.layout
layout.itemO("view3d.snap_selected_to_grid")
layout.itemO("view3d.snap_selected_to_cursor")
layout.itemO("view3d.snap_selected_to_center")
layout.itemS()
layout.itemO("view3d.snap_cursor_to_selected")
layout.itemO("view3d.snap_cursor_to_grid")
layout.itemO("view3d.snap_cursor_to_active")
# Edit MESH
class VIEW3D_MT_edit_MESH(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Mesh"
def draw(self, context):
layout = self.layout
settings = context.tool_settings
layout.itemO("ed.undo")
layout.itemO("ed.redo")
layout.itemS()
layout.itemM("VIEW3D_MT_edit_snap")
layout.itemS()
layout.itemO("uv.mapping_menu")
layout.itemS()
layout.itemO("mesh.extrude")
layout.itemO("mesh.duplicate")
layout.itemO("mesh.delete")
layout.itemS()
layout.itemM("VIEW3D_MT_edit_MESH_vertices")
layout.itemM("VIEW3D_MT_edit_MESH_edges")
layout.itemM("VIEW3D_MT_edit_MESH_faces")
layout.itemM("VIEW3D_MT_edit_MESH_normals")
layout.itemS()
layout.itemR(settings, "automerge_editing")
layout.itemR(settings, "proportional_editing")
layout.item_menu_enumR(settings, "proportional_editing_falloff")
layout.itemS()
layout.itemM("VIEW3D_MT_edit_MESH_showhide")
class VIEW3D_MT_edit_MESH_vertices(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Vertices"
def draw(self, context):
layout = self.layout
layout.itemO("mesh.merge")
layout.itemO("mesh.rip")
layout.itemO("mesh.split")
layout.itemO("mesh.separate")
layout.itemS()
layout.itemO("mesh.vertices_smooth")
layout.itemO("mesh.remove_doubles")
class VIEW3D_MT_edit_MESH_edges(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Edges"
def draw(self, context):
layout = self.layout
layout.itemO("mesh.edge_face_add")
layout.itemO("mesh.subdivide")
layout.item_floatO("mesh.subdivide", "smoothness", 1.0, text="Subdivide Smooth")
layout.itemS()
layout.itemO("mesh.mark_seam")
layout.item_booleanO("mesh.mark_seam", "clear", True, text="Clear Seam")
layout.itemS()
layout.itemO("mesh.mark_sharp")
layout.item_booleanO("mesh.mark_sharp", "clear", True, text="Clear Sharp")
layout.itemS()
layout.item_enumO("mesh.edge_rotate", "direction", 'CW', text="Rotate Edge CW")
layout.item_enumO("mesh.edge_rotate", "direction", 'CCW', text="Rotate Edge CCW")
class VIEW3D_MT_edit_MESH_faces(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Faces"
def draw(self, context):
layout = self.layout
layout.itemO("mesh.edge_face_add")
layout.itemO("mesh.fill")
layout.itemO("mesh.beauty_fill")
layout.itemS()
layout.itemO("mesh.quads_convert_to_tris")
layout.itemO("mesh.tris_convert_to_quads")
layout.itemO("mesh.edge_flip")
layout.itemS()
layout.itemO("mesh.faces_shade_smooth")
layout.itemO("mesh.faces_shade_flat")
class VIEW3D_MT_edit_MESH_normals(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Normals"
def draw(self, context):
layout = self.layout
layout.itemO("mesh.normals_make_consistent", text="Recalculate Outside")
layout.item_booleanO("mesh.normals_make_consistent", "inside", True, text="Recalculate Inside")
layout.itemS()
layout.itemO("mesh.flip_normals")
class VIEW3D_MT_edit_MESH_showhide(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Show/Hide"
def draw(self, context):
layout = self.layout
layout.itemO("mesh.reveal")
layout.itemO("mesh.hide")
layout.item_booleanO("mesh.hide", "unselected", True, text="Hide Unselected")
# Edit CURVE
# draw_CURVE is used by VIEW3D_MT_edit_CURVE and VIEW3D_MT_edit_SURFACE
def draw_CURVE(self, context):
layout = self.layout
settings = context.tool_settings
layout.itemM("VIEW3D_MT_edit_snap")
layout.itemS()
layout.itemO("curve.extrude")
layout.itemO("curve.duplicate")
layout.itemO("curve.separate")
layout.itemO("curve.make_segment")
layout.itemO("curve.cyclic_toggle")
layout.itemO("curve.delete")
layout.itemS()
layout.itemM("VIEW3D_MT_edit_CURVE_ctrlpoints")
layout.itemM("VIEW3D_MT_edit_CURVE_segments")
layout.itemS()
layout.itemR(settings, "proportional_editing")
layout.item_menu_enumR(settings, "proportional_editing_falloff")
layout.itemS()
layout.itemM("VIEW3D_MT_edit_CURVE_showhide")
class VIEW3D_MT_edit_CURVE(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Curve"
draw = draw_CURVE
class VIEW3D_MT_edit_CURVE_ctrlpoints(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Control Points"
def draw(self, context):
layout = self.layout
edit_object = context.edit_object
if edit_object.type == 'CURVE':
layout.item_enumO("tfm.transform", "mode", 'TILT')
layout.itemO("curve.tilt_clear")
layout.itemO("curve.separate")
layout.itemS()
layout.item_menu_enumO("curve.handle_type_set", "type")
class VIEW3D_MT_edit_CURVE_segments(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Segments"
def draw(self, context):
layout = self.layout
layout.itemO("curve.subdivide")
layout.itemO("curve.switch_direction")
class VIEW3D_MT_edit_CURVE_showhide(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Show/Hide"
def draw(self, context):
layout = self.layout
layout.itemO("curve.reveal")
layout.itemO("curve.hide")
layout.item_booleanO("curve.hide", "unselected", True, text="Hide Unselected")
# Edit SURFACE
class VIEW3D_MT_edit_SURFACE(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Surface"
draw = draw_CURVE
# Edit TEXT
class VIEW3D_MT_edit_TEXT(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Text"
def draw(self, context):
layout = self.layout
layout.itemO("font.file_paste")
layout.itemS()
layout.itemM("VIEW3D_MT_edit_TEXT_chars")
class VIEW3D_MT_edit_TEXT_chars(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Special Characters"
def draw(self, context):
layout = self.layout
layout.item_stringO("font.text_insert", "text", b'\xC2\xA9'.decode(), text="Copyright|Alt C")
layout.item_stringO("font.text_insert", "text", b'\xC2\xAE'.decode(), text="Registered Trademark|Alt R")
layout.itemS()
layout.item_stringO("font.text_insert", "text", b'\xC2\xB0'.decode(), text="Degree Sign|Alt G")
layout.item_stringO("font.text_insert", "text", b'\xC3\x97'.decode(), text="Multiplication Sign|Alt x")
layout.item_stringO("font.text_insert", "text", b'\xC2\x8A'.decode(), text="Circle|Alt .")
layout.item_stringO("font.text_insert", "text", b'\xC2\xB9'.decode(), text="Superscript 1|Alt 1")
layout.item_stringO("font.text_insert", "text", b'\xC2\xB2'.decode(), text="Superscript 2|Alt 2")
layout.item_stringO("font.text_insert", "text", b'\xC2\xB3'.decode(), text="Superscript 3|Alt 3")
layout.item_stringO("font.text_insert", "text", b'\xC2\xBB'.decode(), text="Double >>|Alt >")
layout.item_stringO("font.text_insert", "text", b'\xC2\xAB'.decode(), text="Double <<|Alt <")
layout.item_stringO("font.text_insert", "text", b'\xE2\x80\xB0'.decode(), text="Promillage|Alt %")
layout.itemS()
layout.item_stringO("font.text_insert", "text", b'\xC2\xA4'.decode(), text="Dutch Florin|Alt F")
layout.item_stringO("font.text_insert", "text", b'\xC2\xA3'.decode(), text="British Pound|Alt L")
layout.item_stringO("font.text_insert", "text", b'\xC2\xA5'.decode(), text="Japanese Yen|Alt Y")
layout.itemS()
layout.item_stringO("font.text_insert", "text", b'\xC3\x9F'.decode(), text="German S|Alt S")
layout.item_stringO("font.text_insert", "text", b'\xC2\xBF'.decode(), text="Spanish Question Mark|Alt ?")
layout.item_stringO("font.text_insert", "text", b'\xC2\xA1'.decode(), text="Spanish Exclamation Mark|Alt !")
# Edit META
class VIEW3D_MT_edit_META(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Metaball"
def draw(self, context):
layout = self.layout
settings = context.tool_settings
layout.itemO("ed.undo")
layout.itemO("ed.redo")
layout.itemS()
layout.itemM("VIEW3D_MT_edit_snap")
layout.itemS()
layout.itemO("mball.delete_metaelems")
layout.itemO("mball.duplicate_metaelems")
layout.itemS()
layout.itemR(settings, "proportional_editing")
layout.item_menu_enumR(settings, "proportional_editing_falloff")
layout.itemS()
layout.itemM("VIEW3D_MT_edit_META_showhide")
class VIEW3D_MT_edit_META_showhide(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Show/Hide"
def draw(self, context):
layout = self.layout
layout.itemO("mball.reveal_metaelems")
layout.itemO("mball.hide_metaelems")
layout.item_booleanO("mball.hide_metaelems", "unselected", True, text="Hide Unselected")
# Edit LATTICE
class VIEW3D_MT_edit_LATTICE(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Lattice"
def draw(self, context):
layout = self.layout
settings = context.tool_settings
layout.itemM("VIEW3D_MT_edit_snap")
layout.itemS()
layout.itemO("lattice.make_regular")
layout.itemS()
layout.itemR(settings, "proportional_editing")
layout.item_menu_enumR(settings, "proportional_editing_falloff")
# Edit ARMATURE
class VIEW3D_MT_edit_ARMATURE(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Armature"
def draw(self, context):
layout = self.layout
edit_object = context.edit_object
arm = edit_object.data
layout.itemM("VIEW3D_MT_edit_snap")
layout.itemM("VIEW3D_MT_edit_ARMATURE_roll")
if arm.drawtype == 'ENVELOPE':
layout.item_enumO("tfm.transform", "mode", 'BONESIZE', text="Scale Envelope Distance")
else:
layout.item_enumO("tfm.transform", "mode", 'BONESIZE', text="Scale B-Bone Width")
layout.itemS()
layout.itemO("armature.extrude")
if arm.x_axis_mirror:
layout.item_booleanO("armature.extrude", "forked", True, text="Extrude Forked")
layout.itemO("armature.duplicate")
layout.itemO("armature.merge")
layout.itemO("armature.fill")
layout.itemO("armature.delete")
layout.itemO("armature.separate")
layout.itemS()
layout.itemO("armature.subdivide_simple")
layout.itemO("armature.subdivide_multi")
layout.itemS()
layout.item_enumO("armature.autoside_names", "axis", 'XAXIS', text="AutoName Left/Right")
layout.item_enumO("armature.autoside_names", "axis", 'YAXIS', text="AutoName Front/Back")
layout.item_enumO("armature.autoside_names", "axis", 'ZAXIS', text="AutoName Top/Bottom")
layout.itemO("armature.flip_names")
layout.itemS()
layout.itemO("armature.armature_layers")
layout.itemO("armature.bone_layers")
layout.itemS()
layout.itemM("VIEW3D_MT_edit_ARMATURE_parent")
layout.itemS()
layout.item_menu_enumO("armature.flags_set", "mode", text="Bone Settings")
class VIEW3D_MT_edit_ARMATURE_parent(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Parent"
def draw(self, context):
layout = self.layout
layout.itemO("armature.parent_set")
layout.itemO("armature.parent_clear")
class VIEW3D_MT_edit_ARMATURE_roll(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Bone Roll"
def draw(self, context):
layout = self.layout
layout.item_enumO("armature.calculate_roll", "type", 'GLOBALUP', text="Clear Roll (Z-Axis Up)")
layout.item_enumO("armature.calculate_roll", "type", 'CURSOR', text="Roll to Cursor")
layout.itemS()
layout.item_enumO("tfm.transform", "mode", 'BONE_ROLL', text="Set Roll")
# ********** Panel **********
class VIEW3D_PT_3dview_properties(bpy.types.Panel):
__space_type__ = "VIEW_3D"
@ -198,9 +1037,61 @@ class VIEW3D_PT_background_image(bpy.types.Panel):
col.itemR(bg, "x_offset", text="X")
col.itemR(bg, "y_offset", text="Y")
bpy.types.register(VIEW3D_HT_header) # Header
bpy.types.register(VIEW3D_MT_view) #View Menus
bpy.types.register(VIEW3D_MT_view_navigation)
bpy.types.register(VIEW3D_MT_view)
bpy.types.register(VIEW3D_HT_header)
bpy.types.register(VIEW3D_PT_3dview_properties)
bpy.types.register(VIEW3D_MT_select_OBJECT) # Select Menus
bpy.types.register(VIEW3D_MT_select_POSE)
bpy.types.register(VIEW3D_MT_select_PARTICLE)
bpy.types.register(VIEW3D_MT_select_EDIT_MESH)
bpy.types.register(VIEW3D_MT_select_EDIT_CURVE)
bpy.types.register(VIEW3D_MT_select_EDIT_SURFACE)
bpy.types.register(VIEW3D_MT_select_EDIT_METABALL)
bpy.types.register(VIEW3D_MT_select_EDIT_LATTICE)
bpy.types.register(VIEW3D_MT_select_EDIT_ARMATURE)
bpy.types.register(VIEW3D_MT_select_FACE) # XXX todo
bpy.types.register(VIEW3D_MT_object) # Object Menu
bpy.types.register(VIEW3D_MT_object_clear)
bpy.types.register(VIEW3D_MT_object_snap)
bpy.types.register(VIEW3D_MT_object_parent)
bpy.types.register(VIEW3D_MT_object_track)
bpy.types.register(VIEW3D_MT_object_group)
bpy.types.register(VIEW3D_MT_object_constraints)
bpy.types.register(VIEW3D_MT_object_show)
bpy.types.register(VIEW3D_MT_sculpt) # Sculpt Menu
bpy.types.register(VIEW3D_MT_edit_snap) # Edit Menus
bpy.types.register(VIEW3D_MT_edit_MESH)
bpy.types.register(VIEW3D_MT_edit_MESH_vertices)
bpy.types.register(VIEW3D_MT_edit_MESH_edges)
bpy.types.register(VIEW3D_MT_edit_MESH_faces)
bpy.types.register(VIEW3D_MT_edit_MESH_normals)
bpy.types.register(VIEW3D_MT_edit_MESH_showhide)
bpy.types.register(VIEW3D_MT_edit_CURVE)
bpy.types.register(VIEW3D_MT_edit_CURVE_ctrlpoints)
bpy.types.register(VIEW3D_MT_edit_CURVE_segments)
bpy.types.register(VIEW3D_MT_edit_CURVE_showhide)
bpy.types.register(VIEW3D_MT_edit_SURFACE)
bpy.types.register(VIEW3D_MT_edit_TEXT)
bpy.types.register(VIEW3D_MT_edit_TEXT_chars)
bpy.types.register(VIEW3D_MT_edit_META)
bpy.types.register(VIEW3D_MT_edit_META_showhide)
bpy.types.register(VIEW3D_MT_edit_LATTICE)
bpy.types.register(VIEW3D_MT_edit_ARMATURE)
bpy.types.register(VIEW3D_MT_edit_ARMATURE_parent)
bpy.types.register(VIEW3D_MT_edit_ARMATURE_roll)
bpy.types.register(VIEW3D_PT_3dview_properties) # Panels
bpy.types.register(VIEW3D_PT_3dview_display)
bpy.types.register(VIEW3D_PT_background_image)

@ -1,14 +1,14 @@
import bpy
# ********** default tools for objectmode ****************
class View3DPanel(bpy.types.Panel):
__space_type__ = "VIEW_3D"
__region_type__ = "TOOLS"
__context__ = "objectmode"
# ********** default tools for objectmode ****************
class VIEW3D_PT_tools_objectmode(View3DPanel):
__context__ = "objectmode"
__label__ = "Object Tools"
def draw(self, context):
@ -43,12 +43,8 @@ class VIEW3D_PT_tools_objectmode(View3DPanel):
# ********** default tools for editmode_mesh ****************
class View3DPanel(bpy.types.Panel):
__space_type__ = "VIEW_3D"
__region_type__ = "TOOLS"
__context__ = "editmode_mesh"
class VIEW3D_PT_tools_editmode_mesh(View3DPanel):
class VIEW3D_PT_tools_meshedit(View3DPanel):
__context__ = "mesh_edit"
__label__ = "Mesh Tools"
def draw(self, context):
@ -90,12 +86,8 @@ class VIEW3D_PT_tools_editmode_mesh(View3DPanel):
# ********** default tools for editmode_curve ****************
class View3DPanel(bpy.types.Panel):
__space_type__ = "VIEW_3D"
__region_type__ = "TOOLS"
__context__ = "editmode_curve"
class VIEW3D_PT_tools_editmode_curve(View3DPanel):
class VIEW3D_PT_tools_curveedit(View3DPanel):
__context__ = "curve_edit"
__label__ = "Curve Tools"
def draw(self, context):
@ -124,12 +116,8 @@ class VIEW3D_PT_tools_editmode_curve(View3DPanel):
# ********** default tools for editmode_surface ****************
class View3DPanel(bpy.types.Panel):
__space_type__ = "VIEW_3D"
__region_type__ = "TOOLS"
__context__ = "editmode_surface"
class VIEW3D_PT_tools_editmode_surface(View3DPanel):
class VIEW3D_PT_tools_surfaceedit(View3DPanel):
__context__ = "surface_edit"
__label__ = "Surface Tools"
def draw(self, context):
@ -158,12 +146,8 @@ class VIEW3D_PT_tools_editmode_surface(View3DPanel):
# ********** default tools for editmode_text ****************
class View3DPanel(bpy.types.Panel):
__space_type__ = "VIEW_3D"
__region_type__ = "TOOLS"
__context__ = "editmode_text"
class VIEW3D_PT_tools_editmode_text(View3DPanel):
class VIEW3D_PT_tools_textedit(View3DPanel):
__context__ = "text_edit"
__label__ = "Text Tools"
def draw(self, context):
@ -179,12 +163,8 @@ class VIEW3D_PT_tools_editmode_text(View3DPanel):
# ********** default tools for editmode_armature ****************
class View3DPanel(bpy.types.Panel):
__space_type__ = "VIEW_3D"
__region_type__ = "TOOLS"
__context__ = "editmode_armature"
class VIEW3D_PT_tools_editmode_armature(View3DPanel):
class VIEW3D_PT_tools_armatureedit(View3DPanel):
__context__ = "armature_edit"
__label__ = "Armature Tools"
def draw(self, context):
@ -209,12 +189,8 @@ class VIEW3D_PT_tools_editmode_armature(View3DPanel):
# ********** default tools for editmode_mball ****************
class View3DPanel(bpy.types.Panel):
__space_type__ = "VIEW_3D"
__region_type__ = "TOOLS"
__context__ = "editmode_mball"
class VIEW3D_PT_tools_editmode_mball(View3DPanel):
class VIEW3D_PT_tools_mballedit(View3DPanel):
__context__ = "mball_edit"
__label__ = "Meta Tools"
def draw(self, context):
@ -229,12 +205,8 @@ class VIEW3D_PT_tools_editmode_mball(View3DPanel):
# ********** default tools for editmode_lattice ****************
class View3DPanel(bpy.types.Panel):
__space_type__ = "VIEW_3D"
__region_type__ = "TOOLS"
__context__ = "editmode_lattice"
class VIEW3D_PT_tools_editmode_lattice(View3DPanel):
class VIEW3D_PT_tools_latticeedit(View3DPanel):
__context__ = "lattice_edit"
__label__ = "Lattice Tools"
def draw(self, context):
@ -249,12 +221,8 @@ class VIEW3D_PT_tools_editmode_lattice(View3DPanel):
# ********** default tools for posemode ****************
class View3DPanel(bpy.types.Panel):
__space_type__ = "VIEW_3D"
__region_type__ = "TOOLS"
__context__ = "pose_mode"
class VIEW3D_PT_tools_posemode(View3DPanel):
__context__ = "posemode"
__label__ = "Pose Tools"
def draw(self, context):
@ -324,10 +292,14 @@ class VIEW3D_PT_tools_brush(PaintPanel):
settings = self.paint_settings(context)
brush = settings.brush
if not context.particle_edit_object:
layout.split().row().template_ID(settings, "brush")
col = layout.split().column()
row = col.row()
row.template_list(settings, "brushes", settings, "active_brush_index", rows=2)
col.template_ID(settings, "brush", new="brush.add")
# Particle Mode #
# XXX This needs a check if psys is editable.
@ -336,27 +308,28 @@ class VIEW3D_PT_tools_brush(PaintPanel):
layout.column().itemR(settings, "tool", expand=True)
if settings.tool != 'NONE':
col = layout.column(align=True)
col = layout.column()
col.itemR(brush, "size", slider=True)
col.itemR(brush, "strength", slider=True)
if settings.tool == 'ADD':
layout.itemR(settings, "add_interpolate")
col = layout.column()
col.itemR(brush, "steps", slider=True)
col.itemR(settings, "add_keys", slider=True)
col.itemR(settings, "add_interpolate")
sub = col.column(align=True)
sub.active = settings.add_interpolate
sub.itemR(brush, "steps", slider=True)
sub.itemR(settings, "add_keys", slider=True)
elif settings.tool == 'LENGTH':
layout.itemR(brush, "length_mode", expand=True)
elif settings.tool == 'PUFF':
layout.itemR(brush, "puff_mode", expand=True)
# Sculpt Mode #
elif context.sculpt_object:
layout.column().itemR(brush, "sculpt_tool", expand=True)
elif context.sculpt_object and settings.brush:
col = layout.column()
col.itemS()
row = col.row(align=True)
row.itemR(brush, "size", slider=True)
@ -368,7 +341,7 @@ class VIEW3D_PT_tools_brush(PaintPanel):
row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
col = layout.column()
col.itemR(brush, "airbrush")
if brush.sculpt_tool != 'LAYER':
col.itemR(brush, "anchored")
@ -378,6 +351,10 @@ class VIEW3D_PT_tools_brush(PaintPanel):
if brush.sculpt_tool == 'LAYER':
col.itemR(brush, "persistent")
col.itemO("sculpt.set_persistent_base")
col.itemR(brush, "rake")
col.itemR(brush, "sculpt_tool")
# Texture Paint Mode #
@ -446,6 +423,31 @@ class VIEW3D_PT_tools_brush(PaintPanel):
row.itemR(brush, "strength", slider=True)
row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
class VIEW3D_PT_tools_brush_stroke(PaintPanel):
__label__ = "Stroke"
__default_closed__ = True
def poll(self, context):
settings = self.paint_settings(context)
return (settings and settings.brush and context.sculpt_object)
def draw(self, context):
settings = self.paint_settings(context)
brush = settings.brush
layout = self.layout
layout.itemR(brush, "smooth_stroke")
col = layout.column()
col.active = brush.smooth_stroke
col.itemR(brush, "smooth_stroke_radius", text="Radius", slider=True)
col.itemR(brush, "smooth_stroke_factor", text="Factor", slider=True)
layout.itemR(brush, "space")
col = layout.column()
col.active = brush.space
col.itemR(brush, "spacing", text="Distance", slider=True)
class VIEW3D_PT_tools_brush_curve(PaintPanel):
__label__ = "Curve"
__default_closed__ = True
@ -492,12 +494,8 @@ class VIEW3D_PT_sculpt_options(PaintPanel):
# ********** default tools for weightpaint ****************
class View3DPanel(bpy.types.Panel):
__space_type__ = "VIEW_3D"
__region_type__ = "TOOLS"
__context__ = "weight_paint"
class VIEW3D_PT_weight_paint_options(View3DPanel):
class VIEW3D_PT_tools_weightpaint(View3DPanel):
__context__ = "weightpaint"
__label__ = "Options"
def draw(self, context):
@ -523,12 +521,8 @@ class VIEW3D_PT_weight_paint_options(View3DPanel):
# ********** default tools for vertexpaint ****************
class View3DPanel(bpy.types.Panel):
__space_type__ = "VIEW_3D"
__region_type__ = "TOOLS"
class VIEW3D_PT_vertex_paint_options(View3DPanel):
__context__ = "vertex_paint"
class VIEW3D_PT_tools_vertexpaint(View3DPanel):
__context__ = "vertexpaint"
__label__ = "Options"
def draw(self, context):
@ -551,12 +545,8 @@ class VIEW3D_PT_vertex_paint_options(View3DPanel):
# ********** default tools for texturepaint ****************
class View3DPanel(bpy.types.Panel):
__space_type__ = "VIEW_3D"
__region_type__ = "TOOLS"
__context__ = "texture_paint"
class VIEW3D_PT_tools_texture_paint(View3DPanel):
class VIEW3D_PT_tools_texturepaint(View3DPanel):
__context__ = "texturepaint"
__label__ = "Options"
def draw(self, context):
@ -564,32 +554,49 @@ class VIEW3D_PT_tools_texture_paint(View3DPanel):
ipaint = context.tool_settings.image_paint
settings = context.tool_settings.image_paint
use_projection= ipaint.use_projection
col = layout.column()
col.itemR(ipaint, "use_projection")
sub = col.column()
sub.active = ipaint.use_projection
sub.active = use_projection
sub.itemR(ipaint, "use_occlude")
sub.itemR(ipaint, "use_backface_cull")
sub.itemR(ipaint, "use_normal_falloff")
sub.itemR(ipaint, "use_stencil_layer")
subsub = sub.column()
subsub.active = ipaint.use_stencil_layer
subsub.itemR(ipaint, "invert_stencil")
if settings.tool == 'CLONE':
sub.itemR(ipaint, "use_clone_layer")
split = layout.split()
col = split.column()
col.active = (use_projection)
col.itemR(ipaint, "use_normal_falloff")
col = split.column()
col.active = (ipaint.use_normal_falloff and use_projection)
col.itemR(ipaint, "normal_angle", text="")
split = layout.split(percentage=0.7)
col = split.column(align=False)
col.active = (use_projection)
col.itemR(ipaint, "use_stencil_layer")
col = split.column(align=False)
col.active = (use_projection and ipaint.use_stencil_layer)
col.itemR(ipaint, "invert_stencil", text="Inv")
col = layout.column()
sub = col.column()
sub.active = (settings.tool == 'CLONE')
sub.itemR(ipaint, "use_clone_layer")
sub = col.column()
sub.itemR(ipaint, "seam_bleed")
sub.itemR(ipaint, "normal_angle")
# ********** default tools for particle mode ****************
class View3DPanel(bpy.types.Panel):
__space_type__ = "VIEW_3D"
__region_type__ = "TOOLS"
__context__ = "particle_mode"
class VIEW3D_PT_tools_particle_edit(View3DPanel):
class VIEW3D_PT_tools_particlemode(View3DPanel):
__context__ = "particlemode"
__label__ = "Options"
def draw(self, context):
@ -608,23 +615,24 @@ class VIEW3D_PT_tools_particle_edit(View3DPanel):
col.itemR(pe, "keep_root", text="Root")
col = layout.column(align=True)
col.itemL(text="Draw:")
col.itemL(text="Display:")
col.itemR(pe, "show_time", text="Time")
col.itemR(pe, "show_children", text="Children")
bpy.types.register(VIEW3D_PT_tools_objectmode)
bpy.types.register(VIEW3D_PT_tools_editmode_mesh)
bpy.types.register(VIEW3D_PT_tools_editmode_curve)
bpy.types.register(VIEW3D_PT_tools_editmode_surface)
bpy.types.register(VIEW3D_PT_tools_editmode_text)
bpy.types.register(VIEW3D_PT_tools_editmode_armature)
bpy.types.register(VIEW3D_PT_tools_editmode_mball)
bpy.types.register(VIEW3D_PT_tools_editmode_lattice)
bpy.types.register(VIEW3D_PT_tools_meshedit)
bpy.types.register(VIEW3D_PT_tools_curveedit)
bpy.types.register(VIEW3D_PT_tools_surfaceedit)
bpy.types.register(VIEW3D_PT_tools_textedit)
bpy.types.register(VIEW3D_PT_tools_armatureedit)
bpy.types.register(VIEW3D_PT_tools_mballedit)
bpy.types.register(VIEW3D_PT_tools_latticeedit)
bpy.types.register(VIEW3D_PT_tools_posemode)
bpy.types.register(VIEW3D_PT_tools_brush)
bpy.types.register(VIEW3D_PT_tools_brush_stroke)
bpy.types.register(VIEW3D_PT_tools_brush_curve)
bpy.types.register(VIEW3D_PT_sculpt_options)
bpy.types.register(VIEW3D_PT_vertex_paint_options)
bpy.types.register(VIEW3D_PT_weight_paint_options)
bpy.types.register(VIEW3D_PT_tools_texture_paint)
bpy.types.register(VIEW3D_PT_tools_particle_edit)
bpy.types.register(VIEW3D_PT_tools_vertexpaint)
bpy.types.register(VIEW3D_PT_tools_weightpaint)
bpy.types.register(VIEW3D_PT_tools_texturepaint)
bpy.types.register(VIEW3D_PT_tools_particlemode)

@ -109,7 +109,7 @@ COMLIB += $(OCGDIR)/blender/blenfont/$(DEBUG_DIR)libblenfont.a
COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaudaspace.a
COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_src.a
COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_fx.a
COMLIB += $(NAN_SAMPLERATE)/lib/libsamplerate.a
COMLIB += $(NAN_SAMPLERATE)/lib/$(DEBUG_DIR)libsamplerate.a
ifneq ($(NAN_NO_KETSJI),true)
COMLIB += $(OCGDIR)/gameengine/bloutines/$(DEBUG_DIR)libbloutines.a
@ -244,6 +244,7 @@ PULIB += $(OCGDIR)/blender/ed_image/$(DEBUG_DIR)libed_image.a
PULIB += $(OCGDIR)/blender/ed_uvedit/$(DEBUG_DIR)libed_uvedit.a
PULIB += $(OCGDIR)/blender/ed_screen/$(DEBUG_DIR)libed_screen.a
PULIB += $(OCGDIR)/blender/ed_console/$(DEBUG_DIR)libed_console.a
PULIB += $(OCGDIR)/blender/ed_userpref/$(DEBUG_DIR)libed_userpref.a
PULIB += $(OCGDIR)/blender/windowmanager/$(DEBUG_DIR)libwindowmanager.a
PULIB += $(OCGDIR)/blender/python/$(DEBUG_DIR)libpython.a
PULIB += $(OCGDIR)/blender/makesrna/$(DEBUG_DIR)librna.a

@ -70,6 +70,11 @@ void BLF_boundbox(char *str, struct rctf *box);
float BLF_width(char *str);
float BLF_height(char *str);
/*
* The following function return the width and height of the string, but
* just in one call, so avoid extra freetype2 stuff.
*/
void BLF_width_and_height(char *str, float *width, float *height);
/*
* For fixed width fonts only, returns the width of a
@ -116,6 +121,28 @@ void BLF_shadow(int level, float r, float g, float b, float a);
*/
void BLF_shadow_offset(int x, int y);
/*
* Set the buffer, size and number of channels to draw, one thing to take care is call
* this function with NULL pointer when we finish, for example:
* BLF_buffer(my_fbuf, my_cbuf, 100, 100, 4);
*
* ... set color, position and draw ...
*
* BLF_buffer(NULL, NULL, 0, 0, 0);
*/
void BLF_buffer(float *fbuf, unsigned char *cbuf, unsigned int w, unsigned int h, int nch);
/*
* Set the color to be used for text.
*/
void BLF_buffer_col(float r, float g, float b, float a);
/*
* Draw the string into the buffer, this function draw in both buffer, float and unsigned char _BUT_
* it's not necessary set both buffer, NULL is valid here.
*/
void BLF_draw_buffer(char *str);
/*
* Search the path directory to the locale files, this try all
* the case for Linux, Win and Mac.

@ -27,11 +27,13 @@ FILE(GLOB SRC intern/*.c)
SET(INC
../../../intern/guardedalloc ../blenlib ../makesdna ../editors/include
../blenkernel ../../../extern/glew/include .
${FTGL_INC}
${FREETYPE_INC}
${GETTEXT_INC}
${FREETYPE_INCLUDE_DIRS}
)
IF(WITH_INTERNATIONAL)
SET(INC ${INC} ${GETTEXT_INC})
ENDIF(WITH_INTERNATIONAL)
IF(WIN32)
ADD_DEFINITIONS(-D_WIN32 -DUSE_GETTEXT_DLL)
ENDIF(WIN32)

@ -371,6 +371,15 @@ void BLF_boundbox(char *str, rctf *box)
blf_font_boundbox(font, str, box);
}
void BLF_width_and_height(char *str, float *width, float *height)
{
FontBLF *font;
font= global_font[global_font_cur];
if (font)
blf_font_width_and_height(font, str, width, height);
}
float BLF_width(char *str)
{
FontBLF *font;
@ -513,3 +522,39 @@ void BLF_shadow_offset(int x, int y)
font->shadow_y= y;
}
}
void BLF_buffer(float *fbuf, unsigned char *cbuf, unsigned int w, unsigned int h, int nch)
{
FontBLF *font;
font= global_font[global_font_cur];
if (font) {
font->b_fbuf= fbuf;
font->b_cbuf= cbuf;
font->bw= w;
font->bh= h;
font->bch= nch;
}
}
void BLF_buffer_col(float r, float g, float b, float a)
{
FontBLF *font;
font= global_font[global_font_cur];
if (font) {
font->b_col[0]= r;
font->b_col[1]= g;
font->b_col[2]= b;
font->b_col[3]= a;
}
}
void BLF_draw_buffer(char *str)
{
FontBLF *font;
font= global_font[global_font_cur];
if (font)
blf_font_buffer(font, str);
}

@ -153,7 +153,8 @@ char *blf_dir_search(char *file)
int blf_dir_split(const char *str, char *file, int *size)
{
char *s, i, len;
int i, len;
char *s;
/* Window, Linux or Mac, this is always / */
s= strrchr(str, '/');

@ -100,7 +100,7 @@ void blf_font_draw(FontBLF *font, char *str)
unsigned int c;
GlyphBLF *g, *g_prev;
FT_Vector delta;
FT_UInt glyph_index, g_prev_index;
FT_UInt glyph_index;
int pen_x, pen_y;
int i, has_kerning, st;
@ -112,17 +112,17 @@ void blf_font_draw(FontBLF *font, char *str)
pen_y= 0;
has_kerning= FT_HAS_KERNING(font->face);
g_prev= NULL;
g_prev_index= 0;
while (str[i]) {
c= blf_utf8_next((unsigned char *)str, &i);
if (c == 0)
break;
glyph_index= FT_Get_Char_Index(font->face, c);
g= blf_glyph_search(font->glyph_cache, c);
if (!g)
if (!g) {
glyph_index= FT_Get_Char_Index(font->face, c);
g= blf_glyph_add(font, glyph_index, c);
}
/* if we don't found a glyph, skip it. */
if (!g)
@ -133,9 +133,9 @@ void blf_font_draw(FontBLF *font, char *str)
delta.y= 0;
if (font->flags & BLF_KERNING_DEFAULT)
st= FT_Get_Kerning(font->face, g_prev_index, glyph_index, ft_kerning_default, &delta);
st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, ft_kerning_default, &delta);
else
st= FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta);
st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_UNFITTED, &delta);
if (st == 0)
pen_x += delta.x >> 6;
@ -146,7 +146,129 @@ void blf_font_draw(FontBLF *font, char *str)
pen_x += g->advance;
g_prev= g;
g_prev_index= glyph_index;
}
}
void blf_font_buffer(FontBLF *font, char *str)
{
unsigned char *data;
unsigned int c;
GlyphBLF *g, *g_prev;
FT_Vector delta;
FT_UInt glyph_index;
float a, *fbuf;
int pen_x, pen_y, y, x, yb, diff;
int i, has_kerning, st, chx, chy;
if (!font->glyph_cache)
return;
i= 0;
pen_x= (int)font->pos[0];
pen_y= (int)font->pos[1];
has_kerning= FT_HAS_KERNING(font->face);
g_prev= NULL;
while (str[i]) {
c= blf_utf8_next((unsigned char *)str, &i);
if (c == 0)
break;
g= blf_glyph_search(font->glyph_cache, c);
if (!g) {
glyph_index= FT_Get_Char_Index(font->face, c);
g= blf_glyph_add(font, glyph_index, c);
}
/* if we don't found a glyph, skip it. */
if (!g)
continue;
if (has_kerning && g_prev) {
delta.x= 0;
delta.y= 0;
if (font->flags & BLF_KERNING_DEFAULT)
st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, ft_kerning_default, &delta);
else
st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_UNFITTED, &delta);
if (st == 0)
pen_x += delta.x >> 6;
}
if (font->b_fbuf) {
chx= pen_x + ((int)g->pos_x);
diff= g->height - ((int)g->pos_y);
if (diff > 0) {
if (g->pitch < 0)
pen_y += diff;
else
pen_y -= diff;
}
else if (diff < 0) {
if (g->pitch < 0)
pen_y -= diff;
else
pen_y += diff;
}
if (g->pitch < 0)
chy= pen_y - ((int)g->pos_y);
else
chy= pen_y + ((int)g->pos_y);
if (chx >= 0 && chx < font->bw && pen_y >= 0 && pen_y < font->bh) {
if (g->pitch < 0)
yb= 0;
else
yb= g->height-1;
for (y= 0; y < g->height; y++) {
for (x= 0; x < g->width; x++) {
fbuf= font->b_fbuf + font->bch * ((chx + x) + ((pen_y + y)*font->bw));
data= g->bitmap + x + (yb * g->pitch);
a= data[0]/255.0f;
if (a == 1.0) {
fbuf[0]= font->b_col[0];
fbuf[1]= font->b_col[1];
fbuf[2]= font->b_col[2];
}
else {
fbuf[0]= (font->b_col[0]*a) + (fbuf[0] * (1-a));
fbuf[1]= (font->b_col[1]*a) + (fbuf[1] * (1-a));
fbuf[2]= (font->b_col[2]*a) + (fbuf[2] * (1-a));
}
}
if (g->pitch < 0)
yb++;
else
yb--;
}
}
if (diff > 0) {
if (g->pitch < 0)
pen_x -= diff;
else
pen_y += diff;
}
else if (diff < 0) {
if (g->pitch < 0)
pen_x += diff;
else
pen_y -= diff;
}
}
pen_x += g->advance;
g_prev= g;
}
}
@ -155,7 +277,7 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
unsigned int c;
GlyphBLF *g, *g_prev;
FT_Vector delta;
FT_UInt glyph_index, g_prev_index;
FT_UInt glyph_index;
rctf gbox;
int pen_x, pen_y;
int i, has_kerning, st;
@ -173,17 +295,17 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
pen_y= 0;
has_kerning= FT_HAS_KERNING(font->face);
g_prev= NULL;
g_prev_index= 0;
while (str[i]) {
c= blf_utf8_next((unsigned char *)str, &i);
if (c == 0)
break;
glyph_index= FT_Get_Char_Index(font->face, c);
g= blf_glyph_search(font->glyph_cache, c);
if (!g)
if (!g) {
glyph_index= FT_Get_Char_Index(font->face, c);
g= blf_glyph_add(font, glyph_index, c);
}
/* if we don't found a glyph, skip it. */
if (!g)
@ -194,9 +316,9 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
delta.y= 0;
if (font->flags & BLF_KERNING_DEFAULT)
st= FT_Get_Kerning(font->face, g_prev_index, glyph_index, ft_kerning_default, &delta);
st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, ft_kerning_default, &delta);
else
st= FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta);
st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_UNFITTED, &delta);
if (st == 0)
pen_x += delta.x >> 6;
@ -219,7 +341,6 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
pen_x += g->advance;
g_prev= g;
g_prev_index= glyph_index;
}
if (box->xmin > box->xmax) {
@ -230,6 +351,17 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
}
}
void blf_font_width_and_height(FontBLF *font, char *str, float *width, float *height)
{
rctf box;
if (font->glyph_cache) {
blf_font_boundbox(font, str, &box);
*width= ((box.xmax - box.xmin) * font->aspect);
*height= ((box.ymax - box.ymin) * font->aspect);
}
}
float blf_font_width(FontBLF *font, char *str)
{
rctf box;
@ -311,6 +443,15 @@ void blf_font_fill(FontBLF *font)
font->glyph_cache= NULL;
font->blur= 0;
font->max_tex_size= -1;
font->b_fbuf= NULL;
font->b_cbuf= NULL;
font->bw= 0;
font->bh= 0;
font->bch= 0;
font->b_col[0]= 0;
font->b_col[1]= 0;
font->b_col[2]= 0;
font->b_col[3]= 0;
}
FontBLF *blf_font_new(char *name, char *filename)

@ -217,6 +217,7 @@ GlyphBLF *blf_glyph_add(FontBLF *font, FT_UInt index, unsigned int c)
g->next= NULL;
g->prev= NULL;
g->c= c;
g->idx= index;
g->tex= 0;
g->build_tex= 0;
g->bitmap= NULL;
@ -238,6 +239,7 @@ GlyphBLF *blf_glyph_add(FontBLF *font, FT_UInt index, unsigned int c)
g->advance= ((float)slot->advance.x) / 64.0f;
g->pos_x= slot->bitmap_left;
g->pos_y= slot->bitmap_top;
g->pitch= slot->bitmap.pitch;
FT_Outline_Get_CBox(&(slot->outline), &bbox);
g->box.xmin= ((float)bbox.xMin) / 64.0f;

@ -45,7 +45,9 @@ void blf_font_attach_from_mem(FontBLF *font, const unsigned char *mem, int mem_s
void blf_font_size(FontBLF *font, int size, int dpi);
void blf_font_draw(FontBLF *font, char *str);
void blf_font_buffer(FontBLF *font, char *str);
void blf_font_boundbox(FontBLF *font, char *str, rctf *box);
void blf_font_width_and_height(FontBLF *font, char *str, float *width, float *height);
float blf_font_width(FontBLF *font, char *str);
float blf_font_height(FontBLF *font, char *str);
float blf_font_fixed_width(FontBLF *font);

@ -85,6 +85,9 @@ typedef struct GlyphBLF {
/* and the character, as UTF8 */
unsigned int c;
/* freetype2 index, to speed-up the search. */
FT_UInt idx;
/* glyph box. */
rctf box;
@ -106,6 +109,7 @@ typedef struct GlyphBLF {
/* glyph width and height. */
int width;
int height;
int pitch;
/* uv coords. */
float uv[2][2];
@ -176,6 +180,22 @@ typedef struct FontBLF {
/* freetype2 face. */
FT_Face face;
/* for draw to buffer, always set this to NULL after finish! */
float *b_fbuf;
/* the same but unsigned char */
unsigned char *b_cbuf;
/* buffer size. */
unsigned int bw;
unsigned int bh;
/* number of channels. */
int bch;
/* and the color, the alphas is get from the glyph! */
float b_col[4];
} FontBLF;
typedef struct DirBLF {

@ -66,6 +66,9 @@ void BKE_keyingset_add_destination(struct KeyingSet *ks, struct ID *id, const ch
struct KS_Path *BKE_keyingset_find_destination(struct KeyingSet *ks, struct ID *id, const char group_name[], const char rna_path[], int array_index, int group_mode);
/* Copy all KeyingSets in the given list */
void BKE_keyingsets_copy(struct ListBase *newlist, struct ListBase *list);
/* Free data for KeyingSet but not set itself */
void BKE_keyingset_free(struct KeyingSet *ks);

@ -43,7 +43,7 @@ struct bContext;
struct ReportList;
#define BLENDER_VERSION 250
#define BLENDER_SUBVERSION 0
#define BLENDER_SUBVERSION 2
#define BLENDER_MINVERSION 250
#define BLENDER_MINSUBVERSION 0

@ -38,16 +38,15 @@ struct Scene;
struct wmOperator;
/* datablock functions */
struct Brush *add_brush(char *name);
struct Brush *add_brush(const char *name);
struct Brush *copy_brush(struct Brush *brush);
void make_local_brush(struct Brush *brush);
void free_brush(struct Brush *brush);
/* brush library operations used by different paint panels */
struct Brush **current_brush_source(struct Scene *sce);
int brush_set_nr(struct Brush **current_brush, int nr);
int brush_set_nr(struct Brush **current_brush, int nr, const char *name);
int brush_delete(struct Brush **current_brush);
void brush_check_exists(struct Brush **brush);
void brush_check_exists(struct Brush **brush, const char *name);
void brush_toggled_fake_user(struct Brush *brush);
int brush_texture_set_nr(struct Brush *brush, int nr);
int brush_texture_delete(struct Brush *brush);

@ -86,6 +86,25 @@ typedef struct bContextStore {
int used;
} bContextStore;
/* for the conrtext's rna mode enum
* keep aligned with data_mode_strings in context.c */
enum {
CTX_MODE_EDIT_MESH = 0,
CTX_MODE_EDIT_CURVE,
CTX_MODE_EDIT_SURFACE,
CTX_MODE_EDIT_TEXT,
CTX_MODE_EDIT_ARMATURE,
CTX_MODE_EDIT_METABALL,
CTX_MODE_EDIT_LATTICE,
CTX_MODE_POSE,
CTX_MODE_SCULPT,
CTX_MODE_PAINT_WEIGHT,
CTX_MODE_PAINT_VERTEX,
CTX_MODE_PAINT_TEXTURE,
CTX_MODE_PARTICLE,
CTX_MODE_OBJECT
};
/* Context */
bContext *CTX_create(void);
@ -133,6 +152,7 @@ struct SpaceLogic *CTX_wm_space_logic(const bContext *C);
struct SpaceIpo *CTX_wm_space_graph(const bContext *C);
struct SpaceAction *CTX_wm_space_action(const bContext *C);
struct SpaceInfo *CTX_wm_space_info(const bContext *C);
struct SpaceUserPref *CTX_wm_space_userpref(const bContext *C);
void CTX_wm_manager_set(bContext *C, struct wmWindowManager *wm);
void CTX_wm_window_set(bContext *C, struct wmWindow *win);
@ -191,6 +211,9 @@ struct Main *CTX_data_main(const bContext *C);
struct Scene *CTX_data_scene(const bContext *C);
struct ToolSettings *CTX_data_tool_settings(const bContext *C);
char *CTX_data_mode_string(const bContext *C);
int CTX_data_mode_enum(const bContext *C);
void CTX_data_main_set(bContext *C, struct Main *bmain);
void CTX_data_scene_set(bContext *C, struct Scene *bmain);

@ -112,52 +112,40 @@ typedef struct Global {
#define G_FACESELECT (1 << 8)
#define G_VERTEXPAINT (1 << 10)
#define G_DEBUG (1 << 12)
#define G_DOSCRIPTLINKS (1 << 13)
#define G_WEIGHTPAINT (1 << 15)
#define G_TEXTUREPAINT (1 << 16)
/* #define G_NOFROZEN (1 << 17) also removed */
#define G_GREASEPENCIL (1 << 17)
#define G_SCULPTMODE (1 << 29)
#define G_PARTICLEEDIT (1 << 30)
/* #define G_AUTOMATKEYS (1 << 30) also removed */
#define G_HIDDENHANDLES (1 << 31) /* used for curves only */
/* macro for testing face select mode
* Texture paint could be removed since selected faces are not used
* however hiding faces is useful */
#define FACESEL_PAINT_TEST ((G.f&G_FACESELECT) && (G.f & (G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT)))
/* G.fileflags */
#define G_AUTOPACK (1 << 0)
#define G_FILE_COMPRESS (1 << 1)
#define G_FILE_AUTOPLAY (1 << 2)
#define G_FILE_ENABLE_ALL_FRAMES (1 << 3)
#define G_FILE_SHOW_DEBUG_PROPS (1 << 4)
#define G_FILE_SHOW_FRAMERATE (1 << 5)
#define G_FILE_SHOW_PROFILE (1 << 6)
#define G_FILE_ENABLE_ALL_FRAMES (1 << 3) /* deprecated */
#define G_FILE_SHOW_DEBUG_PROPS (1 << 4) /* deprecated */
#define G_FILE_SHOW_FRAMERATE (1 << 5) /* deprecated */
#define G_FILE_SHOW_PROFILE (1 << 6) /* deprecated */
#define G_FILE_LOCK (1 << 7)
#define G_FILE_SIGN (1 << 8)
#define G_FIle_PUBLISH (1 << 9)
#define G_FILE_NO_UI (1 << 10)
#define G_FILE_GAME_TO_IPO (1 << 11)
#define G_FILE_GAME_MAT (1 << 12)
#define G_FILE_DISPLAY_LISTS (1 << 13)
#define G_FILE_SHOW_PHYSICS (1 << 14)
#define G_FILE_GAME_MAT_GLSL (1 << 15)
#define G_FILE_GLSL_NO_LIGHTS (1 << 16)
#define G_FILE_GLSL_NO_SHADERS (1 << 17)
#define G_FILE_GLSL_NO_SHADOWS (1 << 18)
#define G_FILE_GLSL_NO_RAMPS (1 << 19)
#define G_FILE_GLSL_NO_NODES (1 << 20)
#define G_FILE_GLSL_NO_EXTRA_TEX (1 << 21)
#define G_FILE_IGNORE_DEPRECATION_WARNINGS (1 << 22)
#define G_FILE_GAME_TO_IPO (1 << 11) /* deprecated */
#define G_FILE_GAME_MAT (1 << 12) /* deprecated */
#define G_FILE_DISPLAY_LISTS (1 << 13) /* deprecated */
#define G_FILE_SHOW_PHYSICS (1 << 14) /* deprecated */
#define G_FILE_GAME_MAT_GLSL (1 << 15) /* deprecated */
#define G_FILE_GLSL_NO_LIGHTS (1 << 16) /* deprecated */
#define G_FILE_GLSL_NO_SHADERS (1 << 17) /* deprecated */
#define G_FILE_GLSL_NO_SHADOWS (1 << 18) /* deprecated */
#define G_FILE_GLSL_NO_RAMPS (1 << 19) /* deprecated */
#define G_FILE_GLSL_NO_NODES (1 << 20) /* deprecated */
#define G_FILE_GLSL_NO_EXTRA_TEX (1 << 21) /* deprecated */
#define G_FILE_IGNORE_DEPRECATION_WARNINGS (1 << 22) /* deprecated */
/* G.windowstate */
#define G_WINDOWSTATE_USERDEF 0

@ -47,6 +47,7 @@ struct rctf;
struct ListBase;
struct RenderData;
struct Scene;
struct Main;
struct Tex;
struct GPUMaterial;
struct GPUNode;
@ -421,7 +422,7 @@ extern struct ListBase node_all_textures;
/* API */
int ntreeTexTagAnimated(struct bNodeTree *ntree);
void ntreeTexUpdatePreviews( struct bNodeTree* nodetree );
void ntreeTexExecTree(struct bNodeTree *ntree, struct TexResult *target, float *coord, char do_preview, short thread, struct Tex *tex, short which_output, int cfra);
void ntreeTexExecTree(struct bNodeTree *ntree, struct TexResult *target, float *coord, float *dxt, float *dyt, char do_preview, short thread, struct Tex *tex, short which_output, int cfra);
void ntreeTexCheckCyclics(struct bNodeTree *ntree);
void ntreeTexAssignIndex(struct bNodeTree *ntree, struct bNode *node);
char* ntreeTexOutputMenu(struct bNodeTree *ntree);
@ -432,4 +433,8 @@ char* ntreeTexOutputMenu(struct bNodeTree *ntree);
void init_nodesystem(void);
void free_nodesystem(void);
/**/
void clear_scene_in_nodes(struct Main *bmain, struct Scene *sce);
#endif

@ -0,0 +1,51 @@
/*
* ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2009 by Nicholas Bishop
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef BKE_PAINT_H
#define BKE_PAINT_H
struct Brush;
struct Object;
struct Paint;
struct Scene;
void paint_init(struct Paint *p, const char *brush_name);
void free_paint(struct Paint *p);
void copy_paint(struct Paint *orig, struct Paint *new);
struct Paint *paint_get_active(struct Scene *sce);
struct Brush *paint_brush(struct Paint *paint);
void paint_brush_set(struct Paint *paint, struct Brush *br);
void paint_brush_slot_add(struct Paint *p);
void paint_brush_slot_remove(struct Paint *p);
/* testing face select mode
* Texture paint could be removed since selected faces are not used
* however hiding faces is useful */
int paint_facesel_test(struct Object *ob);
#endif

@ -57,9 +57,11 @@
#define PTCACHE_FILE_WRITE 1
/* PTCacheID types */
#define PTCACHE_TYPE_SOFTBODY 0
#define PTCACHE_TYPE_PARTICLES 1
#define PTCACHE_TYPE_CLOTH 2
#define PTCACHE_TYPE_SOFTBODY 0
#define PTCACHE_TYPE_PARTICLES 1
#define PTCACHE_TYPE_CLOTH 2
#define PTCACHE_TYPE_SMOKE_DOMAIN_LOW 3
#define PTCACHE_TYPE_SMOKE_DOMAIN_HIGH 4
/* PTCache read return code */
#define PTCACHE_READ_EXACT 1
@ -73,6 +75,7 @@ struct SoftBody;
struct ParticleSystem;
struct ParticleKey;
struct ClothModifierData;
struct SmokeModifierData;
struct PointCache;
struct ListBase;
@ -112,8 +115,12 @@ typedef struct PTCacheID {
/* copies point data to cache data */
int (*write_elem)(int index, void *calldata, void **data);
/* copies point data to cache data */
int (*write_stream)(PTCacheFile *pf, void *calldata);
/* copies cache cata to point data */
void (*read_elem)(int index, void *calldata, void **data, float frs_sec, float cfra, float *old_data);
/* copies cache cata to point data */
void (*read_stream)(PTCacheFile *pf, void *calldata);
/* interpolated between previously read point data and cache data */
void (*interpolate_elem)(int index, void *calldata, void **data, float frs_sec, float cfra, float cfra1, float cfra2, float *old_data);
@ -151,6 +158,7 @@ void BKE_ptcache_make_particle_key(struct ParticleKey *key, int index, void **da
void BKE_ptcache_id_from_softbody(PTCacheID *pid, struct Object *ob, struct SoftBody *sb);
void BKE_ptcache_id_from_particles(PTCacheID *pid, struct Object *ob, struct ParticleSystem *psys);
void BKE_ptcache_id_from_cloth(PTCacheID *pid, struct Object *ob, struct ClothModifierData *clmd);
void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeModifierData *smd, int num);
void BKE_ptcache_ids_from_object(struct ListBase *lb, struct Object *ob);
@ -192,7 +200,7 @@ struct PointCache *BKE_ptcache_add(struct ListBase *ptcaches);
void BKE_ptache_free_mem(struct PointCache *cache);
void BKE_ptcache_free(struct PointCache *cache);
void BKE_ptcache_free_list(struct ListBase *ptcaches);
struct PointCache *BKE_ptcache_copy(struct PointCache *cache);
struct PointCache *BKE_ptcache_copy_list(struct ListBase *ptcaches_new, struct ListBase *ptcaches_old);
/********************** Baking *********************/

@ -40,6 +40,12 @@ struct AviCodecData;
struct QuicktimeCodecData;
struct RenderData;
struct Text;
struct Main;
#define SCE_COPY_EMPTY 0
#define SCE_COPY_LINK_OB 1
#define SCE_COPY_LINK_DATA 2
#define SCE_COPY_FULL 3
/* note; doesn't work when scene is empty */
#define SETLOOPER(s, b) sce= s, b= (Base*)sce->base.first; b; b= (Base*)(b->next?b->next:sce->set?(sce=sce->set)->base.first:NULL)
@ -48,13 +54,16 @@ struct Text;
void free_avicodecdata(struct AviCodecData *acd);
void free_qtcodecdata(struct QuicktimeCodecData *acd);
void free_scene(struct Scene *me);
void free_scene(struct Scene *sce);
struct Scene *add_scene(char *name);
struct Base *object_in_scene(struct Object *ob, struct Scene *sce);
void set_scene_bg(struct Scene *sce);
void set_scene_name(char *name);
struct Scene *copy_scene(struct Main *bmain, struct Scene *sce, int type);
void unlink_scene(struct Main *bmain, struct Scene *sce, struct Scene *newsce);
int next_object(struct Scene *scene, int val, struct Base **base, struct Object **ob);
struct Object *scene_find_camera(struct Scene *sc);

@ -33,7 +33,7 @@
struct MFace;
struct MultireModifierData;
struct MVert;
struct Sculpt;
struct Object;
struct StrokeCache;
typedef struct SculptSession {
@ -63,13 +63,10 @@ typedef struct SculptSession {
float (*mesh_co_orig)[3]; /* Copy of the mesh vertices' locations */
float *layer_disps; /* Displacements for each vertex */
void *cursor; /* wm handle */
struct SculptStroke *stroke;
struct StrokeCache *cache;
} SculptSession;
void sculptsession_free(struct Sculpt *sculpt);
void free_sculptsession(SculptSession **);
#endif

@ -184,3 +184,7 @@ int shuffle_seq(struct ListBase * seqbasep, struct Sequence *test);
void free_imbuf_seq(struct ListBase * seqbasep, int check_mem_usage);
void seq_update_sound(struct Sequence *seq);
void clear_scene_in_allseqs(struct Scene *sce);

@ -39,8 +39,6 @@ struct Main;
void sound_init();
void sound_reinit(struct bContext *C);
void sound_exit();
struct bSound* sound_new_file(struct Main *main, char* filename);

@ -47,7 +47,7 @@ double bUnit_BaseScalar(int system, int type);
void bUnit_GetSystem(void **usys_pt, int *len, int system, int type);
char* bUnit_GetName(void *usys_pt, int index);
char* bUnit_GetNamePlural(void *usys_pt, int index);
char* bUnit_GetNameDisplay(void *usys_pt, int index);
double bUnit_GetScaler(void *usys_pt, int index);
/* aligned with PropertyUnit */

@ -62,11 +62,6 @@
#define SHIFT3(type, a, b, c) { type tmp; tmp = a; a = c; c = b; b = tmp; }
#define SHIFT4(type, a, b, c, d) { type tmp; tmp = a; a = d; d = c; c = b; b = tmp; }
/* string compare */
#define STREQ(str, a) ( strcmp((str), (a))==0 )
#define STREQ2(str, a, b) ( STREQ(str, a) || STREQ(str, b) )
#define STREQ3(str, a, b, c) ( STREQ2(str, a, b) || STREQ(str, c) )
/* min/max */
#define MIN2(x,y) ( (x)<(y) ? (x) : (y) )
#define MIN3(x,y,z) MIN2( MIN2((x),(y)) , (z) )
@ -92,8 +87,6 @@
if( (max)[0]<(vec)[0] ) (max)[0]= (vec)[0]; \
if( (max)[1]<(vec)[1] ) (max)[1]= (vec)[1]; }
#define MINSIZE(val, size) ( ((val)>=0.0) ? (((val)<(size)) ? (size): (val)) : ( ((val)>(-size)) ? (-size) : (val)))
/* some math and copy defines */
#define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; }

Some files were not shown because too many files have changed in this diff Show More