synched with trunk at revision 31065

This commit is contained in:
Nick Samarin 2010-08-05 13:54:56 +00:00
commit f09cd6974e
528 changed files with 17660 additions and 15872 deletions

@ -69,7 +69,7 @@ OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
OPTION(WITH_LCMS "Enable color correction with lcms" OFF)
OPTION(WITH_PYTHON "Enable Embedded Python API" ON)
OPTION(WITH_BUILDINFO "Include extra build details" ON)
OPTION(WITH_ELBEEM "Enable Elbeem (Fluid Simulation)" ON)
OPTION(WITH_FLUID "Enable Elbeem (Fluid Simulation)" ON)
OPTION(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effects)" OFF)
OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
OPTION(WITH_GAMEENGINE "Enable Game Engine" ON)
@ -82,10 +82,12 @@ ELSE()
ENDIF()
# Image format support
OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON)
OPTION(WITH_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF)
OPTION(WITH_TIFF "Enable LibTIFF Support" ON)
OPTION(WITH_DDS "Enable DDS Support" ON)
OPTION(WITH_IMAGE_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON)
OPTION(WITH_IMAGE_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF)
OPTION(WITH_IMAGE_TIFF "Enable LibTIFF Support" ON)
OPTION(WITH_IMAGE_DDS "Enable DDS Image Support" ON)
OPTION(WITH_IMAGE_CINEON "Enable CINEON and DPX Image Support" ON)
OPTION(WITH_IMAGE_HDR "Enable HDR Image Support" ON)
# Audio format support
OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF)
@ -115,6 +117,7 @@ OPTION(WITH_LZMA "Enable best LZMA compression, (used for pointcache)"
OPTION(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking" OFF)
OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON)
OPTION(WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON)
IF(APPLE)
OPTION(WITH_COCOA "Use Cocoa framework instead of deprecated Carbon" ON)
@ -130,6 +133,10 @@ IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
IF(NOT WITH_INSTALL AND WITH_PYTHON_INSTALL)
MESSAGE("WARNING: WITH_PYTHON_INSTALL needs WITH_INSTALL")
ENDIF(NOT WITH_INSTALL AND WITH_PYTHON_INSTALL)
TEST_SSE_SUPPORT()
# disabled for now, not supported
@ -215,7 +222,7 @@ IF(UNIX AND NOT APPLE)
ENDIF(NOT SDL_FOUND)
ENDIF(WITH_SDL)
IF(WITH_OPENEXR)
IF(WITH_IMAGE_OPENEXR)
SET(OPENEXR /usr CACHE FILEPATH "OPENEXR Directory")
FIND_PATH(OPENEXR_INC
ImfXdr.h
@ -230,16 +237,16 @@ IF(UNIX AND NOT APPLE)
SET(OPENEXR_LIB Half IlmImf Iex Imath)
IF(NOT OPENEXR_INC)
SET(WITH_OPENEXR OFF)
SET(WITH_IMAGE_OPENEXR OFF)
ENDIF(NOT OPENEXR_INC)
ENDIF(WITH_OPENEXR)
ENDIF(WITH_IMAGE_OPENEXR)
IF(WITH_TIFF)
IF(WITH_IMAGE_TIFF)
FIND_PACKAGE(TIFF)
IF(NOT TIFF_FOUND)
SET(WITH_TIFF OFF)
SET(WITH_IMAGE_TIFF OFF)
ENDIF(NOT TIFF_FOUND)
ENDIF(WITH_TIFF)
ENDIF(WITH_IMAGE_TIFF)
FIND_PACKAGE(JPEG REQUIRED)
@ -492,7 +499,7 @@ IF(WIN32)
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
ENDIF(WITH_FFMPEG)
IF(WITH_OPENEXR)
IF(WITH_IMAGE_OPENEXR)
SET(OPENEXR ${LIBDIR}/openexr)
SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath)
SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
@ -504,14 +511,14 @@ IF(WIN32)
IF (MSVC90)
SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008)
ENDIF(MSVC90)
ENDIF(WITH_OPENEXR)
ENDIF(WITH_IMAGE_OPENEXR)
IF(WITH_TIFF)
IF(WITH_IMAGE_TIFF)
SET(TIFF ${LIBDIR}/tiff)
SET(TIFF_LIBRARY libtiff)
SET(TIFF_INCLUDE_DIR ${TIFF}/include)
SET(TIFF_LIBPATH ${TIFF}/lib)
ENDIF(WITH_TIFF)
ENDIF(WITH_IMAGE_TIFF)
IF(WITH_JACK)
SET(JACK ${LIBDIR}/jack)
@ -602,19 +609,19 @@ IF(WIN32)
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
ENDIF(WITH_FFMPEG)
IF(WITH_OPENEXR)
IF(WITH_IMAGE_OPENEXR)
SET(OPENEXR ${LIBDIR}/gcc/openexr)
SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/OpenEXR)
SET(OPENEXR_LIB Half IlmImf Imath IlmThread)
SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
ENDIF(WITH_OPENEXR)
ENDIF(WITH_IMAGE_OPENEXR)
IF(WITH_TIFF)
IF(WITH_IMAGE_TIFF)
SET(TIFF ${LIBDIR}/gcc/tiff)
SET(TIFF_LIBRARY tiff)
SET(TIFF_INCLUDE_DIR ${TIFF}/include)
SET(TIFF_LIBPATH ${TIFF}/lib)
ENDIF(WITH_TIFF)
ENDIF(WITH_IMAGE_TIFF)
IF(WITH_JACK)
SET(JACK ${LIBDIR}/jack)
@ -722,12 +729,12 @@ IF(APPLE)
SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
SET(FREETYPE_LIBRARY freetype)
IF(WITH_OPENEXR)
IF(WITH_IMAGE_OPENEXR)
SET(OPENEXR ${LIBDIR}/openexr)
SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include)
SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
ENDIF(WITH_OPENEXR)
ENDIF(WITH_IMAGE_OPENEXR)
IF(WITH_LCMS)
SET(LCMS ${LIBDIR}/lcms)
@ -805,12 +812,12 @@ IF(APPLE)
SET(JPEG_INC "${JPEG}/include")
SET(JPEG_LIBPATH ${JPEG}/lib)
IF(WITH_TIFF)
IF(WITH_IMAGE_TIFF)
SET(TIFF ${LIBDIR}/tiff)
SET(TIFF_INCLUDE_DIR ${TIFF}/include)
SET(TIFF_LIBRARY tiff)
SET(TIFF_LIBPATH ${TIFF}/lib)
ENDIF(WITH_TIFF)
ENDIF(WITH_IMAGE_TIFF)
IF(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
SET(PLATFORM_CFLAGS " -msse -msse2 ${PLATFORM_CFLAGS}")
@ -864,11 +871,11 @@ ENDIF(WITH_BUILDINFO)
#-----------------------------------------------------------------------------
# Common.
IF(WITH_OPENJPEG)
IF(WITH_IMAGE_OPENJPEG)
set(OPENJPEG ${CMAKE_SOURCE_DIR}/extern/libopenjpeg)
set(OPENJPEG_INC ${OPENJPEG})
set(OPENJPEG_LIb extern_libopenjpeg)
ENDIF(WITH_OPENJPEG)
ENDIF(WITH_IMAGE_OPENJPEG)
#-----------------------------------------------------------------------------
# Blender WebPlugin

@ -45,7 +45,7 @@ MAKEFLAGS=-I$(NANBLENDERHOME)/build_files/make --no-print-directory
SOURCEDIR =
ifeq ($(FREE_WINDOWS),true)
DIRS ?= dlltool extern intern source po
DIRS ?= $(NANBLENDERHOME)/build_files/make/dlltool extern intern source po
else
DIRS ?= extern intern source po
endif

@ -210,14 +210,36 @@ SetOption('num_jobs', int(env['BF_NUMJOBS']))
print B.bc.OKGREEN + "Build with parallel jobs%s: %s" % (B.bc.ENDC, GetOption('num_jobs'))
print B.bc.OKGREEN + "Build with debug symbols%s: %s" % (B.bc.ENDC, env['BF_DEBUG'])
# BLENDERPATH is a unix only option to enable typical style paths this is
# spesifically a data-dir, which is used a lot but cant replace BF_INSTALLDIR
# because the blender binary is installed in $BF_INSTALLDIR/bin/blender
if 'blenderlite' in B.targets:
target_env_defs = {}
target_env_defs['WITH_BF_GAMEENGINE'] = False
target_env_defs['WITH_BF_OPENAL'] = False
target_env_defs['WITH_BF_OPENEXR'] = False
target_env_defs['WITH_BF_OPENMP'] = False
target_env_defs['WITH_BF_ICONV'] = False
target_env_defs['WITH_BF_INTERNATIONAL'] = False
target_env_defs['WITH_BF_OPENJPEG'] = False
target_env_defs['WITH_BF_FFMPEG'] = False
target_env_defs['WITH_BF_QUICKTIME'] = False
target_env_defs['WITH_BF_REDCODE'] = False
target_env_defs['WITH_BF_DDS'] = False
target_env_defs['WITH_BF_CINEON'] = False
target_env_defs['WITH_BF_HDR'] = False
target_env_defs['WITH_BF_ZLIB'] = False
target_env_defs['WITH_BF_SDL'] = False
target_env_defs['WITH_BF_JPEG'] = False
target_env_defs['WITH_BF_PNG'] = False
target_env_defs['WITH_BF_BULLET'] = False
target_env_defs['WITH_BF_BINRELOC'] = False
target_env_defs['BF_BUILDINFO'] = False
target_env_defs['BF_NO_ELBEEM'] = True
target_env_defs['WITH_BF_PYTHON'] = False
# Merge blenderlite, let command line to override
for k,v in target_env_defs.iteritems():
if k not in B.arguments:
env[k] = v
if env['WITH_BF_FHS']:
BLENDERPATH = os.path.join(env['BF_INSTALLDIR'], 'share', 'blender', env['BF_VERSION'])
else:
BLENDERPATH = env['BF_INSTALLDIR']
if env['WITH_BF_OPENMP'] == 1:
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
@ -271,34 +293,6 @@ if 'blenderplayer' in B.targets:
if 'blendernogame' in B.targets:
env['WITH_BF_GAMEENGINE'] = False
if 'blenderlite' in B.targets:
target_env_defs = {}
target_env_defs['WITH_BF_GAMEENGINE'] = False
target_env_defs['WITH_BF_OPENAL'] = False
target_env_defs['WITH_BF_OPENEXR'] = False
target_env_defs['WITH_BF_OPENMP'] = False
target_env_defs['WITH_BF_ICONV'] = False
target_env_defs['WITH_BF_INTERNATIONAL'] = False
target_env_defs['WITH_BF_OPENJPEG'] = False
target_env_defs['WITH_BF_FFMPEG'] = False
target_env_defs['WITH_BF_QUICKTIME'] = False
target_env_defs['WITH_BF_REDCODE'] = False
target_env_defs['WITH_BF_DDS'] = False
target_env_defs['WITH_BF_ZLIB'] = False
target_env_defs['WITH_BF_SDL'] = False
target_env_defs['WITH_BF_JPEG'] = False
target_env_defs['WITH_BF_PNG'] = False
target_env_defs['WITH_BF_BULLET'] = False
target_env_defs['WITH_BF_BINRELOC'] = False
target_env_defs['BF_BUILDINFO'] = False
target_env_defs['BF_NO_ELBEEM'] = True
target_env_defs['WITH_BF_PYTHON'] = False
# Merge blenderlite, let command line to override
for k,v in target_env_defs.iteritems():
if k not in B.arguments:
env[k] = v
# disable elbeem (fluidsim) compilation?
if env['BF_NO_ELBEEM'] == 1:
env['CPPFLAGS'].append('-DDISABLE_ELBEEM')
@ -311,7 +305,7 @@ if env['WITH_BF_SDL'] == False and env['OURPLATFORM'] in ('win32-vc', 'win32-min
# lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
B.root_build_dir = env['BF_BUILDDIR']
B.doc_build_dir = os.path.join(BLENDERPATH, 'doc')
B.doc_build_dir = os.path.join(env['BF_INSTALLDIR'], 'doc')
if not B.root_build_dir[-1]==os.sep:
B.root_build_dir += os.sep
if not B.doc_build_dir[-1]==os.sep:
@ -366,8 +360,9 @@ if not os.path.isdir ( B.root_build_dir):
os.makedirs ( B.root_build_dir + 'extern' )
os.makedirs ( B.root_build_dir + 'lib' )
os.makedirs ( B.root_build_dir + 'bin' )
if not os.path.isdir(B.doc_build_dir) and env['WITH_BF_DOCS']:
os.makedirs ( B.doc_build_dir )
# # Docs not working with epy anymore
# if not os.path.isdir(B.doc_build_dir) and env['WITH_BF_DOCS']:
# os.makedirs ( B.doc_build_dir )
Help(opts.GenerateHelpText(env))
@ -436,10 +431,7 @@ if env['OURPLATFORM']=='darwin':
source=[dp+os.sep+f for f in df]
blenderinstall.append(env.Install(dir=dir,source=source))
else:
if env['WITH_BF_FHS']: dir= os.path.join(env['BF_INSTALLDIR'], 'bin')
else: dir= env['BF_INSTALLDIR']
blenderinstall = env.Install(dir=dir, source=B.program_list)
blenderinstall = env.Install(dir=env['BF_INSTALLDIR'], source=B.program_list)
#-- local path = config files in install dir: installdir\VERSION
#- dont do config and scripts for darwin, it is already in the bundle
@ -466,15 +458,12 @@ if env['OURPLATFORM']!='darwin':
if 'locale' in dp:
datafileslist.append(os.path.join(dp,f))
if env['WITH_BF_FHS']: dir= os.path.join(*([BLENDERPATH] + ['datafiles'] + dp.split(os.sep)[2:])) # skip bin/.blender
else: dir= os.path.join(*([BLENDERPATH] + [VERSION] + ['datafiles'] + dp.split(os.sep)[1:])) # skip bin
dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['datafiles'] + dp.split(os.sep)[1:])) # skip bin
datafilestargetlist.append(dir + os.sep + f)
else:
dotblendlist.append(os.path.join(dp, f))
if env['WITH_BF_FHS']: dir= os.path.join(*([BLENDERPATH] + ['config'] + dp.split(os.sep)[2:])) # skip bin/.blender
else: dir= os.path.join(*([BLENDERPATH] + [VERSION] + ['config'] + dp.split(os.sep)[1:])) # skip bin
dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['config'] + dp.split(os.sep)[1:])) # skip bin
dottargetlist.append(dir + os.sep + f)
dotblenderinstall = []
@ -493,8 +482,7 @@ if env['OURPLATFORM']!='darwin':
if '.svn' in dn:
dn.remove('.svn')
if env['WITH_BF_FHS']: dir = BLENDERPATH
else: dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
dir += os.sep + os.path.basename(scriptpath) + dp[len(scriptpath):]
source=[os.path.join(dp, f) for f in df if f[-3:]!='pyc']
@ -510,7 +498,7 @@ if env['OURPLATFORM']=='linux2':
tn.remove('.svn')
for f in tf:
iconlist.append(os.path.join(tp, f))
icontargetlist.append( os.path.join(*([BLENDERPATH] + tp.split(os.sep)[2:] + [f])) )
icontargetlist.append( os.path.join(*([env['BF_INSTALLDIR']] + tp.split(os.sep)[2:] + [f])) )
iconinstall = []
for targetdir,srcfile in zip(icontargetlist, iconlist):
@ -537,24 +525,24 @@ for tp, tn, tf in os.walk('release/plugins'):
df = tp[8:] # remove 'release/'
for f in tf:
pluglist.append(os.path.join(tp, f))
plugtargetlist.append( os.path.join(BLENDERPATH, df, f) )
plugtargetlist.append( os.path.join(env['BF_INSTALLDIR'], df, f) )
# header files for plugins
pluglist.append('source/blender/blenpluginapi/documentation.h')
plugtargetlist.append(os.path.join(BLENDERPATH, 'plugins', 'include', 'documentation.h'))
plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], 'plugins', 'include', 'documentation.h'))
pluglist.append('source/blender/blenpluginapi/externdef.h')
plugtargetlist.append(os.path.join(BLENDERPATH, 'plugins', 'include', 'externdef.h'))
plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], 'plugins', 'include', 'externdef.h'))
pluglist.append('source/blender/blenpluginapi/floatpatch.h')
plugtargetlist.append(os.path.join(BLENDERPATH, 'plugins', 'include', 'floatpatch.h'))
plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], 'plugins', 'include', 'floatpatch.h'))
pluglist.append('source/blender/blenpluginapi/iff.h')
plugtargetlist.append(os.path.join(BLENDERPATH, 'plugins', 'include', 'iff.h'))
plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], 'plugins', 'include', 'iff.h'))
pluglist.append('source/blender/blenpluginapi/plugin.h')
plugtargetlist.append(os.path.join(BLENDERPATH, 'plugins', 'include', 'plugin.h'))
plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], 'plugins', 'include', 'plugin.h'))
pluglist.append('source/blender/blenpluginapi/util.h')
plugtargetlist.append(os.path.join(BLENDERPATH, 'plugins', 'include', 'util.h'))
plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], 'plugins', 'include', 'util.h'))
pluglist.append('source/blender/blenpluginapi/plugin.DEF')
plugtargetlist.append(os.path.join(BLENDERPATH, 'plugins', 'include', 'plugin.def'))
plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], 'plugins', 'include', 'plugin.def'))
plugininstall = []
for targetdir,srcfile in zip(plugtargetlist, pluglist):
@ -569,7 +557,7 @@ for tp, tn, tf in os.walk('release/text'):
for f in tf:
textlist.append(tp+os.sep+f)
textinstall = env.Install(dir=BLENDERPATH, source=textlist)
textinstall = env.Install(dir=env['BF_INSTALLDIR'], source=textlist)
if env['OURPLATFORM']=='darwin':
allinstall = [blenderinstall, plugininstall, textinstall]
@ -662,17 +650,3 @@ Default(B.program_list)
if not env['WITHOUT_BF_INSTALL']:
Default(installtarget)
#------------ EPYDOC
if env['WITH_BF_DOCS']:
try:
import epydoc
except ImportError:
epydoc = None
if epydoc:
SConscript('source/gameengine/PyDoc/SConscript')
else:
print "No epydoc install detected, Python API and Gameengine API Docs will not be generated "

@ -58,12 +58,12 @@ MACRO(SETUP_LIBDIRS)
IF(WITH_FFMPEG)
LINK_DIRECTORIES(${FFMPEG_LIBPATH})
ENDIF(WITH_FFMPEG)
IF(WITH_OPENEXR)
IF(WITH_IMAGE_OPENEXR)
LINK_DIRECTORIES(${OPENEXR_LIBPATH})
ENDIF(WITH_OPENEXR)
IF(WITH_TIFF)
ENDIF(WITH_IMAGE_OPENEXR)
IF(WITH_IMAGE_TIFF)
LINK_DIRECTORIES(${TIFF_LIBPATH})
ENDIF(WITH_TIFF)
ENDIF(WITH_IMAGE_TIFF)
IF(WITH_LCMS)
LINK_DIRECTORIES(${LCMS_LIBPATH})
ENDIF(WITH_LCMS)
@ -140,10 +140,10 @@ MACRO(SETUP_LIBLINKS
IF(WITH_QUICKTIME)
TARGET_LINK_LIBRARIES(${target} ${QUICKTIME_LIB})
ENDIF(WITH_QUICKTIME)
IF(WITH_TIFF)
IF(WITH_IMAGE_TIFF)
TARGET_LINK_LIBRARIES(${target} ${TIFF_LIBRARY})
ENDIF(WITH_TIFF)
IF(WITH_OPENEXR)
ENDIF(WITH_IMAGE_TIFF)
IF(WITH_IMAGE_OPENEXR)
IF(WIN32)
FOREACH(loop_var ${OPENEXR_LIB})
TARGET_LINK_LIBRARIES(${target} debug ${loop_var}_d)
@ -152,7 +152,7 @@ MACRO(SETUP_LIBLINKS
ELSE(WIN32)
TARGET_LINK_LIBRARIES(${target} ${OPENEXR_LIB})
ENDIF(WIN32)
ENDIF(WITH_OPENEXR)
ENDIF(WITH_IMAGE_OPENEXR)
IF(WITH_LCMS)
TARGET_LINK_LIBRARIES(${target} ${LCMS_LIBRARY})
ENDIF(WITH_LCMS)
@ -198,6 +198,7 @@ MACRO(TEST_SSE_SUPPORT)
SUPPORT_SSE_BUILD)
ENDMACRO(TEST_SSE_SUPPORT)
MACRO(GET_BLENDER_VERSION)
FILE(READ ${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender.h CONTENT)
STRING(REGEX REPLACE "\n" ";" CONTENT "${CONTENT}")

@ -89,7 +89,6 @@ ifeq ($(OS),darwin)
CCFLAGS += -pipe -fPIC -funsigned-char
endif
CFLAGS += -arch $(MACOSX_ARCHITECTURE) #-isysroot $(MACOSX_SDK) -mmacosx-version-min=$(MACOSX_MIN_VERS)
CCFLAGS += -arch $(MACOSX_ARCHITECTURE) #-isysroot $(MACOSX_SDK) -mmacosx-version-min=$(MACOSX_MIN_VERS)

@ -159,6 +159,13 @@ ifndef CONFIG_GUESS
endif
export WITH_TIFF ?= true
#enable raytracing optimization (currently only for i386 and x86_64)
export WITH_BF_RAYOPTIMIZATION ?= true
export WITH_LCMS ?= false
export WITH_CINEON ?= true
export WITH_HDR ?= true
# Compare recreated .mo files with committed ones
export BF_VERIFY_MO_FILES ?= true
@ -622,6 +629,11 @@ ifndef CONFIG_GUESS
# default tiff libs
export NAN_TIFF_LIBS ?= $(NAN_TIFF)/lib/libtiff.a
# default path to lcms, may be overidden in platform sections above or in user-def.mk
export BF_LCMS ?= $(LCGDIR)/lcms
export BF_LCMS_INC ?= $(BF_LCMS)/include
export BF_LCMS_LIBS ?= $(BF_LCMS)/lib/liblcms.a
endif # CONFIG_GUESS
# Don't want to build the gameengine?

@ -195,4 +195,8 @@ ifeq ($(WITH_TIFF),true)
LLIBS += $(NAN_TIFF_LIBS)
endif
ifeq ($(WITH_LCMS),true)
LLIBS += $(BF_LCMS_LIBS)
endif
LLIBS += $(NAN_PYTHON_LIB)

@ -130,7 +130,7 @@ BF_OPENJPEG_LIB = ''
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
WITH_BF_FFTW3 = False
WITH_BF_FFTW3 = True
BF_FFTW3 = LIBDIR + '/fftw3'
BF_FFTW3_INC = '${BF_FFTW3}/include'
BF_FFTW3_LIB = 'libfftw'

@ -194,8 +194,6 @@ CXX_WARN = []
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid']
WITH_BF_DOCS=False
BF_DEBUG=False
BF_BSC=False

@ -501,10 +501,7 @@ def AppIt(target=None, source=None, env=None):
installdir = env['BF_INSTALLDIR']
print("compiled architecture: %s"%(osxarch))
print("Installing to %s"%(installdir))
if libdir == '../lib/darwin-9.x.universal':
python_zip = 'python_' + osxarch + '.zip' # set specific python_arch.zip
else:
python_zip = 'python.zip' # compatibility for darwin8 python.zip
python_zip = 'python_' + osxarch + '.zip' # set specific python_arch.zip
print("unzipping to app-bundle: %s"%(python_zip))
bldroot = env.Dir('.').abspath
binary = env['BINARYKIND']
@ -529,13 +526,13 @@ def AppIt(target=None, source=None, env=None):
# print cmd
commands.getoutput(cmd)
cmd = installdir + '/%s.app/Contents/MacOS/%s'%(binary,VERSION)
shutil.copy(bldroot + '/bin/.blender/.bfont.ttf', cmd)
shutil.copy(bldroot + '/bin/.blender/.Blanguages', cmd)
cmd = 'cp -R %s/bin/%s/locale %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary)
shutil.copy(bldroot + '/release/bin/.blender/.bfont.ttf', cmd)
shutil.copy(bldroot + '/release/bin/.blender/.Blanguages', cmd)
cmd = 'cp -R %s/release/bin/%s/locale %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary)
commands.getoutput(cmd)
cmd = 'cp -R %s/bin/%s/locale %s/%s.app/Contents/MacOS/%s/'%(bldroot,VERSION,installdir,binary,VERSION)
cmd = 'cp -R %s/release/bin/%s/locale %s/%s.app/Contents/MacOS/%s/'%(bldroot,VERSION,installdir,binary,VERSION)
commands.getoutput(cmd)
cmd = 'cp %s/bin/%s/.Blanguages %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary)
cmd = 'cp %s/release/bin/%s/.Blanguages %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary)
commands.getoutput(cmd)
cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/python/'%(installdir,binary, VERSION)
commands.getoutput(cmd)
@ -570,10 +567,9 @@ def UnixPyBundle(target=None, source=None, env=None):
def run(cmd):
print 'Install command:', cmd
commands.getoutput(cmd)
if env['WITH_BF_FHS']: dir = os.path.join(env['BF_INSTALLDIR'], 'share', 'blender', env['BF_VERSION']) # BLENDERPATH
else: dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
py_src = env.subst( env['BF_PYTHON_LIBPATH'] + '/python'+env['BF_PYTHON_VERSION'] )
py_target = env.subst( dir + '/python/lib/python'+env['BF_PYTHON_VERSION'] )

@ -36,7 +36,7 @@ def validate_arguments(args, bc):
'WITH_BF_SNDFILE', 'BF_SNDFILE', 'BF_SNDFILE_INC', 'BF_SNDFILE_LIB', 'BF_SNDFILE_LIBPATH',
'BF_PTHREADS', 'BF_PTHREADS_INC', 'BF_PTHREADS_LIB', 'BF_PTHREADS_LIBPATH',
'WITH_BF_OPENEXR', 'BF_OPENEXR', 'BF_OPENEXR_INC', 'BF_OPENEXR_LIB', 'BF_OPENEXR_LIBPATH', 'WITH_BF_STATICOPENEXR', 'BF_OPENEXR_LIB_STATIC',
'WITH_BF_DDS',
'WITH_BF_DDS', 'WITH_BF_CINEON', 'WITH_BF_HDR',
'WITH_BF_FFMPEG', 'BF_FFMPEG_LIB','BF_FFMPEG_EXTRA', 'BF_FFMPEG', 'BF_FFMPEG_INC',
'WITH_BF_OGG', 'BF_OGG', 'BF_OGG_LIB',
'WITH_BF_JPEG', 'BF_JPEG', 'BF_JPEG_INC', 'BF_JPEG_LIB', 'BF_JPEG_LIBPATH',
@ -78,7 +78,6 @@ def validate_arguments(args, bc):
'WITH_BF_DOCS',
'BF_NUMJOBS',
'BF_MSVS',
'WITH_BF_FHS',
'BF_VERSION',
'BF_GHOST_DEBUG',
'WITH_BF_RAYOPTIMIZATION',
@ -224,7 +223,11 @@ def read_opts(env, cfg, args):
('BF_OPENEXR_LIBPATH', 'OPENEXR library path', ''),
('BF_OPENEXR_LIB_STATIC', 'OPENEXR static library', ''),
(BoolVariable('WITH_BF_DDS', 'Use DDS if true', True)),
(BoolVariable('WITH_BF_DDS', 'Support DDS image format if true', True)),
(BoolVariable('WITH_BF_CINEON', 'Support CINEON and DPX image formats if true', True)),
(BoolVariable('WITH_BF_HDR', 'Support HDR image formats if true', True)),
(BoolVariable('WITH_BF_FFMPEG', 'Use FFMPEG if true', False)),
('BF_FFMPEG', 'FFMPEG base path', ''),
@ -428,13 +431,12 @@ def read_opts(env, cfg, args):
('BF_X264_CONFIG', 'configuration flags for x264', ''),
('BF_XVIDCORE_CONFIG', 'configuration flags for xvidcore', ''),
(BoolVariable('WITH_BF_DOCS', 'Generate API documentation', False)),
# (BoolVariable('WITH_BF_DOCS', 'Generate API documentation', False)),
('BF_CONFIG', 'SCons python config file used to set default options', 'user_config.py'),
('BF_NUMJOBS', 'Number of build processes to spawn', '1'),
('BF_MSVS', 'Generate MSVS project files and solution', False),
(BoolVariable('WITH_BF_FHS', 'Use the Unix "Filesystem Hierarchy Standard" rather then a redistributable directory layout', False)),
('BF_VERSION', 'The root path for Unix (non-apple)', '2.5'),
(BoolVariable('BF_UNIT_TEST', 'Build with unit test support.', False)),

@ -34,9 +34,9 @@ ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
ADD_SUBDIRECTORY(glew)
IF(WITH_OPENJPEG)
IF(WITH_IMAGE_OPENJPEG)
ADD_SUBDIRECTORY(libopenjpeg)
ENDIF(WITH_OPENJPEG)
ENDIF(WITH_IMAGE_OPENJPEG)
IF(WITH_LZO)
ADD_SUBDIRECTORY(lzo)

@ -38,8 +38,8 @@ ADD_SUBDIRECTORY(boolop)
ADD_SUBDIRECTORY(opennl)
ADD_SUBDIRECTORY(smoke)
IF(WITH_ELBEEM)
IF(WITH_FLUID)
ADD_SUBDIRECTORY(elbeem)
ENDIF(WITH_ELBEEM)
ENDIF(WITH_FLUID)
ADD_SUBDIRECTORY(bsp)

@ -60,7 +60,7 @@ public:
virtual void seek(int position)=0;
/**
* Returns an aproximated length of the source in samples.
* Returns an approximated length of the source in samples.
* For readers of the type buffer this has to return a correct value!
* \return The length as sample count. May be negative if unknown.
* \see getType

@ -44,7 +44,7 @@ AUD_StreamBufferFactory::AUD_StreamBufferFactory(AUD_IFactory* factory)
int index = 0;
sample_t* buffer;
// get an aproximated size if possible
// get an approximated size if possible
int size = reader->getLength();
if(size <= 0)

@ -1299,6 +1299,11 @@ GHOST_TUns8 GHOST_SystemCocoa::handleQuitRequest()
NSArray *windowsList = [NSApp orderedWindows];
if ([windowsList count]) {
[[windowsList objectAtIndex:0] makeKeyAndOrderFront:nil];
//Handle the modifiers keyes changed state issue
//as recovering from the quit dialog is like application
//gaining focus back.
//Main issue fixed is Cmd modifier not being cleared
handleApplicationBecomeActiveEvent();
}
}

@ -63,7 +63,7 @@
extern "C" {
#endif
/** Returns the lenght of the allocated memory segment pointed at
/** Returns the length of the allocated memory segment pointed at
* by vmemh. If the pointer was not previously allocated by this
* module, the result is undefined.*/
size_t MEM_allocN_len(void *vmemh);

@ -38,11 +38,11 @@ struct FLUID_3D;
void smoke_export(struct FLUID_3D *fluid, float *dt, float *dx, float **dens, float **densold, float **heat, float **heatold, float **vx, float **vy, float **vz, float **vxold, float **vyold, float **vzold, unsigned char **obstacles);
// low res
struct FLUID_3D *smoke_init(int *res, float *p0, float dt);
struct FLUID_3D *smoke_init(int *res, float *p0);
void smoke_free(struct FLUID_3D *fluid);
void smoke_initBlenderRNA(struct FLUID_3D *fluid, float *alpha, float *beta);
void smoke_step(struct FLUID_3D *fluid, size_t framenr);
void smoke_initBlenderRNA(struct FLUID_3D *fluid, float *alpha, float *beta, float *dt_factor, float *vorticity, int *border_colli);
void smoke_step(struct FLUID_3D *fluid, size_t framenr, float fps);
float *smoke_get_density(struct FLUID_3D *fluid);
float *smoke_get_heat(struct FLUID_3D *fluid);

@ -35,23 +35,15 @@
#include <omp.h>
#endif // PARALLEL
// boundary conditions of the fluid domain
#define DOMAIN_BC_FRONT 0 // z
#define DOMAIN_BC_TOP 1 // y
#define DOMAIN_BC_LEFT 1 // x
#define DOMAIN_BC_BACK DOMAIN_BC_FRONT
#define DOMAIN_BC_BOTTOM DOMAIN_BC_TOP
#define DOMAIN_BC_RIGHT DOMAIN_BC_LEFT
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
FLUID_3D::FLUID_3D(int *res, float *p0, float dt) :
_xRes(res[0]), _yRes(res[1]), _zRes(res[2]), _res(0.0f), _dt(dt)
FLUID_3D::FLUID_3D(int *res, float *p0) :
_xRes(res[0]), _yRes(res[1]), _zRes(res[2]), _res(0.0f)
{
// set simulation consts
// _dt = dt; // 0.10
_dt = DT_DEFAULT; // just in case. set in step from a RNA factor
// start point of array
_p0[0] = p0[0];
@ -61,7 +53,6 @@ FLUID_3D::FLUID_3D(int *res, float *p0, float dt) :
_iterations = 100;
_tempAmb = 0;
_heatDiffusion = 1e-3;
_vorticityEps = 2.0;
_totalTime = 0.0f;
_totalSteps = 0;
_res = Vec3Int(_xRes,_yRes,_zRes);
@ -77,9 +68,9 @@ FLUID_3D::FLUID_3D(int *res, float *p0, float dt) :
// scale the constants according to the refinement of the grid
_dx = 1.0f / (float)_maxRes;
float scaling = 64.0f / _maxRes;
scaling = (scaling < 1.0f) ? 1.0f : scaling;
_vorticityEps /= scaling;
_constantScaling = 64.0f / _maxRes;
_constantScaling = (_constantScaling < 1.0f) ? 1.0f : _constantScaling;
_vorticityEps = 2.0f / _constantScaling; // Just in case set a default value
// allocate arrays
_totalCells = _xRes * _yRes * _zRes;
@ -126,30 +117,42 @@ FLUID_3D::FLUID_3D(int *res, float *p0, float dt) :
_obstacles[x] = false;
}
// boundary conditions of the fluid domain
// set default values -> vertically non-colliding
_domainBcFront = true;
_domainBcTop = false;
_domainBcLeft = true;
_domainBcBack = _domainBcFront;
_domainBcBottom = _domainBcTop;
_domainBcRight = _domainBcLeft;
_colloPrev = 1; // default value
// set side obstacles
int index;
for (int y = 0; y < _yRes; y++)
for (int x = 0; x < _xRes; x++)
{
// front slab
// bottom slab
index = x + y * _xRes;
if(DOMAIN_BC_FRONT==1) _obstacles[index] = 1;
if(_domainBcBottom==1) _obstacles[index] = 1;
// back slab
// top slab
index += _totalCells - _slabSize;
if(DOMAIN_BC_BACK==1) _obstacles[index] = 1;
if(_domainBcTop==1) _obstacles[index] = 1;
}
for (int z = 0; z < _zRes; z++)
for (int x = 0; x < _xRes; x++)
{
// bottom slab
// front slab
index = x + z * _slabSize;
if(DOMAIN_BC_BOTTOM==1) _obstacles[index] = 1;
if(_domainBcFront==1) _obstacles[index] = 1;
// top slab
// back slab
index += _slabSize - _xRes;
if(DOMAIN_BC_TOP==1) _obstacles[index] = 1;
if(_domainBcBack==1) _obstacles[index] = 1;
}
for (int z = 0; z < _zRes; z++)
@ -157,12 +160,13 @@ FLUID_3D::FLUID_3D(int *res, float *p0, float dt) :
{
// left slab
index = y * _xRes + z * _slabSize;
if(DOMAIN_BC_LEFT==1) _obstacles[index] = 1;
if(_domainBcLeft==1) _obstacles[index] = 1;
// right slab
index += _xRes - 1;
if(DOMAIN_BC_RIGHT==1) _obstacles[index] = 1;
if(_domainBcRight==1) _obstacles[index] = 1;
}
}
FLUID_3D::~FLUID_3D()
@ -193,17 +197,32 @@ FLUID_3D::~FLUID_3D()
}
// init direct access functions from blender
void FLUID_3D::initBlenderRNA(float *alpha, float *beta)
void FLUID_3D::initBlenderRNA(float *alpha, float *beta, float *dt_factor, float *vorticity, int *borderCollision)
{
_alpha = alpha;
_beta = beta;
_dtFactor = dt_factor;
_vorticityRNA = vorticity;
_borderColli = borderCollision;
}
//////////////////////////////////////////////////////////////////////
// step simulation once
//////////////////////////////////////////////////////////////////////
void FLUID_3D::step()
void FLUID_3D::step(float dt)
{
// If border rules have been changed
if (_colloPrev != *_borderColli) {
setBorderCollisions();
}
// set delta time by dt_factor
_dt = (*_dtFactor) * dt;
// set vorticity from RNA value
_vorticityEps = (*_vorticityRNA)/_constantScaling;
#if PARALLEL==1
int threadval = 1;
threadval = omp_get_max_threads();
@ -246,6 +265,13 @@ void FLUID_3D::step()
#pragma omp single
{
#endif
/*
* addForce() changed Temp values to preserve thread safety
* (previous functions in per thread loop still needed
* original velocity data)
*
* So swap temp values to velocity
*/
SWAP_POINTERS(_xVelocity, _xVelocityTemp);
SWAP_POINTERS(_yVelocity, _yVelocityTemp);
SWAP_POINTERS(_zVelocity, _zVelocityTemp);
@ -276,6 +302,10 @@ void FLUID_3D::step()
#pragma omp single
{
#endif
/*
* For thread safety use "Old" to read
* "current" values but still allow changing values.
*/
SWAP_POINTERS(_xVelocity, _xVelocityOld);
SWAP_POINTERS(_yVelocity, _yVelocityOld);
SWAP_POINTERS(_zVelocity, _zVelocityOld);
@ -334,6 +364,10 @@ void FLUID_3D::step()
}
#endif
/*
* swap final velocity back to Velocity array
* from temp xForce storage
*/
SWAP_POINTERS(_xVelocity, _xForce);
SWAP_POINTERS(_yVelocity, _yForce);
SWAP_POINTERS(_zVelocity, _zForce);
@ -351,6 +385,88 @@ void FLUID_3D::step()
}
// Set border collision model from RNA setting
void FLUID_3D::setBorderCollisions() {
_colloPrev = *_borderColli; // saving the current value
// boundary conditions of the fluid domain
if (_colloPrev == 0)
{
// No collisions
_domainBcFront = false;
_domainBcTop = false;
_domainBcLeft = false;
}
else if (_colloPrev == 2)
{
// Collide with all sides
_domainBcFront = true;
_domainBcTop = true;
_domainBcLeft = true;
}
else
{
// Default values: Collide with "walls", but not top and bottom
_domainBcFront = true;
_domainBcTop = false;
_domainBcLeft = true;
}
_domainBcBack = _domainBcFront;
_domainBcBottom = _domainBcTop;
_domainBcRight = _domainBcLeft;
// set side obstacles
int index;
for (int y = 0; y < _yRes; y++)
for (int x = 0; x < _xRes; x++)
{
// front slab
index = x + y * _xRes;
if(_domainBcBottom==1) _obstacles[index] = 1;
else _obstacles[index] = 0;
// back slab
index += _totalCells - _slabSize;
if(_domainBcTop==1) _obstacles[index] = 1;
else _obstacles[index] = 0;
}
for (int z = 0; z < _zRes; z++)
for (int x = 0; x < _xRes; x++)
{
// bottom slab
index = x + z * _slabSize;
if(_domainBcFront==1) _obstacles[index] = 1;
else _obstacles[index] = 0;
// top slab
index += _slabSize - _xRes;
if(_domainBcBack==1) _obstacles[index] = 1;
else _obstacles[index] = 0;
}
for (int z = 0; z < _zRes; z++)
for (int y = 0; y < _yRes; y++)
{
// left slab
index = y * _xRes + z * _slabSize;
if(_domainBcLeft==1) _obstacles[index] = 1;
else _obstacles[index] = 0;
// right slab
index += _xRes - 1;
if(_domainBcRight==1) _obstacles[index] = 1;
else _obstacles[index] = 0;
}
}
//////////////////////////////////////////////////////////////////////
// helper function to dampen co-located grid artifacts of given arrays in intervals
// (only needed for velocity, strength (w) depends on testcase...
@ -428,6 +544,10 @@ void FLUID_3D::artificialDampingExactSL(int pos) {
for (y = 1; y < _res[1]-1; y++)
for (x = 1+(y+z)%2; x < _res[0]-1; x+=2) {
index = x + y*_res[0] + posslab;
/*
* Uses xForce as temporary storage to allow other threads to read
* old values from xVelocityTemp
*/
_xForce[index] = (1-w)*_xVelocityTemp[index] + 1./6. * w*(
_xVelocityTemp[index+1] + _xVelocityTemp[index-1] +
_xVelocityTemp[index+_res[0]] + _xVelocityTemp[index-_res[0]] +
@ -450,6 +570,11 @@ void FLUID_3D::artificialDampingExactSL(int pos) {
for (y = 1; y < _res[1]-1; y++)
for (x = 1+(y+z+1)%2; x < _res[0]-1; x+=2) {
index = x + y*_res[0] + posslab;
/*
* Uses xForce as temporary storage to allow other threads to read
* old values from xVelocityTemp
*/
_xForce[index] = (1-w)*_xVelocityTemp[index] + 1./6. * w*(
_xVelocityTemp[index+1] + _xVelocityTemp[index-1] +
_xVelocityTemp[index+_res[0]] + _xVelocityTemp[index-_res[0]] +
@ -661,13 +786,13 @@ void FLUID_3D::project()
setObstacleBoundaries(_pressure, 0, _zRes);
// copy out the boundaries
if(DOMAIN_BC_LEFT == 0) setNeumannX(_xVelocity, _res, 0, _zRes);
if(_domainBcLeft == 0) setNeumannX(_xVelocity, _res, 0, _zRes);
else setZeroX(_xVelocity, _res, 0, _zRes);
if(DOMAIN_BC_TOP == 0) setNeumannY(_yVelocity, _res, 0, _zRes);
if(_domainBcFront == 0) setNeumannY(_yVelocity, _res, 0, _zRes);
else setZeroY(_yVelocity, _res, 0, _zRes);
if(DOMAIN_BC_FRONT == 0) setNeumannZ(_zVelocity, _res, 0, _zRes);
if(_domainBcTop == 0) setNeumannZ(_zVelocity, _res, 0, _zRes);
else setZeroZ(_zVelocity, _res, 0, _zRes);
// calculate divergence
@ -1060,13 +1185,13 @@ void FLUID_3D::advectMacCormackBegin(int zBegin, int zEnd)
{
Vec3Int res = Vec3Int(_xRes,_yRes,_zRes);
if(DOMAIN_BC_LEFT == 0) copyBorderX(_xVelocityOld, res, zBegin, zEnd);
if(_domainBcLeft == 0) copyBorderX(_xVelocityOld, res, zBegin, zEnd);
else setZeroX(_xVelocityOld, res, zBegin, zEnd);
if(DOMAIN_BC_TOP == 0) copyBorderY(_yVelocityOld, res, zBegin, zEnd);
if(_domainBcFront == 0) copyBorderY(_yVelocityOld, res, zBegin, zEnd);
else setZeroY(_yVelocityOld, res, zBegin, zEnd);
if(DOMAIN_BC_FRONT == 0) copyBorderZ(_zVelocityOld, res, zBegin, zEnd);
if(_domainBcTop == 0) copyBorderZ(_zVelocityOld, res, zBegin, zEnd);
else setZeroZ(_zVelocityOld, res, zBegin, zEnd);
}
@ -1114,13 +1239,13 @@ void FLUID_3D::advectMacCormackEnd2(int zBegin, int zEnd)
advectFieldMacCormack2(dt0, _xVelocityOld, _yVelocityOld, _zVelocityOld, _yVelocityOld, _yVelocityTemp, _yVelocity, t1, res, _obstacles, zBegin, zEnd);
advectFieldMacCormack2(dt0, _xVelocityOld, _yVelocityOld, _zVelocityOld, _zVelocityOld, _zVelocityTemp, _zVelocity, t1, res, _obstacles, zBegin, zEnd);
if(DOMAIN_BC_LEFT == 0) copyBorderX(_xVelocityTemp, res, zBegin, zEnd);
if(_domainBcLeft == 0) copyBorderX(_xVelocityTemp, res, zBegin, zEnd);
else setZeroX(_xVelocityTemp, res, zBegin, zEnd);
if(DOMAIN_BC_TOP == 0) copyBorderY(_yVelocityTemp, res, zBegin, zEnd);
if(_domainBcFront == 0) copyBorderY(_yVelocityTemp, res, zBegin, zEnd);
else setZeroY(_yVelocityTemp, res, zBegin, zEnd);
if(DOMAIN_BC_FRONT == 0) copyBorderZ(_zVelocityTemp, res, zBegin, zEnd);
if(_domainBcTop == 0) copyBorderZ(_zVelocityTemp, res, zBegin, zEnd);
else setZeroZ(_zVelocityTemp, res, zBegin, zEnd);
setZeroBorder(_density, res, zBegin, zEnd);

@ -30,11 +30,15 @@
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iostream>
#include "OBSTACLE.h"
// #include "WTURBULENCE.h"
#include "VEC3.h"
// timestep default value for nice appearance
#define DT_DEFAULT 0.1f;
using namespace std;
using namespace BasicVector;
class WTURBULENCE;
@ -42,11 +46,11 @@ class WTURBULENCE;
class FLUID_3D
{
public:
FLUID_3D(int *res, /* int amplify, */ float *p0, float dt);
FLUID_3D(int *res, /* int amplify, */ float *p0);
FLUID_3D() {};
virtual ~FLUID_3D();
void initBlenderRNA(float *alpha, float *beta);
void initBlenderRNA(float *alpha, float *beta, float *dt_factor, float *vorticity, int *border_colli);
// create & allocate vector noise advection
void initVectorNoise(int amplify);
@ -54,7 +58,7 @@ class FLUID_3D
void addSmokeColumn();
static void addSmokeTestCase(float* field, Vec3Int res);
void step();
void step(float dt);
void addObstacle(OBSTACLE* obstacle);
const float* xVelocity() { return _xVelocity; };
@ -110,11 +114,25 @@ class FLUID_3D
// simulation constants
float _dt;
float *_dtFactor;
float _vorticityEps;
float _heatDiffusion;
float *_vorticityRNA; // RNA-pointer.
float *_alpha; // for the buoyancy density term <-- as pointer to get blender RNA in here
float *_beta; // was _buoyancy <-- as pointer to get blender RNA in here
float _tempAmb; /* ambient temperature */
float _constantScaling;
bool _domainBcFront; // z
bool _domainBcTop; // y
bool _domainBcLeft; // x
bool _domainBcBack; // DOMAIN_BC_FRONT
bool _domainBcBottom; // DOMAIN_BC_TOP
bool _domainBcRight; // DOMAIN_BC_LEFT
int *_borderColli; // border collision rules <-- as pointer to get blender RNA in here
int _colloPrev; // To track whether value has been changed (to not
// have to recalibrate borders if nothing has changed
void setBorderCollisions();
// WTURBULENCE object, if active
// WTURBULENCE* _wTurbulence;

@ -33,10 +33,10 @@
#include <math.h>
// y in smoke is z in blender
extern "C" FLUID_3D *smoke_init(int *res, float *p0, float dt)
extern "C" FLUID_3D *smoke_init(int *res, float *p0)
{
// smoke lib uses y as top-bottom/vertical axis where blender uses z
FLUID_3D *fluid = new FLUID_3D(res, p0, dt);
FLUID_3D *fluid = new FLUID_3D(res, p0);
// printf("xres: %d, yres: %d, zres: %d\n", res[0], res[1], res[2]);
@ -75,9 +75,41 @@ extern "C" size_t smoke_get_index2d(int x, int max_x, int y /*, int max_y, int z
return x + y * max_x;
}
extern "C" void smoke_step(FLUID_3D *fluid, size_t framenr)
extern "C" void smoke_step(FLUID_3D *fluid, size_t framenr, float fps)
{
fluid->step();
/* stability values copied from wturbulence.cpp */
const int maxSubSteps = 25;
const float maxVel = 0.5f; /* TODO: maybe 0.5 is still too high, please confirm! -dg */
float dt = DT_DEFAULT;
float maxVelMag = 0.0f;
int totalSubsteps;
int substep = 0;
float dtSubdiv;
/* get max velocity and lower the dt value if it is too high */
size_t size= fluid->_xRes * fluid->_yRes * fluid->_zRes;
for(size_t i = 0; i < size; i++)
{
float vtemp = (fluid->_xVelocity[i]*fluid->_xVelocity[i]+fluid->_yVelocity[i]*fluid->_yVelocity[i]+fluid->_zVelocity[i]*fluid->_zVelocity[i]);
if(vtemp > maxVelMag)
maxVelMag = vtemp;
}
/* adapt timestep for different framerates, dt = 0.1 is at 25fps */
dt *= (25.0f / fps);
maxVelMag = sqrt(maxVelMag) * dt * (*(fluid->_dtFactor));
totalSubsteps = (int)((maxVelMag / maxVel) + 1.0f); /* always round up */
totalSubsteps = (totalSubsteps < 1) ? 1 : totalSubsteps;
totalSubsteps = (totalSubsteps > maxSubSteps) ? maxSubSteps : totalSubsteps;
dtSubdiv = (float)dt / (float)totalSubsteps;
// printf("totalSubsteps: %d, maxVelMag: %f, dt: %f\n", totalSubsteps, maxVelMag, dt);
for(substep = 0; substep < totalSubsteps; substep++)
fluid->step(dtSubdiv);
}
extern "C" void smoke_turbulence_step(WTURBULENCE *wt, FLUID_3D *fluid)
@ -85,9 +117,9 @@ extern "C" void smoke_turbulence_step(WTURBULENCE *wt, FLUID_3D *fluid)
wt->stepTurbulenceFull(fluid->_dt/fluid->_dx, fluid->_xVelocity, fluid->_yVelocity, fluid->_zVelocity, fluid->_obstacles);
}
extern "C" void smoke_initBlenderRNA(FLUID_3D *fluid, float *alpha, float *beta)
extern "C" void smoke_initBlenderRNA(FLUID_3D *fluid, float *alpha, float *beta, float *dt_factor, float *vorticity, int *border_colli)
{
fluid->initBlenderRNA(alpha, beta);
fluid->initBlenderRNA(alpha, beta, dt_factor, vorticity, border_colli);
}
extern "C" void smoke_dissolve(FLUID_3D *fluid, int speed, int log)

@ -51,7 +51,7 @@ $(DIR)%/LC_MESSAGES/blender.mo: %.po
mkdir -p $(@D)
msgfmt -o $@ $<
ifeq ($(BF_VERIFY_MO_FILES), true)
@cmp $@ $(NANBLENDERHOME)/bin/.blender/locale/$(basename $<)/LC_MESSAGES/blender.mo \
@cmp $@ $(NANBLENDERHOME)/release/bin/.blender/locale/$(basename $<)/LC_MESSAGES/blender.mo \
|| ( echo Mismatch between generated and commited $(basename $<).mo catalog && \
rm -f $@ && false )
endif

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Version="9.00"
Name="BKE_blenkernel"
ProjectGUID="{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}"
RootNamespace="BKE_blenkernel"
@ -742,6 +742,10 @@
RelativePath="..\..\..\source\blender\blenkernel\intern\script.c"
>
</File>
<File
RelativePath="..\..\..\source\blender\blenkernel\intern\seqcache.c"
>
</File>
<File
RelativePath="..\..\..\source\blender\blenkernel\intern\seqeffects.c"
>

@ -1599,10 +1599,6 @@
RelativePath="..\..\..\source\blender\editors\space_logic\logic_buttons.c"
>
</File>
<File
RelativePath="..\..\..\source\blender\editors\space_logic\logic_header.c"
>
</File>
<File
RelativePath="..\..\..\source\blender\editors\space_logic\logic_intern.h"
>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Version="9.00"
Name="RNA_rna"
ProjectGUID="{DFE7F3E3-E62A-4677-B666-DF0DDF70C359}"
RootNamespace="RNA_rna"
@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesrna\intern;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\ikplugin;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\source\blender\gpu;..\..\..\source\blender\render\extern\include"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesrna\intern;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\ikplugin;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\source\blender\gpu;..\..\..\source\blender\render\extern\include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;GAMEBLENDER=1"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@ -114,7 +114,7 @@
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesrna\intern;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\ikplugin;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\source\blender\gpu;..\..\..\source\blender\render\extern\include"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesrna\intern;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\ikplugin;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\source\blender\gpu;..\..\..\source\blender\render\extern\include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;GAMEBLENDER=1"
MinimalRebuild="true"
RuntimeLibrary="0"

@ -114,8 +114,8 @@ install: package
ifneq ($(OS), darwin)
@[ ! -d $(OCGDIR)/bin/.blender ] || \
cp -r $(OCGDIR)/bin/.blender $(DISTDIR)
@cp $(NANBLENDERHOME)/bin/.blender/.Blanguages $(CONFDIR)
@cp $(NANBLENDERHOME)/bin/.blender/.bfont.ttf $(CONFDIR)
@cp $(NANBLENDERHOME)/release/bin/.blender/.Blanguages $(CONFDIR)
@cp $(NANBLENDERHOME)/release/bin/.blender/.bfont.ttf $(CONFDIR)
endif
@echo "----> Copy blender$(EXT0) executable"
ifeq ($(TYPE),-static)

File diff suppressed because it is too large Load Diff

@ -941,7 +941,8 @@ def save_3ds(filename, context):
sce = context.scene
# sce= bpy.data.scenes.active
bpy.ops.object.mode_set(mode='OBJECT')
if context.object:
bpy.ops.object.mode_set(mode='OBJECT')
# Initialize the main chunk (primary):
primary = _3ds_chunk(PRIMARY)
@ -1137,7 +1138,6 @@ class Export3DS(bpy.types.Operator):
def poll(self, context): # Poll isnt working yet
return context.active_object != None
# Add to a menu
def menu_func(self, context):
default_path = os.path.splitext(bpy.data.filepath)[0] + ".3ds"
@ -1145,11 +1145,9 @@ def menu_func(self, context):
def register():
bpy.types.register(Export3DS)
bpy.types.INFO_MT_file_export.append(menu_func)
def unregister():
bpy.types.unregister(Export3DS)
bpy.types.INFO_MT_file_export.remove(menu_func)
if __name__ == "__main__":

@ -305,7 +305,8 @@ def write(filename, batch_objects = None, \
BATCH_OWN_DIR = False
):
bpy.ops.object.mode_set(mode='OBJECT')
if bpy.context.object:
bpy.ops.object.mode_set(mode='OBJECT')
# ----------------- Batch support!
if BATCH_ENABLE:
@ -947,10 +948,7 @@ def write(filename, batch_objects = None, \
render = scene.render
width = render.resolution_x
height = render.resolution_y
# render = scene.render
# width = render.sizeX
# height = render.sizeY
aspect = float(width)/height
aspect = width / height
data = my_cam.blenObject.data
@ -962,11 +960,9 @@ def write(filename, batch_objects = None, \
file.write('\n\t\t\tProperty: "FieldOfView", "FieldOfView", "A+",%.6f' % math.degrees(data.angle))
file.write('\n\t\t\tProperty: "FieldOfViewX", "FieldOfView", "A+",1')
file.write('\n\t\t\tProperty: "FieldOfViewY", "FieldOfView", "A+",1')
file.write('\n\t\t\tProperty: "FocalLength", "Real", "A+",14.0323972702026')
# file.write('\n\t\t\tProperty: "FocalLength", "Real", "A+",14.0323972702026')
file.write('\n\t\t\tProperty: "OpticalCenterX", "Real", "A+",%.6f' % data.shift_x) # not sure if this is in the correct units?
# file.write('\n\t\t\tProperty: "OpticalCenterX", "Real", "A+",%.6f' % data.shiftX) # not sure if this is in the correct units?
file.write('\n\t\t\tProperty: "OpticalCenterY", "Real", "A+",%.6f' % data.shift_y) # ditto
# file.write('\n\t\t\tProperty: "OpticalCenterY", "Real", "A+",%.6f' % data.shiftY) # ditto
file.write('\n\t\t\tProperty: "BackgroundColor", "Color", "A+",0,0,0')
file.write('\n\t\t\tProperty: "TurnTable", "Real", "A+",0')
file.write('\n\t\t\tProperty: "DisplayTurnTableIcon", "bool", "",1')
@ -975,7 +971,7 @@ def write(filename, batch_objects = None, \
file.write('\n\t\t\tProperty: "UseRealTimeMotionBlur", "bool", "",1')
file.write('\n\t\t\tProperty: "ResolutionMode", "enum", "",0')
file.write('\n\t\t\tProperty: "ApertureMode", "enum", "",2')
file.write('\n\t\t\tProperty: "GateFit", "enum", "",0')
file.write('\n\t\t\tProperty: "GateFit", "enum", "",2')
file.write('\n\t\t\tProperty: "CameraFormat", "enum", "",0')
file.write('\n\t\t\tProperty: "AspectW", "double", "",%i' % width)
file.write('\n\t\t\tProperty: "AspectH", "double", "",%i' % height)
@ -3443,12 +3439,10 @@ def menu_func(self, context):
def register():
bpy.types.register(ExportFBX)
bpy.types.INFO_MT_file_export.append(menu_func)
def unregister():
bpy.types.unregister(ExportFBX)
bpy.types.INFO_MT_file_export.remove(menu_func)
if __name__ == "__main__":

@ -189,12 +189,10 @@ def menu_func(self, context):
def register():
bpy.types.register(ExportMDD)
bpy.types.INFO_MT_file_export.append(menu_func)
def unregister():
bpy.types.unregister(ExportMDD)
bpy.types.INFO_MT_file_export.remove(menu_func)
if __name__ == "__main__":

@ -18,13 +18,6 @@
# <pep8 compliant>
"""
Name: 'Wavefront (.obj)...'
Blender: 248
Group: 'Export'
Tooltip: 'Save a Wavefront OBJ File'
"""
__author__ = "Campbell Barton, Jiri Hnidek, Paolo Ciccone"
__url__ = ['http://wiki.blender.org/index.php/Scripts/Manual/Export/wavefront_obj', 'www.blender.org', 'blenderartists.org']
__version__ = "1.21"
@ -634,7 +627,7 @@ def write(filepath, objects, scene,
# for vIdx, vWeight in me.getVertsFromGroup(vertexGroupName, 1):
vgroupsMap[vIdx].append((g.name, vWeight))
for f_index, f in enumerate(faces):
for f, f_index in face_index_pairs:
f_v = [{"index": index, "vertex": me.verts[index]} for index in f.verts]
# if f.verts[3] == 0:
@ -646,7 +639,7 @@ def write(filepath, objects, scene,
# f_mat = min(f.mat, len(materialNames)-1)
if faceuv:
tface = me.active_uv_texture.data[face_index_pairs[f_index][1]]
tface = me.active_uv_texture.data[f_index]
f_image = tface.image
f_uv = tface.uv
@ -823,7 +816,8 @@ def do_export(filepath, context,
orig_scene = context.scene
# Exit edit mode before exporting, so current object states are exported properly.
bpy.ops.object.mode_set(mode='OBJECT')
if context.object:
bpy.ops.object.mode_set(mode='OBJECT')
# if EXPORT_ALL_SCENES:
# export_scenes = bpy.data.scenes
@ -969,11 +963,9 @@ def menu_func(self, context):
def register():
bpy.types.register(ExportOBJ)
bpy.types.INFO_MT_file_export.append(menu_func)
def unregister():
bpy.types.unregister(ExportOBJ)
bpy.types.INFO_MT_file_export.remove(menu_func)

@ -99,7 +99,8 @@ def write(filename, scene, ob, \
Window.WaitCursor(1)
"""
bpy.ops.object.mode_set(mode='OBJECT')
if scene.objects.active:
bpy.ops.object.mode_set(mode='OBJECT')
#mesh = BPyMesh.getMeshFromObject(ob, None, EXPORT_APPLY_MODIFIERS, False, scn) # XXX
if EXPORT_APPLY_MODIFIERS:
@ -316,12 +317,10 @@ def menu_func(self, context):
def register():
bpy.types.register(ExportPLY)
bpy.types.INFO_MT_file_export.append(menu_func)
def unregister():
bpy.types.unregister(ExportPLY)
bpy.types.INFO_MT_file_export.remove(menu_func)
if __name__ == "__main__":

@ -1156,8 +1156,9 @@ def x3d_export(filename,
scene = context.scene
world = scene.world
bpy.ops.object.mode_set(mode='OBJECT')
if scene.objects.active:
bpy.ops.object.mode_set(mode='OBJECT')
# XXX these are global textures while .Get() returned only scene's?
alltextures = bpy.data.textures
@ -1247,11 +1248,9 @@ def menu_func(self, context):
def register():
bpy.types.register(ExportX3D)
bpy.types.INFO_MT_file_export.append(menu_func)
def unregister():
bpy.types.unregister(ExportX3D)
bpy.types.INFO_MT_file_export.remove(menu_func)
# NOTES

@ -612,12 +612,10 @@ def menu_func(self, context):
def register():
bpy.types.register(BvhImporter)
bpy.types.INFO_MT_file_import.append(menu_func)
def unregister():
bpy.types.unregister(BvhImporter)
bpy.types.INFO_MT_file_import.remove(menu_func)
if __name__ == "__main__":

@ -883,14 +883,12 @@ def load_3ds(filename, context, IMPORT_CONSTRAIN_BOUNDS=10.0, IMAGE_SEARCH=True,
# REMOVE DUMMYVERT, - remove this in the next release when blenders internal are fixed.
# for ob in importedObjects:
# if ob.type == 'MESH':
# # if ob.type=='Mesh':
# me = ob.getData(mesh=1)
# me.verts.delete([me.verts[0],])
# if not APPLY_MATRIX:
# me.transform(ob.matrix_world.copy().invert())
for ob in importedObjects:
if ob.type == 'MESH':
me = ob.data
# me.verts.delete([me.verts[0],]) # XXX, todo
if not APPLY_MATRIX:
me.transform(ob.matrix_world.copy().invert())
# Done DUMMYVERT
"""
@ -1009,15 +1007,19 @@ class IMPORT_OT_autodesk_3ds(bpy.types.Operator):
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
filepath = StringProperty(name="File Path", description="Filepath used for importing the 3DS file", maxlen= 1024, default= "")
# size_constraint = FloatProperty(name="Size Constraint", description="Scale the model by 10 until it reacehs the size constraint. Zero Disables.", min=0.0, max=1000.0, soft_min=0.0, soft_max=1000.0, default=10.0),
# search_images = BoolProperty(name="Image Search", description="Search subdirectories for any assosiated images (Warning, may be slow)", default=True),
# apply_matrix = BoolProperty(name="Transform Fix", description="Workaround for object transformations importing incorrectly", default=False),
constrain_size = FloatProperty(name="Size Constraint", description="Scale the model by 10 until it reacehs the size constraint. Zero Disables.", min=0.0, max=1000.0, soft_min=0.0, soft_max=1000.0, default=10.0)
search_images = BoolProperty(name="Image Search", description="Search subdirectories for any assosiated images (Warning, may be slow)", default=True)
apply_transform = BoolProperty(name="Apply Transform", description="Workaround for object transformations importing incorrectly", default=False)
def execute(self, context):
load_3ds(self.properties.filepath, context, 0.0, False, False)
load_3ds(self.properties.filepath,
context,
IMPORT_CONSTRAIN_BOUNDS=self.properties.constrain_size,
IMAGE_SEARCH=self.properties.search_images,
APPLY_MATRIX=self.properties.apply_transform)
return {'FINISHED'}
def invoke(self, context, event):
@ -1030,11 +1032,9 @@ def menu_func(self, context):
self.layout.operator(IMPORT_OT_autodesk_3ds.bl_idname, text="3D Studio (.3ds)")
def register():
bpy.types.register(IMPORT_OT_autodesk_3ds)
bpy.types.INFO_MT_file_import.append(menu_func)
def unregister():
bpy.types.unregister(IMPORT_OT_autodesk_3ds)
bpy.types.INFO_MT_file_import.remove(menu_func)
# NOTES:

@ -420,8 +420,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
# Add an MTL with the same name as the obj if no MTLs are spesified.
temp_mtl = os.path.splitext((os.path.basename(filepath)))[0] + '.mtl'
if os.path.exists(DIR + temp_mtl) and temp_mtl not in material_libs:
# if sys.exists(DIR + temp_mtl) and temp_mtl not in material_libs:
if os.path.exists(os.path.join(DIR, temp_mtl)) and temp_mtl not in material_libs:
material_libs.append( temp_mtl )
del temp_mtl
@ -435,11 +434,9 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
unique_material_images[None]= None, False
for libname in material_libs:
mtlpath= DIR + libname
mtlpath= os.path.join(DIR, libname)
if not os.path.exists(mtlpath):
# if not sys.exists(mtlpath):
#print '\tError Missing MTL: "%s"' % mtlpath
pass
print ("\tError Missing MTL: '%s'" % mtlpath)
else:
#print '\t\tloading mtl: "%s"' % mtlpath
context_material= None
@ -1609,11 +1606,9 @@ def menu_func(self, context):
def register():
bpy.types.register(IMPORT_OT_obj)
bpy.types.INFO_MT_file_import.append(menu_func)
def unregister():
bpy.types.unregister(IMPORT_OT_obj)
bpy.types.INFO_MT_file_import.remove(menu_func)

@ -143,12 +143,10 @@ def menu_func(self, context):
def register():
bpy.types.register(importMDD)
bpy.types.INFO_MT_file_import.append(menu_func)
def unregister():
bpy.types.unregister(importMDD)
bpy.types.INFO_MT_file_import.remove(menu_func)
if __name__ == "__main__":

@ -18,16 +18,31 @@
# This directory is a Python package.
from netrender import model
from netrender import operators
from netrender import client
from netrender import slave
from netrender import master
from netrender import master_html
from netrender import utils
from netrender import balancing
from netrender import ui
from netrender import repath
# To support reload properly, try to access a package var, if it's there, reload everything
try:
init_data
reload(model)
reload(operators)
reload(client)
reload(slave)
reload(master)
reload(master_html)
reload(utils)
reload(balancing)
reload(ui)
reload(repath)
except:
from netrender import model
from netrender import operators
from netrender import client
from netrender import slave
from netrender import master
from netrender import master_html
from netrender import utils
from netrender import balancing
from netrender import ui
from netrender import repath
jobs = []
slaves = []
@ -38,11 +53,10 @@ init_data = True
init_address = True
def register():
pass # TODO
ui.addProperties()
def unregister():
import bpy
bpy.types.unregister(ui.NetRenderJob)
bpy.types.unregister(ui.NetRenderSettings)
bpy.types.unregister(ui.NetRenderSlave)
bpy.types.Scene.RemoveProperty("network_render")

@ -189,7 +189,6 @@ def clientSendJob(conn, scene, anim = False):
def requestResult(conn, job_id, frame):
conn.request("GET", renderURL(job_id, frame))
@rnaType
class NetworkRenderEngine(bpy.types.RenderEngine):
bl_idname = 'NET_RENDER'
bl_label = "Network Render"

@ -26,7 +26,6 @@ from netrender.utils import *
import netrender.client as client
import netrender.model
@rnaType
class RENDER_OT_netslave_bake(bpy.types.Operator):
'''NEED DESCRIPTION'''
bl_idname = "render.netslavebake"
@ -84,7 +83,6 @@ class RENDER_OT_netslave_bake(bpy.types.Operator):
def invoke(self, context, event):
return self.execute(context)
@rnaType
class RENDER_OT_netclientanim(bpy.types.Operator):
'''Start rendering an animation on network'''
bl_idname = "render.netclientanim"
@ -111,7 +109,6 @@ class RENDER_OT_netclientanim(bpy.types.Operator):
def invoke(self, context, event):
return self.execute(context)
@rnaType
class RENDER_OT_netclientrun(bpy.types.Operator):
'''Start network rendering service'''
bl_idname = "render.netclientstart"
@ -128,7 +125,6 @@ class RENDER_OT_netclientrun(bpy.types.Operator):
def invoke(self, context, event):
return self.execute(context)
@rnaType
class RENDER_OT_netclientsend(bpy.types.Operator):
'''Send Render Job to the Network'''
bl_idname = "render.netclientsend"
@ -158,7 +154,6 @@ class RENDER_OT_netclientsend(bpy.types.Operator):
def invoke(self, context, event):
return self.execute(context)
@rnaType
class RENDER_OT_netclientsendframe(bpy.types.Operator):
'''Send Render Job with current frame to the Network'''
bl_idname = "render.netclientsendframe"
@ -188,7 +183,6 @@ class RENDER_OT_netclientsendframe(bpy.types.Operator):
def invoke(self, context, event):
return self.execute(context)
@rnaType
class RENDER_OT_netclientstatus(bpy.types.Operator):
'''Refresh the status of the current jobs'''
bl_idname = "render.netclientstatus"
@ -228,7 +222,6 @@ class RENDER_OT_netclientstatus(bpy.types.Operator):
def invoke(self, context, event):
return self.execute(context)
@rnaType
class RENDER_OT_netclientblacklistslave(bpy.types.Operator):
'''Operator documentation text, will be used for the operator tooltip and python docs.'''
bl_idname = "render.netclientblacklistslave"
@ -258,7 +251,6 @@ class RENDER_OT_netclientblacklistslave(bpy.types.Operator):
def invoke(self, context, event):
return self.execute(context)
@rnaType
class RENDER_OT_netclientwhitelistslave(bpy.types.Operator):
'''Operator documentation text, will be used for the operator tooltip and python docs.'''
bl_idname = "render.netclientwhitelistslave"
@ -289,7 +281,6 @@ class RENDER_OT_netclientwhitelistslave(bpy.types.Operator):
return self.execute(context)
@rnaType
class RENDER_OT_netclientslaves(bpy.types.Operator):
'''Refresh status about available Render slaves'''
bl_idname = "render.netclientslaves"
@ -334,7 +325,6 @@ class RENDER_OT_netclientslaves(bpy.types.Operator):
def invoke(self, context, event):
return self.execute(context)
@rnaType
class RENDER_OT_netclientcancel(bpy.types.Operator):
'''Cancel the selected network rendering job.'''
bl_idname = "render.netclientcancel"
@ -363,7 +353,6 @@ class RENDER_OT_netclientcancel(bpy.types.Operator):
def invoke(self, context, event):
return self.execute(context)
@rnaType
class RENDER_OT_netclientcancelall(bpy.types.Operator):
'''Cancel all running network rendering jobs.'''
bl_idname = "render.netclientcancelall"
@ -390,7 +379,6 @@ class RENDER_OT_netclientcancelall(bpy.types.Operator):
def invoke(self, context, event):
return self.execute(context)
@rnaType
class netclientdownload(bpy.types.Operator):
'''Download render results from the network'''
bl_idname = "render.netclientdownload"
@ -435,7 +423,6 @@ class netclientdownload(bpy.types.Operator):
def invoke(self, context, event):
return self.execute(context)
@rnaType
class netclientscan(bpy.types.Operator):
'''Listen on network for master server broadcasting its address and port.'''
bl_idname = "render.netclientscan"
@ -458,7 +445,6 @@ class netclientscan(bpy.types.Operator):
def invoke(self, context, event):
return self.execute(context)
@rnaType
class netclientweb(bpy.types.Operator):
'''Open new window with information about running rendering jobs'''
bl_idname = "render.netclientweb"

0
release/scripts/io/netrender/repath.py Executable file → Normal file

@ -87,7 +87,6 @@ class RenderButtonsPanel():
return (rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES)
# Setting panel, use in the scene for now.
@rnaType
class RENDER_PT_network_settings(bpy.types.Panel, RenderButtonsPanel):
bl_label = "Network Settings"
COMPAT_ENGINES = {'NET_RENDER'}
@ -122,7 +121,6 @@ class RENDER_PT_network_settings(bpy.types.Panel, RenderButtonsPanel):
layout.operator("render.netclientweb", icon='QUESTION')
@rnaType
class RENDER_PT_network_slave_settings(bpy.types.Panel, RenderButtonsPanel):
bl_label = "Slave Settings"
COMPAT_ENGINES = {'NET_RENDER'}
@ -147,7 +145,7 @@ class RENDER_PT_network_slave_settings(bpy.types.Panel, RenderButtonsPanel):
sub = layout.column()
sub.enabled = rd.threads_mode == 'FIXED'
sub.prop(rd, "threads")
@rnaType
class RENDER_PT_network_master_settings(bpy.types.Panel, RenderButtonsPanel):
bl_label = "Master Settings"
COMPAT_ENGINES = {'NET_RENDER'}
@ -166,7 +164,6 @@ class RENDER_PT_network_master_settings(bpy.types.Panel, RenderButtonsPanel):
layout.prop(netsettings, "master_broadcast")
layout.prop(netsettings, "master_clear")
@rnaType
class RENDER_PT_network_job(bpy.types.Panel, RenderButtonsPanel):
bl_label = "Job Settings"
COMPAT_ENGINES = {'NET_RENDER'}
@ -207,7 +204,6 @@ class RENDER_PT_network_job(bpy.types.Panel, RenderButtonsPanel):
row.prop(netsettings, "priority")
row.prop(netsettings, "chunks")
@rnaType
class RENDER_PT_network_slaves(bpy.types.Panel, RenderButtonsPanel):
bl_label = "Slaves Status"
COMPAT_ENGINES = {'NET_RENDER'}
@ -246,7 +242,6 @@ class RENDER_PT_network_slaves(bpy.types.Panel, RenderButtonsPanel):
layout.label(text="Seen: " + time.ctime(slave.last_seen))
layout.label(text="Stats: " + slave.stats)
@rnaType
class RENDER_PT_network_slaves_blacklist(bpy.types.Panel, RenderButtonsPanel):
bl_label = "Slaves Blacklist"
COMPAT_ENGINES = {'NET_RENDER'}
@ -284,7 +279,6 @@ class RENDER_PT_network_slaves_blacklist(bpy.types.Panel, RenderButtonsPanel):
layout.label(text="Seen: " + time.ctime(slave.last_seen))
layout.label(text="Stats: " + slave.stats)
@rnaType
class RENDER_PT_network_jobs(bpy.types.Panel, RenderButtonsPanel):
bl_label = "Jobs"
COMPAT_ENGINES = {'NET_RENDER'}
@ -325,150 +319,148 @@ class RENDER_PT_network_jobs(bpy.types.Panel, RenderButtonsPanel):
layout.label(text="Done: %04i" % job.results[DONE])
layout.label(text="Error: %04i" % job.results[ERROR])
@rnaType
class NetRenderSettings(bpy.types.IDPropertyGroup):
pass
@rnaType
class NetRenderSlave(bpy.types.IDPropertyGroup):
pass
@rnaType
class NetRenderJob(bpy.types.IDPropertyGroup):
pass
bpy.types.Scene.PointerProperty(attr="network_render", type=NetRenderSettings, name="Network Render", description="Network Render Settings")
NetRenderSettings.StringProperty( attr="server_address",
name="Server address",
description="IP or name of the master render server",
maxlen = 128,
default = "[default]")
NetRenderSettings.IntProperty( attr="server_port",
name="Server port",
description="port of the master render server",
default = 8000,
min=1,
max=65535)
NetRenderSettings.BoolProperty( attr="master_broadcast",
name="Broadcast",
description="broadcast master server address on local network",
default = True)
NetRenderSettings.BoolProperty( attr="slave_clear",
name="Clear on exit",
description="delete downloaded files on exit",
default = True)
NetRenderSettings.BoolProperty( attr="slave_thumb",
name="Generate thumbnails",
description="Generate thumbnails on slaves instead of master",
default = False)
NetRenderSettings.BoolProperty( attr="slave_outputlog",
name="Output render log on console",
description="Output render text log to console as well as sending it to the master",
default = True)
NetRenderSettings.BoolProperty( attr="master_clear",
name="Clear on exit",
description="delete saved files on exit",
default = False)
default_path = os.environ.get("TEMP")
if not default_path:
if os.name == 'nt':
default_path = "c:/tmp/"
else:
default_path = "/tmp/"
elif not default_path.endswith(os.sep):
default_path += os.sep
NetRenderSettings.StringProperty( attr="path",
name="Path",
description="Path for temporary files",
maxlen = 128,
default = default_path,
subtype='FILE_PATH')
NetRenderSettings.StringProperty( attr="job_name",
name="Job name",
description="Name of the job",
maxlen = 128,
default = "[default]")
NetRenderSettings.StringProperty( attr="job_category",
name="Job category",
description="Category of the job",
maxlen = 128,
default = "")
NetRenderSettings.IntProperty( attr="chunks",
name="Chunks",
description="Number of frame to dispatch to each slave in one chunk",
default = 5,
min=1,
max=65535)
NetRenderSettings.IntProperty( attr="priority",
name="Priority",
description="Priority of the job",
default = 1,
min=1,
max=10)
NetRenderSettings.StringProperty( attr="job_id",
name="Network job id",
description="id of the last sent render job",
maxlen = 64,
default = "")
NetRenderSettings.IntProperty( attr="active_slave_index",
name="Index of the active slave",
description="",
default = -1,
min= -1,
max=65535)
NetRenderSettings.IntProperty( attr="active_blacklisted_slave_index",
name="Index of the active slave",
description="",
default = -1,
min= -1,
max=65535)
NetRenderSettings.IntProperty( attr="active_job_index",
name="Index of the active job",
description="",
default = -1,
min= -1,
max=65535)
NetRenderSettings.EnumProperty(attr="mode",
items=(
("RENDER_CLIENT", "Client", "Act as render client"),
("RENDER_MASTER", "Master", "Act as render master"),
("RENDER_SLAVE", "Slave", "Act as render slave"),
),
name="Network mode",
description="Mode of operation of this instance",
default="RENDER_CLIENT")
NetRenderSettings.CollectionProperty(attr="slaves", type=NetRenderSlave, name="Slaves", description="")
NetRenderSettings.CollectionProperty(attr="slaves_blacklist", type=NetRenderSlave, name="Slaves Blacklist", description="")
NetRenderSettings.CollectionProperty(attr="jobs", type=NetRenderJob, name="Job List", description="")
NetRenderSlave.StringProperty( attr="name",
name="Name of the slave",
description="",
maxlen = 64,
default = "")
NetRenderJob.StringProperty( attr="name",
name="Name of the job",
description="",
maxlen = 128,
default = "")
def addProperties():
bpy.types.Scene.PointerProperty(attr="network_render", type=NetRenderSettings, name="Network Render", description="Network Render Settings")
NetRenderSettings.StringProperty( attr="server_address",
name="Server address",
description="IP or name of the master render server",
maxlen = 128,
default = "[default]")
NetRenderSettings.IntProperty( attr="server_port",
name="Server port",
description="port of the master render server",
default = 8000,
min=1,
max=65535)
NetRenderSettings.BoolProperty( attr="master_broadcast",
name="Broadcast",
description="broadcast master server address on local network",
default = True)
NetRenderSettings.BoolProperty( attr="slave_clear",
name="Clear on exit",
description="delete downloaded files on exit",
default = True)
NetRenderSettings.BoolProperty( attr="slave_thumb",
name="Generate thumbnails",
description="Generate thumbnails on slaves instead of master",
default = False)
NetRenderSettings.BoolProperty( attr="slave_outputlog",
name="Output render log on console",
description="Output render text log to console as well as sending it to the master",
default = True)
NetRenderSettings.BoolProperty( attr="master_clear",
name="Clear on exit",
description="delete saved files on exit",
default = False)
default_path = os.environ.get("TEMP")
if not default_path:
if os.name == 'nt':
default_path = "c:/tmp/"
else:
default_path = "/tmp/"
elif not default_path.endswith(os.sep):
default_path += os.sep
NetRenderSettings.StringProperty( attr="path",
name="Path",
description="Path for temporary files",
maxlen = 128,
default = default_path,
subtype='FILE_PATH')
NetRenderSettings.StringProperty( attr="job_name",
name="Job name",
description="Name of the job",
maxlen = 128,
default = "[default]")
NetRenderSettings.StringProperty( attr="job_category",
name="Job category",
description="Category of the job",
maxlen = 128,
default = "")
NetRenderSettings.IntProperty( attr="chunks",
name="Chunks",
description="Number of frame to dispatch to each slave in one chunk",
default = 5,
min=1,
max=65535)
NetRenderSettings.IntProperty( attr="priority",
name="Priority",
description="Priority of the job",
default = 1,
min=1,
max=10)
NetRenderSettings.StringProperty( attr="job_id",
name="Network job id",
description="id of the last sent render job",
maxlen = 64,
default = "")
NetRenderSettings.IntProperty( attr="active_slave_index",
name="Index of the active slave",
description="",
default = -1,
min= -1,
max=65535)
NetRenderSettings.IntProperty( attr="active_blacklisted_slave_index",
name="Index of the active slave",
description="",
default = -1,
min= -1,
max=65535)
NetRenderSettings.IntProperty( attr="active_job_index",
name="Index of the active job",
description="",
default = -1,
min= -1,
max=65535)
NetRenderSettings.EnumProperty(attr="mode",
items=(
("RENDER_CLIENT", "Client", "Act as render client"),
("RENDER_MASTER", "Master", "Act as render master"),
("RENDER_SLAVE", "Slave", "Act as render slave"),
),
name="Network mode",
description="Mode of operation of this instance",
default="RENDER_CLIENT")
NetRenderSettings.CollectionProperty(attr="slaves", type=NetRenderSlave, name="Slaves", description="")
NetRenderSettings.CollectionProperty(attr="slaves_blacklist", type=NetRenderSlave, name="Slaves Blacklist", description="")
NetRenderSettings.CollectionProperty(attr="jobs", type=NetRenderJob, name="Job List", description="")
NetRenderSlave.StringProperty( attr="name",
name="Name of the slave",
description="",
maxlen = 64,
default = "")
NetRenderJob.StringProperty( attr="name",
name="Name of the job",
description="",
maxlen = 128,
default = "")

@ -57,10 +57,6 @@ FRAME_STATUS_TEXT = {
ERROR: "Error"
}
def rnaType(rna_type):
if bpy: bpy.types.register(rna_type)
return rna_type
def reporting(report, message, errorType = None):
if errorType:
t = 'ERROR'

@ -30,7 +30,6 @@ import sys as _sys
from _bpy import blend_paths
from _bpy import script_paths as _bpy_script_paths
def _test_import(module_name, loaded_modules):
import traceback
import time
@ -84,9 +83,9 @@ def modules_from_path(path, loaded_modules):
modules.append(mod)
return modules
_loaded = [] # store loaded modules for reloading.
_bpy_types = __import__("bpy_types") # keep for comparisons, never ever reload this.
_global_loaded_modules = [] # store loaded module names for reloading.
import bpy_types as _bpy_types # keep for comparisons, never ever reload this.
def load_scripts(reload_scripts=False, refresh_scripts=False):
@ -101,12 +100,39 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
import traceback
import time
# must be set back to True on exits
_bpy_types._register_immediate = False
t_main = time.time()
loaded_modules = set()
if refresh_scripts:
original_modules = _sys.modules.values()
if reload_scripts:
_bpy_types.TypeMap.clear()
_bpy_types.PropertiesMap.clear()
def register_module_call(mod):
_bpy_types._register_module(mod.__name__)
register = getattr(mod, "register", None)
if register:
try:
register()
except:
traceback.print_exc()
else:
print("\nWarning! '%s' has no register function, this is now a requirement for registerable scripts." % mod.__file__)
def unregister_module_call(mod):
_bpy_types._unregister_module(mod.__name__)
unregister = getattr(mod, "unregister", None)
if unregister:
try:
unregister()
except:
traceback.print_exc()
def sys_path_ensure(path):
if path not in _sys.path: # reloading would add twice
@ -134,48 +160,23 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
mod = test_reload(mod)
if mod:
register = getattr(mod, "register", None)
if register:
try:
register()
except:
traceback.print_exc()
else:
print("\nWarning! '%s' has no register function, this is now a requirement for registerable scripts." % mod.__file__)
_loaded.append(mod)
register_module_call(mod)
_global_loaded_modules.append(mod.__name__)
if reload_scripts:
# TODO, this is broken but should work, needs looking into
'''
# reload modules that may not be directly included
for type_class_name in dir(_bpy.types):
type_class = getattr(_bpy.types, type_class_name)
module_name = getattr(type_class, "__module__", "")
if module_name and module_name != "bpy.types": # hard coded for C types
loaded_modules.add(module_name)
# sorting isnt needed but rather it be pradictable
for module_name in sorted(loaded_modules):
print("Reloading:", module_name)
test_reload(_sys.modules[module_name])
'''
# module names -> modules
_global_loaded_modules[:] = [_sys.modules[mod_name] for mod_name in _global_loaded_modules]
# loop over and unload all scripts
_loaded.reverse()
for mod in _loaded:
unregister = getattr(mod, "unregister", None)
if unregister:
try:
unregister()
except:
traceback.print_exc()
_global_loaded_modules.reverse()
for mod in _global_loaded_modules:
unregister_module_call(mod)
for mod in _loaded:
reload(mod)
for mod in _global_loaded_modules:
test_reload(mod)
_loaded[:] = []
_global_loaded_modules[:] = []
user_path = user_script_path()
@ -197,7 +198,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
# load addons
used_ext = {ext.module for ext in _bpy.context.user_preferences.addons}
paths = script_paths("addons")
paths = script_paths("addons") + script_paths("addons_contrib")
for path in paths:
sys_path_ensure(path)
@ -210,7 +211,9 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
print("gc.collect() -> %d" % gc.collect())
if _bpy.app.debug:
print("Time %.4f" % (time.time() - t_main))
print("Python Script Load Time %.4f" % (time.time() - t_main))
_bpy_types._register_immediate = True
def expandpath(path):
@ -238,30 +241,29 @@ def relpath(path, start=None):
return path
_unclean_chars = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, \
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, \
35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 58, 59, 60, 61, 62, 63, \
64, 91, 92, 93, 94, 96, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, \
133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, \
147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, \
161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, \
175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, \
189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, \
203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, \
217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, \
231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, \
245, 246, 247, 248, 249, 250, 251, 252, 253, 254]
_unclean_chars = ''.join([chr(i) for i in _unclean_chars])
def clean_name(name, replace="_"):
"""
Returns a name with characters replaced that may cause problems under various circumstances, such as writing to a file.
All characters besides A-Z/a-z, 0-9 are replaced with "_"
or the replace argument if defined.
"""
for ch in _unclean_chars:
unclean_chars = \
"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\
\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\
\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\
\x2e\x2f\x3a\x3b\x3c\x3d\x3e\x3f\x40\x5b\x5c\x5d\x5e\x60\x7b\
\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\
\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\
\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\
\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\
\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\
\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\
\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\
\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\
\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe"
for ch in unclean_chars:
name = name.replace(ch, replace)
return name
@ -337,7 +339,7 @@ _presets = _os.path.join(_scripts[0], "presets") # FIXME - multiple paths
def preset_paths(subdir):
'''
Returns a list of paths for a spesific preset.
Returns a list of paths for a specific preset.
'''
return (_os.path.join(_presets, subdir), )

@ -19,6 +19,7 @@
# <pep8 compliant>
from _bpy import types as bpy_types
import _bpy
from mathutils import Vector
StructRNA = bpy_types.Struct.__bases__[0]
@ -539,8 +540,83 @@ class Text(bpy_types.ID):
import collections
TypeMap = {}
# Properties (IDPropertyGroup) are different from types because they need to be registered
# before adding sub properties to them, so they are registered on definition
# and unregistered on unload
PropertiesMap = {}
class OrderedMeta(type):
# Using our own loading function we set this to false
# so when running a script directly in the text editor
# registers moduals instantly.
_register_immediate = True
def _unregister_module(module, free=True):
for t in TypeMap.get(module, ()):
try:
bpy_types.unregister(t)
except:
import traceback
print("bpy.utils._unregister_module(): Module '%s' failed to unregister class '%s.%s'" % (module, t.__module__, t.__name__))
traceback.print_exc()
if free == True and module in TypeMap:
del TypeMap[module]
for t in PropertiesMap.get(module, ()):
try:
bpy_types.unregister(t)
except:
import traceback
print("bpy.utils._unload_module(): Module '%s' failed to unregister class '%s.%s'" % (module, t.__module__, t.__name__))
traceback.print_exc()
if free == True and module in PropertiesMap:
del PropertiesMap[module]
def _register_module(module):
for t in TypeMap.get(module, ()):
try:
bpy_types.register(t)
except:
import traceback
print("bpy.utils._register_module(): Module '%s' failed to register class '%s.%s'" % (module, t.__module__, t.__name__))
traceback.print_exc()
class RNAMeta(type):
@classmethod
def _register_immediate(cls):
return _register_immediate
def __new__(cls, name, bases, classdict, **args):
result = type.__new__(cls, name, bases, classdict)
if bases and bases[0] != StructRNA:
module = result.__module__
ClassMap = TypeMap
# Register right away if needed
if cls._register_immediate():
bpy_types.register(result)
ClassMap = PropertiesMap
# first part of packages only
if "." in module:
module = module[:module.index(".")]
ClassMap.setdefault(module, []).append(result)
return result
class RNAMetaRegister(RNAMeta):
@classmethod
def _register_immediate(cls):
return True
class OrderedMeta(RNAMeta):
def __init__(cls, name, bases, attributes):
super(OrderedMeta, cls).__init__(name, bases, attributes)
@ -549,7 +625,6 @@ class OrderedMeta(type):
def __prepare__(name, bases, **kwargs):
return collections.OrderedDict()
# Only defined so operators members can be used by accessing self.order
class Operator(StructRNA, metaclass=OrderedMeta):
__slots__ = ()
@ -564,7 +639,12 @@ class Macro(StructRNA, metaclass=OrderedMeta):
def define(self, opname):
from _bpy import ops
return ops.macro_define(self, opname)
class IDPropertyGroup(StructRNA, metaclass=RNAMetaRegister):
__slots__ = ()
class RenderEngine(StructRNA, metaclass=RNAMeta):
__slots__ = ()
class _GenericUI:
__slots__ = ()
@ -606,15 +686,15 @@ class _GenericUI:
pass
class Panel(StructRNA, _GenericUI):
class Panel(StructRNA, _GenericUI, metaclass=RNAMeta):
__slots__ = ()
class Header(StructRNA, _GenericUI):
class Header(StructRNA, _GenericUI, metaclass=RNAMeta):
__slots__ = ()
class Menu(StructRNA, _GenericUI):
class Menu(StructRNA, _GenericUI, metaclass=RNAMeta):
__slots__ = ()
def path_menu(self, searchpaths, operator, props_default={}):

@ -124,7 +124,7 @@ def draw(layout, context, context_member, use_edit=True):
assign_props(prop, val_draw, key)
class PropertyPanel(bpy.types.Panel):
class PropertyPanel():
"""
The subclass should have its own poll function
and the variable '_context_path' MUST be set.
@ -135,130 +135,3 @@ class PropertyPanel(bpy.types.Panel):
def draw(self, context):
draw(self.layout, context, self._context_path)
from bpy.props import *
rna_path = StringProperty(name="Property Edit",
description="Property data_path edit", maxlen=1024, default="", options={'HIDDEN'})
rna_value = StringProperty(name="Property Value",
description="Property value edit", maxlen=1024, default="")
rna_property = StringProperty(name="Property Name",
description="Property name edit", maxlen=1024, default="")
rna_min = FloatProperty(name="Min", default=0.0, precision=3)
rna_max = FloatProperty(name="Max", default=1.0, precision=3)
class WM_OT_properties_edit(bpy.types.Operator):
'''Internal use (edit a property data_path)'''
bl_idname = "wm.properties_edit"
bl_label = "Edit Property"
data_path = rna_path
property = rna_property
value = rna_value
min = rna_min
max = rna_max
description = StringProperty(name="Tip", default="")
def execute(self, context):
data_path = self.properties.data_path
value = self.properties.value
prop = self.properties.property
prop_old = self._last_prop[0]
try:
value_eval = eval(value)
except:
value_eval = value
# First remove
item = eval("context.%s" % data_path)
rna_idprop_ui_prop_clear(item, prop_old)
exec_str = "del item['%s']" % prop_old
# print(exec_str)
exec(exec_str)
# Reassign
exec_str = "item['%s'] = %s" % (prop, repr(value_eval))
# print(exec_str)
exec(exec_str)
self._last_prop[:] = [prop]
prop_type = type(item[prop])
prop_ui = rna_idprop_ui_prop_get(item, prop)
if prop_type in (float, int):
prop_ui['soft_min'] = prop_ui['min'] = prop_type(self.properties.min)
prop_ui['soft_max'] = prop_ui['max'] = prop_type(self.properties.max)
prop_ui['description'] = self.properties.description
return {'FINISHED'}
def invoke(self, context, event):
self._last_prop = [self.properties.property]
item = eval("context.%s" % self.properties.data_path)
# setup defaults
prop_ui = rna_idprop_ui_prop_get(item, self.properties.property, False) # dont create
if prop_ui:
self.properties.min = prop_ui.get("min", -1000000000)
self.properties.max = prop_ui.get("max", 1000000000)
self.properties.description = prop_ui.get("description", "")
wm = context.manager
# This crashes, TODO - fix
#return wm.invoke_props_popup(self, event)
wm.invoke_props_popup(self, event)
return {'RUNNING_MODAL'}
class WM_OT_properties_add(bpy.types.Operator):
'''Internal use (edit a property data_path)'''
bl_idname = "wm.properties_add"
bl_label = "Add Property"
data_path = rna_path
def execute(self, context):
item = eval("context.%s" % self.properties.data_path)
def unique_name(names):
prop = 'prop'
prop_new = prop
i = 1
while prop_new in names:
prop_new = prop + str(i)
i += 1
return prop_new
property = unique_name(item.keys())
item[property] = 1.0
return {'FINISHED'}
class WM_OT_properties_remove(bpy.types.Operator):
'''Internal use (edit a property data_path)'''
bl_idname = "wm.properties_remove"
bl_label = "Remove Property"
data_path = rna_path
property = rna_property
def execute(self, context):
item = eval("context.%s" % self.properties.data_path)
del item[self.properties.property]
return {'FINISHED'}

@ -606,12 +606,10 @@ menu_func = (lambda self, context: self.layout.operator(AddHuman.bl_idname,
def register():
bpy.types.register(AddHuman)
bpy.types.INFO_MT_armature_add.append(menu_func)
def unregister():
bpy.types.unregister(AddHuman)
bpy.types.INFO_MT_armature_add.remove(menu_func)
if __name__ == "__main__":

@ -137,12 +137,10 @@ def menu_func(self, context):
def register():
bpy.types.register(AddTorus)
bpy.types.INFO_MT_mesh_add.append(menu_func)
def unregister():
bpy.types.unregister(AddTorus)
bpy.types.INFO_MT_mesh_add.remove(menu_func)
if __name__ == "__main__":

@ -22,6 +22,9 @@ import bpy
language_id = 'python'
# store our own __main__ module, not 100% needed
# but python expects this in some places
_BPY_MAIN_OWN = True
def add_scrollback(text, text_type):
for l in text.split('\n'):
@ -41,16 +44,17 @@ def get_console(console_id):
from code import InteractiveConsole
consoles = getattr(get_console, "consoles", None)
hash_next = hash(bpy.context.manager)
if consoles is None:
consoles = get_console.consoles = {}
get_console.consoles_namespace_hash = hash_next
else:
# check if clearning the namespace is needed to avoid a memory leak.
# the window manager is normally loaded with new blend files
# so this is a reasonable way to deal with namespace clearing.
# bpy.data hashing is reset by undo so cant be used.
hash_prev = getattr(get_console, "consoles_namespace_hash", 0)
hash_next = hash(bpy.context.manager)
if hash_prev != hash_next:
get_console.consoles_namespace_hash = hash_next
@ -67,8 +71,21 @@ def get_console(console_id):
stdout = io.StringIO()
stderr = io.StringIO()
else:
namespace = {'__builtins__': __builtins__, 'bpy': bpy}
if _BPY_MAIN_OWN:
import types
bpy_main_mod = types.ModuleType("__main__")
namespace = bpy_main_mod.__dict__
else:
namespace = {}
namespace["__builtins__"] = sys.modules["builtins"]
namespace["bpy"] = bpy
namespace["C"] = bpy.context
console = InteractiveConsole(locals=namespace, filename="<blender_console>")
if _BPY_MAIN_OWN:
console._bpy_main_mod = bpy_main_mod
import io
stdout = io.StringIO()
@ -97,10 +114,6 @@ def execute(context):
console, stdout, stderr = get_console(hash(context.region))
# Hack, useful but must add some other way to access
#if "C" not in console.locals:
console.locals["C"] = context
# redirect output
sys.stdout = stdout
sys.stderr = stderr
@ -109,6 +122,10 @@ def execute(context):
stdin_backup = sys.stdin
sys.stdin = None
if _BPY_MAIN_OWN:
main_mod_back = sys.modules["__main__"]
sys.modules["__main__"] = console._bpy_main_mod
# incase exception happens
line = "" # incase of encodingf error
is_multiline = False
@ -125,6 +142,8 @@ def execute(context):
import traceback
stderr.write(traceback.format_exc())
if _BPY_MAIN_OWN:
sys.modules["__main__"] = main_mod_back
stdout.seek(0)
stderr.seek(0)
@ -187,6 +206,10 @@ def autocomplete(context):
scrollback = ""
scrollback_error = ""
if _BPY_MAIN_OWN:
main_mod_back = sys.modules["__main__"]
sys.modules["__main__"] = console._bpy_main_mod
try:
current_line = sc.history[-1]
line = current_line.line
@ -205,6 +228,9 @@ def autocomplete(context):
import traceback
scrollback_error = traceback.format_exc()
if _BPY_MAIN_OWN:
sys.modules["__main__"] = main_mod_back
# Separate automplete output by command prompts
if scrollback != '':
bpy.ops.console.scrollback_append(text=sc.prompt + current_line.line, type='INPUT')
@ -243,10 +269,6 @@ def banner(context):
add_scrollback("", 'OUTPUT')
sc.prompt = PROMPT
# Add context into the namespace for quick access
console = get_console(hash(context.region))[0]
console.locals["C"] = bpy.context
return {'FINISHED'}

@ -56,10 +56,10 @@ class DiscontFilterOp(bpy.types.Operator):
return {'FINISHED'}
def register():
bpy.types.register(DiscontFilterOp)
pass
def unregister():
bpy.types.unregister(DiscontFilterOp)
pass
if __name__ == "__main__":
register()

@ -56,13 +56,15 @@ class EditExternally(bpy.types.Operator):
return image_editor
def execute(self, context):
import os
import subprocess
filepath = self.properties.filepath
image_editor = self._editor_guess(context)
filepath = bpy.utils.expandpath(self.properties.filepath)
cmd = []
cmd.extend(image_editor)
cmd.append(bpy.utils.expandpath(filepath))
if not os.path.exists(filepath):
self.report('ERROR', "Image path '%s' not found." % filepath)
return {'CANCELLED'}
cmd = self._editor_guess(context) + [filepath]
subprocess.Popen(cmd)
@ -186,23 +188,12 @@ class ProjectApply(bpy.types.Operator):
return {'FINISHED'}
classes = [
EditExternally,
SaveDirty,
ProjectEdit,
ProjectApply]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -172,22 +172,12 @@ class MeshMirrorUV(bpy.types.Operator):
return {'FINISHED'}
# Register the operator
classes = [
MeshSelectInteriorFaces,
MeshMirrorUV]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -178,12 +178,12 @@ class BakeAction(bpy.types.Operator):
def register():
bpy.types.register(BakeAction)
pass
# bpy.types.INFO_MT_mesh_add.append(menu_func)
def unregister():
bpy.types.unregister(BakeAction)
pass
# bpy.types.INFO_MT_mesh_add.remove(menu_func)
if __name__ == "__main__":

@ -113,44 +113,46 @@ class SelectHierarchy(bpy.types.Operator):
return context.object
def execute(self, context):
objs = context.selected_objects
select_new = []
act_new = None
selected_objects = context.selected_objects
obj_act = context.object
if context.object not in objs:
objs.append(context.object)
if not self.properties.extend:
# for obj in objs:
# obj.select = False
bpy.ops.object.select_all(action='DESELECT')
if context.object not in selected_objects:
selected_objects.append(context.object)
if self.properties.direction == 'PARENT':
parents = []
for obj in objs:
for obj in selected_objects:
parent = obj.parent
if parent:
parents.append(parent)
if obj_act == obj:
context.scene.objects.active = parent
act_new = parent
parent.select = True
if parents:
return {'CANCELLED'}
select_new.append(parent)
else:
children = []
for obj in objs:
children += list(obj.children)
for obj_iter in children:
obj_iter.select = True
for obj in selected_objects:
select_new.extend(obj.children)
children.sort(key=lambda obj_iter: obj_iter.name)
context.scene.objects.active = children[0]
if select_new:
select_new.sort(key=lambda obj_iter: obj_iter.name)
act_new = select_new[0]
return {'FINISHED'}
# dont edit any object settings above this
if select_new:
if not self.properties.extend:
bpy.ops.object.select_all(action='DESELECT')
for obj in select_new:
obj.select = True
context.scene.objects.active = act_new
return {'FINISHED'}
return {'CANCELLED'}
class SubdivisionSet(bpy.types.Operator):
@ -526,9 +528,9 @@ class MakeDupliFace(bpy.types.Operator):
class IsolateTypeRender(bpy.types.Operator):
'''Select object matching a naming pattern'''
'''Hide unselected render objects of same type as active by setting the hide render flag'''
bl_idname = "object.isolate_type_render"
bl_label = "Isolate Render Selection"
bl_label = "Restrict Render Unselected"
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context):
@ -543,29 +545,25 @@ class IsolateTypeRender(bpy.types.Operator):
obj.hide_render = True
return {'FINISHED'}
class ClearAllRestrictRender(bpy.types.Operator):
'''Reveal all render objects by setting the hide render flag'''
bl_idname = "object.hide_render_clear_all"
bl_label = "Clear All Restrict Render"
bl_options = {'REGISTER', 'UNDO'}
classes = [
SelectPattern,
SelectCamera,
SelectHierarchy,
SubdivisionSet,
ShapeTransfer,
JoinUVs,
IsolateTypeRender,
MakeDupliFace]
def execute(self, context):
for obj in context.scene.objects:
obj.hide_render = False
return {'FINISHED'}
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()
register()

@ -286,12 +286,10 @@ def menu_func(self, context):
def register():
bpy.types.register(AlignObjects)
bpy.types.VIEW3D_MT_transform.append(menu_func)
def unregister():
bpy.types.unregister(AlignObjects)
bpy.types.VIEW3D_MT_transform.remove(menu_func)
if __name__ == "__main__":

@ -140,12 +140,10 @@ def menu_func(self, context):
def register():
bpy.types.register(RandomizeLocRotSize)
bpy.types.VIEW3D_MT_transform.append(menu_func)
def unregister():
bpy.types.unregister(RandomizeLocRotSize)
bpy.types.VIEW3D_MT_transform.remove(menu_func)
if __name__ == "__main__":

@ -22,7 +22,7 @@ import bpy
import os
class AddPresetBase(bpy.types.Operator):
class AddPresetBase():
'''Base preset class, only for subclassing
subclasses must define
- preset_values
@ -91,7 +91,7 @@ class ExecutePreset(bpy.types.Operator):
return {'FINISHED'}
class AddPresetRender(AddPresetBase):
class AddPresetRender(AddPresetBase, bpy.types.Operator):
'''Add a Render Preset'''
bl_idname = "render.preset_add"
bl_label = "Add Render Preset"
@ -113,7 +113,7 @@ class AddPresetRender(AddPresetBase):
preset_subdir = "render"
class AddPresetSSS(AddPresetBase):
class AddPresetSSS(AddPresetBase, bpy.types.Operator):
'''Add a Subsurface Scattering Preset'''
bl_idname = "material.sss_preset_add"
bl_label = "Add SSS Preset"
@ -138,7 +138,7 @@ class AddPresetSSS(AddPresetBase):
preset_subdir = "sss"
class AddPresetCloth(AddPresetBase):
class AddPresetCloth(AddPresetBase, bpy.types.Operator):
'''Add a Cloth Preset'''
bl_idname = "cloth.preset_add"
bl_label = "Add Cloth Preset"
@ -156,7 +156,7 @@ class AddPresetCloth(AddPresetBase):
preset_subdir = "cloth"
class AddPresetSunSky(AddPresetBase):
class AddPresetSunSky(AddPresetBase, bpy.types.Operator):
'''Add a Sky & Atmosphere Preset'''
bl_idname = "lamp.sunsky_preset_add"
bl_label = "Add Sunsky Preset"
@ -181,7 +181,7 @@ class AddPresetSunSky(AddPresetBase):
preset_subdir = "sunsky"
class AddPresetInteraction(AddPresetBase):
class AddPresetInteraction(AddPresetBase, bpy.types.Operator):
'''Add an Application Interaction Preset'''
bl_idname = "wm.interaction_preset_add"
bl_label = "Add Interaction Preset"
@ -203,25 +203,12 @@ class AddPresetInteraction(AddPresetBase):
preset_subdir = "interaction"
classes = [
ExecutePreset,
AddPresetRender,
AddPresetSSS,
AddPresetCloth,
AddPresetSunSky,
AddPresetInteraction]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -144,11 +144,11 @@ class PlayRenderedAnim(bpy.types.Operator):
def register():
bpy.types.register(PlayRenderedAnim)
pass
def unregister():
bpy.types.unregister(PlayRenderedAnim)
pass
if __name__ == "__main__":
register()

@ -132,19 +132,11 @@ class SequencerDeinterlaceSelectedMovies(bpy.types.Operator):
def register():
register = bpy.types.register
register(SequencerCrossfadeSounds)
register(SequencerCutMulticam)
register(SequencerDeinterlaceSelectedMovies)
pass
def unregister():
unregister = bpy.types.unregister
unregister(SequencerCrossfadeSounds)
unregister(SequencerCutMulticam)
unregister(SequencerDeinterlaceSelectedMovies)
pass
if __name__ == "__main__":

@ -216,12 +216,10 @@ def menu_func(self, context):
def register():
bpy.types.register(ExportUVLayout)
bpy.types.IMAGE_MT_uvs.append(menu_func)
def unregister():
bpy.types.unregister(ExportUVLayout)
bpy.types.IMAGE_MT_uvs.remove(menu_func)
if __name__ == "__main__":

@ -263,12 +263,10 @@ menu_func = (lambda self, context: self.layout.operator(FollowActiveQuads.bl_idn
def register():
bpy.types.register(FollowActiveQuads)
bpy.types.VIEW3D_MT_uv_map.append(menu_func)
def unregister():
bpy.types.unregister(FollowActiveQuads)
bpy.types.VIEW3D_MT_uv_map.remove(menu_func)
if __name__ == "__main__":

@ -1138,12 +1138,10 @@ menu_func = (lambda self, context: self.layout.operator(SmartProject.bl_idname,
def register():
bpy.types.register(SmartProject)
bpy.types.VIEW3D_MT_uv_map.append(menu_func)
def unregister():
bpy.types.unregister(SmartProject)
bpy.types.VIEW3D_MT_uv_map.remove(menu_func)
if __name__ == "__main__":

@ -180,11 +180,11 @@ class VertexPaintDirt(bpy.types.Operator):
def register():
bpy.types.register(VertexPaintDirt)
pass
def unregister():
bpy.types.unregister(VertexPaintDirt)
pass
if __name__ == "__main__":
register()

@ -21,7 +21,7 @@
import bpy
from bpy.props import *
from rna_prop_ui import rna_idprop_ui_prop_get, rna_idprop_ui_prop_clear
class MESH_OT_delete_edgeloop(bpy.types.Operator):
'''Delete an edge loop by merging the faces on each side to a single face loop'''
@ -325,6 +325,42 @@ class WM_OT_context_cycle_enum(bpy.types.Operator):
exec("context.%s=advance_enum" % self.properties.data_path)
return {'FINISHED'}
class WM_OT_context_set_id(bpy.types.Operator):
'''Toggle a context value.'''
bl_idname = "wm.context_set_id"
bl_label = "Set Library ID"
bl_options = {'UNDO'}
data_path = rna_path_prop
value = StringProperty(name="Value",
description="Assign value", maxlen=1024, default="")
def execute(self, context):
value = self.properties.value
data_path = self.properties.data_path
# match the pointer type from the target property to bpy.data.*
# so we lookup the correct list.
data_path_base, data_path_prop = data_path.rsplit(".", 1)
data_prop_rna = eval("context.%s" % data_path_base).rna_type.properties[data_path_prop]
data_prop_rna_type = data_prop_rna.fixed_type
id_iter = None
for prop in bpy.data.rna_type.properties:
if prop.rna_type.identifier == "CollectionProperty":
if prop.fixed_type == data_prop_rna_type:
id_iter = prop.identifier
break
if id_iter:
value_id = getattr(bpy.data, id_iter).get(value)
exec("context.%s=value_id" % data_path)
return {'FINISHED'}
doc_id = StringProperty(name="Doc ID",
description="", maxlen=1024, default="", options={'HIDDEN'})
@ -576,46 +612,139 @@ class WM_OT_doc_edit(bpy.types.Operator):
return wm.invoke_props_dialog(self, width=600)
import rna_prop_ui
from bpy.props import *
classes = [
MESH_OT_delete_edgeloop,
WM_OT_context_set_boolean,
WM_OT_context_set_int,
WM_OT_context_scale_int,
WM_OT_context_set_float,
WM_OT_context_set_string,
WM_OT_context_set_enum,
WM_OT_context_set_value,
WM_OT_context_toggle,
WM_OT_context_toggle_enum,
WM_OT_context_cycle_enum,
WM_OT_context_cycle_int,
WM_OT_context_modal_mouse,
rna_path = StringProperty(name="Property Edit",
description="Property data_path edit", maxlen=1024, default="", options={'HIDDEN'})
WM_OT_url_open,
WM_OT_path_open,
rna_value = StringProperty(name="Property Value",
description="Property value edit", maxlen=1024, default="")
WM_OT_doc_view,
WM_OT_doc_edit,
rna_property = StringProperty(name="Property Name",
description="Property name edit", maxlen=1024, default="")
# experemental!
rna_prop_ui.WM_OT_properties_edit,
rna_prop_ui.WM_OT_properties_add,
rna_prop_ui.WM_OT_properties_remove]
rna_min = FloatProperty(name="Min", default=0.0, precision=3)
rna_max = FloatProperty(name="Max", default=1.0, precision=3)
class WM_OT_properties_edit(bpy.types.Operator):
'''Internal use (edit a property data_path)'''
bl_idname = "wm.properties_edit"
bl_label = "Edit Property"
data_path = rna_path
property = rna_property
value = rna_value
min = rna_min
max = rna_max
description = StringProperty(name="Tip", default="")
def execute(self, context):
data_path = self.properties.data_path
value = self.properties.value
prop = self.properties.property
prop_old = self._last_prop[0]
try:
value_eval = eval(value)
except:
value_eval = value
# First remove
item = eval("context.%s" % data_path)
rna_idprop_ui_prop_clear(item, prop_old)
exec_str = "del item['%s']" % prop_old
# print(exec_str)
exec(exec_str)
# Reassign
exec_str = "item['%s'] = %s" % (prop, repr(value_eval))
# print(exec_str)
exec(exec_str)
self._last_prop[:] = [prop]
prop_type = type(item[prop])
prop_ui = rna_idprop_ui_prop_get(item, prop)
if prop_type in (float, int):
prop_ui['soft_min'] = prop_ui['min'] = prop_type(self.properties.min)
prop_ui['soft_max'] = prop_ui['max'] = prop_type(self.properties.max)
prop_ui['description'] = self.properties.description
return {'FINISHED'}
def invoke(self, context, event):
self._last_prop = [self.properties.property]
item = eval("context.%s" % self.properties.data_path)
# setup defaults
prop_ui = rna_idprop_ui_prop_get(item, self.properties.property, False) # dont create
if prop_ui:
self.properties.min = prop_ui.get("min", -1000000000)
self.properties.max = prop_ui.get("max", 1000000000)
self.properties.description = prop_ui.get("description", "")
wm = context.manager
# This crashes, TODO - fix
#return wm.invoke_props_popup(self, event)
wm.invoke_props_popup(self, event)
return {'RUNNING_MODAL'}
class WM_OT_properties_add(bpy.types.Operator):
'''Internal use (edit a property data_path)'''
bl_idname = "wm.properties_add"
bl_label = "Add Property"
data_path = rna_path
def execute(self, context):
item = eval("context.%s" % self.properties.data_path)
def unique_name(names):
prop = 'prop'
prop_new = prop
i = 1
while prop_new in names:
prop_new = prop + str(i)
i += 1
return prop_new
property = unique_name(item.keys())
item[property] = 1.0
return {'FINISHED'}
class WM_OT_properties_remove(bpy.types.Operator):
'''Internal use (edit a property data_path)'''
bl_idname = "wm.properties_remove"
bl_label = "Remove Property"
data_path = rna_path
property = rna_property
def execute(self, context):
item = eval("context.%s" % self.properties.data_path)
del item[self.properties.property]
return {'FINISHED'}
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -54,9 +54,6 @@ class ExportSomeData(bpy.types.Operator):
return self.execute(context)
bpy.types.register(ExportSomeData)
# Only needed if you want to add into a dynamic menu
menu_func = lambda self, context: self.layout.operator("export.some_data", text="Example Exporter...")
bpy.types.INFO_MT_file_export.append(menu_func)

@ -34,7 +34,5 @@ class ModalOperator(bpy.types.Operator):
return {'CANCELLED'}
bpy.types.register(ModalOperator)
if __name__ == "__main__":
bpy.ops.object.modal_operator()

@ -64,15 +64,3 @@ class ModalDrawOperator(bpy.types.Operator):
else:
self.report({'WARNING'}, "View3D not found, cannot run operator")
return {'CANCELLED'}
def register():
bpy.types.register(ModalDrawOperator)
def unregister():
bpy.types.unregister(ModalDrawOperator)
if __name__ == "__main__":
register()

@ -51,6 +51,3 @@ class ViewOperator(bpy.types.Operator):
else:
self.report({'WARNING'}, "Active space must be a View3d")
return {'CANCELLED'}
bpy.types.register(ViewOperator)

@ -16,11 +16,6 @@ class SimpleOperator(bpy.types.Operator):
main(context)
return {'FINISHED'}
def register():
bpy.types.register(SimpleOperator)
def unregister():
bpy.types.unregister(SimpleOperator)
if __name__ == "__main__":
register()
bpy.ops.object.simple_operator()

@ -24,8 +24,9 @@ def main(context):
if is_editmode:
bpy.ops.object.mode_set(mode='EDIT', toggle=False)
class UvOperator(bpy.types.Operator):
''''''
'''UV Operator description'''
bl_idname = "uv.simple_operator"
bl_label = "Simple UV Operator"
@ -37,7 +38,6 @@ class UvOperator(bpy.types.Operator):
main(context)
return {'FINISHED'}
bpy.types.register(UvOperator)
if __name__ == "__main__":
bpy.ops.uv.simple_operator()

@ -18,5 +18,3 @@ class OBJECT_PT_hello(bpy.types.Panel):
row.label(text="Active object is: " + obj.name)
row = layout.row()
row.prop(obj, "name")
bpy.types.register(OBJECT_PT_hello)

@ -25,7 +25,7 @@ narrowui = bpy.context.user_preferences.view.properties_width_check
# Generic Panels (Independent of DataType)
class MotionPathButtonsPanel(bpy.types.Panel):
class MotionPathButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_label = "Motion Paths"
@ -67,7 +67,7 @@ class MotionPathButtonsPanel(bpy.types.Panel):
# FIXME: this panel still needs to be ported so that it will work correctly with animviz
class OnionSkinButtonsPanel(bpy.types.Panel):
class OnionSkinButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_label = "Onion Skinning"
@ -102,119 +102,19 @@ class OnionSkinButtonsPanel(bpy.types.Panel):
col.label(text="Display:")
col.prop(arm, "ghost_only_selected", text="Selected Only")
################################################
# Specific Panels for DataTypes
class OBJECT_PT_motion_paths(MotionPathButtonsPanel):
#bl_label = "Object Motion Paths"
bl_context = "object"
def poll(self, context):
return (context.object)
def draw(self, context):
layout = self.layout
ob = context.object
wide_ui = context.region.width > narrowui
self.draw_settings(context, ob.animation_visualisation, wide_ui)
layout.separator()
split = layout.split()
col = split.column()
col.operator("object.paths_calculate", text="Calculate Paths")
if wide_ui:
col = split.column()
col.operator("object.paths_clear", text="Clear Paths")
class OBJECT_PT_onion_skinning(OnionSkinButtonsPanel):
#bl_label = "Object Onion Skinning"
bl_context = "object"
def poll(self, context):
return (context.object)
def draw(self, context):
layout = self.layout
ob = context.object
wide_ui = context.region.width > narrowui
self.draw_settings(context, ob.animation_visualisation, wide_ui)
class DATA_PT_motion_paths(MotionPathButtonsPanel):
#bl_label = "Bones Motion Paths"
bl_context = "data"
def poll(self, context):
# XXX: include posemode check?
return (context.object) and (context.armature)
def draw(self, context):
layout = self.layout
ob = context.object
wide_ui = context.region.width > narrowui
self.draw_settings(context, ob.pose.animation_visualisation, wide_ui, bones=True)
layout.separator()
split = layout.split()
col = split.column()
col.operator("pose.paths_calculate", text="Calculate Paths")
if wide_ui:
col = split.column()
col.operator("pose.paths_clear", text="Clear Paths")
class DATA_PT_onion_skinning(OnionSkinButtonsPanel):
#bl_label = "Bones Onion Skinning"
bl_context = "data"
def poll(self, context):
# XXX: include posemode check?
return (context.object) and (context.armature)
def draw(self, context):
layout = self.layout
ob = context.object
wide_ui = context.region.width > narrowui
self.draw_settings(context, ob.pose.animation_visualisation, wide_ui, bones=True)
# NOTE:
# The specialised panel types defined here (i.e. OBJECT_PT_*, etc.)
# aren't registered here, but are rather imported to (and registered)
# in the files defining the contexts where they reside. Otherwise,
# these panels appear at the top of the lists by default.
#
# However, we keep these empty register funcs here just in case
# something will need them again one day, and also to make
# it easier to maintain these scripts.
classes = []
# The specialised panel types are derived in their respective UI modules
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -23,7 +23,7 @@ from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(bpy.types.Panel):
class DataButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
@ -32,7 +32,7 @@ class DataButtonsPanel(bpy.types.Panel):
return context.armature
class DATA_PT_context_arm(DataButtonsPanel):
class DATA_PT_context_arm(DataButtonsPanel, bpy.types.Panel):
bl_label = ""
bl_show_header = False
@ -56,11 +56,11 @@ class DATA_PT_context_arm(DataButtonsPanel):
layout.template_ID(ob, "data")
class DATA_PT_custom_props_arm(DataButtonsPanel, PropertyPanel):
class DATA_PT_custom_props_arm(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
_context_path = "object.data"
class DATA_PT_skeleton(DataButtonsPanel):
class DATA_PT_skeleton(DataButtonsPanel, bpy.types.Panel):
bl_label = "Skeleton"
def draw(self, context):
@ -95,7 +95,7 @@ class DATA_PT_skeleton(DataButtonsPanel):
col.prop(arm, "deform_quaternion", text="Quaternion")
class DATA_PT_display(DataButtonsPanel):
class DATA_PT_display(DataButtonsPanel, bpy.types.Panel):
bl_label = "Display"
def draw(self, context):
@ -120,10 +120,11 @@ class DATA_PT_display(DataButtonsPanel):
if wide_ui:
col = split.column()
col.prop(arm, "draw_group_colors", text="Colors")
col.prop(ob, "x_ray", text="X-Ray")
col.prop(arm, "delay_deform", text="Delay Refresh")
class DATA_PT_bone_groups(DataButtonsPanel):
class DATA_PT_bone_groups(DataButtonsPanel, bpy.types.Panel):
bl_label = "Bone Groups"
def poll(self, context):
@ -173,9 +174,7 @@ class DATA_PT_bone_groups(DataButtonsPanel):
# TODO: this panel will soon be depreceated too
class DATA_PT_ghost(DataButtonsPanel):
class DATA_PT_ghost(DataButtonsPanel, bpy.types.Panel):
bl_label = "Ghost"
def draw(self, context):
@ -208,7 +207,7 @@ class DATA_PT_ghost(DataButtonsPanel):
col.prop(arm, "ghost_only_selected", text="Selected Only")
class DATA_PT_iksolver_itasc(DataButtonsPanel):
class DATA_PT_iksolver_itasc(DataButtonsPanel, bpy.types.Panel):
bl_label = "iTaSC parameters"
bl_default_closed = True
@ -262,33 +261,58 @@ class DATA_PT_iksolver_itasc(DataButtonsPanel):
row.prop(itasc, "dampmax", text="Damp", slider=True)
row.prop(itasc, "dampeps", text="Eps", slider=True)
# import generic panels from other files
from properties_animviz import DATA_PT_motion_paths, DATA_PT_onion_skinning
from properties_animviz import MotionPathButtonsPanel, OnionSkinButtonsPanel
classes = [
DATA_PT_context_arm,
DATA_PT_skeleton,
DATA_PT_display,
DATA_PT_bone_groups,
DATA_PT_ghost,
DATA_PT_iksolver_itasc,
class DATA_PT_motion_paths(MotionPathButtonsPanel, bpy.types.Panel):
#bl_label = "Bones Motion Paths"
bl_context = "data"
DATA_PT_motion_paths,
#DATA_PT_onion_skinning,
def poll(self, context):
# XXX: include posemode check?
return (context.object) and (context.armature)
DATA_PT_custom_props_arm]
def draw(self, context):
layout = self.layout
ob = context.object
wide_ui = context.region.width > narrowui
self.draw_settings(context, ob.pose.animation_visualisation, wide_ui, bones=True)
layout.separator()
split = layout.split()
col = split.column()
col.operator("pose.paths_calculate", text="Calculate Paths")
if wide_ui:
col = split.column()
col.operator("pose.paths_clear", text="Clear Paths")
class DATA_PT_onion_skinning(OnionSkinButtonsPanel): #, bpy.types.Panel): # inherit from panel when ready
#bl_label = "Bones Onion Skinning"
bl_context = "data"
def poll(self, context):
# XXX: include posemode check?
return (context.object) and (context.armature)
def draw(self, context):
layout = self.layout
ob = context.object
wide_ui = context.region.width > narrowui
self.draw_settings(context, ob.pose.animation_visualisation, wide_ui, bones=True)
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -307,33 +307,11 @@ class INFO_MT_armature_metarig_add(bpy.types.Menu):
text = bpy.utils.display_name(submodule_type)
layout.operator("pose.metarig_sample_add", text=text, icon='OUTLINER_OB_ARMATURE').metarig_type = submodule_type
classes = [
DATA_PT_template,
PoseTemplateSettings,
PoseTemplate,
Reload,
Generate,
Validate,
Sample,
Graph,
AsScript,
ActiveAssign,
ActiveClear,
INFO_MT_armature_metarig_add]
menu_func = (lambda self, context: self.layout.menu("INFO_MT_armature_metarig_add", icon='OUTLINER_OB_ARMATURE'))
import space_info # ensure the menu is loaded first
def register():
register = bpy.types.register
for cls in classes:
register(cls)
PoseTemplate.StringProperty(attr="name",
name="Name of the slave",
description="",
@ -360,11 +338,8 @@ def register():
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
bpy.types.INFO_MT_armature_add.remove(menu_func)
bpy.types.Scene.RemoveProperty("pose_templates")
space_info.INFO_MT_armature_add.remove(menu_func)
if __name__ == "__main__":
register()

@ -23,7 +23,7 @@ from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class BoneButtonsPanel(bpy.types.Panel):
class BoneButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "bone"
@ -32,7 +32,7 @@ class BoneButtonsPanel(bpy.types.Panel):
return (context.bone or context.edit_bone)
class BONE_PT_context_bone(BoneButtonsPanel):
class BONE_PT_context_bone(BoneButtonsPanel, bpy.types.Panel):
bl_label = ""
bl_show_header = False
@ -48,7 +48,7 @@ class BONE_PT_context_bone(BoneButtonsPanel):
row.prop(bone, "name", text="")
class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel):
class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel, bpy.types.Panel):
@property
def _context_path(self):
@ -59,7 +59,7 @@ class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel):
return "active_bone"
class BONE_PT_transform(BoneButtonsPanel):
class BONE_PT_transform(BoneButtonsPanel, bpy.types.Panel):
bl_label = "Transform"
def draw(self, context):
@ -128,7 +128,7 @@ class BONE_PT_transform(BoneButtonsPanel):
col.prop(pchan, "scale")
class BONE_PT_transform_locks(BoneButtonsPanel):
class BONE_PT_transform_locks(BoneButtonsPanel, bpy.types.Panel):
bl_label = "Transform Locks"
bl_default_closed = True
@ -159,7 +159,7 @@ class BONE_PT_transform_locks(BoneButtonsPanel):
row.column().prop(pchan, "lock_scale")
class BONE_PT_relations(BoneButtonsPanel):
class BONE_PT_relations(BoneButtonsPanel, bpy.types.Panel):
bl_label = "Relations"
def draw(self, context):
@ -206,7 +206,7 @@ class BONE_PT_relations(BoneButtonsPanel):
sub.prop(bone, "local_location", text="Local Location")
class BONE_PT_display(BoneButtonsPanel):
class BONE_PT_display(BoneButtonsPanel, bpy.types.Panel):
bl_label = "Display"
def poll(self, context):
@ -242,7 +242,7 @@ class BONE_PT_display(BoneButtonsPanel):
col.prop_object(pchan, "custom_shape_transform", ob.pose, "bones", text="At")
class BONE_PT_inverse_kinematics(BoneButtonsPanel):
class BONE_PT_inverse_kinematics(BoneButtonsPanel, bpy.types.Panel):
bl_label = "Inverse Kinematics"
bl_default_closed = True
@ -340,7 +340,7 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel):
#row.prop(pchan, "ik_lin_weight", text="Weight", slider=True)
class BONE_PT_deform(BoneButtonsPanel):
class BONE_PT_deform(BoneButtonsPanel, bpy.types.Panel):
bl_label = "Deform"
bl_default_closed = True
@ -390,28 +390,13 @@ class BONE_PT_deform(BoneButtonsPanel):
col.label(text="Offset:")
col.prop(bone, "cyclic_offset")
classes = [
BONE_PT_context_bone,
BONE_PT_transform,
BONE_PT_transform_locks,
BONE_PT_relations,
BONE_PT_display,
BONE_PT_inverse_kinematics,
BONE_PT_deform,
BONE_PT_custom_props]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -23,7 +23,7 @@ from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(bpy.types.Panel):
class DataButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
@ -33,7 +33,7 @@ class DataButtonsPanel(bpy.types.Panel):
return context.camera and (engine in self.COMPAT_ENGINES)
class DATA_PT_context_camera(DataButtonsPanel):
class DATA_PT_context_camera(DataButtonsPanel, bpy.types.Panel):
bl_label = ""
bl_show_header = False
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -61,12 +61,12 @@ class DATA_PT_context_camera(DataButtonsPanel):
layout.template_ID(space, "pin_id")
class DATA_PT_custom_props_camera(DataButtonsPanel, PropertyPanel):
class DATA_PT_custom_props_camera(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
_context_path = "object.data"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
class DATA_PT_camera(DataButtonsPanel):
class DATA_PT_camera(DataButtonsPanel, bpy.types.Panel):
bl_label = "Lens"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -127,7 +127,7 @@ class DATA_PT_camera(DataButtonsPanel):
col.prop(cam, "dof_distance", text="Distance")
class DATA_PT_camera_display(DataButtonsPanel):
class DATA_PT_camera_display(DataButtonsPanel, bpy.types.Panel):
bl_label = "Display"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -155,24 +155,12 @@ class DATA_PT_camera_display(DataButtonsPanel):
sub.prop(cam, "passepartout_alpha", text="Alpha", slider=True)
classes = [
DATA_PT_context_camera,
DATA_PT_camera,
DATA_PT_camera_display,
DATA_PT_custom_props_camera]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -23,7 +23,7 @@ from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(bpy.types.Panel):
class DataButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
@ -47,7 +47,7 @@ class DataButtonsPanelActive(DataButtonsPanel):
return (curve and type(curve) is not bpy.types.TextCurve and curve.splines.active)
class DATA_PT_context_curve(DataButtonsPanel):
class DATA_PT_context_curve(DataButtonsPanel, bpy.types.Panel):
bl_label = ""
bl_show_header = False
@ -73,11 +73,11 @@ class DATA_PT_context_curve(DataButtonsPanel):
layout.template_ID(ob, "data")
class DATA_PT_custom_props_curve(DataButtonsPanel, PropertyPanel):
class DATA_PT_custom_props_curve(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
_context_path = "object.data"
class DATA_PT_shape_curve(DataButtonsPanel):
class DATA_PT_shape_curve(DataButtonsPanel, bpy.types.Panel):
bl_label = "Shape"
def draw(self, context):
@ -130,7 +130,7 @@ class DATA_PT_shape_curve(DataButtonsPanel):
col.prop(curve, "auto_texspace")
class DATA_PT_geometry_curve(DataButtonsPanel):
class DATA_PT_geometry_curve(DataButtonsPanel, bpy.types.Panel):
bl_label = "Geometry"
def poll(self, context):
@ -164,7 +164,7 @@ class DATA_PT_geometry_curve(DataButtonsPanel):
col.prop(curve, "bevel_object", text="")
class DATA_PT_pathanim(DataButtonsPanelCurve):
class DATA_PT_pathanim(DataButtonsPanelCurve, bpy.types.Panel):
bl_label = "Path Animation"
def draw_header(self, context):
@ -196,7 +196,7 @@ class DATA_PT_pathanim(DataButtonsPanelCurve):
col.prop(curve, "use_time_offset", text="Offset Children")
class DATA_PT_active_spline(DataButtonsPanelActive):
class DATA_PT_active_spline(DataButtonsPanelActive, bpy.types.Panel):
bl_label = "Active Spline"
def draw(self, context):
@ -267,7 +267,7 @@ class DATA_PT_active_spline(DataButtonsPanelActive):
layout.prop(act_spline, "smooth")
class DATA_PT_font(DataButtonsPanel):
class DATA_PT_font(DataButtonsPanel, bpy.types.Panel):
bl_label = "Font"
def poll(self, context):
@ -329,7 +329,7 @@ class DATA_PT_font(DataButtonsPanel):
col.prop(char, "use_small_caps")
class DATA_PT_paragraph(DataButtonsPanel):
class DATA_PT_paragraph(DataButtonsPanel, bpy.types.Panel):
bl_label = "Paragraph"
def poll(self, context):
@ -362,7 +362,7 @@ class DATA_PT_paragraph(DataButtonsPanel):
col.prop(text, "offset_y", text="Y")
class DATA_PT_textboxes(DataButtonsPanel):
class DATA_PT_textboxes(DataButtonsPanel, bpy.types.Panel):
bl_label = "Text Boxes"
def poll(self, context):
@ -404,29 +404,12 @@ class DATA_PT_textboxes(DataButtonsPanel):
row.operator("font.textbox_remove", text='', icon='X', emboss=False).index = i
classes = [
DATA_PT_context_curve,
DATA_PT_shape_curve,
DATA_PT_geometry_curve,
DATA_PT_pathanim,
DATA_PT_active_spline,
DATA_PT_font,
DATA_PT_paragraph,
DATA_PT_textboxes,
DATA_PT_custom_props_curve]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -22,7 +22,7 @@ import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(bpy.types.Panel):
class DataButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
@ -31,7 +31,7 @@ class DataButtonsPanel(bpy.types.Panel):
return (context.object and context.object.type == 'EMPTY')
class DATA_PT_empty(DataButtonsPanel):
class DATA_PT_empty(DataButtonsPanel, bpy.types.Panel):
bl_label = "Empty"
def draw(self, context):
@ -48,20 +48,13 @@ class DATA_PT_empty(DataButtonsPanel):
layout.prop(ob, "empty_draw_size", text="Size")
classes = [
DATA_PT_empty]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -31,7 +31,7 @@ class LAMP_MT_sunsky_presets(bpy.types.Menu):
draw = bpy.types.Menu.draw_preset
class DataButtonsPanel(bpy.types.Panel):
class DataButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
@ -40,16 +40,14 @@ class DataButtonsPanel(bpy.types.Panel):
engine = context.scene.render.engine
return context.lamp and (engine in self.COMPAT_ENGINES)
class DATA_PT_preview(DataButtonsPanel):
class DATA_PT_preview(DataButtonsPanel, bpy.types.Panel):
bl_label = "Preview"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
self.layout.template_preview(context.lamp)
class DATA_PT_context_lamp(DataButtonsPanel):
class DATA_PT_context_lamp(DataButtonsPanel, bpy.types.Panel):
bl_label = ""
bl_show_header = False
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -77,12 +75,12 @@ class DATA_PT_context_lamp(DataButtonsPanel):
layout.template_ID(space, "pin_id")
class DATA_PT_custom_props_lamp(DataButtonsPanel, PropertyPanel):
class DATA_PT_custom_props_lamp(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
_context_path = "object.data"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
class DATA_PT_lamp(DataButtonsPanel):
class DATA_PT_lamp(DataButtonsPanel, bpy.types.Panel):
bl_label = "Lamp"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -129,7 +127,7 @@ class DATA_PT_lamp(DataButtonsPanel):
col.prop(lamp, "diffuse")
class DATA_PT_sunsky(DataButtonsPanel):
class DATA_PT_sunsky(DataButtonsPanel, bpy.types.Panel):
bl_label = "Sky & Atmosphere"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -202,7 +200,7 @@ class DATA_PT_sunsky(DataButtonsPanel):
sub.prop(lamp, "atmosphere_extinction", slider=True, text="Extinction")
class DATA_PT_shadow(DataButtonsPanel):
class DATA_PT_shadow(DataButtonsPanel, bpy.types.Panel):
bl_label = "Shadow"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -327,7 +325,7 @@ class DATA_PT_shadow(DataButtonsPanel):
sub.prop(lamp, "shadow_buffer_clip_end", text=" Clip End")
class DATA_PT_area(DataButtonsPanel):
class DATA_PT_area(DataButtonsPanel, bpy.types.Panel):
bl_label = "Area Shape"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -354,7 +352,7 @@ class DATA_PT_area(DataButtonsPanel):
sub.prop(lamp, "size_y", text="Size Y")
class DATA_PT_spot(DataButtonsPanel):
class DATA_PT_spot(DataButtonsPanel, bpy.types.Panel):
bl_label = "Spot Shape"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -390,7 +388,7 @@ class DATA_PT_spot(DataButtonsPanel):
sub.prop(lamp, "halo_step", text="Step")
class DATA_PT_falloff_curve(DataButtonsPanel):
class DATA_PT_falloff_curve(DataButtonsPanel, bpy.types.Panel):
bl_label = "Falloff Curve"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -407,31 +405,12 @@ class DATA_PT_falloff_curve(DataButtonsPanel):
self.layout.template_curve_mapping(lamp, "falloff_curve")
classes = [
LAMP_MT_sunsky_presets,
DATA_PT_context_lamp,
DATA_PT_preview,
DATA_PT_lamp,
DATA_PT_falloff_curve,
DATA_PT_area,
DATA_PT_spot,
DATA_PT_shadow,
DATA_PT_sunsky,
DATA_PT_custom_props_lamp]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -23,7 +23,7 @@ from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(bpy.types.Panel):
class DataButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
@ -32,7 +32,7 @@ class DataButtonsPanel(bpy.types.Panel):
return context.lattice
class DATA_PT_context_lattice(DataButtonsPanel):
class DATA_PT_context_lattice(DataButtonsPanel, bpy.types.Panel):
bl_label = ""
bl_show_header = False
@ -59,11 +59,11 @@ class DATA_PT_context_lattice(DataButtonsPanel):
layout.template_ID(space, "pin_id")
class DATA_PT_custom_props_lattice(DataButtonsPanel, PropertyPanel):
class DATA_PT_custom_props_lattice(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
_context_path = "object.data"
class DATA_PT_lattice(DataButtonsPanel):
class DATA_PT_lattice(DataButtonsPanel, bpy.types.Panel):
bl_label = "Lattice"
def draw(self, context):
@ -98,23 +98,12 @@ class DATA_PT_lattice(DataButtonsPanel):
row.prop_object(lat, "vertex_group", context.object, "vertex_groups", text="")
classes = [
DATA_PT_context_lattice,
DATA_PT_lattice,
DATA_PT_custom_props_lattice]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -49,7 +49,7 @@ class MESH_MT_shape_key_specials(bpy.types.Menu):
layout.operator("object.shape_key_mirror", icon='ARROW_LEFTRIGHT')
class DataButtonsPanel(bpy.types.Panel):
class DataButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
@ -59,7 +59,7 @@ class DataButtonsPanel(bpy.types.Panel):
return context.mesh and (engine in self.COMPAT_ENGINES)
class DATA_PT_context_mesh(DataButtonsPanel):
class DATA_PT_context_mesh(DataButtonsPanel, bpy.types.Panel):
bl_label = ""
bl_show_header = False
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -87,12 +87,12 @@ class DATA_PT_context_mesh(DataButtonsPanel):
layout.template_ID(space, "pin_id")
class DATA_PT_custom_props_mesh(DataButtonsPanel, PropertyPanel):
class DATA_PT_custom_props_mesh(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
_context_path = "object.data"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
class DATA_PT_normals(DataButtonsPanel):
class DATA_PT_normals(DataButtonsPanel, bpy.types.Panel):
bl_label = "Normals"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -114,11 +114,10 @@ class DATA_PT_normals(DataButtonsPanel):
col = split.column()
else:
col.separator()
col.prop(mesh, "vertex_normal_flip")
col.prop(mesh, "double_sided")
class DATA_PT_settings(DataButtonsPanel):
class DATA_PT_settings(DataButtonsPanel, bpy.types.Panel):
bl_label = "Settings"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -130,7 +129,7 @@ class DATA_PT_settings(DataButtonsPanel):
layout.prop(mesh, "texture_mesh")
class DATA_PT_vertex_groups(DataButtonsPanel):
class DATA_PT_vertex_groups(DataButtonsPanel, bpy.types.Panel):
bl_label = "Vertex Groups"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -177,7 +176,7 @@ class DATA_PT_vertex_groups(DataButtonsPanel):
layout.prop(context.tool_settings, "vertex_group_weight", text="Weight")
class DATA_PT_shape_keys(DataButtonsPanel):
class DATA_PT_shape_keys(DataButtonsPanel, bpy.types.Panel):
bl_label = "Shape Keys"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -275,7 +274,7 @@ class DATA_PT_shape_keys(DataButtonsPanel):
row.prop(key, "slurph")
class DATA_PT_uv_texture(DataButtonsPanel):
class DATA_PT_uv_texture(DataButtonsPanel, bpy.types.Panel):
bl_label = "UV Texture"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -345,7 +344,7 @@ class DATA_PT_texface(DataButtonsPanel):
col.label(text="No UV Texture")
class DATA_PT_vertex_colors(DataButtonsPanel):
class DATA_PT_vertex_colors(DataButtonsPanel, bpy.types.Panel):
bl_label = "Vertex Colors"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -368,32 +367,12 @@ class DATA_PT_vertex_colors(DataButtonsPanel):
layout.prop(lay, "name")
classes = [
MESH_MT_vertex_group_specials,
MESH_MT_shape_key_specials,
DATA_PT_context_mesh,
DATA_PT_normals,
DATA_PT_settings,
DATA_PT_vertex_groups,
DATA_PT_shape_keys,
DATA_PT_uv_texture,
DATA_PT_texface,
DATA_PT_vertex_colors,
DATA_PT_custom_props_mesh]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -23,7 +23,7 @@ from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(bpy.types.Panel):
class DataButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
@ -32,7 +32,7 @@ class DataButtonsPanel(bpy.types.Panel):
return context.meta_ball
class DATA_PT_context_metaball(DataButtonsPanel):
class DATA_PT_context_metaball(DataButtonsPanel, bpy.types.Panel):
bl_label = ""
bl_show_header = False
@ -59,11 +59,11 @@ class DATA_PT_context_metaball(DataButtonsPanel):
layout.template_ID(space, "pin_id")
class DATA_PT_custom_props_metaball(DataButtonsPanel, PropertyPanel):
class DATA_PT_custom_props_metaball(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
_context_path = "object.data"
class DATA_PT_metaball(DataButtonsPanel):
class DATA_PT_metaball(DataButtonsPanel, bpy.types.Panel):
bl_label = "Metaball"
def draw(self, context):
@ -92,7 +92,7 @@ class DATA_PT_metaball(DataButtonsPanel):
layout.prop(mball, "flag", text="")
class DATA_PT_metaball_element(DataButtonsPanel):
class DATA_PT_metaball_element(DataButtonsPanel, bpy.types.Panel):
bl_label = "Active Element"
def poll(self, context):
@ -136,24 +136,12 @@ class DATA_PT_metaball_element(DataButtonsPanel):
col.prop(metaelem, "size_y", text="Y")
classes = [
DATA_PT_context_metaball,
DATA_PT_metaball,
DATA_PT_metaball_element,
DATA_PT_custom_props_metaball]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -23,13 +23,13 @@ narrowui = bpy.context.user_preferences.view.properties_width_check
narrowmod = 260
class DataButtonsPanel(bpy.types.Panel):
class DataButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "modifier"
class DATA_PT_modifiers(DataButtonsPanel):
class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
bl_label = "Modifiers"
def draw(self, context):
@ -437,7 +437,6 @@ class DATA_PT_modifiers(DataButtonsPanel):
col.prop(md, "levels", text="Preview")
col.prop(md, "sculpt_levels", text="Sculpt")
col.prop(md, "render_levels", text="Render")
col.prop(bpy.context.tool_settings.sculpt, "fast_navigate")
if wide_ui:
col = split.column()
@ -775,20 +774,12 @@ class DATA_PT_modifiers(DataButtonsPanel):
col.prop(md, "narrowness", slider=True)
classes = [
DATA_PT_modifiers]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -22,7 +22,7 @@ import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
class PhysicsButtonsPanel(bpy.types.Panel):
class PhysicsButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"
@ -33,7 +33,7 @@ class PhysicsButtonsPanel(bpy.types.Panel):
return ob and ob.game and (rd.engine in self.COMPAT_ENGINES)
class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
class PHYSICS_PT_game_physics(PhysicsButtonsPanel, bpy.types.Panel):
bl_label = "Physics"
COMPAT_ENGINES = {'BLENDER_GAME'}
@ -162,7 +162,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
layout.prop(ob, "hide_render", text="Invisible")
class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, bpy.types.Panel):
bl_label = "Collision Bounds"
COMPAT_ENGINES = {'BLENDER_GAME'}
@ -196,10 +196,10 @@ class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
if wide_ui:
col = split.column()
col.prop(game, "collision_compound", text="Compound")
class PHYSICS_PT_game_obstacles(PhysicsButtonsPanel):
bl_label = "Create obstacle"
class PHYSICS_PT_game_obstacles(PhysicsButtonsPanel, bpy.types.Panel):
bl_label = "Create obstacle"
COMPAT_ENGINES = {'BLENDER_GAME'}
def poll(self, context):
game = context.object.game
rd = context.scene.render
@ -222,7 +222,7 @@ class PHYSICS_PT_game_obstacles(PhysicsButtonsPanel):
col = split.column()
col.prop(game, "obstacle_radius", text="Radius")
class RenderButtonsPanel(bpy.types.Panel):
class RenderButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "render"
@ -232,7 +232,7 @@ class RenderButtonsPanel(bpy.types.Panel):
return (rd.engine in self.COMPAT_ENGINES)
class RENDER_PT_game(RenderButtonsPanel):
class RENDER_PT_game(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Game"
COMPAT_ENGINES = {'BLENDER_GAME'}
@ -244,7 +244,7 @@ class RENDER_PT_game(RenderButtonsPanel):
row.label()
class RENDER_PT_game_player(RenderButtonsPanel):
class RENDER_PT_game_player(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Standalone Player"
COMPAT_ENGINES = {'BLENDER_GAME'}
@ -282,7 +282,7 @@ class RENDER_PT_game_player(RenderButtonsPanel):
col.prop(gs, "framing_color", text="")
class RENDER_PT_game_stereo(RenderButtonsPanel):
class RENDER_PT_game_stereo(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Stereo"
COMPAT_ENGINES = {'BLENDER_GAME'}
@ -342,7 +342,7 @@ class RENDER_PT_game_stereo(RenderButtonsPanel):
layout.prop(gs, "dome_text")
class RENDER_PT_game_shading(RenderButtonsPanel):
class RENDER_PT_game_shading(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Shading"
COMPAT_ENGINES = {'BLENDER_GAME'}
@ -371,7 +371,7 @@ class RENDER_PT_game_shading(RenderButtonsPanel):
col.prop(gs, "glsl_extra_textures", text="Extra Textures")
class RENDER_PT_game_performance(RenderButtonsPanel):
class RENDER_PT_game_performance(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Performance"
COMPAT_ENGINES = {'BLENDER_GAME'}
@ -397,7 +397,7 @@ class RENDER_PT_game_performance(RenderButtonsPanel):
col.prop(gs, "use_display_lists")
class RENDER_PT_game_sound(RenderButtonsPanel):
class RENDER_PT_game_sound(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Sound"
COMPAT_ENGINES = {'BLENDER_GAME'}
@ -415,7 +415,7 @@ class RENDER_PT_game_sound(RenderButtonsPanel):
layout.prop(scene, "doppler_factor")
class WorldButtonsPanel(bpy.types.Panel):
class WorldButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "world"
@ -425,7 +425,7 @@ class WorldButtonsPanel(bpy.types.Panel):
return (scene.render.engine in self.COMPAT_ENGINES) and (scene.world is not None)
class WORLD_PT_game_context_world(WorldButtonsPanel):
class WORLD_PT_game_context_world(WorldButtonsPanel, bpy.types.Panel):
bl_label = ""
bl_show_header = False
COMPAT_ENGINES = {'BLENDER_GAME'}
@ -455,7 +455,7 @@ class WORLD_PT_game_context_world(WorldButtonsPanel):
layout.template_ID(space, "pin_id")
class WORLD_PT_game_world(WorldButtonsPanel):
class WORLD_PT_game_world(WorldButtonsPanel, bpy.types.Panel):
bl_label = "World"
COMPAT_ENGINES = {'BLENDER_GAME'}
@ -475,7 +475,7 @@ class WORLD_PT_game_world(WorldButtonsPanel):
col.prop(world, "ambient_color")
class WORLD_PT_game_mist(WorldButtonsPanel):
class WORLD_PT_game_mist(WorldButtonsPanel, bpy.types.Panel):
bl_label = "Mist"
COMPAT_ENGINES = {'BLENDER_GAME'}
@ -501,7 +501,7 @@ class WORLD_PT_game_mist(WorldButtonsPanel):
col.prop(world.mist, "depth")
class WORLD_PT_game_physics(WorldButtonsPanel):
class WORLD_PT_game_physics(WorldButtonsPanel, bpy.types.Panel):
bl_label = "Physics"
COMPAT_ENGINES = {'BLENDER_GAME'}
@ -546,7 +546,7 @@ class WORLD_PT_game_physics(WorldButtonsPanel):
col.label(text="Logic Steps:")
col.prop(gs, "logic_step_max", text="Max")
class WORLD_PT_game_physics_obstacles(WorldButtonsPanel):
class WORLD_PT_game_physics_obstacles(WorldButtonsPanel, bpy.types.Panel):
bl_label = "Obstacle simulation"
COMPAT_ENGINES = {'BLENDER_GAME'}
@ -560,37 +560,13 @@ class WORLD_PT_game_physics_obstacles(WorldButtonsPanel):
if gs.obstacle_simulation != 'None':
layout.prop(gs, "level_height")
layout.prop(gs, "show_obstacle_simulation")
classes = [
PHYSICS_PT_game_physics,
PHYSICS_PT_game_collision_bounds,
PHYSICS_PT_game_obstacles,
RENDER_PT_game,
RENDER_PT_game_player,
RENDER_PT_game_stereo,
RENDER_PT_game_shading,
RENDER_PT_game_performance,
RENDER_PT_game_sound,
WORLD_PT_game_context_world,
WORLD_PT_game_world,
WORLD_PT_game_mist,
WORLD_PT_game_physics,
WORLD_PT_game_physics_obstacles]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -54,7 +54,7 @@ class MATERIAL_MT_specials(bpy.types.Menu):
layout.operator("material.paste", icon='PASTEDOWN')
class MaterialButtonsPanel(bpy.types.Panel):
class MaterialButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "material"
@ -66,7 +66,7 @@ class MaterialButtonsPanel(bpy.types.Panel):
return mat and (engine in self.COMPAT_ENGINES)
class MATERIAL_PT_preview(MaterialButtonsPanel):
class MATERIAL_PT_preview(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Preview"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -74,7 +74,7 @@ class MATERIAL_PT_preview(MaterialButtonsPanel):
self.layout.template_preview(context.material)
class MATERIAL_PT_context_material(MaterialButtonsPanel):
class MATERIAL_PT_context_material(MaterialButtonsPanel, bpy.types.Panel):
bl_label = ""
bl_show_header = False
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -141,12 +141,12 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
layout.prop(mat, "type", text="")
class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel):
class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel, bpy.types.Panel):
COMPAT_ENGINES = {'BLENDER_RENDER'}
_context_path = "material"
class MATERIAL_PT_shading(MaterialButtonsPanel):
class MATERIAL_PT_shading(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Shading"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -184,7 +184,7 @@ class MATERIAL_PT_shading(MaterialButtonsPanel):
layout.prop(mat, "alpha")
class MATERIAL_PT_strand(MaterialButtonsPanel):
class MATERIAL_PT_strand(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Strand"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -233,7 +233,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel):
sub.prop(tan, "blend_distance", text="Distance")
class MATERIAL_PT_physics(MaterialButtonsPanel):
class MATERIAL_PT_physics(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Physics"
COMPAT_ENGINES = {'BLENDER_GAME'}
@ -257,14 +257,14 @@ class MATERIAL_PT_physics(MaterialButtonsPanel):
col.prop(phys, "damp", slider=True)
class MATERIAL_PT_options(MaterialButtonsPanel):
class MATERIAL_PT_options(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Options"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def poll(self, context):
mat = active_node_mat(context.material)
engine = context.scene.render.engine
return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
@ -302,7 +302,7 @@ class MATERIAL_PT_options(MaterialButtonsPanel):
col.prop(mat, "object_color")
class MATERIAL_PT_shadow(MaterialButtonsPanel):
class MATERIAL_PT_shadow(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Shadow"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -339,8 +339,7 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel):
sub.prop(mat, "shadow_ray_bias", text="Ray Bias")
col.prop(mat, "cast_approximate")
class MATERIAL_PT_diffuse(MaterialButtonsPanel):
class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Diffuse"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -411,7 +410,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
row.prop(mat, "diffuse_ramp_factor", text="Factor")
class MATERIAL_PT_specular(MaterialButtonsPanel):
class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Specular"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -480,7 +479,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel):
row.prop(mat, "specular_ramp_factor", text="Factor")
class MATERIAL_PT_sss(MaterialButtonsPanel):
class MATERIAL_PT_sss(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Subsurface Scattering"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -532,7 +531,7 @@ class MATERIAL_PT_sss(MaterialButtonsPanel):
col.prop(sss, "error_tolerance", text="Error")
class MATERIAL_PT_mirror(MaterialButtonsPanel):
class MATERIAL_PT_mirror(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Mirror"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -592,7 +591,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel):
sub.prop(raym, "gloss_anisotropic", text="Anisotropic")
class MATERIAL_PT_transp(MaterialButtonsPanel):
class MATERIAL_PT_transp(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Transparency"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -659,7 +658,7 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
sub.prop(rayt, "gloss_samples", text="Samples")
class MATERIAL_PT_transp_game(MaterialButtonsPanel):
class MATERIAL_PT_transp_game(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Transparency"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_GAME'}
@ -694,7 +693,7 @@ class MATERIAL_PT_transp_game(MaterialButtonsPanel):
col.prop(mat, "alpha")
class MATERIAL_PT_halo(MaterialButtonsPanel):
class MATERIAL_PT_halo(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Halo"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -744,7 +743,7 @@ class MATERIAL_PT_halo(MaterialButtonsPanel):
sub.prop(halo, "star_tips")
class MATERIAL_PT_flare(MaterialButtonsPanel):
class MATERIAL_PT_flare(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Flare"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -779,7 +778,7 @@ class MATERIAL_PT_flare(MaterialButtonsPanel):
col.prop(halo, "flare_subsize", text="Subsize")
class VolumeButtonsPanel(bpy.types.Panel):
class VolumeButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "material"
@ -790,7 +789,7 @@ class VolumeButtonsPanel(bpy.types.Panel):
return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES)
class MATERIAL_PT_volume_density(VolumeButtonsPanel):
class MATERIAL_PT_volume_density(VolumeButtonsPanel, bpy.types.Panel):
bl_label = "Density"
bl_default_closed = False
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -810,7 +809,7 @@ class MATERIAL_PT_volume_density(VolumeButtonsPanel):
col.prop(vol, "density_scale")
class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
class MATERIAL_PT_volume_shading(VolumeButtonsPanel, bpy.types.Panel):
bl_label = "Shading"
bl_default_closed = False
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -838,7 +837,7 @@ class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
sub.prop(vol, "reflection_color", text="")
class MATERIAL_PT_volume_lighting(VolumeButtonsPanel):
class MATERIAL_PT_volume_lighting(VolumeButtonsPanel, bpy.types.Panel):
bl_label = "Lighting"
bl_default_closed = False
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -876,7 +875,7 @@ class MATERIAL_PT_volume_lighting(VolumeButtonsPanel):
sub.prop(vol, "ms_intensity")
class MATERIAL_PT_volume_transp(VolumeButtonsPanel):
class MATERIAL_PT_volume_transp(VolumeButtonsPanel, bpy.types.Panel):
bl_label = "Transparency"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -892,7 +891,7 @@ class MATERIAL_PT_volume_transp(VolumeButtonsPanel):
layout.prop(mat, "transparency_method", text="")
class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
class MATERIAL_PT_volume_integration(VolumeButtonsPanel, bpy.types.Panel):
bl_label = "Integration"
bl_default_closed = False
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -917,7 +916,7 @@ class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
col.prop(vol, "depth_cutoff")
class MATERIAL_PT_volume_options(VolumeButtonsPanel):
class MATERIAL_PT_volume_options(VolumeButtonsPanel, bpy.types.Panel):
bl_label = "Options"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
bl_default_closed = True
@ -943,46 +942,12 @@ class MATERIAL_PT_volume_options(VolumeButtonsPanel):
row.prop(mat, "light_group_exclusive", text="Exclusive")
classes = [
MATERIAL_PT_context_material,
MATERIAL_PT_preview,
MATERIAL_PT_diffuse,
MATERIAL_PT_specular,
MATERIAL_PT_shading,
MATERIAL_PT_transp,
MATERIAL_PT_mirror,
MATERIAL_PT_sss,
MATERIAL_PT_halo,
MATERIAL_PT_flare,
MATERIAL_PT_physics,
MATERIAL_PT_strand,
MATERIAL_PT_options,
MATERIAL_PT_shadow,
MATERIAL_PT_transp_game,
MATERIAL_MT_sss_presets,
MATERIAL_MT_specials,
MATERIAL_PT_volume_density,
MATERIAL_PT_volume_shading,
MATERIAL_PT_volume_lighting,
MATERIAL_PT_volume_transp,
MATERIAL_PT_volume_integration,
MATERIAL_PT_volume_options,
MATERIAL_PT_custom_props]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -23,13 +23,13 @@ from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class ObjectButtonsPanel(bpy.types.Panel):
class ObjectButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "object"
class OBJECT_PT_context_object(ObjectButtonsPanel):
class OBJECT_PT_context_object(ObjectButtonsPanel, bpy.types.Panel):
bl_label = ""
bl_show_header = False
@ -46,11 +46,7 @@ class OBJECT_PT_context_object(ObjectButtonsPanel):
row.prop(ob, "name", text="")
class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel):
_context_path = "object"
class OBJECT_PT_transform(ObjectButtonsPanel):
class OBJECT_PT_transform(ObjectButtonsPanel, bpy.types.Panel):
bl_label = "Transform"
def draw(self, context):
@ -90,7 +86,7 @@ class OBJECT_PT_transform(ObjectButtonsPanel):
col.prop(ob, "scale")
class OBJECT_PT_transform_locks(ObjectButtonsPanel):
class OBJECT_PT_transform_locks(ObjectButtonsPanel, bpy.types.Panel):
bl_label = "Transform Locks"
bl_default_closed = True
@ -117,7 +113,7 @@ class OBJECT_PT_transform_locks(ObjectButtonsPanel):
row.column().prop(ob, "lock_scale", text="Scale")
class OBJECT_PT_relations(ObjectButtonsPanel):
class OBJECT_PT_relations(ObjectButtonsPanel, bpy.types.Panel):
bl_label = "Relations"
def draw(self, context):
@ -146,7 +142,7 @@ class OBJECT_PT_relations(ObjectButtonsPanel):
sub.active = (parent is not None)
class OBJECT_PT_groups(ObjectButtonsPanel):
class OBJECT_PT_groups(ObjectButtonsPanel, bpy.types.Panel):
bl_label = "Groups"
def draw(self, context):
@ -187,7 +183,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
index += 1
class OBJECT_PT_display(ObjectButtonsPanel):
class OBJECT_PT_display(ObjectButtonsPanel, bpy.types.Panel):
bl_label = "Display"
def draw(self, context):
@ -223,7 +219,7 @@ class OBJECT_PT_display(ObjectButtonsPanel):
col.prop(ob, "draw_transparent", text="Transparency")
class OBJECT_PT_duplication(ObjectButtonsPanel):
class OBJECT_PT_duplication(ObjectButtonsPanel, bpy.types.Panel):
bl_label = "Duplication"
def draw(self, context):
@ -272,8 +268,7 @@ class OBJECT_PT_duplication(ObjectButtonsPanel):
# XXX: the following options are all quite buggy, ancient hacks that should be dropped
class OBJECT_PT_animation(ObjectButtonsPanel):
class OBJECT_PT_animation(ObjectButtonsPanel, bpy.types.Panel):
bl_label = "Animation Hacks"
bl_default_closed = True
@ -306,36 +301,60 @@ class OBJECT_PT_animation(ObjectButtonsPanel):
col.prop(ob, "track_axis", text="Axis")
col.prop(ob, "up_axis", text="Up Axis")
from properties_animviz import MotionPathButtonsPanel, OnionSkinButtonsPanel
# import generic panels from other files
from properties_animviz import OBJECT_PT_motion_paths, OBJECT_PT_onion_skinning
classes = [
OBJECT_PT_context_object,
OBJECT_PT_transform,
OBJECT_PT_transform_locks,
OBJECT_PT_relations,
OBJECT_PT_groups,
OBJECT_PT_display,
OBJECT_PT_duplication,
OBJECT_PT_animation, # XXX: panel of old hacks pending to be removed...
class OBJECT_PT_motion_paths(MotionPathButtonsPanel, bpy.types.Panel):
#bl_label = "Object Motion Paths"
bl_context = "object"
OBJECT_PT_motion_paths,
#OBJECT_PT_onion_skinning,
def poll(self, context):
return (context.object)
OBJECT_PT_custom_props]
def draw(self, context):
layout = self.layout
ob = context.object
wide_ui = context.region.width > narrowui
self.draw_settings(context, ob.animation_visualisation, wide_ui)
layout.separator()
split = layout.split()
col = split.column()
col.operator("object.paths_calculate", text="Calculate Paths")
if wide_ui:
col = split.column()
col.operator("object.paths_clear", text="Clear Paths")
class OBJECT_PT_onion_skinning(OnionSkinButtonsPanel): #, bpy.types.Panel): # inherit from panel when ready
#bl_label = "Object Onion Skinning"
bl_context = "object"
def poll(self, context):
return (context.object)
def draw(self, context):
layout = self.layout
ob = context.object
wide_ui = context.region.width > narrowui
self.draw_settings(context, ob.animation_visualisation, wide_ui)
class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel, bpy.types.Panel):
_context_path = "object"
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -23,7 +23,7 @@ narrowui = bpy.context.user_preferences.view.properties_width_check
narrowcon = 260
class ConstraintButtonsPanel(bpy.types.Panel):
class ConstraintButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "constraint"
@ -749,8 +749,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
col = layout.column()
col.prop(con, "enabled_rotation_range", text="Pivot When")
class OBJECT_PT_constraints(ConstraintButtonsPanel):
class OBJECT_PT_constraints(ConstraintButtonsPanel, bpy.types.Panel):
bl_label = "Object Constraints"
bl_context = "constraint"
@ -768,7 +767,7 @@ class OBJECT_PT_constraints(ConstraintButtonsPanel):
self.draw_constraint(context, con)
class BONE_PT_constraints(ConstraintButtonsPanel):
class BONE_PT_constraints(ConstraintButtonsPanel, bpy.types.Panel):
bl_label = "Bone Constraints"
bl_context = "bone_constraint"
@ -784,21 +783,12 @@ class BONE_PT_constraints(ConstraintButtonsPanel):
self.draw_constraint(context, con)
classes = [
OBJECT_PT_constraints,
BONE_PT_constraints]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -42,7 +42,7 @@ def particle_panel_poll(panel, context):
return psys.settings.type in ('EMITTER', 'REACTOR', 'HAIR') and (engine in panel.COMPAT_ENGINES)
class ParticleButtonsPanel(bpy.types.Panel):
class ParticleButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "particle"
@ -51,7 +51,7 @@ class ParticleButtonsPanel(bpy.types.Panel):
return particle_panel_poll(self, context)
class PARTICLE_PT_context_particles(ParticleButtonsPanel):
class PARTICLE_PT_context_particles(ParticleButtonsPanel, bpy.types.Panel):
bl_label = ""
bl_show_header = False
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -136,12 +136,12 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel):
split.prop(psys, "reactor_target_particle_system", text="Particle System")
class PARTICLE_PT_custom_props(ParticleButtonsPanel, PropertyPanel):
class PARTICLE_PT_custom_props(ParticleButtonsPanel, PropertyPanel, bpy.types.Panel):
COMPAT_ENGINES = {'BLENDER_RENDER'}
_context_path = "particle_system.settings"
class PARTICLE_PT_emission(ParticleButtonsPanel):
class PARTICLE_PT_emission(ParticleButtonsPanel, bpy.types.Panel):
bl_label = "Emission"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -203,7 +203,7 @@ class PARTICLE_PT_emission(ParticleButtonsPanel):
row.prop(part, "grid_resolution")
class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel):
class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, bpy.types.Panel):
bl_label = "Hair dynamics"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -260,7 +260,7 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel):
col.prop(cloth, "quality", text="Steps", slider=True)
class PARTICLE_PT_cache(ParticleButtonsPanel):
class PARTICLE_PT_cache(ParticleButtonsPanel, bpy.types.Panel):
bl_label = "Cache"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -283,7 +283,7 @@ class PARTICLE_PT_cache(ParticleButtonsPanel):
point_cache_ui(self, context, psys.point_cache, True, 'HAIR' if psys.hair_dynamics else 'PSYS')
class PARTICLE_PT_velocity(ParticleButtonsPanel):
class PARTICLE_PT_velocity(ParticleButtonsPanel, bpy.types.Panel):
bl_label = "Velocity"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -330,7 +330,7 @@ class PARTICLE_PT_velocity(ParticleButtonsPanel):
# sub.prop(part, "reaction_shape", slider=True)
class PARTICLE_PT_rotation(ParticleButtonsPanel):
class PARTICLE_PT_rotation(ParticleButtonsPanel, bpy.types.Panel):
bl_label = "Rotation"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -376,7 +376,7 @@ class PARTICLE_PT_rotation(ParticleButtonsPanel):
sub.prop(part, "angular_velocity_factor", text="")
class PARTICLE_PT_physics(ParticleButtonsPanel):
class PARTICLE_PT_physics(ParticleButtonsPanel, bpy.types.Panel):
bl_label = "Physics"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -401,11 +401,12 @@ class PARTICLE_PT_physics(ParticleButtonsPanel):
else:
row.prop(part, "physics_type", text="")
row = layout.row()
col = row.column(align=True)
col.prop(part, "particle_size")
col.prop(part, "random_size", slider=True)
if part.physics_type != 'NO':
row = layout.row()
col = row.column(align=True)
col.prop(part, "particle_size")
col.prop(part, "random_size", slider=True)
col = row.column(align=True)
col.prop(part, "mass")
col.prop(part, "sizemass", text="Multiply mass with size")
@ -572,7 +573,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel):
sub.prop(key, "system", text="System")
class PARTICLE_PT_boidbrain(ParticleButtonsPanel):
class PARTICLE_PT_boidbrain(ParticleButtonsPanel, bpy.types.Panel):
bl_label = "Boid Brain"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -672,7 +673,7 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel):
row.prop(rule, "flee_distance")
class PARTICLE_PT_render(ParticleButtonsPanel):
class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel):
bl_label = "Render"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -842,7 +843,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel):
col.label(text="")
class PARTICLE_PT_draw(ParticleButtonsPanel):
class PARTICLE_PT_draw(ParticleButtonsPanel, bpy.types.Panel):
bl_label = "Display"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -901,7 +902,7 @@ class PARTICLE_PT_draw(ParticleButtonsPanel):
#sub.label(text="Override material color")
class PARTICLE_PT_children(ParticleButtonsPanel):
class PARTICLE_PT_children(ParticleButtonsPanel, bpy.types.Panel):
bl_label = "Children"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -986,7 +987,7 @@ class PARTICLE_PT_children(ParticleButtonsPanel):
col.prop(part, "kink_shape", slider=True)
class PARTICLE_PT_field_weights(ParticleButtonsPanel):
class PARTICLE_PT_field_weights(ParticleButtonsPanel, bpy.types.Panel):
bl_label = "Field Weights"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -999,7 +1000,7 @@ class PARTICLE_PT_field_weights(ParticleButtonsPanel):
self.layout.prop(part.effector_weights, "do_growing_hair")
class PARTICLE_PT_force_fields(ParticleButtonsPanel):
class PARTICLE_PT_force_fields(ParticleButtonsPanel, bpy.types.Panel):
bl_label = "Force Field Settings"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -1027,7 +1028,7 @@ class PARTICLE_PT_force_fields(ParticleButtonsPanel):
basic_force_field_falloff_ui(self, context, part.force_field_2)
class PARTICLE_PT_vertexgroups(ParticleButtonsPanel):
class PARTICLE_PT_vertexgroups(ParticleButtonsPanel, bpy.types.Panel):
bl_label = "Vertexgroups"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -1095,35 +1096,12 @@ class PARTICLE_PT_vertexgroups(ParticleButtonsPanel):
row.prop(psys, "vertex_group_field_negate", text="")
classes = [
PARTICLE_PT_context_particles,
PARTICLE_PT_hair_dynamics,
PARTICLE_PT_cache,
PARTICLE_PT_emission,
PARTICLE_PT_velocity,
PARTICLE_PT_rotation,
PARTICLE_PT_physics,
PARTICLE_PT_boidbrain,
PARTICLE_PT_render,
PARTICLE_PT_draw,
PARTICLE_PT_children,
PARTICLE_PT_field_weights,
PARTICLE_PT_force_fields,
PARTICLE_PT_vertexgroups,
PARTICLE_PT_custom_props]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -40,7 +40,7 @@ class CLOTH_MT_presets(bpy.types.Menu):
draw = bpy.types.Menu.draw_preset
class PhysicButtonsPanel(bpy.types.Panel):
class PhysicButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"
@ -51,7 +51,7 @@ class PhysicButtonsPanel(bpy.types.Panel):
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
class PHYSICS_PT_cloth(PhysicButtonsPanel):
class PHYSICS_PT_cloth(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Cloth"
def draw(self, context):
@ -133,7 +133,7 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
col.prop_object(cloth, "rest_shape_key", key, "keys", text="")
class PHYSICS_PT_cloth_cache(PhysicButtonsPanel):
class PHYSICS_PT_cloth_cache(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Cloth Cache"
bl_default_closed = True
@ -145,7 +145,7 @@ class PHYSICS_PT_cloth_cache(PhysicButtonsPanel):
point_cache_ui(self, context, md.point_cache, cloth_panel_enabled(md), 'CLOTH')
class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):
class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Cloth Collision"
bl_default_closed = True
@ -185,7 +185,7 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):
layout.prop(cloth, "group")
class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Cloth Stiffness Scaling"
bl_default_closed = True
@ -222,7 +222,7 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
col.prop(cloth, "bending_stiffness_max", text="Max")
class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel):
class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Cloth Field Weights"
bl_default_closed = True
@ -234,26 +234,12 @@ class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel):
effector_weights_ui(self, context, cloth.effector_weights)
classes = [
CLOTH_MT_presets,
PHYSICS_PT_cloth,
PHYSICS_PT_cloth_cache,
PHYSICS_PT_cloth_collision,
PHYSICS_PT_cloth_stiffness,
PHYSICS_PT_cloth_field_weights]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -26,7 +26,7 @@ from properties_physics_common import basic_force_field_settings_ui
from properties_physics_common import basic_force_field_falloff_ui
class PhysicButtonsPanel(bpy.types.Panel):
class PhysicButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"
@ -36,7 +36,7 @@ class PhysicButtonsPanel(bpy.types.Panel):
return (context.object) and (not rd.use_game_engine)
class PHYSICS_PT_field(PhysicButtonsPanel):
class PHYSICS_PT_field(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Force Fields"
def draw(self, context):
@ -169,7 +169,7 @@ class PHYSICS_PT_field(PhysicButtonsPanel):
sub.prop(field, "radial_maximum", text="Distance")
class PHYSICS_PT_collision(PhysicButtonsPanel):
class PHYSICS_PT_collision(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Collision"
#bl_default_closed = True
@ -243,21 +243,12 @@ class PHYSICS_PT_collision(PhysicButtonsPanel):
col.prop(settings, "absorption", text="Absorption")
classes = [
PHYSICS_PT_field,
PHYSICS_PT_collision]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -22,7 +22,7 @@ import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
class PhysicButtonsPanel(bpy.types.Panel):
class PhysicButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"
@ -33,7 +33,7 @@ class PhysicButtonsPanel(bpy.types.Panel):
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
class PHYSICS_PT_fluid(PhysicButtonsPanel):
class PHYSICS_PT_fluid(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Fluid"
def draw(self, context):
@ -216,7 +216,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
sub.prop(fluid, "velocity_radius", text="Radius")
class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Domain World"
bl_default_closed = True
@ -267,7 +267,7 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
col.prop(fluid, "compressibility", slider=True)
class PHYSICS_PT_domain_boundary(PhysicButtonsPanel):
class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Domain Boundary"
bl_default_closed = True
@ -296,7 +296,7 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel):
col.prop(fluid, "surface_subdivisions", text="Subdivisions")
class PHYSICS_PT_domain_particles(PhysicButtonsPanel):
class PHYSICS_PT_domain_particles(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Domain Particles"
bl_default_closed = True
@ -314,23 +314,12 @@ class PHYSICS_PT_domain_particles(PhysicButtonsPanel):
col.prop(fluid, "generate_particles")
classes = [
PHYSICS_PT_fluid,
PHYSICS_PT_domain_gravity,
PHYSICS_PT_domain_boundary,
PHYSICS_PT_domain_particles]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -26,7 +26,7 @@ from properties_physics_common import point_cache_ui
from properties_physics_common import effector_weights_ui
class PhysicButtonsPanel(bpy.types.Panel):
class PhysicButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"
@ -37,7 +37,7 @@ class PhysicButtonsPanel(bpy.types.Panel):
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
class PHYSICS_PT_smoke(PhysicButtonsPanel):
class PHYSICS_PT_smoke(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Smoke"
def draw(self, context):
@ -78,14 +78,17 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
col = split.column()
col.label(text="Resolution:")
col.prop(domain, "maxres", text="Divisions")
col.label(text="Particle:")
col.prop(domain, "initial_velocity", text="Initial Velocity")
col.label(text="Time:")
col.prop(domain, "time_scale", text="Scale")
col.label(text="Border Collisions:")
col.prop(domain, "smoke_domain_colli", text="")
if wide_ui:
col = split.column()
col.label(text="Behavior:")
col.prop(domain, "alpha")
col.prop(domain, "beta")
col.prop(domain, "vorticity")
col.prop(domain, "dissolve_smoke", text="Dissolve")
sub = col.column()
sub.active = domain.dissolve_smoke
@ -93,6 +96,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
sub.prop(domain, "dissolve_smoke_log", text="Slow")
elif md.smoke_type == 'FLOW':
flow = md.flow_settings
split = layout.split()
@ -102,21 +106,27 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
col.label(text="Particle System:")
col.prop_object(flow, "psys", ob, "particle_systems", text="")
if md.flow_settings.outflow:
if wide_ui:
col = split.column()
else:
if wide_ui:
col = split.column()
col.label(text="Behavior:")
col.prop(flow, "temperature")
col.prop(flow, "density")
sub = col.column()
sub.active = not md.flow_settings.outflow
sub.prop(flow, "initial_velocity", text="Initial Velocity")
sub = sub.column()
sub.active = flow.initial_velocity
sub.prop(flow, "velocity_multiplier", text="Multiplier")
if wide_ui:
sub = split.column()
sub.active = not md.flow_settings.outflow
sub.label(text="Behavior:")
sub.prop(flow, "temperature")
sub.prop(flow, "density")
sub.prop(flow, "absolute")
#elif md.smoke_type == 'COLLISION':
# layout.separator()
class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Smoke Groups"
bl_default_closed = True
@ -145,7 +155,7 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
col.prop(group, "coll_group", text="")
class PHYSICS_PT_smoke_cache(PhysicButtonsPanel):
class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Smoke Cache"
bl_default_closed = True
@ -165,7 +175,7 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel):
point_cache_ui(self, context, cache, (cache.baked is False), 'SMOKE')
class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Smoke High Resolution"
bl_default_closed = True
@ -191,6 +201,7 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
col = split.column()
col.label(text="Resolution:")
col.prop(md, "amplify", text="Divisions")
col.prop(md, "smoothemitter")
col.prop(md, "viewhighres")
if wide_ui:
@ -200,7 +211,7 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
col.prop(md, "strength")
class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel):
class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Smoke High Resolution Cache"
bl_default_closed = True
@ -220,7 +231,7 @@ class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel):
point_cache_ui(self, context, cache, (cache.baked is False), 'SMOKE')
class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel):
class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Smoke Field Weights"
bl_default_closed = True
@ -233,25 +244,12 @@ class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel):
effector_weights_ui(self, context, domain.effector_weights)
classes = [
PHYSICS_PT_smoke,
PHYSICS_PT_smoke_field_weights,
PHYSICS_PT_smoke_cache,
PHYSICS_PT_smoke_highres,
PHYSICS_PT_smoke_groups,
PHYSICS_PT_smoke_cache_highres]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -30,7 +30,7 @@ def softbody_panel_enabled(md):
return (md.point_cache.baked is False)
class PhysicButtonsPanel(bpy.types.Panel):
class PhysicButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"
@ -43,7 +43,7 @@ class PhysicButtonsPanel(bpy.types.Panel):
return (ob and (ob.type == 'MESH' or ob.type == 'LATTICE'or ob.type == 'CURVE')) and (not rd.use_game_engine)
class PHYSICS_PT_softbody(PhysicButtonsPanel):
class PHYSICS_PT_softbody(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Soft Body"
def draw(self, context):
@ -88,7 +88,7 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel):
col.prop(softbody, "speed")
class PHYSICS_PT_softbody_cache(PhysicButtonsPanel):
class PHYSICS_PT_softbody_cache(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Soft Body Cache"
bl_default_closed = True
@ -100,7 +100,7 @@ class PHYSICS_PT_softbody_cache(PhysicButtonsPanel):
point_cache_ui(self, context, md.point_cache, softbody_panel_enabled(md), 'SOFTBODY')
class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):
class PHYSICS_PT_softbody_goal(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Soft Body Goal"
bl_default_closed = True
@ -144,7 +144,7 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):
layout.prop_object(softbody, "goal_vertex_group", ob, "vertex_groups", text="Vertex Group")
class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Soft Body Edges"
bl_default_closed = True
@ -199,7 +199,7 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
col.prop(softbody, "face_collision", text="Face")
class PHYSICS_PT_softbody_collision(PhysicButtonsPanel):
class PHYSICS_PT_softbody_collision(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Soft Body Self Collision"
bl_default_closed = True
@ -234,7 +234,7 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel):
col.prop(softbody, "ball_damp", text="Dampening")
class PHYSICS_PT_softbody_solver(PhysicButtonsPanel):
class PHYSICS_PT_softbody_solver(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Soft Body Solver"
bl_default_closed = True
@ -271,7 +271,7 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel):
layout.prop(softbody, "estimate_matrix")
class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel):
class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Soft Body Field Weights"
bl_default_closed = True
@ -285,26 +285,12 @@ class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel):
effector_weights_ui(self, context, softbody.effector_weights)
classes = [
PHYSICS_PT_softbody,
PHYSICS_PT_softbody_cache,
PHYSICS_PT_softbody_goal,
PHYSICS_PT_softbody_edge,
PHYSICS_PT_softbody_collision,
PHYSICS_PT_softbody_solver,
PHYSICS_PT_softbody_field_weights]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -36,7 +36,7 @@ class RENDER_MT_ffmpeg_presets(bpy.types.Menu):
draw = bpy.types.Menu.draw_preset
class RenderButtonsPanel(bpy.types.Panel):
class RenderButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "render"
@ -47,7 +47,7 @@ class RenderButtonsPanel(bpy.types.Panel):
return (context.scene and rd.use_game_engine is False) and (rd.engine in self.COMPAT_ENGINES)
class RENDER_PT_render(RenderButtonsPanel):
class RENDER_PT_render(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Render"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -69,7 +69,7 @@ class RENDER_PT_render(RenderButtonsPanel):
layout.prop(rd, "display_mode", text="Display")
class RENDER_PT_layers(RenderButtonsPanel):
class RENDER_PT_layers(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Layers"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -174,7 +174,7 @@ class RENDER_PT_layers(RenderButtonsPanel):
row.prop(rl, "pass_refraction_exclude", text="")
class RENDER_PT_shading(RenderButtonsPanel):
class RENDER_PT_shading(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Shading"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -199,7 +199,7 @@ class RENDER_PT_shading(RenderButtonsPanel):
col.prop(rd, "alpha_mode", text="Alpha")
class RENDER_PT_performance(RenderButtonsPanel):
class RENDER_PT_performance(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Performance"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -243,7 +243,7 @@ class RENDER_PT_performance(RenderButtonsPanel):
sub.prop(rd, "use_local_coords", text="Local Coordinates")
class RENDER_PT_post_processing(RenderButtonsPanel):
class RENDER_PT_post_processing(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Post Processing"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -287,7 +287,7 @@ class RENDER_PT_post_processing(RenderButtonsPanel):
sub.prop(rd, "edge_color", text="")
class RENDER_PT_output(RenderButtonsPanel):
class RENDER_PT_output(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Output"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -407,7 +407,7 @@ class RENDER_PT_output(RenderButtonsPanel):
col.prop(rd, "quicktime_audio_resampling_hq")
class RENDER_PT_encoding(RenderButtonsPanel):
class RENDER_PT_encoding(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Encoding"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -479,7 +479,7 @@ class RENDER_PT_encoding(RenderButtonsPanel):
col.prop(rd, "ffmpeg_audio_volume", slider=True)
class RENDER_PT_antialiasing(RenderButtonsPanel):
class RENDER_PT_antialiasing(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Anti-Aliasing"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -509,7 +509,7 @@ class RENDER_PT_antialiasing(RenderButtonsPanel):
col.prop(rd, "filter_size", text="Size")
class RENDER_PT_motion_blur(RenderButtonsPanel):
class RENDER_PT_motion_blur(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Full Sample Motion Blur"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -529,8 +529,7 @@ class RENDER_PT_motion_blur(RenderButtonsPanel):
row.prop(rd, "motion_blur_samples")
row.prop(rd, "motion_blur_shutter")
class RENDER_PT_dimensions(RenderButtonsPanel):
class RENDER_PT_dimensions(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Dimensions"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -577,7 +576,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel):
sub.prop(rd, "fps_base", text="/")
class RENDER_PT_stamp(RenderButtonsPanel):
class RENDER_PT_stamp(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Stamp"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -623,7 +622,7 @@ class RENDER_PT_stamp(RenderButtonsPanel):
sub.prop(rd, "stamp_note_text", text="")
class RENDER_PT_bake(RenderButtonsPanel):
class RENDER_PT_bake(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Bake"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -670,33 +669,12 @@ class RENDER_PT_bake(RenderButtonsPanel):
sub.prop(rd, "bake_bias")
classes = [
RENDER_MT_presets,
RENDER_MT_ffmpeg_presets,
RENDER_PT_render,
RENDER_PT_layers,
RENDER_PT_dimensions,
RENDER_PT_antialiasing,
RENDER_PT_motion_blur,
RENDER_PT_shading,
RENDER_PT_output,
RENDER_PT_encoding,
RENDER_PT_performance,
RENDER_PT_post_processing,
RENDER_PT_stamp,
RENDER_PT_bake]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -23,7 +23,7 @@ from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class SceneButtonsPanel(bpy.types.Panel):
class SceneButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "scene"
@ -32,7 +32,7 @@ class SceneButtonsPanel(bpy.types.Panel):
return context.scene
class SCENE_PT_scene(SceneButtonsPanel):
class SCENE_PT_scene(SceneButtonsPanel, bpy.types.Panel):
bl_label = "Scene"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -49,11 +49,11 @@ class SCENE_PT_scene(SceneButtonsPanel):
layout.prop(scene, "set", text="")
class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel):
class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, bpy.types.Panel):
_context_path = "scene"
class SCENE_PT_unit(SceneButtonsPanel):
class SCENE_PT_unit(SceneButtonsPanel, bpy.types.Panel):
bl_label = "Units"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -78,7 +78,7 @@ class SCENE_PT_unit(SceneButtonsPanel):
layout.column().prop(unit, "rotation_units")
class SCENE_PT_keying_sets(SceneButtonsPanel):
class SCENE_PT_keying_sets(SceneButtonsPanel, bpy.types.Panel):
bl_label = "Keying Sets"
def draw(self, context):
@ -115,7 +115,7 @@ class SCENE_PT_keying_sets(SceneButtonsPanel):
col.prop(ks, "insertkey_xyz_to_rgb", text="XYZ to RGB")
class SCENE_PT_keying_set_paths(SceneButtonsPanel):
class SCENE_PT_keying_set_paths(SceneButtonsPanel, bpy.types.Panel):
bl_label = "Active Keying Set"
def poll(self, context):
@ -169,7 +169,7 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel):
col.prop(ksp, "insertkey_xyz_to_rgb", text="XYZ to RGB")
class SCENE_PT_physics(SceneButtonsPanel):
class SCENE_PT_physics(SceneButtonsPanel, bpy.types.Panel):
bl_label = "Gravity"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -190,7 +190,7 @@ class SCENE_PT_physics(SceneButtonsPanel):
layout.column().prop(scene, "gravity", text="")
class SCENE_PT_simplify(SceneButtonsPanel):
class SCENE_PT_simplify(SceneButtonsPanel, bpy.types.Panel):
bl_label = "Simplify"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -333,7 +333,7 @@ class ANIM_OT_keying_set_export(bpy.types.Operator):
wm.add_fileselect(self)
return {'RUNNING_MODAL'}
class SCENE_PT_navmesh(SceneButtonsPanel):
class SCENE_PT_navmesh(SceneButtonsPanel, bpy.types.Panel):
bl_label = "Navmesh"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -406,30 +406,12 @@ class SCENE_PT_navmesh(SceneButtonsPanel):
col.prop(rd, "detailsamplemaxerror")
classes = [
SCENE_PT_scene,
SCENE_PT_unit,
SCENE_PT_keying_sets,
SCENE_PT_keying_set_paths,
SCENE_PT_physics,
SCENE_PT_simplify,
SCENE_PT_navmesh,
SCENE_PT_custom_props,
ANIM_OT_keying_set_export]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -65,7 +65,7 @@ def context_tex_datablock(context):
return idblock
class TextureButtonsPanel(bpy.types.Panel):
class TextureButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "texture"
@ -78,7 +78,7 @@ class TextureButtonsPanel(bpy.types.Panel):
return (tex.type != 'NONE' or tex.use_nodes) and (engine in self.COMPAT_ENGINES)
class TEXTURE_PT_preview(TextureButtonsPanel):
class TEXTURE_PT_preview(TextureButtonsPanel, bpy.types.Panel):
bl_label = "Preview"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -95,7 +95,7 @@ class TEXTURE_PT_preview(TextureButtonsPanel):
layout.template_preview(tex, slot=slot)
class TEXTURE_PT_context_texture(TextureButtonsPanel):
class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel):
bl_label = ""
bl_show_header = False
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -166,7 +166,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
layout.prop(tex, "type", text="")
class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel):
class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, bpy.types.Panel):
_context_path = "texture"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -175,7 +175,7 @@ class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel):
return context.texture and (engine in self.COMPAT_ENGINES)
class TEXTURE_PT_colors(TextureButtonsPanel):
class TEXTURE_PT_colors(TextureButtonsPanel, bpy.types.Panel):
bl_label = "Colors"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -220,7 +220,7 @@ class TextureSlotPanel(TextureButtonsPanel):
return TextureButtonsPanel.poll(self, context) and (engine in self.COMPAT_ENGINES)
class TEXTURE_PT_mapping(TextureSlotPanel):
class TEXTURE_PT_mapping(TextureSlotPanel, bpy.types.Panel):
bl_label = "Mapping"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -317,7 +317,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel):
col.prop(tex, "size")
class TEXTURE_PT_influence(TextureSlotPanel):
class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel):
bl_label = "Influence"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -451,7 +451,7 @@ class TextureTypePanel(TextureButtonsPanel):
return ((tex and tex.type == self.tex_type and not tex.use_nodes) and (engine in self.COMPAT_ENGINES))
class TEXTURE_PT_clouds(TextureTypePanel):
class TEXTURE_PT_clouds(TextureTypePanel, bpy.types.Panel):
bl_label = "Clouds"
tex_type = 'CLOUDS'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -481,7 +481,7 @@ class TEXTURE_PT_clouds(TextureTypePanel):
col.prop(tex, "nabla", text="Nabla")
class TEXTURE_PT_wood(TextureTypePanel):
class TEXTURE_PT_wood(TextureTypePanel, bpy.types.Panel):
bl_label = "Wood"
tex_type = 'WOOD'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -518,7 +518,7 @@ class TEXTURE_PT_wood(TextureTypePanel):
col.prop(tex, "nabla")
class TEXTURE_PT_marble(TextureTypePanel):
class TEXTURE_PT_marble(TextureTypePanel, bpy.types.Panel):
bl_label = "Marble"
tex_type = 'MARBLE'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -550,7 +550,7 @@ class TEXTURE_PT_marble(TextureTypePanel):
col.prop(tex, "nabla")
class TEXTURE_PT_magic(TextureTypePanel):
class TEXTURE_PT_magic(TextureTypePanel, bpy.types.Panel):
bl_label = "Magic"
tex_type = 'MAGIC'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -571,7 +571,7 @@ class TEXTURE_PT_magic(TextureTypePanel):
col.prop(tex, "turbulence")
class TEXTURE_PT_blend(TextureTypePanel):
class TEXTURE_PT_blend(TextureTypePanel, bpy.types.Panel):
bl_label = "Blend"
tex_type = 'BLEND'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -593,7 +593,7 @@ class TEXTURE_PT_blend(TextureTypePanel):
sub.prop(tex, "flip_axis", expand=True)
class TEXTURE_PT_stucci(TextureTypePanel):
class TEXTURE_PT_stucci(TextureTypePanel, bpy.types.Panel):
bl_label = "Stucci"
tex_type = 'STUCCI'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -622,7 +622,7 @@ class TEXTURE_PT_stucci(TextureTypePanel):
col.prop(tex, "turbulence")
class TEXTURE_PT_image(TextureTypePanel):
class TEXTURE_PT_image(TextureTypePanel, bpy.types.Panel):
bl_label = "Image"
tex_type = 'IMAGE'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -648,7 +648,7 @@ def texture_filter_common(tex, layout):
layout.prop(tex, "filter_size_minimum")
class TEXTURE_PT_image_sampling(TextureTypePanel):
class TEXTURE_PT_image_sampling(TextureTypePanel, bpy.types.Panel):
bl_label = "Image Sampling"
bl_default_closed = True
tex_type = 'IMAGE'
@ -689,7 +689,7 @@ class TEXTURE_PT_image_sampling(TextureTypePanel):
texture_filter_common(tex, col)
class TEXTURE_PT_image_mapping(TextureTypePanel):
class TEXTURE_PT_image_mapping(TextureTypePanel, bpy.types.Panel):
bl_label = "Image Mapping"
bl_default_closed = True
tex_type = 'IMAGE'
@ -748,7 +748,7 @@ class TEXTURE_PT_image_mapping(TextureTypePanel):
col.prop(tex, "crop_max_y", text="Y")
class TEXTURE_PT_plugin(TextureTypePanel):
class TEXTURE_PT_plugin(TextureTypePanel, bpy.types.Panel):
bl_label = "Plugin"
tex_type = 'PLUGIN'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -761,7 +761,7 @@ class TEXTURE_PT_plugin(TextureTypePanel):
layout.label(text="Nothing yet")
class TEXTURE_PT_envmap(TextureTypePanel):
class TEXTURE_PT_envmap(TextureTypePanel, bpy.types.Panel):
bl_label = "Environment Map"
tex_type = 'ENVIRONMENT_MAP'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -802,7 +802,7 @@ class TEXTURE_PT_envmap(TextureTypePanel):
col.prop(env, "clip_end", text="End")
class TEXTURE_PT_envmap_sampling(TextureTypePanel):
class TEXTURE_PT_envmap_sampling(TextureTypePanel, bpy.types.Panel):
bl_label = "Environment Map Sampling"
bl_default_closed = True
tex_type = 'ENVIRONMENT_MAP'
@ -816,7 +816,7 @@ class TEXTURE_PT_envmap_sampling(TextureTypePanel):
texture_filter_common(tex, layout)
class TEXTURE_PT_musgrave(TextureTypePanel):
class TEXTURE_PT_musgrave(TextureTypePanel, bpy.types.Panel):
bl_label = "Musgrave"
tex_type = 'MUSGRAVE'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -864,7 +864,7 @@ class TEXTURE_PT_musgrave(TextureTypePanel):
col.prop(tex, "nabla")
class TEXTURE_PT_voronoi(TextureTypePanel):
class TEXTURE_PT_voronoi(TextureTypePanel, bpy.types.Panel):
bl_label = "Voronoi"
tex_type = 'VORONOI'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -908,7 +908,7 @@ class TEXTURE_PT_voronoi(TextureTypePanel):
col.prop(tex, "nabla")
class TEXTURE_PT_distortednoise(TextureTypePanel):
class TEXTURE_PT_distortednoise(TextureTypePanel, bpy.types.Panel):
bl_label = "Distorted Noise"
tex_type = 'DISTORTED_NOISE'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -937,7 +937,7 @@ class TEXTURE_PT_distortednoise(TextureTypePanel):
col.prop(tex, "nabla")
class TEXTURE_PT_voxeldata(TextureButtonsPanel):
class TEXTURE_PT_voxeldata(TextureButtonsPanel, bpy.types.Panel):
bl_label = "Voxel Data"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -975,7 +975,7 @@ class TEXTURE_PT_voxeldata(TextureButtonsPanel):
layout.prop(vd, "intensity")
class TEXTURE_PT_pointdensity(TextureButtonsPanel):
class TEXTURE_PT_pointdensity(TextureButtonsPanel, bpy.types.Panel):
bl_label = "Point Density"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -1035,7 +1035,7 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel):
col.prop(pd, "falloff_softness")
class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel):
class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel, bpy.types.Panel):
bl_label = "Turbulence"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@ -1076,49 +1076,12 @@ class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel):
col.prop(pd, "turbulence_strength")
classes = [
TEXTURE_MT_specials,
TEXTURE_MT_envmap_specials,
TEXTURE_PT_context_texture,
TEXTURE_PT_preview,
TEXTURE_PT_clouds, # Texture Type Panels
TEXTURE_PT_wood,
TEXTURE_PT_marble,
TEXTURE_PT_magic,
TEXTURE_PT_blend,
TEXTURE_PT_stucci,
TEXTURE_PT_image,
TEXTURE_PT_image_sampling,
TEXTURE_PT_image_mapping,
TEXTURE_PT_plugin,
TEXTURE_PT_envmap,
TEXTURE_PT_envmap_sampling,
TEXTURE_PT_musgrave,
TEXTURE_PT_voronoi,
TEXTURE_PT_distortednoise,
TEXTURE_PT_voxeldata,
TEXTURE_PT_pointdensity,
TEXTURE_PT_pointdensity_turbulence,
TEXTURE_PT_colors,
TEXTURE_PT_mapping,
TEXTURE_PT_influence,
TEXTURE_PT_custom_props]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

@ -23,7 +23,7 @@ from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class WorldButtonsPanel(bpy.types.Panel):
class WorldButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "world"
@ -34,7 +34,7 @@ class WorldButtonsPanel(bpy.types.Panel):
return (context.world) and (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES)
class WORLD_PT_preview(WorldButtonsPanel):
class WORLD_PT_preview(WorldButtonsPanel, bpy.types.Panel):
bl_label = "Preview"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -42,7 +42,7 @@ class WORLD_PT_preview(WorldButtonsPanel):
self.layout.template_preview(context.world)
class WORLD_PT_context_world(WorldButtonsPanel):
class WORLD_PT_context_world(WorldButtonsPanel, bpy.types.Panel):
bl_label = ""
bl_show_header = False
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -70,12 +70,12 @@ class WORLD_PT_context_world(WorldButtonsPanel):
layout.template_ID(scene, "world", new="world.new")
class WORLD_PT_custom_props(WorldButtonsPanel, PropertyPanel):
class WORLD_PT_custom_props(WorldButtonsPanel, PropertyPanel, bpy.types.Panel):
COMPAT_ENGINES = {'BLENDER_RENDER'}
_context_path = "world"
class WORLD_PT_world(WorldButtonsPanel):
class WORLD_PT_world(WorldButtonsPanel, bpy.types.Panel):
bl_label = "World"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -103,7 +103,7 @@ class WORLD_PT_world(WorldButtonsPanel):
row.column().prop(world, "ambient_color")
class WORLD_PT_mist(WorldButtonsPanel):
class WORLD_PT_mist(WorldButtonsPanel, bpy.types.Panel):
bl_label = "Mist"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -134,7 +134,7 @@ class WORLD_PT_mist(WorldButtonsPanel):
layout.prop(world.mist, "falloff")
class WORLD_PT_stars(WorldButtonsPanel):
class WORLD_PT_stars(WorldButtonsPanel, bpy.types.Panel):
bl_label = "Stars"
bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -163,7 +163,7 @@ class WORLD_PT_stars(WorldButtonsPanel):
col.prop(world.stars, "average_separation", text="Separation")
class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
class WORLD_PT_ambient_occlusion(WorldButtonsPanel, bpy.types.Panel):
bl_label = "Ambient Occlusion"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -182,7 +182,7 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
split.prop(light, "ao_blend_mode", text="")
class WORLD_PT_environment_lighting(WorldButtonsPanel):
class WORLD_PT_environment_lighting(WorldButtonsPanel, bpy.types.Panel):
bl_label = "Environment Lighting"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -201,7 +201,7 @@ class WORLD_PT_environment_lighting(WorldButtonsPanel):
split.prop(light, "environment_color", text="")
class WORLD_PT_indirect_lighting(WorldButtonsPanel):
class WORLD_PT_indirect_lighting(WorldButtonsPanel, bpy.types.Panel):
bl_label = "Indirect Lighting"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -224,7 +224,7 @@ class WORLD_PT_indirect_lighting(WorldButtonsPanel):
split.prop(light, "indirect_bounces", text="Bounces")
class WORLD_PT_gather(WorldButtonsPanel):
class WORLD_PT_gather(WorldButtonsPanel, bpy.types.Panel):
bl_label = "Gather"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@ -272,30 +272,12 @@ class WORLD_PT_gather(WorldButtonsPanel):
col.prop(light, "correction")
classes = [
WORLD_PT_context_world,
WORLD_PT_preview,
WORLD_PT_world,
WORLD_PT_ambient_occlusion,
WORLD_PT_environment_lighting,
WORLD_PT_indirect_lighting,
WORLD_PT_gather,
WORLD_PT_mist,
WORLD_PT_stars,
WORLD_PT_custom_props]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
pass
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
pass
if __name__ == "__main__":
register()

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