diff options
author | Miika Hamalainen <blender@miikah.org> | 2011-07-02 22:15:55 +0400 |
---|---|---|
committer | Miika Hamalainen <blender@miikah.org> | 2011-07-02 22:15:55 +0400 |
commit | fdc59b8a40014c28e033f39cbf144565568d7058 (patch) | |
tree | f0acaba90be9c2b0fac9b70e2010479fd8f02c51 | |
parent | 9ae663154fd9f100c299afaab05a560b1a2a55a4 (diff) | |
parent | 3ee2cb9cdb647729a1d62d2b2dab45813d938cc8 (diff) |
Merge with trunk r38042
62 files changed, 2713 insertions, 2279 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d65e62d88fc..f7e8d7dc172 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,10 +53,12 @@ if(NOT EXECUTABLE_OUTPUT_PATH) set(FIRST_RUN "TRUE") endif() - # this starts out unset list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/Modules") +# avoid having empty buildtype +set(CMAKE_BUILD_TYPE_INIT "Release") + # quiet output for Makefiles, 'make -s' helps too # set_property(GLOBAL PROPERTY RULE_MESSAGES OFF) @@ -142,7 +144,7 @@ option(WITH_IMAGE_HDR "Enable HDR Image Support" ON) option(WITH_IMAGE_REDCODE "Enable RedCode Image Support" OFF) # Audio/Video format support -option(WITH_CODEC_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu)" OFF) +option(WITH_CODEC_FFMPEG "Enable FFMPeg Support (http://ffmpeg.org)" OFF) option(WITH_CODEC_SNDFILE "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF) if(APPLE OR (WIN32 AND NOT UNIX)) option(WITH_CODEC_QUICKTIME "Enable Quicktime Support" OFF) @@ -240,11 +242,24 @@ TEST_SSE_SUPPORT() set(WITH_BINRELOC OFF) # MAXOSX only, set to avoid uninitialized -set(EXETYPE "") +set(EXETYPE) + +# C/C++ flags +set(PLATFORM_CFLAGS) # these are added to later on. -set(C_WARNINGS "") -set(CXX_WARNINGS "") +set(C_WARNINGS) +set(CXX_WARNINGS) + +# libraries to link the binary with passed to target_link_libraries() +# known as LLIBS to scons +set(PLATFORM_LINKLIBS) + +# Added to linker flags in setup_liblinks +# - CMAKE_EXE_LINKER_FLAGS +# - CMAKE_EXE_LINKER_FLAGS_DEBUG +set(PLATFORM_LINKFLAGS) +set(PLATFORM_LINKFLAGS_DEBUG) # disabled for now, not supported @@ -347,7 +362,7 @@ if(UNIX AND NOT APPLE) endif() if(WITH_CODEC_FFMPEG) - set(FFMPEG /usr CACHE FILEPATH "FFMPEG Directory") + set(FFMPEG /usr CACHE PATH "FFMPEG Directory") mark_as_advanced(FFMPEG) set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include) set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries") @@ -391,18 +406,18 @@ if(UNIX AND NOT APPLE) endif() if(WITH_OPENCOLLADA) - set(OPENCOLLADA /usr/local/opencollada CACHE FILEPATH "OpenCollada Directory") + set(OPENCOLLADA /usr/local/opencollada CACHE PATH "OpenCollada Directory") mark_as_advanced(OPENCOLLADA) set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib) set(OPENCOLLADA_LIBRARIES OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre ftoa buffer xml2) set(OPENCOLLADA_INCLUDE_DIR ${OPENCOLLADA}) - set(PCRE /usr CACHE FILEPATH "PCRE Directory") + set(PCRE /usr CACHE PATH "PCRE Directory") mark_as_advanced(PCRE) set(PCRE_LIBPATH ${PCRE}/lib) set(PCRE_LIB pcre) - set(EXPAT /usr CACHE FILEPATH "Expat Directory") + set(EXPAT /usr CACHE PATH "Expat Directory") mark_as_advanced(EXPAT) set(EXPAT_LIBPATH ${EXPAT}/lib) set(EXPAT_LIB expat) @@ -416,24 +431,24 @@ if(UNIX AND NOT APPLE) endif() # OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed - set(LLIBS "-lutil -lc -lm -lpthread -lstdc++") + set(PLATFORM_LINKLIBS "-lutil -lc -lm -lpthread -lstdc++") if(NOT WITH_HEADLESS) find_package(X11 REQUIRED) find_path(X11_XF86keysym_INCLUDE_PATH X11/XF86keysym.h ${X11_INC_SEARCH_PATH}) mark_as_advanced(X11_XF86keysym_INCLUDE_PATH) - list(APPEND LLIBS ${X11_X11_LIB}) + list(APPEND PLATFORM_LINKLIBS ${X11_X11_LIB}) if(WITH_X11_XINPUT) - list(APPEND LLIBS ${X11_Xinput_LIB}) + list(APPEND PLATFORM_LINKLIBS ${X11_Xinput_LIB}) endif() endif() if(CMAKE_SYSTEM_NAME MATCHES "Linux") if(NOT WITH_PYTHON_MODULE) # BSD's dont use libdl.so - list(APPEND LLIBS -ldl) + list(APPEND PLATFORM_LINKLIBS -ldl) # binreloc is linux only set(BINRELOC_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/binreloc/include) set(WITH_BINRELOC ON) @@ -544,13 +559,15 @@ elseif(WIN32) if(MSVC) if(CMAKE_CL_64) - set(LLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid) + set(PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid) else() - set(LLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid) + set(PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid) endif() - - set(CMAKE_CXX_FLAGS "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_CONSOLE /D_LIB /nologo /Ob1 /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013" CACHE STRING "MSVC MT C++ flags " FORCE) - set(CMAKE_C_FLAGS "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_CONSOLE /D_LIB /nologo /Ob1 /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013 /EHsc" CACHE STRING "MSVC MT C++ flags " FORCE) + + add_definitions(/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_CONSOLE /D_LIB) + + set(CMAKE_CXX_FLAGS "/nologo /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013" CACHE STRING "MSVC MT C++ flags " FORCE) + set(CMAKE_C_FLAGS "/nologo /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013 /EHsc" CACHE STRING "MSVC MT C++ flags " FORCE) if(CMAKE_CL_64) set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE) @@ -587,24 +604,22 @@ elseif(WIN32) endif() set(JPEG_LIBRARIES libjpeg) - set(ZLIB ${LIBDIR}/zlib) - set(ZLIB_INCLUDE_DIRS ${ZLIB}/include) - set(ZLIB_LIBPATH ${ZLIB}/lib) + set(ZLIB_INCLUDE_DIRS ${LIBDIR}/zlib/include) if(CMAKE_CL_64) - set(ZLIB_LIBRARIES libz) + set(ZLIB_LIBRARIES ${LIBDIR}/zlib/lib/libz.lib) else() - set(ZLIB_LIBRARIES zlib) + set(ZLIB_LIBRARIES ${LIBDIR}/zlib/lib/zlib.lib) endif() - set(PTHREADS ${LIBDIR}/pthreads) - set(PTHREADS_INCLUDE_DIRS ${PTHREADS}/include) - set(PTHREADS_LIBPATH ${PTHREADS}/lib) - set(PTHREADS_LIBRARIES pthreadVC2) - + set(PTHREADS_INCLUDE_DIRS ${LIBDIR}/pthreads/include) + set(PTHREADS_LIBRARIES ${LIBDIR}/pthreads/lib/pthreadVC2.lib) + set(FREETYPE ${LIBDIR}/freetype) - set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2) - set(FREETYPE_LIBPATH ${FREETYPE}/lib) - set(FREETYPE_LIBRARY freetype2ST) + set(FREETYPE_INCLUDE_DIRS + ${LIBDIR}/freetype/include + ${LIBDIR}/freetype/include/freetype2 + ) + set(FREETYPE_LIBRARY ${LIBDIR}/freetype/lib/freetype2ST.lib) if(WITH_FFTW3) set(FFTW3 ${LIBDIR}/fftw3) @@ -635,10 +650,17 @@ elseif(WIN32) endif() if(WITH_CODEC_FFMPEG) - set(FFMPEG ${LIBDIR}/ffmpeg) - set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include ${FFMPEG}/include/msvc) - set(FFMPEG_LIBRARIES avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0) - set(FFMPEG_LIBPATH ${FFMPEG}/lib) + set(FFMPEG_INCLUDE_DIRS + ${LIBDIR}/ffmpeg/include + ${LIBDIR}/ffmpeg/include/msvc + ) + set(FFMPEG_LIBRARIES + ${LIBDIR}/ffmpeg/lib/avcodec-52.lib + ${LIBDIR}/ffmpeg/lib/avformat-52.lib + ${LIBDIR}/ffmpeg/lib/avdevice-52.lib + ${LIBDIR}/ffmpeg/lib/avutil-50.lib + ${LIBDIR}/ffmpeg/lib/swscale-0.lib + ) endif() if(WITH_IMAGE_OPENEXR) @@ -673,17 +695,16 @@ elseif(WIN32) endif() if(WITH_IMAGE_TIFF) - set(TIFF ${LIBDIR}/tiff) - set(TIFF_LIBRARY libtiff) - set(TIFF_INCLUDE_DIR ${TIFF}/include) - set(TIFF_LIBPATH ${TIFF}/lib) + set(TIFF_LIBRARY ${LIBDIR}/tiff/lib/libtiff.lib) + set(TIFF_INCLUDE_DIR ${LIBDIR}/tiff/include) endif() if(WITH_JACK) - set(JACK ${LIBDIR}/jack) - set(JACK_INCLUDE_DIRS ${JACK}/include/jack ${JACK}/include) - set(JACK_LIBRARIES libjack) - set(JACK_LIBPATH ${JACK}/lib) + set(JACK_INCLUDE_DIRS + ${LIBDIR}/jack/include/jack + ${LIBDIR}/jack/include + ) + set(JACK_LIBRARIES ${LIBDIR}/jack/lib/libjack.lib) endif() if(WITH_PYTHON) @@ -693,23 +714,24 @@ elseif(WIN32) set(PYTHON_LIBRARIES ${LIBDIR}/python/lib/python32.lib) endif() + set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib") + # MSVC only, Mingw doesnt need if(CMAKE_CL_64) - set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /MACHINE:X64 /STACK:2097152 /OPT:NOREF /INCREMENTAL:NO /NODEFAULTLIB:\"msvcrt.lib\" /NODEFAULTLIB:\"msvcmrt.lib\" /NODEFAULTLIB:\"msvcurt.lib\" /NODEFAULTLIB:\"msvcrtd.lib\" ") + set(PLATFORM_LINKFLAGS "/MACHINE:X64 /OPT:NOREF ${PLATFORM_LINKFLAGS}") else() - set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /MACHINE:IX86 /STACK:2097152 /INCREMENTAL:NO /LARGEADDRESSAWARE /NODEFAULTLIB:\"msvcrt.lib\" /NODEFAULTLIB:\"msvcmrt.lib\" /NODEFAULTLIB:\"msvcurt.lib\" /NODEFAULTLIB:\"msvcrtd.lib\" ") + set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}") endif() - set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ") + set(PLATFORM_LINKFLAGS_DEBUG "/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib") else() # keep GCC spesific stuff here if(CMAKE_COMPILER_IS_GNUCC) - set(LLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid") + set(PLATFORM_LINKLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid") set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE") + add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE) endif() add_definitions(-DFREE_WINDOWS) @@ -919,7 +941,7 @@ elseif(APPLE) set(SAMPLERATE_LIBPATH ${SAMPLERATE}/lib) endif() - set(LLIBS stdc++ SystemStubs) + set(PLATFORM_LINKLIBS stdc++ SystemStubs) if(WITH_COCOA) set(PLATFORM_CFLAGS "-pipe -funsigned-char -DGHOST_COCOA") @@ -1143,6 +1165,18 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel") endif() +# MSVC2010 fails to links C++ libs right +if(MSVC10) + if(WITH_IMAGE_OPENEXR) + message(WARNING "MSVC 2010 does not support OpenEXR, disabling WITH_IMAGE_OPENEXR. To enable support use Use MSVC 2008") + set(WITH_IMAGE_OPENEXR OFF) + endif() + if(WITH_OPENCOLLADA) + message(WARNING "MSVC 2010 does not support OpenCollada, disabling WITH_OPENCOLLADA. To enable support use Use MSVC 2008") + set(WITH_OPENCOLLADA OFF) + endif() +endif() + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(WITH_IK_ITASC OR WITH_MOD_FLUID) message(WARNING "Using Clang as CXX compiler: disabling WITH_IK_ITASC and WITH_MOD_FLUID, these features will be missing.") diff --git a/GNUmakefile b/GNUmakefile index 47073bf5734..b55890f9271 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -75,7 +75,8 @@ all: @echo Building Blender ... make -C $(BUILD_DIR) -s -j $(NPROCS) install @echo - @echo run blender from "$(BUILD_DIR)/bin/blender" + @echo edit build configuration with: "$(BUILD_DIR)/CMakeCache.txt" run make again to rebuild. + @echo blender installed, run from: "$(BUILD_DIR)/bin/blender" @echo debug: all diff --git a/build_files/cmake/cmake_consistency_check.py b/build_files/cmake/cmake_consistency_check.py index b0fd242db4a..c13da8775b3 100755 --- a/build_files/cmake/cmake_consistency_check.py +++ b/build_files/cmake/cmake_consistency_check.py @@ -26,7 +26,7 @@ from cmake_consistency_check_config import IGNORE, UTF8_CHECK, SOURCE_DIR import os -from os.path import join, dirname, normpath, abspath, splitext +from os.path import join, dirname, normpath, splitext print("Scanning:", SOURCE_DIR) @@ -183,7 +183,6 @@ def is_ignore(f): # First do stupid check, do these files exist? print("\nChecking for missing references:") -import sys is_err = False errs = [] for f in (global_h | global_c): diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 8ae73451e31..34301458a06 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -201,7 +201,9 @@ endmacro() macro(setup_liblinks target) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS} ") + + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}") + set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}") target_link_libraries(${target} ${OPENGL_gl_LIBRARY} @@ -209,7 +211,7 @@ macro(setup_liblinks ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} - ${LLIBS}) + ${PLATFORM_LINKLIBS}) # since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions if(WITH_PYTHON) # AND NOT WITH_PYTHON_MODULE # WIN32 needs diff --git a/build_files/scons/config/win32-vc-config.py b/build_files/scons/config/win32-vc-config.py index ab7b5ce7d14..89b246cb39f 100644 --- a/build_files/scons/config/win32-vc-config.py +++ b/build_files/scons/config/win32-vc-config.py @@ -181,7 +181,7 @@ CXX_WARN = [] LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid'] -PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/STACK:2097152','/INCREMENTAL:NO', '/LARGEADDRESSAWARE', '/NODEFAULTLIB:"msvcrt.lib"', '/NODEFAULTLIB:"msvcmrt.lib"', '/NODEFAULTLIB:"msvcurt.lib"', '/NODEFAULTLIB:"msvcrtd.lib"'] +PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/STACK:2097152','/INCREMENTAL:NO', '/LARGEADDRESSAWARE', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib'] # # Todo # BF_PROFILE_CCFLAGS = ['-pg', '-g '] diff --git a/build_files/scons/config/win64-vc-config.py b/build_files/scons/config/win64-vc-config.py index 3abc466d33d..67db1c441d7 100644 --- a/build_files/scons/config/win64-vc-config.py +++ b/build_files/scons/config/win64-vc-config.py @@ -50,6 +50,8 @@ BF_SDL_INC = '${BF_SDL}/include' BF_SDL_LIB = 'SDL.lib' BF_SDL_LIBPATH = '${BF_SDL}/lib' +WITH_BF_JACK = False + BF_PTHREADS = LIBDIR + '/pthreads' BF_PTHREADS_INC = '${BF_PTHREADS}/include' BF_PTHREADS_LIB = 'pthreadVC2' @@ -188,7 +190,7 @@ if BF_DEBUG: else: BF_NUMJOBS=6 -PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:X64','/STACK:2097152','/OPT:NOREF','/INCREMENTAL:NO', '/NODEFAULTLIB:"msvcrt.lib"', '/NODEFAULTLIB:"msvcmrt.lib"', '/NODEFAULTLIB:"msvcurt.lib"', '/NODEFAULTLIB:"msvcrtd.lib"'] +PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:X64','/STACK:2097152','/OPT:NOREF','/INCREMENTAL:NO', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib'] BF_BUILDDIR = '..\\build\\blender25-win64-vc' BF_INSTALLDIR='..\\install\\blender25-win64-vc' diff --git a/doc/python_api/epy/BGL.py b/doc/python_api/epy/BGL.py deleted file mode 100644 index ce148dc72ba..00000000000 --- a/doc/python_api/epy/BGL.py +++ /dev/null @@ -1,1807 +0,0 @@ -# Blender.BGL module (OpenGL wrapper) - -""" -The Blender.BGL submodule (the OpenGL wrapper). - -B{New}: some GLU functions: L{gluLookAt}, etc. - -The Blender.BGL submodule -========================= -(when accessing it from the Game Engine use BGL instead of Blender.BGL) - -This module wraps OpenGL constants and functions, making them available from -within Blender Python. - -The complete list can be retrieved from the module itself, by listing its -contents: dir(Blender.BGL). A simple search on the net can point to more -than enough material to teach OpenGL programming, from books to many -collections of tutorials. - -The "red book": "I{OpenGL Programming Guide: The Official Guide to Learning -OpenGL}" and the online NeHe tutorials are two of the best resources. - -Example:: - import Blender - from Blender.BGL import * - from Blender import Draw - R = G = B = 0 - A = 1 - title = "Testing BGL + Draw" - instructions = "Use mouse buttons or wheel to change the background color." - quitting = " Press ESC or q to quit." - len1 = Draw.GetStringWidth(title) - len2 = Draw.GetStringWidth(instructions + quitting) - # - def show_win(): - glClearColor(R,G,B,A) # define color used to clear buffers - glClear(GL_COLOR_BUFFER_BIT) # use it to clear the color buffer - glColor3f(0.35,0.18,0.92) # define default color - glBegin(GL_POLYGON) # begin a vertex data list - glVertex2i(165, 158) - glVertex2i(252, 55) - glVertex2i(104, 128) - glEnd() - glColor3f(0.4,0.4,0.4) # change default color - glRecti(40, 96, 60+len1, 113) - glColor3f(1,1,1) - glRasterPos2i(50,100) # move cursor to x = 50, y = 100 - Draw.Text(title) # draw this text there - glRasterPos2i(350,40) # move cursor again - Draw.Text(instructions + quitting) # draw another msg - glBegin(GL_LINE_LOOP) # begin a vertex-data list - glVertex2i(46,92) - glVertex2i(120,92) - glVertex2i(120,115) - glVertex2i(46,115) - glEnd() # close this list - # - def ev(evt, val): # event callback for Draw.Register() - global R,G,B,A # ... it handles input events - if evt == Draw.ESCKEY or evt == Draw.QKEY: - Draw.Exit() # this quits the script - elif not val: return - elif evt == Draw.LEFTMOUSE: R = 1 - R - elif evt == Draw.MIDDLEMOUSE: G = 1 - G - elif evt == Draw.RIGHTMOUSE: B = 1 - B - elif evt == Draw.WHEELUPMOUSE: - R += 0.1 - if R > 1: R = 1 - elif evt == Draw.WHEELDOWNMOUSE: - R -= 0.1 - if R < 0: R = 0 - else: - return # don't redraw if nothing changed - Draw.Redraw(1) # make changes visible. - # - Draw.Register(show_win, ev, None) # start the main loop - -@note: you can use the L{Image} module and L{Image.Image} BPy object to load - and set textures. See L{Image.Image.glLoad} and L{Image.Image.glFree}, - for example. -@see: U{www.opengl.org} -@see: U{nehe.gamedev.net} -""" - -def glAccum(op, value): - """ - Operate on the accumulation buffer - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/accum.html} - - @type op: Enumerated constant - @param op: The accumulation buffer operation. - @type value: float - @param value: a value used in the accumulation buffer operation. - """ - -def glAlphaFunc(func, ref): - """ - Specify the alpha test function - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/alphafunc.html} - - @type func: Enumerated constant - @param func: Specifies the alpha comparison function. - @type ref: float - @param ref: The reference value that incoming alpha values are compared to. - Clamped between 0 and 1. - """ - -def glAreTexturesResident(n, textures, residences): - """ - Determine if textures are loaded in texture memory - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/aretexturesresident.html} - - @type n: int - @param n: Specifies the number of textures to be queried. - @type textures: Buffer object I{type GL_INT} - @param textures: Specifies an array containing the names of the textures to be queried - @type residences: Buffer object I{type GL_INT}(boolean) - @param residences: An array in which the texture residence status in returned.The residence status of a - texture named by an element of textures is returned in the corresponding element of residences. - """ - -def glBegin(mode): - """ - Delimit the vertices of a primitive or a group of like primatives - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/begin.html} - - @type mode: Enumerated constant - @param mode: Specifies the primitive that will be create from vertices between glBegin and - glEnd. - """ - -def glBindTexture(target, texture): - """ - Bind a named texture to a texturing target - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/bindtexture.html} - - @type target: Enumerated constant - @param target: Specifies the target to which the texture is bound. - @type texture: unsigned int - @param texture: Specifies the name of a texture. - """ - -def glBitmap(width, height, xorig, yorig, xmove, ymove, bitmap): - """ - Draw a bitmap - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/bitmap.html} - - @type width, height: int - @param width, height: Specify the pixel width and height of the bitmap image. - @type xorig, yorig: float - @param xorig, yorig: Specify the location of the origin in the bitmap image. The origin is measured - from the lower left corner of the bitmap, with right and up being the positive axes. - @type xmove, ymove: float - @param xmove, ymove: Specify the x and y offsets to be added to the current raster position after - the bitmap is drawn. - @type bitmap: Buffer object I{type GL_BYTE} - @param bitmap: Specifies the address of the bitmap image. - """ - -def glBlendFunc(sfactor, dfactor): - """ - Specify pixel arithmetic - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/blendfunc.html} - - @type sfactor: Enumerated constant - @param sfactor: Specifies how the red, green, blue, and alpha source blending factors are - computed. - @type dfactor: Enumerated constant - @param dfactor: Specifies how the red, green, blue, and alpha destination blending factors are - computed. - """ - -def glCallList(list): - """ - Execute a display list - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/calllist.html} - - @type list: unsigned int - @param list: Specifies the integer name of the display list to be executed. - """ - -def glCallLists(n, type, lists): - """ - Execute a list of display lists - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/calllists.html} - - @type n: int - @param n: Specifies the number of display lists to be executed. - @type type: Enumerated constant - @param type: Specifies the type of values in lists. - @type lists: Buffer object - @param lists: Specifies the address of an array of name offsets in the display list. - The pointer type is void because the offsets can be bytes, shorts, ints, or floats, - depending on the value of type. - """ - -def glClear(mask): - """ - Clear buffers to preset values - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clear.html} - - @type mask: Enumerated constant(s) - @param mask: Bitwise OR of masks that indicate the buffers to be cleared. - """ - -def glClearAccum(red, green, blue, alpha): - """ - Specify clear values for the accumulation buffer - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearaccum.html} - - @type red, green, blue, alpha: float - @param red, green, blue, alpha: Specify the red, green, blue, and alpha values used when the - accumulation buffer is cleared. The initial values are all 0. - """ - -def glClearColor(red, green, blue, alpha): - """ - Specify clear values for the color buffers - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearcolor.html} - - @type red, green, blue, alpha: float - @param red, green, blue, alpha: Specify the red, green, blue, and alpha values used when the - color buffers are cleared. The initial values are all 0. - """ - -def glClearDepth(depth): - """ - Specify the clear value for the depth buffer - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/cleardepth.html} - - @type depth: int - @param depth: Specifies the depth value used when the depth buffer is cleared. - The initial value is 1. - """ - -def glClearIndex(c): - """ - Specify the clear value for the color index buffers - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearindex.html} - - @type c: float - @param c: Specifies the index used when the color index buffers are cleared. - The initial value is 0. - """ - -def glClearStencil(s): - """ - Specify the clear value for the stencil buffer - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearstencil.html} - - @type s: int - @param s: Specifies the index used when the stencil buffer is cleared. The initial value is 0. - """ - -def glClipPlane (plane, equation): - """ - Specify a plane against which all geometry is clipped - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clipplane.html} - - @type plane: Enumerated constant - @param plane: Specifies which clipping plane is being positioned. - @type equation: Buffer object I{type GL_FLOAT}(double) - @param equation: Specifies the address of an array of four double- precision floating-point - values. These values are interpreted as a plane equation. - """ - -def glColor (red, green, blue, alpha): - """ - B{glColor3b, glColor3d, glColor3f, glColor3i, glColor3s, glColor3ub, glColor3ui, glColor3us, - glColor4b, glColor4d, glColor4f, glColor4i, glColor4s, glColor4ub, glColor4ui, glColor4us, - glColor3bv, glColor3dv, glColor3fv, glColor3iv, glColor3sv, glColor3ubv, glColor3uiv, - glColor3usv, glColor4bv, glColor4dv, glColor4fv, glColor4iv, glColor4sv, glColor4ubv, - glColor4uiv, glColor4usv} - - Set a new color. - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/color.html} - - @type red, green, blue, alpha: Depends on function prototype. - @param red, green, blue: Specify new red, green, and blue values for the current color. - @param alpha: Specifies a new alpha value for the current color. Included only in the - four-argument glColor4 commands. (With '4' colors only) - """ - -def glColorMask(red, green, blue, alpha): - """ - Enable and disable writing of frame buffer color components - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/colormask.html} - - @type red, green, blue, alpha: int (boolean) - @param red, green, blue, alpha: Specify whether red, green, blue, and alpha can or cannot be - written into the frame buffer. The initial values are all GL_TRUE, indicating that the - color components can be written. - """ - -def glColorMaterial(face, mode): - """ - Cause a material color to track the current color - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/colormaterial.html} - - @type face: Enumerated constant - @param face: Specifies whether front, back, or both front and back material parameters should - track the current color. - @type mode: Enumerated constant - @param mode: Specifies which of several material parameters track the current color. - """ - -def glCopyPixels(x, y, width, height, type): - """ - Copy pixels in the frame buffer - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/copypixels.html} - - @type x, y: int - @param x, y: Specify the window coordinates of the lower left corner of the rectangular - region of pixels to be copied. - @type width, height: int - @param width,height: Specify the dimensions of the rectangular region of pixels to be copied. - Both must be non-negative. - @type type: Enumerated constant - @param type: Specifies whether color values, depth values, or stencil values are to be copied. - """ - - def glCopyTexImage2D(target, level, internalformat, x, y, width, height, border): - """ - Copy pixels into a 2D texture image - @see: U{www.opengl.org/sdk/docs/man/xhtml/glCopyTexImage2D.xml} - - @type target: Enumerated constant - @param target: Specifies the target texture. - @type level: int - @param level: Specifies the level-of-detail number. Level 0 is the base image level. - Level n is the nth mipmap reduction image. - @type internalformat: int - @param internalformat: Specifies the number of color components in the texture. - @type width: int - @type x, y: int - @param x, y:Specify the window coordinates of the first pixel that is copied - from the frame buffer. This location is the lower left corner of a rectangular - block of pixels. - @param width: Specifies the width of the texture image. Must be 2n+2(border) for - some integer n. All implementations support texture images that are at least 64 - texels wide. - @type height: int - @param height: Specifies the height of the texture image. Must be 2m+2(border) for - some integer m. All implementations support texture images that are at least 64 - texels high. - @type border: int - @param border: Specifies the width of the border. Must be either 0 or 1. - """ - -def glCullFace(mode): - """ - Specify whether front- or back-facing facets can be culled - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/cullface.html} - - @type mode: Enumerated constant - @param mode: Specifies whether front- or back-facing facets are candidates for culling. - """ - -def glDeleteLists(list, range): - """ - Delete a contiguous group of display lists - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/deletelists.html} - - @type list: unsigned int - @param list: Specifies the integer name of the first display list to delete - @type range: int - @param range: Specifies the number of display lists to delete - """ - -def glDeleteTextures(n, textures): - """ - Delete named textures - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/deletetextures.html} - - @type n: int - @param n: Specifies the number of textures to be deleted - @type textures: Buffer I{GL_INT} - @param textures: Specifies an array of textures to be deleted - """ - -def glDepthFunc(func): - """ - Specify the value used for depth buffer comparisons - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/depthfunc.html} - - @type func: Enumerated constant - @param func: Specifies the depth comparison function. - """ - -def glDepthMask(flag): - """ - Enable or disable writing into the depth buffer - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/depthmask.html} - - @type flag: int (boolean) - @param flag: Specifies whether the depth buffer is enabled for writing. If flag is GL_FALSE, - depth buffer writing is disabled. Otherwise, it is enabled. Initially, depth buffer - writing is enabled. - """ - -def glDepthRange(zNear, zFar): - """ - Specify mapping of depth values from normalized device coordinates to window coordinates - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/depthrange.html} - - @type zNear: int - @param zNear: Specifies the mapping of the near clipping plane to window coordinates. - The initial value is 0. - @type zFar: int - @param zFar: Specifies the mapping of the far clipping plane to window coordinates. - The initial value is 1. - """ - -def glDisable(cap): - """ - Disable server-side GL capabilities - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/enable.html} - - @type cap: Enumerated constant - @param cap: Specifies a symbolic constant indicating a GL capability. - """ - -def glDrawBuffer(mode): - """ - Specify which color buffers are to be drawn into - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/drawbuffer.html} - - @type mode: Enumerated constant - @param mode: Specifies up to four color buffers to be drawn into. - """ - -def glDrawPixels(width, height, format, type, pixels): - """ - Write a block of pixels to the frame buffer - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/drawpixels.html} - - @type width, height: int - @param width, height: Specify the dimensions of the pixel rectangle to be - written into the frame buffer. - @type format: Enumerated constant - @param format: Specifies the format of the pixel data. - @type type: Enumerated constant - @param type: Specifies the data type for pixels. - @type pixels: Buffer object - @param pixels: Specifies a pointer to the pixel data. - """ - -def glEdgeFlag (flag): - """ - B{glEdgeFlag, glEdgeFlagv} - - Flag edges as either boundary or non-boundary - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/edgeflag.html} - - @type flag: Depends of function prototype - @param flag: Specifies the current edge flag value.The initial value is GL_TRUE. - """ - -def glEnable(cap): - """ - Enable server-side GL capabilities - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/enable.html} - - @type cap: Enumerated constant - @param cap: Specifies a symbolic constant indicating a GL capability. - """ - -def glEnd(): - """ - Delimit the vertices of a primitive or group of like primitives - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/begin.html} - """ - -def glEndList(): - """ - Create or replace a display list - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/newlist.html} - """ - -def glEvalCoord (u,v): - """ - B{glEvalCoord1d, glEvalCoord1f, glEvalCoord2d, glEvalCoord2f, glEvalCoord1dv, glEvalCoord1fv, - glEvalCoord2dv, glEvalCoord2fv} - - Evaluate enabled one- and two-dimensional maps - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/evalcoord.html} - - @type u: Depends on function prototype. - @param u: Specifies a value that is the domain coordinate u to the basis function defined - in a previous glMap1 or glMap2 command. If the function prototype ends in 'v' then - u specifies a pointer to an array containing either one or two domain coordinates. The first - coordinate is u. The second coordinate is v, which is present only in glEvalCoord2 versions. - @type v: Depends on function prototype. (only with '2' prototypes) - @param v: Specifies a value that is the domain coordinate v to the basis function defined - in a previous glMap2 command. This argument is not present in a glEvalCoord1 command. - """ - -def glEvalMesh (mode, i1, i2): - """ - B{glEvalMesh1 or glEvalMesh2} - - Compute a one- or two-dimensional grid of points or lines - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/evalmesh.html} - - @type mode: Enumerated constant - @param mode: In glEvalMesh1, specifies whether to compute a one-dimensional - mesh of points or lines. - @type i1, i2: int - @param i1, i2: Specify the first and last integer values for the grid domain variable i. - """ - -def glEvalPoint (i, j): - """ - B{glEvalPoint1 and glEvalPoint2} - - Generate and evaluate a single point in a mesh - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/evalpoint.html} - - @type i: int - @param i: Specifies the integer value for grid domain variable i. - @type j: int (only with '2' prototypes) - @param j: Specifies the integer value for grid domain variable j (glEvalPoint2 only). - """ - -def glFeedbackBuffer (size, type, buffer): - """ - Controls feedback mode - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/feedbackbuffer.html} - - @type size: int - @param size:Specifies the maximum number of values that can be written into buffer. - @type type: Enumerated constant - @param type:Specifies a symbolic constant that describes the information that - will be returned for each vertex. - @type buffer: Buffer object I{GL_FLOAT} - @param buffer: Returns the feedback data. - """ - -def glFinish(): - """ - Block until all GL execution is complete - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/finish.html} - """ - -def glFlush(): - """ - Force Execution of GL commands in finite time - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/flush.html} - """ - -def glFog (pname, param): - """ - B{glFogf, glFogi, glFogfv, glFogiv} - - Specify fog parameters - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/fog.html} - - @type pname: Enumerated constant - @param pname: Specifies a single-valued fog parameter. If the function prototype - ends in 'v' specifies a fog parameter. - @type param: Depends on function prototype. - @param param: Specifies the value or values to be assigned to pname. GL_FOG_COLOR - requires an array of four values. All other parameters accept an array containing - only a single value. - """ - -def glFrontFace(mode): - """ - Define front- and back-facing polygons - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/frontface.html} - - @type mode: Enumerated constant - @param mode: Specifies the orientation of front-facing polygons. - """ - -def glFrustum(left, right, bottom, top, zNear, zFar): - """ - Multiply the current matrix by a perspective matrix - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/frustum.html} - - @type left, right: double (float) - @param left, right: Specify the coordinates for the left and right vertical - clipping planes. - @type top, bottom: double (float) - @param top, bottom: Specify the coordinates for the bottom and top horizontal - clipping planes. - @type zNear, zFar: double (float) - @param zNear, zFar: Specify the distances to the near and far depth clipping planes. - Both distances must be positive. - """ - -def glGenLists(range): - """ - Generate a contiguous set of empty display lists - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/genlists.html} - - @type range: int - @param range: Specifies the number of contiguous empty display lists to be generated. - """ - -def glGenTextures(n, textures): - """ - Generate texture names - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gentextures.html} - - @type n: int - @param n: Specifies the number of textures name to be generated. - @type textures: Buffer object I{type GL_INT} - @param textures: Specifies an array in which the generated textures names are stored. - """ - -def glGet (pname, param): - """ - B{glGetBooleanv, glGetfloatv, glGetFloatv, glGetIntegerv} - - Return the value or values of a selected parameter - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/get.html} - - @type pname: Enumerated constant - @param pname: Specifies the parameter value to be returned. - @type param: Depends on function prototype. - @param param: Returns the value or values of the specified parameter. - """ - -def glGetClipPlane(plane, equation): - """ - Return the coefficients of the specified clipping plane - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getclipplane.html} - - @type plane: Enumerated constant - @param plane: Specifies a clipping plane. The number of clipping planes depends on the - implementation, but at least six clipping planes are supported. They are identified by - symbolic names of the form GL_CLIP_PLANEi where 0 < i < GL_MAX_CLIP_PLANES. - @type equation: Buffer object I{type GL_FLOAT} - @param equation: Returns four float (double)-precision values that are the coefficients of the - plane equation of plane in eye coordinates. The initial value is (0, 0, 0, 0). - """ - -def glGetError(): - """ - Return error information - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/geterror.html} - """ - -def glGetLight (light, pname, params): - """ - B{glGetLightfv and glGetLightiv} - - Return light source parameter values - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getlight.html} - - @type light: Enumerated constant - @param light: Specifies a light source. The number of possible lights depends on the - implementation, but at least eight lights are supported. They are identified by symbolic - names of the form GL_LIGHTi where 0 < i < GL_MAX_LIGHTS. - @type pname: Enumerated constant - @param pname: Specifies a light source parameter for light. - @type params: Buffer object. Depends on function prototype. - @param params: Returns the requested data. - """ - -def glGetMap (target, query, v): - """ - B{glGetMapdv, glGetMapfv, glGetMapiv} - - Return evaluator parameters - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getmap.html} - - @type target: Enumerated constant - @param target: Specifies the symbolic name of a map. - @type query: Enumerated constant - @param query: Specifies which parameter to return. - @type v: Buffer object. Depends on function prototype. - @param v: Returns the requested data. - """ - -def glGetMaterial (face, pname, params): - """ - B{glGetMaterialfv, glGetMaterialiv} - - Return material parameters - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getmaterial.html} - - @type face: Enumerated constant - @param face: Specifies which of the two materials is being queried. - representing the front and back materials, respectively. - @type pname: Enumerated constant - @param pname: Specifies the material parameter to return. - @type params: Buffer object. Depends on function prototype. - @param params: Returns the requested data. - """ - -def glGetPixelMap (map, values): - """ - B{glGetPixelMapfv, glGetPixelMapuiv, glGetPixelMapusv} - - Return the specified pixel map - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getpixelmap.html} - - @type map: Enumerated constant - @param map: Specifies the name of the pixel map to return. - @type values: Buffer object. Depends on function prototype. - @param values: Returns the pixel map contents. - """ - -def glGetPolygonStipple(mask): - """ - Return the polygon stipple pattern - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getpolygonstipple.html} - - @type mask: Buffer object I{type GL_BYTE} - @param mask: Returns the stipple pattern. The initial value is all 1's. - """ - -def glGetString(name): - """ - Return a string describing the current GL connection - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getstring.html} - - @type name: Enumerated constant - @param name: Specifies a symbolic constant. - - """ - -def glGetTexEnv (target, pname, params): - """ - B{glGetTexEnvfv, glGetTexEnviv} - - Return texture environment parameters - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gettexenv.html} - - @type target: Enumerated constant - @param target: Specifies a texture environment. Must be GL_TEXTURE_ENV. - @type pname: Enumerated constant - @param pname: Specifies the symbolic name of a texture environment parameter. - @type params: Buffer object. Depends on function prototype. - @param params: Returns the requested data. - """ - -def glGetTexGen (coord, pname, params): - """ - B{glGetTexGendv, glGetTexGenfv, glGetTexGeniv} - - Return texture coordinate generation parameters - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gettexgen.html} - - @type coord: Enumerated constant - @param coord: Specifies a texture coordinate. - @type pname: Enumerated constant - @param pname: Specifies the symbolic name of the value(s) to be returned. - @type params: Buffer object. Depends on function prototype. - @param params: Returns the requested data. - """ - -def glGetTexImage(target, level, format, type, pixels): - """ - Return a texture image - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getteximage.html} - - @type target: Enumerated constant - @param target: Specifies which texture is to be obtained. - @type level: int - @param level: Specifies the level-of-detail number of the desired image. - Level 0 is the base image level. Level n is the nth mipmap reduction image. - @type format: Enumerated constant - @param format: Specifies a pixel format for the returned data. - @type type: Enumerated constant - @param type: Specifies a pixel type for the returned data. - @type pixels: Buffer object. - @param pixels: Returns the texture image. Should be a pointer to an array of the - type specified by type - """ - -def glGetTexLevelParameter (target, level, pname, params): - """ - B{glGetTexLevelParameterfv, glGetTexLevelParameteriv} - - return texture parameter values for a specific level of detail - @see: U{opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/gettexlevelparameter.html} - - @type target: Enumerated constant - @param target: Specifies the symbolic name of the target texture. - @type level: int - @param level: Specifies the level-of-detail number of the desired image. - Level 0 is the base image level. Level n is the nth mipmap reduction image. - @type pname: Enumerated constant - @param pname: Specifies the symbolic name of a texture parameter. - @type params: Buffer object. Depends on function prototype. - @param params: Returns the requested data. - """ - -def glGetTexParameter (target, pname, params): - """ - B{glGetTexParameterfv, glGetTexParameteriv} - - Return texture parameter values - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gettexparameter.html} - - @type target: Enumerated constant - @param target: Specifies the symbolic name of the target texture. - @type pname: Enumerated constant - @param pname: Specifies the symbolic name the target texture. - @type params: Buffer object. Depends on function prototype. - @param params: Returns the texture parameters. - """ - -def glHint(target, mode): - """ - Specify implementation-specific hints - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/hint.html} - - @type target: Enumerated constant - @param target: Specifies a symbolic constant indicating the behavior to be - controlled. - @type mode: Enumerated constant - @param mode: Specifies a symbolic constant indicating the desired behavior. - """ - -def glIndex (c): - """ - B{glIndexd, glIndexf, glIndexi, glIndexs, glIndexdv, glIndexfv, glIndexiv, glIndexsv} - - Set the current color index - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/index_.html} - - @type c: Buffer object. Depends on function prototype. - @param c: Specifies a pointer to a one element array that contains the new value for - the current color index. - """ - -def glInitNames(): - """ - Initialize the name stack - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/initnames.html} - """ - -def glIsEnabled(cap): - """ - Test whether a capability is enabled - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/isenabled.html} - - @type cap: Enumerated constant - @param cap: Specifies a constant representing a GL capability. - """ - -def glIsList(list): - """ - Determine if a name corresponds to a display-list - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/islist.html} - - @type list: unsigned int - @param list: Specifies a potential display-list name. - """ - -def glIsTexture(texture): - """ - Determine if a name corresponds to a texture - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/istexture.html} - - @type texture: unsigned int - @param texture: Specifies a value that may be the name of a texture. - """ - -def glLight (light, pname, param): - """ - B{glLightf,glLighti, glLightfv, glLightiv} - - Set the light source parameters - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/light.html} - - @type light: Enumerated constant - @param light: Specifies a light. The number of lights depends on the implementation, - but at least eight lights are supported. They are identified by symbolic names of the - form GL_LIGHTi where 0 < i < GL_MAX_LIGHTS. - @type pname: Enumerated constant - @param pname: Specifies a single-valued light source parameter for light. - @type param: Depends on function prototype. - @param param: Specifies the value that parameter pname of light source light will be set to. - If function prototype ends in 'v' specifies a pointer to the value or values that - parameter pname of light source light will be set to. - """ - -def glLightModel (pname, param): - """ - B{glLightModelf, glLightModeli, glLightModelfv, glLightModeliv} - - Set the lighting model parameters - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/lightmodel.html} - - @type pname: Enumerated constant - @param pname: Specifies a single-value light model parameter. - @type param: Depends on function prototype. - @param param: Specifies the value that param will be set to. If function prototype ends in 'v' - specifies a pointer to the value or values that param will be set to. - """ - -def glLineStipple(factor, pattern): - """ - Specify the line stipple pattern - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/linestipple.html} - - @type factor: int - @param factor: Specifies a multiplier for each bit in the line stipple pattern. - If factor is 3, for example, each bit in the pattern is used three times before - the next bit in the pattern is used. factor is clamped to the range [1, 256] and - defaults to 1. - @type pattern: unsigned short int - @param pattern: Specifies a 16-bit integer whose bit pattern determines which fragments - of a line will be drawn when the line is rasterized. Bit zero is used first; the default - pattern is all 1's. - """ - -def glLineWidth(width): - """ - Specify the width of rasterized lines. - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/linewidth.html} - - @type width: float - @param width: Specifies the width of rasterized lines. The initial value is 1. - """ - -def glListBase(base): - """ - Set the display-list base for glCallLists - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/listbase.html} - - @type base: unsigned int - @param base: Specifies an integer offset that will be added to glCallLists - offsets to generate display-list names. The initial value is 0. - """ - -def glLoadIdentity(): - """ - Replace the current matrix with the identity matrix - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/loadidentity.html} - """ - -def glLoadMatrix (m): - """ - B{glLoadMatrixd, glLoadMatixf} - - Replace the current matrix with the specified matrix - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/loadmatrix.html} - - @type m: Buffer object. Depends on function prototype. - @param m: Specifies a pointer to 16 consecutive values, which are used as the elements - of a 4x4 column-major matrix. - """ - -def glLoadName(name): - """ - Load a name onto the name stack. - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/loadname.html} - - @type name: unsigned int - @param name: Specifies a name that will replace the top value on the name stack. - """ - -def glLogicOp(opcode): - """ - Specify a logical pixel operation for color index rendering - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/logicop.html} - - @type opcode: Enumerated constant - @param opcode: Specifies a symbolic constant that selects a logical operation. - """ - -def glMap1 (target, u1, u2, stride, order, points): - """ - B{glMap1d, glMap1f} - - Define a one-dimensional evaluator - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/map1.html} - - @type target: Enumerated constant - @param target: Specifies the kind of values that are generated by the evaluator. - @type u1, u2: Depends on function prototype. - @param u1,u2: Specify a linear mapping of u, as presented to glEvalCoord1, to ^, t - he variable that is evaluated by the equations specified by this command. - @type stride: int - @param stride: Specifies the number of floats or float (double)s between the beginning - of one control point and the beginning of the next one in the data structure - referenced in points. This allows control points to be embedded in arbitrary data - structures. The only constraint is that the values for a particular control point must - occupy contiguous memory locations. - @type order: int - @param order: Specifies the number of control points. Must be positive. - @type points: Buffer object. Depends on function prototype. - @param points: Specifies a pointer to the array of control points. - """ - -def glMap2 (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points): - """ - B{glMap2d, glMap2f} - - Define a two-dimensional evaluator - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/map2.html} - - @type target: Enumerated constant - @param target: Specifies the kind of values that are generated by the evaluator. - @type u1, u2: Depends on function prototype. - @param u1,u2: Specify a linear mapping of u, as presented to glEvalCoord2, to ^, t - he variable that is evaluated by the equations specified by this command. Initially - u1 is 0 and u2 is 1. - @type ustride: int - @param ustride: Specifies the number of floats or float (double)s between the beginning - of control point R and the beginning of control point R ij, where i and j are the u - and v control point indices, respectively. This allows control points to be embedded - in arbitrary data structures. The only constraint is that the values for a particular - control point must occupy contiguous memory locations. The initial value of ustride is 0. - @type uorder: int - @param uorder: Specifies the dimension of the control point array in the u axis. - Must be positive. The initial value is 1. - @type v1, v2: Depends on function prototype. - @param v1, v2: Specify a linear mapping of v, as presented to glEvalCoord2, to ^, - one of the two variables that are evaluated by the equations specified by this command. - Initially, v1 is 0 and v2 is 1. - @type vstride: int - @param vstride: Specifies the number of floats or float (double)s between the beginning of control - point R and the beginning of control point R ij, where i and j are the u and v control - point(indices, respectively. This allows control points to be embedded in arbitrary data - structures. The only constraint is that the values for a particular control point must - occupy contiguous memory locations. The initial value of vstride is 0. - @type vorder: int - @param vorder: Specifies the dimension of the control point array in the v axis. - Must be positive. The initial value is 1. - @type points: Buffer object. Depends on function prototype. - @param points: Specifies a pointer to the array of control points. - """ - -def glMapGrid (un, u1,u2 ,vn, v1, v2): - """ - B{glMapGrid1d, glMapGrid1f, glMapGrid2d, glMapGrid2f} - - Define a one- or two-dimensional mesh - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/mapgrid.html} - - @type un: int - @param un: Specifies the number of partitions in the grid range interval - [u1, u2]. Must be positive. - @type u1, u2: Depends on function prototype. - @param u1, u2: Specify the mappings for integer grid domain values i=0 and i=un. - @type vn: int - @param vn: Specifies the number of partitions in the grid range interval [v1, v2] - (glMapGrid2 only). - @type v1, v2: Depends on function prototype. - @param v1, v2: Specify the mappings for integer grid domain values j=0 and j=vn - (glMapGrid2 only). - """ - -def glMaterial (face, pname, params): - """ - Specify material parameters for the lighting model. - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/material.html} - - @type face: Enumerated constant - @param face: Specifies which face or faces are being updated. Must be one of: - @type pname: Enumerated constant - @param pname: Specifies the single-valued material parameter of the face - or faces that is being updated. Must be GL_SHININESS. - @type params: int - @param params: Specifies the value that parameter GL_SHININESS will be set to. - If function prototype ends in 'v' specifies a pointer to the value or values that - pname will be set to. - """ - -def glMatrixMode(mode): - """ - Specify which matrix is the current matrix. - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/matrixmode.html} - - @type mode: Enumerated constant - @param mode: Specifies which matrix stack is the target for subsequent matrix operations. - """ - -def glMultMatrix (m): - """ - B{glMultMatrixd, glMultMatrixf} - - Multiply the current matrix with the specified matrix - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/multmatrix.html} - - @type m: Buffer object. Depends on function prototype. - @param m: Points to 16 consecutive values that are used as the elements of a 4x4 column - major matrix. - """ - -def glNewList(list, mode): - """ - Create or replace a display list - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/newlist.html} - - @type list: unsigned int - @param list: Specifies the display list name - @type mode: Enumerated constant - @param mode: Specifies the compilation mode. - """ - -def glNormal3 (nx, ny, nz, v): - """ - B{Normal3b, Normal3bv, Normal3d, Normal3dv, Normal3f, Normal3fv, Normal3i, Normal3iv, - Normal3s, Normal3sv} - - Set the current normal vector - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/normal.html} - - @type nx, ny, nz: Depends on function prototype. (non - 'v' prototypes only) - @param nx, ny, nz: Specify the x, y, and z coordinates of the new current normal. - The initial value of the current normal is the unit vector, (0, 0, 1). - @type v: Buffer object. Depends on function prototype. ('v' prototypes) - @param v: Specifies a pointer to an array of three elements: the x, y, and z coordinates - of the new current normal. - """ - -def glOrtho(left, right, bottom, top, zNear, zFar): - """ - Multiply the current matrix with an orthographic matrix - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/ortho.html} - - @type left, right: double (float) - @param left, right: Specify the coordinates for the left and - right vertical clipping planes. - @type bottom, top: double (float) - @param bottom, top: Specify the coordinates for the bottom and top - horizontal clipping planes. - @type zNear, zFar: double (float) - @param zNear, zFar: Specify the distances to the nearer and farther - depth clipping planes. These values are negative if the plane is to be behind the viewer. - """ - -def glPassThrough(token): - """ - Place a marker in the feedback buffer - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/passthrough.html} - - @type token: float - @param token: Specifies a marker value to be placed in the feedback - buffer following a GL_PASS_THROUGH_TOKEN. - """ - -def glPixelMap (map, mapsize, values): - """ - B{glPixelMapfv, glPixelMapuiv, glPixelMapusv} - - Set up pixel transfer maps - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixelmap.html} - - @type map: Enumerated constant - @param map: Specifies a symbolic map name. - @type mapsize: int - @param mapsize: Specifies the size of the map being defined. - @type values: Buffer object. Depends on function prototype. - @param values: Specifies an array of mapsize values. - """ - -def glPixelStore (pname, param): - """ - B{glPixelStoref, glPixelStorei} - - Set pixel storage modes - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixelstore.html} - - @type pname: Enumerated constant - @param pname: Specifies the symbolic name of the parameter to be set. - Six values affect the packing of pixel data into memory. - Six more affect the unpacking of pixel data from memory. - @type param: Depends on function prototype. - @param param: Specifies the value that pname is set to. - """ - -def glPixelTransfer (pname, param): - """ - B{glPixelTransferf, glPixelTransferi} - - Set pixel transfer modes - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixeltransfer.html} - - @type pname: Enumerated constant - @param pname: Specifies the symbolic name of the pixel transfer parameter to be set. - @type param: Depends on function prototype. - @param param: Specifies the value that pname is set to. - """ - -def glPixelZoom(xfactor, yfactor): - """ - Specify the pixel zoom factors - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixelzoom.html} - - @type xfactor, yfactor: float - @param xfactor, yfactor: Specify the x and y zoom factors for pixel write operations. - """ - -def glPointSize(size): - """ - Specify the diameter of rasterized points - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pointsize.html} - - @type size: float - @param size: Specifies the diameter of rasterized points. The initial value is 1. - """ - -def glPolygonMode(face, mode): - """ - Select a polygon rasterization mode - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/polygonmode.html} - - @type face: Enumerated constant - @param face: Specifies the polygons that mode applies to. - Must be GL_FRONT for front-facing polygons, GL_BACK for back- facing polygons, - or GL_FRONT_AND_BACK for front- and back-facing polygons. - @type mode: Enumerated constant - @param mode: Specifies how polygons will be rasterized. - The initial value is GL_FILL for both front- and back- facing polygons. - """ - -def glPolygonOffset(factor, units): - """ - Set the scale and units used to calculate depth values - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/polygonoffset.html} - - @type factor: float - @param factor: Specifies a scale factor that is used to create a variable depth - offset for each polygon. The initial value is 0. - @type units: float - @param units: Is multiplied by an implementation-specific value to create a constant - depth offset. The initial value is 0. - """ - -def glPolygonStipple(mask): - """ - Set the polygon stippling pattern - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/polygonstipple.html} - - @type mask: Buffer object I{type GL_BYTE} - @param mask: Specifies a pointer to a 32x32 stipple pattern that will be unpacked - from memory in the same way that glDrawPixels unpacks pixels. - """ - -def glPopAttrib(): - """ - Pop the server attribute stack - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushattrib.html} - """ - -def glPopClientAttrib(): - """ - Pop the client attribute stack - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushclientattrib.html} - """ - -def glPopMatrix(): - """ - Pop the current matrix stack - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushmatrix.html} - """ - -def glPopName(): - """ - Pop the name stack - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushname.html} - """ - -def glPrioritizeTextures(n, textures, priorities): - """ - Set texture residence priority - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/prioritizetextures.html} - - @type n: int - @param n:Specifies the number of textures to be prioritized. - @type textures: Buffer I{type GL_INT} - @param textures: Specifies an array containing the names of the textures to be prioritized. - @type priorities: Buffer I{type GL_FLOAT} - @param priorities: Specifies an array containing the texture priorities. A priority given - in an element of priorities applies to the texture named by the corresponding element of textures. - """ - -def glPushAttrib(mask): - """ - Push the server attribute stack - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushattrib.html} - - @type mask: Enumerated constant(s) - @param mask: Specifies a mask that indicates which attributes to save. - """ - -def glPushClientAttrib(mask): - """ - Push the client attribute stack - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushclientattrib.html} - - @type mask: Enumerated constant(s) - @param mask: Specifies a mask that indicates which attributes to save. - """ - -def glPushMatrix(): - """ - Push the current matrix stack - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushmatrix.html} - """ - -def glPushName(name): - """ - Push the name stack - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushname.html} - - @type name: unsigned int - @param name: Specifies a name that will be pushed onto the name stack. - """ - -def glRasterPos (x,y,z,w): - """ - B{glRasterPos2d, glRasterPos2f, glRasterPos2i, glRasterPos2s, glRasterPos3d, - glRasterPos3f, glRasterPos3i, glRasterPos3s, glRasterPos4d, glRasterPos4f, - glRasterPos4i, glRasterPos4s, glRasterPos2dv, glRasterPos2fv, glRasterPos2iv, - glRasterPos2sv, glRasterPos3dv, glRasterPos3fv, glRasterPos3iv, glRasterPos3sv, - glRasterPos4dv, glRasterPos4fv, glRasterPos4iv, glRasterPos4sv} - - Specify the raster position for pixel operations - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rasterpos.html} - - @type x, y, z, w: Depends on function prototype. (z and w for '3' and '4' prototypes only) - @param x, y, z, w: Specify the x,y,z, and w object coordinates (if present) for the - raster position. If function prototype ends in 'v' specifies a pointer to an array of two, - three, or four elements, specifying x, y, z, and w coordinates, respectively. - @note: - If you are drawing to the 3d view with a Scriptlink of a space handler - the zoom level of the panels will scale the glRasterPos by the view matrix. - so a X of 10 will not always offset 10 pixels as you would expect. - - To work around this get the scale value of the view matrix and use it to scale your pixel values. - - Workaround:: - - import Blender - from Blender.BGL import * - xval, yval= 100, 40 - # Get the scale of the view matrix - viewMatrix = Buffer(GL_FLOAT, 16) - glGetFloatv(GL_MODELVIEW_MATRIX, viewMatrix) - f = 1/viewMatrix[0] - glRasterPos2f(xval*f, yval*f) # Instead of the usual glRasterPos2i(xval, yval) - """ - -def glReadBuffer(mode): - """ - Select a color buffer source for pixels. - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/readbuffer.html} - - @type mode: Enumerated constant - @param mode: Specifies a color buffer. - """ - -def glReadPixels(x, y, width, height, format, type, pixels): - """ - Read a block of pixels from the frame buffer - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/readpixels.html} - - @type x, y: int - @param x, y:Specify the window coordinates of the first pixel that is read - from the frame buffer. This location is the lower left corner of a rectangular - block of pixels. - @type width, height: int - @param width, height: Specify the dimensions of the pixel rectangle. width and - height of one correspond to a single pixel. - @type format: Enumerated constant - @param format: Specifies the format of the pixel data. - @type type: Enumerated constant - @param type: Specifies the data type of the pixel data. - @type pixels: Buffer object - @param pixels: Returns the pixel data. - """ - -def glRect (x1,y1,x2,y2,v1,v2): - """ - B{glRectd, glRectf, glRecti, glRects, glRectdv, glRectfv, glRectiv, glRectsv} - - Draw a rectangle - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rect.html} - - @type x1, y1: Depends on function prototype. (for non 'v' prototypes only) - @param x1, y1: Specify one vertex of a rectangle - @type x2, y2: Depends on function prototype. (for non 'v' prototypes only) - @param x2, y2: Specify the opposite vertex of the rectangle - @type v1, v2: Depends on function prototype. (for 'v' prototypes only) - @param v1, v2: Specifies a pointer to one vertex of a rectangle and the pointer - to the opposite vertex of the rectangle - """ - -def glRenderMode(mode): - """ - Set rasterization mode - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rendermode.html} - - @type mode: Enumerated constant - @param mode: Specifies the rasterization mode. - """ - -def glRotate (angle, x, y, z): - """ - B{glRotated, glRotatef} - - Multiply the current matrix by a rotation matrix - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rotate.html} - - @type angle: Depends on function prototype. - @param angle: Specifies the angle of rotation in degrees. - @type x, y, z: Depends on function prototype. - @param x, y, z: Specify the x, y, and z coordinates of a vector respectively. - """ - -def glScale (x,y,z): - """ - B{glScaled, glScalef} - - Multiply the current matrix by a general scaling matrix - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/scale.html} - - @type x, y, z: Depends on function prototype. - @param x, y, z: Specify scale factors along the x, y, and z axes, respectively. - """ - -def glScissor(x,y,width,height): - """ - Define the scissor box - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/scissor.html} - - @type x, y: int - @param x, y: Specify the lower left corner of the scissor box. Initially (0, 0). - @type width, height: int - @param width height: Specify the width and height of the scissor box. When a - GL context is first attached to a window, width and height are set to the - dimensions of that window. - """ - -def glSelectBuffer(size, buffer): - """ - Establish a buffer for selection mode values - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/selectbuffer.html} - - @type size: int - @param size: Specifies the size of buffer - @type buffer: Buffer I{type GL_INT} - @param buffer: Returns the selection data - """ - -def glShadeModel(mode): - """ - Select flat or smooth shading - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/shademodel.html} - - @type mode: Enumerated constant - @param mode: Specifies a symbolic value representing a shading technique. - """ - -def glStencilFuc(func, ref, mask): - """ - Set function and reference value for stencil testing - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/stencilfunc.html} - - @type func: Enumerated constant - @param func:Specifies the test function. - @type ref: int - @param ref:Specifies the reference value for the stencil test. ref is clamped to - the range [0,2n-1], where n is the number of bitplanes in the stencil buffer. - The initial value is 0. - @type mask: unsigned int - @param mask:Specifies a mask that is ANDed with both the reference value and - the stored stencil value when the test is done. The initial value is all 1's. - """ - -def glStencilMask(mask): - """ - Control the writing of individual bits in the stencil planes - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/stencilmask.html} - - @type mask: unsigned int - @param mask: Specifies a bit mask to enable and disable writing of individual bits - in the stencil planes. Initially, the mask is all 1's. - """ - -def glStencilOp(fail, zfail, zpass): - """ - Set stencil test actions - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/stencilop.html} - - @type fail: Enumerated constant - @param fail: Specifies the action to take when the stencil test fails. - The initial value is GL_KEEP. - @type zfail: Enumerated constant - @param zfail: Specifies the stencil action when the stencil test passes, but the - depth test fails. zfail accepts the same symbolic constants as fail. - The initial value is GL_KEEP. - @type zpass: Enumerated constant - @param zpass: Specifies the stencil action when both the stencil test and the - depth test pass, or when the stencil test passes and either there is no depth - buffer or depth testing is not enabled. zpass accepts the same symbolic constants - as fail. The initial value is GL_KEEP. - """ - -def glTexCoord (s,t,r,q,v): - """ - B{glTexCoord1d, glTexCoord1f, glTexCoord1i, glTexCoord1s, glTexCoord2d, glTexCoord2f, - glTexCoord2i, glTexCoord2s, glTexCoord3d, glTexCoord3f, glTexCoord3i, glTexCoord3s, - glTexCoord4d, glTexCoord4f, glTexCoord4i, glTexCoord4s, glTexCoord1dv, glTexCoord1fv, - glTexCoord1iv, glTexCoord1sv, glTexCoord2dv, glTexCoord2fv, glTexCoord2iv, - glTexCoord2sv, glTexCoord3dv, glTexCoord3fv, glTexCoord3iv, glTexCoord3sv, - glTexCoord4dv, glTexCoord4fv, glTexCoord4iv, glTexCoord4sv} - - Set the current texture coordinates - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texcoord.html} - - @type s, t, r, q: Depends on function prototype. (r and q for '3' and '4' prototypes only) - @param s, t, r, q: Specify s, t, r, and q texture coordinates. Not all parameters are - present in all forms of the command. - @type v: Buffer object. Depends on function prototype. (for 'v' prototypes only) - @param v: Specifies a pointer to an array of one, two, three, or four elements, - which in turn specify the s, t, r, and q texture coordinates. - """ - -def glTexEnv (target, pname, param): - """ - B{glTextEnvf, glTextEnvi, glTextEnvfv, glTextEnviv} - - Set texture environment parameters - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texenv.html} - - @type target: Enumerated constant - @param target: Specifies a texture environment. Must be GL_TEXTURE_ENV. - @type pname: Enumerated constant - @param pname: Specifies the symbolic name of a single-valued texture environment - parameter. Must be GL_TEXTURE_ENV_MODE. - @type param: Depends on function prototype. - @param param: Specifies a single symbolic constant. If function prototype ends in 'v' - specifies a pointer to a parameter array that contains either a single symbolic - constant or an RGBA color - """ - -def glTexGen (coord, pname, param): - """ - B{glTexGend, glTexGenf, glTexGeni, glTexGendv, glTexGenfv, glTexGeniv} - - Control the generation of texture coordinates - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texgen.html} - - @type coord: Enumerated constant - @param coord: Specifies a texture coordinate. - @type pname: Enumerated constant - @param pname: Specifies the symbolic name of the texture- coordinate generation function. - @type param: Depends on function prototype. - @param param: Specifies a single-valued texture generation parameter. - If function prototype ends in 'v' specifies a pointer to an array of texture - generation parameters. If pname is GL_TEXTURE_GEN_MODE, then the array must - contain a single symbolic constant. Otherwise, params holds the coefficients - for the texture-coordinate generation function specified by pname. - """ - -def glTexImage1D(target, level, internalformat, width, border, format, type, pixels): - """ - Specify a one-dimensional texture image - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/teximage1d.html} - - @type target: Enumerated constant - @param target: Specifies the target texture. - @type level: int - @param level: Specifies the level-of-detail number. Level 0 is the base image level. - Level n is the nth mipmap reduction image. - @type internalformat: int - @param internalformat: Specifies the number of color components in the texture. - @type width: int - @param width: Specifies the width of the texture image. Must be 2n+2(border) for - some integer n. All implementations support texture images that are at least 64 - texels wide. The height of the 1D texture image is 1. - @type border: int - @param border: Specifies the width of the border. Must be either 0 or 1. - @type format: Enumerated constant - @param format: Specifies the format of the pixel data. - @type type: Enumerated constant - @param type: Specifies the data type of the pixel data. - @type pixels: Buffer object. - @param pixels: Specifies a pointer to the image data in memory. - """ - -def glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels): - """ - Specify a two-dimensional texture image - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/teximage2d.html} - - @type target: Enumerated constant - @param target: Specifies the target texture. - @type level: int - @param level: Specifies the level-of-detail number. Level 0 is the base image level. - Level n is the nth mipmap reduction image. - @type internalformat: int - @param internalformat: Specifies the number of color components in the texture. - @type width: int - @param width: Specifies the width of the texture image. Must be 2n+2(border) for - some integer n. All implementations support texture images that are at least 64 - texels wide. - @type height: int - @param height: Specifies the height of the texture image. Must be 2m+2(border) for - some integer m. All implementations support texture images that are at least 64 - texels high. - @type border: int - @param border: Specifies the width of the border. Must be either 0 or 1. - @type format: Enumerated constant - @param format: Specifies the format of the pixel data. - @type type: Enumerated constant - @param type: Specifies the data type of the pixel data. - @type pixels: Buffer object. - @param pixels: Specifies a pointer to the image data in memory. - """ - -def glTexParameter (target, pname, param): - """ - B{glTexParameterf, glTexParameteri, glTexParameterfv, glTexParameteriv} - - Set texture parameters - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texparameter.html} - - @type target: Enumerated constant - @param target: Specifies the target texture. - @type pname: Enumerated constant - @param pname: Specifies the symbolic name of a single-valued texture parameter. - @type param: Depends on function prototype. - @param param: Specifies the value of pname. If function prototype ends in 'v' specifies - a pointer to an array where the value or values of pname are stored. - """ - -def glTranslate (x, y, z): - """ - B{glTranslatef, glTranslated} - - Multiply the current matrix by a translation matrix - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/translate.html} - - @type x, y, z: Depends on function prototype. - @param x, y, z: Specify the x, y, and z coordinates of a translation vector. - """ - -def glVertex (x,y,z,w,v): - """ - B{glVertex2d, glVertex2f, glVertex2i, glVertex2s, glVertex3d, glVertex3f, glVertex3i, - glVertex3s, glVertex4d, glVertex4f, glVertex4i, glVertex4s, glVertex2dv, glVertex2fv, - glVertex2iv, glVertex2sv, glVertex3dv, glVertex3fv, glVertex3iv, glVertex3sv, glVertex4dv, - glVertex4fv, glVertex4iv, glVertex4sv} - - Specify a vertex - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/vertex.html} - - @type x, y, z, w: Depends on function prototype (z and w for '3' and '4' prototypes only) - @param x, y, z, w: Specify x, y, z, and w coordinates of a vertex. Not all parameters - are present in all forms of the command. - @type v: Buffer object. Depends of function prototype (for 'v' prototypes only) - @param v: Specifies a pointer to an array of two, three, or four elements. The - elements of a two-element array are x and y; of a three-element array, x, y, and z; - and of a four-element array, x, y, z, and w. - """ - -def glViewport(x,y,width,height): - """ - Set the viewport - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/viewport.html} - - @type x, y: int - @param x, y: Specify the lower left corner of the viewport rectangle, - in pixels. The initial value is (0,0). - @type width, height: int - @param width, height: Specify the width and height of the viewport. When a GL context - is first attached to a window, width and height are set to the dimensions of that window. - """ - -def gluPerspective(fovY, aspect, zNear, zFar): - """ - Set up a perspective projection matrix. - @see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5577288} - - @type fovY: double - @param fovY: Specifies the field of view angle, in degrees, in the y direction. - @type aspect: double - @param aspect: Specifies the aspect ratio that determines the field of view in the x direction. - The aspect ratio is the ratio of x (width) to y (height). - @type zNear: double - @param zNear: Specifies the distance from the viewer to the near clipping plane (always positive). - @type zFar: double - @param zFar: Specifies the distance from the viewer to the far clipping plane (always positive). - """ - -def gluLookAt(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz): - """ - Define a viewing transformation - @see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5573042} - - @type eyex, eyey, eyez: double - @param eyex, eyey, eyez: Specifies the position of the eye point. - @type centerx, centery, centerz: double - @param centerx, centery, centerz: Specifies the position of the reference point. - @type upx, upy, upz: double - @param upx, upy, upz: Specifies the direction of the up vector. - """ - -def gluOrtho2D(left, right, bottom, top): - """ - Define a 2-D orthographic projection matrix - @see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5578074} - - @type left, right: double - @param left, right: Specify the coordinates for the left and right vertical clipping planes. - @type bottom, top: double - @param bottom, top: Specify the coordinates for the bottom and top horizontal clipping planes. - """ - -def gluPickMatrix(x, y, width, height, viewport): - """ - Define a picking region - @see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5578074} - - @type x, y: double - @param x, y: Specify the center of a picking region in window coordinates. - @type width, height: double - @param width, height: Specify the width and height, respectively, of the picking region in window coordinates. - @type viewport: Buffer object. [int] - @param viewport: Specifies the current viewport. - """ - -def gluProject(objx, objy, objz, modelMatrix, projMatrix, viewport, winx, winy, winz): - """ - Map object coordinates to window coordinates. - @see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5578074} - - @type objx, objy, objz: double - @param objx, objy, objz: Specify the object coordinates. - @type modelMatrix: Buffer object. [double] - @param modelMatrix: Specifies the current modelview matrix (as from a glGetDoublev call). - @type projMatrix: Buffer object. [double] - @param projMatrix: Specifies the current projection matrix (as from a glGetDoublev call). - @type viewport: Buffer object. [int] - @param viewport: Specifies the current viewport (as from a glGetIntegerv call). - @type winx, winy, winz: Buffer object. [double] - @param winx, winy, winz: Return the computed window coordinates. - """ - -def gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, objx, objy, objz): - """ - Map object coordinates to window - coordinates. - @see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5582204} - - @type winx, winy, winz: double - @param winx, winy, winz: Specify the window coordinates to be mapped. - @type modelMatrix: Buffer object. [double] - @param modelMatrix: Specifies the current modelview matrix (as from a glGetDoublev call). - @type projMatrix: Buffer object. [double] - @param projMatrix: Specifies the current projection matrix (as from a glGetDoublev call). - @type viewport: Buffer object. [int] - @param viewport: Specifies the current viewport (as from a glGetIntegerv call). - @type objx, objy, objz: Buffer object. [double] - @param objx, objy, objz: Return the computed object coordinates. - """ - -class Buffer: - """ - The Buffer object is simply a block of memory that is delineated and initialized by the - user. Many OpenGL functions return data to a C-style pointer, however, because this - is not possible in python the Buffer object can be used to this end. Wherever pointer - notation is used in the OpenGL functions the Buffer object can be used in it's BGL - wrapper. In some instances the Buffer object will need to be initialized with the template - parameter, while in other instances the user will want to create just a blank buffer - which will be zeroed by default. - - Example with Buffer:: - import Blender - from Blender import BGL - myByteBuffer = BGL.Buffer(BGL.GL_BYTE, [32,32]) - BGL.glGetPolygonStipple(myByteBuffer) - print myByteBuffer.dimensions - print myByteBuffer.list - sliceBuffer = myByteBuffer[0:16] - print sliceBuffer - - @ivar list: The contents of the Buffer. - @ivar dimensions: The size of the Buffer. - """ - - def __init__(type, dimensions, template = None): - """ - This will create a new Buffer object for use with other BGL OpenGL commands. - Only the type of argument to store in the buffer and the dimensions of the buffer - are necessary. Buffers are zeroed by default unless a template is supplied, in - which case the buffer is initialized to the template. - - @type type: int - @param type: The format to store data in. The type should be one of - GL_BYTE, GL_SHORT, GL_INT, or GL_FLOAT. - @type dimensions: An int or sequence object specifying the dimensions of the buffer. - @param dimensions: If the dimensions are specified as an int a linear array will - be created for the buffer. If a sequence is passed for the dimensions, the buffer - becomes n-Dimensional, where n is equal to the number of parameters passed in the - sequence. Example: [256,2] is a two- dimensional buffer while [256,256,4] creates - a three- dimensional buffer. You can think of each additional dimension as a sub-item - of the dimension to the left. i.e. [10,2] is a 10 element array each with 2 sub-items. - [(0,0), (0,1), (1,0), (1,1), (2,0), ...] etc. - @type template: A python sequence object (optional) - @param template: A sequence of matching dimensions which will be used to initialize - the Buffer. If a template is not passed in all fields will be initialized to 0. - @rtype: Buffer object - @return: The newly created buffer as a PyObject. - """ diff --git a/doc/python_api/rst/bgl.rst b/doc/python_api/rst/bgl.rst new file mode 100644 index 00000000000..743f1c33e27 --- /dev/null +++ b/doc/python_api/rst/bgl.rst @@ -0,0 +1,1888 @@ + +bgl module (OpenGL wrapper) +=========================== + +.. module:: bgl + +This module wraps OpenGL constants and functions, making them available from +within Blender Python. + +The complete list can be retrieved from the module itself, by listing its +contents: dir(bgl). A simple search on the net can point to more +than enough material to teach OpenGL programming, from books to many +collections of tutorials. + +The "red book": "I{OpenGL Programming Guide: The Official Guide to Learning +OpenGL}" and the online NeHe tutorials are two of the best resources. + +..note:: + You can use the :class:`Image` type to load and set textures. + See :class:`Image.gl_load` and :class:`Image.gl_load`, + for example. + `OpenGL.org <http://www.opengl.org>`_ + `NeHe GameDev <nehe.gamedev.net>`_ + + +.. function:: glAccum(op, value): + + Operate on the accumulation buffer. + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/accum.html>`_ + + :type op: Enumerated constant + :arg op: The accumulation buffer operation. + :type value: float + :arg value: a value used in the accumulation buffer operation. + + +.. function:: glAlphaFunc(func, ref): + + Specify the alpha test function. + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/alphafunc.html>`_ + + :type func: Enumerated constant + :arg func: Specifies the alpha comparison function. + :type ref: float + :arg ref: The reference value that incoming alpha values are compared to. + Clamped between 0 and 1. + + +.. function:: glAreTexturesResident(n, textures, residences): + + Determine if textures are loaded in texture memory + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/aretexturesresident.html>`_ + + :type n: int + :arg n: Specifies the number of textures to be queried. + :type textures: :class:`Buffer` object I{type GL_INT} + :arg textures: Specifies an array containing the names of the textures to be queried + :type residences: :class:`Buffer` object I{type GL_INT}(boolean) + :arg residences: An array in which the texture residence status in returned. + The residence status of a texture named by an element of textures is + returned in the corresponding element of residences. + + +.. function:: glBegin(mode): + + Delimit the vertices of a primitive or a group of like primatives + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/begin.html>`_ + + :type mode: Enumerated constant + :arg mode: Specifies the primitive that will be create from vertices between glBegin and + glEnd. + + +.. function:: glBindTexture(target, texture): + + Bind a named texture to a texturing target + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/bindtexture.html>`_ + + :type target: Enumerated constant + :arg target: Specifies the target to which the texture is bound. + :type texture: unsigned int + :arg texture: Specifies the name of a texture. + + +.. function:: glBitmap(width, height, xorig, yorig, xmove, ymove, bitmap): + + Draw a bitmap + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/bitmap.html>`_ + + :type width, height: int + :arg width, height: Specify the pixel width and height of the bitmap image. + :type xorig, yorig: float + :arg xorig, yorig: Specify the location of the origin in the bitmap image. The origin is measured + from the lower left corner of the bitmap, with right and up being the positive axes. + :type xmove, ymove: float + :arg xmove, ymove: Specify the x and y offsets to be added to the current raster position after + the bitmap is drawn. + :type bitmap: :class:`Buffer` object I{type GL_BYTE} + :arg bitmap: Specifies the address of the bitmap image. + + +.. function:: glBlendFunc(sfactor, dfactor): + + Specify pixel arithmetic + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/blendfunc.html>`_ + + :type sfactor: Enumerated constant + :arg sfactor: Specifies how the red, green, blue, and alpha source blending factors are + computed. + :type dfactor: Enumerated constant + :arg dfactor: Specifies how the red, green, blue, and alpha destination + blending factors are computed. + + +.. function:: glCallList(list): + + Execute a display list + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/calllist.html>`_ + + :type list: unsigned int + :arg list: Specifies the integer name of the display list to be executed. + + +.. function:: glCallLists(n, type, lists): + + Execute a list of display lists + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/calllists.html>`_ + + :type n: int + :arg n: Specifies the number of display lists to be executed. + :type type: Enumerated constant + :arg type: Specifies the type of values in lists. + :type lists: :class:`Buffer` object + :arg lists: Specifies the address of an array of name offsets in the display list. + The pointer type is void because the offsets can be bytes, shorts, ints, or floats, + depending on the value of type. + + +.. function:: glClear(mask): + + Clear buffers to preset values + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clear.html>`_ + + :type mask: Enumerated constant(s) + :arg mask: Bitwise OR of masks that indicate the buffers to be cleared. + + +.. function:: glClearAccum(red, green, blue, alpha): + + Specify clear values for the accumulation buffer + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearaccum.html>`_ + + :type red, green, blue, alpha: float + :arg red, green, blue, alpha: Specify the red, green, blue, and alpha values used when the + accumulation buffer is cleared. The initial values are all 0. + + +.. function:: glClearColor(red, green, blue, alpha): + + Specify clear values for the color buffers + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearcolor.html>`_ + + :type red, green, blue, alpha: float + :arg red, green, blue, alpha: Specify the red, green, blue, and alpha values used when the + color buffers are cleared. The initial values are all 0. + + +.. function:: glClearDepth(depth): + + Specify the clear value for the depth buffer + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/cleardepth.html>`_ + + :type depth: int + :arg depth: Specifies the depth value used when the depth buffer is cleared. + The initial value is 1. + + +.. function:: glClearIndex(c): + + Specify the clear value for the color index buffers + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearindex.html>`_ + + :type c: float + :arg c: Specifies the index used when the color index buffers are cleared. + The initial value is 0. + + +.. function:: glClearStencil(s): + + Specify the clear value for the stencil buffer + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearstencil.html>`_ + + :type s: int + :arg s: Specifies the index used when the stencil buffer is cleared. The initial value is 0. + + +.. function:: glClipPlane (plane, equation): + + Specify a plane against which all geometry is clipped + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clipplane.html>`_ + + :type plane: Enumerated constant + :arg plane: Specifies which clipping plane is being positioned. + :type equation: :class:`Buffer` object I{type GL_FLOAT}(double) + :arg equation: Specifies the address of an array of four double- precision + floating-point values. These values are interpreted as a plane equation. + + +.. function:: glColor (red, green, blue, alpha): + + B{glColor3b, glColor3d, glColor3f, glColor3i, glColor3s, glColor3ub, glColor3ui, glColor3us, + glColor4b, glColor4d, glColor4f, glColor4i, glColor4s, glColor4ub, glColor4ui, glColor4us, + glColor3bv, glColor3dv, glColor3fv, glColor3iv, glColor3sv, glColor3ubv, glColor3uiv, + glColor3usv, glColor4bv, glColor4dv, glColor4fv, glColor4iv, glColor4sv, glColor4ubv, + glColor4uiv, glColor4usv} + + Set a new color. + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/color.html>`_ + + :type red, green, blue, alpha: Depends on function prototype. + :arg red, green, blue: Specify new red, green, and blue values for the current color. + :arg alpha: Specifies a new alpha value for the current color. Included only in the + four-argument glColor4 commands. (With '4' colors only) + + +.. function:: glColorMask(red, green, blue, alpha): + + Enable and disable writing of frame buffer color components + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/colormask.html>`_ + + :type red, green, blue, alpha: int (boolean) + :arg red, green, blue, alpha: Specify whether red, green, blue, and alpha can or cannot be + written into the frame buffer. The initial values are all GL_TRUE, indicating that the + color components can be written. + + +.. function:: glColorMaterial(face, mode): + + Cause a material color to track the current color + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/colormaterial.html>`_ + + :type face: Enumerated constant + :arg face: Specifies whether front, back, or both front and back material parameters should + track the current color. + :type mode: Enumerated constant + :arg mode: Specifies which of several material parameters track the current color. + + +.. function:: glCopyPixels(x, y, width, height, type): + + Copy pixels in the frame buffer + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/copypixels.html>`_ + + :type x, y: int + :arg x, y: Specify the window coordinates of the lower left corner of the rectangular + region of pixels to be copied. + :type width, height: int + :arg width,height: Specify the dimensions of the rectangular region of pixels to be copied. + Both must be non-negative. + :type type: Enumerated constant + :arg type: Specifies whether color values, depth values, or stencil values are to be copied. + + + def glCopyTexImage2D(target, level, internalformat, x, y, width, height, border): + + Copy pixels into a 2D texture image + + .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glCopyTexImage2D.xml>`_ + + :type target: Enumerated constant + :arg target: Specifies the target texture. + :type level: int + :arg level: Specifies the level-of-detail number. Level 0 is the base image level. + Level n is the nth mipmap reduction image. + :type internalformat: int + :arg internalformat: Specifies the number of color components in the texture. + :type width: int + :type x, y: int + :arg x, y: Specify the window coordinates of the first pixel that is copied + from the frame buffer. This location is the lower left corner of a rectangular + block of pixels. + :arg width: Specifies the width of the texture image. Must be 2n+2(border) for + some integer n. All implementations support texture images that are at least 64 + texels wide. + :type height: int + :arg height: Specifies the height of the texture image. Must be 2m+2(border) for + some integer m. All implementations support texture images that are at least 64 + texels high. + :type border: int + :arg border: Specifies the width of the border. Must be either 0 or 1. + + +.. function:: glCullFace(mode): + + Specify whether front- or back-facing facets can be culled + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/cullface.html>`_ + + :type mode: Enumerated constant + :arg mode: Specifies whether front- or back-facing facets are candidates for culling. + + +.. function:: glDeleteLists(list, range): + + Delete a contiguous group of display lists + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/deletelists.html>`_ + + :type list: unsigned int + :arg list: Specifies the integer name of the first display list to delete + :type range: int + :arg range: Specifies the number of display lists to delete + + +.. function:: glDeleteTextures(n, textures): + + Delete named textures + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/deletetextures.html>`_ + + :type n: int + :arg n: Specifies the number of textures to be deleted + :type textures: :class:`Buffer` I{GL_INT} + :arg textures: Specifies an array of textures to be deleted + + +.. function:: glDepthFunc(func): + + Specify the value used for depth buffer comparisons + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/depthfunc.html>`_ + + :type func: Enumerated constant + :arg func: Specifies the depth comparison function. + + +.. function:: glDepthMask(flag): + + Enable or disable writing into the depth buffer + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/depthmask.html>`_ + + :type flag: int (boolean) + :arg flag: Specifies whether the depth buffer is enabled for writing. If flag is GL_FALSE, + depth buffer writing is disabled. Otherwise, it is enabled. Initially, depth buffer + writing is enabled. + + +.. function:: glDepthRange(zNear, zFar): + + Specify mapping of depth values from normalized device coordinates to window coordinates + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/depthrange.html>`_ + + :type zNear: int + :arg zNear: Specifies the mapping of the near clipping plane to window coordinates. + The initial value is 0. + :type zFar: int + :arg zFar: Specifies the mapping of the far clipping plane to window coordinates. + The initial value is 1. + + +.. function:: glDisable(cap): + + Disable server-side GL capabilities + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/enable.html>`_ + + :type cap: Enumerated constant + :arg cap: Specifies a symbolic constant indicating a GL capability. + + +.. function:: glDrawBuffer(mode): + + Specify which color buffers are to be drawn into + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/drawbuffer.html>`_ + + :type mode: Enumerated constant + :arg mode: Specifies up to four color buffers to be drawn into. + + +.. function:: glDrawPixels(width, height, format, type, pixels): + + Write a block of pixels to the frame buffer + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/drawpixels.html>`_ + + :type width, height: int + :arg width, height: Specify the dimensions of the pixel rectangle to be + written into the frame buffer. + :type format: Enumerated constant + :arg format: Specifies the format of the pixel data. + :type type: Enumerated constant + :arg type: Specifies the data type for pixels. + :type pixels: :class:`Buffer` object + :arg pixels: Specifies a pointer to the pixel data. + + +.. function:: glEdgeFlag (flag): + + B{glEdgeFlag, glEdgeFlagv} + + Flag edges as either boundary or non-boundary + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/edgeflag.html>`_ + + :type flag: Depends of function prototype + :arg flag: Specifies the current edge flag value.The initial value is GL_TRUE. + + +.. function:: glEnable(cap): + + Enable server-side GL capabilities + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/enable.html>`_ + + :type cap: Enumerated constant + :arg cap: Specifies a symbolic constant indicating a GL capability. + + +.. function:: glEnd(): + + Delimit the vertices of a primitive or group of like primitives + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/begin.html>`_ + + +.. function:: glEndList(): + + Create or replace a display list + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/newlist.html>`_ + + +.. function:: glEvalCoord (u,v): + + B{glEvalCoord1d, glEvalCoord1f, glEvalCoord2d, glEvalCoord2f, glEvalCoord1dv, glEvalCoord1fv, + glEvalCoord2dv, glEvalCoord2fv} + + Evaluate enabled one- and two-dimensional maps + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/evalcoord.html>`_ + + :type u: Depends on function prototype. + :arg u: Specifies a value that is the domain coordinate u to the basis function defined + in a previous glMap1 or glMap2 command. If the function prototype ends in 'v' then + u specifies a pointer to an array containing either one or two domain coordinates. The first + coordinate is u. The second coordinate is v, which is present only in glEvalCoord2 versions. + :type v: Depends on function prototype. (only with '2' prototypes) + :arg v: Specifies a value that is the domain coordinate v to the basis function defined + in a previous glMap2 command. This argument is not present in a glEvalCoord1 command. + + +.. function:: glEvalMesh (mode, i1, i2): + + B{glEvalMesh1 or glEvalMesh2} + + Compute a one- or two-dimensional grid of points or lines + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/evalmesh.html>`_ + + :type mode: Enumerated constant + :arg mode: In glEvalMesh1, specifies whether to compute a one-dimensional + mesh of points or lines. + :type i1, i2: int + :arg i1, i2: Specify the first and last integer values for the grid domain variable i. + + +.. function:: glEvalPoint (i, j): + + B{glEvalPoint1 and glEvalPoint2} + + Generate and evaluate a single point in a mesh + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/evalpoint.html>`_ + + :type i: int + :arg i: Specifies the integer value for grid domain variable i. + :type j: int (only with '2' prototypes) + :arg j: Specifies the integer value for grid domain variable j (glEvalPoint2 only). + + +.. function:: glFeedbackBuffer (size, type, buffer): + + Controls feedback mode + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/feedbackbuffer.html>`_ + + :type size: int + :arg size: Specifies the maximum number of values that can be written into buffer. + :type type: Enumerated constant + :arg type: Specifies a symbolic constant that describes the information that + will be returned for each vertex. + :type buffer: :class:`Buffer` object I{GL_FLOAT} + :arg buffer: Returns the feedback data. + + +.. function:: glFinish(): + + Block until all GL execution is complete + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/finish.html>`_ + + +.. function:: glFlush(): + + Force Execution of GL commands in finite time + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/flush.html>`_ + + +.. function:: glFog (pname, param): + + B{glFogf, glFogi, glFogfv, glFogiv} + + Specify fog parameters + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/fog.html>`_ + + :type pname: Enumerated constant + :arg pname: Specifies a single-valued fog parameter. If the function prototype + ends in 'v' specifies a fog parameter. + :type param: Depends on function prototype. + :arg param: Specifies the value or values to be assigned to pname. GL_FOG_COLOR + requires an array of four values. All other parameters accept an array containing + only a single value. + + +.. function:: glFrontFace(mode): + + Define front- and back-facing polygons + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/frontface.html>`_ + + :type mode: Enumerated constant + :arg mode: Specifies the orientation of front-facing polygons. + + +.. function:: glFrustum(left, right, bottom, top, zNear, zFar): + + Multiply the current matrix by a perspective matrix + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/frustum.html>`_ + + :type left, right: double (float) + :arg left, right: Specify the coordinates for the left and right vertical + clipping planes. + :type top, bottom: double (float) + :arg top, bottom: Specify the coordinates for the bottom and top horizontal + clipping planes. + :type zNear, zFar: double (float) + :arg zNear, zFar: Specify the distances to the near and far depth clipping planes. + Both distances must be positive. + + +.. function:: glGenLists(range): + + Generate a contiguous set of empty display lists + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/genlists.html>`_ + + :type range: int + :arg range: Specifies the number of contiguous empty display lists to be generated. + + +.. function:: glGenTextures(n, textures): + + Generate texture names + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gentextures.html>`_ + + :type n: int + :arg n: Specifies the number of textures name to be generated. + :type textures: :class:`Buffer` object I{type GL_INT} + :arg textures: Specifies an array in which the generated textures names are stored. + + +.. function:: glGet (pname, param): + + B{glGetBooleanv, glGetfloatv, glGetFloatv, glGetIntegerv} + + Return the value or values of a selected parameter + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/get.html>`_ + + :type pname: Enumerated constant + :arg pname: Specifies the parameter value to be returned. + :type param: Depends on function prototype. + :arg param: Returns the value or values of the specified parameter. + + +.. function:: glGetClipPlane(plane, equation): + + Return the coefficients of the specified clipping plane + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getclipplane.html>`_ + + :type plane: Enumerated constant + :arg plane: Specifies a clipping plane. The number of clipping planes depends on the + implementation, but at least six clipping planes are supported. They are identified by + symbolic names of the form GL_CLIP_PLANEi where 0 < i < GL_MAX_CLIP_PLANES. + :type equation: :class:`Buffer` object I{type GL_FLOAT} + :arg equation: Returns four float (double)-precision values that are the coefficients of the + plane equation of plane in eye coordinates. The initial value is (0, 0, 0, 0). + + +.. function:: glGetError(): + + Return error information + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/geterror.html>`_ + + +.. function:: glGetLight (light, pname, params): + + B{glGetLightfv and glGetLightiv} + + Return light source parameter values + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getlight.html>`_ + + :type light: Enumerated constant + :arg light: Specifies a light source. The number of possible lights depends on the + implementation, but at least eight lights are supported. They are identified by symbolic + names of the form GL_LIGHTi where 0 < i < GL_MAX_LIGHTS. + :type pname: Enumerated constant + :arg pname: Specifies a light source parameter for light. + :type params: :class:`Buffer` object. Depends on function prototype. + :arg params: Returns the requested data. + + +.. function:: glGetMap (target, query, v): + + B{glGetMapdv, glGetMapfv, glGetMapiv} + + Return evaluator parameters + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getmap.html>`_ + + :type target: Enumerated constant + :arg target: Specifies the symbolic name of a map. + :type query: Enumerated constant + :arg query: Specifies which parameter to return. + :type v: :class:`Buffer` object. Depends on function prototype. + :arg v: Returns the requested data. + + +.. function:: glGetMaterial (face, pname, params): + + B{glGetMaterialfv, glGetMaterialiv} + + Return material parameters + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getmaterial.html>`_ + + :type face: Enumerated constant + :arg face: Specifies which of the two materials is being queried. + representing the front and back materials, respectively. + :type pname: Enumerated constant + :arg pname: Specifies the material parameter to return. + :type params: :class:`Buffer` object. Depends on function prototype. + :arg params: Returns the requested data. + + +.. function:: glGetPixelMap (map, values): + + B{glGetPixelMapfv, glGetPixelMapuiv, glGetPixelMapusv} + + Return the specified pixel map + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getpixelmap.html>`_ + + :type map: Enumerated constant + :arg map: Specifies the name of the pixel map to return. + :type values: :class:`Buffer` object. Depends on function prototype. + :arg values: Returns the pixel map contents. + + +.. function:: glGetPolygonStipple(mask): + + Return the polygon stipple pattern + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getpolygonstipple.html>`_ + + :type mask: :class:`Buffer` object I{type GL_BYTE} + :arg mask: Returns the stipple pattern. The initial value is all 1's. + + +.. function:: glGetString(name): + + Return a string describing the current GL connection + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getstring.html>`_ + + :type name: Enumerated constant + :arg name: Specifies a symbolic constant. + + + +.. function:: glGetTexEnv (target, pname, params): + + B{glGetTexEnvfv, glGetTexEnviv} + + Return texture environment parameters + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gettexenv.html>`_ + + :type target: Enumerated constant + :arg target: Specifies a texture environment. Must be GL_TEXTURE_ENV. + :type pname: Enumerated constant + :arg pname: Specifies the symbolic name of a texture environment parameter. + :type params: :class:`Buffer` object. Depends on function prototype. + :arg params: Returns the requested data. + + +.. function:: glGetTexGen (coord, pname, params): + + B{glGetTexGendv, glGetTexGenfv, glGetTexGeniv} + + Return texture coordinate generation parameters + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gettexgen.html>`_ + + :type coord: Enumerated constant + :arg coord: Specifies a texture coordinate. + :type pname: Enumerated constant + :arg pname: Specifies the symbolic name of the value(s) to be returned. + :type params: :class:`Buffer` object. Depends on function prototype. + :arg params: Returns the requested data. + + +.. function:: glGetTexImage(target, level, format, type, pixels): + + Return a texture image + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getteximage.html>`_ + + :type target: Enumerated constant + :arg target: Specifies which texture is to be obtained. + :type level: int + :arg level: Specifies the level-of-detail number of the desired image. + Level 0 is the base image level. Level n is the nth mipmap reduction image. + :type format: Enumerated constant + :arg format: Specifies a pixel format for the returned data. + :type type: Enumerated constant + :arg type: Specifies a pixel type for the returned data. + :type pixels: :class:`Buffer` object. + :arg pixels: Returns the texture image. Should be a pointer to an array of the + type specified by type + + +.. function:: glGetTexLevelParameter (target, level, pname, params): + + B{glGetTexLevelParameterfv, glGetTexLevelParameteriv} + + return texture parameter values for a specific level of detail + + .. seealso:: U{opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/gettexlevelparameter.html>`_ + + :type target: Enumerated constant + :arg target: Specifies the symbolic name of the target texture. + :type level: int + :arg level: Specifies the level-of-detail number of the desired image. + Level 0 is the base image level. Level n is the nth mipmap reduction image. + :type pname: Enumerated constant + :arg pname: Specifies the symbolic name of a texture parameter. + :type params: :class:`Buffer` object. Depends on function prototype. + :arg params: Returns the requested data. + + +.. function:: glGetTexParameter (target, pname, params): + + B{glGetTexParameterfv, glGetTexParameteriv} + + Return texture parameter values + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gettexparameter.html>`_ + + :type target: Enumerated constant + :arg target: Specifies the symbolic name of the target texture. + :type pname: Enumerated constant + :arg pname: Specifies the symbolic name the target texture. + :type params: :class:`Buffer` object. Depends on function prototype. + :arg params: Returns the texture parameters. + + +.. function:: glHint(target, mode): + + Specify implementation-specific hints + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/hint.html>`_ + + :type target: Enumerated constant + :arg target: Specifies a symbolic constant indicating the behavior to be + controlled. + :type mode: Enumerated constant + :arg mode: Specifies a symbolic constant indicating the desired behavior. + + +.. function:: glIndex(c): + + B{glIndexd, glIndexf, glIndexi, glIndexs, glIndexdv, glIndexfv, glIndexiv, glIndexsv} + + Set the current color index + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/index_.html>`_ + + :type c: :class:`Buffer` object. Depends on function prototype. + :arg c: Specifies a pointer to a one element array that contains the new value for + the current color index. + + +.. function:: glInitNames(): + + Initialize the name stack + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/initnames.html>`_ + + +.. function:: glIsEnabled(cap): + + Test whether a capability is enabled + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/isenabled.html>`_ + + :type cap: Enumerated constant + :arg cap: Specifies a constant representing a GL capability. + + +.. function:: glIsList(list): + + Determine if a name corresponds to a display-list + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/islist.html>`_ + + :type list: unsigned int + :arg list: Specifies a potential display-list name. + + +.. function:: glIsTexture(texture): + + Determine if a name corresponds to a texture + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/istexture.html>`_ + + :type texture: unsigned int + :arg texture: Specifies a value that may be the name of a texture. + + +.. function:: glLight (light, pname, param): + + B{glLightf,glLighti, glLightfv, glLightiv} + + Set the light source parameters + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/light.html>`_ + + :type light: Enumerated constant + :arg light: Specifies a light. The number of lights depends on the implementation, + but at least eight lights are supported. They are identified by symbolic names of the + form GL_LIGHTi where 0 < i < GL_MAX_LIGHTS. + :type pname: Enumerated constant + :arg pname: Specifies a single-valued light source parameter for light. + :type param: Depends on function prototype. + :arg param: Specifies the value that parameter pname of light source light will be set to. + If function prototype ends in 'v' specifies a pointer to the value or values that + parameter pname of light source light will be set to. + + +.. function:: glLightModel (pname, param): + + B{glLightModelf, glLightModeli, glLightModelfv, glLightModeliv} + + Set the lighting model parameters + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/lightmodel.html>`_ + + :type pname: Enumerated constant + :arg pname: Specifies a single-value light model parameter. + :type param: Depends on function prototype. + :arg param: Specifies the value that param will be set to. If function prototype ends in 'v' + specifies a pointer to the value or values that param will be set to. + + +.. function:: glLineStipple(factor, pattern): + + Specify the line stipple pattern + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/linestipple.html>`_ + + :type factor: int + :arg factor: Specifies a multiplier for each bit in the line stipple pattern. + If factor is 3, for example, each bit in the pattern is used three times before + the next bit in the pattern is used. factor is clamped to the range [1, 256] and + defaults to 1. + :type pattern: unsigned short int + :arg pattern: Specifies a 16-bit integer whose bit pattern determines which fragments + of a line will be drawn when the line is rasterized. Bit zero is used first; the default + pattern is all 1's. + + +.. function:: glLineWidth(width): + + Specify the width of rasterized lines. + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/linewidth.html>`_ + + :type width: float + :arg width: Specifies the width of rasterized lines. The initial value is 1. + + +.. function:: glListBase(base): + + Set the display-list base for glCallLists + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/listbase.html>`_ + + :type base: unsigned int + :arg base: Specifies an integer offset that will be added to glCallLists + offsets to generate display-list names. The initial value is 0. + + +.. function:: glLoadIdentity(): + + Replace the current matrix with the identity matrix + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/loadidentity.html>`_ + + +.. function:: glLoadMatrix (m): + + B{glLoadMatrixd, glLoadMatixf} + + Replace the current matrix with the specified matrix + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/loadmatrix.html>`_ + + :type m: :class:`Buffer` object. Depends on function prototype. + :arg m: Specifies a pointer to 16 consecutive values, which are used as the elements + of a 4x4 column-major matrix. + + +.. function:: glLoadName(name): + + Load a name onto the name stack. + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/loadname.html>`_ + + :type name: unsigned int + :arg name: Specifies a name that will replace the top value on the name stack. + + +.. function:: glLogicOp(opcode): + + Specify a logical pixel operation for color index rendering + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/logicop.html>`_ + + :type opcode: Enumerated constant + :arg opcode: Specifies a symbolic constant that selects a logical operation. + + +.. function:: glMap1 (target, u1, u2, stride, order, points): + + B{glMap1d, glMap1f} + + Define a one-dimensional evaluator + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/map1.html>`_ + + :type target: Enumerated constant + :arg target: Specifies the kind of values that are generated by the evaluator. + :type u1, u2: Depends on function prototype. + :arg u1,u2: Specify a linear mapping of u, as presented to glEvalCoord1, to ^, t + he variable that is evaluated by the equations specified by this command. + :type stride: int + :arg stride: Specifies the number of floats or float (double)s between the beginning + of one control point and the beginning of the next one in the data structure + referenced in points. This allows control points to be embedded in arbitrary data + structures. The only constraint is that the values for a particular control point must + occupy contiguous memory locations. + :type order: int + :arg order: Specifies the number of control points. Must be positive. + :type points: :class:`Buffer` object. Depends on function prototype. + :arg points: Specifies a pointer to the array of control points. + + +.. function:: glMap2 (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points): + + B{glMap2d, glMap2f} + + Define a two-dimensional evaluator + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/map2.html>`_ + + :type target: Enumerated constant + :arg target: Specifies the kind of values that are generated by the evaluator. + :type u1, u2: Depends on function prototype. + :arg u1,u2: Specify a linear mapping of u, as presented to glEvalCoord2, to ^, t + he variable that is evaluated by the equations specified by this command. Initially + u1 is 0 and u2 is 1. + :type ustride: int + :arg ustride: Specifies the number of floats or float (double)s between the beginning + of control point R and the beginning of control point R ij, where i and j are the u + and v control point indices, respectively. This allows control points to be embedded + in arbitrary data structures. The only constraint is that the values for a particular + control point must occupy contiguous memory locations. The initial value of ustride is 0. + :type uorder: int + :arg uorder: Specifies the dimension of the control point array in the u axis. + Must be positive. The initial value is 1. + :type v1, v2: Depends on function prototype. + :arg v1, v2: Specify a linear mapping of v, as presented to glEvalCoord2, + to ^, one of the two variables that are evaluated by the equations + specified by this command. Initially, v1 is 0 and v2 is 1. + :type vstride: int + :arg vstride: Specifies the number of floats or float (double)s between the + beginning of control point R and the beginning of control point R ij, + where i and j are the u and v control point(indices, respectively. + This allows control points to be embedded in arbitrary data structures. + The only constraint is that the values for a particular control point must + occupy contiguous memory locations. The initial value of vstride is 0. + :type vorder: int + :arg vorder: Specifies the dimension of the control point array in the v axis. + Must be positive. The initial value is 1. + :type points: :class:`Buffer` object. Depends on function prototype. + :arg points: Specifies a pointer to the array of control points. + + +.. function:: glMapGrid (un, u1,u2 ,vn, v1, v2): + + B{glMapGrid1d, glMapGrid1f, glMapGrid2d, glMapGrid2f} + + Define a one- or two-dimensional mesh + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/mapgrid.html>`_ + + :type un: int + :arg un: Specifies the number of partitions in the grid range interval + [u1, u2]. Must be positive. + :type u1, u2: Depends on function prototype. + :arg u1, u2: Specify the mappings for integer grid domain values i=0 and i=un. + :type vn: int + :arg vn: Specifies the number of partitions in the grid range interval + [v1, v2] (glMapGrid2 only). + :type v1, v2: Depends on function prototype. + :arg v1, v2: Specify the mappings for integer grid domain values j=0 and j=vn + (glMapGrid2 only). + + +.. function:: glMaterial (face, pname, params): + + Specify material parameters for the lighting model. + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/material.html>`_ + + :type face: Enumerated constant + :arg face: Specifies which face or faces are being updated. Must be one of: + :type pname: Enumerated constant + :arg pname: Specifies the single-valued material parameter of the face + or faces that is being updated. Must be GL_SHININESS. + :type params: int + :arg params: Specifies the value that parameter GL_SHININESS will be set to. + If function prototype ends in 'v' specifies a pointer to the value or values that + pname will be set to. + + +.. function:: glMatrixMode(mode): + + Specify which matrix is the current matrix. + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/matrixmode.html>`_ + + :type mode: Enumerated constant + :arg mode: Specifies which matrix stack is the target for subsequent matrix operations. + + +.. function:: glMultMatrix (m): + + B{glMultMatrixd, glMultMatrixf} + + Multiply the current matrix with the specified matrix + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/multmatrix.html>`_ + + :type m: :class:`Buffer` object. Depends on function prototype. + :arg m: Points to 16 consecutive values that are used as the elements of a 4x4 column + major matrix. + + +.. function:: glNewList(list, mode): + + Create or replace a display list + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/newlist.html>`_ + + :type list: unsigned int + :arg list: Specifies the display list name + :type mode: Enumerated constant + :arg mode: Specifies the compilation mode. + + +.. function:: glNormal3 (nx, ny, nz, v): + + B{Normal3b, Normal3bv, Normal3d, Normal3dv, Normal3f, Normal3fv, Normal3i, Normal3iv, + Normal3s, Normal3sv} + + Set the current normal vector + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/normal.html>`_ + + :type nx, ny, nz: Depends on function prototype. (non - 'v' prototypes only) + :arg nx, ny, nz: Specify the x, y, and z coordinates of the new current normal. + The initial value of the current normal is the unit vector, (0, 0, 1). + :type v: :class:`Buffer` object. Depends on function prototype. ('v' prototypes) + :arg v: Specifies a pointer to an array of three elements: the x, y, and z coordinates + of the new current normal. + + +.. function:: glOrtho(left, right, bottom, top, zNear, zFar): + + Multiply the current matrix with an orthographic matrix + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/ortho.html>`_ + + :type left, right: double (float) + :arg left, right: Specify the coordinates for the left and + right vertical clipping planes. + :type bottom, top: double (float) + :arg bottom, top: Specify the coordinates for the bottom and top + horizontal clipping planes. + :type zNear, zFar: double (float) + :arg zNear, zFar: Specify the distances to the nearer and farther + depth clipping planes. These values are negative if the plane is to be behind the viewer. + + +.. function:: glPassThrough(token): + + Place a marker in the feedback buffer + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/passthrough.html>`_ + + :type token: float + :arg token: Specifies a marker value to be placed in the feedback + buffer following a GL_PASS_THROUGH_TOKEN. + + +.. function:: glPixelMap (map, mapsize, values): + + B{glPixelMapfv, glPixelMapuiv, glPixelMapusv} + + Set up pixel transfer maps + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixelmap.html>`_ + + :type map: Enumerated constant + :arg map: Specifies a symbolic map name. + :type mapsize: int + :arg mapsize: Specifies the size of the map being defined. + :type values: :class:`Buffer` object. Depends on function prototype. + :arg values: Specifies an array of mapsize values. + + +.. function:: glPixelStore (pname, param): + + B{glPixelStoref, glPixelStorei} + + Set pixel storage modes + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixelstore.html>`_ + + :type pname: Enumerated constant + :arg pname: Specifies the symbolic name of the parameter to be set. + Six values affect the packing of pixel data into memory. + Six more affect the unpacking of pixel data from memory. + :type param: Depends on function prototype. + :arg param: Specifies the value that pname is set to. + + +.. function:: glPixelTransfer (pname, param): + + B{glPixelTransferf, glPixelTransferi} + + Set pixel transfer modes + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixeltransfer.html>`_ + + :type pname: Enumerated constant + :arg pname: Specifies the symbolic name of the pixel transfer parameter to be set. + :type param: Depends on function prototype. + :arg param: Specifies the value that pname is set to. + + +.. function:: glPixelZoom(xfactor, yfactor): + + Specify the pixel zoom factors + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixelzoom.html>`_ + + :type xfactor, yfactor: float + :arg xfactor, yfactor: Specify the x and y zoom factors for pixel write operations. + + +.. function:: glPointSize(size): + + Specify the diameter of rasterized points + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pointsize.html>`_ + + :type size: float + :arg size: Specifies the diameter of rasterized points. The initial value is 1. + + +.. function:: glPolygonMode(face, mode): + + Select a polygon rasterization mode + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/polygonmode.html>`_ + + :type face: Enumerated constant + :arg face: Specifies the polygons that mode applies to. + Must be GL_FRONT for front-facing polygons, GL_BACK for back- facing + polygons, or GL_FRONT_AND_BACK for front- and back-facing polygons. + :type mode: Enumerated constant + :arg mode: Specifies how polygons will be rasterized. + The initial value is GL_FILL for both front- and back- facing polygons. + + +.. function:: glPolygonOffset(factor, units): + + Set the scale and units used to calculate depth values + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/polygonoffset.html>`_ + + :type factor: float + :arg factor: Specifies a scale factor that is used to create a variable depth + offset for each polygon. The initial value is 0. + :type units: float + :arg units: Is multiplied by an implementation-specific value to create a + constant depth offset. The initial value is 0. + + +.. function:: glPolygonStipple(mask): + + Set the polygon stippling pattern + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/polygonstipple.html>`_ + + :type mask: :class:`Buffer` object I{type GL_BYTE} + :arg mask: Specifies a pointer to a 32x32 stipple pattern that will be unpacked + from memory in the same way that glDrawPixels unpacks pixels. + + +.. function:: glPopAttrib(): + + Pop the server attribute stack + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushattrib.html>`_ + + +.. function:: glPopClientAttrib(): + + Pop the client attribute stack + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushclientattrib.html>`_ + + +.. function:: glPopMatrix(): + + Pop the current matrix stack + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushmatrix.html>`_ + + +.. function:: glPopName(): + + Pop the name stack + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushname.html>`_ + + +.. function:: glPrioritizeTextures(n, textures, priorities): + + Set texture residence priority + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/prioritizetextures.html>`_ + + :type n: int + :arg n: Specifies the number of textures to be prioritized. + :type textures: :class:`Buffer` I{type GL_INT} + :arg textures: Specifies an array containing the names of the textures to be prioritized. + :type priorities: :class:`Buffer` I{type GL_FLOAT} + :arg priorities: Specifies an array containing the texture priorities. + A priority given in an element of priorities applies to the texture named + by the corresponding element of textures. + + +.. function:: glPushAttrib(mask): + + Push the server attribute stack + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushattrib.html>`_ + + :type mask: Enumerated constant(s) + :arg mask: Specifies a mask that indicates which attributes to save. + + +.. function:: glPushClientAttrib(mask): + + Push the client attribute stack + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushclientattrib.html>`_ + + :type mask: Enumerated constant(s) + :arg mask: Specifies a mask that indicates which attributes to save. + + +.. function:: glPushMatrix(): + + Push the current matrix stack + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushmatrix.html>`_ + + +.. function:: glPushName(name): + + Push the name stack + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushname.html>`_ + + :type name: unsigned int + :arg name: Specifies a name that will be pushed onto the name stack. + + +.. function:: glRasterPos (x,y,z,w): + + B{glRasterPos2d, glRasterPos2f, glRasterPos2i, glRasterPos2s, glRasterPos3d, + glRasterPos3f, glRasterPos3i, glRasterPos3s, glRasterPos4d, glRasterPos4f, + glRasterPos4i, glRasterPos4s, glRasterPos2dv, glRasterPos2fv, glRasterPos2iv, + glRasterPos2sv, glRasterPos3dv, glRasterPos3fv, glRasterPos3iv, glRasterPos3sv, + glRasterPos4dv, glRasterPos4fv, glRasterPos4iv, glRasterPos4sv} + + Specify the raster position for pixel operations + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rasterpos.html>`_ + + :type x, y, z, w: Depends on function prototype. (z and w for '3' and '4' prototypes only) + :arg x, y, z, w: Specify the x,y,z, and w object coordinates (if present) for the + raster position. If function prototype ends in 'v' specifies a pointer to an array of two, + three, or four elements, specifying x, y, z, and w coordinates, respectively. + + .. note:: + + If you are drawing to the 3d view with a Scriptlink of a space handler + the zoom level of the panels will scale the glRasterPos by the view matrix. + so a X of 10 will not always offset 10 pixels as you would expect. + + To work around this get the scale value of the view matrix and use it to scale your pixel values. + + .. code-block:: python + + import Blender + from Blender.BGL import * + xval, yval= 100, 40 + # Get the scale of the view matrix + viewMatrix = Buffer(GL_FLOAT, 16) + glGetFloatv(GL_MODELVIEW_MATRIX, viewMatrix) + f = 1/viewMatrix[0] + glRasterPos2f(xval*f, yval*f) # Instead of the usual glRasterPos2i(xval, yval) + + +.. function:: glReadBuffer(mode): + + Select a color buffer source for pixels. + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/readbuffer.html>`_ + + :type mode: Enumerated constant + :arg mode: Specifies a color buffer. + + +.. function:: glReadPixels(x, y, width, height, format, type, pixels): + + Read a block of pixels from the frame buffer + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/readpixels.html>`_ + + :type x, y: int + :arg x, y: Specify the window coordinates of the first pixel that is read + from the frame buffer. This location is the lower left corner of a rectangular + block of pixels. + :type width, height: int + :arg width, height: Specify the dimensions of the pixel rectangle. width and + height of one correspond to a single pixel. + :type format: Enumerated constant + :arg format: Specifies the format of the pixel data. + :type type: Enumerated constant + :arg type: Specifies the data type of the pixel data. + :type pixels: :class:`Buffer` object + :arg pixels: Returns the pixel data. + + +.. function:: glRect (x1,y1,x2,y2,v1,v2): + + B{glRectd, glRectf, glRecti, glRects, glRectdv, glRectfv, glRectiv, glRectsv} + + Draw a rectangle + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rect.html>`_ + + :type x1, y1: Depends on function prototype. (for non 'v' prototypes only) + :arg x1, y1: Specify one vertex of a rectangle + :type x2, y2: Depends on function prototype. (for non 'v' prototypes only) + :arg x2, y2: Specify the opposite vertex of the rectangle + :type v1, v2: Depends on function prototype. (for 'v' prototypes only) + :arg v1, v2: Specifies a pointer to one vertex of a rectangle and the pointer + to the opposite vertex of the rectangle + + +.. function:: glRenderMode(mode): + + Set rasterization mode + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rendermode.html>`_ + + :type mode: Enumerated constant + :arg mode: Specifies the rasterization mode. + + +.. function:: glRotate (angle, x, y, z): + + B{glRotated, glRotatef} + + Multiply the current matrix by a rotation matrix + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rotate.html>`_ + + :type angle: Depends on function prototype. + :arg angle: Specifies the angle of rotation in degrees. + :type x, y, z: Depends on function prototype. + :arg x, y, z: Specify the x, y, and z coordinates of a vector respectively. + + +.. function:: glScale (x,y,z): + + B{glScaled, glScalef} + + Multiply the current matrix by a general scaling matrix + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/scale.html>`_ + + :type x, y, z: Depends on function prototype. + :arg x, y, z: Specify scale factors along the x, y, and z axes, respectively. + + +.. function:: glScissor(x,y,width,height): + + Define the scissor box + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/scissor.html>`_ + + :type x, y: int + :arg x, y: Specify the lower left corner of the scissor box. Initially (0, 0). + :type width, height: int + :arg width height: Specify the width and height of the scissor box. When a + GL context is first attached to a window, width and height are set to the + dimensions of that window. + + +.. function:: glSelectBuffer(size, buffer): + + Establish a buffer for selection mode values + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/selectbuffer.html>`_ + + :type size: int + :arg size: Specifies the size of buffer + :type buffer: :class:`Buffer` I{type GL_INT} + :arg buffer: Returns the selection data + + +.. function:: glShadeModel(mode): + + Select flat or smooth shading + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/shademodel.html>`_ + + :type mode: Enumerated constant + :arg mode: Specifies a symbolic value representing a shading technique. + + +.. function:: glStencilFuc(func, ref, mask): + + Set function and reference value for stencil testing + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/stencilfunc.html>`_ + + :type func: Enumerated constant + :arg func: Specifies the test function. + :type ref: int + :arg ref: Specifies the reference value for the stencil test. ref is clamped + to the range [0,2n-1], where n is the number of bitplanes in the stencil + buffer. The initial value is 0. + :type mask: unsigned int + :arg mask: Specifies a mask that is ANDed with both the reference value and + the stored stencil value when the test is done. The initial value is all 1's. + + +.. function:: glStencilMask(mask): + + Control the writing of individual bits in the stencil planes + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/stencilmask.html>`_ + + :type mask: unsigned int + :arg mask: Specifies a bit mask to enable and disable writing of individual bits + in the stencil planes. Initially, the mask is all 1's. + + +.. function:: glStencilOp(fail, zfail, zpass): + + Set stencil test actions + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/stencilop.html>`_ + + :type fail: Enumerated constant + :arg fail: Specifies the action to take when the stencil test fails. + The initial value is GL_KEEP. + :type zfail: Enumerated constant + :arg zfail: Specifies the stencil action when the stencil test passes, but the + depth test fails. zfail accepts the same symbolic constants as fail. + The initial value is GL_KEEP. + :type zpass: Enumerated constant + :arg zpass: Specifies the stencil action when both the stencil test and the + depth test pass, or when the stencil test passes and either there is no + depth buffer or depth testing is not enabled. zpass accepts the same + symbolic constants + as fail. The initial value is GL_KEEP. + + +.. function:: glTexCoord (s,t,r,q,v): + + B{glTexCoord1d, glTexCoord1f, glTexCoord1i, glTexCoord1s, glTexCoord2d, glTexCoord2f, + glTexCoord2i, glTexCoord2s, glTexCoord3d, glTexCoord3f, glTexCoord3i, glTexCoord3s, + glTexCoord4d, glTexCoord4f, glTexCoord4i, glTexCoord4s, glTexCoord1dv, glTexCoord1fv, + glTexCoord1iv, glTexCoord1sv, glTexCoord2dv, glTexCoord2fv, glTexCoord2iv, + glTexCoord2sv, glTexCoord3dv, glTexCoord3fv, glTexCoord3iv, glTexCoord3sv, + glTexCoord4dv, glTexCoord4fv, glTexCoord4iv, glTexCoord4sv} + + Set the current texture coordinates + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texcoord.html>`_ + + :type s, t, r, q: Depends on function prototype. (r and q for '3' and '4' prototypes only) + :arg s, t, r, q: Specify s, t, r, and q texture coordinates. Not all parameters are + present in all forms of the command. + :type v: :class:`Buffer` object. Depends on function prototype. (for 'v' prototypes only) + :arg v: Specifies a pointer to an array of one, two, three, or four elements, + which in turn specify the s, t, r, and q texture coordinates. + + +.. function:: glTexEnv (target, pname, param): + + B{glTextEnvf, glTextEnvi, glTextEnvfv, glTextEnviv} + + Set texture environment parameters + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texenv.html>`_ + + :type target: Enumerated constant + :arg target: Specifies a texture environment. Must be GL_TEXTURE_ENV. + :type pname: Enumerated constant + :arg pname: Specifies the symbolic name of a single-valued texture environment + parameter. Must be GL_TEXTURE_ENV_MODE. + :type param: Depends on function prototype. + :arg param: Specifies a single symbolic constant. If function prototype ends in 'v' + specifies a pointer to a parameter array that contains either a single + symbolic constant or an RGBA color + + +.. function:: glTexGen (coord, pname, param): + + B{glTexGend, glTexGenf, glTexGeni, glTexGendv, glTexGenfv, glTexGeniv} + + Control the generation of texture coordinates + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texgen.html>`_ + + :type coord: Enumerated constant + :arg coord: Specifies a texture coordinate. + :type pname: Enumerated constant + :arg pname: Specifies the symbolic name of the texture- coordinate generation function. + :type param: Depends on function prototype. + :arg param: Specifies a single-valued texture generation parameter. + If function prototype ends in 'v' specifies a pointer to an array of texture + generation parameters. If pname is GL_TEXTURE_GEN_MODE, then the array must + contain a single symbolic constant. Otherwise, params holds the coefficients + for the texture-coordinate generation function specified by pname. + + +.. function:: glTexImage1D(target, level, internalformat, width, border, format, type, pixels): + + Specify a one-dimensional texture image + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/teximage1d.html>`_ + + :type target: Enumerated constant + :arg target: Specifies the target texture. + :type level: int + :arg level: Specifies the level-of-detail number. Level 0 is the base image level. + Level n is the nth mipmap reduction image. + :type internalformat: int + :arg internalformat: Specifies the number of color components in the texture. + :type width: int + :arg width: Specifies the width of the texture image. Must be 2n+2(border) + for some integer n. All implementations support texture images that are + at least 64 texels wide. The height of the 1D texture image is 1. + :type border: int + :arg border: Specifies the width of the border. Must be either 0 or 1. + :type format: Enumerated constant + :arg format: Specifies the format of the pixel data. + :type type: Enumerated constant + :arg type: Specifies the data type of the pixel data. + :type pixels: :class:`Buffer` object. + :arg pixels: Specifies a pointer to the image data in memory. + + +.. function:: glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels): + + Specify a two-dimensional texture image + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/teximage2d.html>`_ + + :type target: Enumerated constant + :arg target: Specifies the target texture. + :type level: int + :arg level: Specifies the level-of-detail number. Level 0 is the base image level. + Level n is the nth mipmap reduction image. + :type internalformat: int + :arg internalformat: Specifies the number of color components in the texture. + :type width: int + :arg width: Specifies the width of the texture image. Must be 2n+2(border) + for some integer n. All implementations support texture images that are at + least 64 texels wide. + :type height: int + :arg height: Specifies the height of the texture image. Must be 2m+2(border) for + some integer m. All implementations support texture images that are at + least 64 texels high. + :type border: int + :arg border: Specifies the width of the border. Must be either 0 or 1. + :type format: Enumerated constant + :arg format: Specifies the format of the pixel data. + :type type: Enumerated constant + :arg type: Specifies the data type of the pixel data. + :type pixels: :class:`Buffer` object. + :arg pixels: Specifies a pointer to the image data in memory. + + +.. function:: glTexParameter (target, pname, param): + + B{glTexParameterf, glTexParameteri, glTexParameterfv, glTexParameteriv} + + Set texture parameters + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texparameter.html>`_ + + :type target: Enumerated constant + :arg target: Specifies the target texture. + :type pname: Enumerated constant + :arg pname: Specifies the symbolic name of a single-valued texture parameter. + :type param: Depends on function prototype. + :arg param: Specifies the value of pname. If function prototype ends in 'v' specifies + a pointer to an array where the value or values of pname are stored. + + +.. function:: glTranslate (x, y, z): + + B{glTranslatef, glTranslated} + + Multiply the current matrix by a translation matrix + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/translate.html>`_ + + :type x, y, z: Depends on function prototype. + :arg x, y, z: Specify the x, y, and z coordinates of a translation vector. + + +.. function:: glVertex (x,y,z,w,v): + + B{glVertex2d, glVertex2f, glVertex2i, glVertex2s, glVertex3d, glVertex3f, glVertex3i, + glVertex3s, glVertex4d, glVertex4f, glVertex4i, glVertex4s, glVertex2dv, glVertex2fv, + glVertex2iv, glVertex2sv, glVertex3dv, glVertex3fv, glVertex3iv, glVertex3sv, glVertex4dv, + glVertex4fv, glVertex4iv, glVertex4sv} + + Specify a vertex + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/vertex.html>`_ + + :type x, y, z, w: Depends on function prototype (z and w for '3' and '4' prototypes only) + :arg x, y, z, w: Specify x, y, z, and w coordinates of a vertex. Not all parameters + are present in all forms of the command. + :type v: :class:`Buffer` object. Depends of function prototype (for 'v' + prototypes only) + :arg v: Specifies a pointer to an array of two, three, or four elements. The + elements of a two-element array are x and y; of a three-element array, + x, y, and z; and of a four-element array, x, y, z, and w. + + +.. function:: glViewport(x,y,width,height): + + Set the viewport + + .. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/viewport.html>`_ + + :type x, y: int + :arg x, y: Specify the lower left corner of the viewport rectangle, + in pixels. The initial value is (0,0). + :type width, height: int + :arg width, height: Specify the width and height of the viewport. When a GL + context is first attached to a window, width and height are set to the + dimensions of that window. + + +.. function:: gluPerspective(fovY, aspect, zNear, zFar): + + Set up a perspective projection matrix. + + .. seealso:: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5577288} + + :type fovY: double + :arg fovY: Specifies the field of view angle, in degrees, in the y direction. + :type aspect: double + :arg aspect: Specifies the aspect ratio that determines the field of view in the x direction. + The aspect ratio is the ratio of x (width) to y (height). + :type zNear: double + :arg zNear: Specifies the distance from the viewer to the near clipping plane (always positive). + :type zFar: double + :arg zFar: Specifies the distance from the viewer to the far clipping plane (always positive). + + +.. function:: gluLookAt(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz): + + Define a viewing transformation. + + .. seealso:: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5573042} + + :type eyex, eyey, eyez: double + :arg eyex, eyey, eyez: Specifies the position of the eye point. + :type centerx, centery, centerz: double + :arg centerx, centery, centerz: Specifies the position of the reference point. + :type upx, upy, upz: double + :arg upx, upy, upz: Specifies the direction of the up vector. + + +.. function:: gluOrtho2D(left, right, bottom, top): + + Define a 2-D orthographic projection matrix. + + .. seealso:: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5578074} + + :type left, right: double + :arg left, right: Specify the coordinates for the left and right vertical clipping planes. + :type bottom, top: double + :arg bottom, top: Specify the coordinates for the bottom and top horizontal clipping planes. + + +.. function:: gluPickMatrix(x, y, width, height, viewport): + + Define a picking region. + + .. seealso:: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5578074} + + :type x, y: double + :arg x, y: Specify the center of a picking region in window coordinates. + :type width, height: double + :arg width, height: Specify the width and height, respectively, of the picking region in window coordinates. + :type viewport: :class:`Buffer` object. [int] + :arg viewport: Specifies the current viewport. + + +.. function:: gluProject(objx, objy, objz, modelMatrix, projMatrix, viewport, winx, winy, winz): + + Map object coordinates to window coordinates. + + .. seealso:: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5578074} + + :type objx, objy, objz: double + :arg objx, objy, objz: Specify the object coordinates. + :type modelMatrix: :class:`Buffer` object. [double] + :arg modelMatrix: Specifies the current modelview matrix (as from a glGetDoublev call). + :type projMatrix: :class:`Buffer` object. [double] + :arg projMatrix: Specifies the current projection matrix (as from a glGetDoublev call). + :type viewport: :class:`Buffer` object. [int] + :arg viewport: Specifies the current viewport (as from a glGetIntegerv call). + :type winx, winy, winz: :class:`Buffer` object. [double] + :arg winx, winy, winz: Return the computed window coordinates. + + +.. function:: gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, objx, objy, objz): + + Map object coordinates to window coordinates. + + .. seealso:: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5582204} + + :type winx, winy, winz: double + :arg winx, winy, winz: Specify the window coordinates to be mapped. + :type modelMatrix: :class:`Buffer` object. [double] + :arg modelMatrix: Specifies the current modelview matrix (as from a glGetDoublev call). + :type projMatrix: :class:`Buffer` object. [double] + :arg projMatrix: Specifies the current projection matrix (as from a glGetDoublev call). + :type viewport: :class:`Buffer` object. [int] + :arg viewport: Specifies the current viewport (as from a glGetIntegerv call). + :type objx, objy, objz: :class:`Buffer` object. [double] + :arg objx, objy, objz: Return the computed object coordinates. + + +class Buffer: + + The Buffer object is simply a block of memory that is delineated and initialized by the + user. Many OpenGL functions return data to a C-style pointer, however, because this + is not possible in python the Buffer object can be used to this end. Wherever pointer + notation is used in the OpenGL functions the Buffer object can be used in it's BGL + wrapper. In some instances the Buffer object will need to be initialized with the template + parameter, while in other instances the user will want to create just a blank buffer + which will be zeroed by default. + + Example with Buffer:: + import Blender + from Blender import BGL + myByteBuffer = BGL.Buffer(BGL.GL_BYTE, [32,32]) + BGL.glGetPolygonStipple(myByteBuffer) + print myByteBuffer.dimensions + print myByteBuffer.list + sliceBuffer = myByteBuffer[0:16] + print sliceBuffer + + .. attribute:: list + + The contents of the Buffer. + + .. attribute:: dimensions + + The size of the Buffer. + + .. method:: __init__(type, dimensions, template = None): + + This will create a new Buffer object for use with other BGL OpenGL commands. + Only the type of argument to store in the buffer and the dimensions of the buffer + are necessary. Buffers are zeroed by default unless a template is supplied, in + which case the buffer is initialized to the template. + + :type type: int + :arg type: The format to store data in. The type should be one of + GL_BYTE, GL_SHORT, GL_INT, or GL_FLOAT. + :type dimensions: An int or sequence object specifying the dimensions of the buffer. + :arg dimensions: If the dimensions are specified as an int a linear array will + be created for the buffer. If a sequence is passed for the dimensions, the buffer + becomes n-Dimensional, where n is equal to the number of parameters passed in the + sequence. Example: [256,2] is a two- dimensional buffer while [256,256,4] creates + a three- dimensional buffer. You can think of each additional dimension as a sub-item + of the dimension to the left. i.e. [10,2] is a 10 element array each with 2 sub-items. + [(0,0), (0,1), (1,0), (1,1), (2,0), ...] etc. + :type template: A python sequence object (optional) + :arg template: A sequence of matching dimensions which will be used to initialize + the Buffer. If a template is not passed in all fields will be initialized to 0. + :rtype: Buffer object + :return: The newly created buffer as a PyObject. + diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 0112007ca7f..94578c6a545 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -67,7 +67,7 @@ if 1: else: # for testing so doc-builds dont take so long. EXCLUDE_MODULES = ( - # "bpy.context", + "bpy.context", "bpy.app", "bpy.path", "bpy.data", @@ -76,10 +76,10 @@ else: "bpy.context", "bpy.types", # supports filtering "bpy.ops", # supports filtering - #"bpy_extras", + "bpy_extras", "bge", "aud", - "bgl", + #"bgl", "blf", "mathutils", "mathutils.geometry", @@ -1028,8 +1028,8 @@ def rna2sphinx(BASEPATH): fw(" mathutils.rst\n\n") if "mathutils.geometry" not in EXCLUDE_MODULES: fw(" mathutils.geometry.rst\n\n") - # XXX TODO - #fw(" bgl.rst\n\n") + if "bgl" not in EXCLUDE_MODULES: + fw(" bgl.rst\n\n") if "blf" not in EXCLUDE_MODULES: fw(" blf.rst\n\n") if "aud" not in EXCLUDE_MODULES: @@ -1159,14 +1159,16 @@ def rna2sphinx(BASEPATH): import mathutils.geometry as module pymodule2sphinx(BASEPATH, "mathutils.geometry", module, "Geometry Utilities") - if "mathutils.geometry" not in EXCLUDE_MODULES: + if "blf" not in EXCLUDE_MODULES: import blf as module pymodule2sphinx(BASEPATH, "blf", module, "Font Drawing") - # XXX TODO - #import bgl as module - #pymodule2sphinx(BASEPATH, "bgl", module, "Blender OpenGl wrapper") - #del module + if "bgl" not in EXCLUDE_MODULES: + #import bgl as module + #pymodule2sphinx(BASEPATH, "bgl", module, "Blender OpenGl wrapper") + #del module + import shutil + shutil.copy2(os.path.join(BASEPATH, "..", "rst", "bgl.rst"), BASEPATH) if "aud" not in EXCLUDE_MODULES: import aud as module diff --git a/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm b/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm index ab3abdd659f..86f5f4cdddb 100644 --- a/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm +++ b/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm @@ -164,5 +164,5 @@ GHOST_TSuccess GHOST_DisplayManagerCocoa::setCurrentDisplaySetting(GHOST_TUns8 d //CGDisplayErr err = ::CGDisplaySwitchToMode(m_displayIDs[display], displayModeValues); - return /*err == CGDisplayNoErr ? GHOST_kSuccess :*/ GHOST_kFailure; + return /*err == CGDisplayNoErr ?*/ GHOST_kSuccess /*: GHOST_kFailure*/; } diff --git a/intern/ghost/intern/GHOST_SystemCocoa.h b/intern/ghost/intern/GHOST_SystemCocoa.h index e7a8178a382..ce777358389 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.h +++ b/intern/ghost/intern/GHOST_SystemCocoa.h @@ -119,14 +119,6 @@ public: const GHOST_TEmbedderWindowID parentWindow = 0 ); - virtual GHOST_TSuccess beginFullScreen( - const GHOST_DisplaySetting& setting, - GHOST_IWindow** window, - const bool stereoVisual - ); - - virtual GHOST_TSuccess endFullScreen( void ); - /*************************************************************************************** ** Event management functionality ***************************************************************************************/ diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index 2649929713a..69423f2dfbf 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -773,26 +773,6 @@ GHOST_IWindow* GHOST_SystemCocoa::createWindow( return window; } -GHOST_TSuccess GHOST_SystemCocoa::beginFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window, const bool stereoVisual) -{ - GHOST_IWindow* currentWindow = m_windowManager->getActiveWindow(); - *window = currentWindow; - - if(!currentWindow) return GHOST_kFailure; - - return currentWindow->setState(GHOST_kWindowStateFullScreen); -} - -GHOST_TSuccess GHOST_SystemCocoa::endFullScreen(void) -{ - GHOST_IWindow* currentWindow = m_windowManager->getActiveWindow(); - if(!currentWindow) return GHOST_kFailure; - - return currentWindow->setState(GHOST_kWindowStateNormal); -} - - - /** * @note : returns coordinates in Cocoa screen coordinates */ diff --git a/intern/ghost/intern/GHOST_WindowCocoa.h b/intern/ghost/intern/GHOST_WindowCocoa.h index e6de2bf07b4..ce28f8c4538 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.h +++ b/intern/ghost/intern/GHOST_WindowCocoa.h @@ -42,6 +42,7 @@ #include "STR_String.h" @class CocoaWindow; +@class CocoaOpenGLView; class GHOST_SystemCocoa; @@ -309,7 +310,7 @@ protected: CocoaWindow *m_window; /** The openGL view */ - NSOpenGLView *m_openGLView; + CocoaOpenGLView *m_openGLView; /** The opgnGL drawing context */ NSOpenGLContext *m_openGLContext; diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 93bc87b2458..937dffe9fba 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -241,10 +241,19 @@ extern "C" { //We need to subclass it in order to give Cocoa the feeling key events are trapped @interface CocoaOpenGLView : NSOpenGLView { + GHOST_SystemCocoa *systemCocoa; + GHOST_WindowCocoa *associatedWindow; } +- (void)setSystemAndWindowCocoa:(GHOST_SystemCocoa *)sysCocoa windowCocoa:(GHOST_WindowCocoa *)winCocoa; @end @implementation CocoaOpenGLView +- (void)setSystemAndWindowCocoa:(GHOST_SystemCocoa *)sysCocoa windowCocoa:(GHOST_WindowCocoa *)winCocoa +{ + systemCocoa = sysCocoa; + associatedWindow = winCocoa; +} + - (BOOL)acceptsFirstResponder { return YES; @@ -294,6 +303,7 @@ extern "C" { else { [super drawRect:rect]; + systemCocoa->handleWindowEvent(GHOST_kEventWindowUpdate, associatedWindow); } } @@ -424,6 +434,8 @@ GHOST_WindowCocoa::GHOST_WindowCocoa( //Creates the OpenGL View inside the window m_openGLView = [[CocoaOpenGLView alloc] initWithFrame:rect pixelFormat:pixelFormat]; + + [m_openGLView setSystemAndWindowCocoa:systemCocoa windowCocoa:this]; [pixelFormat release]; diff --git a/intern/ghost/intern/GHOST_WindowNULL.h b/intern/ghost/intern/GHOST_WindowNULL.h index 0ec3c6f5700..f979313af5c 100644 --- a/intern/ghost/intern/GHOST_WindowNULL.h +++ b/intern/ghost/intern/GHOST_WindowNULL.h @@ -54,7 +54,7 @@ public: const bool stereoVisual, const GHOST_TUns16 numOfAASamples ) : - GHOST_Window(title,left,top,width,height,state,type,stereoVisual,numOfAASamples), + GHOST_Window(width,height,state,type,stereoVisual,numOfAASamples), m_system (system) { setTitle(title); diff --git a/release/scripts/modules/bpy/__init__.py b/release/scripts/modules/bpy/__init__.py index 1df8e9e5588..9c48dc89f83 100644 --- a/release/scripts/modules/bpy/__init__.py +++ b/release/scripts/modules/bpy/__init__.py @@ -22,24 +22,29 @@ Give access to blender data and utility functions. """ -# internal blender C module -import _bpy -from _bpy import types, props, app +__all__ = ( + "app", + "context", + "data", + "ops", + "path", + "props", + "types", + "utils", +) + -data = _bpy.data -context = _bpy.context +# internal blender C module +from _bpy import types, props, app, data, context # python modules -from . import utils, path -from . import ops as _ops_module +from . import utils, path, ops # fake operator module -ops = _ops_module.ops_fake_module - -import sys as _sys - +ops = ops.ops_fake_module def _main(): + import sys as _sys # Possibly temp. addons path from os.path import join, dirname, normpath @@ -59,3 +64,5 @@ def _main(): _main() + +del _main diff --git a/release/scripts/modules/bpy_extras/mesh_utils.py b/release/scripts/modules/bpy_extras/mesh_utils.py index 2062fe4485f..cf099016aee 100644 --- a/release/scripts/modules/bpy_extras/mesh_utils.py +++ b/release/scripts/modules/bpy_extras/mesh_utils.py @@ -287,7 +287,7 @@ def ngon_tesselate(from_data, indices, fix_loops=True): else: return v1[1], v2[1] - if not PREF_FIX_LOOPS: + if not fix_loops: ''' Normal single concave loop filling ''' diff --git a/release/scripts/modules/console/intellisense.py b/release/scripts/modules/console/intellisense.py index 072d467ff86..a177b305fda 100644 --- a/release/scripts/modules/console/intellisense.py +++ b/release/scripts/modules/console/intellisense.py @@ -53,7 +53,7 @@ RE_UNQUOTED_WORD = re.compile( re.UNICODE) -def complete(line, cursor, namespace, private=True): +def complete(line, cursor, namespace, private): """Returns a list of possible completions: * name completion @@ -82,6 +82,9 @@ def complete(line, cursor, namespace, private=True): if RE_MODULE.match(line): from . import complete_import matches = complete_import.complete(line) + if not private: + matches[:] = [m for m in matches if m[:1] != "_"] + matches.sort() else: from . import complete_namespace matches = complete_namespace.complete(word, namespace, private) @@ -130,11 +133,15 @@ def expand(line, cursor, namespace, private=True): else: # causes blender bug [#27495] since string keys may contain '.' # scrollback = ' '.join([m.split('.')[-1] for m in matches]) + + # add white space to align with the cursor + white_space = " " + (" " * (cursor + len(prefix))) word_prefix = word + prefix - scrollback = ' '.join( - [m[len(word_prefix):] + scrollback = '\n'.join( + [white_space + m[len(word_prefix):] if (word_prefix and m.startswith(word_prefix)) - else m.split('.')[-1] + else + white_space + m.split('.')[-1] for m in matches]) no_calltip = True diff --git a/release/scripts/startup/bl_operators/image.py b/release/scripts/startup/bl_operators/image.py index 462db3a2c5e..1e5217217dd 100644 --- a/release/scripts/startup/bl_operators/image.py +++ b/release/scripts/startup/bl_operators/image.py @@ -60,7 +60,7 @@ class EditExternally(bpy.types.Operator): filepath = bpy.path.abspath(self.filepath) if not os.path.exists(filepath): - self.report({'ERROR'}, "Image path %r not found." % filepath) + self.report({'ERROR'}, "Image path %r not found, image may be packed or unsaved." % filepath) return {'CANCELLED'} cmd = self._editor_guess(context) + [filepath] diff --git a/release/scripts/startup/bl_operators/mesh.py b/release/scripts/startup/bl_operators/mesh.py index 996b38ae571..8dca30e54df 100644 --- a/release/scripts/startup/bl_operators/mesh.py +++ b/release/scripts/startup/bl_operators/mesh.py @@ -81,8 +81,8 @@ class MeshMirrorUV(bpy.types.Operator): @classmethod def poll(cls, context): - ob = context.active_object - return (ob and ob.type == 'MESH') + obj = context.active_object + return (obj and obj.type == 'MESH' and obj.data.uv_textures.active) def execute(self, context): DIR = (self.direction == 'NEGATIVE') @@ -120,12 +120,7 @@ class MeshMirrorUV(bpy.types.Operator): if j is not None: vmap[i] = j - active_uv_layer = None - for lay in mesh.uv_textures: - if lay.active: - active_uv_layer = lay.data - break - + active_uv_layer = mesh.uv_textures.active.data fuvs = [(uv.uv1, uv.uv2, uv.uv3, uv.uv4) for uv in active_uv_layer] fuvs_cpy = [(uv[0].copy(), uv[1].copy(), uv[2].copy(), uv[3].copy()) for uv in fuvs] diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py index a8bb3227b3c..074f204d50e 100644 --- a/release/scripts/startup/bl_operators/object_quick_effects.py +++ b/release/scripts/startup/bl_operators/object_quick_effects.py @@ -132,7 +132,7 @@ class QuickExplode(bpy.types.Operator): fake_context = bpy.context.copy() obj_act = context.active_object - if obj_act.type != 'MESH': + if obj_act is None or obj_act.type != 'MESH': self.report({'ERROR'}, "Active object is not a mesh") return {'CANCELLED'} diff --git a/release/scripts/startup/bl_operators/uvcalc_smart_project.py b/release/scripts/startup/bl_operators/uvcalc_smart_project.py index 3e1ce621ec2..7ea89cfa479 100644 --- a/release/scripts/startup/bl_operators/uvcalc_smart_project.py +++ b/release/scripts/startup/bl_operators/uvcalc_smart_project.py @@ -746,13 +746,15 @@ def packIslands(islandList): uv.y= (uv.y+yoffset) * yfactor - def VectoQuat(vec): - vec = vec.normalized() - if abs(vec.x) > 0.5: - return vec.to_track_quat('Z', 'X') - else: - return vec.to_track_quat('Z', 'Y') + a3 = vec.normalized() + up = Vector((0.0, 0.0, 1.0)) + if abs(a3.dot(up)) == 1.0: + up = Vector((0.0, 1.0, 0.0)) + + a1 = a3.cross(up).normalized() + a2 = a3.cross(a1) + return Matrix((a1, a2, a3)).to_quaternion() class thickface(object): @@ -791,7 +793,11 @@ def main_consts(): global ob ob = None -def main(context, island_margin, projection_limit): +def main(context, + island_margin, + projection_limit, + user_area_weight, + ): global USER_FILL_HOLES global USER_FILL_HOLES_QUALITY global USER_STRETCH_ASPECT @@ -844,7 +850,6 @@ def main(context, island_margin, projection_limit): USER_FILL_HOLES = (0) USER_FILL_HOLES_QUALITY = (50) # Only for hole filling. USER_VIEW_INIT = (0) # Only for hole filling. - USER_AREA_WEIGHT = (1) # Only for hole filling. # Reuse variable if len(obList) == 1: @@ -970,12 +975,15 @@ def main(context, island_margin, projection_limit): # Add the average of all these faces normals as a projectionVec averageVec = Vector((0.0, 0.0, 0.0)) - if USER_AREA_WEIGHT: + if user_area_weight == 0.0: + for fprop in newProjectMeshFaces: + averageVec += fprop.no + elif user_area_weight == 1.0: for fprop in newProjectMeshFaces: - averageVec += (fprop.no * fprop.area) + averageVec += fprop.no * fprop.area else: for fprop in newProjectMeshFaces: - averageVec += fprop.no + averageVec += fprop.no * ((fprop.area * user_area_weight) + (1.0 - user_area_weight)) if averageVec.x != 0 or averageVec.y != 0 or averageVec.z != 0: # Avoid NAN projectVecs.append(averageVec.normalized()) @@ -1062,7 +1070,7 @@ def main(context, island_margin, projection_limit): f_uv = f.uv for j, v in enumerate(f.v): # XXX - note, between mathutils in 2.4 and 2.5 the order changed. - f_uv[j][:] = (v.co * MatQuat)[:2] + f_uv[j][:] = (v.co * MatQuat).xy if USER_SHARE_SPACE: @@ -1098,12 +1106,8 @@ def main(context, island_margin, projection_limit): """ pup_block = [\ 'Projection',\ -* ('Angle Limit:', USER_PROJECTION_LIMIT, 1, 89, ''),\ ('Selected Faces Only', USER_ONLY_SELECTED_FACES, 'Use only selected faces from all selected meshes.'),\ ('Init from view', USER_VIEW_INIT, 'The first projection will be from the view vector.'),\ - ('Area Weight', USER_AREA_WEIGHT, 'Weight projections vector by face area.'),\ - '',\ - '',\ '',\ 'UV Layout',\ ('Share Tex Space', USER_SHARE_SPACE, 'Objects Share texture space, map all objects into 1 uvmap.'),\ @@ -1125,11 +1129,15 @@ class SmartProject(bpy.types.Operator): bl_options = {'REGISTER', 'UNDO'} angle_limit = FloatProperty(name="Angle Limit", - description="lower for more projection groups, higher for less distortion.", + description="lower for more projection groups, higher for less distortion", default=66.0, min=1.0, max=89.0) island_margin = FloatProperty(name="Island Margin", - description="Margin to reduce bleed from adjacent islands.", + description="Margin to reduce bleed from adjacent islands", + default=0.0, min=0.0, max=1.0) + + user_area_weight = FloatProperty(name="Area Weight", + description="Weight projections vector by faces with larger areas", default=0.0, min=0.0, max=1.0) @classmethod @@ -1137,7 +1145,11 @@ class SmartProject(bpy.types.Operator): return context.active_object != None def execute(self, context): - main(context, self.island_margin, self.angle_limit) + main(context, + self.island_margin, + self.angle_limit, + self.user_area_weight, + ) return {'FINISHED'} def invoke(self, context, event): diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 629a48d5750..af33e45668c 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -19,7 +19,9 @@ # <pep8 compliant> import bpy -from bpy.props import StringProperty, BoolProperty, IntProperty, FloatProperty +from bpy.props import StringProperty, BoolProperty, IntProperty, \ + FloatProperty, EnumProperty + from rna_prop_ui import rna_idprop_ui_prop_get, rna_idprop_ui_prop_clear @@ -457,6 +459,66 @@ doc_id = StringProperty(name="Doc ID", doc_new = StringProperty(name="Edit Description", description="", maxlen=1024, default="") +data_path_iter = StringProperty( + description="The data path relative to the context, must point to an iterable.") + +data_path_item = StringProperty( + description="The data path from each iterable to the value (int or float)") + + +class WM_OT_context_collection_boolean_set(bpy.types.Operator): + '''Set boolean values for a collection of items''' + bl_idname = "wm.context_collection_boolean_set" + bl_label = "Context Collection Boolean Set" + bl_options = {'UNDO', 'REGISTER', 'INTERNAL'} + + data_path_iter = data_path_iter + data_path_item = data_path_item + + type = EnumProperty(items=( + ('TOGGLE', "Toggle", ""), + ('ENABLE', "Enable", ""), + ('DISABLE', "Disable", ""), + ), + name="Type") + + def execute(self, context): + data_path_iter = self.data_path_iter + data_path_item = self.data_path_item + + items = list(getattr(context, data_path_iter)) + items_ok = [] + is_set = False + for item in items: + try: + value_orig = eval("item." + data_path_item) + except: + continue + + if value_orig == True: + is_set = True + elif value_orig == False: + pass + else: + self.report({'WARNING'}, "Non boolean value found: %s[ ].%s" % + (data_path_iter, data_path_item)) + return {'CANCELLED'} + + items_ok.append(item) + + if self.type == 'ENABLE': + is_set = True + elif self.type == 'DISABLE': + is_set = False + else: + is_set = not is_set + + exec_str = "item.%s = %s" % (data_path_item, is_set) + for item in items_ok: + exec(exec_str) + + return {'FINISHED'} + class WM_OT_context_modal_mouse(bpy.types.Operator): '''Adjust arbitrary values with mouse input''' @@ -464,8 +526,9 @@ class WM_OT_context_modal_mouse(bpy.types.Operator): bl_label = "Context Modal Mouse" bl_options = {'GRAB_POINTER', 'BLOCKING', 'INTERNAL'} - data_path_iter = StringProperty(description="The data path relative to the context, must point to an iterable.") - data_path_item = StringProperty(description="The data path from each iterable to the value (int or float)") + data_path_iter = data_path_iter + data_path_item = data_path_item + input_scale = FloatProperty(default=0.01, description="Scale the mouse movement by this value before applying the delta") invert = BoolProperty(default=False, description="Invert the mouse input") initial_x = IntProperty(options={'HIDDEN'}) diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py index 7d4b78396bd..4c92296dacd 100644 --- a/release/scripts/startup/bl_ui/properties_particle.py +++ b/release/scripts/startup/bl_ui/properties_particle.py @@ -878,7 +878,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel): col.prop(part, "billboard_tilt_random", text="Random", slider=True) col = row.column() col.prop(part, "billboard_offset") - + row = layout.row() col = row.column() col.prop(part, "billboard_size", text="Scale") diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 9f69ca17076..b1322d453fc 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -616,10 +616,9 @@ class IMAGE_PT_view_properties(bpy.types.Panel): split = layout.split() col = split.column() + col.prop(uvedit, "show_faces") col.prop(uvedit, "show_smooth_edges", text="Smooth") col.prop(uvedit, "show_modified_edges", text="Modified") - #col.prop(uvedit, "show_edges") - #col.prop(uvedit, "show_faces") col = split.column() col.prop(uvedit, "show_stretch", text="Stretch") diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index b9ac740eb5b..c598788006c 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -876,6 +876,19 @@ class USERPREF_PT_addons(bpy.types.Panel): def module_get(mod_name): return USERPREF_PT_addons._addons_fake_modules[mod_name] + @staticmethod + def is_user_addon(mod, user_addon_paths): + if not user_addon_paths: + user_script_path = bpy.utils.user_script_path() + if user_script_path is not None: + user_addon_paths.append(os.path.join(user_script_path(), "addons")) + user_addon_paths.append(os.path.join(bpy.utils.resource_path('USER'), "scripts", "addons")) + + for path in user_addon_paths: + if bpy.path.is_subdir(mod.__file__, path): + return True + return False + def draw(self, context): layout = self.layout @@ -900,6 +913,9 @@ class USERPREF_PT_addons(bpy.types.Panel): search = context.window_manager.addon_search.lower() support = context.window_manager.addon_support + # initialized on demand + user_addon_paths = [] + for mod, info in addons: module_name = mod.__name__ @@ -969,20 +985,24 @@ class USERPREF_PT_addons(bpy.types.Panel): split = colsub.row().split(percentage=0.15) split.label(text="Warning:") split.label(text=' ' + info["warning"], icon='ERROR') - if info["wiki_url"] or info["tracker_url"]: + + user_addon = __class__.is_user_addon(mod, user_addon_paths) + tot_row = bool(info["wiki_url"]) + bool(info["tracker_url"]) + bool(user_addon) + + if tot_row: split = colsub.row().split(percentage=0.15) split.label(text="Internet:") if info["wiki_url"]: split.operator("wm.url_open", text="Link to the Wiki", icon='HELP').url = info["wiki_url"] if info["tracker_url"]: split.operator("wm.url_open", text="Report a Bug", icon='URL').url = info["tracker_url"] + if user_addon: + split.operator("wm.addon_remove", text="Remove", icon='CANCEL').module = mod.__name__ - if info["wiki_url"] and info["tracker_url"]: - split.separator() - else: - split.separator() + for i in range(4 - tot_row): split.separator() + # Append missing scripts # First collect scripts that are used but have no script file. module_names = {mod.__name__ for mod, info in addons} @@ -1186,6 +1206,54 @@ class WM_OT_addon_install(bpy.types.Operator): return {'RUNNING_MODAL'} +class WM_OT_addon_remove(bpy.types.Operator): + "Disable an addon" + bl_idname = "wm.addon_remove" + bl_label = "Remove Add-On" + + module = StringProperty(name="Module", description="Module name of the addon to remove") + + @staticmethod + def path_from_addon(module): + for mod in addon_utils.modules(USERPREF_PT_addons._addons_fake_modules): + if mod.__name__ == module: + filepath = mod.__file__ + if os.path.exists(filepath): + if os.path.splitext(os.path.basename(filepath))[0] == "__init__": + return os.path.dirname(filepath), True + else: + return filepath, False + return None, False + + def execute(self, context): + path, isdir = __class__.path_from_addon(self.module) + if path is None: + self.report('WARNING', "Addon path %r could not be found" % path) + return {'CANCELLED'} + + # incase its enabled + addon_utils.disable(self.module) + + import shutil + if isdir: + shutil.rmtree(path) + else: + os.remove(path) + + context.area.tag_redraw() + return {'FINISHED'} + + # lame confirmation check + def draw(self, context): + self.layout.label(text="Remove Addon: %r?" % self.module) + path, isdir = __class__.path_from_addon(self.module) + self.layout.label(text="Path: %r" % path) + + def invoke(self, context, event): + wm = context.window_manager + return wm.invoke_props_dialog(self, width=600) + + class WM_OT_addon_expand(bpy.types.Operator): "Display more information on this add-on" bl_idname = "wm.addon_expand" diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index b989085939f..2b58f2a216f 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -1252,7 +1252,7 @@ class VIEW3D_MT_pose(bpy.types.Menu): layout.separator() layout.menu("VIEW3D_MT_pose_showhide") - layout.operator_menu_enum("pose.flags_set", 'mode', text="Bone Settings") + layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings") class VIEW3D_MT_pose_transform(bpy.types.Menu): @@ -1373,6 +1373,49 @@ class VIEW3D_MT_pose_apply(bpy.types.Menu): layout.operator("pose.visual_transform_apply") +class BoneOptions: + def draw(self, context): + layout = self.layout + + options = [ + "show_wire", + "use_deform", + "use_envelope_multiply", + "use_inherit_rotation", + "use_inherit_scale", + ] + + if context.mode == 'EDIT_ARMATURE': + bone_props = bpy.types.EditBone.bl_rna.properties + data_path_iter = "selected_bones" + opt_suffix = "" + options.append("lock") + else: # posemode + bone_props = bpy.types.Bone.bl_rna.properties + data_path_iter = "selected_pose_bones" + opt_suffix = "bone." + + for opt in options: + props = layout.operator("wm.context_collection_boolean_set", text=bone_props[opt].name) + props.data_path_iter = data_path_iter + props.data_path_item = opt_suffix + opt + props.type = self.type + + +class VIEW3D_MT_bone_options_toggle(bpy.types.Menu, BoneOptions): + bl_label = "Toggle Bone Options" + type = 'TOGGLE' + + +class VIEW3D_MT_bone_options_enable(bpy.types.Menu, BoneOptions): + bl_label = "Enable Bone Options" + type = 'ENABLE' + + +class VIEW3D_MT_bone_options_disable(bpy.types.Menu, BoneOptions): + bl_label = "Disable Bone Options" + type = 'DISABLE' + # ********** Edit Menus, suffix from ob.type ********** @@ -1966,7 +2009,7 @@ class VIEW3D_MT_edit_armature(bpy.types.Menu): layout.separator() - layout.operator_menu_enum("armature.flags_set", "mode", text="Bone Settings") + layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings") class VIEW3D_MT_armature_specials(bpy.types.Menu): diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 7c11f9e964e..25fb6f9f9ff 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -51,7 +51,7 @@ extern "C" { /* used by packaging tools */ /* can be left blank, otherwise a,b,c... etc with no quotes */ -#define BLENDER_VERSION_CHAR +#define BLENDER_VERSION_CHAR a /* alpha/beta/rc/release, docs use this */ #define BLENDER_VERSION_CYCLE release diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index 4b532362cd8..8b0cfb1d156 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -63,6 +63,7 @@ #include "BKE_library.h" #include "BKE_main.h" #include "BKE_object.h" +#include "BKE_deform.h" #include "RNA_access.h" @@ -1005,7 +1006,7 @@ static float *get_weights_array(Object *ob, char *vgroup) MDeformVert *dvert= NULL; EditMesh *em= NULL; EditVert *eve; - int totvert= 0, index= 0; + int totvert= 0, defgrp_index= 0; /* no vgroup string set? */ if(vgroup[0]==0) return NULL; @@ -1028,10 +1029,10 @@ static float *get_weights_array(Object *ob, char *vgroup) if(dvert==NULL) return NULL; /* find the group (weak loop-in-loop) */ - index= defgroup_name_index(ob, vgroup); - if(index >= 0) { + defgrp_index= defgroup_name_index(ob, vgroup); + if(defgrp_index >= 0) { float *weights; - int i, j; + int i; weights= MEM_callocN(totvert*sizeof(float), "weights"); @@ -1040,23 +1041,13 @@ static float *get_weights_array(Object *ob, char *vgroup) dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); if(dvert) { - for(j=0; j<dvert->totweight; j++) { - if(dvert->dw[j].def_nr == index) { - weights[i]= dvert->dw[j].weight; - break; - } - } + weights[i]= defvert_find_weight(dvert, defgrp_index); } } } else { for(i=0; i < totvert; i++, dvert++) { - for(j=0; j<dvert->totweight; j++) { - if(dvert->dw[j].def_nr == index) { - weights[i]= dvert->dw[j].weight; - break; - } - } + weights[i]= defvert_find_weight(dvert, defgrp_index); } } diff --git a/source/blender/collada/EffectExporter.cpp b/source/blender/collada/EffectExporter.cpp index 0bbf714137e..74756859d3b 100644 --- a/source/blender/collada/EffectExporter.cpp +++ b/source/blender/collada/EffectExporter.cpp @@ -273,7 +273,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob) std::string uvname = strlen(t->uvname) ? t->uvname : active_uv; // color - if (t->mapto & MAP_COL | MAP_COLSPEC) { + if (t->mapto & (MAP_COL | MAP_COLSPEC)) { ep.setDiffuse(createTexture(ima, uvname, sampler)); } // ambient diff --git a/source/blender/editors/armature/armature_intern.h b/source/blender/editors/armature/armature_intern.h index 82decf8d1cf..85da7a212c9 100644 --- a/source/blender/editors/armature/armature_intern.h +++ b/source/blender/editors/armature/armature_intern.h @@ -79,8 +79,6 @@ void ARMATURE_OT_separate(struct wmOperatorType *ot); void ARMATURE_OT_autoside_names(struct wmOperatorType *ot); void ARMATURE_OT_flip_names(struct wmOperatorType *ot); -void ARMATURE_OT_flags_set(struct wmOperatorType *ot); - void ARMATURE_OT_layers_show_all(struct wmOperatorType *ot); void ARMATURE_OT_armature_layers(struct wmOperatorType *ot); void ARMATURE_OT_bone_layers(struct wmOperatorType *ot); @@ -125,8 +123,6 @@ void POSE_OT_flip_names(struct wmOperatorType *ot); void POSE_OT_quaternions_flip(struct wmOperatorType *ot); -void POSE_OT_flags_set(struct wmOperatorType *ot); - void POSE_OT_armature_layers(struct wmOperatorType *ot); void POSE_OT_bone_layers(struct wmOperatorType *ot); diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c index 545cff82483..16b748737ca 100644 --- a/source/blender/editors/armature/armature_ops.c +++ b/source/blender/editors/armature/armature_ops.c @@ -85,8 +85,6 @@ void ED_operatortypes_armature(void) WM_operatortype_append(ARMATURE_OT_autoside_names); WM_operatortype_append(ARMATURE_OT_flip_names); - WM_operatortype_append(ARMATURE_OT_flags_set); - WM_operatortype_append(ARMATURE_OT_layers_show_all); WM_operatortype_append(ARMATURE_OT_armature_layers); WM_operatortype_append(ARMATURE_OT_bone_layers); @@ -141,8 +139,6 @@ void ED_operatortypes_armature(void) WM_operatortype_append(POSE_OT_quaternions_flip); - WM_operatortype_append(POSE_OT_flags_set); - WM_operatortype_append(POSE_OT_armature_layers); WM_operatortype_append(POSE_OT_bone_layers); @@ -268,12 +264,9 @@ void ED_keymap_armature(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "ARMATURE_OT_separate", PKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); /* set flags */ - kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_flags_set", WKEY, KM_PRESS, KM_SHIFT, 0); - RNA_enum_set(kmi->ptr, "mode", 2); // toggle - kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_flags_set", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); - RNA_enum_set(kmi->ptr, "mode", 1); // enable - kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_flags_set", WKEY, KM_PRESS, KM_ALT, 0); - RNA_enum_set(kmi->ptr, "mode", 0); // clear + WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_toggle", WKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_enable", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); + WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_disable", WKEY, KM_PRESS, KM_ALT, 0); /* armature/bone layers */ WM_keymap_add_item(keymap, "ARMATURE_OT_layers_show_all", ACCENTGRAVEKEY, KM_PRESS, KM_CTRL, 0); @@ -349,13 +342,10 @@ void ED_keymap_armature(wmKeyConfig *keyconf) WM_keymap_add_menu(keymap, "VIEW3D_MT_pose_group", GKEY, KM_PRESS, KM_CTRL, 0); /* set flags */ - kmi= WM_keymap_add_item(keymap, "POSE_OT_flags_set", WKEY, KM_PRESS, KM_SHIFT, 0); - RNA_enum_set(kmi->ptr, "mode", 2); // toggle - kmi= WM_keymap_add_item(keymap, "POSE_OT_flags_set", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); - RNA_enum_set(kmi->ptr, "mode", 1); // enable - kmi= WM_keymap_add_item(keymap, "POSE_OT_flags_set", WKEY, KM_PRESS, KM_ALT, 0); - RNA_enum_set(kmi->ptr, "mode", 0); // clear - + WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_toggle", WKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_enable", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); + WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_disable", WKEY, KM_PRESS, KM_ALT, 0); + /* armature/bone layers */ WM_keymap_add_item(keymap, "ARMATURE_OT_layers_show_all", ACCENTGRAVEKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "POSE_OT_armature_layers", MKEY, KM_PRESS, KM_SHIFT, 0); diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index abf08393544..20352206121 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -1352,30 +1352,6 @@ static void *get_nearest_bone (bContext *C, short findunsel, int x, int y) return NULL; } -/* helper for setflag_sel_bone() */ -static void bone_setflag (int *bone, int flag, short mode) -{ - if (bone && flag) { - /* exception for inverse flags */ - if (flag == BONE_NO_DEFORM) { - if (mode == 2) - *bone |= flag; - else if (mode == 1) - *bone &= ~flag; - else - *bone ^= flag; - } - else { - if (mode == 2) - *bone &= ~flag; - else if (mode == 1) - *bone |= flag; - else - *bone ^= flag; - } - } -} - /* Get the first available child of an editbone */ static EditBone *editbone_get_child(bArmature *arm, EditBone *pabone, short use_visibility) { @@ -1396,105 +1372,6 @@ static EditBone *editbone_get_child(bArmature *arm, EditBone *pabone, short use_ return chbone; } -/* callback for posemode setflag */ -static int pose_setflag_exec (bContext *C, wmOperator *op) -{ - int flag= RNA_enum_get(op->ptr, "type"); - int mode= RNA_enum_get(op->ptr, "mode"); - - /* loop over all selected pchans */ - CTX_DATA_BEGIN(C, bPoseChannel *, pchan, selected_pose_bones) - { - bone_setflag(&pchan->bone->flag, flag, mode); - } - CTX_DATA_END; - - /* note, notifier might evolve */ - WM_event_add_notifier(C, NC_OBJECT|ND_POSE, ED_object_pose_armature(CTX_data_active_object(C))); - - return OPERATOR_FINISHED; -} - -/* callback for editbones setflag */ -static int armature_bones_setflag_exec (bContext *C, wmOperator *op) -{ - int flag= RNA_enum_get(op->ptr, "type"); - int mode= RNA_enum_get(op->ptr, "mode"); - - /* loop over all selected pchans */ - CTX_DATA_BEGIN(C, EditBone *, ebone, selected_bones) - { - bone_setflag(&ebone->flag, flag, mode); - } - CTX_DATA_END; - - /* note, notifier might evolve */ - WM_event_add_notifier(C, NC_OBJECT|ND_POSE, CTX_data_edit_object(C)); - - return OPERATOR_FINISHED; -} - -/* settings that can be changed */ -static EnumPropertyItem prop_bone_setting_types[] = { - {BONE_DRAWWIRE, "DRAWWIRE", 0, "Draw Wire", ""}, - {BONE_NO_DEFORM, "DEFORM", 0, "Deform", ""}, - {BONE_MULT_VG_ENV, "MULT_VG", 0, "Multiply Vertex Groups", ""}, - {BONE_HINGE, "HINGE", 0, "Hinge", ""}, - {BONE_NO_SCALE, "NO_SCALE", 0, "No Scale", ""}, - {BONE_EDITMODE_LOCKED, "LOCKED", 0, "Locked", "(For EditMode only)"}, - {0, NULL, 0, NULL, NULL} -}; - -/* ways that settings can be changed */ -static EnumPropertyItem prop_bone_setting_modes[] = { - {0, "CLEAR", 0, "Clear", ""}, - {1, "ENABLE", 0, "Enable", ""}, - {2, "TOGGLE", 0, "Toggle", ""}, - {0, NULL, 0, NULL, NULL} -}; - - -void ARMATURE_OT_flags_set (wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Set Bone Flags"; - ot->idname= "ARMATURE_OT_flags_set"; - ot->description= "Set flags for armature bones"; - - /* callbacks */ - ot->invoke= WM_menu_invoke; - ot->exec= armature_bones_setflag_exec; - ot->poll= ED_operator_editarmature; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - - /* properties */ - ot->prop= RNA_def_enum(ot->srna, "type", prop_bone_setting_types, 0, "Type", ""); - RNA_def_enum(ot->srna, "mode", prop_bone_setting_modes, 0, "Mode", ""); -} - -void POSE_OT_flags_set (wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Set Bone Flags"; - ot->idname= "POSE_OT_flags_set"; - ot->description= "Set flags for armature bones"; - - /* callbacks */ - ot->invoke= WM_menu_invoke; - ot->exec= pose_setflag_exec; - ot->poll= ED_operator_posemode; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - - /* properties */ - ot->prop= RNA_def_enum(ot->srna, "type", prop_bone_setting_types, 0, "Type", ""); - RNA_def_enum(ot->srna, "mode", prop_bone_setting_modes, 0, "Mode", ""); -} - - /* **************** END PoseMode & EditMode *************************** */ /* **************** Posemode stuff ********************** */ diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index c7f11116834..97299a6a766 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -142,13 +142,13 @@ void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float r static void round_box_shade_col(float *col1, float *col2, float fac) { - float col[3]; + float col[4]; col[0]= (fac*col1[0] + (1.0f-fac)*col2[0]); col[1]= (fac*col1[1] + (1.0f-fac)*col2[1]); col[2]= (fac*col1[2] + (1.0f-fac)*col2[2]); - - glColor3fv(col); + col[3]= (fac*col1[3] + (1.0f-fac)*col2[3]); + glColor4fv(col); } @@ -159,7 +159,7 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293}, {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; float div= maxy-miny; - float coltop[3], coldown[3], color[4]; + float coltop[4], coldown[4], color[4]; int a; /* mult */ @@ -173,9 +173,11 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl coltop[0]= color[0]+shadetop; if(coltop[0]>1.0f) coltop[0]= 1.0f; coltop[1]= color[1]+shadetop; if(coltop[1]>1.0f) coltop[1]= 1.0f; coltop[2]= color[2]+shadetop; if(coltop[2]>1.0f) coltop[2]= 1.0f; + coltop[3]= color[3]; coldown[0]= color[0]+shadedown; if(coldown[0]<0.0f) coldown[0]= 0.0f; coldown[1]= color[1]+shadedown; if(coldown[1]<0.0f) coldown[1]= 0.0f; coldown[2]= color[2]+shadedown; if(coldown[2]<0.0f) coldown[2]= 0.0f; + coldown[3]= color[3]; glShadeModel(GL_SMOOTH); glBegin(mode); diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index b6e255b6758..25a64994f5c 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -180,7 +180,7 @@ void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y glEnable(GL_BLEND); glGetFloatv(GL_CURRENT_COLOR, color); - color[3]= 0.125; + color[3]*= 0.125; glColor4fv(color); /* for each AA step */ diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 527b97a6082..29a740affc5 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1689,7 +1689,7 @@ void OBJECT_OT_shade_flat(wmOperatorType *ot) { /* identifiers */ ot->name= "Shade Flat"; - ot->description= "Display faces 'smooth' (using vertext normals)"; + ot->description= "Display faces 'flat'"; ot->idname= "OBJECT_OT_shade_flat"; /* api callbacks */ @@ -1704,7 +1704,7 @@ void OBJECT_OT_shade_smooth(wmOperatorType *ot) { /* identifiers */ ot->name= "Shade Smooth"; - ot->description= "Display faces 'flat'"; + ot->description= "Display faces 'smooth' (using vertex normals)"; ot->idname= "OBJECT_OT_shade_smooth"; /* api callbacks */ diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c index 2d547da41f6..bb32869469a 100644 --- a/source/blender/editors/object/object_hook.c +++ b/source/blender/editors/object/object_hook.c @@ -56,6 +56,7 @@ #include "BKE_object.h" #include "BKE_report.h" #include "BKE_scene.h" +#include "BKE_deform.h" #include "RNA_define.h" #include "RNA_access.h" @@ -85,7 +86,7 @@ static int return_editmesh_indexar(EditMesh *em, int *tot, int **indexar, float *indexar= index= MEM_mallocN(4*totvert, "hook indexar"); *tot= totvert; nr= 0; - cent[0]= cent[1]= cent[2]= 0.0; + zero_v3(cent); for(eve= em->verts.first; eve; eve= eve->next) { if(eve->f & SELECT) { @@ -102,30 +103,29 @@ static int return_editmesh_indexar(EditMesh *em, int *tot, int **indexar, float static int return_editmesh_vgroup(Object *obedit, EditMesh *em, char *name, float *cent) { - MDeformVert *dvert; - EditVert *eve; - int i, totvert=0; - - cent[0]= cent[1]= cent[2]= 0.0; - + zero_v3(cent); + if(obedit->actdef) { - + const int defgrp_index= obedit->actdef-1; + int totvert=0; + + MDeformVert *dvert; + EditVert *eve; + /* find the vertices */ for(eve= em->verts.first; eve; eve= eve->next) { dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); if(dvert) { - for(i=0; i<dvert->totweight; i++){ - if(dvert->dw[i].def_nr == (obedit->actdef-1)) { - totvert++; - add_v3_v3(cent, eve->co); - } + if(defvert_find_weight(dvert, defgrp_index) > 0.0f) { + add_v3_v3(cent, eve->co); + totvert++; } } } if(totvert) { - bDeformGroup *defGroup = BLI_findlink(&obedit->defbase, obedit->actdef-1); - strcpy(name, defGroup->name); + bDeformGroup *dg = BLI_findlink(&obedit->defbase, defgrp_index); + BLI_strncpy(name, dg->name, sizeof(dg->name)); mul_v3_fl(cent, 1.0f/(float)totvert); return 1; } diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index aa2e6d2c145..f3b67867d7f 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -446,6 +446,7 @@ static int parent_clear_exec(bContext *C, wmOperator *op) DAG_scene_sort(bmain, scene); DAG_ids_flush_update(bmain, 0); WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); + WM_event_add_notifier(C, NC_OBJECT|ND_PARENT, NULL); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index d4de1386871..42a163d3da5 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -189,11 +189,6 @@ void image_buffer_rect_update(Scene *scene, RenderResult *rr, ImBuf *ibuf, volat /* set callbacks, exported to sequence render too. Only call in foreground (UI) renders. */ -static void render_error_reports(void *reports, const char *str) -{ - BKE_report(reports, RPT_ERROR, str); -} - /* executes blocking render */ static int screen_render_exec(bContext *C, wmOperator *op) { @@ -214,7 +209,6 @@ static int screen_render_exec(bContext *C, wmOperator *op) G.afbreek= 0; RE_test_break_cb(re, NULL, (int (*)(void *)) blender_test_break); - RE_error_cb(re, op->reports, render_error_reports); ima= BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result"); BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE); @@ -226,11 +220,15 @@ static int screen_render_exec(bContext *C, wmOperator *op) since sequence rendering can call that recursively... (peter) */ seq_stripelem_cache_cleanup(); + RE_SetReports(re, op->reports); + if(is_animation) - RE_BlenderAnim(re, mainp, scene, camera_override, lay, scene->r.sfra, scene->r.efra, scene->r.frame_step, op->reports); + RE_BlenderAnim(re, mainp, scene, camera_override, lay, scene->r.sfra, scene->r.efra, scene->r.frame_step); else RE_BlenderFrame(re, mainp, scene, NULL, camera_override, lay, scene->r.cfra, is_write_still); + RE_SetReports(re, NULL); + // no redraw needed, we leave state as we entered it ED_update_for_newframe(mainp, scene, CTX_wm_screen(C), 1); @@ -374,10 +372,14 @@ static void render_startjob(void *rjv, short *stop, short *do_update, float *pro rj->do_update= do_update; rj->progress= progress; + RE_SetReports(rj->re, rj->reports); + if(rj->anim) - RE_BlenderAnim(rj->re, rj->main, rj->scene, rj->camera_override, rj->lay, rj->scene->r.sfra, rj->scene->r.efra, rj->scene->r.frame_step, rj->reports); + RE_BlenderAnim(rj->re, rj->main, rj->scene, rj->camera_override, rj->lay, rj->scene->r.sfra, rj->scene->r.efra, rj->scene->r.frame_step); else RE_BlenderFrame(rj->re, rj->main, rj->scene, rj->srl, rj->camera_override, rj->lay, rj->scene->r.cfra, rj->write_still); + + RE_SetReports(rj->re, NULL); } static void render_endjob(void *rjv) @@ -470,7 +472,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) if(WM_jobs_test(CTX_wm_manager(C), scene)) return OPERATOR_CANCELLED; - if(!RE_is_rendering_allowed(scene, camera_override, op->reports, render_error_reports)) { + if(!RE_is_rendering_allowed(scene, camera_override, op->reports)) { return OPERATOR_CANCELLED; } @@ -578,8 +580,6 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) rj->re= re; G.afbreek= 0; - RE_error_cb(re, op->reports, render_error_reports); - WM_jobs_start(CTX_wm_manager(C), steve); WM_cursor_wait(0); @@ -596,7 +596,6 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } - /* contextual render, using current scene, view3d? */ void RENDER_OT_render(wmOperatorType *ot) { diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 4d531e78ec0..82986dfbcc4 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -188,17 +188,12 @@ static void area_draw_azone(short x1, short y1, short x2, short y2) } -static void region_draw_azone(AZone *az) +static void region_draw_azone_icon(AZone *az) { GLUquadricObj *qobj = NULL; short midx = az->x1 + (az->x2 - az->x1)/2; short midy = az->y1 + (az->y2 - az->y1)/2; - - if(az->ar==NULL) return; - - /* only display action zone icons when the region is hidden */ - if (!(az->ar->flag & RGN_FLAG_HIDDEN)) return; - + qobj = gluNewQuadric(); glPushMatrix(); @@ -227,6 +222,79 @@ static void region_draw_azone(AZone *az) sdrawline(midx-2, midy, midx+3, midy); } +static void region_draw_azone_tab(AZone *az) +{ + float col[3]; + + glEnable(GL_BLEND); + UI_GetThemeColor3fv(TH_HEADER, col); + glColor4f(col[0], col[1], col[2], 0.5f); + + /* add code to draw region hidden as 'too small' */ + switch(az->edge) { + case AE_TOP_TO_BOTTOMRIGHT: + uiSetRoundBox(3 + 16); + + uiDrawBoxShade(GL_POLYGON, (float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f, -0.3f, 0.05f); + glColor4ub(0, 0, 0, 255); + uiRoundRect((float)az->x1, 0.3f+(float)az->y1, (float)az->x2, 0.3f+(float)az->y2, 4.0f); + break; + case AE_BOTTOM_TO_TOPLEFT: + uiSetRoundBox(12 + 16); + + uiDrawBoxShade(GL_POLYGON, (float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f, -0.3f, 0.05f); + glColor4ub(0, 0, 0, 255); + uiRoundRect((float)az->x1, 0.3f+(float)az->y1, (float)az->x2, 0.3f+(float)az->y2, 4.0f); + break; + case AE_LEFT_TO_TOPRIGHT: + uiSetRoundBox(9 + 16); + + uiDrawBoxShade(GL_POLYGON, (float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f, -0.3f, 0.05f); + glColor4ub(0, 0, 0, 255); + uiRoundRect((float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f); + break; + case AE_RIGHT_TO_TOPLEFT: + uiSetRoundBox(6 + 16); + + uiDrawBoxShade(GL_POLYGON, (float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f, -0.3f, 0.05f); + glColor4ub(0, 0, 0, 255); + uiRoundRect((float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f); + break; + } + + glDisable(GL_BLEND); +} + +static void region_draw_azone_tria(AZone *az) +{ + extern void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y3); /* xxx temp */ + + glEnable(GL_BLEND); + //UI_GetThemeColor3fv(TH_HEADER, col); + glColor4f(0.0f, 0.0f, 0.0f, 0.35f); + + /* add code to draw region hidden as 'too small' */ + switch(az->edge) { + case AE_TOP_TO_BOTTOMRIGHT: + ui_draw_anti_tria((float)az->x1, (float)az->y1, (float)az->x2, (float)az->y1, (float)(az->x1+az->x2)/2, (float)az->y2); + break; + + case AE_BOTTOM_TO_TOPLEFT: + ui_draw_anti_tria((float)az->x1, (float)az->y2, (float)az->x2, (float)az->y2, (float)(az->x1+az->x2)/2, (float)az->y1); + break; + + case AE_LEFT_TO_TOPRIGHT: + ui_draw_anti_tria((float)az->x2, (float)az->y1, (float)az->x2, (float)az->y2, (float)az->x1, (float)(az->y1+az->y2)/2); + break; + + case AE_RIGHT_TO_TOPLEFT: + ui_draw_anti_tria((float)az->x1, (float)az->y1, (float)az->x1, (float)az->y2, (float)az->x2, (float)(az->y1+az->y2)/2); + break; + + } + + glDisable(GL_BLEND); +} /* only exported for WM */ void ED_area_overdraw(bContext *C) @@ -248,7 +316,19 @@ void ED_area_overdraw(bContext *C) if(az->type==AZONE_AREA) { area_draw_azone(az->x1, az->y1, az->x2, az->y2); } else if(az->type==AZONE_REGION) { - region_draw_azone(az); + + if(az->ar) { + /* only display tab or icons when the region is hidden */ + if (az->ar->flag & (RGN_FLAG_HIDDEN|RGN_FLAG_TOO_SMALL)) { + + if(G.rt==2) + region_draw_azone_tria(az); + else if(G.rt==1) + region_draw_azone_tab(az); + else + region_draw_azone_icon(az); + } + } } az->do_draw= 0; @@ -579,6 +659,96 @@ static void region_azone_icon(ScrArea *sa, AZone *az, ARegion *ar) } } +#define AZONEPAD_TABW 18 +#define AZONEPAD_TABH 7 + +/* region already made zero sized, in shape of edge */ +static void region_azone_tab(ScrArea *sa, AZone *az, ARegion *ar) +{ + AZone *azt; + int tot= 0, add; + + for(azt= sa->actionzones.first; azt; azt= azt->next) { + if(azt->edge == az->edge) tot++; + } + + switch(az->edge) { + case AE_TOP_TO_BOTTOMRIGHT: + if(ar->winrct.ymax == sa->totrct.ymin) add= 1; else add= 0; + az->x1= ar->winrct.xmax - 2*AZONEPAD_TABW; + az->y1= ar->winrct.ymax - add; + az->x2= ar->winrct.xmax - AZONEPAD_TABW; + az->y2= ar->winrct.ymax - add + AZONEPAD_TABH; + break; + case AE_BOTTOM_TO_TOPLEFT: + az->x1= ar->winrct.xmin + AZONEPAD_TABW; + az->y1= ar->winrct.ymin - AZONEPAD_TABH; + az->x2= ar->winrct.xmin + 2*AZONEPAD_TABW; + az->y2= ar->winrct.ymin; + break; + case AE_LEFT_TO_TOPRIGHT: + az->x1= ar->winrct.xmin + 1 - AZONEPAD_TABH; + az->y1= ar->winrct.ymax - 2*AZONEPAD_TABW; + az->x2= ar->winrct.xmin + 1; + az->y2= ar->winrct.ymax - AZONEPAD_TABW; + break; + case AE_RIGHT_TO_TOPLEFT: + az->x1= ar->winrct.xmax - 1; + az->y1= ar->winrct.ymax - 2*AZONEPAD_TABW; + az->x2= ar->winrct.xmax - 1 + AZONEPAD_TABH; + az->y2= ar->winrct.ymax - AZONEPAD_TABW; + break; + } + /* rect needed for mouse pointer test */ + BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2); +} + +#define AZONEPAD_TRIAW 16 +#define AZONEPAD_TRIAH 9 + + +/* region already made zero sized, in shape of edge */ +static void region_azone_tria(ScrArea *sa, AZone *az, ARegion *ar) +{ + AZone *azt; + int tot= 0, add; + + for(azt= sa->actionzones.first; azt; azt= azt->next) { + if(azt->edge == az->edge) tot++; + } + + switch(az->edge) { + case AE_TOP_TO_BOTTOMRIGHT: + if(ar->winrct.ymax == sa->totrct.ymin) add= 1; else add= 0; + az->x1= ar->winrct.xmax - 2*AZONEPAD_TRIAW; + az->y1= ar->winrct.ymax - add; + az->x2= ar->winrct.xmax - AZONEPAD_TRIAW; + az->y2= ar->winrct.ymax - add + AZONEPAD_TRIAH; + break; + case AE_BOTTOM_TO_TOPLEFT: + az->x1= ar->winrct.xmin + AZONEPAD_TRIAW; + az->y1= ar->winrct.ymin - AZONEPAD_TRIAH; + az->x2= ar->winrct.xmin + 2*AZONEPAD_TRIAW; + az->y2= ar->winrct.ymin; + break; + case AE_LEFT_TO_TOPRIGHT: + az->x1= ar->winrct.xmin + 1 - AZONEPAD_TRIAH; + az->y1= ar->winrct.ymax - 2*AZONEPAD_TRIAW; + az->x2= ar->winrct.xmin + 1; + az->y2= ar->winrct.ymax - AZONEPAD_TRIAW; + break; + case AE_RIGHT_TO_TOPLEFT: + az->x1= ar->winrct.xmax - 1; + az->y1= ar->winrct.ymax - 2*AZONEPAD_TRIAW; + az->x2= ar->winrct.xmax - 1 + AZONEPAD_TRIAH; + az->y2= ar->winrct.ymax - AZONEPAD_TRIAW; + break; + } + /* rect needed for mouse pointer test */ + BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2); +} + + static void region_azone_initialize(ScrArea *sa, ARegion *ar, AZEdge edge) { AZone *az; @@ -589,8 +759,13 @@ static void region_azone_initialize(ScrArea *sa, ARegion *ar, AZEdge edge) az->ar= ar; az->edge= edge; - if (ar->flag & RGN_FLAG_HIDDEN) { - region_azone_icon(sa, az, ar); + if (ar->flag & (RGN_FLAG_HIDDEN|RGN_FLAG_TOO_SMALL)) { + if(G.rt==2) + region_azone_tria(sa, az, ar); + else if(G.rt==1) + region_azone_tab(sa, az, ar); + else + region_azone_icon(sa, az, ar); } else { region_azone_edge(az, ar); } @@ -790,15 +965,6 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int ar->winx= ar->winrct.xmax - ar->winrct.xmin + 1; ar->winy= ar->winrct.ymax - ar->winrct.ymin + 1; - /* restore test exception */ - if(ar->alignment & RGN_SPLIT_PREV) { - if(ar->prev) { - remainder= remainder_prev; - ar->prev->winx= ar->prev->winrct.xmax - ar->prev->winrct.xmin + 1; - ar->prev->winy= ar->prev->winrct.ymax - ar->prev->winrct.ymin + 1; - } - } - /* set winrect for azones */ if(ar->flag & (RGN_FLAG_HIDDEN|RGN_FLAG_TOO_SMALL)) { ar->winrct= *remainder; @@ -814,12 +980,22 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int else /* prevent winrct to be valid */ ar->winrct.xmax= ar->winrct.xmin; } + + /* restore prev-split exception */ + if(ar->alignment & RGN_SPLIT_PREV) { + if(ar->prev) { + remainder= remainder_prev; + ar->prev->winx= ar->prev->winrct.xmax - ar->prev->winrct.xmin + 1; + ar->prev->winy= ar->prev->winrct.ymax - ar->prev->winrct.ymin + 1; + } + } + /* in end, add azones, where appropriate */ if(ar->regiontype == RGN_TYPE_HEADER && ar->winy + 6 > sa->winy) { /* The logic for this is: when the header takes up the full area, * disallow hiding it to view the main window. * - * Without this, uou can drag down the file selectors header and hide it + * Without this, you can drag down the file selectors header and hide it * by accident very easily (highly annoying!), the value 6 is arbitrary * but accounts for small common rounding problems when scaling the UI, * must be minimum '4' */ @@ -833,7 +1009,7 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int static void area_calc_totrct(ScrArea *sa, int sizex, int sizey) { - short rt= CLAMPIS(G.rt, 0, 16); + short rt= 0; // CLAMPIS(G.rt, 0, 16); if(sa->v1->vec.x>0) sa->totrct.xmin= sa->v1->vec.x+1+rt; else sa->totrct.xmin= sa->v1->vec.x; diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 721ce823351..80a65d3224e 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -910,7 +910,7 @@ static void drawscredge_area(ScrArea *sa, int sizex, int sizey, int center) short y2= sa->v3->vec.y; short a, rt; - rt= CLAMPIS(G.rt, 0, 16); + rt= 0; // CLAMPIS(G.rt, 0, 16); if(center==0) { cpack(0x505050); diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 0210b0dd78d..e9ebe78da29 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -792,7 +792,9 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char uiItemR(col, userptr, "frame_offset", 0, NULL, ICON_NONE); col= uiLayoutColumn(split, 0); - uiItemR(col, userptr, "fields_per_frame", 0, "Fields", ICON_NONE); + row= uiLayoutRow(col, 0); + uiLayoutSetActive(row, RNA_boolean_get(&imaptr, "use_fields")); + uiItemR(row, userptr, "fields_per_frame", 0, "Fields", ICON_NONE); uiItemR(col, userptr, "use_auto_refresh", 0, NULL, ICON_NONE); uiItemR(col, userptr, "use_cyclic", 0, NULL, ICON_NONE); } diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 71dd7b02e1c..a6a60035aa7 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -2004,19 +2004,16 @@ static int node_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceNode *snode= CTX_wm_space_node(C); bNodeTree *ntree= snode->edittree; - bNode *node, *newnode, *last; + bNode *node, *newnode, *lastnode; + bNodeLink *link, *newlink, *lastlink; ED_preview_kill_jobs(C); - last = ntree->nodes.last; + lastnode = ntree->nodes.last; for(node= ntree->nodes.first; node; node= node->next) { if(node->flag & SELECT) { newnode = nodeCopyNode(ntree, node); - /* deselect old node, select the copy instead */ - node->flag &= ~(NODE_SELECT|NODE_ACTIVE); - newnode->flag |= NODE_SELECT; - if(newnode->id) { /* simple id user adjustment, node internal functions dont touch this * but operators and readfile.c do. */ @@ -2027,7 +2024,53 @@ static int node_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) } /* make sure we don't copy new nodes again! */ - if (node==last) + if (node==lastnode) + break; + } + + /* copy links between selected nodes + * NB: this depends on correct node->new_node and sock->new_sock pointers from above copy! + */ + lastlink = ntree->links.last; + for (link=ntree->links.first; link; link=link->next) { + /* this creates new links between copied nodes, + * as well as input links from unselected (when fromnode==NULL) ! + */ + if (link->tonode && (link->tonode->flag & NODE_SELECT)) { + newlink = MEM_callocN(sizeof(bNodeLink), "bNodeLink"); + newlink->flag = link->flag; + newlink->tonode = link->tonode->new_node; + newlink->tosock = link->tosock->new_sock; + if (link->fromnode && (link->fromnode->flag & NODE_SELECT)) { + newlink->fromnode = link->fromnode->new_node; + newlink->fromsock = link->fromsock->new_sock; + } + else { + /* input node not copied, this keeps the original input linked */ + newlink->fromnode = link->fromnode; + newlink->fromsock = link->fromsock; + } + + BLI_addtail(&ntree->links, newlink); + } + + /* make sure we don't copy new links again! */ + if (link==lastlink) + break; + } + + /* deselect old nodes, select the copies instead */ + for(node= ntree->nodes.first; node; node= node->next) { + if(node->flag & SELECT) { + /* has been set during copy above */ + newnode = node->new_node; + + node->flag &= ~(NODE_SELECT|NODE_ACTIVE); + newnode->flag |= NODE_SELECT; + } + + /* make sure we don't copy new nodes again! */ + if (node==lastnode) break; } diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 8d73da0063c..453bea0969b 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -474,7 +474,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) if(sima->flag & SI_DRAW_STRETCH) { draw_uvs_stretch(sima, scene, em, activetf); } - else if(me->drawflag & ME_DRAWFACES) { + else if(!(sima->flag & SI_NO_DRAWFACES)) { /* draw transparent faces */ UI_GetThemeColor4ubv(TH_FACE, col1); UI_GetThemeColor4ubv(TH_FACE_SELECT, col2); diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 0d843dedbaa..3715dbe192c 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -80,7 +80,7 @@ GPUBufferPool *GPU_buffer_pool_new(void) DEBUG_VBO("GPU_buffer_pool_new\n"); if( useVBOs < 0 ) { - if( GL_ARB_vertex_buffer_object ) { + if( GLEW_ARB_vertex_buffer_object ) { DEBUG_VBO( "Vertex Buffer Objects supported.\n" ); useVBOs = 1; } @@ -484,7 +484,7 @@ void *GPU_build_mesh_buffers(GHash *map, MVert *mvert, MFace *mface, for(i = 0, tottri = 0; i < totface; ++i) tottri += mface[face_indices[i]].v4 ? 2 : 1; - if(GL_ARB_vertex_buffer_object && !(U.gameflags & USER_DISABLE_VBO)) + if(GLEW_ARB_vertex_buffer_object && !(U.gameflags & USER_DISABLE_VBO)) glGenBuffersARB(1, &buffers->index_buf); if(buffers->index_buf) { @@ -615,7 +615,7 @@ void *GPU_build_grid_buffers(DMGridData **UNUSED(grids), int *UNUSED(grid_indice totquad= (gridsize-1)*(gridsize-1)*totgrid; /* Generate index buffer object */ - if(GL_ARB_vertex_buffer_object && !(U.gameflags & USER_DISABLE_VBO)) + if(GLEW_ARB_vertex_buffer_object && !(U.gameflags & USER_DISABLE_VBO)) glGenBuffersARB(1, &buffers->index_buf); if(buffers->index_buf) { diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 4ac712cf3c8..588ecfe3e37 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -754,7 +754,7 @@ enum FileSortTypeE { #define SI_EDITTILE (1<<1) #define SI_CLIP_UV (1<<2) #define SI_DRAWTOOL (1<<3) -#define SI_DEPRECATED1 (1<<4) /* stick UVs to others in the same location */ +#define SI_NO_DRAWFACES (1<<4) #define SI_DRAWSHADOW (1<<5) #define SI_SELACTFACE (1<<6) /* deprecated */ #define SI_DEPRECATED2 (1<<7) diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index e83161b8c62..d9fbdd7caf2 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -2839,7 +2839,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro } /* editable check */ - if(RNA_property_editable(&itemptr, iprop)) { + if(!set || RNA_property_editable(&itemptr, iprop)) { if(a+itemlen > in.len) { BKE_reportf(reports, RPT_ERROR, "Array length mismatch (got %d, expected more).", in.len); err= 1; diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index 6638a9d76d3..3a6cebef178 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -32,6 +32,7 @@ #include "DNA_scene_types.h" #include "RNA_define.h" +#include "RNA_enum_types.h" #include "rna_internal.h" @@ -271,6 +272,12 @@ static void rna_def_render_engine(BlenderRNA *brna) prop= RNA_def_string(func, "info", "", 0, "Info", ""); RNA_def_property_flag(prop, PROP_REQUIRED); + func= RNA_def_function(srna, "report", "RE_engine_report"); + prop= RNA_def_enum_flag(func, "type", wm_report_items, 0, "Type", ""); + RNA_def_property_flag(prop, PROP_REQUIRED); + prop= RNA_def_string(func, "message", "", 0, "Report Message", ""); + RNA_def_property_flag(prop, PROP_REQUIRED); + /* registration */ RNA_define_verify_sdna(0); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index cc6874a14aa..3e71a0e4811 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -990,7 +990,12 @@ static void rna_def_space_image_uv(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS); RNA_def_property_ui_text(prop, "Normalized Coordinates", "Display UV coordinates from 0.0 to 1.0 rather than in pixels"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); - + + prop= RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SI_NO_DRAWFACES); + RNA_def_property_ui_text(prop, "Draw Faces", "Draw faces over the image"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); + prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ); RNA_def_property_array(prop, 2); RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_cursor_location_get", "rna_SpaceImageEditor_cursor_location_set", NULL); diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c index 02845ecaab7..01f1b6fb2a7 100644 --- a/source/blender/modifiers/intern/MOD_displace.c +++ b/source/blender/modifiers/intern/MOD_displace.c @@ -172,6 +172,7 @@ static void displaceModifier_do( MDeformVert *dvert = NULL; int defgrp_index; float (*tex_co)[3]; + float weight= 1.0f; /* init value unused but some compilers may complain */ if(!dmd->texture) return; if(dmd->strength == 0.0f) return; @@ -189,17 +190,10 @@ static void displaceModifier_do( for(i = 0; i < numVerts; ++i) { TexResult texres; float delta = 0, strength = dmd->strength; - MDeformWeight *def_weight = NULL; if(dvert) { - int j; - for(j = 0; j < dvert[i].totweight; ++j) { - if(dvert[i].dw[j].def_nr == defgrp_index) { - def_weight = &dvert[i].dw[j]; - break; - } - } - if(!def_weight || def_weight->weight==0.0f) continue; + weight= defvert_find_weight(dvert + i, defgrp_index); + if(weight == 0.0f) continue; } texres.nor = NULL; @@ -207,7 +201,7 @@ static void displaceModifier_do( delta = texres.tin - dmd->midlevel; - if(def_weight) strength *= def_weight->weight; + if(dvert) strength *= weight; delta *= strength; CLAMP(delta, -10000, 10000); diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h index 23f301249ba..d9ed83a00b2 100644 --- a/source/blender/render/extern/include/RE_pipeline.h +++ b/source/blender/render/extern/include/RE_pipeline.h @@ -218,7 +218,10 @@ void RE_TileProcessor(struct Render *re); /* only RE_NewRender() needed, main Blender render calls */ void RE_BlenderFrame(struct Render *re, struct Main *bmain, struct Scene *scene, struct SceneRenderLayer *srl, struct Object *camera_override, unsigned int lay, int frame, const short write_still); -void RE_BlenderAnim(struct Render *re, struct Main *bmain, struct Scene *scene, struct Object *camera_override, unsigned int lay, int sfra, int efra, int tfra, struct ReportList *reports); +void RE_BlenderAnim(struct Render *re, struct Main *bmain, struct Scene *scene, struct Object *camera_override, unsigned int lay, int sfra, int efra, int tfra); + +/* error reporting */ +void RE_SetReports(struct Render *re, struct ReportList *reports); /* main preview render call */ void RE_PreviewRender(struct Render *re, struct Main *bmain, struct Scene *scene); @@ -242,7 +245,6 @@ void RE_stats_draw_cb (struct Render *re, void *handle, void (*f)(void *handle, void RE_progress_cb (struct Render *re, void *handle, void (*f)(void *handle, float)); void RE_draw_lock_cb (struct Render *re, void *handle, void (*f)(void *handle, int)); void RE_test_break_cb (struct Render *re, void *handle, int (*f)(void *handle)); -void RE_error_cb (struct Render *re, void *handle, void (*f)(void *handle, const char *str)); /* should move to kernel once... still unsure on how/where */ float RE_filter_value(int type, float x); @@ -264,7 +266,7 @@ void RE_zbuf_accumulate_vecblur(struct NodeBlurData *nbd, int xsize, int ysize, #define RE_BAKE_ALPHA 11 #define RE_BAKE_EMIT 12 -void RE_Database_Baking(struct Render *re, struct Main *bmain, struct Scene *scene, unsigned int lay, int type, struct Object *actob); +void RE_Database_Baking(struct Render *re, struct Main *bmain, struct Scene *scene, unsigned int lay, const int type, struct Object *actob); void RE_DataBase_GetView(struct Render *re, float mat[][4]); void RE_GetCameraWindow(struct Render *re, struct Object *camera, int frame, float mat[][4]); @@ -308,11 +310,12 @@ void RE_engine_end_result(RenderEngine *engine, struct RenderResult *result); int RE_engine_test_break(RenderEngine *engine); void RE_engine_update_stats(RenderEngine *engine, const char *stats, const char *info); +void RE_engine_report(RenderEngine *engine, int type, const char *msg); void RE_engines_init(void); void RE_engines_exit(void); -int RE_is_rendering_allowed(struct Scene *scene, struct Object *camera_override, void *erh, void (*error)(void *handle, const char *str)); +int RE_is_rendering_allowed(struct Scene *scene, struct Object *camera_override, struct ReportList *reports); #endif /* RE_PIPELINE_H */ diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index b2535ebc9ea..13ca40bfd20 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -60,6 +60,7 @@ struct RenderBuckets; struct ObjectInstanceRen; struct RayObject; struct RayFace; +struct ReportList; struct Main; #define TABLEINITSIZE 1024 @@ -252,10 +253,9 @@ struct Render int (*test_break)(void *handle); void *tbh; - void (*error)(void *handle, const char *str); - void *erh; - RenderStats i; + + struct ReportList *reports; }; /* ------------------------------------------------------------------------- */ diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index a4ac92d394c..2c9aa4dece5 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -5680,13 +5680,14 @@ void RE_Database_FromScene_Vectors(Render *re, Main *bmain, Scene *sce, unsigned RE_BAKE_DISPLACEMENT:for baking, no lamps, only selected objects RE_BAKE_SHADOW: for baking, only shadows, but all objects */ -void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay, int type, Object *actob) +void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay, const int type, Object *actob) { Object *camera; float mat[4][4]; float amb[3]; - int onlyselected, nolamps; - + const short onlyselected= !ELEM3(type, RE_BAKE_LIGHT, RE_BAKE_ALL, RE_BAKE_SHADOW); + const short nolamps= ELEM3(type, RE_BAKE_NORMALS, RE_BAKE_TEXTURE, RE_BAKE_DISPLACEMENT); + re->main= bmain; re->scene= scene; re->lay= lay; @@ -5736,7 +5737,15 @@ void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay, unit_m4(mat); RE_SetView(re, mat); } - + copy_m3_m4(re->imat, re->viewinv); + + /* TODO: deep shadow maps + baking + strands */ + /* strands use the window matrix and view size, there is to correct + * window matrix but at least avoids malloc and crash loop [#27807] */ + unit_m4(re->winmat); + re->winx= re->winy= 256; + /* done setting dummy values */ + init_render_world(re); /* do first, because of ambient. also requires re->osa set correct */ if(re->r.mode & R_RAYTRACE) { init_render_qmcsampler(re); @@ -5755,9 +5764,6 @@ void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay, set_node_shader_lamp_loop(shade_material_loop); /* MAKE RENDER DATA */ - nolamps= !ELEM3(type, RE_BAKE_LIGHT, RE_BAKE_ALL, RE_BAKE_SHADOW); - onlyselected= ELEM3(type, RE_BAKE_NORMALS, RE_BAKE_TEXTURE, RE_BAKE_DISPLACEMENT); - database_init_objects(re, lay, nolamps, onlyselected, actob, 0); set_material_lightgroups(re); diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c index cb08ae96bf7..6d264951204 100644 --- a/source/blender/render/intern/source/imagetexture.c +++ b/source/blender/render/intern/source/imagetexture.c @@ -76,7 +76,7 @@ extern struct Render R; /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -static void boxsample(ImBuf *ibuf, float minx, float miny, float maxx, float maxy, TexResult *texres, int imaprepeat, int imapextend); +static void boxsample(ImBuf *ibuf, float minx, float miny, float maxx, float maxy, TexResult *texres, const short imaprepeat, const short imapextend); /* *********** IMAGEWRAPPING ****************** */ @@ -115,6 +115,7 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, TexResult *texre { float fx, fy, val1, val2, val3; int x, y, retval; + int xi, yi; /* original values */ texres->tin= texres->ta= texres->tr= texres->tg= texres->tb= 0.0f; @@ -166,8 +167,8 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, TexResult *texre } } - x = (int)floorf(fx*ibuf->x); - y = (int)floorf(fy*ibuf->y); + x= xi= (int)floorf(fx*ibuf->x); + y= yi= (int)floorf(fy*ibuf->y); if(tex->extend == TEX_CLIPCUBE) { if(x<0 || y<0 || x>=ibuf->x || y>=ibuf->y || texvec[2]<-1.0f || texvec[2]>1.0f) { @@ -209,10 +210,17 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, TexResult *texre filterx = (0.5f * tex->filtersize) / ibuf->x; filtery = (0.5f * tex->filtersize) / ibuf->y; + /* important that this value is wrapped [#27782] + * this applies the modifications made by the checks above, + * back to the floating point values */ + fx -= (float)(xi - x) / (float)ibuf->x; + fy -= (float)(yi - y) / (float)ibuf->y; + boxsample(ibuf, fx-filterx, fy-filtery, fx+filterx, fy+filtery, texres, (tex->extend==TEX_REPEAT), (tex->extend==TEX_EXTEND)); } - else /* no filtering */ + else { /* no filtering */ ibuf_get_color(&texres->tr, ibuf, x, y); + } if( (R.flag & R_SEC_FIELD) && (ibuf->flags & IB_fields) ) { ibuf->rect-= (ibuf->x*ibuf->y); @@ -524,15 +532,17 @@ static void boxsampleclip(struct ImBuf *ibuf, rctf *rf, TexResult *texres) } } -static void boxsample(ImBuf *ibuf, float minx, float miny, float maxx, float maxy, TexResult *texres, int imaprepeat, int imapextend) +static void boxsample(ImBuf *ibuf, float minx, float miny, float maxx, float maxy, TexResult *texres, const short imaprepeat, const short imapextend) { /* Sample box, performs clip. minx etc are in range 0.0 - 1.0 . - * Enlarge with antialiased edges of pixels. - * If variable 'imaprepeat' has been set, the - * clipped-away parts are sampled as well. - */ + * Enlarge with antialiased edges of pixels. + * If variable 'imaprepeat' has been set, the + * clipped-away parts are sampled as well. + */ /* note: actually minx etc isnt in the proper range... this due to filter size and offset vectors for bump */ /* note: talpha must be initialized */ + /* note: even when 'imaprepeat' is set, this can only repeate once in any direction. + * the point which min/max is derived from is assumed to be wrapped */ TexResult texr; rctf *rf, stack[8]; float opp, tot, alphaclip= 1.0; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index b1c9820337c..1d4014aac3e 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -128,7 +128,7 @@ Render R; /* ********* alloc and free ******** */ -static int do_write_image_or_movie(Render *re, Scene *scene, bMovieHandle *mh, ReportList *reports, const char *name_override); +static int do_write_image_or_movie(Render *re, Scene *scene, bMovieHandle *mh, const char *name_override); static volatile int g_break= 0; static int thread_break(void *UNUSED(arg)) @@ -141,7 +141,6 @@ static void result_nothing(void *UNUSED(arg), RenderResult *UNUSED(rr)) {} static void result_rcti_nothing(void *UNUSED(arg), RenderResult *UNUSED(rr), volatile struct rcti *UNUSED(rect)) {} static void stats_nothing(void *UNUSED(arg), RenderStats *UNUSED(rs)) {} static void float_nothing(void *UNUSED(arg), float UNUSED(val)) {} -static void print_error(void *UNUSED(arg), const char *str) {printf("ERROR: %s\n", str);} static int default_break(void *UNUSED(arg)) {return G.afbreek == 1;} static void stats_background(void *UNUSED(arg), RenderStats *rs) @@ -1190,13 +1189,12 @@ void RE_InitRenderCB(Render *re) re->display_draw= result_rcti_nothing; re->progress= float_nothing; re->test_break= default_break; - re->error= print_error; if(G.background) re->stats_draw= stats_background; else re->stats_draw= stats_nothing; /* clear callback handles */ - re->dih= re->dch= re->ddh= re->sdh= re->prh= re->tbh= re->erh= NULL; + re->dih= re->dch= re->ddh= re->sdh= re->prh= re->tbh= NULL; } /* only call this while you know it will remove the link too */ @@ -1251,7 +1249,7 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, SceneRenderLayer * if(re->rectx < 2 || re->recty < 2 || (BKE_imtype_is_movie(rd->imtype) && (re->rectx < 16 || re->recty < 16) )) { - re->error(re->erh, "Image too small"); + BKE_report(re->reports, RPT_ERROR, "Image too small"); re->ok= 0; return; } @@ -1417,11 +1415,6 @@ void RE_test_break_cb(Render *re, void *handle, int (*f)(void *handle)) re->test_break= f; re->tbh= handle; } -void RE_error_cb(Render *re, void *handle, void (*f)(void *handle, const char *str)) -{ - re->error= f; - re->erh= handle; -} /* ********* add object data (later) ******** */ @@ -2710,14 +2703,14 @@ static int check_valid_camera(Scene *scene, Object *camera_override) return 1; } -int RE_is_rendering_allowed(Scene *scene, Object *camera_override, void *erh, void (*error)(void *handle, const char *str)) +int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *reports) { SceneRenderLayer *srl; if(scene->r.mode & R_BORDER) { if(scene->r.border.xmax <= scene->r.border.xmin || scene->r.border.ymax <= scene->r.border.ymin) { - error(erh, "No border area selected."); + BKE_report(reports, RPT_ERROR, "No border area selected."); return 0; } } @@ -2728,13 +2721,13 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, void *erh, vo scene_unique_exr_name(scene, str, 0); if (BLI_is_writable(str)==0) { - error(erh, "Can not save render buffers, check the temp default path"); + BKE_report(reports, RPT_ERROR, "Can not save render buffers, check the temp default path"); return 0; } /* no fullsample and edge */ if((scene->r.scemode & R_FULL_SAMPLE) && (scene->r.mode & R_EDGE)) { - error(erh, "Full Sample doesn't support Edge Enhance"); + BKE_report(reports, RPT_ERROR, "Full Sample doesn't support Edge Enhance"); return 0; } @@ -2748,7 +2741,7 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, void *erh, vo bNode *node; if(ntree==NULL) { - error(erh, "No Nodetree in Scene"); + BKE_report(reports, RPT_ERROR, "No Nodetree in Scene"); return 0; } @@ -2757,13 +2750,13 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, void *erh, vo break; if(node==NULL) { - error(erh, "No Render Output Node in Scene"); + BKE_report(reports, RPT_ERROR, "No Render Output Node in Scene"); return 0; } if(scene->r.scemode & R_FULL_SAMPLE) { if(composite_needs_render(scene, 0)==0) { - error(erh, "Full Sample AA not supported without 3d rendering"); + BKE_report(reports, RPT_ERROR, "Full Sample AA not supported without 3d rendering"); return 0; } } @@ -2772,7 +2765,7 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, void *erh, vo /* check valid camera, without camera render is OK (compo, seq) */ if(!check_valid_camera(scene, camera_override)) { - error(erh, "No camera"); + BKE_report(reports, RPT_ERROR, "No camera"); return 0; } @@ -2782,7 +2775,7 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, void *erh, vo /* forbidden combinations */ if(scene->r.mode & R_PANORAMA) { if(scene->r.mode & R_ORTHO) { - error(erh, "No Ortho render possible for Panorama"); + BKE_report(reports, RPT_ERROR, "No Ortho render possible for Panorama"); return 0; } } @@ -2798,13 +2791,13 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, void *erh, vo if(!(srl->layflag & SCE_LAY_DISABLE)) break; if(srl==NULL) { - error(erh, "All RenderLayers are disabled"); + BKE_report(reports, RPT_ERROR, "All RenderLayers are disabled"); return 0; } /* renderer */ if(!ELEM(scene->r.renderer, R_INTERN, R_YAFRAY)) { - error(erh, "Unknown render engine set"); + BKE_report(reports, RPT_ERROR, "Unknown render engine set"); return 0; } @@ -2906,6 +2899,11 @@ static int render_initialize_from_main(Render *re, Main *bmain, Scene *scene, Sc return 1; } +void RE_SetReports(Render *re, ReportList *reports) +{ + re->reports= reports; +} + /* general Blender frame render call */ void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneRenderLayer *srl, Object *camera_override, unsigned int lay, int frame, const short write_still) { @@ -2931,7 +2929,7 @@ void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneRenderLayer *sr BKE_makepicstring(name, scene->r.pic, scene->r.cfra, scene->r.imtype, scene->r.scemode & R_EXTENSION, FALSE); /* reports only used for Movie */ - do_write_image_or_movie(re, scene, NULL, NULL, name); + do_write_image_or_movie(re, scene, NULL, name); } } @@ -2942,7 +2940,7 @@ void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneRenderLayer *sr G.rendering= 0; } -static int do_write_image_or_movie(Render *re, Scene *scene, bMovieHandle *mh, ReportList *reports, const char *name_override) +static int do_write_image_or_movie(Render *re, Scene *scene, bMovieHandle *mh, const char *name_override) { char name[FILE_MAX]; RenderResult rres; @@ -2960,7 +2958,7 @@ static int do_write_image_or_movie(Render *re, Scene *scene, bMovieHandle *mh, R dofree = 1; } RE_ResultGet32(re, (unsigned int *)rres.rect32); - ok= mh->append_movie(&re->r, scene->r.cfra, rres.rect32, rres.rectx, rres.recty, reports); + ok= mh->append_movie(&re->r, scene->r.cfra, rres.rect32, rres.rectx, rres.recty, re->reports); if(dofree) { MEM_freeN(rres.rect32); } @@ -3042,7 +3040,7 @@ static int do_write_image_or_movie(Render *re, Scene *scene, bMovieHandle *mh, R } /* saves images to disk */ -void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_override, unsigned int lay, int sfra, int efra, int tfra, ReportList *reports) +void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_override, unsigned int lay, int sfra, int efra, int tfra) { bMovieHandle *mh= BKE_get_movie_handle(scene->r.imtype); int cfrao= scene->r.cfra; @@ -3055,14 +3053,14 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri /* ugly global still... is to prevent renderwin events and signal subsurfs etc to make full resol */ /* is also set by caller renderwin.c */ G.rendering= 1; - + if(BKE_imtype_is_movie(scene->r.imtype)) - if(!mh->start_movie(scene, &re->r, re->rectx, re->recty, reports)) + if(!mh->start_movie(scene, &re->r, re->rectx, re->recty, re->reports)) G.afbreek= 1; if (mh->get_next_frame) { while (!(G.afbreek == 1)) { - int nf = mh->get_next_frame(&re->r, reports); + int nf = mh->get_next_frame(&re->r, re->reports); if (nf >= 0 && nf >= scene->r.sfra && nf <= scene->r.efra) { scene->r.cfra = re->r.cfra = nf; @@ -3071,7 +3069,7 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri do_render_all_options(re); if(re->test_break(re->tbh) == 0) { - if(!do_write_image_or_movie(re, scene, mh, reports, NULL)) + if(!do_write_image_or_movie(re, scene, mh, NULL)) G.afbreek= 1; } @@ -3135,7 +3133,7 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri if(re->test_break(re->tbh) == 0) { if(!G.afbreek) - if(!do_write_image_or_movie(re, scene, mh, reports, NULL)) + if(!do_write_image_or_movie(re, scene, mh, NULL)) G.afbreek= 1; } else @@ -3343,6 +3341,11 @@ void RE_engine_update_stats(RenderEngine *engine, const char *stats, const char re->i.statstr= NULL; } +void RE_engine_report(RenderEngine *engine, int type, const char *msg) +{ + BKE_report(engine->re->reports, type, msg); +} + /* loads in image into a result, size must match * x/y offsets are only used on a partial copy when dimensions dont match */ void RE_layer_load_from_file(RenderLayer *layer, ReportList *reports, const char *filename, int x, int y) diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 83ef46d109c..ce3830b059c 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2449,6 +2449,16 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U else event.type= MIDDLEMOUSE; + if(win->active==0) { + int cx, cy; + + /* entering window, update mouse pos. (ghost sends win-activate *after* the mouseclick in window!) */ + wm_get_cursor_position(win, &cx, &cy); + + event.x= evt->x= cx; + event.y= evt->y= cy; + } + /* add to other window if event is there (not to both!) */ owin= wm_event_cursor_other_windows(wm, win, &event); if(owin) { diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index 4daa0aa8d1f..8d52a86d418 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -383,6 +383,7 @@ void RE_AcquireResultImage(struct Render *re, struct RenderResult *rr){} void RE_ReleaseResult(struct Render *re){} void RE_ReleaseResultImage(struct Render *re){} int RE_engine_test_break(struct RenderEngine *engine){return 0;} +void RE_engine_report(struct RenderEngine *engine, int type, const char *msg) {} /* python */ struct wmOperatorType *WM_operatortype_find(const char *idname, int quiet){return (struct wmOperatorType *) NULL;} diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 04f1f359ce6..dc19742c057 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -231,7 +231,17 @@ else() set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH}) endif() -# install target + +# ----------------------------------------------------------------------------- +# Install Targets + +set(BLENDER_TEXT_FILES + ${CMAKE_SOURCE_DIR}/release/text/GPL-license.txt + ${CMAKE_SOURCE_DIR}/release/text/Python-license.txt + ${CMAKE_SOURCE_DIR}/release/text/copyright.txt + ${CMAKE_SOURCE_DIR}/release/text/readme.html +) + if(UNIX AND NOT APPLE) if(WITH_INSTALL_PORTABLE) @@ -274,9 +284,8 @@ if(UNIX AND NOT APPLE) ) install( - DIRECTORY ${CMAKE_SOURCE_DIR}/release/text + FILES ${BLENDER_TEXT_FILES} DESTINATION ${TARGETDIR} - PATTERN ".svn" EXCLUDE ) else() @@ -332,9 +341,8 @@ if(UNIX AND NOT APPLE) DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1 ) install( - DIRECTORY ${CMAKE_SOURCE_DIR}/release/text + FILES ${BLENDER_TEXT_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/blender - PATTERN ".svn" EXCLUDE ) endif() @@ -409,9 +417,8 @@ elseif(WIN32) ) install( # same as linux!, deduplicate - DIRECTORY ${CMAKE_SOURCE_DIR}/release/text + FILES ${BLENDER_TEXT_FILES} DESTINATION ${TARGETDIR} - PATTERN ".svn" EXCLUDE ) install( # same as linux!, deduplicate @@ -630,9 +637,9 @@ elseif(APPLE) endmacro() # install release and app files - install_dir( - ${CMAKE_SOURCE_DIR}/release/text/ - \${TARGETDIR} + install( + FILES ${BLENDER_TEXT_FILES} + DESTINATION ${TARGETDIR} ) install( @@ -697,6 +704,12 @@ elseif(APPLE) endif() endif() +unset(BLENDER_TEXT_FILES) + + +# ----------------------------------------------------------------------------- +# Setup link libs + add_dependencies(blender makesdna) get_property(BLENDER_LINK_LIBS GLOBAL PROPERTY BLENDER_LINK_LIBS) diff --git a/source/creator/creator.c b/source/creator/creator.c index 28447ac8e46..a8b24d0c9bc 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -768,7 +768,9 @@ static int render_frame(int argc, const char **argv, void *data) frame = MIN2(MAXFRAME, MAX2(MINAFRAME, frame)); - RE_BlenderAnim(re, bmain, scene, NULL, scene->lay, frame, frame, scene->r.frame_step, &reports); + RE_SetReports(re, &reports); + RE_BlenderAnim(re, bmain, scene, NULL, scene->lay, frame, frame, scene->r.frame_step); + RE_SetReports(re, NULL); return 1; } else { printf("\nError: frame number must follow '-f / --render-frame'.\n"); @@ -789,7 +791,9 @@ static int render_animation(int UNUSED(argc), const char **UNUSED(argv), void *d Render *re= RE_NewRender(scene->id.name); ReportList reports; BKE_reports_init(&reports, RPT_PRINT); - RE_BlenderAnim(re, bmain, scene, NULL, scene->lay, scene->r.sfra, scene->r.efra, scene->r.frame_step, &reports); + RE_SetReports(re, &reports); + RE_BlenderAnim(re, bmain, scene, NULL, scene->lay, scene->r.sfra, scene->r.efra, scene->r.frame_step); + RE_SetReports(re, NULL); } else { printf("\nError: no blend loaded. cannot use '-a'.\n"); } diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp index a73a6d4631b..0e08f157a6a 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp +++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp @@ -89,7 +89,7 @@ SCA_Joystick *SCA_Joystick::GetInstance( short int joyindex ) { int i; // do this once only - if(SDL_InitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO ) == -1 ){ + if(SDL_InitSubSystem(SDL_INIT_JOYSTICK) == -1 ){ echo("Error-Initializing-SDL: " << SDL_GetError()); return NULL; } @@ -124,7 +124,7 @@ void SCA_Joystick::ReleaseInstance() m_instance[i]= NULL; } - SDL_QuitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO ); + SDL_QuitSubSystem(SDL_INIT_JOYSTICK); #endif } } diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index 6487d0298c7..f2b322084ed 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -448,6 +448,7 @@ bool GPG_Application::processEvent(GHOST_IEvent* event) case GHOST_kEventWindowClose: + case GHOST_kEventQuit: m_exitRequested = KX_EXIT_REQUEST_OUTSIDE; break; diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt index 48053aa9d96..d1696223ec6 100644 --- a/source/tests/CMakeLists.txt +++ b/source/tests/CMakeLists.txt @@ -172,21 +172,21 @@ add_test(import_stl_knot_max_simplified ${TEST_BLENDER_EXE} add_test(import_x3d_cube ${TEST_BLENDER_EXE} --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py -- --run={'FINISHED'}&bpy.ops.import_scene.x3d\(filepath='${TEST_SRC_DIR}/io_tests/x3d/color_cube.x3d'\) - --md5=2ed64325dd3d62be6ce43c64219376ec --md5_method=SCENE + --md5=3fae9be004199c145941cd3f9f80ad7b --md5_method=SCENE --write-blend=${TEST_OUT_DIR}/import_x3d_cube.blend ) add_test(import_x3d_teapot ${TEST_BLENDER_EXE} --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py -- --run={'FINISHED'}&bpy.ops.import_scene.x3d\(filepath='${TEST_SRC_DIR}/io_tests/x3d/teapot.x3d'\) - --md5=8b8b386900b8e3d2c036a38c625f4079 --md5_method=SCENE + --md5=8ee196c71947dce4199d55698501691e --md5_method=SCENE --write-blend=${TEST_OUT_DIR}/import_x3d_teapot.blend ) add_test(import_x3d_suzanne_material ${TEST_BLENDER_EXE} --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py -- --run={'FINISHED'}&bpy.ops.import_scene.x3d\(filepath='${TEST_SRC_DIR}/io_tests/x3d/suzanne_material.x3d'\) - --md5=999129ba835f0ccb98c4bb299f6c2fef --md5_method=SCENE + --md5=3edea1353257d8b5a5f071942f417be6 --md5_method=SCENE --write-blend=${TEST_OUT_DIR}/import_x3d_suzanne_material.blend ) @@ -196,7 +196,7 @@ add_test(export_x3d_cube ${TEST_BLENDER_EXE} --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py -- --run={'FINISHED'}&bpy.ops.export_scene.x3d\(filepath='${TEST_OUT_DIR}/export_x3d_cube.x3d',use_selection=False\) --md5_source=${TEST_OUT_DIR}/export_x3d_cube.x3d - --md5=30d2b056c004144cd4a0d172484a66f3 --md5_method=FILE + --md5=6ae36be272d6f84c697e84a8b6463273 --md5_method=FILE ) add_test(export_x3d_nurbs ${TEST_BLENDER_EXE} @@ -204,7 +204,7 @@ add_test(export_x3d_nurbs ${TEST_BLENDER_EXE} --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py -- --run={'FINISHED'}&bpy.ops.export_scene.x3d\(filepath='${TEST_OUT_DIR}/export_x3d_nurbs.x3d',use_selection=False\) --md5_source=${TEST_OUT_DIR}/export_x3d_nurbs.x3d - --md5=7c15afe7b0cf007b842a925508b7d966 --md5_method=FILE + --md5=2d5bcf43cf7b6fbbef1c8cc566968fe5 --md5_method=FILE ) add_test(export_x3d_all_objects ${TEST_BLENDER_EXE} @@ -212,7 +212,7 @@ add_test(export_x3d_all_objects ${TEST_BLENDER_EXE} --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py -- --run={'FINISHED'}&bpy.ops.export_scene.x3d\(filepath='${TEST_OUT_DIR}/export_x3d_all_objects.x3d',use_selection=False\) --md5_source=${TEST_OUT_DIR}/export_x3d_all_objects.x3d - --md5=d7d6574e833f3f051b65ef4577485fa9 --md5_method=FILE + --md5=bba48ca191e8891adb27c59ed4ce4735 --md5_method=FILE ) |