Merged 15170:15635 from trunk (no conflicts or even merges)
This commit is contained in:
@@ -197,10 +197,17 @@ IF(UNIX)
|
||||
ENDIF(UNIX)
|
||||
|
||||
IF(WIN32)
|
||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
|
||||
|
||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
|
||||
|
||||
SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows)
|
||||
|
||||
# Setup 64bit and 64bit windows systems
|
||||
IF(CMAKE_CL_64)
|
||||
message("64 bit compiler detected.")
|
||||
SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
|
||||
SET(PYTHON ${LIBDIR}/python)
|
||||
SET(PYTHON_VERSION 2.5)
|
||||
SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
|
||||
@@ -214,12 +221,20 @@ IF(WIN32)
|
||||
SET(OPENAL_LIB openal_static)
|
||||
SET(OPENAL_LIBPATH ${OPENAL}/lib)
|
||||
|
||||
SET(PNG_LIB libpng_st)
|
||||
IF(CMAKE_CL_64)
|
||||
SET(PNG_LIB libpng)
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(PNG_LIB libpng_st)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
SET(JPEG_LIB libjpeg)
|
||||
|
||||
SET(ZLIB ${LIBDIR}/zlib)
|
||||
SET(ZLIB_INC ${ZLIB}/include)
|
||||
SET(ZLIB_LIB libz)
|
||||
IF(CMAKE_CL_64)
|
||||
SET(ZLIB_LIB zlib)
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(ZLIB_LIB libz)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
SET(ZLIB_LIBPATH ${ZLIB}/lib)
|
||||
|
||||
SET(PTHREADS ${LIBDIR}/pthreads)
|
||||
@@ -302,7 +317,11 @@ IF(WIN32)
|
||||
|
||||
SET(WINTAB_INC ${LIBDIR}/wintab/include)
|
||||
|
||||
SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib")
|
||||
IF(CMAKE_CL_64)
|
||||
SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib;MSVCRT.lib ")
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
|
||||
ENDIF(CMAKE_CL_64)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
|
||||
ENDIF(WIN32)
|
||||
|
||||
|
||||
14
README
14
README
@@ -24,22 +24,22 @@ dir to one of these locations (your home directory being recommended).
|
||||
-------------------------------------Links--------------------------------------
|
||||
|
||||
Getting Involved:
|
||||
http://www.blender.org/docs/get_involved.html
|
||||
http://www.blender.org/community/get-involved
|
||||
|
||||
Community:
|
||||
http://www.blender3d.org/Community/
|
||||
http://www.blender.org/Community
|
||||
|
||||
Main blender development site:
|
||||
http://www.blender.org/
|
||||
http://www.blender.org
|
||||
|
||||
The Blender project homepage:
|
||||
http://projects.blender.org/projects/bf-blender/
|
||||
http://projects.blender.org/projects/bf-blender
|
||||
|
||||
Documentation:
|
||||
http://www.blender.org/modules.php?op=modload&name=documentation&file=index
|
||||
http://www.blender.org/education-help
|
||||
|
||||
Bug tracker:
|
||||
http://projects.blender.org/tracker/?atid=125&group_id=9&func=browse
|
||||
http://www.blender.org/development/report-a-bug
|
||||
|
||||
Feature request tracker:
|
||||
http://projects.blender.org/tracker/?atid=128&group_id=9&func=browse
|
||||
http://wiki.blender.org/index.php/Requests
|
||||
|
||||
@@ -108,6 +108,7 @@ IF(UNIX)
|
||||
blenkernel_blc
|
||||
bf_quicktime
|
||||
extern_binreloc
|
||||
extern_glew
|
||||
)
|
||||
|
||||
FOREACH(SORTLIB ${BLENDER_SORTED_LIBS})
|
||||
|
||||
3
extern/CMakeLists.txt
vendored
3
extern/CMakeLists.txt
vendored
@@ -43,3 +43,6 @@ ENDIF(WITH_VERSE)
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
SUBDIRS(binreloc)
|
||||
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
|
||||
SUBDIRS(glew)
|
||||
|
||||
|
||||
2
extern/Makefile
vendored
2
extern/Makefile
vendored
@@ -30,7 +30,7 @@ include nan_definitions.mk
|
||||
|
||||
SOURCEDIR = extern
|
||||
DIR = $(OCGDIR)/extern
|
||||
DIRS = qhull/src solid
|
||||
DIRS = qhull/src solid glew/src
|
||||
|
||||
ifeq ($(WITH_FREETYPE2), true)
|
||||
DIRS += bFTGL/src
|
||||
|
||||
2
extern/SConscript
vendored
2
extern/SConscript
vendored
@@ -2,6 +2,8 @@
|
||||
|
||||
Import('env')
|
||||
|
||||
SConscript(['glew/SConscript'])
|
||||
|
||||
if env['WITH_BF_GAMEENGINE']:
|
||||
SConscript(['qhull/SConscript',
|
||||
'solid/SConscript'])
|
||||
|
||||
33
extern/glew/CMakeLists.txt
vendored
Normal file
33
extern/glew/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
# $Id$
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# The Original Code is Copyright (C) 2006, Blender Foundation
|
||||
# All rights reserved.
|
||||
#
|
||||
# The Original Code is: all of this file.
|
||||
#
|
||||
# Contributor(s): Jacques Beaurain.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
SET(INC include src)
|
||||
|
||||
SET(SRC
|
||||
src/glew.c
|
||||
)
|
||||
|
||||
BLENDERLIB(extern_glew "${SRC}" "${INC}")
|
||||
18
extern/glew/README.txt
vendored
Normal file
18
extern/glew/README.txt
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
See doc/index.html for more information.
|
||||
|
||||
If you downloaded the tarball from the GLEW website, you just need to:
|
||||
|
||||
Unix:
|
||||
|
||||
make
|
||||
|
||||
Windows:
|
||||
|
||||
use the project file in build/vc6/
|
||||
|
||||
If you wish to build GLEW from scratch (update the extension data from
|
||||
the net or add your own extension information), you need a Unix
|
||||
environment (including wget, perl, and GNU make). The extension data
|
||||
is regenerated from the top level source directory with:
|
||||
|
||||
make extensions
|
||||
12
extern/glew/SConscript
vendored
Normal file
12
extern/glew/SConscript
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/python
|
||||
import sys
|
||||
import os
|
||||
|
||||
Import('env')
|
||||
|
||||
sources = ['src/glew.c']
|
||||
|
||||
defs = ''
|
||||
incs = 'include'
|
||||
|
||||
env.BlenderLib ( 'extern_glew', sources, Split(incs), Split(defs), libtype=['intern', 'player'], priority=[25, 50])
|
||||
9797
extern/glew/include/GL/glew.h
vendored
Normal file
9797
extern/glew/include/GL/glew.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1062
extern/glew/include/GL/glxew.h
vendored
Normal file
1062
extern/glew/include/GL/glxew.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
934
extern/glew/include/GL/wglew.h
vendored
Normal file
934
extern/glew/include/GL/wglew.h
vendored
Normal file
@@ -0,0 +1,934 @@
|
||||
/*
|
||||
** The OpenGL Extension Wrangler Library
|
||||
** Copyright (C) 2002-2006, Milan Ikits <milan ikits[]ieee org>
|
||||
** Copyright (C) 2002-2006, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
** Copyright (C) 2002, Lev Povalahev
|
||||
** All rights reserved.
|
||||
**
|
||||
** Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are met:
|
||||
**
|
||||
** * Redistributions of source code must retain the above copyright notice,
|
||||
** this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright notice,
|
||||
** this list of conditions and the following disclaimer in the documentation
|
||||
** and/or other materials provided with the distribution.
|
||||
** * The name of the author may be used to endorse or promote products
|
||||
** derived from this software without specific prior written permission.
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
** THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __wglew_h__
|
||||
#define __wglew_h__
|
||||
#define __WGLEW_H__
|
||||
|
||||
#ifdef __wglext_h_
|
||||
#error wglext.h included before wglew.h
|
||||
#endif
|
||||
|
||||
#define __wglext_h_
|
||||
|
||||
#if !defined(APIENTRY) && !defined(__CYGWIN__)
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN 1
|
||||
# endif
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* GLEW_STATIC needs to be set when using the static version.
|
||||
* GLEW_BUILD is set when building the DLL version.
|
||||
*/
|
||||
#ifdef GLEW_STATIC
|
||||
# define GLEWAPI extern
|
||||
#else
|
||||
# ifdef GLEW_BUILD
|
||||
# define GLEWAPI extern __declspec(dllexport)
|
||||
# else
|
||||
# define GLEWAPI extern __declspec(dllimport)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* -------------------------- WGL_3DFX_multisample ------------------------- */
|
||||
|
||||
#ifndef WGL_3DFX_multisample
|
||||
#define WGL_3DFX_multisample 1
|
||||
|
||||
#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
|
||||
#define WGL_SAMPLES_3DFX 0x2061
|
||||
|
||||
#define WGLEW_3DFX_multisample WGLEW_GET_VAR(__WGLEW_3DFX_multisample)
|
||||
|
||||
#endif /* WGL_3DFX_multisample */
|
||||
|
||||
/* ------------------------- WGL_3DL_stereo_control ------------------------ */
|
||||
|
||||
#ifndef WGL_3DL_stereo_control
|
||||
#define WGL_3DL_stereo_control 1
|
||||
|
||||
#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
|
||||
#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
|
||||
#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
|
||||
#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
|
||||
|
||||
typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);
|
||||
|
||||
#define wglSetStereoEmitterState3DL WGLEW_GET_FUN(__wglewSetStereoEmitterState3DL)
|
||||
|
||||
#define WGLEW_3DL_stereo_control WGLEW_GET_VAR(__WGLEW_3DL_stereo_control)
|
||||
|
||||
#endif /* WGL_3DL_stereo_control */
|
||||
|
||||
/* ------------------------- WGL_ARB_buffer_region ------------------------- */
|
||||
|
||||
#ifndef WGL_ARB_buffer_region
|
||||
#define WGL_ARB_buffer_region 1
|
||||
|
||||
#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
|
||||
#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
|
||||
#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
|
||||
#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
|
||||
|
||||
typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
|
||||
typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
|
||||
typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
|
||||
typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
|
||||
|
||||
#define wglCreateBufferRegionARB WGLEW_GET_FUN(__wglewCreateBufferRegionARB)
|
||||
#define wglDeleteBufferRegionARB WGLEW_GET_FUN(__wglewDeleteBufferRegionARB)
|
||||
#define wglRestoreBufferRegionARB WGLEW_GET_FUN(__wglewRestoreBufferRegionARB)
|
||||
#define wglSaveBufferRegionARB WGLEW_GET_FUN(__wglewSaveBufferRegionARB)
|
||||
|
||||
#define WGLEW_ARB_buffer_region WGLEW_GET_VAR(__WGLEW_ARB_buffer_region)
|
||||
|
||||
#endif /* WGL_ARB_buffer_region */
|
||||
|
||||
/* ----------------------- WGL_ARB_extensions_string ----------------------- */
|
||||
|
||||
#ifndef WGL_ARB_extensions_string
|
||||
#define WGL_ARB_extensions_string 1
|
||||
|
||||
typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
|
||||
|
||||
#define wglGetExtensionsStringARB WGLEW_GET_FUN(__wglewGetExtensionsStringARB)
|
||||
|
||||
#define WGLEW_ARB_extensions_string WGLEW_GET_VAR(__WGLEW_ARB_extensions_string)
|
||||
|
||||
#endif /* WGL_ARB_extensions_string */
|
||||
|
||||
/* ----------------------- WGL_ARB_make_current_read ----------------------- */
|
||||
|
||||
#ifndef WGL_ARB_make_current_read
|
||||
#define WGL_ARB_make_current_read 1
|
||||
|
||||
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID);
|
||||
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
|
||||
#define wglGetCurrentReadDCARB WGLEW_GET_FUN(__wglewGetCurrentReadDCARB)
|
||||
#define wglMakeContextCurrentARB WGLEW_GET_FUN(__wglewMakeContextCurrentARB)
|
||||
|
||||
#define WGLEW_ARB_make_current_read WGLEW_GET_VAR(__WGLEW_ARB_make_current_read)
|
||||
|
||||
#endif /* WGL_ARB_make_current_read */
|
||||
|
||||
/* -------------------------- WGL_ARB_multisample -------------------------- */
|
||||
|
||||
#ifndef WGL_ARB_multisample
|
||||
#define WGL_ARB_multisample 1
|
||||
|
||||
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
|
||||
#define WGL_SAMPLES_ARB 0x2042
|
||||
|
||||
#define WGLEW_ARB_multisample WGLEW_GET_VAR(__WGLEW_ARB_multisample)
|
||||
|
||||
#endif /* WGL_ARB_multisample */
|
||||
|
||||
/* ---------------------------- WGL_ARB_pbuffer ---------------------------- */
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
#define WGL_ARB_pbuffer 1
|
||||
|
||||
#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
|
||||
#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
|
||||
#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
|
||||
#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
|
||||
#define WGL_PBUFFER_LARGEST_ARB 0x2033
|
||||
#define WGL_PBUFFER_WIDTH_ARB 0x2034
|
||||
#define WGL_PBUFFER_HEIGHT_ARB 0x2035
|
||||
#define WGL_PBUFFER_LOST_ARB 0x2036
|
||||
|
||||
DECLARE_HANDLE(HPBUFFERARB);
|
||||
|
||||
typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
|
||||
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int* piValue);
|
||||
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
|
||||
|
||||
#define wglCreatePbufferARB WGLEW_GET_FUN(__wglewCreatePbufferARB)
|
||||
#define wglDestroyPbufferARB WGLEW_GET_FUN(__wglewDestroyPbufferARB)
|
||||
#define wglGetPbufferDCARB WGLEW_GET_FUN(__wglewGetPbufferDCARB)
|
||||
#define wglQueryPbufferARB WGLEW_GET_FUN(__wglewQueryPbufferARB)
|
||||
#define wglReleasePbufferDCARB WGLEW_GET_FUN(__wglewReleasePbufferDCARB)
|
||||
|
||||
#define WGLEW_ARB_pbuffer WGLEW_GET_VAR(__WGLEW_ARB_pbuffer)
|
||||
|
||||
#endif /* WGL_ARB_pbuffer */
|
||||
|
||||
/* -------------------------- WGL_ARB_pixel_format ------------------------- */
|
||||
|
||||
#ifndef WGL_ARB_pixel_format
|
||||
#define WGL_ARB_pixel_format 1
|
||||
|
||||
#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
|
||||
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
|
||||
#define WGL_DRAW_TO_BITMAP_ARB 0x2002
|
||||
#define WGL_ACCELERATION_ARB 0x2003
|
||||
#define WGL_NEED_PALETTE_ARB 0x2004
|
||||
#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
|
||||
#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
|
||||
#define WGL_SWAP_METHOD_ARB 0x2007
|
||||
#define WGL_NUMBER_OVERLAYS_ARB 0x2008
|
||||
#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
|
||||
#define WGL_TRANSPARENT_ARB 0x200A
|
||||
#define WGL_SHARE_DEPTH_ARB 0x200C
|
||||
#define WGL_SHARE_STENCIL_ARB 0x200D
|
||||
#define WGL_SHARE_ACCUM_ARB 0x200E
|
||||
#define WGL_SUPPORT_GDI_ARB 0x200F
|
||||
#define WGL_SUPPORT_OPENGL_ARB 0x2010
|
||||
#define WGL_DOUBLE_BUFFER_ARB 0x2011
|
||||
#define WGL_STEREO_ARB 0x2012
|
||||
#define WGL_PIXEL_TYPE_ARB 0x2013
|
||||
#define WGL_COLOR_BITS_ARB 0x2014
|
||||
#define WGL_RED_BITS_ARB 0x2015
|
||||
#define WGL_RED_SHIFT_ARB 0x2016
|
||||
#define WGL_GREEN_BITS_ARB 0x2017
|
||||
#define WGL_GREEN_SHIFT_ARB 0x2018
|
||||
#define WGL_BLUE_BITS_ARB 0x2019
|
||||
#define WGL_BLUE_SHIFT_ARB 0x201A
|
||||
#define WGL_ALPHA_BITS_ARB 0x201B
|
||||
#define WGL_ALPHA_SHIFT_ARB 0x201C
|
||||
#define WGL_ACCUM_BITS_ARB 0x201D
|
||||
#define WGL_ACCUM_RED_BITS_ARB 0x201E
|
||||
#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
|
||||
#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
|
||||
#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
|
||||
#define WGL_DEPTH_BITS_ARB 0x2022
|
||||
#define WGL_STENCIL_BITS_ARB 0x2023
|
||||
#define WGL_AUX_BUFFERS_ARB 0x2024
|
||||
#define WGL_NO_ACCELERATION_ARB 0x2025
|
||||
#define WGL_GENERIC_ACCELERATION_ARB 0x2026
|
||||
#define WGL_FULL_ACCELERATION_ARB 0x2027
|
||||
#define WGL_SWAP_EXCHANGE_ARB 0x2028
|
||||
#define WGL_SWAP_COPY_ARB 0x2029
|
||||
#define WGL_SWAP_UNDEFINED_ARB 0x202A
|
||||
#define WGL_TYPE_RGBA_ARB 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_ARB 0x202C
|
||||
#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
|
||||
#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
|
||||
#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
|
||||
#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
|
||||
#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
|
||||
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues);
|
||||
|
||||
#define wglChoosePixelFormatARB WGLEW_GET_FUN(__wglewChoosePixelFormatARB)
|
||||
#define wglGetPixelFormatAttribfvARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvARB)
|
||||
#define wglGetPixelFormatAttribivARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribivARB)
|
||||
|
||||
#define WGLEW_ARB_pixel_format WGLEW_GET_VAR(__WGLEW_ARB_pixel_format)
|
||||
|
||||
#endif /* WGL_ARB_pixel_format */
|
||||
|
||||
/* ----------------------- WGL_ARB_pixel_format_float ---------------------- */
|
||||
|
||||
#ifndef WGL_ARB_pixel_format_float
|
||||
#define WGL_ARB_pixel_format_float 1
|
||||
|
||||
#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
|
||||
|
||||
#define WGLEW_ARB_pixel_format_float WGLEW_GET_VAR(__WGLEW_ARB_pixel_format_float)
|
||||
|
||||
#endif /* WGL_ARB_pixel_format_float */
|
||||
|
||||
/* ------------------------- WGL_ARB_render_texture ------------------------ */
|
||||
|
||||
#ifndef WGL_ARB_render_texture
|
||||
#define WGL_ARB_render_texture 1
|
||||
|
||||
#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
|
||||
#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
|
||||
#define WGL_TEXTURE_FORMAT_ARB 0x2072
|
||||
#define WGL_TEXTURE_TARGET_ARB 0x2073
|
||||
#define WGL_MIPMAP_TEXTURE_ARB 0x2074
|
||||
#define WGL_TEXTURE_RGB_ARB 0x2075
|
||||
#define WGL_TEXTURE_RGBA_ARB 0x2076
|
||||
#define WGL_NO_TEXTURE_ARB 0x2077
|
||||
#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
|
||||
#define WGL_TEXTURE_1D_ARB 0x2079
|
||||
#define WGL_TEXTURE_2D_ARB 0x207A
|
||||
#define WGL_MIPMAP_LEVEL_ARB 0x207B
|
||||
#define WGL_CUBE_MAP_FACE_ARB 0x207C
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
|
||||
#define WGL_FRONT_LEFT_ARB 0x2083
|
||||
#define WGL_FRONT_RIGHT_ARB 0x2084
|
||||
#define WGL_BACK_LEFT_ARB 0x2085
|
||||
#define WGL_BACK_RIGHT_ARB 0x2086
|
||||
#define WGL_AUX0_ARB 0x2087
|
||||
#define WGL_AUX1_ARB 0x2088
|
||||
#define WGL_AUX2_ARB 0x2089
|
||||
#define WGL_AUX3_ARB 0x208A
|
||||
#define WGL_AUX4_ARB 0x208B
|
||||
#define WGL_AUX5_ARB 0x208C
|
||||
#define WGL_AUX6_ARB 0x208D
|
||||
#define WGL_AUX7_ARB 0x208E
|
||||
#define WGL_AUX8_ARB 0x208F
|
||||
#define WGL_AUX9_ARB 0x2090
|
||||
|
||||
typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int* piAttribList);
|
||||
|
||||
#define wglBindTexImageARB WGLEW_GET_FUN(__wglewBindTexImageARB)
|
||||
#define wglReleaseTexImageARB WGLEW_GET_FUN(__wglewReleaseTexImageARB)
|
||||
#define wglSetPbufferAttribARB WGLEW_GET_FUN(__wglewSetPbufferAttribARB)
|
||||
|
||||
#define WGLEW_ARB_render_texture WGLEW_GET_VAR(__WGLEW_ARB_render_texture)
|
||||
|
||||
#endif /* WGL_ARB_render_texture */
|
||||
|
||||
/* ----------------------- WGL_ATI_pixel_format_float ---------------------- */
|
||||
|
||||
#ifndef WGL_ATI_pixel_format_float
|
||||
#define WGL_ATI_pixel_format_float 1
|
||||
|
||||
#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
|
||||
#define GL_RGBA_FLOAT_MODE_ATI 0x8820
|
||||
#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
|
||||
|
||||
#define WGLEW_ATI_pixel_format_float WGLEW_GET_VAR(__WGLEW_ATI_pixel_format_float)
|
||||
|
||||
#endif /* WGL_ATI_pixel_format_float */
|
||||
|
||||
/* -------------------- WGL_ATI_render_texture_rectangle ------------------- */
|
||||
|
||||
#ifndef WGL_ATI_render_texture_rectangle
|
||||
#define WGL_ATI_render_texture_rectangle 1
|
||||
|
||||
#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5
|
||||
|
||||
#define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle)
|
||||
|
||||
#endif /* WGL_ATI_render_texture_rectangle */
|
||||
|
||||
/* -------------------------- WGL_EXT_depth_float -------------------------- */
|
||||
|
||||
#ifndef WGL_EXT_depth_float
|
||||
#define WGL_EXT_depth_float 1
|
||||
|
||||
#define WGL_DEPTH_FLOAT_EXT 0x2040
|
||||
|
||||
#define WGLEW_EXT_depth_float WGLEW_GET_VAR(__WGLEW_EXT_depth_float)
|
||||
|
||||
#endif /* WGL_EXT_depth_float */
|
||||
|
||||
/* ---------------------- WGL_EXT_display_color_table ---------------------- */
|
||||
|
||||
#ifndef WGL_EXT_display_color_table
|
||||
#define WGL_EXT_display_color_table 1
|
||||
|
||||
typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef void (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (GLushort* table, GLuint length);
|
||||
|
||||
#define wglBindDisplayColorTableEXT WGLEW_GET_FUN(__wglewBindDisplayColorTableEXT)
|
||||
#define wglCreateDisplayColorTableEXT WGLEW_GET_FUN(__wglewCreateDisplayColorTableEXT)
|
||||
#define wglDestroyDisplayColorTableEXT WGLEW_GET_FUN(__wglewDestroyDisplayColorTableEXT)
|
||||
#define wglLoadDisplayColorTableEXT WGLEW_GET_FUN(__wglewLoadDisplayColorTableEXT)
|
||||
|
||||
#define WGLEW_EXT_display_color_table WGLEW_GET_VAR(__WGLEW_EXT_display_color_table)
|
||||
|
||||
#endif /* WGL_EXT_display_color_table */
|
||||
|
||||
/* ----------------------- WGL_EXT_extensions_string ----------------------- */
|
||||
|
||||
#ifndef WGL_EXT_extensions_string
|
||||
#define WGL_EXT_extensions_string 1
|
||||
|
||||
typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
|
||||
|
||||
#define wglGetExtensionsStringEXT WGLEW_GET_FUN(__wglewGetExtensionsStringEXT)
|
||||
|
||||
#define WGLEW_EXT_extensions_string WGLEW_GET_VAR(__WGLEW_EXT_extensions_string)
|
||||
|
||||
#endif /* WGL_EXT_extensions_string */
|
||||
|
||||
/* ----------------------- WGL_EXT_make_current_read ----------------------- */
|
||||
|
||||
#ifndef WGL_EXT_make_current_read
|
||||
#define WGL_EXT_make_current_read 1
|
||||
|
||||
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID);
|
||||
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
|
||||
#define wglGetCurrentReadDCEXT WGLEW_GET_FUN(__wglewGetCurrentReadDCEXT)
|
||||
#define wglMakeContextCurrentEXT WGLEW_GET_FUN(__wglewMakeContextCurrentEXT)
|
||||
|
||||
#define WGLEW_EXT_make_current_read WGLEW_GET_VAR(__WGLEW_EXT_make_current_read)
|
||||
|
||||
#endif /* WGL_EXT_make_current_read */
|
||||
|
||||
/* -------------------------- WGL_EXT_multisample -------------------------- */
|
||||
|
||||
#ifndef WGL_EXT_multisample
|
||||
#define WGL_EXT_multisample 1
|
||||
|
||||
#define WGL_SAMPLE_BUFFERS_EXT 0x2041
|
||||
#define WGL_SAMPLES_EXT 0x2042
|
||||
|
||||
#define WGLEW_EXT_multisample WGLEW_GET_VAR(__WGLEW_EXT_multisample)
|
||||
|
||||
#endif /* WGL_EXT_multisample */
|
||||
|
||||
/* ---------------------------- WGL_EXT_pbuffer ---------------------------- */
|
||||
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
#define WGL_EXT_pbuffer 1
|
||||
|
||||
#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
|
||||
#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
|
||||
#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
|
||||
#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
|
||||
#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
|
||||
#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
|
||||
#define WGL_PBUFFER_LARGEST_EXT 0x2033
|
||||
#define WGL_PBUFFER_WIDTH_EXT 0x2034
|
||||
#define WGL_PBUFFER_HEIGHT_EXT 0x2035
|
||||
|
||||
DECLARE_HANDLE(HPBUFFEREXT);
|
||||
|
||||
typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
|
||||
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue);
|
||||
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
|
||||
|
||||
#define wglCreatePbufferEXT WGLEW_GET_FUN(__wglewCreatePbufferEXT)
|
||||
#define wglDestroyPbufferEXT WGLEW_GET_FUN(__wglewDestroyPbufferEXT)
|
||||
#define wglGetPbufferDCEXT WGLEW_GET_FUN(__wglewGetPbufferDCEXT)
|
||||
#define wglQueryPbufferEXT WGLEW_GET_FUN(__wglewQueryPbufferEXT)
|
||||
#define wglReleasePbufferDCEXT WGLEW_GET_FUN(__wglewReleasePbufferDCEXT)
|
||||
|
||||
#define WGLEW_EXT_pbuffer WGLEW_GET_VAR(__WGLEW_EXT_pbuffer)
|
||||
|
||||
#endif /* WGL_EXT_pbuffer */
|
||||
|
||||
/* -------------------------- WGL_EXT_pixel_format ------------------------- */
|
||||
|
||||
#ifndef WGL_EXT_pixel_format
|
||||
#define WGL_EXT_pixel_format 1
|
||||
|
||||
#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
|
||||
#define WGL_DRAW_TO_WINDOW_EXT 0x2001
|
||||
#define WGL_DRAW_TO_BITMAP_EXT 0x2002
|
||||
#define WGL_ACCELERATION_EXT 0x2003
|
||||
#define WGL_NEED_PALETTE_EXT 0x2004
|
||||
#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
|
||||
#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
|
||||
#define WGL_SWAP_METHOD_EXT 0x2007
|
||||
#define WGL_NUMBER_OVERLAYS_EXT 0x2008
|
||||
#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
|
||||
#define WGL_TRANSPARENT_EXT 0x200A
|
||||
#define WGL_TRANSPARENT_VALUE_EXT 0x200B
|
||||
#define WGL_SHARE_DEPTH_EXT 0x200C
|
||||
#define WGL_SHARE_STENCIL_EXT 0x200D
|
||||
#define WGL_SHARE_ACCUM_EXT 0x200E
|
||||
#define WGL_SUPPORT_GDI_EXT 0x200F
|
||||
#define WGL_SUPPORT_OPENGL_EXT 0x2010
|
||||
#define WGL_DOUBLE_BUFFER_EXT 0x2011
|
||||
#define WGL_STEREO_EXT 0x2012
|
||||
#define WGL_PIXEL_TYPE_EXT 0x2013
|
||||
#define WGL_COLOR_BITS_EXT 0x2014
|
||||
#define WGL_RED_BITS_EXT 0x2015
|
||||
#define WGL_RED_SHIFT_EXT 0x2016
|
||||
#define WGL_GREEN_BITS_EXT 0x2017
|
||||
#define WGL_GREEN_SHIFT_EXT 0x2018
|
||||
#define WGL_BLUE_BITS_EXT 0x2019
|
||||
#define WGL_BLUE_SHIFT_EXT 0x201A
|
||||
#define WGL_ALPHA_BITS_EXT 0x201B
|
||||
#define WGL_ALPHA_SHIFT_EXT 0x201C
|
||||
#define WGL_ACCUM_BITS_EXT 0x201D
|
||||
#define WGL_ACCUM_RED_BITS_EXT 0x201E
|
||||
#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
|
||||
#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
|
||||
#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
|
||||
#define WGL_DEPTH_BITS_EXT 0x2022
|
||||
#define WGL_STENCIL_BITS_EXT 0x2023
|
||||
#define WGL_AUX_BUFFERS_EXT 0x2024
|
||||
#define WGL_NO_ACCELERATION_EXT 0x2025
|
||||
#define WGL_GENERIC_ACCELERATION_EXT 0x2026
|
||||
#define WGL_FULL_ACCELERATION_EXT 0x2027
|
||||
#define WGL_SWAP_EXCHANGE_EXT 0x2028
|
||||
#define WGL_SWAP_COPY_EXT 0x2029
|
||||
#define WGL_SWAP_UNDEFINED_EXT 0x202A
|
||||
#define WGL_TYPE_RGBA_EXT 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_EXT 0x202C
|
||||
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues);
|
||||
|
||||
#define wglChoosePixelFormatEXT WGLEW_GET_FUN(__wglewChoosePixelFormatEXT)
|
||||
#define wglGetPixelFormatAttribfvEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvEXT)
|
||||
#define wglGetPixelFormatAttribivEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribivEXT)
|
||||
|
||||
#define WGLEW_EXT_pixel_format WGLEW_GET_VAR(__WGLEW_EXT_pixel_format)
|
||||
|
||||
#endif /* WGL_EXT_pixel_format */
|
||||
|
||||
/* -------------------------- WGL_EXT_swap_control ------------------------- */
|
||||
|
||||
#ifndef WGL_EXT_swap_control
|
||||
#define WGL_EXT_swap_control 1
|
||||
|
||||
typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
|
||||
|
||||
#define wglGetSwapIntervalEXT WGLEW_GET_FUN(__wglewGetSwapIntervalEXT)
|
||||
#define wglSwapIntervalEXT WGLEW_GET_FUN(__wglewSwapIntervalEXT)
|
||||
|
||||
#define WGLEW_EXT_swap_control WGLEW_GET_VAR(__WGLEW_EXT_swap_control)
|
||||
|
||||
#endif /* WGL_EXT_swap_control */
|
||||
|
||||
/* --------------------- WGL_I3D_digital_video_control --------------------- */
|
||||
|
||||
#ifndef WGL_I3D_digital_video_control
|
||||
#define WGL_I3D_digital_video_control 1
|
||||
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
|
||||
#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
|
||||
|
||||
typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue);
|
||||
|
||||
#define wglGetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewGetDigitalVideoParametersI3D)
|
||||
#define wglSetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewSetDigitalVideoParametersI3D)
|
||||
|
||||
#define WGLEW_I3D_digital_video_control WGLEW_GET_VAR(__WGLEW_I3D_digital_video_control)
|
||||
|
||||
#endif /* WGL_I3D_digital_video_control */
|
||||
|
||||
/* ----------------------------- WGL_I3D_gamma ----------------------------- */
|
||||
|
||||
#ifndef WGL_I3D_gamma
|
||||
#define WGL_I3D_gamma 1
|
||||
|
||||
#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
|
||||
#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
|
||||
|
||||
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue);
|
||||
|
||||
#define wglGetGammaTableI3D WGLEW_GET_FUN(__wglewGetGammaTableI3D)
|
||||
#define wglGetGammaTableParametersI3D WGLEW_GET_FUN(__wglewGetGammaTableParametersI3D)
|
||||
#define wglSetGammaTableI3D WGLEW_GET_FUN(__wglewSetGammaTableI3D)
|
||||
#define wglSetGammaTableParametersI3D WGLEW_GET_FUN(__wglewSetGammaTableParametersI3D)
|
||||
|
||||
#define WGLEW_I3D_gamma WGLEW_GET_VAR(__WGLEW_I3D_gamma)
|
||||
|
||||
#endif /* WGL_I3D_gamma */
|
||||
|
||||
/* ---------------------------- WGL_I3D_genlock ---------------------------- */
|
||||
|
||||
#ifndef WGL_I3D_genlock
|
||||
#define WGL_I3D_genlock 1
|
||||
|
||||
#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
|
||||
#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045
|
||||
#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046
|
||||
#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047
|
||||
#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
|
||||
#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
|
||||
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT* uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT* uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT* uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT* uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL* pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay);
|
||||
|
||||
#define wglDisableGenlockI3D WGLEW_GET_FUN(__wglewDisableGenlockI3D)
|
||||
#define wglEnableGenlockI3D WGLEW_GET_FUN(__wglewEnableGenlockI3D)
|
||||
#define wglGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGenlockSampleRateI3D)
|
||||
#define wglGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGenlockSourceDelayI3D)
|
||||
#define wglGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGenlockSourceEdgeI3D)
|
||||
#define wglGenlockSourceI3D WGLEW_GET_FUN(__wglewGenlockSourceI3D)
|
||||
#define wglGetGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGetGenlockSampleRateI3D)
|
||||
#define wglGetGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGetGenlockSourceDelayI3D)
|
||||
#define wglGetGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGetGenlockSourceEdgeI3D)
|
||||
#define wglGetGenlockSourceI3D WGLEW_GET_FUN(__wglewGetGenlockSourceI3D)
|
||||
#define wglIsEnabledGenlockI3D WGLEW_GET_FUN(__wglewIsEnabledGenlockI3D)
|
||||
#define wglQueryGenlockMaxSourceDelayI3D WGLEW_GET_FUN(__wglewQueryGenlockMaxSourceDelayI3D)
|
||||
|
||||
#define WGLEW_I3D_genlock WGLEW_GET_VAR(__WGLEW_I3D_genlock)
|
||||
|
||||
#endif /* WGL_I3D_genlock */
|
||||
|
||||
/* -------------------------- WGL_I3D_image_buffer ------------------------- */
|
||||
|
||||
#ifndef WGL_I3D_image_buffer
|
||||
#define WGL_I3D_image_buffer 1
|
||||
|
||||
#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
|
||||
#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
|
||||
|
||||
typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count);
|
||||
typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, LPVOID* pAddress, UINT count);
|
||||
|
||||
#define wglAssociateImageBufferEventsI3D WGLEW_GET_FUN(__wglewAssociateImageBufferEventsI3D)
|
||||
#define wglCreateImageBufferI3D WGLEW_GET_FUN(__wglewCreateImageBufferI3D)
|
||||
#define wglDestroyImageBufferI3D WGLEW_GET_FUN(__wglewDestroyImageBufferI3D)
|
||||
#define wglReleaseImageBufferEventsI3D WGLEW_GET_FUN(__wglewReleaseImageBufferEventsI3D)
|
||||
|
||||
#define WGLEW_I3D_image_buffer WGLEW_GET_VAR(__WGLEW_I3D_image_buffer)
|
||||
|
||||
#endif /* WGL_I3D_image_buffer */
|
||||
|
||||
/* ------------------------ WGL_I3D_swap_frame_lock ------------------------ */
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_lock
|
||||
#define WGL_I3D_swap_frame_lock 1
|
||||
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (VOID);
|
||||
typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (VOID);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL* pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL* pFlag);
|
||||
|
||||
#define wglDisableFrameLockI3D WGLEW_GET_FUN(__wglewDisableFrameLockI3D)
|
||||
#define wglEnableFrameLockI3D WGLEW_GET_FUN(__wglewEnableFrameLockI3D)
|
||||
#define wglIsEnabledFrameLockI3D WGLEW_GET_FUN(__wglewIsEnabledFrameLockI3D)
|
||||
#define wglQueryFrameLockMasterI3D WGLEW_GET_FUN(__wglewQueryFrameLockMasterI3D)
|
||||
|
||||
#define WGLEW_I3D_swap_frame_lock WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_lock)
|
||||
|
||||
#endif /* WGL_I3D_swap_frame_lock */
|
||||
|
||||
/* ------------------------ WGL_I3D_swap_frame_usage ----------------------- */
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_usage
|
||||
#define WGL_I3D_swap_frame_usage 1
|
||||
|
||||
typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float* pUsage);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
|
||||
|
||||
#define wglBeginFrameTrackingI3D WGLEW_GET_FUN(__wglewBeginFrameTrackingI3D)
|
||||
#define wglEndFrameTrackingI3D WGLEW_GET_FUN(__wglewEndFrameTrackingI3D)
|
||||
#define wglGetFrameUsageI3D WGLEW_GET_FUN(__wglewGetFrameUsageI3D)
|
||||
#define wglQueryFrameTrackingI3D WGLEW_GET_FUN(__wglewQueryFrameTrackingI3D)
|
||||
|
||||
#define WGLEW_I3D_swap_frame_usage WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_usage)
|
||||
|
||||
#endif /* WGL_I3D_swap_frame_usage */
|
||||
|
||||
/* -------------------------- WGL_NV_float_buffer -------------------------- */
|
||||
|
||||
#ifndef WGL_NV_float_buffer
|
||||
#define WGL_NV_float_buffer 1
|
||||
|
||||
#define WGL_FLOAT_COMPONENTS_NV 0x20B0
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
|
||||
#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
|
||||
#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
|
||||
#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
|
||||
#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
|
||||
|
||||
#define WGLEW_NV_float_buffer WGLEW_GET_VAR(__WGLEW_NV_float_buffer)
|
||||
|
||||
#endif /* WGL_NV_float_buffer */
|
||||
|
||||
/* ---------------------- WGL_NV_render_depth_texture ---------------------- */
|
||||
|
||||
#ifndef WGL_NV_render_depth_texture
|
||||
#define WGL_NV_render_depth_texture 1
|
||||
|
||||
#define WGL_NO_TEXTURE_ARB 0x2077
|
||||
#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
|
||||
#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
|
||||
#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
|
||||
#define WGL_DEPTH_COMPONENT_NV 0x20A7
|
||||
|
||||
#define WGLEW_NV_render_depth_texture WGLEW_GET_VAR(__WGLEW_NV_render_depth_texture)
|
||||
|
||||
#endif /* WGL_NV_render_depth_texture */
|
||||
|
||||
/* -------------------- WGL_NV_render_texture_rectangle -------------------- */
|
||||
|
||||
#ifndef WGL_NV_render_texture_rectangle
|
||||
#define WGL_NV_render_texture_rectangle 1
|
||||
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
|
||||
#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
|
||||
|
||||
#define WGLEW_NV_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_NV_render_texture_rectangle)
|
||||
|
||||
#endif /* WGL_NV_render_texture_rectangle */
|
||||
|
||||
/* ----------------------- WGL_NV_vertex_array_range ----------------------- */
|
||||
|
||||
#ifndef WGL_NV_vertex_array_range
|
||||
#define WGL_NV_vertex_array_range 1
|
||||
|
||||
typedef void * (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority);
|
||||
typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
|
||||
|
||||
#define wglAllocateMemoryNV WGLEW_GET_FUN(__wglewAllocateMemoryNV)
|
||||
#define wglFreeMemoryNV WGLEW_GET_FUN(__wglewFreeMemoryNV)
|
||||
|
||||
#define WGLEW_NV_vertex_array_range WGLEW_GET_VAR(__WGLEW_NV_vertex_array_range)
|
||||
|
||||
#endif /* WGL_NV_vertex_array_range */
|
||||
|
||||
/* -------------------------- WGL_OML_sync_control ------------------------- */
|
||||
|
||||
#ifndef WGL_OML_sync_control
|
||||
#define WGL_OML_sync_control 1
|
||||
|
||||
typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32* numerator, INT32 *denominator);
|
||||
typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc);
|
||||
typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc);
|
||||
typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc);
|
||||
|
||||
#define wglGetMscRateOML WGLEW_GET_FUN(__wglewGetMscRateOML)
|
||||
#define wglGetSyncValuesOML WGLEW_GET_FUN(__wglewGetSyncValuesOML)
|
||||
#define wglSwapBuffersMscOML WGLEW_GET_FUN(__wglewSwapBuffersMscOML)
|
||||
#define wglSwapLayerBuffersMscOML WGLEW_GET_FUN(__wglewSwapLayerBuffersMscOML)
|
||||
#define wglWaitForMscOML WGLEW_GET_FUN(__wglewWaitForMscOML)
|
||||
#define wglWaitForSbcOML WGLEW_GET_FUN(__wglewWaitForSbcOML)
|
||||
|
||||
#define WGLEW_OML_sync_control WGLEW_GET_VAR(__WGLEW_OML_sync_control)
|
||||
|
||||
#endif /* WGL_OML_sync_control */
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef GLEW_MX
|
||||
#define WGLEW_EXPORT
|
||||
#else
|
||||
#define WGLEW_EXPORT GLEWAPI
|
||||
#endif /* GLEW_MX */
|
||||
|
||||
#ifdef GLEW_MX
|
||||
struct WGLEWContextStruct
|
||||
{
|
||||
#endif /* GLEW_MX */
|
||||
|
||||
WGLEW_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL;
|
||||
|
||||
WGLEW_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB;
|
||||
WGLEW_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB;
|
||||
WGLEW_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB;
|
||||
WGLEW_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB;
|
||||
|
||||
WGLEW_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB;
|
||||
|
||||
WGLEW_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB;
|
||||
WGLEW_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB;
|
||||
|
||||
WGLEW_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB;
|
||||
WGLEW_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB;
|
||||
WGLEW_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB;
|
||||
WGLEW_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB;
|
||||
WGLEW_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB;
|
||||
|
||||
WGLEW_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB;
|
||||
WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB;
|
||||
WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB;
|
||||
|
||||
WGLEW_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB;
|
||||
WGLEW_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB;
|
||||
WGLEW_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB;
|
||||
|
||||
WGLEW_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT;
|
||||
WGLEW_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT;
|
||||
WGLEW_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT;
|
||||
WGLEW_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT;
|
||||
|
||||
WGLEW_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT;
|
||||
|
||||
WGLEW_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT;
|
||||
WGLEW_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT;
|
||||
|
||||
WGLEW_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT;
|
||||
WGLEW_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT;
|
||||
WGLEW_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT;
|
||||
WGLEW_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT;
|
||||
WGLEW_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT;
|
||||
|
||||
WGLEW_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT;
|
||||
WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT;
|
||||
WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT;
|
||||
|
||||
WGLEW_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT;
|
||||
WGLEW_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT;
|
||||
|
||||
WGLEW_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D;
|
||||
WGLEW_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D;
|
||||
|
||||
WGLEW_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D;
|
||||
WGLEW_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D;
|
||||
WGLEW_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D;
|
||||
WGLEW_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D;
|
||||
|
||||
WGLEW_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D;
|
||||
WGLEW_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D;
|
||||
WGLEW_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D;
|
||||
WGLEW_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D;
|
||||
WGLEW_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D;
|
||||
WGLEW_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D;
|
||||
WGLEW_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D;
|
||||
WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D;
|
||||
WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D;
|
||||
WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D;
|
||||
WGLEW_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D;
|
||||
WGLEW_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D;
|
||||
|
||||
WGLEW_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D;
|
||||
WGLEW_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D;
|
||||
WGLEW_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D;
|
||||
WGLEW_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D;
|
||||
|
||||
WGLEW_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D;
|
||||
WGLEW_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D;
|
||||
WGLEW_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D;
|
||||
WGLEW_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D;
|
||||
|
||||
WGLEW_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D;
|
||||
WGLEW_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D;
|
||||
WGLEW_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D;
|
||||
WGLEW_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D;
|
||||
|
||||
WGLEW_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV;
|
||||
WGLEW_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV;
|
||||
|
||||
WGLEW_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML;
|
||||
WGLEW_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML;
|
||||
WGLEW_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML;
|
||||
WGLEW_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML;
|
||||
WGLEW_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML;
|
||||
WGLEW_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_3DFX_multisample;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_3DL_stereo_control;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_ARB_buffer_region;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_ARB_extensions_string;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_ARB_make_current_read;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_ARB_multisample;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_ARB_pbuffer;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_ARB_pixel_format;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_ARB_pixel_format_float;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_ARB_render_texture;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_ATI_pixel_format_float;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_EXT_depth_float;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_EXT_display_color_table;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_EXT_extensions_string;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_EXT_make_current_read;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_EXT_multisample;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_EXT_pbuffer;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_EXT_pixel_format;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_EXT_swap_control;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_I3D_digital_video_control;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_I3D_gamma;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_I3D_genlock;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_I3D_image_buffer;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_NV_float_buffer;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_NV_render_depth_texture;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_NV_vertex_array_range;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_OML_sync_control;
|
||||
|
||||
#ifdef GLEW_MX
|
||||
}; /* WGLEWContextStruct */
|
||||
#endif /* GLEW_MX */
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef GLEW_MX
|
||||
|
||||
typedef struct WGLEWContextStruct WGLEWContext;
|
||||
GLEWAPI GLenum wglewContextInit (WGLEWContext* ctx);
|
||||
GLEWAPI GLboolean wglewContextIsSupported (WGLEWContext* ctx, const char* name);
|
||||
|
||||
#define wglewInit() wglewContextInit(wglewGetContext())
|
||||
#define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x)
|
||||
|
||||
#define WGLEW_GET_VAR(x) wglewGetContext()->x
|
||||
#define WGLEW_GET_FUN(x) wglewGetContext()->x
|
||||
|
||||
#else /* GLEW_MX */
|
||||
|
||||
#define WGLEW_GET_VAR(x) x
|
||||
#define WGLEW_GET_FUN(x) x
|
||||
|
||||
GLEWAPI GLboolean wglewIsSupported (const char* name);
|
||||
|
||||
#endif /* GLEW_MX */
|
||||
|
||||
GLEWAPI GLboolean wglewGetExtension (const char* name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#undef GLEWAPI
|
||||
|
||||
#endif /* __wglew_h__ */
|
||||
146
extern/glew/make/msvc_7_0/glew_vc7.vcproj
vendored
Normal file
146
extern/glew/make/msvc_7_0/glew_vc7.vcproj
vendored
Normal file
@@ -0,0 +1,146 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="glew"
|
||||
ProjectGUID="{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Blender Debug|Win32"
|
||||
OutputDirectory="..\..\..\..\..\build\msvc_7\extern\glew\debug"
|
||||
IntermediateDirectory="..\..\..\..\..\build\msvc_7\extern\glew\debug"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
|
||||
MinimalRebuild="FALSE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\extern\glew\debug\glew.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\build\msvc_7\extern\glew\debug\"
|
||||
ObjectFile="..\..\..\..\..\build\msvc_7\extern\glew\debug\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\extern\glew\debug\"
|
||||
WarningLevel="2"
|
||||
Detect64BitPortabilityProblems="FALSE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\build\msvc_7\libs\extern\debug\glew.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Copying GLEW files library (debug target) to lib tree."
|
||||
CommandLine="ECHO Copying header files
|
||||
IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\glew\include\GL MKDIR ..\..\..\..\..\build\msvc_7\extern\glew\include\GL
|
||||
XCOPY /Y ..\..\include\GL\*.h ..\..\..\..\..\build\msvc_7\extern\glew\include\GL
|
||||
ECHO Done
|
||||
"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Blender Release|Win32"
|
||||
OutputDirectory="..\..\..\..\..\build\msvc_7\extern\glew"
|
||||
IntermediateDirectory="..\..\..\..\..\build\msvc_7\extern\glew"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\extern\glew\glew.pch"
|
||||
AssemblerListingLocation="..\..\..\..\..\build\msvc_7\extern\glew\"
|
||||
ObjectFile="..\..\..\..\..\build\msvc_7\extern\glew\"
|
||||
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\extern\glew\"
|
||||
WarningLevel="2"
|
||||
Detect64BitPortabilityProblems="FALSE"
|
||||
DebugInformationFormat="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\..\..\build\msvc_7\libs\extern\glew.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Copying GLEW files library to lib tree."
|
||||
CommandLine="ECHO Copying header files
|
||||
IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\glew\include\GL MKDIR ..\..\..\..\..\build\msvc_7\extern\glew\include\GL
|
||||
XCOPY /Y ..\..\include\GL\*.h ..\..\..\..\..\build\msvc_7\extern\glew\include\GL
|
||||
ECHO Done
|
||||
"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||
<File
|
||||
RelativePath="..\..\src\glew.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
<File
|
||||
RelativePath="..\..\include\GL\glew.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\GL\glxew.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\GL\wglew.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
56
extern/glew/src/Makefile
vendored
Normal file
56
extern/glew/src/Makefile
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version. The Blender
|
||||
# Foundation also sells licenses for use in proprietary software under
|
||||
# the Blender License. See http://www.blender.org/BL/ for information
|
||||
# about this.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
# All rights reserved.
|
||||
#
|
||||
# The Original Code is: all of this file.
|
||||
#
|
||||
# Contributor(s): none yet.
|
||||
#
|
||||
# ***** END GPL/BL DUAL LICENSE BLOCK *****
|
||||
#
|
||||
#
|
||||
|
||||
LIBNAME = glew
|
||||
DIR = $(OCGDIR)/extern/$(LIBNAME)
|
||||
|
||||
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
|
||||
|
||||
CPPFLAGS += -I../include
|
||||
|
||||
CSRCS = glew.c
|
||||
CCSRCS =
|
||||
include nan_compile.mk
|
||||
|
||||
install: all debug
|
||||
@[ -d $(NAN_GLEW) ] || mkdir -p $(NAN_GLEW)
|
||||
@[ -d $(NAN_GLEW)/include/GL ] || mkdir -p $(NAN_GLEW)/include/GL
|
||||
@[ -d $(NAN_GLEW)/lib ] || mkdir -p $(NAN_GLEW)/lib
|
||||
@[ -d $(NAN_GLEW)/lib/debug ] || mkdir -p $(NAN_GLEW)/lib/debug
|
||||
@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/lib$(LIBNAME).a $(NAN_GLEW)/lib/
|
||||
ifeq ($(OS),darwin)
|
||||
ranlib $(NAN_GLEW)/lib/lib$(LIBNAME).a
|
||||
ranlib $(NAN_GLEW)/lib/lib$(LIBNAME).a
|
||||
endif
|
||||
@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh ../include/GL/*.h $(NAN_GLEW)/include/GL
|
||||
|
||||
9756
extern/glew/src/glew.c
vendored
Normal file
9756
extern/glew/src/glew.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
extern/libopenjpeg/opj_malloc.h
vendored
6
extern/libopenjpeg/opj_malloc.h
vendored
@@ -76,8 +76,10 @@ Allocate memory aligned to a 16 byte boundry
|
||||
#if defined(__sun)
|
||||
#define HAVE_MEMALIGN
|
||||
#elif defined(__GNUC__)
|
||||
#define HAVE_MEMALIGN
|
||||
#include <malloc.h>
|
||||
#ifndef __APPLE__
|
||||
#define HAVE_MEMALIGN
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
/* Linux x86_64 and OSX always align allocations to 16 bytes */
|
||||
#elif !defined(__amd64__) && !defined(__APPLE__)
|
||||
/* FIXME: Yes, this is a big assumption */
|
||||
|
||||
17
extern/libopenjpeg/patches/osx.patch
vendored
Normal file
17
extern/libopenjpeg/patches/osx.patch
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
Index: opj_malloc.h
|
||||
===================================================================
|
||||
--- opj_malloc.h (revision 15089)
|
||||
+++ opj_malloc.h (working copy)
|
||||
@@ -76,8 +76,10 @@
|
||||
#if defined(__sun)
|
||||
#define HAVE_MEMALIGN
|
||||
#elif defined(__GNUC__)
|
||||
- #define HAVE_MEMALIGN
|
||||
- #include <malloc.h>
|
||||
+ #ifndef __APPLE__
|
||||
+ #define HAVE_MEMALIGN
|
||||
+ #include <malloc.h>
|
||||
+ #endif
|
||||
/* Linux x86_64 and OSX always align allocations to 16 bytes */
|
||||
#elif !defined(__amd64__) && !defined(__APPLE__)
|
||||
/* FIXME: Yes, this is a big assumption */
|
||||
24
extern/libredcode/debayer.c
vendored
24
extern/libredcode/debayer.c
vendored
@@ -9,8 +9,6 @@ void redcode_ycbcr2rgb_fullscale(
|
||||
int x,y;
|
||||
int pix_max = 4096;
|
||||
int mask = pix_max - 1;
|
||||
float Kb = 0.0722;
|
||||
float Kr = 0.2126;
|
||||
float *o;
|
||||
|
||||
for (y = 0; y < height; y++) {
|
||||
@@ -25,9 +23,9 @@ void redcode_ycbcr2rgb_fullscale(
|
||||
float y2 = (planes[3][i] & mask);
|
||||
float y2p = (planes[3][i_p] & mask);
|
||||
|
||||
float b_ = cb * (1.0 - Kb)/(pix_max/2);
|
||||
float r_ = cr * (1.0 - Kr)/(pix_max/2);
|
||||
float g_ = (- Kr * r_ - Kb * b_)/(1.0 - Kr - Kb);
|
||||
float b_ = cb /(pix_max/2);
|
||||
float r_ = cr /(pix_max/2);
|
||||
float g_ = 0.0;
|
||||
|
||||
float y_[4] = {y1 / pix_max,
|
||||
(y2 + y2p)/2 / pix_max,
|
||||
@@ -68,8 +66,6 @@ void redcode_ycbcr2rgb_halfscale(
|
||||
int x,y;
|
||||
int pix_max = 4096;
|
||||
int mask = pix_max - 1;
|
||||
float Kb = 0.0722;
|
||||
float Kr = 0.2126;
|
||||
|
||||
for (y = 0; y < height; y++) {
|
||||
float *o = out + width * (height - y - 1);
|
||||
@@ -80,9 +76,9 @@ void redcode_ycbcr2rgb_halfscale(
|
||||
float cr = (planes[2][i] & mask) - pix_max/2;
|
||||
float y2 = (planes[3][i] & mask);
|
||||
|
||||
float b_ = cb * (1.0 - Kb)/(pix_max/2);
|
||||
float r_ = cr * (1.0 - Kr)/(pix_max/2);
|
||||
float g_ = (- Kr * r_ - Kb * b_)/(1.0 - Kr - Kb);
|
||||
float b_ = cb /(pix_max/2);
|
||||
float r_ = cr /(pix_max/2);
|
||||
float g_ = 0.0;
|
||||
|
||||
float y = (y1 + y2)/2 / pix_max;
|
||||
|
||||
@@ -101,8 +97,6 @@ void redcode_ycbcr2rgb_quarterscale(
|
||||
int x,y;
|
||||
int pix_max = 4096;
|
||||
int mask = pix_max - 1;
|
||||
float Kb = 0.0722;
|
||||
float Kr = 0.2126;
|
||||
|
||||
for (y = 0; y < height; y += 2) {
|
||||
float *o = out + (width/2) * (height/2 - y/2 - 1);
|
||||
@@ -113,9 +107,9 @@ void redcode_ycbcr2rgb_quarterscale(
|
||||
float cr = (planes[2][i] & mask) - pix_max/2;
|
||||
float y2 = planes[3][i] & mask;
|
||||
|
||||
float b_ = cb * (1.0 - Kb)/(pix_max/2);
|
||||
float r_ = cr * (1.0 - Kr)/(pix_max/2);
|
||||
float g_ = (- Kr * r_ - Kb * b_)/(1.0 - Kr - Kb);
|
||||
float b_ = cb /(pix_max/2);
|
||||
float r_ = cr /(pix_max/2);
|
||||
float g_ = 0.0;
|
||||
|
||||
float y = (y1 + y2)/2 / pix_max;
|
||||
|
||||
|
||||
65
extern/make/msvc_7_0/extern.sln
vendored
65
extern/make/msvc_7_0/extern.sln
vendored
@@ -8,6 +8,7 @@ EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "solid", "..\..\solid\make\msvc_7_0\solid.vcproj", "{D696C86B-0B53-4471-A50D-5B983A6FA4AD}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{6461F05D-4698-47AB-A8E8-1CA2ACC9948B} = {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}
|
||||
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A} = {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}
|
||||
{0112CAD5-3584-412A-A2E5-1315A00437B4} = {0112CAD5-3584-412A-A2E5-1315A00437B4}
|
||||
{B83C6BED-11EC-46C8-AFFA-121EEDE94373} = {B83C6BED-11EC-46C8-AFFA-121EEDE94373}
|
||||
{524264F4-DF21-4B79-847F-E7CA643ECD0B} = {524264F4-DF21-4B79-847F-E7CA643ECD0B}
|
||||
@@ -46,6 +47,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bullet2", "..\..\bullet2\ma
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glew", "..\..\glew\make\msvc_7_0\glew_vc7.vcproj", "{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
3D Plugin Debug = 3D Plugin Debug
|
||||
@@ -54,6 +59,10 @@ Global
|
||||
Blender Release = Blender Release
|
||||
BlenderPlayer Debug = BlenderPlayer Debug
|
||||
BlenderPlayer Release = BlenderPlayer Release
|
||||
Debug = Debug
|
||||
Release = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectDependencies) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{9C71A793-C177-4CAB-8EC5-923D500B39F8}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32
|
||||
@@ -68,6 +77,10 @@ Global
|
||||
{9C71A793-C177-4CAB-8EC5-923D500B39F8}.BlenderPlayer Debug.Build.0 = Blender Release|Win32
|
||||
{9C71A793-C177-4CAB-8EC5-923D500B39F8}.BlenderPlayer Release.ActiveCfg = Blender Release|Win32
|
||||
{9C71A793-C177-4CAB-8EC5-923D500B39F8}.BlenderPlayer Release.Build.0 = Blender Release|Win32
|
||||
{9C71A793-C177-4CAB-8EC5-923D500B39F8}.Debug.ActiveCfg = 3D Plugin Debug|Win32
|
||||
{9C71A793-C177-4CAB-8EC5-923D500B39F8}.Debug.Build.0 = 3D Plugin Debug|Win32
|
||||
{9C71A793-C177-4CAB-8EC5-923D500B39F8}.Release.ActiveCfg = 3D Plugin Release|Win32
|
||||
{9C71A793-C177-4CAB-8EC5-923D500B39F8}.Release.Build.0 = 3D Plugin Release|Win32
|
||||
{D696C86B-0B53-4471-A50D-5B983A6FA4AD}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32
|
||||
{D696C86B-0B53-4471-A50D-5B983A6FA4AD}.3D Plugin Debug.Build.0 = 3D Plugin Debug|Win32
|
||||
{D696C86B-0B53-4471-A50D-5B983A6FA4AD}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32
|
||||
@@ -80,6 +93,10 @@ Global
|
||||
{D696C86B-0B53-4471-A50D-5B983A6FA4AD}.BlenderPlayer Debug.Build.0 = Blender Release|Win32
|
||||
{D696C86B-0B53-4471-A50D-5B983A6FA4AD}.BlenderPlayer Release.ActiveCfg = Blender Release|Win32
|
||||
{D696C86B-0B53-4471-A50D-5B983A6FA4AD}.BlenderPlayer Release.Build.0 = Blender Release|Win32
|
||||
{D696C86B-0B53-4471-A50D-5B983A6FA4AD}.Debug.ActiveCfg = 3D Plugin Debug|Win32
|
||||
{D696C86B-0B53-4471-A50D-5B983A6FA4AD}.Debug.Build.0 = 3D Plugin Debug|Win32
|
||||
{D696C86B-0B53-4471-A50D-5B983A6FA4AD}.Release.ActiveCfg = 3D Plugin Release|Win32
|
||||
{D696C86B-0B53-4471-A50D-5B983A6FA4AD}.Release.Build.0 = 3D Plugin Release|Win32
|
||||
{6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32
|
||||
{6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.3D Plugin Debug.Build.0 = 3D Plugin Debug|Win32
|
||||
{6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32
|
||||
@@ -92,6 +109,10 @@ Global
|
||||
{6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.BlenderPlayer Debug.Build.0 = Blender Debug|Win32
|
||||
{6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.BlenderPlayer Release.ActiveCfg = Blender Debug|Win32
|
||||
{6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.BlenderPlayer Release.Build.0 = Blender Debug|Win32
|
||||
{6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.Debug.ActiveCfg = 3D Plugin Debug|Win32
|
||||
{6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.Debug.Build.0 = 3D Plugin Debug|Win32
|
||||
{6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.Release.ActiveCfg = 3D Plugin Release|Win32
|
||||
{6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.Release.Build.0 = 3D Plugin Release|Win32
|
||||
{524264F4-DF21-4B79-847F-E7CA643ECD0B}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32
|
||||
{524264F4-DF21-4B79-847F-E7CA643ECD0B}.3D Plugin Debug.Build.0 = 3D Plugin Debug|Win32
|
||||
{524264F4-DF21-4B79-847F-E7CA643ECD0B}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32
|
||||
@@ -104,6 +125,10 @@ Global
|
||||
{524264F4-DF21-4B79-847F-E7CA643ECD0B}.BlenderPlayer Debug.Build.0 = Blender Release|Win32
|
||||
{524264F4-DF21-4B79-847F-E7CA643ECD0B}.BlenderPlayer Release.ActiveCfg = Blender Release|Win32
|
||||
{524264F4-DF21-4B79-847F-E7CA643ECD0B}.BlenderPlayer Release.Build.0 = Blender Release|Win32
|
||||
{524264F4-DF21-4B79-847F-E7CA643ECD0B}.Debug.ActiveCfg = 3D Plugin Debug|Win32
|
||||
{524264F4-DF21-4B79-847F-E7CA643ECD0B}.Debug.Build.0 = 3D Plugin Debug|Win32
|
||||
{524264F4-DF21-4B79-847F-E7CA643ECD0B}.Release.ActiveCfg = 3D Plugin Release|Win32
|
||||
{524264F4-DF21-4B79-847F-E7CA643ECD0B}.Release.Build.0 = 3D Plugin Release|Win32
|
||||
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32
|
||||
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.3D Plugin Debug.Build.0 = 3D Plugin Debug|Win32
|
||||
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32
|
||||
@@ -116,6 +141,10 @@ Global
|
||||
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.BlenderPlayer Debug.Build.0 = Blender Debug|Win32
|
||||
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.BlenderPlayer Release.ActiveCfg = Blender Debug|Win32
|
||||
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.BlenderPlayer Release.Build.0 = Blender Debug|Win32
|
||||
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.Debug.ActiveCfg = 3D Plugin Debug|Win32
|
||||
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.Debug.Build.0 = 3D Plugin Debug|Win32
|
||||
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.Release.ActiveCfg = 3D Plugin Release|Win32
|
||||
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.Release.Build.0 = 3D Plugin Release|Win32
|
||||
{0112CAD5-3584-412A-A2E5-1315A00437B4}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32
|
||||
{0112CAD5-3584-412A-A2E5-1315A00437B4}.3D Plugin Debug.Build.0 = 3D Plugin Debug|Win32
|
||||
{0112CAD5-3584-412A-A2E5-1315A00437B4}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32
|
||||
@@ -128,6 +157,10 @@ Global
|
||||
{0112CAD5-3584-412A-A2E5-1315A00437B4}.BlenderPlayer Debug.Build.0 = Blender Debug|Win32
|
||||
{0112CAD5-3584-412A-A2E5-1315A00437B4}.BlenderPlayer Release.ActiveCfg = Blender Debug|Win32
|
||||
{0112CAD5-3584-412A-A2E5-1315A00437B4}.BlenderPlayer Release.Build.0 = Blender Debug|Win32
|
||||
{0112CAD5-3584-412A-A2E5-1315A00437B4}.Debug.ActiveCfg = 3D Plugin Debug|Win32
|
||||
{0112CAD5-3584-412A-A2E5-1315A00437B4}.Debug.Build.0 = 3D Plugin Debug|Win32
|
||||
{0112CAD5-3584-412A-A2E5-1315A00437B4}.Release.ActiveCfg = 3D Plugin Release|Win32
|
||||
{0112CAD5-3584-412A-A2E5-1315A00437B4}.Release.Build.0 = 3D Plugin Release|Win32
|
||||
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32
|
||||
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.3D Plugin Debug.Build.0 = 3D Plugin Debug|Win32
|
||||
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32
|
||||
@@ -140,6 +173,10 @@ Global
|
||||
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.BlenderPlayer Debug.Build.0 = Blender Release|Win32
|
||||
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.BlenderPlayer Release.ActiveCfg = Blender Release|Win32
|
||||
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.BlenderPlayer Release.Build.0 = Blender Release|Win32
|
||||
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Debug.ActiveCfg = 3D Plugin Debug|Win32
|
||||
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Debug.Build.0 = 3D Plugin Debug|Win32
|
||||
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Release.ActiveCfg = 3D Plugin Release|Win32
|
||||
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Release.Build.0 = 3D Plugin Release|Win32
|
||||
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32
|
||||
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.3D Plugin Debug.Build.0 = 3D Plugin Debug|Win32
|
||||
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32
|
||||
@@ -152,6 +189,10 @@ Global
|
||||
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.BlenderPlayer Debug.Build.0 = Blender Release|Win32
|
||||
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.BlenderPlayer Release.ActiveCfg = Blender Release|Win32
|
||||
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.BlenderPlayer Release.Build.0 = Blender Release|Win32
|
||||
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Debug.ActiveCfg = 3D Plugin Debug|Win32
|
||||
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Debug.Build.0 = 3D Plugin Debug|Win32
|
||||
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Release.ActiveCfg = 3D Plugin Release|Win32
|
||||
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Release.Build.0 = 3D Plugin Release|Win32
|
||||
{FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32
|
||||
{FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32
|
||||
{FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.Blender Debug.ActiveCfg = Blender Debug|Win32
|
||||
@@ -160,6 +201,10 @@ Global
|
||||
{FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.Blender Release.Build.0 = Blender Release|Win32
|
||||
{FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.BlenderPlayer Debug.ActiveCfg = BlenderPlayer Debug|Win32
|
||||
{FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.BlenderPlayer Release.ActiveCfg = BlenderPlayer Release|Win32
|
||||
{FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.Debug.ActiveCfg = BlenderPlayer Debug|Win32
|
||||
{FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.Debug.Build.0 = BlenderPlayer Debug|Win32
|
||||
{FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.Release.ActiveCfg = BlenderPlayer Release|Win32
|
||||
{FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.Release.Build.0 = BlenderPlayer Release|Win32
|
||||
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32
|
||||
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.3D Plugin Debug.Build.0 = 3D Plugin Debug|Win32
|
||||
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32
|
||||
@@ -172,6 +217,26 @@ Global
|
||||
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.BlenderPlayer Debug.Build.0 = Blender Release|Win32
|
||||
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.BlenderPlayer Release.ActiveCfg = Blender Release|Win32
|
||||
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.BlenderPlayer Release.Build.0 = Blender Release|Win32
|
||||
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.Debug.ActiveCfg = 3D Plugin Debug|Win32
|
||||
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.Debug.Build.0 = 3D Plugin Debug|Win32
|
||||
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.Release.ActiveCfg = 3D Plugin Release|Win32
|
||||
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.Release.Build.0 = 3D Plugin Release|Win32
|
||||
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.3D Plugin Debug.ActiveCfg = Blender Release|Win32
|
||||
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.3D Plugin Debug.Build.0 = Blender Release|Win32
|
||||
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.3D Plugin Release.ActiveCfg = Blender Release|Win32
|
||||
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.3D Plugin Release.Build.0 = Blender Release|Win32
|
||||
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Blender Debug.ActiveCfg = Blender Debug|Win32
|
||||
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Blender Debug.Build.0 = Blender Debug|Win32
|
||||
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Blender Release.ActiveCfg = Blender Release|Win32
|
||||
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Blender Release.Build.0 = Blender Release|Win32
|
||||
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.BlenderPlayer Debug.ActiveCfg = Blender Release|Win32
|
||||
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.BlenderPlayer Debug.Build.0 = Blender Release|Win32
|
||||
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.BlenderPlayer Release.ActiveCfg = Blender Release|Win32
|
||||
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.BlenderPlayer Release.Build.0 = Blender Release|Win32
|
||||
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Debug.ActiveCfg = Blender Debug|Win32
|
||||
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Debug.Build.0 = Blender Debug|Win32
|
||||
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Release.ActiveCfg = Blender Release|Win32
|
||||
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Release.Build.0 = Blender Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
|
||||
@@ -197,7 +197,7 @@ BuildEdges(
|
||||
|
||||
for (int vert = 0; vert < vertex_num; ++vert) {
|
||||
|
||||
BSP_FaceInd fi(f_it - f_it_begin);
|
||||
BSP_FaceInd fi(size_t (f_it - f_it_begin));
|
||||
InsertEdge(prev_vi,face.m_verts[vert],fi,dummy);
|
||||
prev_vi = face.m_verts[vert];
|
||||
}
|
||||
|
||||
@@ -93,6 +93,16 @@ public:
|
||||
}
|
||||
|
||||
|
||||
#if defined(_WIN64)
|
||||
CTR_TaggedIndex(
|
||||
const unsigned __int64 val
|
||||
) :
|
||||
m_val ( ((unsigned __int64)val & index_mask)
|
||||
| ( (empty_tag << tag_shift)
|
||||
& (~index_mask) ) ) {
|
||||
}
|
||||
#endif
|
||||
|
||||
CTR_TaggedIndex(
|
||||
const CTR_TaggedIndex &my_index
|
||||
):
|
||||
@@ -124,6 +134,12 @@ public:
|
||||
return (long int)(m_val & index_mask);
|
||||
}
|
||||
|
||||
#if defined(_WIN64)
|
||||
operator unsigned __int64 () const {
|
||||
return (unsigned __int64)(m_val & index_mask);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool
|
||||
IsEmpty(
|
||||
) const {
|
||||
|
||||
@@ -477,7 +477,7 @@ DeleteVertex(
|
||||
return;
|
||||
}
|
||||
|
||||
LOD_VertexInd last = LOD_VertexInd(verts.end() - verts.begin() - 1);
|
||||
LOD_VertexInd last = LOD_VertexInd(size_t(verts.end() - verts.begin() - 1));
|
||||
|
||||
if (!(last == v)) {
|
||||
|
||||
@@ -533,7 +533,7 @@ DeleteEdge(
|
||||
return;
|
||||
}
|
||||
|
||||
LOD_EdgeInd last = LOD_EdgeInd(edges.end() - edges.begin() - 1);
|
||||
LOD_EdgeInd last = LOD_EdgeInd(size_t(edges.end() - edges.begin() - 1));
|
||||
|
||||
if (!(last == e)) {
|
||||
vector<LOD_EdgeInd> e_verts;
|
||||
@@ -573,7 +573,7 @@ DeleteFace(
|
||||
return;
|
||||
}
|
||||
|
||||
LOD_FaceInd last = LOD_FaceInd(faces.end() - faces.begin() - 1);
|
||||
LOD_FaceInd last = LOD_FaceInd(size_t (faces.end() - faces.begin() - 1));
|
||||
|
||||
if (!(last == f)) {
|
||||
|
||||
|
||||
@@ -694,7 +694,7 @@ bool LbmFsgrSolver::initializeSolverMemory()
|
||||
double maxDefaultMemChunk = 2.*1024.*1024.*1024.;
|
||||
//std::cerr<<" memEstFine "<< memEstFine <<" maxWin:" <<maxWinMemChunk <<" maxMac:" <<maxMacMemChunk ; // DEBUG
|
||||
#ifdef WIN32
|
||||
if(memEstFine> maxWinMemChunk) {
|
||||
if(sizeof(void *)==4 && memEstFine>maxWinMemChunk) {
|
||||
memBlockAllocProblem = true;
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
@@ -42,6 +42,14 @@
|
||||
|
||||
#include "GHOST_SystemWin32.h"
|
||||
|
||||
// win64 doesn't define GWL_USERDATA
|
||||
#ifdef WIN32
|
||||
#ifndef GWL_USERDATA
|
||||
#define GWL_USERDATA GWLP_USERDATA
|
||||
#define GWL_WNDPROC GWLP_WNDPROC
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* According to the docs the mouse wheel message is supported from windows 98
|
||||
* upwards. Leaving WINVER at default value, the WM_MOUSEWHEEL message and the
|
||||
@@ -302,6 +310,15 @@ GHOST_TSuccess GHOST_SystemWin32::init()
|
||||
{
|
||||
GHOST_TSuccess success = GHOST_System::init();
|
||||
|
||||
/* Disable scaling on high DPI displays on Vista */
|
||||
HMODULE user32 = ::LoadLibraryA("user32.dll");
|
||||
typedef BOOL (WINAPI * LPFNSETPROCESSDPIAWARE)();
|
||||
LPFNSETPROCESSDPIAWARE SetProcessDPIAware =
|
||||
(LPFNSETPROCESSDPIAWARE)GetProcAddress(user32, "SetProcessDPIAware");
|
||||
if (SetProcessDPIAware)
|
||||
SetProcessDPIAware();
|
||||
FreeLibrary(user32);
|
||||
|
||||
// Determine whether this system has a high frequency performance counter. */
|
||||
m_hasPerformanceCounter = ::QueryPerformanceFrequency((LARGE_INTEGER*)&m_freq) == TRUE;
|
||||
if (m_hasPerformanceCounter) {
|
||||
|
||||
@@ -488,12 +488,12 @@ GHOST_SystemX11::processEvent(XEvent *xe)
|
||||
data.changed = 1;
|
||||
data.delta = xcme.data.s[8] - data.time;
|
||||
data.time = xcme.data.s[8];
|
||||
data.tx = xcme.data.s[2];
|
||||
data.ty = xcme.data.s[3];
|
||||
data.tz = xcme.data.s[4];
|
||||
data.tx = xcme.data.s[2] >> 2;
|
||||
data.ty = xcme.data.s[3] >> 2;
|
||||
data.tz = xcme.data.s[4] >> 2;
|
||||
data.rx = xcme.data.s[5];
|
||||
data.ry = xcme.data.s[6];
|
||||
data.rz = xcme.data.s[7];
|
||||
data.rz =-xcme.data.s[7];
|
||||
g_event = new GHOST_EventNDOF(getMilliSeconds(),
|
||||
GHOST_kEventNDOFMotion,
|
||||
window, data);
|
||||
|
||||
@@ -48,6 +48,14 @@
|
||||
#define M_PI 3.1415926536
|
||||
#endif
|
||||
|
||||
// win64 doesn't define GWL_USERDATA
|
||||
#ifdef WIN32
|
||||
#ifndef GWL_USERDATA
|
||||
#define GWL_USERDATA GWLP_USERDATA
|
||||
#define GWL_WNDPROC GWLP_WNDPROC
|
||||
#endif
|
||||
#endif
|
||||
|
||||
LPCSTR GHOST_WindowWin32::s_windowClassName = "GHOST_WindowClass";
|
||||
const int GHOST_WindowWin32::s_maxTitleLength = 128;
|
||||
HGLRC GHOST_WindowWin32::s_firsthGLRc = NULL;
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
|
||||
virtual bool PositionTask() const { return false; }
|
||||
|
||||
virtual void Scale(float scale) {}
|
||||
virtual void Scale(float) {}
|
||||
|
||||
protected:
|
||||
int m_id;
|
||||
|
||||
@@ -82,6 +82,24 @@ public:
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Key* getKey(int index) {
|
||||
int count=0;
|
||||
for (int i=0;i<m_num_buckets;i++)
|
||||
{
|
||||
Entry* bucket = m_buckets[i];
|
||||
while(bucket)
|
||||
{
|
||||
if (count==index)
|
||||
{
|
||||
return &bucket->m_key;
|
||||
}
|
||||
bucket = bucket->m_next;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void clear() {
|
||||
for (int i = 0; i < m_num_buckets; ++i) {
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#define MT_RAND_MAX ULONG_MAX
|
||||
#define MT_RAND_MAX UINT_MAX
|
||||
|
||||
extern void MT_srand(unsigned long);
|
||||
extern unsigned long MT_rand();
|
||||
extern void MT_srand(unsigned int);
|
||||
extern unsigned int MT_rand();
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -76,11 +76,11 @@
|
||||
#define TEMPERING_SHIFT_T(y) (y << 15)
|
||||
#define TEMPERING_SHIFT_L(y) (y >> 18)
|
||||
|
||||
static unsigned long mt[N]; /* the array for the state vector */
|
||||
static unsigned int mt[N]; /* the array for the state vector */
|
||||
static int mti = N+1; /* mti==N+1 means mt[N] is not initialized */
|
||||
|
||||
/* initializing the array with a NONZERO seed */
|
||||
void MT_srand(unsigned long seed)
|
||||
void MT_srand(unsigned int seed)
|
||||
{
|
||||
/* setting initial seeds to mt[N] using */
|
||||
/* the generator Line 25 of Table 1 in */
|
||||
@@ -91,12 +91,12 @@ void MT_srand(unsigned long seed)
|
||||
mt[mti] = (69069 * mt[mti-1]) & 0xffffffff;
|
||||
}
|
||||
|
||||
unsigned long MT_rand()
|
||||
unsigned int MT_rand()
|
||||
{
|
||||
static unsigned long mag01[2] = { 0x0, MATRIX_A };
|
||||
static unsigned int mag01[2] = { 0x0, MATRIX_A };
|
||||
/* mag01[x] = x * MATRIX_A for x=0,1 */
|
||||
|
||||
unsigned long y;
|
||||
unsigned int y;
|
||||
|
||||
if (mti >= N) { /* generate N words at one time */
|
||||
int kk;
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="SDL.lib freetype2ST.lib ftgl_static.lib gnu_gettext.lib qtmlClient.lib openal_static.lib libsoundsystem.lib libopenalsoundsystem.lib libdummysoundsystem.lib libguardedalloc.lib libbsp.lib libbmfont.lib libghost.lib libstring.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libdecimation.lib libiksolver.lib libpng_st.lib zlib.lib libmoto.lib solid.lib qhull.lib libopennl.lib Bullet.lib python25.lib libelbeem.lib libboolop.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib broad.lib complex.lib convex.lib memutil.lib verse.lib Half.lib Iex.lib IlmImf.lib Imath.lib IlmThread.lib avcodec-51.lib avformat-52.lib avutil-49.lib swscale-0.lib"
|
||||
AdditionalDependencies="SDL.lib freetype2ST.lib ftgl_static.lib gnu_gettext.lib qtmlClient.lib openal_static.lib libsoundsystem.lib libopenalsoundsystem.lib libdummysoundsystem.lib libguardedalloc.lib libbsp.lib libbmfont.lib libghost.lib libstring.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libdecimation.lib libiksolver.lib libpng_st.lib zlib.lib libmoto.lib solid.lib qhull.lib libopennl.lib Bullet.lib python25.lib libelbeem.lib libboolop.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib broad.lib complex.lib convex.lib memutil.lib verse.lib Half.lib Iex.lib IlmImf.lib Imath.lib IlmThread.lib avcodec-51.lib avformat-52.lib avutil-49.lib swscale-0.lib glew.lib"
|
||||
ShowProgress="0"
|
||||
OutputFile="..\..\bin\blender.exe"
|
||||
LinkIncremental="1"
|
||||
@@ -124,7 +124,7 @@ ECHO Done
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386
|
||||
"
|
||||
AdditionalDependencies="SDL.lib freetype2ST.lib ftgl_static.lib gnu_gettext.lib qtmlClient.lib openal_static.lib libsoundsystem.lib libopenalsoundsystem.lib libdummysoundsystem.lib libguardedalloc.lib libbsp.lib libbmfont.lib libghost.lib libstring.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libdecimation.lib libiksolver.lib libpng_st.lib zlib.lib libmoto.lib solid.lib qhull.lib libopennl.lib Bullet.lib python25_d.lib libelbeem.lib libboolop.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib broad.lib complex.lib convex.lib memutil.lib verse.lib Half.lib Iex.lib Imath.lib IlmImf.lib IlmThread.lib avcodec-51.lib avformat-52.lib avutil-49.lib swscale-0.lib"
|
||||
AdditionalDependencies="SDL.lib freetype2ST.lib ftgl_static.lib gnu_gettext.lib qtmlClient.lib openal_static.lib libsoundsystem.lib libopenalsoundsystem.lib libdummysoundsystem.lib libguardedalloc.lib libbsp.lib libbmfont.lib libghost.lib libstring.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libdecimation.lib libiksolver.lib libpng_st.lib zlib.lib libmoto.lib solid.lib qhull.lib libopennl.lib Bullet.lib python25_d.lib libelbeem.lib libboolop.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib broad.lib complex.lib convex.lib memutil.lib verse.lib Half.lib Iex.lib Imath.lib IlmImf.lib IlmThread.lib avcodec-51.lib avformat-52.lib avutil-49.lib swscale-0.lib glew.lib"
|
||||
ShowProgress="0"
|
||||
OutputFile="..\..\bin\debug\blender.exe"
|
||||
LinkIncremental="2"
|
||||
|
||||
@@ -344,6 +344,9 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenkernel\intern\BME_conversions.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenkernel\intern\BME_Customdata.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenkernel\intern\BME_eulers.c">
|
||||
</File>
|
||||
@@ -425,9 +428,6 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenkernel\intern\ipo.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenkernel\intern\kdop.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenkernel\intern\key.c">
|
||||
</File>
|
||||
@@ -558,6 +558,9 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenkernel\BKE_bmesh.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenkernel\BKE_bmeshCustomData.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenkernel\BKE_bmfont.h">
|
||||
</File>
|
||||
|
||||
@@ -346,6 +346,9 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenlib\intern\BLI_heap.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenlib\intern\BLI_kdopbvh.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenlib\intern\BLI_kdtree.c">
|
||||
</File>
|
||||
@@ -355,6 +358,9 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenlib\intern\BLI_memarena.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenlib\intern\BLI_mempool.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenlib\intern\boxpack2d.c">
|
||||
</File>
|
||||
@@ -458,6 +464,9 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenlib\BLI_jitter.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenlib\BLI_kdopbvh.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenlib\BLI_kdtree.h">
|
||||
</File>
|
||||
@@ -467,6 +476,9 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenlib\BLI_memarena.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenlib\BLI_mempool.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenlib\intern\BLI_scanfill.h">
|
||||
</File>
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\..\lib\windows\sdl\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\yafray;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenkernel;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\blender\render\intern\include;..\..\..\source\blender\render\extern\include;..\..\..\source\kernel;..\..\..\source\kernel\gen_messaging"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_QUICKTIME;WITH_OPENEXR"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_QUICKTIME;WITH_OPENEXR;_USE_MATH_DEFINES"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
@@ -175,6 +175,9 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\render\intern\source\strand.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\render\intern\source\sunsky.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\render\intern\source\texture.c">
|
||||
</File>
|
||||
@@ -245,6 +248,9 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\render\intern\include\strand.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\render\intern\include\sunsky.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\render\intern\include\texture.h">
|
||||
</File>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\ghost\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\blenkey\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\memutil\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\source\blender;..\..\..\source\blender\img;..\..\..\source\blender\verify;..\..\..\source\blender\ftfont;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\renderui;..\..\..\source\blender\blenloader;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenpluginapi;..\..\..\source\blender\renderconverter;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\network;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\ffmpeg\include"
|
||||
AdditionalIncludeDirectories="..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\ghost\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\blenkey\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\memutil\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\source\blender;..\..\..\source\blender\img;..\..\..\source\blender\verify;..\..\..\source\blender\ftfont;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\renderui;..\..\..\source\blender\blenloader;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenpluginapi;..\..\..\source\blender\renderconverter;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\network;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\ffmpeg\include"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_CONSOLE;GAMEBLENDER=1;WITH_QUICKTIME;INTERNATIONAL;WITH_VERSE;WITH_OPENEXR;WITH_DDS;WITH_BULLET=1;WITH_FFMPEG"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
@@ -73,7 +73,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\ghost\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\blenkey\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\memutil\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\source\blender;..\..\..\source\blender\img;..\..\..\source\blender\verify;..\..\..\source\blender\ftfont;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\renderui;..\..\..\source\blender\blenloader;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenpluginapi;..\..\..\source\blender\renderconverter;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\network;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\ffmpeg\include"
|
||||
AdditionalIncludeDirectories="..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\ghost\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\blenkey\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\memutil\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\source\blender;..\..\..\source\blender\img;..\..\..\source\blender\verify;..\..\..\source\blender\ftfont;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\renderui;..\..\..\source\blender\blenloader;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenpluginapi;..\..\..\source\blender\renderconverter;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\network;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_7\extern\glew\include"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;_CONSOLE;GAMEBLENDER;WITH_QUICKTIME;INTERNATIONAL;WITH_VERSE;WITH_OPENEXR;WITH_DDS;WITH_BULLET = 1;WITH_FFMPEG"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\ketsji;..\..\..\source\gameengine\network;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Physics\Sumo;..\..\..\source\gameengine\Physics\common;..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\ketsji;..\..\..\source\gameengine\network;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Physics\Sumo;..\..\..\source\gameengine\Physics\common;..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include"
|
||||
PreprocessorDefinitions="WIN32;_LIB;_DEBUG;WITH_GLEXT"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
@@ -74,7 +74,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\ketsji;..\..\..\source\gameengine\network;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Physics\Sumo;..\..\..\source\gameengine\Physics\common;..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\ketsji;..\..\..\source\gameengine\network;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Physics\Sumo;..\..\..\source\gameengine\Physics\common;..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID;WITH_GLEXT"
|
||||
StringPooling="TRUE"
|
||||
BasicRuntimeChecks="0"
|
||||
|
||||
@@ -347,6 +347,12 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Converter\BL_MeshDeformer.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Converter\BL_ShapeActionActuator.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Converter\BL_ShapeDeformer.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Converter\BL_SkinDeformer.cpp">
|
||||
</File>
|
||||
@@ -396,6 +402,12 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Converter\BL_MeshDeformer.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Converter\BL_ShapeActionActuator.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Converter\BL_ShapeDeformer.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Converter\BL_SkinDeformer.h">
|
||||
</File>
|
||||
|
||||
@@ -332,6 +332,12 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_2DFilterActuator.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_ActuatorEventManager.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_ActuatorSensor.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_AlwaysEventManager.cpp">
|
||||
</File>
|
||||
@@ -395,6 +401,12 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_MouseSensor.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_NANDController.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_NORController.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_ORController.cpp">
|
||||
</File>
|
||||
@@ -425,6 +437,12 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_TimeEventManager.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_XNORController.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_XORController.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
@@ -432,6 +450,12 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_2DFilterActuator.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_ActuatorEventManager.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_ActuatorSensor.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_AlwaysEventManager.h">
|
||||
</File>
|
||||
@@ -498,6 +522,12 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_MouseSensor.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_NANDController.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_NORController.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_ORController.h">
|
||||
</File>
|
||||
@@ -528,6 +558,12 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_TimeEventManager.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_XNORController.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_XORController.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\lib\windows\zlib\include;..\..\..\..\..\lib\windows\png\include;..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\..\build\msvc_7\intern\openal\include;..\..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\..\build\msvc_7\intern\SoundSystem\include;..\..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\Converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\GamePlayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\soundsystem\snd_dummy;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\Physics\Sumo;..\..\..\..\source\gameengine\Physics\common;..\..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\lib\windows\zlib\include;..\..\..\..\..\lib\windows\png\include;..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\..\build\msvc_7\intern\openal\include;..\..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\..\build\msvc_7\intern\SoundSystem\include;..\..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\Converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\GamePlayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\soundsystem\snd_dummy;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\Physics\Sumo;..\..\..\..\source\gameengine\Physics\common;..\..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include"
|
||||
PreprocessorDefinitions="WIN32,_LIB,_DEBUG"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
@@ -175,7 +175,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\lib\windows\zlib\include;..\..\..\..\..\lib\windows\png\include;..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\..\build\msvc_7\intern\openal\include;..\..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\..\build\msvc_7\intern\SoundSystem\include;..\..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\Converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\GamePlayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\soundsystem\snd_dummy;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\Physics\Sumo;..\..\..\..\source\gameengine\Physics\common;..\..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\lib\windows\zlib\include;..\..\..\..\..\lib\windows\png\include;..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\..\build\msvc_7\intern\openal\include;..\..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\..\build\msvc_7\intern\SoundSystem\include;..\..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\Converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\GamePlayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\soundsystem\snd_dummy;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\Physics\Sumo;..\..\..\..\source\gameengine\Physics\common;..\..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include"
|
||||
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\ghost\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\intern\openal\include;..\..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\..\..\build\msvc_7\intern\SoundSystem\include;..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\source\blender\include;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\readblenfile;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\kernel\gen_messaging;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Physics;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\Physics\Ode;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\gameplayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\gameplayer\common\windows;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\ghost\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\intern\openal\include;..\..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\..\..\build\msvc_7\intern\SoundSystem\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\source\blender\include;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\readblenfile;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\kernel\gen_messaging;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Physics;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\Physics\Ode;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\gameplayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\gameplayer\common\windows;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include"
|
||||
PreprocessorDefinitions="WIN32,_CONSOLE,dSINGLE, _DEBUG"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
@@ -40,7 +40,7 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386
|
||||
"
|
||||
AdditionalDependencies="libguardedalloc.lib libstring.lib libghost.lib odelib.lib fmodvc.lib libbmfont.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib openal_static.lib libjpeg.lib dxguid.lib libeay32.lib libpng.lib libz.lib libmoto.lib libSoundSystem.lib qtmlClient.lib libDummySoundSystem.lib libOpenALSoundSystem.lib SDL.lib solid.lib freetype2ST.lib Bullet.lib libdecimation.lib python25_d.lib pthreadVSE2.lib pthreadVC2.lib verse.lib libopennl.lib avcodec-51.lib avformat-52.lib avutil-49.lib swscale-0.lib"
|
||||
AdditionalDependencies="libguardedalloc.lib libstring.lib libghost.lib odelib.lib fmodvc.lib libbmfont.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib openal_static.lib libjpeg.lib dxguid.lib libeay32.lib libpng.lib libz.lib libmoto.lib libSoundSystem.lib qtmlClient.lib libDummySoundSystem.lib libOpenALSoundSystem.lib SDL.lib solid.lib freetype2ST.lib Bullet.lib libdecimation.lib python25_d.lib pthreadVSE2.lib pthreadVC2.lib verse.lib libopennl.lib avcodec-51.lib avformat-52.lib avutil-49.lib swscale-0.lib glew.lib"
|
||||
ShowProgress="0"
|
||||
OutputFile="..\..\..\..\bin\debug\blenderplayer.exe"
|
||||
LinkIncremental="2"
|
||||
@@ -98,7 +98,7 @@ ECHO Done
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\ghost\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\intern\openal\include;..\..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\..\..\build\msvc_7\intern\SoundSystem\include;..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\source\blender\include;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\readblenfile;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\kernel\gen_messaging;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Physics;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\Physics\Ode;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\gameplayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\gameplayer\common\windows;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\ghost\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\intern\openal\include;..\..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\..\..\build\msvc_7\intern\SoundSystem\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\source\blender\include;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\readblenfile;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\kernel\gen_messaging;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Physics;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\Physics\Ode;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\gameplayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\gameplayer\common\windows;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include"
|
||||
PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
@@ -117,7 +117,7 @@ ECHO Done
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="libguardedalloc.lib libstring.lib libghost.lib odelib.lib fmodvc.lib libbmfont.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib openal_static.lib libjpeg.lib dxguid.lib libeay32.lib libpng.lib libz.lib libmoto.lib libSoundSystem.lib qtmlClient.lib libDummySoundSystem.lib libOpenALSoundSystem.lib SDL.lib solid.lib freetype2ST.lib Bullet.lib libdecimation.lib python25.lib pthreadVSE2.lib pthreadVC2.lib verse.lib libopennl.lib avcodec-51.lib avformat-52.lib avutil-49.lib swscale-0.lib"
|
||||
AdditionalDependencies="libguardedalloc.lib libstring.lib libghost.lib odelib.lib fmodvc.lib libbmfont.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib openal_static.lib libjpeg.lib dxguid.lib libeay32.lib libpng.lib libz.lib libmoto.lib libSoundSystem.lib qtmlClient.lib libDummySoundSystem.lib libOpenALSoundSystem.lib SDL.lib solid.lib freetype2ST.lib Bullet.lib libdecimation.lib python25.lib pthreadVSE2.lib pthreadVC2.lib verse.lib libopennl.lib avcodec-51.lib avformat-52.lib avutil-49.lib swscale-0.lib glew.lib"
|
||||
OutputFile="..\..\..\..\bin\blenderplayer.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
@@ -74,7 +74,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
|
||||
PreprocessorDefinitions="WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG;USE_SUMO_SOLID"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
@@ -126,7 +126,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
|
||||
PreprocessorDefinitions="JANCODEPANCO;WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG;USE_SUMO_SOLID;WITH_GLEXT"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
@@ -179,7 +179,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID;WITH_GLEXT"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
@@ -232,7 +232,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
|
||||
PreprocessorDefinitions="JANCODEPANCO;WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG;USE_SUMO_SOLID;WITH_GLEXT"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
@@ -284,7 +284,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID;WITH_GLEXT"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
@@ -333,6 +333,9 @@
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Ketsji\BL_BlenderShader.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Ketsji\BL_Material.cpp">
|
||||
</File>
|
||||
@@ -459,6 +462,9 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Ketsji\KX_SCA_AddObjectActuator.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Ketsji\KX_SCA_DynamicActuator.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Ketsji\KX_SCA_EndObjectActuator.cpp">
|
||||
</File>
|
||||
@@ -471,6 +477,9 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Ketsji\KX_SoundActuator.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Ketsji\KX_StateActuator.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Ketsji\KX_TrackToActuator.cpp">
|
||||
</File>
|
||||
@@ -539,6 +548,9 @@
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Ketsji\BL_BlenderShader.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Ketsji\BL_Material.h">
|
||||
</File>
|
||||
@@ -677,6 +689,9 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Ketsji\KX_SCA_AddObjectActuator.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Ketsji\KX_SCA_DynamicActuator.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Ketsji\KX_SCA_EndObjectActuator.h">
|
||||
</File>
|
||||
@@ -689,6 +704,9 @@
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Ketsji\KX_SoundActuator.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Ketsji\KX_StateActuator.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\gameengine\Ketsji\KX_TrackToActuator.h">
|
||||
</File>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\source\kernel\gen_system"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\..\lib\windows\python\include\python2.5"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_GLEXT"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
@@ -73,7 +73,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\source\kernel\gen_system"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\kernel\gen_system"
|
||||
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
@@ -125,7 +125,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\source\kernel\gen_system"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\..\lib\windows\python\include\python2.5"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_GLEXT"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
@@ -177,7 +177,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\source\kernel\gen_system"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\kernel\gen_system"
|
||||
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
@@ -229,7 +229,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\source\kernel\gen_system"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\..\lib\windows\python\include\python2.5"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_GLEXT"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
@@ -281,7 +281,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\source\kernel\gen_system"
|
||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\..\lib\windows\python\include\python2.5"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_GLEXT"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
|
||||
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
@@ -73,7 +73,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_GLEXT"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
@@ -125,7 +125,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
|
||||
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
@@ -177,7 +177,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_GLEXT"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
@@ -229,7 +229,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_GLEXT"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
@@ -281,7 +281,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_GLEXT"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
@@ -345,15 +345,6 @@
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath="..\..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer\ARB_multitexture.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer\EXT_separate_specular_color.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer\glext.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer\RAS_GLExtensionManager.h">
|
||||
</File>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
@@ -6,9 +6,9 @@
|
||||
# Group: 'Export'
|
||||
# Tooltip: 'Export to DirectX text file format format for XNA Animation Component Library.'
|
||||
"""
|
||||
__author__ = "minahito (original:Arben (Ben) Omari)"
|
||||
__url__ = ("blender", "blenderartists.org", "Adjuster's site http://sunday-lab.blogspot.com/, Author's site http://www.omariben.too.it")
|
||||
__version__ = "3.0"
|
||||
__author__ = "vertex color exporting feature is added by mnemoto (original:minahito (original:Arben (Ben) Omari))"
|
||||
__url__ = ("blender", "elysiun", "Adjuster's site http://sunday-lab.blogspot.com/, Author's site http://www.omariben.too.it","Adjuster's site http://ex.homeunix.net/")
|
||||
__version__ = "3.1"
|
||||
|
||||
__bpydoc__ = """\
|
||||
This script exports a Blender mesh with armature to DirectX 8's text file
|
||||
@@ -444,6 +444,7 @@ class xExport:
|
||||
self.writeMeshMaterialList(obj, mesh, tex)
|
||||
self.writeMeshNormals(obj, mesh)
|
||||
self.writeMeshTextureCoords(obj, mesh)
|
||||
self.writeMeshVertexColors(obj, mesh)
|
||||
self.file.write(" } // End of the Mesh %s \n" % (obj.name))
|
||||
|
||||
|
||||
@@ -464,6 +465,7 @@ class xExport:
|
||||
self.writeMeshMaterialList(obj, mesh, tex)
|
||||
self.writeMeshNormals(obj, mesh)
|
||||
self.writeMeshTextureCoords(obj, mesh)
|
||||
self.writeMeshVertexColors(obj, mesh)
|
||||
self.file.write(" }\n")
|
||||
self.file.write("}\n")
|
||||
ind = objs.index(obj)
|
||||
@@ -1047,6 +1049,32 @@ template SkinWeights {\n\
|
||||
self.file.write(",\n")
|
||||
|
||||
self.file.write("} //End of MeshTextureCoords\n")
|
||||
|
||||
#***********************************************
|
||||
#MESH VORTEX COLORS
|
||||
#***********************************************
|
||||
def writeMeshVertexColors(self, name, mesh):
|
||||
if mesh.hasVertexColours():
|
||||
self.file.write("MeshVertexColors {\n")
|
||||
#VERTICES NUMBER
|
||||
numvert = reduce( lambda i,f: len(f)+i, mesh.faces, 0)
|
||||
self.file.write("%d;\n" % (numvert))
|
||||
#VERTEX COLORS
|
||||
|
||||
vcounter =0
|
||||
for f in mesh.faces:
|
||||
col = f.col
|
||||
for i,c in enumerate(col):
|
||||
# Note vcol alpha has no meaning
|
||||
self.file.write("%d;%f;%f;%f;%f;" % (vcounter,c.r/255.0, c.g/255.0, c.b/255.0, 1.0)) # c.a/255.0))
|
||||
vcounter+=1
|
||||
if vcounter == numvert :
|
||||
self.file.write(";\n")
|
||||
else :
|
||||
self.file.write(",\n")
|
||||
|
||||
self.file.write("} //End of MeshVertexColors\n")
|
||||
|
||||
#***********************************************#***********************************************#***********************************************
|
||||
#***********************************************
|
||||
#FRAMES
|
||||
|
||||
792
release/scripts/animation_bake_constraints.py
Normal file
792
release/scripts/animation_bake_constraints.py
Normal file
@@ -0,0 +1,792 @@
|
||||
#!BPY
|
||||
|
||||
"""
|
||||
Name: 'Bake Constraints'
|
||||
Blender: 246
|
||||
Group: 'Animation'
|
||||
Tooltip: 'Bake a Constrained object/rig to IPOs'
|
||||
Fillename: 'Bake_Constraint.py'
|
||||
"""
|
||||
|
||||
__author__ = "Roger Wickes (rogerwickes(at)yahoo.com)"
|
||||
__script__ = "Animation Bake Constraints"
|
||||
__version__ = "0.7"
|
||||
__url__ = ["Communicate problems and errors, http://www.blenderartists.com/forum/private.php?do=newpm to PapaSmurf"]
|
||||
__email__= ["Roger Wickes, rogerwickes@yahoo.com", "scripts"]
|
||||
__bpydoc__ = """\
|
||||
|
||||
bake_constraints
|
||||
|
||||
This script bakes the real-world LocRot of an object (the net effect of any constraints -
|
||||
(Copy, Limit, Track, Follow, - that affect Location, Rotation)
|
||||
(usually one constrained to match another's location and/or Tracked to another)
|
||||
and creates a clone with a set of Ipo Curves named Ipo<objname>
|
||||
These curves control a non-constrained object and thus make it mimic the constrained object
|
||||
Actions can be then be edited without the need for the drivers/constraining objects
|
||||
|
||||
Developed for use with MoCap data, where a bone is constrained to point at an empty
|
||||
moving through space and time. This records the actual locrot of the armature
|
||||
so that the motion can be edited, reoriented, scaled, and used as NLA Actions
|
||||
|
||||
see also wiki Scripts/Manual/ Tutorial/Motion Capture <br>
|
||||
|
||||
Usage: <br>
|
||||
- Select the reference Object(s) you want to bake <br>
|
||||
- Set the frame range to bake in the Anim Panel <br>
|
||||
- Set the test code (if you want a self-test) in the RT field in the Anim Panel <br>
|
||||
-- Set RT:1 to create a test armature <br>
|
||||
-- Set RT: up to 100 for more debug messages and status updates <br>
|
||||
<br>
|
||||
- Run the script <br>
|
||||
- The clone copy of the object is created and it has an IPO curve assigned to it. <br>
|
||||
- The clone shadows the object by an offset locrot (see usrDelta) <br>
|
||||
- That Object has Ipo Location and Rotation curves that make the clone mimic the movement <br>
|
||||
of the selected object, but without using constraints. <br>
|
||||
- If the object was an Armature, the clone's bones move identically in relation to the <br>
|
||||
original armature, and an Action is created that drives the bone movements. <br>
|
||||
|
||||
Version History:
|
||||
0.1: bakes Loc Rot for a constrained object
|
||||
0.2: bakes Loc and Rot for the bones within Armature object
|
||||
0.3: UI for setting options
|
||||
0.3.1 add manual to script library
|
||||
0.4: bake multiple objects
|
||||
0.5: root bone worldspace rotation
|
||||
0.6: re-integration with BPyArmature
|
||||
0.7: bakes parents and leaves clones selected
|
||||
|
||||
License, Copyright, and Attribution:
|
||||
by Roger WICKES May 2008, released under Blender Artistic Licence to Public Domain
|
||||
feel free to add to any Blender Python Scripts Bundle.
|
||||
Thanks to Jean-Baptiste PERIN, IdeasMan42 (Campbell Barton), Basil_Fawlty/Cage_drei (Andrew Cruse)
|
||||
much lifted/learned from blender.org/documentation/245PytonDoc and wiki
|
||||
some modules based on c3D_Import.py, PoseLib16.py and IPO/Armature code examples e.g. camera jitter
|
||||
|
||||
Pseudocode:
|
||||
Initialize
|
||||
If at least one object is selected
|
||||
For each selected object,
|
||||
create a cloned object
|
||||
remove any constraints on the clone
|
||||
create or reset an ipo curve named like the object
|
||||
for each frame
|
||||
set the clone's locrot key based on the reference object
|
||||
if it's an armature,
|
||||
create an action (which is an Ipo for each bone)
|
||||
for each frame of the animation
|
||||
for each bone in the armature
|
||||
set the key
|
||||
Else you're a smurf
|
||||
|
||||
Test Conditions and Regressions:
|
||||
1. (v0.1) Non-armatures (the cube), with ipo curve and constraints at the object level
|
||||
2. armatures, with ipo curve and constraints at the object level
|
||||
3. armatures, with bones that have ipo curves and constraints
|
||||
4. objects without parents, children with unselected parents, select children first.
|
||||
|
||||
Naming conventions:
|
||||
arm = a specific objec type armature
|
||||
bone = bones that make up the skeleton of an armature
|
||||
|
||||
ob = object, an instance of an object type
|
||||
ebone = edit bone, a bone in edit mode
|
||||
pbone = pose bone, a posed bone in an object
|
||||
tst = testing, self-test routines
|
||||
usr = user-entered or designated stuff
|
||||
"""
|
||||
########################################
|
||||
|
||||
import Blender
|
||||
from Blender import *
|
||||
from Blender.Mathutils import *
|
||||
import struct
|
||||
import string
|
||||
import bpy
|
||||
import BPyMessages
|
||||
import BPyArmature
|
||||
# reload(BPyArmature)
|
||||
from BPyArmature import getBakedPoseData
|
||||
|
||||
Vector= Blender.Mathutils.Vector
|
||||
Euler= Blender.Mathutils.Euler
|
||||
Matrix= Blender.Mathutils.Matrix #invert() function at least
|
||||
RotationMatrix = Blender.Mathutils.RotationMatrix
|
||||
TranslationMatrix= Blender.Mathutils.TranslationMatrix
|
||||
Quaternion = Blender.Mathutils.Quaternion
|
||||
Vector = Blender.Mathutils.Vector
|
||||
POSE_XFORM= [Blender.Object.Pose.LOC, Blender.Object.Pose.ROT]
|
||||
|
||||
#=================
|
||||
# Global Variables
|
||||
#=================
|
||||
|
||||
# set senstitivity for displaying debug/console messages. 0=none, 100=max
|
||||
# then call debug(num,string) to conditionally display status/info in console window
|
||||
MODE=Blender.Get('rt') #execution mode: 0=run normal, 1=make test armature
|
||||
DEBUG=Blender.Get('rt') #how much detail on internal processing for user to see. range 0-100
|
||||
BATCH=False #called from command line? is someone there? Would you like some cake?
|
||||
|
||||
#there are two coordinate systems, the real, or absolute 3D space,
|
||||
# and the local relative to a parent.
|
||||
COORDINATE_SYSTEMS = ['local','real']
|
||||
COORD_LOCAL = 0
|
||||
COORD_REAL = 1
|
||||
|
||||
# User Settings - Change these options manually or via GUI (future TODO)
|
||||
usrCoord = COORD_REAL # what the user wants
|
||||
usrParent = False # True=clone keeps original parent, False = clone's parent is the clone of the original parent (if cloned)
|
||||
usrFreeze = 2 #2=yes, 0=no. Freezes shadow object in place at current frame as origin
|
||||
# delta is amount to offset/change from the reference object. future set in a ui, so technically not a constant
|
||||
usrDelta = [10,10,0,0,0,0] #order specific - Loc xyz Rot xyz
|
||||
usrACTION = True # Offset baked Action frames to start at frame 1
|
||||
|
||||
CURFRAME = 'curframe' #keyword to use when getting the frame number that the scene is presently on
|
||||
ARMATURE = 'Armature' #en anglais
|
||||
BONE_SPACES = ['ARMATURESPACE','BONESPACE']
|
||||
# 'ARMATURESPACE' - this matrix of the bone in relation to the armature
|
||||
# 'BONESPACE' - the matrix of the bone in relation to itself
|
||||
|
||||
#Ipo curves created are prefixed with a name, like Ipo_ or Bake_ followed by the object/bone name
|
||||
#bakedArmName = "b." #used for both the armature class and object instance
|
||||
usrObjectNamePrefix= ""
|
||||
#ipoBoneNamePrefix = ""
|
||||
# for example, if on entry an armature named Man was selected, and the object prefix was "a."
|
||||
# on exit an armature and an IPO curve named a.Man exists for the object as a whole
|
||||
# if that armature had bones (spine, neck, arm) and the bone prefix was "a."
|
||||
# the bones and IPO curves will be (a.spine, a.neck, a.arm)
|
||||
|
||||
R2D = 18/3.1415 # radian to grad
|
||||
BLENDER_VERSION = Blender.Get('version')
|
||||
|
||||
# Gets the current scene, there can be many scenes in 1 blend file.
|
||||
scn = Blender.Scene.GetCurrent()
|
||||
|
||||
#=================
|
||||
# Methods
|
||||
#=================
|
||||
########################################
|
||||
def debug(num,msg): #use log4j or just console here.
|
||||
if DEBUG >= num:
|
||||
if BATCH == False:
|
||||
print 'debug: '[:num/10+7]+msg
|
||||
#TODO: else write out to file (runs faster if it doesnt have to display details)
|
||||
return
|
||||
|
||||
########################################
|
||||
def error(str):
|
||||
debug(0,'ERROR: '+str)
|
||||
if BATCH == False:
|
||||
Draw.PupMenu('ERROR%t|'+str)
|
||||
return
|
||||
|
||||
########################################
|
||||
def getRenderInfo():
|
||||
context=scn.getRenderingContext()
|
||||
staframe = context.startFrame()
|
||||
endframe = context.endFrame()
|
||||
if endframe<staframe: endframe=staframe
|
||||
curframe = Blender.Get(CURFRAME)
|
||||
debug(90,'Scene is on frame %i and frame range is %i to %i' % (curframe,staframe,endframe))
|
||||
return (staframe,endframe,curframe)
|
||||
|
||||
########################################
|
||||
def sortObjects(obs): #returns a list of objects sorted based on parent dependency
|
||||
obClones= []
|
||||
while len(obClones) < len(obs):
|
||||
for ob in obs:
|
||||
if not ob in obClones:
|
||||
par= ob.getParent()
|
||||
#if no parent, or the parent is not scheduled to be cloned
|
||||
if par==None:
|
||||
obClones.append(ob) # add the independent
|
||||
elif par not in obs: # parent will not be cloned
|
||||
obClones.append(ob) # add the child
|
||||
elif par in obClones: # is it on the list?
|
||||
obClones.append(ob) # add the child
|
||||
# parent may be a child, so it will be caught next time thru
|
||||
debug(100,'clone object order: \n%s' % obClones)
|
||||
return obClones # ordered list of (ob, par) tuples
|
||||
|
||||
########################################
|
||||
def sortBones(xbones): #returns a sorted list of bones that should be added,sorted based on parent dependency
|
||||
# while there are bones to add,
|
||||
# look thru the list of bones we need to add
|
||||
# if we have not already added this bone
|
||||
# if it does not have a parent
|
||||
# add it
|
||||
# else, it has a parent
|
||||
# if we already added it's parent
|
||||
# add it now.
|
||||
# else #we need to keep cycling and catch its parent
|
||||
# else it is a root bone
|
||||
# add it
|
||||
# else skip it, it's already in there
|
||||
# endfor
|
||||
# endwhile
|
||||
xboneNames=[]
|
||||
for xbone in xbones: xboneNames.append(xbone.name)
|
||||
debug (80,'reference bone order: \n%s' % xboneNames)
|
||||
eboneNames=[]
|
||||
while len(eboneNames) < len(xboneNames):
|
||||
for xbone in xbones:
|
||||
if not xbone.name in eboneNames:
|
||||
if not xbone.parent:
|
||||
eboneNames.append(xbone.name)
|
||||
else:
|
||||
if xbone.parent.name in eboneNames:
|
||||
eboneNames.append(xbone.name)
|
||||
#else skip it
|
||||
#endif
|
||||
#else prego
|
||||
#endfor
|
||||
#endwhile
|
||||
debug (80,'clone bone order: \n%s' % eboneNames)
|
||||
return eboneNames
|
||||
|
||||
########################################
|
||||
def dupliArmature(ob): #makes a copy in current scn of the armature used by ob and its bones
|
||||
ob_mat = ob.matrixWorld
|
||||
ob_data = ob.getData()
|
||||
debug(49,'Reference object uses %s' % ob_data)
|
||||
arm_ob = Armature.Get(ob_data.name) #the armature used by the passed object
|
||||
|
||||
arm = Blender.Armature.New()
|
||||
debug(20,'Cloning Armature %s to create %s' % (arm_ob.name, arm.name))
|
||||
arm.drawType = Armature.STICK #set the draw type
|
||||
|
||||
arm.makeEditable() #enter editmode
|
||||
|
||||
# for each bone in the object's armature,
|
||||
xbones=ob.data.bones.values()
|
||||
usrSpace = 0 #0=armature, 1=local
|
||||
space=[BONE_SPACES[usrSpace]][0]
|
||||
|
||||
#we have to make a list of bones, then figure out our parents, then add to the arm
|
||||
#when creating a child, we cannot link to a parent if it does not yet exist in our armature
|
||||
ebones = [] #list of the bones I want to create for my arm
|
||||
|
||||
eboneNames = sortBones(xbones)
|
||||
|
||||
i=0
|
||||
# error('bones sorted. continue?')
|
||||
for abone in eboneNames: #set all editable attributes to fully define the bone.
|
||||
for bone in xbones:
|
||||
if bone.name == abone: break # get the reference bone
|
||||
ebone = Armature.Editbone() #throw me a bone, bone-man!
|
||||
ebones.append(ebone) #you're on my list, buddy
|
||||
|
||||
ebone.name = bone.name
|
||||
ebone.headRadius = bone.headRadius
|
||||
ebone.tailRadius = bone.tailRadius
|
||||
ebone.weight = bone.weight
|
||||
ebone.options = bone.options
|
||||
|
||||
ebone.head = bone.head[space] #dictionary lookups
|
||||
ebone.tail = bone.tail[space]
|
||||
ebone.matrix = bone.matrix[space]
|
||||
ebone.roll = bone.roll[space]
|
||||
|
||||
debug(30,'Generating new %s as child of %s' % (bone,bone.parent))
|
||||
if bone.hasParent():
|
||||
# parent=bone.parent.name
|
||||
# debug(100,'looking for %s' % parent)
|
||||
# for parbone in xbones: if parbone.name == parent: break # get the parent bone
|
||||
# ebone.parent = arm.bones[ebones[j].name]
|
||||
ebone.parent = arm.bones[bone.parent.name]
|
||||
# else:
|
||||
# ebone.parent = None
|
||||
debug(30,'Generating new editbone %s as child of %s' % (ebone,ebone.parent))
|
||||
arm.bones[ebone.name] = ebone # i would have expected an append or add function, but this works
|
||||
|
||||
debug (100,'arm.bones: \n%s' % arm.bones)
|
||||
debug (20,'Cloned %i bones now in armature %s' %(len(arm.bones),arm.name))
|
||||
|
||||
myob = scn.objects.new(arm) #interestingly, object must be created before
|
||||
arm.update() #armature can be saved
|
||||
debug(40,'dupArm finished %s instanced as object %s' % (arm.name,myob.getName()))
|
||||
print ob.matrix
|
||||
print myob.matrix
|
||||
|
||||
return myob
|
||||
########################################
|
||||
def scrub(): # scrubs to startframe
|
||||
staFrame,endFrame,curFrame = getRenderInfo()
|
||||
|
||||
# eye-candy, go from current to start, fwd or back
|
||||
if not BATCH:
|
||||
debug(100, "Positioning to start...")
|
||||
frameinc=(staFrame-curFrame)/10
|
||||
if abs(frameinc) >= 1:
|
||||
for i in range(10):
|
||||
curFrame+=frameinc
|
||||
Blender.Set(CURFRAME,curFrame) # computes the constrained location of the 'real' objects
|
||||
Blender.Redraw()
|
||||
Blender.Set(CURFRAME, staFrame)
|
||||
return
|
||||
|
||||
########################################
|
||||
def bakeBones(ref_ob,arm_ob): #copy pose from ref_ob to arm_ob
|
||||
scrub()
|
||||
staFrame,endFrame,curFrame = getRenderInfo()
|
||||
act = getBakedPoseData(ref_ob, staFrame, endFrame, ACTION_BAKE = True, ACTION_BAKE_FIRST_FRAME = usrACTION) # bake the pose positions of the reference ob to the armature ob
|
||||
arm_ob.action = act
|
||||
scrub()
|
||||
|
||||
# user comprehension feature - change action name and channel ipo names to match the names of the bone they drive
|
||||
debug (80,'Renaming each action ipo to match the bone they pose')
|
||||
act.name = arm_ob.name
|
||||
arm_channels = act.getAllChannelIpos()
|
||||
pose= arm_ob.getPose()
|
||||
pbones= pose.bones.values() #we want the bones themselves, not the dictionary lookup
|
||||
for pbone in pbones:
|
||||
debug (100,'Channel listing for %s: %s' % (pbone.name,arm_channels[pbone.name] ))
|
||||
ipo=arm_channels[pbone.name]
|
||||
ipo.name = pbone.name # since bone names are unique within an armature, the pose names can be the same since they are within an Action
|
||||
|
||||
return
|
||||
|
||||
########################################
|
||||
def getOrCreateCurve(ipo, curvename):
|
||||
"""
|
||||
Retrieve or create a Blender Ipo Curve named C{curvename} in the C{ipo} Ipo
|
||||
Either an ipo curve named C{curvename} exists before the call then this curve is returned,
|
||||
Or such a curve doesn't exist before the call .. then it is created into the c{ipo} Ipo and returned
|
||||
"""
|
||||
try:
|
||||
mycurve = ipo.getCurve(curvename)
|
||||
if mycurve != None:
|
||||
pass
|
||||
else:
|
||||
mycurve = ipo.addCurve(curvename)
|
||||
except:
|
||||
mycurve = ipo.addCurve(curvename)
|
||||
return mycurve
|
||||
|
||||
########################################
|
||||
def eraseCurve(ipo,numCurves):
|
||||
debug(90,'Erasing %i curves for %' % (numCurves,ipo.GetName()))
|
||||
for i in range(numCurves):
|
||||
nbBezPoints= ipo.getNBezPoints(i)
|
||||
for j in range(nbBezPoints):
|
||||
ipo.delBezPoint(i)
|
||||
return
|
||||
|
||||
########################################
|
||||
def resetIPO(ipo):
|
||||
debug(60,'Resetting ipo curve named %s' %ipo.name)
|
||||
numCurves = ipo.getNcurves() #like LocX, LocY, etc
|
||||
if numCurves > 0:
|
||||
eraseCurve(ipo, numCurves) #erase data if one exists
|
||||
return
|
||||
|
||||
########################################
|
||||
def resetIPOs(ob): #resets all IPO curvess assocated with an object and its bones
|
||||
debug(30,'Resetting any ipo curves linked to %s' %ob.getName())
|
||||
ipo = ob.getIpo() #may be None
|
||||
ipoName = ipo.getName() #name of the IPO that guides/controls this object
|
||||
debug(70,'Object IPO is %s' %ipoName)
|
||||
try:
|
||||
ipo = Ipo.Get(ipoName)
|
||||
except:
|
||||
ipo = Ipo.New('Object', ipoName)
|
||||
resetIPO(ipo)
|
||||
if ob.getType() == ARMATURE:
|
||||
arm_data=ob.getData()
|
||||
bones=arm_data.bones.values()
|
||||
for bone in bones:
|
||||
#for each bone: get the name and check for a Pose IPO
|
||||
debug(10,'Processing '+ bone.name)
|
||||
return
|
||||
|
||||
########################################
|
||||
def parse(string,delim):
|
||||
index = string.find(delim) # -1 if not found, else pointer to delim
|
||||
if index+1: return string[:index]
|
||||
return string
|
||||
|
||||
########################################
|
||||
def newIpo(ipoName): #add a new Ipo object to the Blender scene
|
||||
ipo=Blender.Ipo.New('Object',ipoName)
|
||||
|
||||
ipo.addCurve('LocX')
|
||||
ipo.addCurve('LocY')
|
||||
ipo.addCurve('LocZ')
|
||||
ipo.addCurve('RotX')
|
||||
ipo.addCurve('RotY')
|
||||
ipo.addCurve('RotZ')
|
||||
return ipo
|
||||
|
||||
########################################
|
||||
def makeUpaName(type,name): #i know this exists in Blender somewhere...
|
||||
debug(90,'Making up a new %s name using %s as a basis.' % (type,name))
|
||||
name = (parse(name,'.'))
|
||||
if type == 'Ipo':
|
||||
ipoName = name # maybe we get lucky today
|
||||
ext = 0
|
||||
extlen = 3 # 3 digit extensions, like hello.002
|
||||
success = False
|
||||
while not(success):
|
||||
try:
|
||||
debug(100,'Trying %s' % ipoName)
|
||||
ipo = Ipo.Get(ipoName)
|
||||
#that one exists if we get here. add on extension and keep trying
|
||||
ext +=1
|
||||
if ext>=10**extlen: extlen +=1 # go to more digits if 999 not found
|
||||
ipoName = '%s.%s' % (name, str(ext).zfill(extlen))
|
||||
except: # could not find it
|
||||
success = True
|
||||
name=ipoName
|
||||
else:
|
||||
debug (0,'FATAL ERROR: I dont know how to make up a new %s name based on %s' % (type,ob))
|
||||
return None
|
||||
return name
|
||||
|
||||
########################################
|
||||
def createIpo(ob): #create an Ipo and curves and link them to this object
|
||||
#first, we have to create a unique name
|
||||
#try first with just the name of the object to keep things simple.
|
||||
ipoName = makeUpaName('Ipo',ob.getName()) # make up a name for a new Ipo based on the object name
|
||||
debug(20,'Ipo and LocRot curves called %s' % ipoName)
|
||||
ipo=newIpo(ipoName)
|
||||
ob.setIpo(ipo) #link them
|
||||
return ipo
|
||||
|
||||
########################################
|
||||
def getLocLocal(ob):
|
||||
key = [
|
||||
ob.LocX,
|
||||
ob.LocY,
|
||||
ob.LocZ,
|
||||
ob.RotX*R2D, #get the curves in this order
|
||||
ob.RotY*R2D,
|
||||
ob.RotZ*R2D
|
||||
]
|
||||
return key
|
||||
|
||||
########################################
|
||||
def getLocReal(ob):
|
||||
obMatrix = ob.matrixWorld #Thank you IdeasMan42
|
||||
loc = obMatrix.translationPart()
|
||||
rot = obMatrix.toEuler()
|
||||
key = [
|
||||
loc.x,
|
||||
loc.y,
|
||||
loc.z,
|
||||
rot.x/10,
|
||||
rot.y/10,
|
||||
rot.z/10
|
||||
]
|
||||
return key
|
||||
|
||||
########################################
|
||||
def getLocRot(ob,space):
|
||||
if space in xrange(len(COORDINATE_SYSTEMS)):
|
||||
if space == COORD_LOCAL:
|
||||
key = getLocLocal(ob)
|
||||
return key
|
||||
elif space == COORD_REAL:
|
||||
key = getLocReal(ob)
|
||||
return key
|
||||
else: #hey, programmers make mistakes too.
|
||||
debug(0,'Fatal Error: getLoc called with %i' % space)
|
||||
return
|
||||
|
||||
########################################
|
||||
def getCurves(ipo):
|
||||
ipos = [
|
||||
ipo[Ipo.OB_LOCX],
|
||||
ipo[Ipo.OB_LOCY],
|
||||
ipo[Ipo.OB_LOCZ],
|
||||
ipo[Ipo.OB_ROTX], #get the curves in this order
|
||||
ipo[Ipo.OB_ROTY],
|
||||
ipo[Ipo.OB_ROTZ]
|
||||
]
|
||||
return ipos
|
||||
|
||||
########################################
|
||||
def addPoint(time,keyLocRot,ipos):
|
||||
if BLENDER_VERSION < 245:
|
||||
debug(0,'WARNING: addPoint uses BezTriple')
|
||||
for i in range(len(ipos)):
|
||||
point = BezTriple.New() #this was new with Blender 2.45 API
|
||||
point.pt = (time, keyLocRot[i])
|
||||
point.handleTypes = [1,1]
|
||||
|
||||
ipos[i].append(point)
|
||||
return ipos
|
||||
|
||||
########################################
|
||||
def bakeFrames(ob,myipo): #bakes an object in a scene, returning the IPO containing the curves
|
||||
myipoName = myipo.getName()
|
||||
debug(20,'Baking frames for scene %s object %s to ipo %s' % (scn.getName(),ob.getName(),myipoName))
|
||||
ipos = getCurves(myipo)
|
||||
#TODO: Gui setup idea: myOffset
|
||||
# reset action to start at frame 1 or at location
|
||||
myOffset=0 #=1-staframe
|
||||
#loop through frames in the animation. Often, there is rollup and the mocap starts late
|
||||
staframe,endframe,curframe = getRenderInfo()
|
||||
for frame in range(staframe, endframe+1):
|
||||
debug(80,'Baking Frame %i' % frame)
|
||||
#tell Blender to advace to frame
|
||||
Blender.Set(CURFRAME,frame) # computes the constrained location of the 'real' objects
|
||||
if not BATCH: Blender.Redraw() # no secrets, let user see what we are doing
|
||||
|
||||
#using the constrained Loc Rot of the object, set the location of the unconstrained clone. Yea! Clones are FreeMen
|
||||
key = getLocRot(ob,usrCoord) #a key is a set of specifed exact channel values (LocRotScale) for a certain frame
|
||||
key = [a+b for a,b in zip(key, usrDelta)] #offset to the new location
|
||||
|
||||
myframe= frame+myOffset
|
||||
Blender.Set(CURFRAME,myframe)
|
||||
|
||||
time = Blender.Get('curtime') #for BezTriple
|
||||
ipos = addPoint(time,key,ipos) #add this data at this time to the ipos
|
||||
debug(100,'%s %i %.3f %.2f %.2f %.2f %.2f %.2f %.2f' % (myipoName, myframe, time, key[0], key[1], key[2], key[3], key[4], key[5]))
|
||||
# eye-candy - smoothly rewind the animation, showing now how the clone match moves
|
||||
if endframe-staframe <400 and not BATCH:
|
||||
for frame in range (endframe,staframe,-1): #rewind
|
||||
Blender.Set(CURFRAME,frame) # computes the constrained location of the 'real' objects
|
||||
Blender.Redraw()
|
||||
Blender.Set(CURFRAME,staframe)
|
||||
Blender.Redraw()
|
||||
|
||||
return ipos
|
||||
|
||||
########################################
|
||||
def duplicateLinked(ob):
|
||||
obType = ob.type
|
||||
debug(10,'Duplicating %s Object named %s' % (obType,ob.getName()))
|
||||
scn.objects.selected = [ob]
|
||||
## rdw: simplified by just duplicating armature. kept code as reference for creating armatures
|
||||
## disadvantage is that you cant have clone as stick and original as octahedron
|
||||
## since they share the same Armature. User can click Make Single User button.
|
||||
## if obType == ARMATURE: #build a copy from scratch
|
||||
## myob= dupliArmature(ob)
|
||||
## else:
|
||||
Blender.Object.Duplicate() # Duplicate linked, including pose constraints.
|
||||
myobs = Object.GetSelected() #duplicate is top on the list
|
||||
myob = myobs[0]
|
||||
if usrParent == False:
|
||||
myob.clrParent(usrFreeze)
|
||||
debug(20,'=myob= was created as %s' % myob.getName())
|
||||
return myob
|
||||
|
||||
########################################
|
||||
def removeConstraints(ob):
|
||||
for const in ob.constraints:
|
||||
debug(90,'removed %s => %s' % (ob.name, const))
|
||||
ob.constraints.remove(const)
|
||||
return
|
||||
|
||||
########################################
|
||||
def removeConstraintsOb(ob): # from object or armature
|
||||
debug(40,'Removing constraints from '+ob.getName())
|
||||
if BLENDER_VERSION > 241: #constraints module not available before 242
|
||||
removeConstraints(ob)
|
||||
if ob.getType() == ARMATURE:
|
||||
pose = ob.getPose()
|
||||
for pbone in pose.bones.values():
|
||||
#bone = pose.bones[bonename]
|
||||
removeConstraints(pbone)
|
||||
#should also check if it is a deflector?
|
||||
return
|
||||
|
||||
########################################
|
||||
def deLinkOb(type,ob): #remove linkages
|
||||
if type == 'Ipo':
|
||||
success = ob.clearIpo() #true=there was one
|
||||
if success: debug(80,'deLinked Ipo curve to %s' % ob.getName())
|
||||
return
|
||||
|
||||
########################################
|
||||
def bakeObject(ob): #bakes the core object locrot and assigns the Ipo to a Clone
|
||||
if ob != None:
|
||||
# Clone the object - duplicate it, clean the clone, and create an ipo curve for the clone
|
||||
myob = duplicateLinked(ob) #clone it
|
||||
myob.name= usrObjectNamePrefix + ob.getName()
|
||||
removeConstraintsOb(myob) #my object is a free man
|
||||
deLinkOb('Ipo',myob) #kids, it's not nice to share. you've been lied to
|
||||
if ob.getType() != ARMATURE: # baking armatures is based on bones, not object
|
||||
myipo = createIpo(myob) #create own IPO and curves for the clone object
|
||||
ipos = bakeFrames(ob,myipo) #bake the locrot for this obj for the scene frames
|
||||
return myob
|
||||
|
||||
########################################
|
||||
def bake(ob,par): #bakes an object of any type, linking it to parent
|
||||
debug(0,'Baking %s object %s' % (ob.getType(), ob))
|
||||
clone = bakeObject(ob) #creates and bakes the object motion
|
||||
if par!= None:
|
||||
par.makeParent([clone])
|
||||
debug(20,"assigned object to parent %s" % par)
|
||||
if ob.getType() == ARMATURE:
|
||||
## error('Object baked. Continue with bones?')
|
||||
bakeBones(ob,clone) #go into the bones and copy from -> to in frame range
|
||||
#future idea: bakeMesh (net result of Shapekeys, Softbody, Cloth, Fluidsim,...)
|
||||
return clone
|
||||
|
||||
########################################
|
||||
def tstCreateArm(): #create a test armature in scene
|
||||
# rip-off from http://www.blender.org/documentation/245PythonDoc/Pose-module.html - thank you!
|
||||
|
||||
debug(0,'Making Test Armature')
|
||||
# New Armature
|
||||
arm_data= Armature.New('myArmature')
|
||||
print arm_data
|
||||
arm_ob = scn.objects.new(arm_data)
|
||||
arm_data.makeEditable()
|
||||
|
||||
# Add 4 bones
|
||||
ebones = [Armature.Editbone(), Armature.Editbone(), Armature.Editbone(), Armature.Editbone()]
|
||||
|
||||
# Name the editbones
|
||||
ebones[0].name = 'Bone.001'
|
||||
ebones[1].name = 'Bone.002'
|
||||
ebones[2].name = 'Bone.003'
|
||||
ebones[3].name = 'Bone.004'
|
||||
|
||||
# Assign the editbones to the armature
|
||||
for eb in ebones:
|
||||
arm_data.bones[eb.name]= eb
|
||||
|
||||
# Set the locations of the bones
|
||||
ebones[0].head= Mathutils.Vector(0,0,0)
|
||||
ebones[0].tail= Mathutils.Vector(0,0,1) #tip
|
||||
ebones[1].head= Mathutils.Vector(0,0,1)
|
||||
ebones[1].tail= Mathutils.Vector(0,0,2)
|
||||
ebones[2].head= Mathutils.Vector(0,0,2)
|
||||
ebones[2].tail= Mathutils.Vector(0,0,3)
|
||||
ebones[3].head= Mathutils.Vector(0,0,3)
|
||||
ebones[3].tail= Mathutils.Vector(0,0,4)
|
||||
|
||||
ebones[1].parent= ebones[0]
|
||||
ebones[2].parent= ebones[1]
|
||||
ebones[3].parent= ebones[2]
|
||||
|
||||
arm_data.update()
|
||||
# Done with editing the armature
|
||||
|
||||
# Assign the pose animation
|
||||
arm_pose = arm_ob.getPose()
|
||||
|
||||
act = arm_ob.getAction()
|
||||
if not act: # Add a pose action if we dont have one
|
||||
act = Armature.NLA.NewAction()
|
||||
act.setActive(arm_ob)
|
||||
|
||||
xbones=arm_ob.data.bones.values()
|
||||
pbones = arm_pose.bones.values()
|
||||
|
||||
frame = 1
|
||||
for pbone in pbones: # set bones to no rotation
|
||||
pbone.quat[:] = 1.000,0.000,0.000,0.0000
|
||||
pbone.insertKey(arm_ob, frame, Object.Pose.ROT)
|
||||
|
||||
# Set a different rotation at frame 25
|
||||
pbones[0].quat[:] = 1.000,0.1000,0.2000,0.20000
|
||||
pbones[1].quat[:] = 1.000,0.6000,0.5000,0.40000
|
||||
pbones[2].quat[:] = 1.000,0.1000,0.3000,0.40000
|
||||
pbones[3].quat[:] = 1.000,-0.2000,-0.3000,0.30000
|
||||
|
||||
frame = 25
|
||||
for i in xrange(4):
|
||||
pbones[i].insertKey(arm_ob, frame, Object.Pose.ROT)
|
||||
|
||||
pbones[0].quat[:] = 1.000,0.000,0.000,0.0000
|
||||
pbones[1].quat[:] = 1.000,0.000,0.000,0.0000
|
||||
pbones[2].quat[:] = 1.000,0.000,0.000,0.0000
|
||||
pbones[3].quat[:] = 1.000,0.000,0.000,0.0000
|
||||
|
||||
frame = 50
|
||||
for pbone in pbones: # set bones to no rotation
|
||||
pbone.quat[:] = 1.000,0.000,0.000,0.0000
|
||||
pbone.insertKey(arm_ob, frame, Object.Pose.ROT)
|
||||
|
||||
return arm_ob
|
||||
|
||||
########################################
|
||||
def tstMoveOb(ob): # makes a simple LocRot animation of object in the scene
|
||||
anim = [
|
||||
#Loc Rot/10
|
||||
#
|
||||
( 0,0,0, 0, 0, 0), #frame 1 origin
|
||||
( 1,0,0, 0, 0, 0), #frame 2
|
||||
( 1,1,0, 0, 0, 0),
|
||||
( 1,1,1, 0, 0, 0),
|
||||
( 1,1,1,4.5, 0, 0),
|
||||
( 1,1,1,4.5,4.5, 0),
|
||||
( 1,1,1,4.5,4.5,4.5)
|
||||
]
|
||||
space = COORD_LOCAL
|
||||
ipo = createIpo(ob) #create an Ipo and curves for this object
|
||||
ipos = getCurves(ipo)
|
||||
|
||||
# span this motion over the currently set anim range
|
||||
# to set points, i need time but do not know how it is computed, so will have to advance the animation
|
||||
staframe,endframe,curframe = getRenderInfo()
|
||||
|
||||
frame = staframe #x position of new ipo datapoint. set to staframe if you want a match
|
||||
frameDelta=(endframe-staframe)/(len(anim)) #accomplish the animation in frame range
|
||||
for key in anim: #effectively does a getLocRot()
|
||||
#tell Blender to advace to frame
|
||||
Blender.Set('curframe',frame) # computes the constrained location of the 'real' objects
|
||||
time = Blender.Get('curtime')
|
||||
|
||||
ipos = addPoint(time,key,ipos) #add this data at this time to the ipos
|
||||
|
||||
debug(100,'%s %i %.3f %.2f %.2f %.2f %.2f %.2f %.2f' % (ipo.name, frame, time, key[0], key[1], key[2], key[3], key[4], key[5]))
|
||||
frame += frameDelta
|
||||
Blender.Set(CURFRAME,curframe) # reset back to where we started
|
||||
return
|
||||
#=================
|
||||
# Program Template
|
||||
#=================
|
||||
########################################
|
||||
def main():
|
||||
# return code set via rt button in Blender Buttons Scene Context Anim panel
|
||||
if MODE == 1: #create test armature #1
|
||||
ob = tstCreateArm() # make test arm and select it
|
||||
tstMoveOb(ob)
|
||||
scn.objects.selected = [ob]
|
||||
|
||||
obs= Blender.Object.GetSelected() #scn.objects.selected
|
||||
obs= sortObjects(obs)
|
||||
debug(0,'Baking %i objects' % len(obs))
|
||||
|
||||
if len(obs) >= 1: # user might have multiple objects selected
|
||||
i= 0
|
||||
clones=[] # my clone army
|
||||
for ob in obs:
|
||||
par= ob.getParent()
|
||||
if not usrParent:
|
||||
if par in obs:
|
||||
par= clones[obs.index(par)]
|
||||
clones.append(bake(ob,par))
|
||||
scn.objects.selected = clones
|
||||
else:
|
||||
error('Please select at least one object')
|
||||
return
|
||||
|
||||
########################################
|
||||
def benchmark(): # This lets you benchmark (time) the script's running duration
|
||||
Window.WaitCursor(1)
|
||||
t = sys.time()
|
||||
debug(60,'%s began at %.0f' %(__script__,sys.time()))
|
||||
|
||||
# Run the function on the active scene
|
||||
in_editmode = Window.EditMode()
|
||||
if in_editmode: Window.EditMode(0)
|
||||
|
||||
main()
|
||||
|
||||
if in_editmode: Window.EditMode(1)
|
||||
|
||||
# Timing the script is a good way to be aware on any speed hits when scripting
|
||||
debug(0,'%s Script finished in %.2f seconds' % (__script__,sys.time()-t) )
|
||||
Window.WaitCursor(0)
|
||||
return
|
||||
|
||||
########################################
|
||||
# This lets you can import the script without running it
|
||||
if __name__ == '__main__':
|
||||
debug(0, "------------------------------------")
|
||||
debug(0, "%s %s Script begins with mode=%i debug=%i batch=%s" % (__script__,__version__,MODE,DEBUG,BATCH))
|
||||
benchmark()
|
||||
@@ -11,13 +11,19 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# Version History:
|
||||
# 1.0 original release bakes an armature into a matrix
|
||||
# 1.1 optional params (ACTION_BAKE, ACTION_BAKE_FIRST_FRAME, direct function to key and return the Action
|
||||
|
||||
import Blender
|
||||
from Blender import sys
|
||||
import bpy
|
||||
def getBakedPoseData(ob_arm, start_frame, end_frame):
|
||||
def getBakedPoseData(ob_arm, start_frame, end_frame, ACTION_BAKE = False, ACTION_BAKE_FIRST_FRAME = True):
|
||||
'''
|
||||
If you are currently getting IPO's this function can be used to
|
||||
return a list of frame aligned bone dictionary's
|
||||
ACTION_BAKE==False: return a list of frame aligned bone dictionary's
|
||||
ACTION_BAKE==True: return an action with keys aligned to bone constrained movement
|
||||
if ACTION_BAKE_FIRST_FRAME is not supplied or is true: keys begin at frame 1
|
||||
|
||||
The data in these can be swaped in for the IPO loc and quat
|
||||
|
||||
@@ -77,7 +83,13 @@ def getBakedPoseData(ob_arm, start_frame, end_frame):
|
||||
|
||||
# --------------------------------- Main loop to collect IPO data
|
||||
frame_index = 0
|
||||
NvideoFrames= end_frame-start_frame
|
||||
for current_frame in xrange(start_frame, end_frame+1):
|
||||
if frame_index==0: start=sys.time()
|
||||
elif frame_index==15: print NvideoFrames*(sys.time()-start),"seconds estimated..." #slows as it grows *3
|
||||
elif frame_index >15:
|
||||
percom= frame_index*100/NvideoFrames
|
||||
print "Frame %i Overall %i percent complete\r" % (current_frame, percom),
|
||||
ob_arm.action = backup_action
|
||||
#pose.update() # not needed
|
||||
Blender.Set('curframe', current_frame)
|
||||
@@ -88,9 +100,7 @@ def getBakedPoseData(ob_arm, start_frame, end_frame):
|
||||
|
||||
for index, parent_index, bone_name, rest_bone, rest_matrix, rest_matrix_inv, pose_bone, ipo in armature_bone_data:
|
||||
matrix= pose_bone.poseMatrix
|
||||
|
||||
parent_bone= rest_bone.parent
|
||||
|
||||
if parent_index != -1:
|
||||
parent_pose_matrix = armature_bone_data[parent_index][6].poseMatrix
|
||||
parent_bone_matrix_inv = armature_bone_data[parent_index][5]
|
||||
@@ -98,40 +108,45 @@ def getBakedPoseData(ob_arm, start_frame, end_frame):
|
||||
rest_matrix= rest_matrix * parent_bone_matrix_inv
|
||||
|
||||
matrix=matrix * rest_matrix.copy().invert()
|
||||
|
||||
pose_bone.quat= matrix.toQuat()
|
||||
pose_bone.loc= matrix.translationPart()
|
||||
pose_bone.insertKey(ob_arm, 1, POSE_XFORM) # always frame 1
|
||||
if ACTION_BAKE==False:
|
||||
pose_bone.insertKey(ob_arm, 1, POSE_XFORM) # always frame 1
|
||||
|
||||
# THIS IS A BAD HACK! IT SUCKS BIGTIME BUT THE RESULT ARE NICE
|
||||
# - use a temp action and bake into that, always at the same frame
|
||||
# so as not to make big IPO's, then collect the result from the IPOs
|
||||
|
||||
# THIS IS A BAD HACK! IT SUCKS BIGTIME BUT THE RESULT ARE NICE
|
||||
# - use a temp action and bake into that, always at the same frame
|
||||
# so as not to make big IPO's, then collect the result from the IPOs
|
||||
# Now get the data from the IPOs
|
||||
if not ipo: ipo = armature_bone_data[index][7] = new_action.getChannelIpo(bone_name)
|
||||
|
||||
# Now get the data from the IPOs
|
||||
if not ipo: ipo = armature_bone_data[index][7] = new_action.getChannelIpo(bone_name)
|
||||
loc = Vector()
|
||||
quat = Quaternion()
|
||||
|
||||
loc = Vector()
|
||||
quat = Quaternion()
|
||||
for curve in ipo:
|
||||
val = curve.evaluate(1)
|
||||
curve_name= curve.name
|
||||
if curve_name == 'LocX': loc[0] = val
|
||||
elif curve_name == 'LocY': loc[1] = val
|
||||
elif curve_name == 'LocZ': loc[2] = val
|
||||
elif curve_name == 'QuatW': quat[3] = val
|
||||
elif curve_name == 'QuatX': quat[0] = val
|
||||
elif curve_name == 'QuatY': quat[1] = val
|
||||
elif curve_name == 'QuatZ': quat[2] = val
|
||||
|
||||
for curve in ipo:
|
||||
val = curve.evaluate(1)
|
||||
curve_name= curve.name
|
||||
if curve_name == 'LocX': loc[0] = val
|
||||
elif curve_name == 'LocY': loc[1] = val
|
||||
elif curve_name == 'LocZ': loc[2] = val
|
||||
elif curve_name == 'QuatW': quat[3] = val
|
||||
elif curve_name == 'QuatX': quat[0] = val
|
||||
elif curve_name == 'QuatY': quat[1] = val
|
||||
elif curve_name == 'QuatZ': quat[2] = val
|
||||
|
||||
bake_data[frame_index][bone_name] = loc, quat
|
||||
|
||||
|
||||
bake_data[frame_index][bone_name] = loc, quat
|
||||
else:
|
||||
if ACTION_BAKE_FIRST_FRAME: pose_bone.insertKey(ob_arm, frame_index+1, POSE_XFORM)
|
||||
else: pose_bone.insertKey(ob_arm, current_frame , POSE_XFORM)
|
||||
frame_index+=1
|
||||
|
||||
print "\nBaking Complete."
|
||||
ob_arm.action = backup_action
|
||||
Blender.Set('curframe', backup_frame)
|
||||
return bake_data
|
||||
if ACTION_BAKE==False:
|
||||
Blender.Set('curframe', backup_frame)
|
||||
return bake_data
|
||||
elif ACTION_BAKE==True:
|
||||
return new_action
|
||||
else: print "ERROR: Invalid ACTION_BAKE %i sent to BPyArmature" % ACTION_BAKE
|
||||
|
||||
|
||||
|
||||
|
||||
1243
release/scripts/c3d_import.py
Normal file
1243
release/scripts/c3d_import.py
Normal file
File diff suppressed because it is too large
Load Diff
@@ -50,7 +50,7 @@ def RM(a):
|
||||
cp = cos(a[1])
|
||||
sr = sin(a[0])
|
||||
cr = cos(a[0])
|
||||
return Matrix([cp*cy, sr*sp*cy+cr*-sy, cr*sp*cy+-sr*-sy],[cp*sy, sr*sp*sy+cr*cy, cr*sp*sy+-sr*cy], [-sp, sr*cp, cr*cp])
|
||||
return Matrix([cp*cy, cp*sy, -sp], [sr*sp*cy+cr*-sy, sr*sp*sy+cr*cy, sr*cp],[cr*sp*cy+-sr*-sy, cr*sp*sy+-sr*cy, cr*cp])
|
||||
|
||||
|
||||
# Converts ms3d euler angles to a quaternion
|
||||
@@ -94,7 +94,12 @@ def import_ms3d(path):
|
||||
except IOError:
|
||||
return "Failed to open the file!"
|
||||
|
||||
# read id
|
||||
# get the file size
|
||||
file.seek(0, os.SEEK_END);
|
||||
fileSize = file.tell();
|
||||
file.seek(0, os.SEEK_SET);
|
||||
|
||||
# read id to check if the file is a MilkShape3D file
|
||||
id = file.read(10)
|
||||
if id!="MS3D000000":
|
||||
return "The file is not a MS3D file!"
|
||||
@@ -123,7 +128,7 @@ def import_ms3d(path):
|
||||
coords.append(struct.unpack("fff", file.read(3*4)))
|
||||
|
||||
# read bone ids
|
||||
boneIds.append(struct.unpack("B", file.read(1))[0])
|
||||
boneIds.append(struct.unpack("b", file.read(1))[0])
|
||||
|
||||
# skip refcount
|
||||
file.read(1)
|
||||
@@ -190,9 +195,10 @@ def import_ms3d(path):
|
||||
triangleIndices = struct.unpack(str(numGroupTriangles) + "H", file.read(2*numGroupTriangles));
|
||||
|
||||
# read material
|
||||
material = struct.unpack("B", file.read(1))[0]
|
||||
for j in xrange(numGroupTriangles):
|
||||
mesh.faces[triangleIndices[j]].mat = material
|
||||
material = struct.unpack("b", file.read(1))[0]
|
||||
if material>=0:
|
||||
for j in xrange(numGroupTriangles):
|
||||
mesh.faces[triangleIndices[j]].mat = material
|
||||
|
||||
# read the number of materials
|
||||
numMaterials = struct.unpack("H", file.read(2))[0]
|
||||
@@ -224,7 +230,6 @@ def import_ms3d(path):
|
||||
|
||||
# read shininess
|
||||
shininess = struct.unpack("f", file.read(4))[0]
|
||||
print "Shininess: " + str(shininess)
|
||||
|
||||
# read transparency
|
||||
transparency = struct.unpack("f", file.read(4))[0]
|
||||
@@ -272,6 +277,7 @@ def import_ms3d(path):
|
||||
armature.makeEditable()
|
||||
|
||||
# read joints
|
||||
joints = []
|
||||
rotKeys = {}
|
||||
posKeys = {}
|
||||
for i in xrange(numJoints):
|
||||
@@ -280,6 +286,7 @@ def import_ms3d(path):
|
||||
|
||||
# read name
|
||||
name = uku(file.read(32))
|
||||
joints.append(name)
|
||||
|
||||
# create the bone
|
||||
bone = Blender.Armature.Editbone()
|
||||
@@ -295,11 +302,13 @@ def import_ms3d(path):
|
||||
|
||||
# read position
|
||||
pos = struct.unpack("fff", file.read(3*4))
|
||||
|
||||
|
||||
# set head
|
||||
if bone.hasParent():
|
||||
bone.head = bone.parent.matrix * Vector(pos) + bone.parent.head
|
||||
bone.matrix = bone.parent.matrix * RM(rot)
|
||||
bone.head = Vector(pos) * bone.parent.matrix + bone.parent.head
|
||||
tempM = RM(rot) * bone.parent.matrix
|
||||
tempM.transpose;
|
||||
bone.matrix = tempM
|
||||
else:
|
||||
bone.head = Vector(pos)
|
||||
bone.matrix = RM(rot)
|
||||
@@ -355,13 +364,111 @@ def import_ms3d(path):
|
||||
# create position keys
|
||||
for key in posKeys[name]:
|
||||
pbone.loc = Vector(key[1])
|
||||
pbone.insertKey(armOb, int(key[0]), Blender.Object.Pose.LOC, True)
|
||||
pbone.insertKey(armOb, int(key[0]+0.5), Blender.Object.Pose.LOC, True)
|
||||
|
||||
# create rotation keys
|
||||
for key in rotKeys[name]:
|
||||
pbone.quat = RQ(key[1])
|
||||
pbone.insertKey(armOb, int(key[0]), Blender.Object.Pose.ROT, True)
|
||||
pbone.insertKey(armOb, int(key[0]+0.5), Blender.Object.Pose.ROT, True)
|
||||
|
||||
# The old format ends here. If there is more data then the file is newer version
|
||||
|
||||
# check to see if there are any comments
|
||||
if file.tell()<fileSize:
|
||||
|
||||
# read sub version
|
||||
subVersion = struct.unpack("i", file.read(4))[0]
|
||||
|
||||
# Is the sub version a supported one
|
||||
if subVersion==1:
|
||||
|
||||
# Group comments
|
||||
numComments = struct.unpack("i", file.read(4))[0]
|
||||
for i in range(numComments):
|
||||
file.read(4) # index
|
||||
size = struct.unpack("i", file.read(4))[0] # comment size
|
||||
if size>0:
|
||||
print "Group comment: " + file.read(size)
|
||||
|
||||
# Material comments
|
||||
numComments = struct.unpack("i", file.read(4))[0]
|
||||
for i in range(numComments):
|
||||
file.read(4) # index
|
||||
size = struct.unpack("i", file.read(4))[0] # comment size
|
||||
if size>0:
|
||||
print "Material comment: " + file.read(size)
|
||||
|
||||
# Joint comments
|
||||
numComments = struct.unpack("i", file.read(4))[0]
|
||||
for i in range(numComments):
|
||||
file.read(4) # index
|
||||
size = struct.unpack("i", file.read(4))[0] # comment size
|
||||
if size>0:
|
||||
print "Joint comment: " + file.read(size)
|
||||
|
||||
# Model comments
|
||||
numComments = struct.unpack("i", file.read(4))[0]
|
||||
for i in range(numComments):
|
||||
file.read(4) # index
|
||||
size = struct.unpack("i", file.read(4))[0] # comment size
|
||||
if size>0:
|
||||
print "Model comment: " + file.read(size)
|
||||
|
||||
# Unknown version give a warning
|
||||
else:
|
||||
print "Warning: Unknown version!"
|
||||
|
||||
|
||||
# check to see if there is any extra vertex data
|
||||
if file.tell()<fileSize:
|
||||
|
||||
# read the subversion
|
||||
subVersion = struct.unpack("i", file.read(4))[0]
|
||||
|
||||
# is the version supported
|
||||
if subVersion==2:
|
||||
# read the extra data for each vertex
|
||||
for i in xrange(numVertices):
|
||||
# bone ids
|
||||
ids = struct.unpack("bbb", file.read(3))
|
||||
# weights
|
||||
weights = struct.unpack("BBB", file.read(3))
|
||||
# extra
|
||||
extra = struct.unpack("I", file.read(4))
|
||||
# add extra vertices with weights to deform groups
|
||||
if ids[0]>=0 or ids[1]>=0 or ids[2]>=0:
|
||||
mesh.assignVertsToGroup(joints[boneIds[i]], [i], 0.01*weights[0], 1)
|
||||
if ids[0]>=0:
|
||||
mesh.assignVertsToGroup(joints[ids[0]], [i], 0.01*weights[1], 1)
|
||||
if ids[1]>=0:
|
||||
mesh.assignVertsToGroup(joints[ids[1]], [i], 0.01*weights[2], 1)
|
||||
if ids[2]>=0:
|
||||
mesh.assignVertsToGroup(joints[ids[2]], [i], 0.01*(100-(weights[0]+weights[1]+weights[2])), 1)
|
||||
|
||||
elif subVersion==1:
|
||||
# read extra data for each vertex
|
||||
for i in xrange(numVertices):
|
||||
# bone ids
|
||||
ids = struct.unpack("bbb", file.read(3))
|
||||
# weights
|
||||
weights = struct.unpack("BBB", file.read(3))
|
||||
# add extra vertices with weights to deform groups
|
||||
if ids[0]>=0 or ids[1]>=0 or ids[2]>=0:
|
||||
mesh.assignVertsToGroup(joints[boneIds[i]], [i], 0.01*weights[0], 1)
|
||||
if ids[0]>=0:
|
||||
mesh.assignVertsToGroup(joints[ids[0]], [i], 0.01*weights[1], 1)
|
||||
if ids[1]>=0:
|
||||
mesh.assignVertsToGroup(joints[ids[1]], [i], 0.01*weights[2], 1)
|
||||
if ids[2]>=0:
|
||||
mesh.assignVertsToGroup(joints[ids[2]], [i], 0.01*(100-(weights[0]+weights[1]+weights[2])), 1)
|
||||
|
||||
# non supported subversion give a warning
|
||||
else:
|
||||
print "Warning: Unknown subversion!"
|
||||
|
||||
# rest of the extra data in the file is not imported/used
|
||||
|
||||
# refresh the view
|
||||
Blender.Redraw()
|
||||
|
||||
# close the file
|
||||
@@ -378,4 +485,3 @@ def fileCallback(filename):
|
||||
Blender.Draw.PupMenu("An error occured during import: " + error + "|Not all data might have been imported succesfully.", 2)
|
||||
|
||||
Blender.Window.FileSelector(fileCallback, 'Import')
|
||||
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
Name: 'VRML97 (.wrl)...'
|
||||
Blender: 241
|
||||
Group: 'Export'
|
||||
Submenu: 'All Objects...' all
|
||||
Submenu: 'All Objects compressed...' comp
|
||||
Submenu: 'Selected Objects...' selected
|
||||
Tooltip: 'Export to VRML97 file (.wrl)'
|
||||
"""
|
||||
|
||||
@@ -55,7 +52,7 @@ want to export only selected or all relevant objects.
|
||||
|
||||
import Blender
|
||||
from Blender import Object, Mesh, Lamp, Draw, BGL, \
|
||||
Image, Text, sys, Mathutils
|
||||
Image, Text, sys, Mathutils, Registry
|
||||
from Blender.Scene import Render
|
||||
|
||||
import math
|
||||
@@ -70,8 +67,9 @@ worldmat = Blender.Texture.Get()
|
||||
filename = Blender.Get('filename')
|
||||
_safeOverwrite = True
|
||||
extension = ''
|
||||
ARG=''
|
||||
|
||||
# Matrices below are used only when export_rotate_z_to_y.val:
|
||||
#
|
||||
# Blender is Z up, VRML is Y up, both are right hand coordinate
|
||||
# systems, so to go from Blender coords to VRML coords we rotate
|
||||
# by 90 degrees around the X axis. In matrix notation, we have a
|
||||
@@ -456,6 +454,8 @@ class VRML2Export:
|
||||
if mat:
|
||||
if (mat.mode & Blender.Material.Modes['VCOL_PAINT']):
|
||||
self.vcolors = 1
|
||||
else:
|
||||
self.vcolors = 0
|
||||
|
||||
# check if object is wireframe only
|
||||
if ob.drawType == Blender.Object.DrawTypes.WIRE:
|
||||
@@ -633,8 +633,9 @@ class VRML2Export:
|
||||
meshVertexList = me.verts
|
||||
|
||||
for vertex in meshVertexList:
|
||||
blenvert = Mathutils.Vector(vertex.co)
|
||||
vrmlvert = M_blen2vrml * blenvert
|
||||
vrmlvert = blenvert = Mathutils.Vector(vertex.co)
|
||||
if export_rotate_z_to_y.val:
|
||||
vrmlvert = M_blen2vrml * vrmlvert
|
||||
self.writeUnindented("%s %s %s\n " % \
|
||||
(vrmlvert[0], \
|
||||
vrmlvert[1], \
|
||||
@@ -730,8 +731,8 @@ class VRML2Export:
|
||||
round(uv[1], self.tp))
|
||||
j=j+1
|
||||
indexStr += "-1"
|
||||
texIndexList.append(indexStr)
|
||||
texCoordList.append(coordStr)
|
||||
texIndexList.append(indexStr)
|
||||
texCoordList.append(coordStr)
|
||||
|
||||
self.writeIndented("texCoord TextureCoordinate {\n", 1)
|
||||
self.writeIndented("point [\n", 1)
|
||||
@@ -1016,7 +1017,10 @@ class VRML2Export:
|
||||
return
|
||||
|
||||
ob_matrix = Mathutils.Matrix(ob.getMatrix('worldspace'))
|
||||
matrix = M_blen2vrml * ob_matrix * M_vrml2blen
|
||||
if export_rotate_z_to_y.val:
|
||||
matrix = M_blen2vrml * ob_matrix * M_vrml2blen
|
||||
else:
|
||||
matrix = ob_matrix
|
||||
e = matrix.rotationPart().toEuler()
|
||||
|
||||
v = matrix.translationPart()
|
||||
@@ -1089,7 +1093,7 @@ class VRML2Export:
|
||||
self.writeFog()
|
||||
self.proto = 0
|
||||
allObj = []
|
||||
if ARG == 'selected':
|
||||
if export_selection_only.val:
|
||||
allObj = list(scene.objects.context)
|
||||
else:
|
||||
allObj = list(scene.objects)
|
||||
@@ -1098,7 +1102,7 @@ class VRML2Export:
|
||||
for thisObj in allObj:
|
||||
self.writeObject(thisObj)
|
||||
|
||||
if ARG != 'selected':
|
||||
if not export_selection_only.val:
|
||||
self.writeScript()
|
||||
self.cleanup()
|
||||
|
||||
@@ -1213,26 +1217,54 @@ def select_file(filename):
|
||||
wrlexport=VRML2Export(filename)
|
||||
wrlexport.export(scene, world, worldmat)
|
||||
|
||||
#########################################################
|
||||
# UI and Registry utilities
|
||||
#########################################################
|
||||
|
||||
export_selection_only = Draw.Create(0)
|
||||
export_rotate_z_to_y = Draw.Create(1)
|
||||
export_compressed = Draw.Create(0)
|
||||
|
||||
def save_to_registry():
|
||||
d = {}
|
||||
d['selection_only'] = export_selection_only.val
|
||||
d['rotate_z_to_y'] = export_rotate_z_to_y.val
|
||||
d['compressed'] = export_compressed.val
|
||||
Registry.SetKey('vrml97_export', d, True)
|
||||
|
||||
def load_from_registry():
|
||||
d = Registry.GetKey('vrml97_export', True)
|
||||
if d:
|
||||
try:
|
||||
export_selection_only.val = d['selection_only']
|
||||
export_rotate_z_to_y.val = d['rotate_z_to_y']
|
||||
export_compressed.val = d['compressed']
|
||||
except: save_to_registry() # If data is not valid, rewrite it.
|
||||
|
||||
def show_popup():
|
||||
pup_block = [
|
||||
('Selection Only', export_selection_only, 'Only export objects in visible selection. Else export whole scene.'),
|
||||
('Rotate +Z to +Y', export_rotate_z_to_y, 'Rotate such that +Z axis (Blender up) becomes +Y (VRML up).'),
|
||||
('Compress', export_compressed, 'Generate a .wrz file (normal VRML compressed by gzip).')
|
||||
]
|
||||
return Draw.PupBlock('Export VRML 97...', pup_block)
|
||||
|
||||
#########################################################
|
||||
# main routine
|
||||
#########################################################
|
||||
|
||||
try:
|
||||
ARG = __script__['arg'] # user selected argument
|
||||
except:
|
||||
print "older version"
|
||||
load_from_registry()
|
||||
|
||||
if Blender.Get('version') < 235:
|
||||
print "Warning: VRML97 export failed, wrong blender version!"
|
||||
print " You aren't running blender version 2.35 or greater"
|
||||
print " download a newer version from http://blender3d.org/"
|
||||
else:
|
||||
if ARG == 'comp':
|
||||
# Note that show_popup must be done before Blender.Window.FileSelector,
|
||||
# because export_compressed affects the suggested extension of resulting
|
||||
# file.
|
||||
|
||||
if show_popup():
|
||||
save_to_registry()
|
||||
if export_compressed.val:
|
||||
extension=".wrz"
|
||||
from gzip import *
|
||||
else:
|
||||
extension=".wrl"
|
||||
Blender.Window.FileSelector(select_file, "Export VRML97", \
|
||||
sys.makename(ext=extension))
|
||||
|
||||
|
||||
@@ -353,6 +353,7 @@ Section "Blender-VERSION (required)" SecCopyUI
|
||||
SetOutPath $INSTDIR
|
||||
; Write the installation path into the registry
|
||||
WriteRegStr HKLM SOFTWARE\BlenderFoundation "Install_Dir" "$INSTDIR"
|
||||
WriteRegStr HKLM SOFTWARE\BlenderFoundation "Home_Dir" "$BLENDERHOME"
|
||||
; Write the uninstall keys for Windows
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayName" "Blender (remove only)"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
||||
@@ -406,28 +407,32 @@ SectionEnd
|
||||
UninstallText "This will uninstall Blender VERSION. Hit next to continue."
|
||||
|
||||
Section "Uninstall"
|
||||
Delete $INSTDIR\uninstall.exe
|
||||
|
||||
ReadRegStr $BLENDERHOME HKLM "SOFTWARE\BlenderFoundation" "Home_Dir"
|
||||
|
||||
; remove registry keys
|
||||
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender"
|
||||
DeleteRegKey HKLM SOFTWARE\BlenderFoundation
|
||||
; remove files
|
||||
[DELROOTDIRCONTS]
|
||||
|
||||
Delete $INSTDIR\.blender\.bfont.ttf
|
||||
Delete $INSTDIR\.blender\.Blanguages
|
||||
Delete $BLENDERHOME\.blender\.bfont.ttf
|
||||
Delete $BLENDERHOME\.blender\.Blanguages
|
||||
; remove shortcuts, if any.
|
||||
Delete "$SMPROGRAMS\Blender Foundation\Blender\*.*"
|
||||
Delete "$DESKTOP\Blender.lnk"
|
||||
; remove directories used.
|
||||
RMDir /r $INSTDIR\.blender\locale
|
||||
RMDir /r $BLENDERHOME\.blender\locale
|
||||
MessageBox MB_YESNO "Erase .blender\scripts folder? (ALL contents will be erased!)" IDNO Next
|
||||
RMDir /r $INSTDIR\.blender\scripts
|
||||
RMDir /r $INSTDIR\.blender\scripts\bpymodules
|
||||
RMDir /r $INSTDIR\.blender\scripts\bpydata
|
||||
RMDir /r $INSTDIR\.blender\scripts\bpydata\config
|
||||
RMDir /r $BLENDERHOME\.blender\scripts
|
||||
RMDir /r $BLENDERHOME\.blender\scripts\bpymodules
|
||||
RMDir /r $BLENDERHOME\.blender\scripts\bpydata
|
||||
RMDir /r $BLENDERHOME\.blender\scripts\bpydata\config
|
||||
Next:
|
||||
RMDir /r $INSTDIR\plugins\include
|
||||
RMDir /r $INSTDIR\plugins
|
||||
RMDir $INSTDIR\.blender
|
||||
RMDir /r $BLENDERHOME\plugins\include
|
||||
RMDir /r $BLENDERHOME\plugins
|
||||
RMDir $BLENDERHOME\.blender
|
||||
RMDir "$SMPROGRAMS\Blender Foundation\Blender"
|
||||
RMDir "$SMPROGRAMS\Blender Foundation"
|
||||
RMDir "$INSTDIR"
|
||||
|
||||
@@ -157,6 +157,7 @@ COMLIB += $(NAN_BMFONT)/lib/$(DEBUG_DIR)libbmfont.a
|
||||
COMLIB += $(NAN_PNG)/lib/libpng.a
|
||||
COMLIB += $(OCGDIR)/blender/yafray/$(DEBUG_DIR)libyafrayexport.a
|
||||
COMLIB += $(OCGDIR)/blender/blenlib/$(DEBUG_DIR)libblenlib.a
|
||||
COMLIB += $(NAN_GLEW)/lib/libglew.a
|
||||
|
||||
ifeq ($(WITH_QUICKTIME), true)
|
||||
COMLIB += $(OCGDIR)/blender/blenderqt/$(DEBUG_DIR)libblenderqt.a
|
||||
|
||||
@@ -44,6 +44,7 @@ struct bActionChannel;
|
||||
struct bPose;
|
||||
struct bPoseChannel;
|
||||
struct Object;
|
||||
struct ID;
|
||||
|
||||
/* Kernel prototypes */
|
||||
#ifdef __cplusplus
|
||||
@@ -157,6 +158,10 @@ void rest_pose(struct bPose *pose);
|
||||
float get_action_frame(struct Object *ob, float cframe);
|
||||
/* map strip time to global time (frame nr) */
|
||||
float get_action_frame_inv(struct Object *ob, float cframe);
|
||||
/* builds a list of NlaIpoChannel with ipo values to write in datablock */
|
||||
void extract_ipochannels_from_action(ListBase *lb, struct ID *id, struct bAction *act, char *name, float ctime);
|
||||
/* write values returned by extract_ipochannels_from_action, returns the number of value written */
|
||||
int execute_ipochannels(ListBase *lb);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
||||
@@ -39,12 +39,12 @@
|
||||
|
||||
#include "DNA_listBase.h"
|
||||
#include "BLI_ghash.h"
|
||||
#include "BLI_mempool.h"
|
||||
#include "BLI_memarena.h"
|
||||
#include "DNA_image_types.h"
|
||||
#include "BLI_editVert.h"
|
||||
#include "BKE_DerivedMesh.h"
|
||||
#include "transform.h"
|
||||
#include "BKE_bmeshCustomData.h"
|
||||
|
||||
/*forward declerations*/
|
||||
struct BME_Vert;
|
||||
@@ -53,13 +53,6 @@ struct BME_Poly;
|
||||
struct BME_Loop;
|
||||
|
||||
|
||||
/*structure for fast memory allocation/frees*/
|
||||
typedef struct BME_mempool{
|
||||
struct ListBase chunks;
|
||||
int esize, csize, pchunk; /*size of elements and chunks in bytes and number of elements per chunk*/
|
||||
struct BME_freenode *free; /*free element list. Interleaved into chunk datas.*/
|
||||
}BME_mempool;
|
||||
|
||||
/*Notes on further structure Cleanup:
|
||||
-Remove the tflags, they belong in custom data layers
|
||||
-Remove the eflags completely, they are mostly not used
|
||||
@@ -78,10 +71,10 @@ typedef struct BME_Mesh
|
||||
{
|
||||
ListBase verts, edges, polys;
|
||||
/*memory pools used for storing mesh elements*/
|
||||
struct BME_mempool *vpool;
|
||||
struct BME_mempool *epool;
|
||||
struct BME_mempool *ppool;
|
||||
struct BME_mempool *lpool;
|
||||
struct BLI_mempool *vpool;
|
||||
struct BLI_mempool *epool;
|
||||
struct BLI_mempool *ppool;
|
||||
struct BLI_mempool *lpool;
|
||||
/*some scratch arrays used by eulers*/
|
||||
struct BME_Vert **vtar;
|
||||
struct BME_Edge **edar;
|
||||
@@ -90,7 +83,7 @@ typedef struct BME_Mesh
|
||||
int vtarlen, edarlen, lparlen, plarlen;
|
||||
int totvert, totedge, totpoly, totloop; /*record keeping*/
|
||||
int nextv, nexte, nextp, nextl; /*Next element ID for verts/edges/faces/loops. Never reused*/
|
||||
struct BME_CustomData vdata, edata, pdata, ldata; /*Custom Data Layer information*/
|
||||
struct CustomData vdata, edata, pdata, ldata; /*Custom Data Layer information*/
|
||||
} BME_Mesh;
|
||||
|
||||
typedef struct BME_Vert
|
||||
@@ -169,7 +162,7 @@ int BME_radial_find_face(struct BME_Edge *e,struct BME_Poly *f);
|
||||
struct BME_Loop *BME_loop_find_loop(struct BME_Poly *f, struct BME_Vert *v);
|
||||
|
||||
/*MESH CREATION/DESTRUCTION*/
|
||||
struct BME_Mesh *BME_make_mesh(int allocsize[4], struct BME_CustomDataInit init[4]);
|
||||
struct BME_Mesh *BME_make_mesh(int allocsize[4]);
|
||||
void BME_free_mesh(struct BME_Mesh *bm);
|
||||
/*FULL MESH VALIDATION*/
|
||||
int BME_validate_mesh(struct BME_Mesh *bm, int halt);
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#ifndef BKE_BMESHCUSTOMDATA_H
|
||||
#define BKE_BMESHCUSTOMDATA_H
|
||||
|
||||
struct BME_mempool;
|
||||
struct BLI_mempool;
|
||||
|
||||
/*Custom Data Types and defines
|
||||
Eventual plan is to move almost everything to custom data and let caller
|
||||
@@ -62,7 +62,7 @@ typedef struct BME_CustomDataLayer {
|
||||
|
||||
typedef struct BME_CustomData {
|
||||
struct BME_CustomDataLayer *layers; /*Custom Data Layers*/
|
||||
struct BME_mempool *pool; /*pool for alloc of blocks*/
|
||||
struct BLI_mempool *pool; /*pool for alloc of blocks*/
|
||||
int totlayer, totsize; /*total layers and total size in bytes of each block*/
|
||||
} BME_CustomData;
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ typedef enum
|
||||
////////////////////////////////////////////////
|
||||
|
||||
// needed for implicit.c
|
||||
int cloth_bvh_objcollision ( ClothModifierData * clmd, float step, float dt );
|
||||
int cloth_bvh_objcollision ( Object *ob, ClothModifierData * clmd, float step, float dt );
|
||||
|
||||
////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -40,6 +40,8 @@ extern const CustomDataMask CD_MASK_BAREMESH;
|
||||
extern const CustomDataMask CD_MASK_MESH;
|
||||
extern const CustomDataMask CD_MASK_EDITMESH;
|
||||
extern const CustomDataMask CD_MASK_DERIVEDMESH;
|
||||
extern const CustomDataMask CD_MASK_BMESH;
|
||||
extern const CustomDataMask CD_MASK_FACECORNERS;
|
||||
|
||||
/* for ORIGINDEX layer type, indicates no original index for this element */
|
||||
#define ORIGINDEX_NONE -1
|
||||
@@ -134,6 +136,9 @@ void CustomData_copy_data(const struct CustomData *source,
|
||||
void CustomData_em_copy_data(const struct CustomData *source,
|
||||
struct CustomData *dest, void *src_block,
|
||||
void **dest_block);
|
||||
void CustomData_bmesh_copy_data(const struct CustomData *source,
|
||||
struct CustomData *dest,void *src_block,
|
||||
void **dest_block);
|
||||
|
||||
/* frees data in a CustomData object
|
||||
* return 1 on success, 0 on failure
|
||||
@@ -160,6 +165,10 @@ void CustomData_interp(const struct CustomData *source, struct CustomData *dest,
|
||||
void CustomData_em_interp(struct CustomData *data, void **src_blocks,
|
||||
float *weights, float *sub_weights, int count,
|
||||
void *dest_block);
|
||||
void CustomData_bmesh_interp(struct CustomData *data, void **src_blocks,
|
||||
float *weights, float *sub_weights, int count,
|
||||
void *dest_block);
|
||||
|
||||
|
||||
/* swaps the data in the element corners, to new corners with indices as
|
||||
specified in corner_indices. for edges this is an array of length 2, for
|
||||
@@ -172,6 +181,8 @@ void CustomData_swap(struct CustomData *data, int index, int *corner_indices);
|
||||
void *CustomData_get(const struct CustomData *data, int index, int type);
|
||||
void *CustomData_em_get(const struct CustomData *data, void *block, int type);
|
||||
void *CustomData_em_get_n(const struct CustomData *data, void *block, int type, int n);
|
||||
void *CustomData_bmesh_get(const struct CustomData *data, void *block, int type);
|
||||
void *CustomData_bmesh_get_n(const struct CustomData *data, void *block, int type, int n);
|
||||
|
||||
/* gets a pointer to the active or first layer of type
|
||||
* returns NULL if there is no layer of type
|
||||
@@ -199,6 +210,12 @@ void CustomData_em_set(struct CustomData *data, void *block, int type,
|
||||
void CustomData_em_set_n(struct CustomData *data, void *block, int type, int n,
|
||||
void *source);
|
||||
|
||||
void CustomData_bmesh_set(const struct CustomData *data, void *block, int type,
|
||||
void *source);
|
||||
|
||||
void CustomData_bmesh_set_n(struct CustomData *data, void *block, int type, int n,
|
||||
void *source);
|
||||
|
||||
/* set the pointer of to the first layer of type. the old data is not freed.
|
||||
* returns the value of ptr if the layer is found, NULL otherwise
|
||||
*/
|
||||
@@ -220,12 +237,20 @@ void CustomData_set_layer_flag(struct CustomData *data, int type, int flag);
|
||||
void CustomData_em_set_default(struct CustomData *data, void **block);
|
||||
void CustomData_em_free_block(struct CustomData *data, void **block);
|
||||
|
||||
void CustomData_bmesh_set_default(struct CustomData *data, void **block);
|
||||
void CustomData_bmesh_free_block(struct CustomData *data, void **block);
|
||||
|
||||
/* copy custom data to/from layers as in mesh/derivedmesh, to editmesh
|
||||
blocks of data. the CustomData's must not be compatible */
|
||||
void CustomData_to_em_block(const struct CustomData *source,
|
||||
struct CustomData *dest, int index, void **block);
|
||||
void CustomData_from_em_block(const struct CustomData *source,
|
||||
struct CustomData *dest, void *block, int index);
|
||||
void CustomData_to_bmesh_block(const struct CustomData *source,
|
||||
struct CustomData *dest, int src_index, void **dest_block);
|
||||
void CustomData_from_bmesh_block(const struct CustomData *source,
|
||||
struct CustomData *dest, void *src_block, int dest_index);
|
||||
|
||||
|
||||
/* query info over types */
|
||||
void CustomData_file_write_info(int type, char **structname, int *structnum);
|
||||
@@ -241,4 +266,8 @@ void CustomData_set_layer_unique_name(struct CustomData *data, int index);
|
||||
only after this test passes, layer->data should be assigned */
|
||||
int CustomData_verify_versions(struct CustomData *data, int index);
|
||||
|
||||
/*BMesh specific customdata stuff*/
|
||||
void CustomData_to_bmeshpoly(struct CustomData *fdata, struct CustomData *pdata, struct CustomData *ldata);
|
||||
void CustomData_from_bmeshpoly(struct CustomData *fdata, struct CustomData *pdata, struct CustomData *ldata, int total);
|
||||
void CustomData_bmesh_init_pool(struct CustomData *data, int allocsize);
|
||||
#endif
|
||||
|
||||
@@ -31,6 +31,10 @@
|
||||
#ifndef BKE_IPO_H
|
||||
#define BKE_IPO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct CfraElem {
|
||||
struct CfraElem *next, *prev;
|
||||
float cfra;
|
||||
@@ -111,5 +115,9 @@ float IPO_GetFloatValue(struct Ipo *ipo,
|
||||
short c,
|
||||
float ctime);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -40,6 +40,11 @@ struct Object;
|
||||
struct Lattice;
|
||||
struct Mesh;
|
||||
|
||||
/* Kernel prototypes */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void free_key(struct Key *sc);
|
||||
struct Key *add_key(struct ID *id);
|
||||
struct Key *copy_key(struct Key *key);
|
||||
@@ -57,6 +62,12 @@ int do_ob_key(struct Object *ob);
|
||||
struct Key *ob_get_key(struct Object *ob);
|
||||
struct KeyBlock *ob_get_keyblock(struct Object *ob);
|
||||
struct KeyBlock *key_get_keyblock(struct Key *key, int index);
|
||||
// needed for the GE
|
||||
void do_rel_key(int start, int end, int tot, char *basispoin, struct Key *key, int mode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -108,6 +108,7 @@ void object_boundbox_flag(struct Object *ob, int flag, int set);
|
||||
void minmax_object(struct Object *ob, float *min, float *max);
|
||||
void minmax_object_duplis(struct Object *ob, float *min, float *max);
|
||||
void solve_tracking (struct Object *ob, float targetmat[][4]);
|
||||
int ray_hit_boundbox(struct BoundBox *bb, float ray_start[3], float ray_normal[3]);
|
||||
|
||||
void object_handle_update(struct Object *ob);
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ struct RenderData;
|
||||
}
|
||||
|
||||
/* note; doesn't work when scene is empty */
|
||||
#define SETLOOPER(s, b) sce= s, b= sce->base.first; b; b= (b->next?b->next:sce->set?(sce=sce->set)->base.first:NULL)
|
||||
#define SETLOOPER(s, b) sce= s, b= (Base*)sce->base.first; b; b= (Base*)(b->next?b->next:sce->set?(sce=sce->set)->base.first:NULL)
|
||||
|
||||
|
||||
void free_avicodecdata(struct AviCodecData *acd);
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "bmesh_private.h"
|
||||
#include <string.h>
|
||||
#include "MEM_guardedalloc.h"
|
||||
#include "BLI_mempool.h"
|
||||
|
||||
/********************* Layer type information **********************/
|
||||
typedef struct BME_LayerTypeInfo {
|
||||
@@ -83,7 +84,7 @@ void BME_CD_Create(BME_CustomData *data, BME_CustomDataInit *init, int initalloc
|
||||
if(data->totlayer){
|
||||
/*alloc memory*/
|
||||
data->layers = MEM_callocN(sizeof(BME_CustomDataLayer)*data->totlayer, "BMesh Custom Data Layers");
|
||||
data->pool = BME_mempool_create(data->totsize, initalloc, initalloc);
|
||||
data->pool = BLI_mempool_create(data->totsize, initalloc, initalloc);
|
||||
/*initialize layer data*/
|
||||
for(i=0; i < BME_CD_NUMTYPES; i++){
|
||||
if(init->layout[i]){
|
||||
@@ -102,7 +103,7 @@ void BME_CD_Create(BME_CustomData *data, BME_CustomDataInit *init, int initalloc
|
||||
|
||||
void BME_CD_Free(BME_CustomData *data)
|
||||
{
|
||||
if(data->pool) BME_mempool_destroy(data->pool);
|
||||
if(data->pool) BLI_mempool_destroy(data->pool);
|
||||
}
|
||||
|
||||
/*Block level ops*/
|
||||
@@ -119,7 +120,7 @@ void BME_CD_free_block(BME_CustomData *data, void **block)
|
||||
typeInfo->free((char*)*block + offset, 1, typeInfo->size);
|
||||
}
|
||||
}
|
||||
BME_mempool_free(data->pool, *block);
|
||||
BLI_mempool_free(data->pool, *block);
|
||||
*block = NULL;
|
||||
}
|
||||
|
||||
@@ -130,7 +131,7 @@ static void BME_CD_alloc_block(BME_CustomData *data, void **block)
|
||||
if (*block) BME_CD_free_block(data, block); //if we copy layers that have their own free functions like deformverts
|
||||
|
||||
if (data->totsize > 0)
|
||||
*block = BME_mempool_alloc(data->pool);
|
||||
*block = BLI_mempool_alloc(data->pool);
|
||||
else
|
||||
*block = NULL;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
*/
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
#include "BKE_customdata.h"
|
||||
|
||||
#include "DNA_listBase.h"
|
||||
#include "DNA_meshdata_types.h"
|
||||
@@ -55,10 +56,199 @@
|
||||
|
||||
#include "BSE_edit.h"
|
||||
|
||||
/*merge these functions*/
|
||||
static void BME_DMcorners_to_loops(BME_Mesh *bm, CustomData *facedata, int index, BME_Poly *f, int numCol, int numTex){
|
||||
int i, j;
|
||||
BME_Loop *l;
|
||||
MTFace *texface;
|
||||
MTexPoly *texpoly;
|
||||
MCol *mcol;
|
||||
MLoopCol *mloopcol;
|
||||
MLoopUV *mloopuv;
|
||||
|
||||
for(i=0; i< numTex; i++){
|
||||
texface = CustomData_get_layer_n(facedata, CD_MTFACE, i);
|
||||
texpoly = CustomData_bmesh_get_n(&bm->pdata, f->data, CD_MTEXPOLY, i);
|
||||
|
||||
texpoly->tpage = texface[index].tpage;
|
||||
texpoly->flag = texface[index].flag;
|
||||
texpoly->transp = texface[index].transp;
|
||||
texpoly->mode = texface[index].mode;
|
||||
texpoly->tile = texface[index].tile;
|
||||
texpoly->unwrap = texface[index].unwrap;
|
||||
|
||||
j = 0;
|
||||
l = f->loopbase;
|
||||
do{
|
||||
mloopuv = CustomData_bmesh_get_n(&bm->ldata, l->data, CD_MLOOPUV, i);
|
||||
mloopuv->uv[0] = texface[index].uv[j][0];
|
||||
mloopuv->uv[1] = texface[index].uv[j][1];
|
||||
j++;
|
||||
l = l->next;
|
||||
}while(l!=f->loopbase);
|
||||
}
|
||||
|
||||
for(i=0; i < numCol; i++){
|
||||
mcol = CustomData_get_layer_n(facedata, CD_MCOL, i);
|
||||
j = 0;
|
||||
l = f->loopbase;
|
||||
do{
|
||||
mloopcol = CustomData_bmesh_get_n(&bm->ldata, l->data, CD_MLOOPCOL, i);
|
||||
mloopcol->r = mcol[(index*4)+j].r;
|
||||
mloopcol->g = mcol[(index*4)+j].g;
|
||||
mloopcol->b = mcol[(index*4)+j].b;
|
||||
mloopcol->a = mcol[(index*4)+j].a;
|
||||
j++;
|
||||
l = l->next;
|
||||
}while(l!=f->loopbase);
|
||||
}
|
||||
}
|
||||
|
||||
static void BME_DMloops_to_corners(BME_Mesh *bm, CustomData *facedata, int index, BME_Poly *f,int numCol, int numTex){
|
||||
int i, j;
|
||||
BME_Loop *l;
|
||||
MTFace *texface;
|
||||
MTexPoly *texpoly;
|
||||
MCol *mcol;
|
||||
MLoopCol *mloopcol;
|
||||
MLoopUV *mloopuv;
|
||||
|
||||
for(i=0; i < numTex; i++){
|
||||
texface = CustomData_get_layer_n(facedata, CD_MTFACE, i);
|
||||
texpoly = CustomData_bmesh_get_n(&bm->pdata, f->data, CD_MTEXPOLY, i);
|
||||
|
||||
texface[index].tpage = texpoly->tpage;
|
||||
texface[index].flag = texpoly->flag;
|
||||
texface[index].transp = texpoly->transp;
|
||||
texface[index].mode = texpoly->mode;
|
||||
texface[index].tile = texpoly->tile;
|
||||
texface[index].unwrap = texpoly->unwrap;
|
||||
|
||||
j = 0;
|
||||
l = f->loopbase;
|
||||
do{
|
||||
mloopuv = CustomData_bmesh_get_n(&bm->ldata, l->data, CD_MLOOPUV, i);
|
||||
texface[index].uv[j][0] = mloopuv->uv[0];
|
||||
texface[index].uv[j][1] = mloopuv->uv[1];
|
||||
j++;
|
||||
l = l->next;
|
||||
}while(l!=f->loopbase);
|
||||
|
||||
}
|
||||
for(i=0; i < numCol; i++){
|
||||
mcol = CustomData_get_layer_n(facedata,CD_MCOL, i);
|
||||
j = 0;
|
||||
l = f->loopbase;
|
||||
do{
|
||||
mloopcol = CustomData_bmesh_get_n(&bm->ldata, l->data, CD_MLOOPCOL, i);
|
||||
mcol[(index*4) + j].r = mloopcol->r;
|
||||
mcol[(index*4) + j].g = mloopcol->g;
|
||||
mcol[(index*4) + j].b = mloopcol->b;
|
||||
mcol[(index*4) + j].a = mloopcol->a;
|
||||
j++;
|
||||
l = l->next;
|
||||
}while(l!=f->loopbase);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void BME_corners_to_loops(BME_Mesh *bm, CustomData *facedata, void *face_block, BME_Poly *f,int numCol, int numTex){
|
||||
int i, j;
|
||||
BME_Loop *l;
|
||||
MTFace *texface;
|
||||
MTexPoly *texpoly;
|
||||
MCol *mcol;
|
||||
MLoopCol *mloopcol;
|
||||
MLoopUV *mloopuv;
|
||||
|
||||
for(i=0; i < numTex; i++){
|
||||
texface = CustomData_em_get_n(facedata, face_block, CD_MTFACE, i);
|
||||
texpoly = CustomData_bmesh_get_n(&bm->pdata, f->data, CD_MTEXPOLY, i);
|
||||
|
||||
texpoly->tpage = texface->tpage;
|
||||
texpoly->flag = texface->flag;
|
||||
texpoly->transp = texface->transp;
|
||||
texpoly->mode = texface->mode;
|
||||
texpoly->tile = texface->tile;
|
||||
texpoly->unwrap = texface->unwrap;
|
||||
|
||||
j = 0;
|
||||
l = f->loopbase;
|
||||
do{
|
||||
mloopuv = CustomData_bmesh_get_n(&bm->ldata, l->data, CD_MLOOPUV, i);
|
||||
mloopuv->uv[0] = texface->uv[j][0];
|
||||
mloopuv->uv[1] = texface->uv[j][1];
|
||||
j++;
|
||||
l = l->next;
|
||||
}while(l!=f->loopbase);
|
||||
|
||||
}
|
||||
for(i=0; i < numCol; i++){
|
||||
mcol = CustomData_em_get_n(facedata, face_block, CD_MCOL, i);
|
||||
j = 0;
|
||||
l = f->loopbase;
|
||||
do{
|
||||
mloopcol = CustomData_bmesh_get_n(&bm->ldata, l->data, CD_MLOOPCOL, i);
|
||||
mloopcol->r = mcol[j].r;
|
||||
mloopcol->g = mcol[j].g;
|
||||
mloopcol->b = mcol[j].b;
|
||||
mloopcol->a = mcol[j].a;
|
||||
j++;
|
||||
l = l->next;
|
||||
}while(l!=f->loopbase);
|
||||
}
|
||||
}
|
||||
|
||||
static void BME_loops_to_corners(BME_Mesh *bm, CustomData *facedata, void *face_block, BME_Poly *f,int numCol, int numTex){
|
||||
int i, j;
|
||||
BME_Loop *l;
|
||||
MTFace *texface;
|
||||
MTexPoly *texpoly;
|
||||
MCol *mcol;
|
||||
MLoopCol *mloopcol;
|
||||
MLoopUV *mloopuv;
|
||||
|
||||
for(i=0; i < numTex; i++){
|
||||
texface = CustomData_em_get_n(facedata, face_block, CD_MTFACE, i);
|
||||
texpoly = CustomData_bmesh_get_n(&bm->pdata, f->data, CD_MTEXPOLY, i);
|
||||
|
||||
texface->tpage = texpoly->tpage;
|
||||
texface->flag = texpoly->flag;
|
||||
texface->transp = texpoly->transp;
|
||||
texface->mode = texpoly->mode;
|
||||
texface->tile = texpoly->tile;
|
||||
texface->unwrap = texpoly->unwrap;
|
||||
|
||||
j = 0;
|
||||
l = f->loopbase;
|
||||
do{
|
||||
mloopuv = CustomData_bmesh_get_n(&bm->ldata, l->data, CD_MLOOPUV, i);
|
||||
texface->uv[j][0] = mloopuv->uv[0];
|
||||
texface->uv[j][1] = mloopuv->uv[1];
|
||||
j++;
|
||||
l = l->next;
|
||||
}while(l!=f->loopbase);
|
||||
|
||||
}
|
||||
for(i=0; i < numCol; i++){
|
||||
mcol = CustomData_em_get_n(facedata, face_block, CD_MCOL, i);
|
||||
j = 0;
|
||||
l = f->loopbase;
|
||||
do{
|
||||
mloopcol = CustomData_bmesh_get_n(&bm->ldata, l->data, CD_MLOOPCOL, i);
|
||||
mcol[j].r = mloopcol->r;
|
||||
mcol[j].g = mloopcol->g;
|
||||
mcol[j].b = mloopcol->b;
|
||||
mcol[j].a = mloopcol->a;
|
||||
j++;
|
||||
l = l->next;
|
||||
}while(l!=f->loopbase);
|
||||
}
|
||||
}
|
||||
/*move the EditMesh conversion functions to editmesh_tools.c*/
|
||||
BME_Mesh *BME_editmesh_to_bmesh(EditMesh *em) {
|
||||
BME_Mesh *bm;
|
||||
int allocsize[4] = {512,512,2048,512};
|
||||
BME_CustomDataInit *init = MEM_callocN(sizeof(BME_CustomDataInit) * 4, "Bmesh custom data init");
|
||||
int allocsize[4] = {512,512,2048,512}, numTex, numCol;
|
||||
BME_Vert *v1, *v2;
|
||||
BME_Edge *e, *edar[4];
|
||||
BME_Poly *f;
|
||||
@@ -68,9 +258,25 @@ BME_Mesh *BME_editmesh_to_bmesh(EditMesh *em) {
|
||||
EditFace *efa;
|
||||
|
||||
int len;
|
||||
bm = BME_make_mesh(allocsize,init);
|
||||
bm = BME_make_mesh(allocsize);
|
||||
|
||||
/*copy custom data layout*/
|
||||
CustomData_copy(&em->vdata, &bm->vdata, CD_MASK_BMESH, CD_CALLOC, 0);
|
||||
CustomData_copy(&em->edata, &bm->edata, CD_MASK_BMESH, CD_CALLOC, 0);
|
||||
CustomData_copy(&em->fdata, &bm->pdata, CD_MASK_BMESH, CD_CALLOC, 0);
|
||||
|
||||
/*copy face corner data*/
|
||||
CustomData_to_bmeshpoly(&em->fdata, &bm->pdata, &bm->ldata);
|
||||
/*initialize memory pools*/
|
||||
CustomData_bmesh_init_pool(&bm->vdata, allocsize[0]);
|
||||
CustomData_bmesh_init_pool(&bm->edata, allocsize[1]);
|
||||
CustomData_bmesh_init_pool(&bm->ldata, allocsize[2]);
|
||||
CustomData_bmesh_init_pool(&bm->pdata, allocsize[3]);
|
||||
/*needed later*/
|
||||
numTex = CustomData_number_of_layers(&bm->pdata, CD_MTEXPOLY);
|
||||
numCol = CustomData_number_of_layers(&bm->ldata, CD_MLOOPCOL);
|
||||
|
||||
BME_model_begin(bm);
|
||||
|
||||
/*add verts*/
|
||||
eve= em->verts.first;
|
||||
while(eve) {
|
||||
@@ -79,9 +285,8 @@ BME_Mesh *BME_editmesh_to_bmesh(EditMesh *em) {
|
||||
v1->flag = eve->f;
|
||||
v1->h = eve->h;
|
||||
v1->bweight = eve->bweight;
|
||||
|
||||
/* link the verts for edge and face construction;
|
||||
* kind of a dangerous thing - remember to cast back to BME_Vert before using! */
|
||||
/*Copy Custom Data*/
|
||||
CustomData_bmesh_copy_data(&em->vdata, &bm->vdata, eve->data, &v1->data);
|
||||
eve->tmp.v = (EditVert*)v1;
|
||||
eve = eve->next;
|
||||
}
|
||||
@@ -99,13 +304,10 @@ BME_Mesh *BME_editmesh_to_bmesh(EditMesh *em) {
|
||||
if(eed->seam) e->flag |= ME_SEAM;
|
||||
if(eed->h & EM_FGON) e->flag |= ME_FGON;
|
||||
if(eed->h & 1) e->flag |= ME_HIDE;
|
||||
|
||||
/* link the edges for face construction;
|
||||
* kind of a dangerous thing - remember to cast back to BME_Edge before using! */
|
||||
eed->tmp.e = (EditEdge*)e;
|
||||
CustomData_bmesh_copy_data(&em->edata, &bm->edata, eed->data, &e->data);
|
||||
eed = eed->next;
|
||||
}
|
||||
|
||||
/*add faces.*/
|
||||
efa= em->faces.first;
|
||||
while(efa) {
|
||||
@@ -134,13 +336,13 @@ BME_Mesh *BME_editmesh_to_bmesh(EditMesh *em) {
|
||||
if(efa->f & 1) f->flag |= ME_FACE_SEL;
|
||||
else f->flag &= ~ME_FACE_SEL;
|
||||
}
|
||||
CustomData_bmesh_copy_data(&em->fdata, &bm->pdata, efa->data, &f->data);
|
||||
BME_corners_to_loops(bm, &em->fdata, efa->data, f,numCol,numTex);
|
||||
efa = efa->next;
|
||||
}
|
||||
BME_model_end(bm);
|
||||
MEM_freeN(init);
|
||||
return bm;
|
||||
}
|
||||
|
||||
/* adds the geometry in the bmesh to G.editMesh (does not free G.editMesh)
|
||||
* if td != NULL, the transdata will be mapped to the EditVert's co */
|
||||
EditMesh *BME_bmesh_to_editmesh(BME_Mesh *bm, BME_TransData_Head *td) {
|
||||
@@ -155,12 +357,21 @@ EditMesh *BME_bmesh_to_editmesh(BME_Mesh *bm, BME_TransData_Head *td) {
|
||||
EditEdge *eed;
|
||||
EditFace *efa;
|
||||
|
||||
int totvert, len, i;
|
||||
int totvert, len, i, numTex, numCol;
|
||||
|
||||
em = G.editMesh;
|
||||
|
||||
if (em == NULL) return NULL;
|
||||
|
||||
|
||||
CustomData_copy(&bm->vdata, &em->vdata, CD_MASK_BMESH, CD_CALLOC, 0);
|
||||
CustomData_copy(&bm->edata, &em->edata, CD_MASK_BMESH, CD_CALLOC, 0);
|
||||
CustomData_copy(&bm->pdata, &em->fdata, CD_MASK_BMESH, CD_CALLOC, 0);
|
||||
CustomData_from_bmeshpoly(&em->fdata, &bm->pdata, &bm->ldata,0);
|
||||
numTex = CustomData_number_of_layers(&bm->pdata, CD_MTEXPOLY);
|
||||
numCol = CustomData_number_of_layers(&bm->ldata, CD_MLOOPCOL);
|
||||
|
||||
|
||||
/* convert to EditMesh */
|
||||
/* make editverts */
|
||||
totvert = BLI_countlist(&(bm->verts));
|
||||
@@ -176,6 +387,7 @@ EditMesh *BME_bmesh_to_editmesh(BME_Mesh *bm, BME_TransData_Head *td) {
|
||||
eve1->f = (unsigned char)v1->flag;
|
||||
eve1->h = (unsigned char)v1->h;
|
||||
eve1->bweight = v1->bweight;
|
||||
CustomData_em_copy_data(&bm->vdata, &em->vdata, v1->data, &eve1->data);
|
||||
}
|
||||
|
||||
/* make edges */
|
||||
@@ -191,6 +403,8 @@ EditMesh *BME_bmesh_to_editmesh(BME_Mesh *bm, BME_TransData_Head *td) {
|
||||
if(e->flag & ME_HIDE) eed->h |= 1;
|
||||
if(G.scene->selectmode==SCE_SELECT_EDGE)
|
||||
EM_select_edge(eed, eed->f & SELECT);
|
||||
|
||||
CustomData_em_copy_data(&bm->edata, &em->edata, e->data, &eed->data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,6 +431,8 @@ EditMesh *BME_bmesh_to_editmesh(BME_Mesh *bm, BME_TransData_Head *td) {
|
||||
if(f->flag & ME_HIDE) efa->h= 1;
|
||||
if((G.f & G_FACESELECT) && (efa->f & SELECT))
|
||||
EM_select_face(efa, 1); /* flush down */
|
||||
CustomData_em_copy_data(&bm->pdata, &em->fdata, f->data, &efa->data);
|
||||
BME_loops_to_corners(bm, &em->fdata, efa->data, f,numCol,numTex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,18 +450,33 @@ BME_Mesh *BME_derivedmesh_to_bmesh(DerivedMesh *dm)
|
||||
|
||||
BME_Mesh *bm;
|
||||
int allocsize[4] = {512,512,2048,512};
|
||||
BME_CustomDataInit *init = MEM_callocN(sizeof(BME_CustomDataInit) * 4, "Bmesh custom data init");
|
||||
MVert *mvert, *mv;
|
||||
MEdge *medge, *me;
|
||||
MFace *mface, *mf;
|
||||
int totface,totedge,totvert,i,len;
|
||||
int totface,totedge,totvert,i,len, numTex, numCol;
|
||||
BME_Vert *v1=NULL,*v2=NULL, **vert_array;
|
||||
BME_Edge *e=NULL;
|
||||
BME_Poly *f=NULL;
|
||||
|
||||
EdgeHash *edge_hash = BLI_edgehash_new();
|
||||
|
||||
bm = BME_make_mesh(allocsize,init);
|
||||
bm = BME_make_mesh(allocsize);
|
||||
/*copy custom data layout*/
|
||||
CustomData_copy(&dm->vertData, &bm->vdata, CD_MASK_BMESH, CD_CALLOC, 0);
|
||||
CustomData_copy(&dm->edgeData, &bm->edata, CD_MASK_BMESH, CD_CALLOC, 0);
|
||||
CustomData_copy(&dm->faceData, &bm->pdata, CD_MASK_BMESH, CD_CALLOC, 0);
|
||||
|
||||
/*copy face corner data*/
|
||||
CustomData_to_bmeshpoly(&dm->faceData, &bm->pdata, &bm->ldata);
|
||||
/*initialize memory pools*/
|
||||
CustomData_bmesh_init_pool(&bm->vdata, allocsize[0]);
|
||||
CustomData_bmesh_init_pool(&bm->edata, allocsize[1]);
|
||||
CustomData_bmesh_init_pool(&bm->ldata, allocsize[2]);
|
||||
CustomData_bmesh_init_pool(&bm->pdata, allocsize[3]);
|
||||
/*needed later*/
|
||||
numTex = CustomData_number_of_layers(&bm->pdata, CD_MTEXPOLY);
|
||||
numCol = CustomData_number_of_layers(&bm->ldata, CD_MLOOPCOL);
|
||||
|
||||
totvert = dm->getNumVerts(dm);
|
||||
totedge = dm->getNumEdges(dm);
|
||||
totface = dm->getNumFaces(dm);
|
||||
@@ -262,6 +493,7 @@ BME_Mesh *BME_derivedmesh_to_bmesh(DerivedMesh *dm)
|
||||
vert_array[i] = v1;
|
||||
v1->flag = mv->flag;
|
||||
v1->bweight = mv->bweight/255.0f;
|
||||
CustomData_to_bmesh_block(&dm->vertData, &bm->vdata, i, &v1->data);
|
||||
}
|
||||
/*add edges*/
|
||||
for(i=0,me = medge; i < totedge;i++,me++){
|
||||
@@ -272,6 +504,7 @@ BME_Mesh *BME_derivedmesh_to_bmesh(DerivedMesh *dm)
|
||||
e->bweight = me->bweight/255.0f;
|
||||
e->flag = (unsigned char)me->flag;
|
||||
BLI_edgehash_insert(edge_hash,me->v1,me->v2,e);
|
||||
CustomData_to_bmesh_block(&dm->edgeData, &bm->edata, i, &e->data);
|
||||
}
|
||||
/*add faces.*/
|
||||
for(i=0,mf = mface; i < totface;i++,mf++){
|
||||
@@ -295,12 +528,13 @@ BME_Mesh *BME_derivedmesh_to_bmesh(DerivedMesh *dm)
|
||||
f = BME_MF(bm,v1,v2,edar,len);
|
||||
f->mat_nr = mf->mat_nr;
|
||||
f->flag = mf->flag;
|
||||
CustomData_to_bmesh_block(&dm->faceData,&bm->pdata,i,&f->data);
|
||||
BME_DMcorners_to_loops(bm, &dm->faceData,i,f, numCol,numTex);
|
||||
}
|
||||
|
||||
BME_model_end(bm);
|
||||
BLI_edgehash_free(edge_hash, NULL);
|
||||
MEM_freeN(vert_array);
|
||||
MEM_freeN(init);
|
||||
return bm;
|
||||
}
|
||||
|
||||
@@ -309,7 +543,7 @@ DerivedMesh *BME_bmesh_to_derivedmesh(BME_Mesh *bm, DerivedMesh *dm)
|
||||
MFace *mface, *mf;
|
||||
MEdge *medge, *me;
|
||||
MVert *mvert, *mv;
|
||||
int totface,totedge,totvert,i,bmeshok,len;
|
||||
int totface,totedge,totvert,i,bmeshok,len, numTex, numCol;
|
||||
|
||||
BME_Vert *v1=NULL;
|
||||
BME_Edge *e=NULL, *oe=NULL;
|
||||
@@ -345,12 +579,21 @@ DerivedMesh *BME_bmesh_to_derivedmesh(BME_Mesh *bm, DerivedMesh *dm)
|
||||
|
||||
/*convert back to mesh*/
|
||||
result = CDDM_from_template(dm,totvert,totedge,totface);
|
||||
CustomData_merge(&bm->vdata, &result->vertData, CD_MASK_BMESH, CD_CALLOC, totvert);
|
||||
CustomData_merge(&bm->edata, &result->edgeData, CD_MASK_BMESH, CD_CALLOC, totedge);
|
||||
CustomData_merge(&bm->pdata, &result->faceData, CD_MASK_BMESH, CD_CALLOC, totface);
|
||||
CustomData_from_bmeshpoly(&result->faceData, &bm->pdata, &bm->ldata,totface);
|
||||
numTex = CustomData_number_of_layers(&bm->pdata, CD_MTEXPOLY);
|
||||
numCol = CustomData_number_of_layers(&bm->ldata, CD_MLOOPCOL);
|
||||
|
||||
|
||||
/*Make Verts*/
|
||||
mvert = CDDM_get_verts(result);
|
||||
for(i=0,v1=bm->verts.first,mv=mvert;v1;v1=v1->next,i++,mv++){
|
||||
VECCOPY(mv->co,v1->co);
|
||||
mv->flag = (unsigned char)v1->flag;
|
||||
mv->bweight = (char)(255.0*v1->bweight);
|
||||
CustomData_from_bmesh_block(&bm->vdata, &result->vertData, &v1->data, i);
|
||||
}
|
||||
medge = CDDM_get_edges(result);
|
||||
i=0;
|
||||
@@ -368,6 +611,7 @@ DerivedMesh *BME_bmesh_to_derivedmesh(BME_Mesh *bm, DerivedMesh *dm)
|
||||
me->crease = (char)(255.0*e->crease);
|
||||
me->bweight = (char)(255.0*e->bweight);
|
||||
me->flag = e->flag;
|
||||
CustomData_from_bmesh_block(&bm->edata, &result->edgeData, &e->data, i);
|
||||
me++;
|
||||
i++;
|
||||
}
|
||||
@@ -389,9 +633,11 @@ DerivedMesh *BME_bmesh_to_derivedmesh(BME_Mesh *bm, DerivedMesh *dm)
|
||||
if(mf->v3 == 0 || (len == 4 && mf->v4 == 0)){
|
||||
test_index_face(mf, NULL, i, len);
|
||||
}
|
||||
i++;
|
||||
mf->mat_nr = (unsigned char)f->mat_nr;
|
||||
mf->flag = (unsigned char)f->flag;
|
||||
CustomData_from_bmesh_block(&bm->pdata, &result->faceData, &f->data, i);
|
||||
BME_DMloops_to_corners(bm, &result->faceData, i, f,numCol,numTex);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "DNA_mesh_types.h"
|
||||
|
||||
#include "BKE_utildefines.h"
|
||||
#include "BKE_customdata.h"
|
||||
#include "BKE_bmesh.h"
|
||||
|
||||
#include "BLI_blenlib.h"
|
||||
@@ -618,8 +619,8 @@ BME_Poly *BME_SFME(BME_Mesh *bm, BME_Poly *f, BME_Vert *v1, BME_Vert *v2, BME_Lo
|
||||
BME_disk_append_edge(e, v2);
|
||||
|
||||
f2 = BME_addpolylist(bm,f);
|
||||
f1loop = BME_create_loop(bm,v2,e,f,NULL);
|
||||
f2loop = BME_create_loop(bm,v1,e,f2,NULL);
|
||||
f1loop = BME_create_loop(bm,v2,e,f,v2loop);
|
||||
f2loop = BME_create_loop(bm,v1,e,f2,v1loop);
|
||||
|
||||
f1loop->prev = v2loop->prev;
|
||||
f2loop->prev = v1loop->prev;
|
||||
@@ -663,16 +664,16 @@ BME_Poly *BME_SFME(BME_Mesh *bm, BME_Poly *f, BME_Vert *v1, BME_Vert *v2, BME_Lo
|
||||
* Takes a an edge and pointer to one of its vertices and collapses
|
||||
* the edge on that vertex.
|
||||
*
|
||||
* Before: OE KE
|
||||
* Before: OE KE
|
||||
* ------- -------
|
||||
* | || |
|
||||
* OV KV TV
|
||||
* OV KV TV
|
||||
*
|
||||
*
|
||||
* After: OE
|
||||
* ---------------
|
||||
* | |
|
||||
* OV TV
|
||||
* OV TV
|
||||
*
|
||||
*
|
||||
* Restrictions:
|
||||
@@ -723,6 +724,8 @@ int BME_JEKV(BME_Mesh *bm, BME_Edge *ke, BME_Vert *kv)
|
||||
/*remove ke from tv's disk cycle*/
|
||||
BME_disk_remove_edge(ke, tv);
|
||||
|
||||
|
||||
|
||||
/*deal with radial cycle of ke*/
|
||||
if(ke->loop){
|
||||
/*first step, fix the neighboring loops of all loops in ke's radial cycle*/
|
||||
@@ -763,6 +766,7 @@ int BME_JEKV(BME_Mesh *bm, BME_Edge *ke, BME_Vert *kv)
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*Validate disk cycles*/
|
||||
diskbase = BME_disk_getpointer(ov->edge,ov);
|
||||
edok = BME_cycle_validate(valance1, diskbase);
|
||||
|
||||
@@ -32,64 +32,33 @@
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "DNA_listBase.h"
|
||||
#include "DNA_meshdata_types.h"
|
||||
#include "DNA_mesh_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
|
||||
|
||||
#include "BLI_blenlib.h"
|
||||
#include "BKE_utildefines.h"
|
||||
#include "BKE_bmesh.h"
|
||||
#include "BKE_global.h"
|
||||
#include "BKE_depsgraph.h"
|
||||
#include "BLI_blenlib.h"
|
||||
#include "BLI_editVert.h"
|
||||
#include "BIF_editmesh.h"
|
||||
#include "BIF_space.h"
|
||||
#include "editmesh.h"
|
||||
#include "bmesh_private.h"
|
||||
#include "mydevice.h"
|
||||
|
||||
#include "BSE_edit.h"
|
||||
|
||||
|
||||
/*
|
||||
* BME MAKE MESH
|
||||
*
|
||||
* Allocates a new BME_Mesh structure.
|
||||
* The arguments are two arrays, one of type int
|
||||
* and another of type BME_CustomDataInit. The first array
|
||||
* contains the allocation size for each element pool in
|
||||
* the mesh. For instance allocsize[0] contains the number
|
||||
* of vertices to allocate at a time for the vertex pool.
|
||||
*
|
||||
* The second array contains structures describing the layout
|
||||
* of custom data for each element type in the mesh. So init[0]
|
||||
* contains the custom data layout information for vertices, init[1]
|
||||
* the layout information for edges and so on.
|
||||
*
|
||||
* Returns -
|
||||
* Pointer to a Bmesh
|
||||
*
|
||||
*/
|
||||
|
||||
BME_Mesh *BME_make_mesh(int allocsize[4], BME_CustomDataInit init[4])
|
||||
BME_Mesh *BME_make_mesh(int allocsize[4])
|
||||
{
|
||||
/*allocate the structure*/
|
||||
BME_Mesh *bm = MEM_callocN(sizeof(BME_Mesh),"BMesh");
|
||||
/*allocate the memory pools for the mesh elements*/
|
||||
bm->vpool = BME_mempool_create(sizeof(BME_Vert), allocsize[0], allocsize[0]);
|
||||
bm->epool = BME_mempool_create(sizeof(BME_Edge), allocsize[1], allocsize[1]);
|
||||
bm->lpool = BME_mempool_create(sizeof(BME_Loop), allocsize[2], allocsize[2]);
|
||||
bm->ppool = BME_mempool_create(sizeof(BME_Poly), allocsize[3], allocsize[3]);
|
||||
/*Setup custom data layers*/
|
||||
BME_CD_Create(&bm->vdata, &init[0], allocsize[0]);
|
||||
BME_CD_Create(&bm->edata, &init[1], allocsize[1]);
|
||||
BME_CD_Create(&bm->ldata, &init[2], allocsize[2]);
|
||||
BME_CD_Create(&bm->pdata, &init[3], allocsize[3]);
|
||||
bm->vpool = BLI_mempool_create(sizeof(BME_Vert), allocsize[0], allocsize[0]);
|
||||
bm->epool = BLI_mempool_create(sizeof(BME_Edge), allocsize[1], allocsize[1]);
|
||||
bm->lpool = BLI_mempool_create(sizeof(BME_Loop), allocsize[2], allocsize[2]);
|
||||
bm->ppool = BLI_mempool_create(sizeof(BME_Poly), allocsize[3], allocsize[3]);
|
||||
return bm;
|
||||
}
|
||||
/*
|
||||
@@ -105,26 +74,35 @@ void BME_free_mesh(BME_Mesh *bm)
|
||||
BME_Loop *l;
|
||||
BME_Poly *f;
|
||||
|
||||
for(v=bm->verts.first; v; v=v->next) BME_CD_free_block(&bm->vdata, &v->data);
|
||||
for(e=bm->edges.first; e; e=e->next) BME_CD_free_block(&bm->edata, &e->data);
|
||||
for(v=bm->verts.first; v; v=v->next) CustomData_bmesh_free_block(&bm->vdata, &v->data);
|
||||
for(e=bm->edges.first; e; e=e->next) CustomData_bmesh_free_block(&bm->edata, &e->data);
|
||||
for(f=bm->polys.first; f; f=f->next){
|
||||
BME_CD_free_block(&bm->pdata, &f->data);
|
||||
CustomData_bmesh_free_block(&bm->pdata, &f->data);
|
||||
l = f->loopbase;
|
||||
do{
|
||||
BME_CD_free_block(&bm->ldata, &l->data);
|
||||
CustomData_bmesh_free_block(&bm->ldata, &l->data);
|
||||
l = l->next;
|
||||
}while(l!=f->loopbase);
|
||||
}
|
||||
|
||||
/*Free custom data pools, This should probably go in CustomData_free?*/
|
||||
if(bm->vdata.totlayer) BLI_mempool_destroy(bm->vdata.pool);
|
||||
if(bm->edata.totlayer) BLI_mempool_destroy(bm->edata.pool);
|
||||
if(bm->ldata.totlayer) BLI_mempool_destroy(bm->ldata.pool);
|
||||
if(bm->pdata.totlayer) BLI_mempool_destroy(bm->pdata.pool);
|
||||
|
||||
/*free custom data*/
|
||||
CustomData_free(&bm->vdata,0);
|
||||
CustomData_free(&bm->edata,0);
|
||||
CustomData_free(&bm->ldata,0);
|
||||
CustomData_free(&bm->pdata,0);
|
||||
|
||||
/*destroy element pools*/
|
||||
BME_mempool_destroy(bm->vpool);
|
||||
BME_mempool_destroy(bm->epool);
|
||||
BME_mempool_destroy(bm->ppool);
|
||||
BME_mempool_destroy(bm->lpool);
|
||||
/*free custom data pools*/
|
||||
BME_CD_Free(&bm->vdata);
|
||||
BME_CD_Free(&bm->edata);
|
||||
BME_CD_Free(&bm->ldata);
|
||||
BME_CD_Free(&bm->pdata);
|
||||
BLI_mempool_destroy(bm->vpool);
|
||||
BLI_mempool_destroy(bm->epool);
|
||||
BLI_mempool_destroy(bm->ppool);
|
||||
BLI_mempool_destroy(bm->lpool);
|
||||
|
||||
MEM_freeN(bm);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,101 +41,6 @@
|
||||
#include "BLI_blenlib.h"
|
||||
#include "BLI_linklist.h"
|
||||
#include "BLI_ghash.h"
|
||||
|
||||
#include "BKE_customdata.h"
|
||||
|
||||
/*
|
||||
Simple, fast memory allocator for allocating many elements of the same size.
|
||||
*/
|
||||
typedef struct BME_mempool_chunk{
|
||||
struct BME_mempool_chunk *next, *prev;
|
||||
void *data;
|
||||
}BME_mempool_chunk;
|
||||
|
||||
/*this is just to make things prettier*/
|
||||
typedef struct BME_freenode{
|
||||
struct BME_freenode *next;
|
||||
}BME_freenode;
|
||||
|
||||
BME_mempool *BME_mempool_create(int esize, int tote, int pchunk)
|
||||
{ BME_mempool *pool = NULL;
|
||||
BME_freenode *lasttail = NULL, *curnode = NULL;
|
||||
int i,j, maxchunks;
|
||||
char *addr;
|
||||
|
||||
/*allocate the pool structure*/
|
||||
pool = MEM_mallocN(sizeof(BME_mempool),"memory pool");
|
||||
pool->esize = esize;
|
||||
pool->pchunk = pchunk;
|
||||
pool->csize = esize * pchunk;
|
||||
pool->chunks.first = pool->chunks.last = NULL;
|
||||
|
||||
maxchunks = tote / pchunk;
|
||||
|
||||
/*allocate the actual chunks*/
|
||||
for(i=0; i < maxchunks; i++){
|
||||
BME_mempool_chunk *mpchunk = MEM_mallocN(sizeof(BME_mempool_chunk), "BME_Mempool Chunk");
|
||||
mpchunk->next = mpchunk->prev = NULL;
|
||||
mpchunk->data = MEM_mallocN(pool->csize, "BME Mempool Chunk Data");
|
||||
BLI_addtail(&(pool->chunks), mpchunk);
|
||||
|
||||
if(i==0) pool->free = mpchunk->data; /*start of the list*/
|
||||
/*loop through the allocated data, building the pointer structures*/
|
||||
for(addr = mpchunk->data, j=0; j < pool->pchunk; j++){
|
||||
curnode = ((BME_freenode*)addr);
|
||||
addr += pool->esize;
|
||||
curnode->next = (BME_freenode*)addr;
|
||||
}
|
||||
/*final pointer in the previously allocated chunk is wrong.*/
|
||||
if(lasttail) lasttail->next = mpchunk->data;
|
||||
/*set the end of this chunks memory to the new tail for next iteration*/
|
||||
lasttail = curnode;
|
||||
}
|
||||
/*terminate the list*/
|
||||
curnode->next = NULL;
|
||||
return pool;
|
||||
}
|
||||
|
||||
void *BME_mempool_alloc(BME_mempool *pool){
|
||||
void *retval=NULL;
|
||||
BME_freenode *curnode=NULL;
|
||||
char *addr=NULL;
|
||||
int j;
|
||||
|
||||
if(!(pool->free)){
|
||||
/*need to allocate a new chunk*/
|
||||
BME_mempool_chunk *mpchunk = MEM_mallocN(sizeof(BME_mempool_chunk), "BME_Mempool Chunk");
|
||||
mpchunk->next = mpchunk->prev = NULL;
|
||||
mpchunk->data = MEM_mallocN(pool->csize, "BME_Mempool Chunk Data");
|
||||
BLI_addtail(&(pool->chunks), mpchunk);
|
||||
|
||||
pool->free = mpchunk->data; /*start of the list*/
|
||||
for(addr = mpchunk->data, j=0; j < pool->pchunk; j++){
|
||||
curnode = ((BME_freenode*)addr);
|
||||
addr += pool->esize;
|
||||
curnode->next = (BME_freenode*)addr;
|
||||
}
|
||||
curnode->next = NULL; /*terminate the list*/
|
||||
}
|
||||
|
||||
retval = pool->free;
|
||||
pool->free = pool->free->next;
|
||||
//memset(retval, 0, pool->esize);
|
||||
return retval;
|
||||
}
|
||||
|
||||
void BME_mempool_free(BME_mempool *pool, void *addr){ //doesnt protect against double frees, dont be stupid!
|
||||
BME_freenode *newhead = addr;
|
||||
newhead->next = pool->free;
|
||||
pool->free = newhead;
|
||||
}
|
||||
void BME_mempool_destroy(BME_mempool *pool)
|
||||
{
|
||||
BME_mempool_chunk *mpchunk=NULL;
|
||||
for(mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) MEM_freeN(mpchunk->data);
|
||||
BLI_freelistN(&(pool->chunks));
|
||||
MEM_freeN(pool);
|
||||
}
|
||||
/**
|
||||
* MISC utility functions.
|
||||
*
|
||||
@@ -179,7 +84,7 @@ int BME_edge_swapverts(BME_Edge *e, BME_Vert *orig, BME_Vert *new){
|
||||
|
||||
BME_Vert *BME_addvertlist(BME_Mesh *bm, BME_Vert *example){
|
||||
BME_Vert *v=NULL;
|
||||
v = BME_mempool_alloc(bm->vpool);
|
||||
v = BLI_mempool_alloc(bm->vpool);
|
||||
v->next = v->prev = NULL;
|
||||
v->EID = bm->nextv;
|
||||
v->co[0] = v->co[1] = v->co[2] = 0.0f;
|
||||
@@ -195,16 +100,16 @@ BME_Vert *BME_addvertlist(BME_Mesh *bm, BME_Vert *example){
|
||||
|
||||
if(example){
|
||||
VECCOPY(v->co,example->co);
|
||||
BME_CD_copy_data(&bm->vdata, &bm->vdata, example->data, &v->data);
|
||||
CustomData_bmesh_copy_data(&bm->vdata, &bm->vdata, example->data, &v->data);
|
||||
}
|
||||
else
|
||||
BME_CD_set_default(&bm->vdata, &v->data);
|
||||
CustomData_bmesh_set_default(&bm->vdata, &v->data);
|
||||
|
||||
return v;
|
||||
}
|
||||
BME_Edge *BME_addedgelist(BME_Mesh *bm, BME_Vert *v1, BME_Vert *v2, BME_Edge *example){
|
||||
BME_Edge *e=NULL;
|
||||
e = BME_mempool_alloc(bm->epool);
|
||||
e = BLI_mempool_alloc(bm->epool);
|
||||
e->next = e->prev = NULL;
|
||||
e->EID = bm->nexte;
|
||||
e->v1 = v1;
|
||||
@@ -222,16 +127,16 @@ BME_Edge *BME_addedgelist(BME_Mesh *bm, BME_Vert *v1, BME_Vert *v2, BME_Edge *ex
|
||||
BLI_addtail(&(bm->edges), e);
|
||||
|
||||
if(example)
|
||||
BME_CD_copy_data(&bm->edata, &bm->edata, example->data, &e->data);
|
||||
CustomData_bmesh_copy_data(&bm->edata, &bm->edata, example->data, &e->data);
|
||||
else
|
||||
BME_CD_set_default(&bm->edata, &e->data);
|
||||
CustomData_bmesh_set_default(&bm->edata, &e->data);
|
||||
|
||||
|
||||
return e;
|
||||
}
|
||||
BME_Loop *BME_create_loop(BME_Mesh *bm, BME_Vert *v, BME_Edge *e, BME_Poly *f, BME_Loop *example){
|
||||
BME_Loop *l=NULL;
|
||||
l = BME_mempool_alloc(bm->lpool);
|
||||
l = BLI_mempool_alloc(bm->lpool);
|
||||
l->next = l->prev = NULL;
|
||||
l->EID = bm->nextl;
|
||||
l->radial.next = l->radial.prev = NULL;
|
||||
@@ -246,16 +151,16 @@ BME_Loop *BME_create_loop(BME_Mesh *bm, BME_Vert *v, BME_Edge *e, BME_Poly *f, B
|
||||
bm->totloop++;
|
||||
|
||||
if(example)
|
||||
BME_CD_copy_data(&bm->ldata, &bm->ldata, example->data, &l->data);
|
||||
CustomData_bmesh_copy_data(&bm->ldata, &bm->ldata, example->data, &l->data);
|
||||
else
|
||||
BME_CD_set_default(&bm->ldata, &l->data);
|
||||
CustomData_bmesh_set_default(&bm->ldata, &l->data);
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
BME_Poly *BME_addpolylist(BME_Mesh *bm, BME_Poly *example){
|
||||
BME_Poly *f = NULL;
|
||||
f = BME_mempool_alloc(bm->ppool);
|
||||
f = BLI_mempool_alloc(bm->ppool);
|
||||
f->next = f->prev = NULL;
|
||||
f->EID = bm->nextp;
|
||||
f->loopbase = NULL;
|
||||
@@ -268,9 +173,9 @@ BME_Poly *BME_addpolylist(BME_Mesh *bm, BME_Poly *example){
|
||||
bm->totpoly++;
|
||||
|
||||
if(example)
|
||||
BME_CD_copy_data(&bm->pdata, &bm->pdata, example->data, &f->data);
|
||||
CustomData_bmesh_copy_data(&bm->pdata, &bm->pdata, example->data, &f->data);
|
||||
else
|
||||
BME_CD_set_default(&bm->pdata, &f->data);
|
||||
CustomData_bmesh_set_default(&bm->pdata, &f->data);
|
||||
|
||||
|
||||
return f;
|
||||
@@ -281,23 +186,23 @@ BME_Poly *BME_addpolylist(BME_Mesh *bm, BME_Poly *example){
|
||||
*/
|
||||
void BME_free_vert(BME_Mesh *bm, BME_Vert *v){
|
||||
bm->totvert--;
|
||||
BME_CD_free_block(&bm->vdata, &v->data);
|
||||
BME_mempool_free(bm->vpool, v);
|
||||
CustomData_bmesh_free_block(&bm->vdata, &v->data);
|
||||
BLI_mempool_free(bm->vpool, v);
|
||||
}
|
||||
void BME_free_edge(BME_Mesh *bm, BME_Edge *e){
|
||||
bm->totedge--;
|
||||
BME_CD_free_block(&bm->edata, &e->data);
|
||||
BME_mempool_free(bm->epool, e);
|
||||
CustomData_bmesh_free_block(&bm->edata, &e->data);
|
||||
BLI_mempool_free(bm->epool, e);
|
||||
}
|
||||
void BME_free_poly(BME_Mesh *bm, BME_Poly *f){
|
||||
bm->totpoly--;
|
||||
BME_CD_free_block(&bm->pdata, &f->data);
|
||||
BME_mempool_free(bm->ppool, f);
|
||||
CustomData_bmesh_free_block(&bm->pdata, &f->data);
|
||||
BLI_mempool_free(bm->ppool, f);
|
||||
}
|
||||
void BME_free_loop(BME_Mesh *bm, BME_Loop *l){
|
||||
bm->totloop--;
|
||||
BME_CD_free_block(&bm->ldata, &l->data);
|
||||
BME_mempool_free(bm->lpool, l);
|
||||
CustomData_bmesh_free_block(&bm->ldata, &l->data);
|
||||
BLI_mempool_free(bm->lpool, l);
|
||||
}
|
||||
/**
|
||||
* BMESH CYCLES
|
||||
|
||||
@@ -205,7 +205,53 @@ static BME_Poly *BME_split_face(BME_Mesh *bm, BME_Poly *f, BME_Vert *v1, BME_Ver
|
||||
return nf;
|
||||
}
|
||||
|
||||
/* a wrapper for BME_SEMV that transfers element flags */
|
||||
|
||||
static void BME_data_interp_from_verts(BME_Mesh *bm, BME_Vert *v1, BME_Vert *v2, BME_Vert *v, float fac)
|
||||
{
|
||||
void *src[2];
|
||||
float w[2];
|
||||
if (v1->data && v2->data) {
|
||||
src[0]= v1->data;
|
||||
src[1]= v2->data;
|
||||
w[0] = 1.0f-fac;
|
||||
w[1] = fac;
|
||||
CustomData_bmesh_interp(&bm->vdata, src, w, NULL, 2, v->data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void BME_data_facevert_edgesplit(BME_Mesh *bm, BME_Vert *v1, BME_Vert *v2, BME_Vert *v, BME_Edge *e1, float fac){
|
||||
void *src[2];
|
||||
float w[2];
|
||||
BME_Loop *l=NULL, *v1loop = NULL, *vloop = NULL, *v2loop = NULL;
|
||||
|
||||
w[0] = 1.0f - fac;
|
||||
w[1] = fac;
|
||||
|
||||
if(!e1->loop) return;
|
||||
l = e1->loop;
|
||||
do{
|
||||
if(l->v == v1){
|
||||
v1loop = l;
|
||||
vloop = v1loop->next;
|
||||
v2loop = vloop->next;
|
||||
}else if(l->v == v){
|
||||
v1loop = l->next;
|
||||
vloop = l;
|
||||
v2loop = l->prev;
|
||||
|
||||
}
|
||||
|
||||
src[0] = v1loop->data;
|
||||
src[1] = v2loop->data;
|
||||
|
||||
CustomData_bmesh_interp(&bm->ldata, src,w, NULL, 2, vloop->data);
|
||||
l = l->radial.next->data;
|
||||
}while(l!=e1->loop);
|
||||
}
|
||||
|
||||
|
||||
/* a wrapper for BME_SEMV that transfers element flags */ /*add custom data interpolation in here!*/
|
||||
static BME_Vert *BME_split_edge(BME_Mesh *bm, BME_Vert *v, BME_Edge *e, BME_Edge **ne, float percent) {
|
||||
BME_Vert *nv, *v2;
|
||||
float len;
|
||||
@@ -224,10 +270,39 @@ static BME_Vert *BME_split_edge(BME_Mesh *bm, BME_Vert *v, BME_Edge *e, BME_Edge
|
||||
(*ne)->crease = e->crease;
|
||||
(*ne)->bweight = e->bweight;
|
||||
}
|
||||
|
||||
/*v->nv->v2*/
|
||||
BME_data_facevert_edgesplit(bm,v2, v, nv, e, 0.75);
|
||||
return nv;
|
||||
}
|
||||
|
||||
static void BME_collapse_vert(BME_Mesh *bm, BME_Edge *ke, BME_Vert *kv, float fac){
|
||||
void *src[2];
|
||||
float w[2];
|
||||
BME_Loop *l=NULL, *kvloop=NULL, *tvloop=NULL;
|
||||
BME_Vert *tv = BME_edge_getothervert(ke,kv);
|
||||
|
||||
w[0] = 1.0f - fac;
|
||||
w[1] = fac;
|
||||
|
||||
if(ke->loop){
|
||||
l = ke->loop;
|
||||
do{
|
||||
if(l->v == tv && l->next->v == kv){
|
||||
tvloop = l;
|
||||
kvloop = l->next;
|
||||
|
||||
src[0] = kvloop->data;
|
||||
src[1] = tvloop->data;
|
||||
CustomData_bmesh_interp(&bm->ldata, src,w, NULL, 2, kvloop->data);
|
||||
}
|
||||
l=l->radial.next->data;
|
||||
}while(l!=ke->loop);
|
||||
}
|
||||
BME_JEKV(bm,ke,kv);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int BME_bevel_is_split_vert(BME_Loop *l) {
|
||||
/* look for verts that have already been added to the edge when
|
||||
* beveling other polys; this can be determined by testing the
|
||||
@@ -315,7 +390,7 @@ static float BME_bevel_project_vec(float *vec1, float *vec2, float *up_vec, int
|
||||
* Finally, return the split vert. */
|
||||
static BME_Vert *BME_bevel_split_edge(BME_Mesh *bm, BME_Vert *v, BME_Vert *v1, BME_Loop *l, float *up_vec, float value, BME_TransData_Head *td) {
|
||||
BME_TransData *vtd, *vtd1, *vtd2;
|
||||
BME_Vert *sv, *v2, *v3;
|
||||
BME_Vert *sv, *v2, *v3, *ov;
|
||||
BME_Loop *lv1, *lv2;
|
||||
BME_Edge *ne, *e1, *e2;
|
||||
float maxfactor, scale, len, dis, vec1[3], vec2[3], t_up_vec[3];
|
||||
@@ -349,7 +424,11 @@ static BME_Vert *BME_bevel_split_edge(BME_Mesh *bm, BME_Vert *v, BME_Vert *v1, B
|
||||
else {
|
||||
e1 = e2;
|
||||
}
|
||||
ov = BME_edge_getothervert(e1,v);
|
||||
sv = BME_split_edge(bm,v,e1,&ne,0);
|
||||
//BME_data_interp_from_verts(bm, v, ov, sv, 0.25); /*this is technically wrong...*/
|
||||
//BME_data_interp_from_faceverts(bm, v, ov, sv, 0.25);
|
||||
//BME_data_interp_from_faceverts(bm, ov, v, sv, 0.25);
|
||||
BME_assign_transdata(td, bm, sv, sv->co, sv->co, NULL, sv->co, 0, -1, -1, NULL); /* quick default */
|
||||
sv->tflag1 |= BME_BEVEL_BEVEL;
|
||||
ne->tflag1 = BME_BEVEL_ORIG; /* mark edge as original, even though it isn't */
|
||||
@@ -388,7 +467,11 @@ static BME_Vert *BME_bevel_split_edge(BME_Mesh *bm, BME_Vert *v, BME_Vert *v1, B
|
||||
}
|
||||
else {
|
||||
is_split_vert = 0;
|
||||
ov = BME_edge_getothervert(l->e,v);
|
||||
sv = BME_split_edge(bm,v,l->e,&ne,0);
|
||||
//BME_data_interp_from_verts(bm, v, ov, sv, 0.25); /*this is technically wrong...*/
|
||||
//BME_data_interp_from_faceverts(bm, v, ov, sv, 0.25);
|
||||
//BME_data_interp_from_faceverts(bm, ov, v, sv, 0.25);
|
||||
BME_assign_transdata(td, bm, sv, sv->co, sv->co, NULL, sv->co, 0, -1, -1, NULL); /* quick default */
|
||||
sv->tflag1 |= BME_BEVEL_BEVEL;
|
||||
ne->tflag1 = BME_BEVEL_ORIG; /* mark edge as original, even though it isn't */
|
||||
@@ -567,12 +650,15 @@ static BME_Loop *BME_bevel_edge(BME_Mesh *bm, BME_Loop *l, float value, int opti
|
||||
if (kl->v == kv) {
|
||||
BME_split_face(bm,kl->f,kl->prev->v,kl->next->v,&nl,kl->prev->e);
|
||||
BME_JFKE(bm,((BME_Loop*)kl->prev->radial.next->data)->f,kl->f,kl->prev->e);
|
||||
BME_JEKV(bm,kl->e,kv);
|
||||
BME_collapse_vert(bm, kl->e, kv, 1.0);
|
||||
//BME_JEKV(bm,kl->e,kv);
|
||||
|
||||
}
|
||||
else {
|
||||
BME_split_face(bm,kl->f,kl->next->next->v,kl->v,&nl,kl->next->e);
|
||||
BME_JFKE(bm,((BME_Loop*)kl->next->radial.next->data)->f,kl->f,kl->next->e);
|
||||
BME_JEKV(bm,kl->e,kv);
|
||||
BME_collapse_vert(bm, kl->e, kv, 1.0);
|
||||
//BME_JEKV(bm,kl->e,kv);
|
||||
}
|
||||
l = l->prev;
|
||||
}
|
||||
@@ -601,12 +687,14 @@ static BME_Loop *BME_bevel_edge(BME_Mesh *bm, BME_Loop *l, float value, int opti
|
||||
if (kl->v == kv) {
|
||||
BME_split_face(bm,kl->f,kl->prev->v,kl->next->v,&nl,kl->prev->e);
|
||||
BME_JFKE(bm,((BME_Loop*)kl->prev->radial.next->data)->f,kl->f,kl->prev->e);
|
||||
BME_JEKV(bm,kl->e,kv);
|
||||
BME_collapse_vert(bm, kl->e, kv, 1.0);
|
||||
//BME_JEKV(bm,kl->e,kv);
|
||||
}
|
||||
else {
|
||||
BME_split_face(bm,kl->f,kl->next->next->v,kl->v,&nl,kl->next->e);
|
||||
BME_JFKE(bm,((BME_Loop*)kl->next->radial.next->data)->f,kl->f,kl->next->e);
|
||||
BME_JEKV(bm,kl->e,kv);
|
||||
BME_collapse_vert(bm, kl->e, kv, 1.0);
|
||||
//BME_JEKV(bm,kl->e,kv);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1073,7 +1161,8 @@ static void bmesh_dissolve_disk(BME_Mesh *bm, BME_Vert *v){
|
||||
e = BME_disk_nextedge(e,v);
|
||||
}while(e != v->edge);
|
||||
}
|
||||
BME_JEKV(bm,v->edge,v);
|
||||
BME_collapse_vert(bm, v->edge, v, 1.0);
|
||||
//BME_JEKV(bm,v->edge,v);
|
||||
}
|
||||
}
|
||||
static BME_Mesh *BME_bevel_mesh(BME_Mesh *bm, float value, int res, int options, int defgrp_index, BME_TransData_Head *td) {
|
||||
|
||||
@@ -186,10 +186,6 @@ void DM_init_funcs(DerivedMesh *dm)
|
||||
void DM_init(DerivedMesh *dm,
|
||||
int numVerts, int numEdges, int numFaces)
|
||||
{
|
||||
CustomData_add_layer(&dm->vertData, CD_ORIGINDEX, CD_CALLOC, NULL, numVerts);
|
||||
CustomData_add_layer(&dm->edgeData, CD_ORIGINDEX, CD_CALLOC, NULL, numEdges);
|
||||
CustomData_add_layer(&dm->faceData, CD_ORIGINDEX, CD_CALLOC, NULL, numFaces);
|
||||
|
||||
dm->numVertData = numVerts;
|
||||
dm->numEdgeData = numEdges;
|
||||
dm->numFaceData = numFaces;
|
||||
@@ -1056,7 +1052,7 @@ void emDM_copyEdgeArray(DerivedMesh *dm, MEdge *edge_r)
|
||||
|
||||
/* store vertex indices in tmp union */
|
||||
for(ev = em->verts.first, i = 0; ev; ev = ev->next, ++i)
|
||||
ev->tmp.l = (long) i++;
|
||||
ev->tmp.l = (long) i;
|
||||
|
||||
for( ; ee; ee = ee->next, ++edge_r) {
|
||||
edge_r->crease = (unsigned char) (ee->crease*255.0f);
|
||||
|
||||
@@ -290,6 +290,12 @@ void copy_pose(bPose **dst, bPose *src, int copycon)
|
||||
return;
|
||||
}
|
||||
|
||||
if (*dst==src) {
|
||||
printf("copy_pose source and target are the same\n");
|
||||
*dst=NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
outPose= MEM_callocN(sizeof(bPose), "pose");
|
||||
|
||||
duplicatelist(&outPose->chanbase, &src->chanbase);
|
||||
@@ -344,7 +350,7 @@ static void copy_pose_channel_data(bPoseChannel *pchan, const bPoseChannel *chan
|
||||
pchan->flag= chan->flag;
|
||||
|
||||
con= chan->constraints.first;
|
||||
for(pcon= pchan->constraints.first; pcon; pcon= pcon->next) {
|
||||
for(pcon= pchan->constraints.first; pcon; pcon= pcon->next, con= con->next) {
|
||||
pcon->enforce= con->enforce;
|
||||
pcon->headtail= con->headtail;
|
||||
}
|
||||
@@ -740,6 +746,11 @@ void extract_pose_from_pose(bPose *pose, const bPose *src)
|
||||
const bPoseChannel *schan;
|
||||
bPoseChannel *pchan= pose->chanbase.first;
|
||||
|
||||
if (pose==src) {
|
||||
printf("extract_pose_from_pose source and target are the same\n");
|
||||
return;
|
||||
}
|
||||
|
||||
for (schan=src->chanbase.first; schan; schan=schan->next, pchan= pchan->next) {
|
||||
copy_pose_channel_data(pchan, schan);
|
||||
}
|
||||
@@ -817,6 +828,12 @@ void copy_pose_result(bPose *to, bPose *from)
|
||||
return;
|
||||
}
|
||||
|
||||
if (to==from) {
|
||||
printf("copy_pose_result source and target are the same\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
for(pchanfrom= from->chanbase.first; pchanfrom; pchanfrom= pchanfrom->next) {
|
||||
pchanto= get_pose_channel(to, pchanfrom->name);
|
||||
if(pchanto) {
|
||||
@@ -843,7 +860,7 @@ typedef struct NlaIpoChannel {
|
||||
int type;
|
||||
} NlaIpoChannel;
|
||||
|
||||
static void extract_ipochannels_from_action(ListBase *lb, ID *id, bAction *act, char *name, float ctime)
|
||||
void extract_ipochannels_from_action(ListBase *lb, ID *id, bAction *act, char *name, float ctime)
|
||||
{
|
||||
bActionChannel *achan= get_action_channel(act, name);
|
||||
IpoCurve *icu;
|
||||
@@ -936,15 +953,18 @@ static void blend_ipochannels(ListBase *dst, ListBase *src, float srcweight, int
|
||||
}
|
||||
}
|
||||
|
||||
static void execute_ipochannels(ListBase *lb)
|
||||
int execute_ipochannels(ListBase *lb)
|
||||
{
|
||||
NlaIpoChannel *nic;
|
||||
int count = 0;
|
||||
|
||||
for(nic= lb->first; nic; nic= nic->next) {
|
||||
if(nic->poin) {
|
||||
write_ipo_poin(nic->poin, nic->type, nic->val);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/* nla timing */
|
||||
|
||||
@@ -1709,13 +1709,13 @@ static void execute_posetree(Object *ob, PoseTree *tree)
|
||||
|
||||
if (tree->totchannel == 0)
|
||||
return;
|
||||
|
||||
|
||||
iktree= MEM_mallocN(sizeof(void*)*tree->totchannel, "ik tree");
|
||||
|
||||
for(a=0; a<tree->totchannel; a++) {
|
||||
pchan= tree->pchan[a];
|
||||
bone= pchan->bone;
|
||||
|
||||
|
||||
/* set DoF flag */
|
||||
flag= 0;
|
||||
if(!(pchan->ikflag & BONE_IK_NO_XDOF) && !(pchan->ikflag & BONE_IK_NO_XDOF_TEMP))
|
||||
@@ -1724,32 +1724,32 @@ static void execute_posetree(Object *ob, PoseTree *tree)
|
||||
flag |= IK_YDOF;
|
||||
if(!(pchan->ikflag & BONE_IK_NO_ZDOF) && !(pchan->ikflag & BONE_IK_NO_ZDOF_TEMP))
|
||||
flag |= IK_ZDOF;
|
||||
|
||||
|
||||
if(tree->stretch && (pchan->ikstretch > 0.0)) {
|
||||
flag |= IK_TRANS_YDOF;
|
||||
hasstretch = 1;
|
||||
}
|
||||
|
||||
|
||||
seg= iktree[a]= IK_CreateSegment(flag);
|
||||
|
||||
|
||||
/* find parent */
|
||||
if(a == 0)
|
||||
parent= NULL;
|
||||
else
|
||||
parent= iktree[tree->parent[a]];
|
||||
|
||||
|
||||
IK_SetParent(seg, parent);
|
||||
|
||||
|
||||
/* get the matrix that transforms from prevbone into this bone */
|
||||
Mat3CpyMat4(R_bonemat, pchan->pose_mat);
|
||||
|
||||
|
||||
/* gather transformations for this IK segment */
|
||||
|
||||
|
||||
if (pchan->parent)
|
||||
Mat3CpyMat4(R_parmat, pchan->parent->pose_mat);
|
||||
else
|
||||
Mat3One(R_parmat);
|
||||
|
||||
|
||||
/* bone offset */
|
||||
if (pchan->parent && (a > 0))
|
||||
VecSubf(start, pchan->pose_head, pchan->parent->pose_tail);
|
||||
@@ -1759,37 +1759,37 @@ static void execute_posetree(Object *ob, PoseTree *tree)
|
||||
|
||||
/* change length based on bone size */
|
||||
length= bone->length*VecLength(R_bonemat[1]);
|
||||
|
||||
|
||||
/* compute rest basis and its inverse */
|
||||
Mat3CpyMat3(rest_basis, bone->bone_mat);
|
||||
Mat3CpyMat3(irest_basis, bone->bone_mat);
|
||||
Mat3Transp(irest_basis);
|
||||
|
||||
|
||||
/* compute basis with rest_basis removed */
|
||||
Mat3Inv(iR_parmat, R_parmat);
|
||||
Mat3MulMat3(full_basis, iR_parmat, R_bonemat);
|
||||
Mat3MulMat3(basis, irest_basis, full_basis);
|
||||
|
||||
|
||||
/* basis must be pure rotation */
|
||||
Mat3Ortho(basis);
|
||||
|
||||
|
||||
/* transform offset into local bone space */
|
||||
Mat3Ortho(iR_parmat);
|
||||
Mat3MulVecfl(iR_parmat, start);
|
||||
|
||||
|
||||
IK_SetTransform(seg, start, rest_basis, basis, length);
|
||||
|
||||
|
||||
if (pchan->ikflag & BONE_IK_XLIMIT)
|
||||
IK_SetLimit(seg, IK_X, pchan->limitmin[0], pchan->limitmax[0]);
|
||||
if (pchan->ikflag & BONE_IK_YLIMIT)
|
||||
IK_SetLimit(seg, IK_Y, pchan->limitmin[1], pchan->limitmax[1]);
|
||||
if (pchan->ikflag & BONE_IK_ZLIMIT)
|
||||
IK_SetLimit(seg, IK_Z, pchan->limitmin[2], pchan->limitmax[2]);
|
||||
|
||||
|
||||
IK_SetStiffness(seg, IK_X, pchan->stiffness[0]);
|
||||
IK_SetStiffness(seg, IK_Y, pchan->stiffness[1]);
|
||||
IK_SetStiffness(seg, IK_Z, pchan->stiffness[2]);
|
||||
|
||||
|
||||
if(tree->stretch && (pchan->ikstretch > 0.0)) {
|
||||
float ikstretch = pchan->ikstretch*pchan->ikstretch;
|
||||
IK_SetStiffness(seg, IK_TRANS_Y, MIN2(1.0-ikstretch, 0.99));
|
||||
@@ -1818,7 +1818,7 @@ static void execute_posetree(Object *ob, PoseTree *tree)
|
||||
for (target=tree->targets.first; target; target=target->next) {
|
||||
float polepos[3];
|
||||
int poleconstrain= 0;
|
||||
|
||||
|
||||
data= (bKinematicConstraint*)target->con->data;
|
||||
|
||||
/* 1.0=ctime, we pass on object for auto-ik (owner-type here is object, even though
|
||||
@@ -1835,7 +1835,7 @@ static void execute_posetree(Object *ob, PoseTree *tree)
|
||||
/* same for pole vector target */
|
||||
if(data->poletar) {
|
||||
get_constraint_target_matrix(target->con, 1, CONSTRAINT_OBTYPE_OBJECT, ob, rootmat, 1.0);
|
||||
|
||||
|
||||
if(data->flag & CONSTRAINT_IK_SETANGLE) {
|
||||
/* don't solve IK when we are setting the pole angle */
|
||||
break;
|
||||
@@ -1844,7 +1844,7 @@ static void execute_posetree(Object *ob, PoseTree *tree)
|
||||
Mat4MulMat4(goal, rootmat, goalinv);
|
||||
VECCOPY(polepos, goal[3]);
|
||||
poleconstrain= 1;
|
||||
|
||||
|
||||
if(data->flag & CONSTRAINT_IK_GETANGLE) {
|
||||
poleangledata= data;
|
||||
data->flag &= ~CONSTRAINT_IK_GETANGLE;
|
||||
@@ -1903,36 +1903,35 @@ static void execute_posetree(Object *ob, PoseTree *tree)
|
||||
tree->basis_change= MEM_mallocN(sizeof(float[3][3])*tree->totchannel, "ik basis change");
|
||||
if(hasstretch)
|
||||
ikstretch= MEM_mallocN(sizeof(float)*tree->totchannel, "ik stretch");
|
||||
|
||||
|
||||
for(a=0; a<tree->totchannel; a++) {
|
||||
IK_GetBasisChange(iktree[a], tree->basis_change[a]);
|
||||
|
||||
|
||||
if(hasstretch) {
|
||||
/* have to compensate for scaling received from parent */
|
||||
float parentstretch, stretch;
|
||||
|
||||
|
||||
pchan= tree->pchan[a];
|
||||
parentstretch= (tree->parent[a] >= 0)? ikstretch[tree->parent[a]]: 1.0;
|
||||
|
||||
|
||||
if(tree->stretch && (pchan->ikstretch > 0.0)) {
|
||||
float trans[3], length;
|
||||
|
||||
|
||||
IK_GetTranslationChange(iktree[a], trans);
|
||||
length= pchan->bone->length*VecLength(pchan->pose_mat[1]);
|
||||
|
||||
|
||||
ikstretch[a]= (length == 0.0)? 1.0: (trans[1]+length)/length;
|
||||
}
|
||||
else
|
||||
ikstretch[a] = 1.0;
|
||||
|
||||
|
||||
stretch= (parentstretch == 0.0)? 1.0: ikstretch[a]/parentstretch;
|
||||
|
||||
|
||||
VecMulf(tree->basis_change[a][0], stretch);
|
||||
VecMulf(tree->basis_change[a][1], stretch);
|
||||
VecMulf(tree->basis_change[a][2], stretch);
|
||||
|
||||
}
|
||||
|
||||
|
||||
IK_FreeSegment(iktree[a]);
|
||||
}
|
||||
|
||||
|
||||
@@ -39,11 +39,6 @@
|
||||
|
||||
#include "BKE_bmesh.h"
|
||||
|
||||
struct BME_mempool *BME_mempool_create(int esize, int tote, int pchunk);
|
||||
void BME_mempool_destroy(struct BME_mempool *pool);
|
||||
void *BME_mempool_alloc(struct BME_mempool *pool);
|
||||
void BME_mempool_free(struct BME_mempool *pool, void *address);
|
||||
|
||||
/*ALLOCATION/DEALLOCATION*/
|
||||
struct BME_Vert *BME_addvertlist(struct BME_Mesh *bm, struct BME_Vert *example);
|
||||
struct BME_Edge *BME_addedgelist(struct BME_Mesh *bm, struct BME_Vert *v1, struct BME_Vert *v2, struct BME_Edge *example);
|
||||
@@ -54,7 +49,6 @@ void BME_free_vert(struct BME_Mesh *bm, struct BME_Vert *v);
|
||||
void BME_free_edge(struct BME_Mesh *bm, struct BME_Edge *e);
|
||||
void BME_free_poly(struct BME_Mesh *bm, struct BME_Poly *f);
|
||||
void BME_free_loop(struct BME_Mesh *bm, struct BME_Loop *l);
|
||||
//void BME_delete_loop(struct BME_Mesh *bm, struct BME_Loop *l);
|
||||
|
||||
/*DOUBLE CIRCULAR LINKED LIST FUNCTIONS*/
|
||||
void BME_cycle_append(void *h, void *nt);
|
||||
|
||||
@@ -732,6 +732,10 @@ DerivedMesh *CDDM_new(int numVerts, int numEdges, int numFaces)
|
||||
|
||||
DM_init(dm, numVerts, numEdges, numFaces);
|
||||
|
||||
CustomData_add_layer(&dm->vertData, CD_ORIGINDEX, CD_CALLOC, NULL, numVerts);
|
||||
CustomData_add_layer(&dm->edgeData, CD_ORIGINDEX, CD_CALLOC, NULL, numEdges);
|
||||
CustomData_add_layer(&dm->faceData, CD_ORIGINDEX, CD_CALLOC, NULL, numFaces);
|
||||
|
||||
CustomData_add_layer(&dm->vertData, CD_MVERT, CD_CALLOC, NULL, numVerts);
|
||||
CustomData_add_layer(&dm->edgeData, CD_MEDGE, CD_CALLOC, NULL, numEdges);
|
||||
CustomData_add_layer(&dm->faceData, CD_MFACE, CD_CALLOC, NULL, numFaces);
|
||||
@@ -753,6 +757,11 @@ DerivedMesh *CDDM_from_mesh(Mesh *mesh, Object *ob)
|
||||
* with an exception for fluidsim */
|
||||
|
||||
DM_init(dm, mesh->totvert, mesh->totedge, mesh->totface);
|
||||
|
||||
CustomData_add_layer(&dm->vertData, CD_ORIGINDEX, CD_CALLOC, NULL, mesh->totvert);
|
||||
CustomData_add_layer(&dm->edgeData, CD_ORIGINDEX, CD_CALLOC, NULL, mesh->totedge);
|
||||
CustomData_add_layer(&dm->faceData, CD_ORIGINDEX, CD_CALLOC, NULL, mesh->totface);
|
||||
|
||||
dm->deformedOnly = 1;
|
||||
|
||||
if(ob && ob->fluidsimSettings && ob->fluidsimSettings->meshSurface)
|
||||
|
||||
@@ -132,7 +132,7 @@ void cloth_init ( ClothModifierData *clmd )
|
||||
|
||||
clmd->coll_parms->self_friction = 5.0;
|
||||
clmd->coll_parms->friction = 5.0;
|
||||
clmd->coll_parms->loop_count = 3;
|
||||
clmd->coll_parms->loop_count = 2;
|
||||
clmd->coll_parms->epsilon = 0.015f;
|
||||
clmd->coll_parms->flags = CLOTH_COLLSETTINGS_FLAG_ENABLED;
|
||||
clmd->coll_parms->collision_list = NULL;
|
||||
@@ -471,7 +471,7 @@ static int do_step_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *resul
|
||||
|
||||
tend();
|
||||
|
||||
/* printf ( "Cloth simulation time: %f\n", ( float ) tval() ); */
|
||||
// printf ( "%f\n", ( float ) tval() );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -541,7 +541,7 @@ int cloth_collision_response_static ( ClothModifierData *clmd, CollisionModifier
|
||||
{
|
||||
Normalize ( vrel_t_pre );
|
||||
|
||||
impulse = 2.0 * magtangent / ( 1.0 + w1*w1 + w2*w2 + w3*w3 );
|
||||
impulse = magtangent / ( 1.0 + w1*w1 + w2*w2 + w3*w3 ); // 2.0 *
|
||||
VECADDMUL ( cloth1->verts[collpair->ap1].impulse, vrel_t_pre, w1 * impulse );
|
||||
VECADDMUL ( cloth1->verts[collpair->ap2].impulse, vrel_t_pre, w2 * impulse );
|
||||
VECADDMUL ( cloth1->verts[collpair->ap3].impulse, vrel_t_pre, w3 * impulse );
|
||||
@@ -1291,52 +1291,223 @@ int cloth_collision_moving ( ClothModifierData *clmd, CollisionModifierData *col
|
||||
return 1;
|
||||
}
|
||||
|
||||
int cloth_bvh_objcollisions_do ( ClothModifierData * clmd, CollisionModifierData *collmd, float step, float dt )
|
||||
int cloth_do_selfcollisions(ClothModifierData * clmd)
|
||||
{
|
||||
int ret2 = 0, l;
|
||||
Cloth *cloth = clmd->clothObject;
|
||||
|
||||
if ( clmd->clothObject->bvhselftree )
|
||||
{
|
||||
for(l = 0; l < clmd->coll_parms->self_loop_count; l++)
|
||||
{
|
||||
BVHTreeOverlap *overlap = NULL;
|
||||
ClothVertex *verts = clmd->clothObject->verts; // needed for openMP
|
||||
int k;
|
||||
int ret = 0, result = 0;
|
||||
|
||||
// search for overlapping collision pairs
|
||||
overlap = BLI_bvhtree_overlap ( cloth->bvhselftree, cloth->bvhselftree, &result );
|
||||
|
||||
// #pragma omp parallel for private(k, i, j) schedule(static)
|
||||
for ( k = 0; k < result; k++ )
|
||||
{
|
||||
float temp[3];
|
||||
float length = 0;
|
||||
float mindistance;
|
||||
int i, j;
|
||||
|
||||
i = overlap[k].indexA;
|
||||
j = overlap[k].indexB;
|
||||
|
||||
mindistance = clmd->coll_parms->selfepsilon* ( cloth->verts[i].avg_spring_len + cloth->verts[j].avg_spring_len );
|
||||
|
||||
if ( clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL )
|
||||
{
|
||||
if ( ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED )
|
||||
&& ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
VECSUB ( temp, verts[i].tx, verts[j].tx );
|
||||
|
||||
if ( ( ABS ( temp[0] ) > mindistance ) || ( ABS ( temp[1] ) > mindistance ) || ( ABS ( temp[2] ) > mindistance ) ) continue;
|
||||
|
||||
// check for adjacent points (i must be smaller j)
|
||||
if ( BLI_edgehash_haskey ( cloth->edgehash, MIN2(i, j), MAX2(i, j) ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
length = Normalize ( temp );
|
||||
|
||||
if ( length < mindistance )
|
||||
{
|
||||
float correction = mindistance - length;
|
||||
|
||||
if ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED )
|
||||
{
|
||||
VecMulf ( temp, -correction );
|
||||
VECADD ( verts[j].tx, verts[j].tx, temp );
|
||||
}
|
||||
else if ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED )
|
||||
{
|
||||
VecMulf ( temp, correction );
|
||||
VECADD ( verts[i].tx, verts[i].tx, temp );
|
||||
}
|
||||
else
|
||||
{
|
||||
VecMulf ( temp, -correction*0.5 );
|
||||
VECADD ( verts[j].tx, verts[j].tx, temp );
|
||||
|
||||
VECSUB ( verts[i].tx, verts[i].tx, temp );
|
||||
}
|
||||
ret = 1;
|
||||
ret2 += ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
// check for approximated time collisions
|
||||
}
|
||||
}
|
||||
|
||||
if ( overlap )
|
||||
MEM_freeN ( overlap );
|
||||
|
||||
if(!ret)
|
||||
break;
|
||||
|
||||
}
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// SELFCOLLISIONS: update velocities
|
||||
////////////////////////////////////////////////////////////
|
||||
if ( ret2 )
|
||||
{
|
||||
int i;
|
||||
ClothVertex *verts = clmd->clothObject->verts; // needed for openMP
|
||||
|
||||
for ( i = 0; i < cloth->numverts; i++ )
|
||||
{
|
||||
if ( ! ( verts [i].flags & CLOTH_VERT_FLAG_PINNED ) )
|
||||
{
|
||||
VECSUB ( verts[i].tv, verts[i].tx, verts[i].txold );
|
||||
}
|
||||
}
|
||||
}
|
||||
////////////////////////////////////////////////////////////
|
||||
}
|
||||
return ret2;
|
||||
}
|
||||
|
||||
// return all collision objects in scene
|
||||
// collision object will exclude self
|
||||
CollisionModifierData **get_collisionobjects(Object *self, int *numcollobj)
|
||||
{
|
||||
Base *base=NULL;
|
||||
CollisionModifierData **objs = NULL;
|
||||
Object *coll_ob = NULL;
|
||||
CollisionModifierData *collmd = NULL;
|
||||
int numobj = 0, maxobj = 100;
|
||||
|
||||
objs = MEM_callocN(sizeof(CollisionModifierData *)*maxobj, "CollisionObjectsArray");
|
||||
// check all collision objects
|
||||
for ( base = G.scene->base.first; base; base = base->next )
|
||||
{
|
||||
coll_ob = base->object;
|
||||
collmd = ( CollisionModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Collision );
|
||||
|
||||
if ( !collmd )
|
||||
{
|
||||
if ( coll_ob->dup_group )
|
||||
{
|
||||
GroupObject *go;
|
||||
Group *group = coll_ob->dup_group;
|
||||
|
||||
for ( go= group->gobject.first; go; go= go->next )
|
||||
{
|
||||
coll_ob = go->ob;
|
||||
|
||||
collmd = ( CollisionModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Collision );
|
||||
|
||||
if ( !collmd )
|
||||
continue;
|
||||
|
||||
if(coll_ob == self)
|
||||
continue;
|
||||
|
||||
if(numobj >= maxobj)
|
||||
{
|
||||
// realloc
|
||||
int oldmax = maxobj;
|
||||
CollisionModifierData **tmp;
|
||||
maxobj *= 2;
|
||||
tmp = MEM_callocN(sizeof(CollisionModifierData *)*maxobj, "CollisionObjectsArray");
|
||||
memcpy(tmp, objs, sizeof(CollisionModifierData *)*oldmax);
|
||||
MEM_freeN(objs);
|
||||
objs = tmp;
|
||||
}
|
||||
|
||||
objs[numobj] = collmd;
|
||||
numobj++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(coll_ob == self)
|
||||
continue;
|
||||
|
||||
if(numobj >= maxobj)
|
||||
{
|
||||
// realloc
|
||||
int oldmax = maxobj;
|
||||
CollisionModifierData **tmp;
|
||||
maxobj *= 2;
|
||||
tmp = MEM_callocN(sizeof(CollisionModifierData *)*maxobj, "CollisionObjectsArray");
|
||||
memcpy(tmp, objs, sizeof(CollisionModifierData *)*oldmax);
|
||||
MEM_freeN(objs);
|
||||
objs = tmp;
|
||||
|
||||
}
|
||||
|
||||
objs[numobj] = collmd;
|
||||
numobj++;
|
||||
}
|
||||
}
|
||||
*numcollobj = numobj;
|
||||
return objs;
|
||||
}
|
||||
|
||||
void cloth_bvh_objcollisions_nearcheck ( ClothModifierData * clmd, CollisionModifierData *collmd, CollPair **collisions, CollPair **collisions_index, int numresult, BVHTreeOverlap *overlap)
|
||||
{
|
||||
int i;
|
||||
|
||||
*collisions = ( CollPair* ) MEM_mallocN ( sizeof ( CollPair ) * numresult * 4, "collision array" ); //*4 since cloth_collision_static can return more than 1 collision
|
||||
*collisions_index = *collisions;
|
||||
|
||||
for ( i = 0; i < numresult; i++ )
|
||||
{
|
||||
*collisions_index = cloth_collision ( ( ModifierData * ) clmd, ( ModifierData * ) collmd, overlap+i, *collisions_index );
|
||||
}
|
||||
}
|
||||
|
||||
int cloth_bvh_objcollisions_resolve ( ClothModifierData * clmd, CollisionModifierData *collmd, CollPair *collisions, CollPair *collisions_index)
|
||||
{
|
||||
Cloth *cloth = clmd->clothObject;
|
||||
BVHTree *cloth_bvh= ( BVHTree * ) cloth->bvhtree;
|
||||
long i=0, j = 0, numfaces = 0, numverts = 0;
|
||||
int i=0, j = 0, numfaces = 0, numverts = 0;
|
||||
ClothVertex *verts = NULL;
|
||||
CollPair *collisions = NULL, *collisions_index = NULL;
|
||||
int ret = 0;
|
||||
int result = 0;
|
||||
float tnull[3] = {0,0,0};
|
||||
BVHTreeOverlap *overlap = NULL;
|
||||
|
||||
|
||||
|
||||
numfaces = clmd->clothObject->numfaces;
|
||||
numverts = clmd->clothObject->numverts;
|
||||
|
||||
|
||||
verts = cloth->verts;
|
||||
|
||||
if ( collmd->bvhtree )
|
||||
{
|
||||
/* get pointer to bounding volume hierarchy */
|
||||
BVHTree *coll_bvh = collmd->bvhtree;
|
||||
|
||||
/* move object to position (step) in time */
|
||||
collision_move_object ( collmd, step + dt, step );
|
||||
|
||||
/* search for overlapping collision pairs */
|
||||
overlap = BLI_bvhtree_overlap ( cloth_bvh, coll_bvh, &result );
|
||||
|
||||
collisions = ( CollPair* ) MEM_mallocN ( sizeof ( CollPair ) * result*4, "collision array" ); //*4 since cloth_collision_static can return more than 1 collision
|
||||
collisions_index = collisions;
|
||||
|
||||
for ( i = 0; i < result; i++ )
|
||||
{
|
||||
collisions_index = cloth_collision ( ( ModifierData * ) clmd, ( ModifierData * ) collmd, overlap+i, collisions_index );
|
||||
}
|
||||
|
||||
if ( overlap )
|
||||
MEM_freeN ( overlap );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( G.rt > 0 )
|
||||
printf ( "cloth_bvh_objcollision: found a collision object with clothObject or collData NULL.\n" );
|
||||
}
|
||||
|
||||
|
||||
// process all collisions (calculate impulses, TODO: also repulses if distance too short)
|
||||
result = 1;
|
||||
for ( j = 0; j < 5; j++ ) // 5 is just a value that ensures convergence
|
||||
@@ -1363,48 +1534,22 @@ int cloth_bvh_objcollisions_do ( ClothModifierData * clmd, CollisionModifierData
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
result += cloth_collision_moving ( clmd, collmd, collisions, collisions_index );
|
||||
|
||||
// apply impulses in parallel
|
||||
if ( result )
|
||||
{
|
||||
for ( i = 0; i < numverts; i++ )
|
||||
{
|
||||
// calculate "velocities" (just xnew = xold + v; no dt in v)
|
||||
if ( verts[i].impulse_count )
|
||||
{
|
||||
VECADDMUL ( verts[i].tv, verts[i].impulse, 1.0f / verts[i].impulse_count );
|
||||
VECCOPY ( verts[i].impulse, tnull );
|
||||
verts[i].impulse_count = 0;
|
||||
|
||||
ret++;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
if ( collisions ) MEM_freeN ( collisions );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// cloth - object collisions
|
||||
int cloth_bvh_objcollision ( ClothModifierData * clmd, float step, float dt )
|
||||
int cloth_bvh_objcollision ( Object *ob, ClothModifierData * clmd, float step, float dt )
|
||||
{
|
||||
Base *base=NULL;
|
||||
CollisionModifierData *collmd=NULL;
|
||||
Cloth *cloth=NULL;
|
||||
Object *coll_ob=NULL;
|
||||
BVHTree *cloth_bvh=NULL;
|
||||
long i=0, j = 0, k = 0, l = 0, numfaces = 0, numverts = 0;
|
||||
int result = 0, rounds = 0; // result counts applied collisions; ic is for debug output;
|
||||
long i=0, numfaces = 0, numverts = 0;
|
||||
int rounds = 0; // result counts applied collisions; ic is for debug output;
|
||||
ClothVertex *verts = NULL;
|
||||
int ret = 0, ret2 = 0;
|
||||
ClothModifierData *tclmd;
|
||||
int collisions = 0;
|
||||
CollisionModifierData **collobjs = NULL;
|
||||
int numcollobj = 0;
|
||||
|
||||
if ( ( clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_COLLOBJ ) || ! ( ( ( Cloth * ) clmd->clothObject )->bvhtree ) )
|
||||
{
|
||||
@@ -1424,54 +1569,61 @@ int cloth_bvh_objcollision ( ClothModifierData * clmd, float step, float dt )
|
||||
// update cloth bvh
|
||||
bvhtree_update_from_cloth ( clmd, 1 ); // 0 means STATIC, 1 means MOVING (see later in this function)
|
||||
bvhselftree_update_from_cloth ( clmd, 0 ); // 0 means STATIC, 1 means MOVING (see later in this function)
|
||||
|
||||
collobjs = get_collisionobjects(ob, &numcollobj);
|
||||
|
||||
if(!collobjs)
|
||||
return 0;
|
||||
|
||||
do
|
||||
{
|
||||
result = 0;
|
||||
CollPair **collisions, **collisions_index;
|
||||
|
||||
ret2 = 0;
|
||||
|
||||
collisions = MEM_callocN(sizeof(CollPair *) *numcollobj , "CollPair");
|
||||
collisions_index = MEM_callocN(sizeof(CollPair *) *numcollobj , "CollPair");
|
||||
|
||||
// check all collision objects
|
||||
for ( base = G.scene->base.first; base; base = base->next )
|
||||
for(i = 0; i < numcollobj; i++)
|
||||
{
|
||||
coll_ob = base->object;
|
||||
collmd = ( CollisionModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Collision );
|
||||
|
||||
if ( !collmd )
|
||||
CollisionModifierData *collmd = collobjs[i];
|
||||
BVHTreeOverlap *overlap = NULL;
|
||||
int result = 0;
|
||||
|
||||
/* move object to position (step) in time */
|
||||
collision_move_object ( collmd, step + dt, step );
|
||||
|
||||
/* search for overlapping collision pairs */
|
||||
overlap = BLI_bvhtree_overlap ( cloth_bvh, collmd->bvhtree, &result );
|
||||
|
||||
// go to next object if no overlap is there
|
||||
if(!result || !overlap)
|
||||
{
|
||||
if ( coll_ob->dup_group )
|
||||
{
|
||||
GroupObject *go;
|
||||
Group *group = coll_ob->dup_group;
|
||||
|
||||
for ( go= group->gobject.first; go; go= go->next )
|
||||
{
|
||||
coll_ob = go->ob;
|
||||
|
||||
collmd = ( CollisionModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Collision );
|
||||
|
||||
if ( !collmd )
|
||||
continue;
|
||||
|
||||
tclmd = ( ClothModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Cloth );
|
||||
if ( tclmd == clmd )
|
||||
continue;
|
||||
|
||||
ret += cloth_bvh_objcollisions_do ( clmd, collmd, step, dt );
|
||||
ret2 += ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tclmd = ( ClothModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Cloth );
|
||||
if ( tclmd == clmd )
|
||||
continue;
|
||||
|
||||
ret += cloth_bvh_objcollisions_do ( clmd, collmd, step, dt );
|
||||
ret2 += ret;
|
||||
if ( overlap )
|
||||
MEM_freeN ( overlap );
|
||||
continue;
|
||||
}
|
||||
|
||||
/* check if collisions really happen (costly near check) */
|
||||
cloth_bvh_objcollisions_nearcheck ( clmd, collmd, &collisions[i], &collisions_index[i], result, overlap);
|
||||
|
||||
// resolve nearby collisions
|
||||
ret += cloth_bvh_objcollisions_resolve ( clmd, collmd, collisions[i], collisions_index[i]);
|
||||
ret2 += ret;
|
||||
|
||||
if ( overlap )
|
||||
MEM_freeN ( overlap );
|
||||
}
|
||||
rounds++;
|
||||
|
||||
for(i = 0; i < numcollobj; i++)
|
||||
{
|
||||
if ( collisions[i] ) MEM_freeN ( collisions[i] );
|
||||
}
|
||||
|
||||
MEM_freeN(collisions);
|
||||
MEM_freeN(collisions_index);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// update positions
|
||||
@@ -1493,117 +1645,20 @@ int cloth_bvh_objcollision ( ClothModifierData * clmd, float step, float dt )
|
||||
}
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Test on *simple* selfcollisions
|
||||
////////////////////////////////////////////////////////////
|
||||
if ( clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_SELF )
|
||||
{
|
||||
for(l = 0; l < clmd->coll_parms->self_loop_count; l++)
|
||||
{
|
||||
// TODO: add coll quality rounds again
|
||||
BVHTreeOverlap *overlap = NULL;
|
||||
|
||||
collisions = 1;
|
||||
verts = cloth->verts; // needed for openMP
|
||||
|
||||
numfaces = clmd->clothObject->numfaces;
|
||||
numverts = clmd->clothObject->numverts;
|
||||
|
||||
verts = cloth->verts;
|
||||
|
||||
if ( cloth->bvhselftree )
|
||||
{
|
||||
// search for overlapping collision pairs
|
||||
overlap = BLI_bvhtree_overlap ( cloth->bvhselftree, cloth->bvhselftree, &result );
|
||||
|
||||
// #pragma omp parallel for private(k, i, j) schedule(static)
|
||||
for ( k = 0; k < result; k++ )
|
||||
{
|
||||
float temp[3];
|
||||
float length = 0;
|
||||
float mindistance;
|
||||
|
||||
i = overlap[k].indexA;
|
||||
j = overlap[k].indexB;
|
||||
|
||||
mindistance = clmd->coll_parms->selfepsilon* ( cloth->verts[i].avg_spring_len + cloth->verts[j].avg_spring_len );
|
||||
|
||||
if ( clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL )
|
||||
{
|
||||
if ( ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED )
|
||||
&& ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
VECSUB ( temp, verts[i].tx, verts[j].tx );
|
||||
|
||||
if ( ( ABS ( temp[0] ) > mindistance ) || ( ABS ( temp[1] ) > mindistance ) || ( ABS ( temp[2] ) > mindistance ) ) continue;
|
||||
|
||||
// check for adjacent points (i must be smaller j)
|
||||
if ( BLI_edgehash_haskey ( cloth->edgehash, MIN2(i, j), MAX2(i, j) ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
length = Normalize ( temp );
|
||||
|
||||
if ( length < mindistance )
|
||||
{
|
||||
float correction = mindistance - length;
|
||||
|
||||
if ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED )
|
||||
{
|
||||
VecMulf ( temp, -correction );
|
||||
VECADD ( verts[j].tx, verts[j].tx, temp );
|
||||
}
|
||||
else if ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED )
|
||||
{
|
||||
VecMulf ( temp, correction );
|
||||
VECADD ( verts[i].tx, verts[i].tx, temp );
|
||||
}
|
||||
else
|
||||
{
|
||||
VecMulf ( temp, -correction*0.5 );
|
||||
VECADD ( verts[j].tx, verts[j].tx, temp );
|
||||
|
||||
VECSUB ( verts[i].tx, verts[i].tx, temp );
|
||||
}
|
||||
ret = 1;
|
||||
ret2 += ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
// check for approximated time collisions
|
||||
}
|
||||
}
|
||||
|
||||
if ( overlap )
|
||||
MEM_freeN ( overlap );
|
||||
|
||||
}
|
||||
}
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// SELFCOLLISIONS: update velocities
|
||||
////////////////////////////////////////////////////////////
|
||||
if ( ret2 )
|
||||
{
|
||||
for ( i = 0; i < cloth->numverts; i++ )
|
||||
{
|
||||
if ( ! ( verts [i].flags & CLOTH_VERT_FLAG_PINNED ) )
|
||||
{
|
||||
VECSUB ( verts[i].tv, verts[i].tx, verts[i].txold );
|
||||
}
|
||||
}
|
||||
}
|
||||
////////////////////////////////////////////////////////////
|
||||
ret2 += cloth_do_selfcollisions(clmd);
|
||||
}
|
||||
////////////////////////////////////////////////////////////
|
||||
}
|
||||
while ( ret2 && ( clmd->coll_parms->loop_count>rounds ) );
|
||||
|
||||
if(collobjs)
|
||||
+ MEM_freeN(collobjs);
|
||||
|
||||
return MIN2 ( ret, 1 );
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "BLI_blenlib.h"
|
||||
#include "BLI_linklist.h"
|
||||
#include "BLI_mempool.h"
|
||||
|
||||
#include "DNA_customdata_types.h"
|
||||
#include "DNA_listBase.h"
|
||||
@@ -359,8 +360,80 @@ static void layerDefault_origspace_face(void *data, int count)
|
||||
}
|
||||
/* --------- */
|
||||
|
||||
static void layerDefault_mloopcol(void *data, int count)
|
||||
{
|
||||
static MLoopCol default_mloopcol = {255,255,255,255};
|
||||
MLoopCol *mlcol = (MLoopCol*)data;
|
||||
int i;
|
||||
for(i = 0; i < count; i++)
|
||||
mlcol[i] = default_mloopcol;
|
||||
|
||||
}
|
||||
|
||||
static void layerInterp_mloopcol(void **sources, float *weights,
|
||||
float *sub_weights, int count, void *dest)
|
||||
{
|
||||
MLoopCol *mc = dest;
|
||||
int i;
|
||||
float *sub_weight;
|
||||
struct {
|
||||
float a;
|
||||
float r;
|
||||
float g;
|
||||
float b;
|
||||
} col;
|
||||
col.a = col.r = col.g = col.b = 0;
|
||||
|
||||
sub_weight = sub_weights;
|
||||
for(i = 0; i < count; ++i){
|
||||
float weight = weights ? weights[i] : 1;
|
||||
MLoopCol *src = sources[i];
|
||||
if(sub_weights){
|
||||
col.a += src->a * (*sub_weight) * weight;
|
||||
col.r += src->r * (*sub_weight) * weight;
|
||||
col.g += src->g * (*sub_weight) * weight;
|
||||
col.b += src->b * (*sub_weight) * weight;
|
||||
sub_weight++;
|
||||
} else {
|
||||
col.a += src->a * weight;
|
||||
col.r += src->r * weight;
|
||||
col.g += src->g * weight;
|
||||
col.b += src->b * weight;
|
||||
}
|
||||
}
|
||||
mc->a = (int)col.a;
|
||||
mc->r = (int)col.r;
|
||||
mc->g = (int)col.g;
|
||||
mc->b = (int)col.b;
|
||||
}
|
||||
static void layerInterp_mloopuv(void **sources, float *weights,
|
||||
float *sub_weights, int count, void *dest)
|
||||
{
|
||||
MLoopUV *mluv = dest;
|
||||
int i;
|
||||
float *sub_weight;
|
||||
struct {
|
||||
float u;
|
||||
float v;
|
||||
}uv;
|
||||
uv.u = uv.v = 0.0;
|
||||
|
||||
sub_weight = sub_weights;
|
||||
for(i = 0; i < count; ++i){
|
||||
float weight = weights ? weights[i] : 1;
|
||||
MLoopUV *src = sources[i];
|
||||
if(sub_weights){
|
||||
uv.u += src->uv[0] * (*sub_weight) * weight;
|
||||
uv.v += src->uv[1] * (*sub_weight) * weight;
|
||||
sub_weight++;
|
||||
} else {
|
||||
uv.u += src->uv[0] * weight;
|
||||
uv.v += src->uv[1] * weight;
|
||||
}
|
||||
}
|
||||
mluv->uv[0] = uv.u;
|
||||
mluv->uv[1] = uv.v;
|
||||
}
|
||||
|
||||
static void layerInterp_mcol(void **sources, float *weights,
|
||||
float *sub_weights, int count, void *dest)
|
||||
@@ -432,6 +505,8 @@ static void layerDefault_mcol(void *data, int count)
|
||||
mcol[i] = default_mcol;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
|
||||
{sizeof(MVert), "MVert", 1, NULL, NULL, NULL, NULL, NULL, NULL},
|
||||
{sizeof(MSticky), "MSticky", 1, NULL, NULL, NULL, layerInterp_msticky, NULL,
|
||||
@@ -454,13 +529,16 @@ const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
|
||||
{sizeof(MStringProperty), "MStringProperty",1,"String",NULL,NULL,NULL,NULL},
|
||||
{sizeof(OrigSpaceFace), "OrigSpaceFace", 1, "UVTex", layerCopy_origspace_face, NULL,
|
||||
layerInterp_origspace_face, layerSwap_origspace_face, layerDefault_origspace_face},
|
||||
{sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL}
|
||||
{sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
|
||||
{sizeof(MTexPoly), "MTexPoly", 1, "Face Texture", NULL, NULL, NULL, NULL, NULL},
|
||||
{sizeof(MLoopUV), "MLoopUV", 1, "UV coord", NULL, NULL, layerInterp_mloopuv, NULL, NULL},
|
||||
{sizeof(MLoopCol), "MLoopCol", 1, "Col", NULL, NULL, layerInterp_mloopcol, NULL, layerDefault_mloopcol}
|
||||
};
|
||||
|
||||
const char *LAYERTYPENAMES[CD_NUMTYPES] = {
|
||||
"CDMVert", "CDMSticky", "CDMDeformVert", "CDMEdge", "CDMFace", "CDMTFace",
|
||||
"CDMCol", "CDOrigIndex", "CDNormal", "CDFlags","CDMFloatProperty",
|
||||
"CDMIntProperty","CDMStringProperty", "CDOrigSpace", "CDOrco"};
|
||||
"CDMIntProperty","CDMStringProperty", "CDOrigSpace", "CDOrco", "CDMTexPoly", "CDMLoopUV", "CDMloopCol"};
|
||||
|
||||
const CustomDataMask CD_MASK_BAREMESH =
|
||||
CD_MASK_MVERT | CD_MASK_MEDGE | CD_MASK_MFACE;
|
||||
@@ -475,6 +553,12 @@ const CustomDataMask CD_MASK_DERIVEDMESH =
|
||||
CD_MASK_MSTICKY | CD_MASK_MDEFORMVERT | CD_MASK_MTFACE |
|
||||
CD_MASK_MCOL | CD_MASK_ORIGINDEX | CD_MASK_PROP_FLT | CD_MASK_PROP_INT |
|
||||
CD_MASK_PROP_STR | CD_MASK_ORIGSPACE | CD_MASK_ORCO;
|
||||
const CustomDataMask CD_MASK_BMESH =
|
||||
CD_MASK_MSTICKY | CD_MASK_MDEFORMVERT | CD_MASK_PROP_FLT | CD_MASK_PROP_INT | CD_MASK_PROP_STR;
|
||||
const CustomDataMask CD_MASK_FACECORNERS =
|
||||
CD_MASK_MTFACE | CD_MASK_MCOL | CD_MASK_MTEXPOLY | CD_MASK_MLOOPUV |
|
||||
CD_MASK_MLOOPCOL;
|
||||
|
||||
|
||||
static const LayerTypeInfo *layerType_getInfo(int type)
|
||||
{
|
||||
@@ -1449,6 +1533,302 @@ void CustomData_from_em_block(const CustomData *source, CustomData *dest,
|
||||
|
||||
}
|
||||
|
||||
/*Bmesh functions*/
|
||||
/*needed to convert to/from different face reps*/
|
||||
void CustomData_to_bmeshpoly(CustomData *fdata, CustomData *pdata, CustomData *ldata)
|
||||
{
|
||||
int i;
|
||||
for(i=0; i < fdata->totlayer; i++){
|
||||
if(fdata->layers[i].type == CD_MTFACE){
|
||||
CustomData_add_layer(pdata, CD_MTEXPOLY, CD_CALLOC, &(fdata->layers[i].name), 0);
|
||||
CustomData_add_layer(ldata, CD_MLOOPUV, CD_CALLOC, &(fdata->layers[i].name), 0);
|
||||
}
|
||||
else if(fdata->layers[i].type == CD_MCOL)
|
||||
CustomData_add_layer(ldata, CD_MLOOPCOL, CD_CALLOC, &(fdata->layers[i].name), 0);
|
||||
}
|
||||
}
|
||||
void CustomData_from_bmeshpoly(CustomData *fdata, CustomData *pdata, CustomData *ldata, int total){
|
||||
int i;
|
||||
for(i=0; i < pdata->totlayer; i++){
|
||||
if(pdata->layers[i].type == CD_MTEXPOLY)
|
||||
CustomData_add_layer(fdata, CD_MTFACE, CD_CALLOC, &(pdata->layers[i].name), total);
|
||||
}
|
||||
for(i=0; i < ldata->totlayer; i++){
|
||||
if(ldata->layers[i].type == CD_MLOOPCOL)
|
||||
CustomData_add_layer(fdata, CD_MCOL, CD_CALLOC, &(ldata->layers[i].name), total);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CustomData_bmesh_init_pool(CustomData *data, int allocsize){
|
||||
if(data->totlayer)data->pool = BLI_mempool_create(data->totsize, allocsize, allocsize);
|
||||
}
|
||||
|
||||
void CustomData_bmesh_free_block(CustomData *data, void **block)
|
||||
{
|
||||
const LayerTypeInfo *typeInfo;
|
||||
int i;
|
||||
|
||||
if(!*block) return;
|
||||
for(i = 0; i < data->totlayer; ++i) {
|
||||
if(!(data->layers[i].flag & CD_FLAG_NOFREE)) {
|
||||
typeInfo = layerType_getInfo(data->layers[i].type);
|
||||
|
||||
if(typeInfo->free) {
|
||||
int offset = data->layers[i].offset;
|
||||
typeInfo->free((char*)*block + offset, 1, typeInfo->size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BLI_mempool_free(data->pool, *block);
|
||||
*block = NULL;
|
||||
}
|
||||
|
||||
static void CustomData_bmesh_alloc_block(CustomData *data, void **block)
|
||||
{
|
||||
|
||||
if (*block)
|
||||
CustomData_bmesh_free_block(data, block);
|
||||
|
||||
if (data->totsize > 0)
|
||||
*block = BLI_mempool_calloc(data->pool);
|
||||
else
|
||||
*block = NULL;
|
||||
}
|
||||
|
||||
void CustomData_bmesh_copy_data(const CustomData *source, CustomData *dest,
|
||||
void *src_block, void **dest_block)
|
||||
{
|
||||
const LayerTypeInfo *typeInfo;
|
||||
int dest_i, src_i;
|
||||
|
||||
if (!*dest_block)
|
||||
CustomData_bmesh_alloc_block(dest, dest_block);
|
||||
|
||||
/* copies a layer at a time */
|
||||
dest_i = 0;
|
||||
for(src_i = 0; src_i < source->totlayer; ++src_i) {
|
||||
|
||||
/* find the first dest layer with type >= the source type
|
||||
* (this should work because layers are ordered by type)
|
||||
*/
|
||||
while(dest_i < dest->totlayer
|
||||
&& dest->layers[dest_i].type < source->layers[src_i].type)
|
||||
++dest_i;
|
||||
|
||||
/* if there are no more dest layers, we're done */
|
||||
if(dest_i >= dest->totlayer) return;
|
||||
|
||||
/* if we found a matching layer, copy the data */
|
||||
if(dest->layers[dest_i].type == source->layers[src_i].type &&
|
||||
strcmp(dest->layers[dest_i].name, source->layers[src_i].name) == 0) {
|
||||
char *src_data = (char*)src_block + source->layers[src_i].offset;
|
||||
char *dest_data = (char*)*dest_block + dest->layers[dest_i].offset;
|
||||
|
||||
typeInfo = layerType_getInfo(source->layers[src_i].type);
|
||||
|
||||
if(typeInfo->copy)
|
||||
typeInfo->copy(src_data, dest_data, 1);
|
||||
else
|
||||
memcpy(dest_data, src_data, typeInfo->size);
|
||||
|
||||
/* if there are multiple source & dest layers of the same type,
|
||||
* we don't want to copy all source layers to the same dest, so
|
||||
* increment dest_i
|
||||
*/
|
||||
++dest_i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*Bmesh Custom Data Functions. Should replace editmesh ones with these as well, due to more effecient memory alloc*/
|
||||
void *CustomData_bmesh_get(const CustomData *data, void *block, int type)
|
||||
{
|
||||
int layer_index;
|
||||
|
||||
/* get the layer index of the first layer of type */
|
||||
layer_index = CustomData_get_active_layer_index(data, type);
|
||||
if(layer_index < 0) return NULL;
|
||||
|
||||
return (char *)block + data->layers[layer_index].offset;
|
||||
}
|
||||
|
||||
void *CustomData_bmesh_get_n(const CustomData *data, void *block, int type, int n)
|
||||
{
|
||||
int layer_index;
|
||||
|
||||
/* get the layer index of the first layer of type */
|
||||
layer_index = CustomData_get_layer_index(data, type);
|
||||
if(layer_index < 0) return NULL;
|
||||
|
||||
return (char *)block + data->layers[layer_index+n].offset;
|
||||
}
|
||||
|
||||
void CustomData_bmesh_set(const CustomData *data, void *block, int type, void *source)
|
||||
{
|
||||
void *dest = CustomData_bmesh_get(data, block, type);
|
||||
const LayerTypeInfo *typeInfo = layerType_getInfo(type);
|
||||
|
||||
if(!dest) return;
|
||||
|
||||
if(typeInfo->copy)
|
||||
typeInfo->copy(source, dest, 1);
|
||||
else
|
||||
memcpy(dest, source, typeInfo->size);
|
||||
}
|
||||
|
||||
void CustomData_bmesh_set_n(CustomData *data, void *block, int type, int n, void *source)
|
||||
{
|
||||
void *dest = CustomData_bmesh_get_n(data, block, type, n);
|
||||
const LayerTypeInfo *typeInfo = layerType_getInfo(type);
|
||||
|
||||
if(!dest) return;
|
||||
|
||||
if(typeInfo->copy)
|
||||
typeInfo->copy(source, dest, 1);
|
||||
else
|
||||
memcpy(dest, source, typeInfo->size);
|
||||
}
|
||||
|
||||
void CustomData_bmesh_interp(CustomData *data, void **src_blocks, float *weights,
|
||||
float *sub_weights, int count, void *dest_block)
|
||||
{
|
||||
int i, j;
|
||||
void *source_buf[SOURCE_BUF_SIZE];
|
||||
void **sources = source_buf;
|
||||
|
||||
/* slow fallback in case we're interpolating a ridiculous number of
|
||||
* elements
|
||||
*/
|
||||
if(count > SOURCE_BUF_SIZE)
|
||||
sources = MEM_callocN(sizeof(*sources) * count,
|
||||
"CustomData_interp sources");
|
||||
|
||||
/* interpolates a layer at a time */
|
||||
for(i = 0; i < data->totlayer; ++i) {
|
||||
CustomDataLayer *layer = &data->layers[i];
|
||||
const LayerTypeInfo *typeInfo = layerType_getInfo(layer->type);
|
||||
if(typeInfo->interp) {
|
||||
for(j = 0; j < count; ++j)
|
||||
sources[j] = (char *)src_blocks[j] + layer->offset;
|
||||
|
||||
typeInfo->interp(sources, weights, sub_weights, count,
|
||||
(char *)dest_block + layer->offset);
|
||||
}
|
||||
}
|
||||
|
||||
if(count > SOURCE_BUF_SIZE) MEM_freeN(sources);
|
||||
}
|
||||
|
||||
void CustomData_bmesh_set_default(CustomData *data, void **block)
|
||||
{
|
||||
const LayerTypeInfo *typeInfo;
|
||||
int i;
|
||||
|
||||
if (!*block)
|
||||
CustomData_bmesh_alloc_block(data, block);
|
||||
|
||||
for(i = 0; i < data->totlayer; ++i) {
|
||||
int offset = data->layers[i].offset;
|
||||
|
||||
typeInfo = layerType_getInfo(data->layers[i].type);
|
||||
|
||||
if(typeInfo->set_default)
|
||||
typeInfo->set_default((char*)*block + offset, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void CustomData_to_bmesh_block(const CustomData *source, CustomData *dest,
|
||||
int src_index, void **dest_block)
|
||||
{
|
||||
const LayerTypeInfo *typeInfo;
|
||||
int dest_i, src_i, src_offset;
|
||||
|
||||
if (!*dest_block)
|
||||
CustomData_bmesh_alloc_block(dest, dest_block);
|
||||
|
||||
/* copies a layer at a time */
|
||||
dest_i = 0;
|
||||
for(src_i = 0; src_i < source->totlayer; ++src_i) {
|
||||
|
||||
/* find the first dest layer with type >= the source type
|
||||
* (this should work because layers are ordered by type)
|
||||
*/
|
||||
while(dest_i < dest->totlayer
|
||||
&& dest->layers[dest_i].type < source->layers[src_i].type)
|
||||
++dest_i;
|
||||
|
||||
/* if there are no more dest layers, we're done */
|
||||
if(dest_i >= dest->totlayer) return;
|
||||
|
||||
/* if we found a matching layer, copy the data */
|
||||
if(dest->layers[dest_i].type == source->layers[src_i].type) {
|
||||
int offset = dest->layers[dest_i].offset;
|
||||
char *src_data = source->layers[src_i].data;
|
||||
char *dest_data = (char*)*dest_block + offset;
|
||||
|
||||
typeInfo = layerType_getInfo(dest->layers[dest_i].type);
|
||||
src_offset = src_index * typeInfo->size;
|
||||
|
||||
if(typeInfo->copy)
|
||||
typeInfo->copy(src_data + src_offset, dest_data, 1);
|
||||
else
|
||||
memcpy(dest_data, src_data + src_offset, typeInfo->size);
|
||||
|
||||
/* if there are multiple source & dest layers of the same type,
|
||||
* we don't want to copy all source layers to the same dest, so
|
||||
* increment dest_i
|
||||
*/
|
||||
++dest_i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CustomData_from_bmesh_block(const CustomData *source, CustomData *dest,
|
||||
void *src_block, int dest_index)
|
||||
{
|
||||
const LayerTypeInfo *typeInfo;
|
||||
int dest_i, src_i, dest_offset;
|
||||
|
||||
/* copies a layer at a time */
|
||||
dest_i = 0;
|
||||
for(src_i = 0; src_i < source->totlayer; ++src_i) {
|
||||
|
||||
/* find the first dest layer with type >= the source type
|
||||
* (this should work because layers are ordered by type)
|
||||
*/
|
||||
while(dest_i < dest->totlayer
|
||||
&& dest->layers[dest_i].type < source->layers[src_i].type)
|
||||
++dest_i;
|
||||
|
||||
/* if there are no more dest layers, we're done */
|
||||
if(dest_i >= dest->totlayer) return;
|
||||
|
||||
/* if we found a matching layer, copy the data */
|
||||
if(dest->layers[dest_i].type == source->layers[src_i].type) {
|
||||
int offset = source->layers[src_i].offset;
|
||||
char *src_data = (char*)src_block + offset;
|
||||
char *dest_data = dest->layers[dest_i].data;
|
||||
|
||||
typeInfo = layerType_getInfo(dest->layers[dest_i].type);
|
||||
dest_offset = dest_index * typeInfo->size;
|
||||
|
||||
if(typeInfo->copy)
|
||||
typeInfo->copy(src_data, dest_data + dest_offset, 1);
|
||||
else
|
||||
memcpy(dest_data + dest_offset, src_data, typeInfo->size);
|
||||
|
||||
/* if there are multiple source & dest layers of the same type,
|
||||
* we don't want to copy all source layers to the same dest, so
|
||||
* increment dest_i
|
||||
*/
|
||||
++dest_i;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CustomData_file_write_info(int type, char **structname, int *structnum)
|
||||
{
|
||||
const LayerTypeInfo *typeInfo = layerType_getInfo(type);
|
||||
|
||||
@@ -848,17 +848,13 @@ void BKE_add_image_extension(char *string, int imtype)
|
||||
if(!BLI_testextensie(string, ".tga"))
|
||||
extension= ".tga";
|
||||
}
|
||||
else if(ELEM5(imtype, R_MOVIE, R_AVICODEC, R_AVIRAW, R_AVIJPEG, R_JPEG90)) {
|
||||
if(!( BLI_testextensie(string, ".jpg") || BLI_testextensie(string, ".jpeg")))
|
||||
extension= ".jpg";
|
||||
}
|
||||
else if(imtype==R_BMP) {
|
||||
if(!BLI_testextensie(string, ".bmp"))
|
||||
extension= ".bmp";
|
||||
}
|
||||
else if(G.have_libtiff && (imtype==R_TIFF)) {
|
||||
if(!BLI_testextensie(string, ".tif"))
|
||||
extension= ".tif";
|
||||
if(!BLI_testextensie(string, ".tif") &&
|
||||
!BLI_testextensie(string, ".tiff")) extension= ".tif";
|
||||
}
|
||||
#ifdef WITH_OPENEXR
|
||||
else if( ELEM(imtype, R_OPENEXR, R_MULTILAYER)) {
|
||||
@@ -874,10 +870,14 @@ void BKE_add_image_extension(char *string, int imtype)
|
||||
if (!BLI_testextensie(string, ".dpx"))
|
||||
extension= ".dpx";
|
||||
}
|
||||
else { /* targa default */
|
||||
else if(imtype==R_TARGA) {
|
||||
if(!BLI_testextensie(string, ".tga"))
|
||||
extension= ".tga";
|
||||
}
|
||||
else { // R_MOVIE, R_AVICODEC, R_AVIRAW, R_AVIJPEG, R_JPEG90, R_QUICKTIME etc
|
||||
if(!( BLI_testextensie(string, ".jpg") || BLI_testextensie(string, ".jpeg")))
|
||||
extension= ".jpg";
|
||||
}
|
||||
|
||||
strcat(string, extension);
|
||||
}
|
||||
@@ -1512,6 +1512,10 @@ static ImBuf *image_load_sequence_file(Image *ima, ImageUser *iuser, int frame)
|
||||
image_initialize_after_load(ima, ibuf);
|
||||
image_assign_ibuf(ima, ibuf, 0, frame);
|
||||
#endif
|
||||
|
||||
if(ima->flag & IMA_DO_PREMUL)
|
||||
converttopremul(ibuf);
|
||||
|
||||
}
|
||||
else
|
||||
ima->ok= 0;
|
||||
|
||||
@@ -1588,10 +1588,17 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
|
||||
VECSUB(verts[i].tv, verts[i].tx, verts[i].txold);
|
||||
VECCOPY(verts[i].v, verts[i].tv);
|
||||
}
|
||||
|
||||
|
||||
// call collision function
|
||||
result = cloth_bvh_objcollision(clmd, step + dt, dt);
|
||||
|
||||
// TODO: check if "step" or "step+dt" is correct - dg
|
||||
result = cloth_bvh_objcollision(ob, clmd, step, dt);
|
||||
|
||||
// correct velocity again, just to be sure we had to change it due to adaptive collisions
|
||||
for(i = 0; i < numverts; i++)
|
||||
{
|
||||
VECSUB(verts[i].tv, verts[i].tx, id->X[i]);
|
||||
}
|
||||
|
||||
// copy corrected positions back to simulation
|
||||
for(i = 0; i < numverts; i++)
|
||||
{
|
||||
|
||||
@@ -1859,7 +1859,7 @@ void set_icu_vars(IpoCurve *icu)
|
||||
/* yafray: aperture & focal distance params */
|
||||
switch(icu->adrcode) {
|
||||
case CAM_LENS:
|
||||
icu->ymin= 5.0;
|
||||
icu->ymin= 1.0;
|
||||
icu->ymax= 1000.0;
|
||||
break;
|
||||
case CAM_STA:
|
||||
|
||||
@@ -630,7 +630,7 @@ void cp_cu_key(Curve *cu, KeyBlock *kb, int start, int end)
|
||||
}
|
||||
|
||||
|
||||
static void do_rel_key(int start, int end, int tot, char *basispoin, Key *key, int mode)
|
||||
void do_rel_key(int start, int end, int tot, char *basispoin, Key *key, int mode)
|
||||
{
|
||||
KeyBlock *kb;
|
||||
int *ofsp, ofs[3], elemsize, b;
|
||||
|
||||
@@ -224,48 +224,50 @@ void flag_all_listbases_ids(short flag, short value)
|
||||
/* note: MAX_LIBARRAY define should match this code */
|
||||
int set_listbasepointers(Main *main, ListBase **lb)
|
||||
{
|
||||
int a = 0;
|
||||
|
||||
/* BACKWARDS! also watch order of free-ing! (mesh<->mat) */
|
||||
|
||||
lb[0]= &(main->ipo);
|
||||
lb[1]= &(main->key);
|
||||
lb[2]= &(main->image);
|
||||
lb[3]= &(main->tex);
|
||||
lb[4]= &(main->mat);
|
||||
lb[5]= &(main->vfont);
|
||||
lb[a++]= &(main->ipo);
|
||||
lb[a++]= &(main->key);
|
||||
lb[a++]= &(main->nodetree);
|
||||
lb[a++]= &(main->image);
|
||||
lb[a++]= &(main->tex);
|
||||
lb[a++]= &(main->mat);
|
||||
lb[a++]= &(main->vfont);
|
||||
|
||||
/* Important!: When adding a new object type,
|
||||
* the specific data should be inserted here
|
||||
*/
|
||||
|
||||
lb[6]= &(main->armature);
|
||||
lb[7]= &(main->action);
|
||||
lb[a++]= &(main->armature);
|
||||
lb[a++]= &(main->action);
|
||||
|
||||
lb[8]= &(main->mesh);
|
||||
lb[9]= &(main->curve);
|
||||
lb[10]= &(main->mball);
|
||||
lb[a++]= &(main->mesh);
|
||||
lb[a++]= &(main->curve);
|
||||
lb[a++]= &(main->mball);
|
||||
|
||||
lb[11]= &(main->wave);
|
||||
lb[12]= &(main->latt);
|
||||
lb[13]= &(main->lamp);
|
||||
lb[14]= &(main->camera);
|
||||
lb[a++]= &(main->wave);
|
||||
lb[a++]= &(main->latt);
|
||||
lb[a++]= &(main->lamp);
|
||||
lb[a++]= &(main->camera);
|
||||
|
||||
lb[15]= &(main->text);
|
||||
lb[16]= &(main->sound);
|
||||
lb[17]= &(main->group);
|
||||
lb[18]= &(main->nodetree);
|
||||
lb[19]= &(main->brush);
|
||||
lb[20]= &(main->script);
|
||||
lb[21]= &(main->particle);
|
||||
lb[a++]= &(main->text);
|
||||
lb[a++]= &(main->sound);
|
||||
lb[a++]= &(main->group);
|
||||
lb[a++]= &(main->brush);
|
||||
lb[a++]= &(main->script);
|
||||
lb[a++]= &(main->particle);
|
||||
|
||||
lb[22]= &(main->world);
|
||||
lb[23]= &(main->screen);
|
||||
lb[24]= &(main->object);
|
||||
lb[25]= &(main->scene);
|
||||
lb[26]= &(main->library);
|
||||
lb[a++]= &(main->world);
|
||||
lb[a++]= &(main->screen);
|
||||
lb[a++]= &(main->object);
|
||||
lb[a++]= &(main->scene);
|
||||
lb[a++]= &(main->library);
|
||||
|
||||
lb[27]= NULL;
|
||||
lb[a]= NULL;
|
||||
|
||||
return 27;
|
||||
return a;
|
||||
}
|
||||
|
||||
/* *********** ALLOC AND FREE *****************
|
||||
@@ -934,7 +936,7 @@ int new_id(ListBase *lb, ID *id, const char *tname)
|
||||
}
|
||||
|
||||
/* if result > 21, strncpy don't put the final '\0' to name. */
|
||||
if( result > 21 ) name[21]= 0;
|
||||
if( result >= 21 ) name[21]= 0;
|
||||
|
||||
result = check_for_dupid( lb, id, name );
|
||||
strcpy( id->name+2, name );
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "stdarg.h"
|
||||
#include "math.h"
|
||||
#include "float.h"
|
||||
#include "ctype.h"
|
||||
|
||||
#include "BLI_arithb.h"
|
||||
#include "BLI_blenlib.h"
|
||||
@@ -1269,7 +1270,7 @@ static void mirrorModifier_initData(ModifierData *md)
|
||||
{
|
||||
MirrorModifierData *mmd = (MirrorModifierData*) md;
|
||||
|
||||
mmd->flag |= MOD_MIR_AXIS_X;
|
||||
mmd->flag |= (MOD_MIR_AXIS_X | MOD_MIR_VGROUP);
|
||||
mmd->tolerance = 0.001;
|
||||
mmd->mirror_ob = NULL;
|
||||
}
|
||||
@@ -1308,11 +1309,123 @@ static void mirrorModifier_updateDepgraph(ModifierData *md, DagForest *forest,
|
||||
}
|
||||
}
|
||||
|
||||
/* finds the best possible flipped name. For renaming; check for unique names afterwards */
|
||||
/* if strip_number: removes number extensions */
|
||||
void vertgroup_flip_name (char *name, int strip_number)
|
||||
{
|
||||
int len;
|
||||
char prefix[128]={""}; /* The part before the facing */
|
||||
char suffix[128]={""}; /* The part after the facing */
|
||||
char replace[128]={""}; /* The replacement string */
|
||||
char number[128]={""}; /* The number extension string */
|
||||
char *index=NULL;
|
||||
|
||||
len= strlen(name);
|
||||
if(len<3) return; // we don't do names like .R or .L
|
||||
|
||||
/* We first check the case with a .### extension, let's find the last period */
|
||||
if(isdigit(name[len-1])) {
|
||||
index= strrchr(name, '.'); // last occurrance
|
||||
if (index && isdigit(index[1]) ) { // doesnt handle case bone.1abc2 correct..., whatever!
|
||||
if(strip_number==0)
|
||||
strcpy(number, index);
|
||||
*index= 0;
|
||||
len= strlen(name);
|
||||
}
|
||||
}
|
||||
|
||||
strcpy (prefix, name);
|
||||
|
||||
#define IS_SEPARATOR(a) ((a)=='.' || (a)==' ' || (a)=='-' || (a)=='_')
|
||||
|
||||
/* first case; separator . - _ with extensions r R l L */
|
||||
if( IS_SEPARATOR(name[len-2]) ) {
|
||||
switch(name[len-1]) {
|
||||
case 'l':
|
||||
prefix[len-1]= 0;
|
||||
strcpy(replace, "r");
|
||||
break;
|
||||
case 'r':
|
||||
prefix[len-1]= 0;
|
||||
strcpy(replace, "l");
|
||||
break;
|
||||
case 'L':
|
||||
prefix[len-1]= 0;
|
||||
strcpy(replace, "R");
|
||||
break;
|
||||
case 'R':
|
||||
prefix[len-1]= 0;
|
||||
strcpy(replace, "L");
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* case; beginning with r R l L , with separator after it */
|
||||
else if( IS_SEPARATOR(name[1]) ) {
|
||||
switch(name[0]) {
|
||||
case 'l':
|
||||
strcpy(replace, "r");
|
||||
strcpy(suffix, name+1);
|
||||
prefix[0]= 0;
|
||||
break;
|
||||
case 'r':
|
||||
strcpy(replace, "l");
|
||||
strcpy(suffix, name+1);
|
||||
prefix[0]= 0;
|
||||
break;
|
||||
case 'L':
|
||||
strcpy(replace, "R");
|
||||
strcpy(suffix, name+1);
|
||||
prefix[0]= 0;
|
||||
break;
|
||||
case 'R':
|
||||
strcpy(replace, "L");
|
||||
strcpy(suffix, name+1);
|
||||
prefix[0]= 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if(len > 5) {
|
||||
/* hrms, why test for a separator? lets do the rule 'ultimate left or right' */
|
||||
index = BLI_strcasestr(prefix, "right");
|
||||
if (index==prefix || index==prefix+len-5) {
|
||||
if(index[0]=='r')
|
||||
strcpy (replace, "left");
|
||||
else {
|
||||
if(index[1]=='I')
|
||||
strcpy (replace, "LEFT");
|
||||
else
|
||||
strcpy (replace, "Left");
|
||||
}
|
||||
*index= 0;
|
||||
strcpy (suffix, index+5);
|
||||
}
|
||||
else {
|
||||
index = BLI_strcasestr(prefix, "left");
|
||||
if (index==prefix || index==prefix+len-4) {
|
||||
if(index[0]=='l')
|
||||
strcpy (replace, "right");
|
||||
else {
|
||||
if(index[1]=='E')
|
||||
strcpy (replace, "RIGHT");
|
||||
else
|
||||
strcpy (replace, "Right");
|
||||
}
|
||||
*index= 0;
|
||||
strcpy (suffix, index+4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#undef IS_SEPARATOR
|
||||
|
||||
sprintf (name, "%s%s%s%s", prefix, replace, suffix, number);
|
||||
}
|
||||
|
||||
static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
|
||||
Object *ob,
|
||||
DerivedMesh *dm,
|
||||
int initFlags,
|
||||
int axis)
|
||||
Object *ob,
|
||||
DerivedMesh *dm,
|
||||
int initFlags,
|
||||
int axis)
|
||||
{
|
||||
int i;
|
||||
float tolerance = mmd->tolerance;
|
||||
@@ -1321,6 +1434,9 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
|
||||
int maxVerts = dm->getNumVerts(dm);
|
||||
int maxEdges = dm->getNumEdges(dm);
|
||||
int maxFaces = dm->getNumFaces(dm);
|
||||
int vector_size=0, j, a, b;
|
||||
bDeformGroup *def, *defb;
|
||||
bDeformGroup **vector_def = NULL;
|
||||
int (*indexMap)[2];
|
||||
float mtx[4][4], imtx[4][4];
|
||||
|
||||
@@ -1330,9 +1446,24 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
|
||||
|
||||
result = CDDM_from_template(dm, maxVerts * 2, maxEdges * 2, maxFaces * 2);
|
||||
|
||||
|
||||
if (mmd->flag & MOD_MIR_VGROUP) {
|
||||
/* calculate the number of deformedGroups */
|
||||
for(vector_size = 0, def = ob->defbase.first; def;
|
||||
def = def->next, vector_size++);
|
||||
|
||||
/* load the deformedGroups for fast access */
|
||||
vector_def =
|
||||
(bDeformGroup **)MEM_mallocN(sizeof(bDeformGroup*) * vector_size,
|
||||
"group_index");
|
||||
for(a = 0, def = ob->defbase.first; def; def = def->next, a++) {
|
||||
vector_def[a] = def;
|
||||
}
|
||||
}
|
||||
|
||||
if (mmd->mirror_ob) {
|
||||
float obinv[4][4];
|
||||
|
||||
|
||||
Mat4Invert(obinv, mmd->mirror_ob->obmat);
|
||||
Mat4MulMat4(mtx, ob->obmat, obinv);
|
||||
Mat4Invert(imtx, mtx);
|
||||
@@ -1343,16 +1474,16 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
|
||||
MVert *mv = CDDM_get_vert(result, numVerts);
|
||||
int isShared;
|
||||
float co[3];
|
||||
|
||||
|
||||
dm->getVert(dm, i, &inMV);
|
||||
|
||||
|
||||
VecCopyf(co, inMV.co);
|
||||
|
||||
|
||||
if (mmd->mirror_ob) {
|
||||
VecMat4MulVecfl(co, mtx, co);
|
||||
}
|
||||
isShared = ABS(co[axis])<=tolerance;
|
||||
|
||||
|
||||
/* Because the topology result (# of vertices) must be the same if
|
||||
* the mesh data is overridden by vertex cos, have to calc sharedness
|
||||
* based on original coordinates. This is why we test before copy.
|
||||
@@ -1360,10 +1491,10 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
|
||||
DM_copy_vert_data(dm, result, i, numVerts, 1);
|
||||
*mv = inMV;
|
||||
numVerts++;
|
||||
|
||||
|
||||
indexMap[i][0] = numVerts - 1;
|
||||
indexMap[i][1] = !isShared;
|
||||
|
||||
|
||||
if(isShared) {
|
||||
co[axis] = 0;
|
||||
if (mmd->mirror_ob) {
|
||||
@@ -1374,41 +1505,73 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
|
||||
mv->flag |= ME_VERT_MERGED;
|
||||
} else {
|
||||
MVert *mv2 = CDDM_get_vert(result, numVerts);
|
||||
|
||||
MDeformVert *dvert = NULL;
|
||||
|
||||
DM_copy_vert_data(dm, result, i, numVerts, 1);
|
||||
*mv2 = *mv;
|
||||
numVerts++;
|
||||
|
||||
|
||||
co[axis] = -co[axis];
|
||||
if (mmd->mirror_ob) {
|
||||
VecMat4MulVecfl(co, imtx, co);
|
||||
}
|
||||
VecCopyf(mv2->co, co);
|
||||
|
||||
if (mmd->flag & MOD_MIR_VGROUP){
|
||||
dvert = DM_get_vert_data(result, numVerts, CD_MDEFORMVERT);
|
||||
|
||||
if (dvert)
|
||||
{
|
||||
for(j = 0; j < dvert[0].totweight; ++j)
|
||||
{
|
||||
char tmpname[32];
|
||||
|
||||
if(dvert->dw[j].def_nr < 0 ||
|
||||
dvert->dw[j].def_nr >= vector_size)
|
||||
continue;
|
||||
|
||||
def = vector_def[dvert->dw[j].def_nr];
|
||||
strcpy(tmpname, def->name);
|
||||
vertgroup_flip_name(tmpname,0);
|
||||
|
||||
for(b = 0, defb = ob->defbase.first; defb;
|
||||
defb = defb->next, b++)
|
||||
{
|
||||
if(!strcmp(defb->name, tmpname))
|
||||
{
|
||||
dvert->dw[j].def_nr = b;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
numVerts++;
|
||||
}
|
||||
}
|
||||
|
||||
for(i = 0; i < maxEdges; i++) {
|
||||
MEdge inMED;
|
||||
MEdge *med = CDDM_get_edge(result, numEdges);
|
||||
|
||||
|
||||
dm->getEdge(dm, i, &inMED);
|
||||
|
||||
|
||||
DM_copy_edge_data(dm, result, i, numEdges, 1);
|
||||
*med = inMED;
|
||||
numEdges++;
|
||||
|
||||
|
||||
med->v1 = indexMap[inMED.v1][0];
|
||||
med->v2 = indexMap[inMED.v2][0];
|
||||
if(initFlags)
|
||||
med->flag |= ME_EDGEDRAW | ME_EDGERENDER;
|
||||
|
||||
|
||||
if(indexMap[inMED.v1][1] || indexMap[inMED.v2][1]) {
|
||||
MEdge *med2 = CDDM_get_edge(result, numEdges);
|
||||
|
||||
|
||||
DM_copy_edge_data(dm, result, i, numEdges, 1);
|
||||
*med2 = *med;
|
||||
numEdges++;
|
||||
|
||||
|
||||
med2->v1 += indexMap[inMED.v1][1];
|
||||
med2->v2 += indexMap[inMED.v2][1];
|
||||
}
|
||||
@@ -1417,13 +1580,13 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
|
||||
for(i = 0; i < maxFaces; i++) {
|
||||
MFace inMF;
|
||||
MFace *mf = CDDM_get_face(result, numFaces);
|
||||
|
||||
|
||||
dm->getFace(dm, i, &inMF);
|
||||
|
||||
|
||||
DM_copy_face_data(dm, result, i, numFaces, 1);
|
||||
*mf = inMF;
|
||||
numFaces++;
|
||||
|
||||
|
||||
mf->v1 = indexMap[inMF.v1][0];
|
||||
mf->v2 = indexMap[inMF.v2][0];
|
||||
mf->v3 = indexMap[inMF.v3][0];
|
||||
@@ -1435,15 +1598,15 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
|
||||
|| (mf->v4 && indexMap[inMF.v4][1])) {
|
||||
MFace *mf2 = CDDM_get_face(result, numFaces);
|
||||
static int corner_indices[4] = {2, 1, 0, 3};
|
||||
|
||||
|
||||
DM_copy_face_data(dm, result, i, numFaces, 1);
|
||||
*mf2 = *mf;
|
||||
|
||||
|
||||
mf2->v1 += indexMap[inMF.v1][1];
|
||||
mf2->v2 += indexMap[inMF.v2][1];
|
||||
mf2->v3 += indexMap[inMF.v3][1];
|
||||
if(inMF.v4) mf2->v4 += indexMap[inMF.v4][1];
|
||||
|
||||
|
||||
/* mirror UVs if enabled */
|
||||
if(mmd->flag & (MOD_MIR_MIRROR_U | MOD_MIR_MIRROR_V)) {
|
||||
MTFace *tf = result->getFaceData(result, numFaces, CD_MTFACE);
|
||||
@@ -1457,16 +1620,18 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Flip face normal */
|
||||
SWAP(int, mf2->v1, mf2->v3);
|
||||
DM_swap_face_data(result, numFaces, corner_indices);
|
||||
|
||||
|
||||
test_index_face(mf2, &result->faceData, numFaces, inMF.v4?4:3);
|
||||
numFaces++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (vector_def) MEM_freeN(vector_def);
|
||||
|
||||
MEM_freeN(indexMap);
|
||||
|
||||
CDDM_lower_num_verts(result, numVerts);
|
||||
@@ -1477,8 +1642,8 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
|
||||
}
|
||||
|
||||
static DerivedMesh *mirrorModifier__doMirror(MirrorModifierData *mmd,
|
||||
Object *ob, DerivedMesh *dm,
|
||||
int initFlags)
|
||||
Object *ob, DerivedMesh *dm,
|
||||
int initFlags)
|
||||
{
|
||||
DerivedMesh *result = dm;
|
||||
|
||||
@@ -4360,13 +4525,13 @@ static void castModifier_deformVertsEM(
|
||||
|
||||
/* Wave */
|
||||
|
||||
static void waveModifier_initData(ModifierData *md)
|
||||
static void waveModifier_initData(ModifierData *md)
|
||||
{
|
||||
WaveModifierData *wmd = (WaveModifierData*) md; // whadya know, moved here from Iraq
|
||||
|
||||
|
||||
wmd->flag |= (MOD_WAVE_X | MOD_WAVE_Y | MOD_WAVE_CYCL
|
||||
| MOD_WAVE_NORM_X | MOD_WAVE_NORM_Y | MOD_WAVE_NORM_Z);
|
||||
|
||||
|
||||
wmd->objectcenter = NULL;
|
||||
wmd->texture = NULL;
|
||||
wmd->map_object = NULL;
|
||||
@@ -4376,6 +4541,7 @@ static void waveModifier_initData(ModifierData *md)
|
||||
wmd->narrow= 1.5f;
|
||||
wmd->lifetime= 0.0f;
|
||||
wmd->damp= 10.0f;
|
||||
wmd->falloff= 0.0f;
|
||||
wmd->texmapping = MOD_WAV_MAP_LOCAL;
|
||||
wmd->defgrp_name[0] = 0;
|
||||
}
|
||||
@@ -4395,6 +4561,7 @@ static void waveModifier_copyData(ModifierData *md, ModifierData *target)
|
||||
twmd->starty = wmd->starty;
|
||||
twmd->timeoffs = wmd->timeoffs;
|
||||
twmd->width = wmd->width;
|
||||
twmd->falloff = wmd->falloff;
|
||||
twmd->objectcenter = wmd->objectcenter;
|
||||
twmd->texture = wmd->texture;
|
||||
twmd->map_object = wmd->map_object;
|
||||
@@ -4605,7 +4772,7 @@ static void waveModifier_do(
|
||||
|
||||
if(x > wmd->lifetime) {
|
||||
lifefac = x - wmd->lifetime;
|
||||
|
||||
|
||||
if(lifefac > wmd->damp) lifefac = 0.0;
|
||||
else lifefac =
|
||||
(float)(wmd->height * (1.0 - sqrt(lifefac / wmd->damp)));
|
||||
@@ -4626,6 +4793,8 @@ static void waveModifier_do(
|
||||
float x = co[0] - wmd->startx;
|
||||
float y = co[1] - wmd->starty;
|
||||
float amplit= 0.0f;
|
||||
float dist = 0.0f;
|
||||
float falloff_fac = 0.0f;
|
||||
TexResult texres;
|
||||
MDeformWeight *def_weight = NULL;
|
||||
|
||||
@@ -4648,14 +4817,29 @@ static void waveModifier_do(
|
||||
get_texture_value(wmd->texture, tex_co[i], &texres);
|
||||
}
|
||||
|
||||
/*get dist*/
|
||||
if(wmd->flag & MOD_WAVE_X) {
|
||||
if(wmd->flag & MOD_WAVE_Y){
|
||||
dist = (float)sqrt(x*x + y*y);
|
||||
}
|
||||
else{
|
||||
dist = fabs(x);
|
||||
}
|
||||
}
|
||||
else if(wmd->flag & MOD_WAVE_Y) {
|
||||
dist = fabs(y);
|
||||
}
|
||||
|
||||
falloff_fac = (1.0-(dist / wmd->falloff));
|
||||
CLAMP(falloff_fac,0,1);
|
||||
|
||||
if(wmd->flag & MOD_WAVE_X) {
|
||||
if(wmd->flag & MOD_WAVE_Y) amplit = (float)sqrt(x*x + y*y);
|
||||
else amplit = x;
|
||||
}
|
||||
else if(wmd->flag & MOD_WAVE_Y)
|
||||
else if(wmd->flag & MOD_WAVE_Y)
|
||||
amplit= y;
|
||||
|
||||
|
||||
/* this way it makes nice circles */
|
||||
amplit -= (ctime - wmd->timeoffs) * wmd->speed;
|
||||
|
||||
@@ -4668,12 +4852,19 @@ static void waveModifier_do(
|
||||
if(amplit > -wmd->width && amplit < wmd->width) {
|
||||
amplit = amplit * wmd->narrow;
|
||||
amplit = (float)(1.0 / exp(amplit * amplit) - minfac);
|
||||
|
||||
/*apply texture*/
|
||||
if(wmd->texture)
|
||||
amplit = amplit * texres.tin;
|
||||
|
||||
/*apply weight*/
|
||||
if(def_weight)
|
||||
amplit = amplit * def_weight->weight;
|
||||
|
||||
/*apply falloff*/
|
||||
if (wmd->falloff > 0)
|
||||
amplit = amplit * falloff_fac;
|
||||
|
||||
if(mvert) {
|
||||
/* move along normals */
|
||||
if(wmd->flag & MOD_WAVE_NORM_X) {
|
||||
@@ -4729,7 +4920,7 @@ static void waveModifier_deformVertsEM(
|
||||
|
||||
if(!wmd->texture && !wmd->defgrp_name[0] && !(wmd->flag & MOD_WAVE_NORM))
|
||||
dm = derivedData;
|
||||
else if(derivedData) dm = derivedData;
|
||||
else if(derivedData) dm = CDDM_copy(derivedData);
|
||||
else dm = CDDM_from_editmesh(editData, ob->data);
|
||||
|
||||
if(wmd->flag & MOD_WAVE_NORM) {
|
||||
|
||||
@@ -732,6 +732,17 @@ void *add_lamp(char *name)
|
||||
la->preview=NULL;
|
||||
la->falloff_type = LA_FALLOFF_INVLINEAR;
|
||||
la->curfalloff = curvemapping_add(1, 0.0f, 1.0f, 1.0f, 0.0f);
|
||||
la->sun_effect_type = 0;
|
||||
la->horizon_brightness = 1.0;
|
||||
la->spread = 1.0;
|
||||
la->sun_brightness = 1.0;
|
||||
la->sun_size = 1.0;
|
||||
la->backscattered_light = 1.0;
|
||||
la->atm_turbidity = 2.0;
|
||||
la->atm_inscattering_factor = 1.0;
|
||||
la->atm_extinction_factor = 1.0;
|
||||
la->atm_distance_factor = 1.0;
|
||||
la->sun_intensity = 1.0;
|
||||
curvemapping_initialize(la->curfalloff);
|
||||
return la;
|
||||
}
|
||||
@@ -1100,6 +1111,8 @@ static void copy_object_pose(Object *obn, Object *ob)
|
||||
{
|
||||
bPoseChannel *chan;
|
||||
|
||||
/* note: need to clear obn->pose pointer first, so that copy_pose works (otherwise there's a crash) */
|
||||
obn->pose= NULL;
|
||||
copy_pose(&obn->pose, ob->pose, 1); /* 1 = copy constraints */
|
||||
|
||||
for (chan = obn->pose->chanbase.first; chan; chan=chan->next){
|
||||
@@ -2380,3 +2393,31 @@ int give_obdata_texspace(Object *ob, int **texflag, float **loc, float **size, f
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Test a bounding box for ray intersection
|
||||
* assumes the ray is already local to the boundbox space
|
||||
*/
|
||||
int ray_hit_boundbox(struct BoundBox *bb, float ray_start[3], float ray_normal[3])
|
||||
{
|
||||
static int triangle_indexes[12][3] = {{0, 1, 2}, {0, 2, 3},
|
||||
{3, 2, 6}, {3, 6, 7},
|
||||
{1, 2, 6}, {1, 6, 5},
|
||||
{5, 6, 7}, {4, 5, 7},
|
||||
{0, 3, 7}, {0, 4, 7},
|
||||
{0, 1, 5}, {0, 4, 5}};
|
||||
int result = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 12 && result == 0; i++)
|
||||
{
|
||||
float lambda;
|
||||
int v1, v2, v3;
|
||||
v1 = triangle_indexes[i][0];
|
||||
v2 = triangle_indexes[i][1];
|
||||
v3 = triangle_indexes[i][2];
|
||||
result = RayIntersectsTriangle(ray_start, ray_normal, bb->vec[v1], bb->vec[v2], bb->vec[v3], &lambda, NULL);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1371,7 +1371,7 @@ void psys_particle_on_shape(int distr, int index, float *fuv, float *vec, float
|
||||
/************************************************/
|
||||
void psys_particle_on_emitter(Object *ob, ParticleSystemModifierData *psmd, int from, int index, int index_dmcache, float *fuv, float foffset, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor){
|
||||
if(psmd){
|
||||
if(psmd->psys->part->distr==PART_DISTR_GRID){
|
||||
if(psmd->psys->part->distr==PART_DISTR_GRID && psmd->psys->part->from != PART_FROM_VERT){
|
||||
if(vec){
|
||||
VECCOPY(vec,fuv);
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ static void realloc_particles(Object *ob, ParticleSystem *psys, int new_totpart)
|
||||
int i, totpart, totsaved = 0;
|
||||
|
||||
if(new_totpart<0) {
|
||||
if(psys->part->distr==PART_DISTR_GRID) {
|
||||
if(psys->part->distr==PART_DISTR_GRID && psys->part->from != PART_FROM_VERT) {
|
||||
totpart= psys->part->grid_res;
|
||||
totpart*=totpart*totpart;
|
||||
}
|
||||
@@ -1056,7 +1056,7 @@ int psys_threads_init_distribution(ParticleThread *threads, DerivedMesh *finaldm
|
||||
dm= CDDM_from_mesh((Mesh*)ob->data, ob);
|
||||
|
||||
/* special handling of grid distribution */
|
||||
if(part->distr==PART_DISTR_GRID){
|
||||
if(part->distr==PART_DISTR_GRID && from != PART_FROM_VERT){
|
||||
distribute_particles_in_grid(dm,psys);
|
||||
dm->release(dm);
|
||||
return 0;
|
||||
@@ -1600,7 +1600,7 @@ void initialize_particle(ParticleData *pa, int p, Object *ob, ParticleSystem *ps
|
||||
|
||||
NormalQuat(pa->r_rot);
|
||||
|
||||
if(part->distr!=PART_DISTR_GRID){
|
||||
if(part->distr!=PART_DISTR_GRID && part->from != PART_FROM_VERT){
|
||||
/* any unique random number will do (r_ave[0]) */
|
||||
if(ptex.exist < 0.5*(1.0+pa->r_ave[0]))
|
||||
pa->flag |= PARS_UNEXIST;
|
||||
@@ -2596,6 +2596,7 @@ static void precalc_effectors(Object *ob, ParticleSystem *psys, ParticleSystemMo
|
||||
|
||||
for(ec= lb->first; ec; ec= ec->next) {
|
||||
PartDeflect *pd= ec->ob->pd;
|
||||
co = NULL;
|
||||
|
||||
if(ec->type==PSYS_EC_EFFECTOR && pd->forcefield==PFIELD_GUIDE && ec->ob->type==OB_CURVE
|
||||
&& part->phystype!=PART_PHYS_BOIDS) {
|
||||
@@ -4514,7 +4515,7 @@ void psys_changed_type(ParticleSystem *psys)
|
||||
if(part->from == PART_FROM_PARTICLE) {
|
||||
if(part->type != PART_REACTOR)
|
||||
part->from = PART_FROM_FACE;
|
||||
if(part->distr == PART_DISTR_GRID)
|
||||
if(part->distr == PART_DISTR_GRID && part->from != PART_FROM_VERT)
|
||||
part->distr = PART_DISTR_JIT;
|
||||
}
|
||||
|
||||
@@ -4709,7 +4710,7 @@ static void system_step(Object *ob, ParticleSystem *psys, ParticleSystemModifier
|
||||
oldtotpart = psys->totpart;
|
||||
oldtotchild = psys->totchild;
|
||||
|
||||
if(part->distr == PART_DISTR_GRID)
|
||||
if(part->distr == PART_DISTR_GRID && part->from != PART_FROM_VERT)
|
||||
totpart = part->grid_res*part->grid_res*part->grid_res;
|
||||
else
|
||||
totpart = psys->part->totpart;
|
||||
@@ -4814,9 +4815,20 @@ static void system_step(Object *ob, ParticleSystem *psys, ParticleSystemModifier
|
||||
pa->flag &= ~PARS_NO_DISP;
|
||||
}
|
||||
|
||||
/* ok now we're all set so let's go */
|
||||
if(psys->totpart)
|
||||
dynamics_step(ob,psys,psmd,cfra,vg_vel,vg_tan,vg_rot,vg_size);
|
||||
if(psys->totpart) {
|
||||
int dframe, totframesback = 0;
|
||||
|
||||
/* handle negative frame start at the first frame by doing
|
||||
* all the steps before the first frame */
|
||||
if(framenr == startframe && part->sta < startframe)
|
||||
totframesback = (startframe - (int)part->sta);
|
||||
|
||||
for(dframe=-totframesback; dframe<=0; dframe++) {
|
||||
/* ok now we're all set so let's go */
|
||||
dynamics_step(ob,psys,psmd,cfra+dframe,vg_vel,vg_tan,vg_rot,vg_size);
|
||||
psys->cfra = cfra+dframe;
|
||||
}
|
||||
}
|
||||
|
||||
cache->simframe= framenr;
|
||||
cache->flag |= PTCACHE_SIMULATION_VALID;
|
||||
|
||||
@@ -459,9 +459,10 @@ int BKE_ptcache_object_reset(Object *ob, int mode)
|
||||
PTCacheID pid;
|
||||
ParticleSystem *psys;
|
||||
ModifierData *md;
|
||||
int reset;
|
||||
int reset, skip;
|
||||
|
||||
reset= 0;
|
||||
skip= 0;
|
||||
|
||||
if(ob->soft) {
|
||||
BKE_ptcache_id_from_softbody(&pid, ob, ob->soft);
|
||||
@@ -469,11 +470,18 @@ int BKE_ptcache_object_reset(Object *ob, int mode)
|
||||
}
|
||||
|
||||
for(psys=ob->particlesystem.first; psys; psys=psys->next) {
|
||||
BKE_ptcache_id_from_particles(&pid, ob, psys);
|
||||
reset |= BKE_ptcache_id_reset(&pid, mode);
|
||||
|
||||
/* Baked softbody hair has to be checked first, because we don't want to reset */
|
||||
/* particles or softbody in that case -jahka */
|
||||
if(psys->soft) {
|
||||
BKE_ptcache_id_from_softbody(&pid, ob, psys->soft);
|
||||
if(mode == PSYS_RESET_ALL || !(psys->part->type == PART_HAIR && (pid.cache->flag & PTCACHE_BAKED)))
|
||||
reset |= BKE_ptcache_id_reset(&pid, mode);
|
||||
else
|
||||
skip = 1;
|
||||
}
|
||||
|
||||
if(skip == 0) {
|
||||
BKE_ptcache_id_from_particles(&pid, ob, psys);
|
||||
reset |= BKE_ptcache_id_reset(&pid, mode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,6 +150,9 @@ void init_sensor(bSensor *sens)
|
||||
case SENS_PROPERTY:
|
||||
sens->data= MEM_callocN(sizeof(bPropertySensor), "propsens");
|
||||
break;
|
||||
case SENS_ACTUATOR:
|
||||
sens->data= MEM_callocN(sizeof(bActuatorSensor), "actsens");
|
||||
break;
|
||||
case SENS_MOUSE:
|
||||
ms=sens->data= MEM_callocN(sizeof(bMouseSensor), "mousesens");
|
||||
ms->type= LEFTMOUSE;
|
||||
@@ -411,6 +414,7 @@ void init_actuator(bActuator *act)
|
||||
switch(act->type) {
|
||||
#ifdef __NLA
|
||||
case ACT_ACTION:
|
||||
case ACT_SHAPEACTION:
|
||||
act->data= MEM_callocN(sizeof(bActionActuator), "actionact");
|
||||
break;
|
||||
#endif
|
||||
@@ -464,6 +468,9 @@ void init_actuator(bActuator *act)
|
||||
case ACT_PARENT:
|
||||
act->data = MEM_callocN(sizeof( bParentActuator ), "parent act");
|
||||
break;
|
||||
case ACT_STATE:
|
||||
act->data = MEM_callocN(sizeof( bStateActuator ), "state act");
|
||||
break;
|
||||
default:
|
||||
; /* this is very severe... I cannot make any memory for this */
|
||||
/* logic brick... */
|
||||
|
||||
@@ -1027,7 +1027,8 @@ char *txt_to_buf (Text *text)
|
||||
if (!text) return NULL;
|
||||
if (!text->curl) return NULL;
|
||||
if (!text->sell) return NULL;
|
||||
|
||||
if (!text->lines.first) return NULL;
|
||||
|
||||
linef= text->lines.first;
|
||||
charf= 0;
|
||||
|
||||
|
||||
@@ -50,6 +50,9 @@ extern "C" {
|
||||
#ifndef M_SQRT1_2
|
||||
#define M_SQRT1_2 0.70710678118654752440
|
||||
#endif
|
||||
#ifndef M_1_PI
|
||||
#define M_1_PI 0.318309886183790671538
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifndef FREE_WINDOWS
|
||||
@@ -258,6 +261,7 @@ void Vec2Addf(float *v, float *v1, float *v2);
|
||||
void Vec2Subf(float *v, float *v1, float *v2);
|
||||
void Vec2Copyf(float *v1, float *v2);
|
||||
|
||||
void AxisAngleToQuat(float *q, float *axis, float angle);
|
||||
void vectoquat(float *vec, short axis, short upflag, float *q);
|
||||
|
||||
float VecAngle2(float *v1, float *v2);
|
||||
@@ -269,6 +273,8 @@ float NormalizedVecAngle2_2D(float *v1, float *v2);
|
||||
|
||||
void euler_rot(float *beul, float ang, char axis);
|
||||
|
||||
void NormalShortToFloat(float *out, short *in);
|
||||
void NormalFloatToShort(short *out, float *in);
|
||||
|
||||
float DistVL2Dfl(float *v1, float *v2, float *v3);
|
||||
float PdistVL2Dfl(float *v1, float *v2, float *v3);
|
||||
@@ -320,6 +326,9 @@ void yuv_to_rgb(float y, float u, float v, float *lr, float *lg, float *lb);
|
||||
void ycc_to_rgb(float y, float cb, float cr, float *lr, float *lg, float *lb);
|
||||
void rgb_to_ycc(float r, float g, float b, float *ly, float *lcb, float *lcr);
|
||||
void rgb_to_hsv(float r, float g, float b, float *lh, float *ls, float *lv);
|
||||
void xyz_to_rgb(float x, float y, float z, float *r, float *g, float *b);
|
||||
int constrain_rgb(float *r, float *g, float *b);
|
||||
void gamma_correct_rgb(float *r, float *g, float *b);
|
||||
unsigned int hsv_to_cpack(float h, float s, float v);
|
||||
unsigned int rgb_to_cpack(float r, float g, float b);
|
||||
void cpack_to_rgb(unsigned int col, float *r, float *g, float *b);
|
||||
@@ -371,7 +380,9 @@ void LocQuatSizeToMat4(float mat[][4], float loc[3], float quat[4], float size[3
|
||||
void tubemap(float x, float y, float z, float *u, float *v);
|
||||
void spheremap(float x, float y, float z, float *u, float *v);
|
||||
|
||||
int LineIntersectLine(float v1[3], float v2[3], float v3[3], float v4[3], float i1[3], float i2[3]);
|
||||
int LineIntersectsTriangle(float p1[3], float p2[3], float v0[3], float v1[3], float v2[3], float *lambda, float *uv);
|
||||
int RayIntersectsTriangle(float p1[3], float d[3], float v0[3], float v1[3], float v2[3], float *lambda, float *uv);
|
||||
int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, float v0[3], float v1[3], float v2[3], float *lambda, float *ipoint);
|
||||
int AxialLineIntersectsTriangle(int axis, float co1[3], float co2[3], float v0[3], float v1[3], float v2[3], float *lambda);
|
||||
int AabbIntersectAabb(float min1[3], float max1[3], float min2[3], float max2[3]);
|
||||
|
||||
44
source/blender/blenlib/BLI_mempool.h
Normal file
44
source/blender/blenlib/BLI_mempool.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* Simple fast memory allocator
|
||||
*
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): Geoffrey Bantle.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef BLI_MEMPOOL_H
|
||||
#define BLI_MEMPOOL_H
|
||||
|
||||
struct BLI_mempool;
|
||||
typedef struct BLI_mempool BLI_mempool;
|
||||
|
||||
BLI_mempool *BLI_mempool_create(int esize, int tote, int pchunk);
|
||||
void *BLI_mempool_alloc(BLI_mempool *pool);
|
||||
void *BLI_mempool_calloc(BLI_mempool *pool);
|
||||
void BLI_mempool_free(BLI_mempool *pool, void *addr);
|
||||
void BLI_mempool_destroy(BLI_mempool *pool);
|
||||
|
||||
|
||||
#endif
|
||||
@@ -73,6 +73,9 @@
|
||||
#ifndef M_SQRT1_2
|
||||
#define M_SQRT1_2 0.70710678118654752440
|
||||
#endif
|
||||
#ifndef M_1_PI
|
||||
#define M_1_PI 0.318309886183790671538
|
||||
#endif
|
||||
|
||||
#define MAXPATHLEN MAX_PATH
|
||||
|
||||
|
||||
@@ -523,6 +523,7 @@ static void bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, char
|
||||
return;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void verify_tree(BVHTree *tree)
|
||||
{
|
||||
int i, j, check = 0;
|
||||
@@ -569,6 +570,7 @@ static void verify_tree(BVHTree *tree)
|
||||
|
||||
printf("branches: %d, leafs: %d, total: %d\n", tree->totbranch, tree->totleaf, tree->totbranch + tree->totleaf);
|
||||
}
|
||||
#endif
|
||||
|
||||
void BLI_bvhtree_balance(BVHTree *tree)
|
||||
{
|
||||
|
||||
140
source/blender/blenlib/intern/BLI_mempool.c
Normal file
140
source/blender/blenlib/intern/BLI_mempool.c
Normal file
@@ -0,0 +1,140 @@
|
||||
/**
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2008 by Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/*
|
||||
Simple, fast memory allocator for allocating many elements of the same size.
|
||||
*/
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
#include "BLI_blenlib.h"
|
||||
#include "DNA_listBase.h"
|
||||
#include "BLI_linklist.h"
|
||||
#include <string.h>
|
||||
|
||||
typedef struct BLI_freenode{
|
||||
struct BLI_freenode *next;
|
||||
}BLI_freenode;
|
||||
|
||||
typedef struct BLI_mempool_chunk{
|
||||
struct BLI_mempool_chunk *next, *prev;
|
||||
void *data;
|
||||
}BLI_mempool_chunk;
|
||||
|
||||
typedef struct BLI_mempool{
|
||||
struct ListBase chunks;
|
||||
int esize, csize, pchunk; /*size of elements and chunks in bytes and number of elements per chunk*/
|
||||
struct BLI_freenode *free; /*free element list. Interleaved into chunk datas.*/
|
||||
}BLI_mempool;
|
||||
|
||||
BLI_mempool *BLI_mempool_create(int esize, int tote, int pchunk)
|
||||
{ BLI_mempool *pool = NULL;
|
||||
BLI_freenode *lasttail = NULL, *curnode = NULL;
|
||||
int i,j, maxchunks;
|
||||
char *addr;
|
||||
|
||||
/*allocate the pool structure*/
|
||||
pool = MEM_mallocN(sizeof(BLI_mempool),"memory pool");
|
||||
pool->esize = esize;
|
||||
pool->pchunk = pchunk;
|
||||
pool->csize = esize * pchunk;
|
||||
pool->chunks.first = pool->chunks.last = NULL;
|
||||
|
||||
maxchunks = tote / pchunk;
|
||||
|
||||
/*allocate the actual chunks*/
|
||||
for(i=0; i < maxchunks; i++){
|
||||
BLI_mempool_chunk *mpchunk = MEM_mallocN(sizeof(BLI_mempool_chunk), "BLI_Mempool Chunk");
|
||||
mpchunk->next = mpchunk->prev = NULL;
|
||||
mpchunk->data = MEM_mallocN(pool->csize, "BLI Mempool Chunk Data");
|
||||
BLI_addtail(&(pool->chunks), mpchunk);
|
||||
|
||||
if(i==0) pool->free = mpchunk->data; /*start of the list*/
|
||||
/*loop through the allocated data, building the pointer structures*/
|
||||
for(addr = mpchunk->data, j=0; j < pool->pchunk; j++){
|
||||
curnode = ((BLI_freenode*)addr);
|
||||
addr += pool->esize;
|
||||
curnode->next = (BLI_freenode*)addr;
|
||||
}
|
||||
/*final pointer in the previously allocated chunk is wrong.*/
|
||||
if(lasttail) lasttail->next = mpchunk->data;
|
||||
/*set the end of this chunks memoryy to the new tail for next iteration*/
|
||||
lasttail = curnode;
|
||||
}
|
||||
/*terminate the list*/
|
||||
curnode->next = NULL;
|
||||
return pool;
|
||||
}
|
||||
void *BLI_mempool_alloc(BLI_mempool *pool){
|
||||
void *retval=NULL;
|
||||
BLI_freenode *curnode=NULL;
|
||||
char *addr=NULL;
|
||||
int j;
|
||||
|
||||
if(!(pool->free)){
|
||||
/*need to allocate a new chunk*/
|
||||
BLI_mempool_chunk *mpchunk = MEM_mallocN(sizeof(BLI_mempool_chunk), "BLI_Mempool Chunk");
|
||||
mpchunk->next = mpchunk->prev = NULL;
|
||||
mpchunk->data = MEM_mallocN(pool->csize, "BLI_Mempool Chunk Data");
|
||||
BLI_addtail(&(pool->chunks), mpchunk);
|
||||
|
||||
pool->free = mpchunk->data; /*start of the list*/
|
||||
for(addr = mpchunk->data, j=0; j < pool->pchunk; j++){
|
||||
curnode = ((BLI_freenode*)addr);
|
||||
addr += pool->esize;
|
||||
curnode->next = (BLI_freenode*)addr;
|
||||
}
|
||||
curnode->next = NULL; /*terminate the list*/
|
||||
}
|
||||
|
||||
retval = pool->free;
|
||||
pool->free = pool->free->next;
|
||||
//memset(retval, 0, pool->esize);
|
||||
return retval;
|
||||
}
|
||||
|
||||
void *BLI_mempool_calloc(BLI_mempool *pool){
|
||||
void *retval=NULL;
|
||||
retval = BLI_mempool_alloc(pool);
|
||||
memset(retval, 0, pool->esize);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void BLI_mempool_free(BLI_mempool *pool, void *addr){ //doesnt protect against double frees, dont be stupid!
|
||||
BLI_freenode *newhead = addr;
|
||||
newhead->next = pool->free;
|
||||
pool->free = newhead;
|
||||
}
|
||||
void BLI_mempool_destroy(BLI_mempool *pool)
|
||||
{
|
||||
BLI_mempool_chunk *mpchunk=NULL;
|
||||
for(mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) MEM_freeN(mpchunk->data);
|
||||
BLI_freelistN(&(pool->chunks));
|
||||
MEM_freeN(pool);
|
||||
}
|
||||
@@ -60,6 +60,7 @@
|
||||
#define SMALL_NUMBER 1.e-8
|
||||
#define ABS(x) ((x) < 0 ? -(x) : (x))
|
||||
#define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; }
|
||||
#define CLAMP(a, b, c) if((a)<(b)) (a)=(b); else if((a)>(c)) (a)=(c)
|
||||
|
||||
|
||||
#if defined(WIN32) || defined(__APPLE__)
|
||||
@@ -1335,6 +1336,22 @@ void NormalQuat(float *q)
|
||||
}
|
||||
}
|
||||
|
||||
void AxisAngleToQuat(float *q, float *axis, float angle)
|
||||
{
|
||||
float nor[3];
|
||||
float si;
|
||||
|
||||
VecCopyf(nor, axis);
|
||||
Normalize(nor);
|
||||
|
||||
angle /= 2;
|
||||
si = (float)sin(angle);
|
||||
q[0] = (float)cos(angle);
|
||||
q[1] = nor[0] * si;
|
||||
q[2] = nor[1] * si;
|
||||
q[3] = nor[2] * si;
|
||||
}
|
||||
|
||||
void vectoquat(float *vec, short axis, short upflag, float *q)
|
||||
{
|
||||
float q2[4], nor[3], *fp, mat[3][3], angle, si, co, x2, y2, z2, len1;
|
||||
@@ -2258,6 +2275,20 @@ double Sqrt3d(double d)
|
||||
else return exp(log(d)/3);
|
||||
}
|
||||
|
||||
void NormalShortToFloat(float *out, short *in)
|
||||
{
|
||||
out[0] = in[0] / 32767.0;
|
||||
out[1] = in[1] / 32767.0;
|
||||
out[2] = in[2] / 32767.0;
|
||||
}
|
||||
|
||||
void NormalFloatToShort(short *out, float *in)
|
||||
{
|
||||
out[0] = (short)(in[0] * 32767.0);
|
||||
out[1] = (short)(in[1] * 32767.0);
|
||||
out[2] = (short)(in[2] * 32767.0);
|
||||
}
|
||||
|
||||
/* distance v1 to line v2-v3 */
|
||||
/* using Hesse formula, NO LINE PIECE! */
|
||||
float DistVL2Dfl( float *v1, float *v2, float *v3) {
|
||||
@@ -3384,6 +3415,66 @@ void rgb_to_hsv(float r, float g, float b, float *lh, float *ls, float *lv)
|
||||
*lv = v;
|
||||
}
|
||||
|
||||
/*http://brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
|
||||
* SMPTE-C XYZ to RGB matrix*/
|
||||
void xyz_to_rgb(float xc, float yc, float zc, float *r, float *g, float *b)
|
||||
{
|
||||
*r = (3.50570 * xc) + (-1.73964 * yc) + (-0.544011 * zc);
|
||||
*g = (-1.06906 * xc) + (1.97781 * yc) + (0.0351720 * zc);
|
||||
*b = (0.0563117 * xc) + (-0.196994 * yc) + (1.05005 * zc);
|
||||
}
|
||||
|
||||
/*If the requested RGB shade contains a negative weight for
|
||||
one of the primaries, it lies outside the colour gamut
|
||||
accessible from the given triple of primaries. Desaturate
|
||||
it by adding white, equal quantities of R, G, and B, enough
|
||||
to make RGB all positive. The function returns 1 if the
|
||||
components were modified, zero otherwise.*/
|
||||
int constrain_rgb(float *r, float *g, float *b)
|
||||
{
|
||||
float w;
|
||||
|
||||
/* Amount of white needed is w = - min(0, *r, *g, *b) */
|
||||
|
||||
w = (0 < *r) ? 0 : *r;
|
||||
w = (w < *g) ? w : *g;
|
||||
w = (w < *b) ? w : *b;
|
||||
w = -w;
|
||||
|
||||
/* Add just enough white to make r, g, b all positive. */
|
||||
|
||||
if (w > 0) {
|
||||
*r += w; *g += w; *b += w;
|
||||
return 1; /* Colour modified to fit RGB gamut */
|
||||
}
|
||||
|
||||
return 0; /* Colour within RGB gamut */
|
||||
}
|
||||
|
||||
/*Transform linear RGB values to nonlinear RGB values. Rec.
|
||||
709 is ITU-R Recommendation BT. 709 (1990) ``Basic
|
||||
Parameter Values for the HDTV Standard for the Studio and
|
||||
for International Programme Exchange'', formerly CCIR Rec.
|
||||
709.*/
|
||||
void gamma_correct(float *c)
|
||||
{
|
||||
/* Rec. 709 gamma correction. */
|
||||
float cc = 0.018;
|
||||
|
||||
if (*c < cc) {
|
||||
*c *= ((1.099 * pow(cc, 0.45)) - 0.099) / cc;
|
||||
} else {
|
||||
*c = (1.099 * pow(*c, 0.45)) - 0.099;
|
||||
}
|
||||
}
|
||||
|
||||
void gamma_correct_rgb(float *r, float *g, float *b)
|
||||
{
|
||||
gamma_correct(r);
|
||||
gamma_correct(g);
|
||||
gamma_correct(b);
|
||||
}
|
||||
|
||||
|
||||
/* we define a 'cpack' here as a (3 byte color code) number that can be expressed like 0xFFAA66 or so.
|
||||
for that reason it is sensitive for endianness... with this function it works correctly
|
||||
@@ -3671,14 +3762,89 @@ int LineIntersectsTriangle(float p1[3], float p2[3], float v0[3], float v1[3], f
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* moved from effect.c
|
||||
test if the ray starting at p1 going in d direction intersects the triangle v0..v2
|
||||
return non zero if it does
|
||||
*/
|
||||
int RayIntersectsTriangle(float p1[3], float d[3], float v0[3], float v1[3], float v2[3], float *lambda, float *uv)
|
||||
{
|
||||
float p[3], s[3], e1[3], e2[3], q[3];
|
||||
float a, f, u, v;
|
||||
|
||||
VecSubf(e1, v1, v0);
|
||||
VecSubf(e2, v2, v0);
|
||||
|
||||
Crossf(p, d, e2);
|
||||
a = Inpf(e1, p);
|
||||
if ((a > -0.000001) && (a < 0.000001)) return 0;
|
||||
f = 1.0f/a;
|
||||
|
||||
VecSubf(s, p1, v0);
|
||||
|
||||
Crossf(q, s, e1);
|
||||
*lambda = f * Inpf(e2, q);
|
||||
if ((*lambda < 0.0)) return 0;
|
||||
|
||||
u = f * Inpf(s, p);
|
||||
if ((u < 0.0)||(u > 1.0)) return 0;
|
||||
|
||||
v = f * Inpf(d, q);
|
||||
if ((v < 0.0)||((u + v) > 1.0)) return 0;
|
||||
|
||||
if(uv) {
|
||||
uv[0]= u;
|
||||
uv[1]= v;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Adapted from the paper by Kasper Fauerby */
|
||||
/* "Improved Collision detection and Response" */
|
||||
static int getLowestRoot(float a, float b, float c, float maxR, float* root)
|
||||
{
|
||||
// Check if a solution exists
|
||||
float determinant = b*b - 4.0f*a*c;
|
||||
|
||||
// If determinant is negative it means no solutions.
|
||||
if (determinant >= 0.0f)
|
||||
{
|
||||
// calculate the two roots: (if determinant == 0 then
|
||||
// x1==x2 but let’s disregard that slight optimization)
|
||||
float sqrtD = sqrt(determinant);
|
||||
float r1 = (-b - sqrtD) / (2.0f*a);
|
||||
float r2 = (-b + sqrtD) / (2.0f*a);
|
||||
|
||||
// Sort so x1 <= x2
|
||||
if (r1 > r2)
|
||||
SWAP( float, r1, r2);
|
||||
|
||||
// Get lowest root:
|
||||
if (r1 > 0.0f && r1 < maxR)
|
||||
{
|
||||
*root = r1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// It is possible that we want x2 - this can happen
|
||||
// if x1 < 0
|
||||
if (r2 > 0.0f && r2 < maxR)
|
||||
{
|
||||
*root = r2;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
// No (valid) solutions
|
||||
return 0;
|
||||
}
|
||||
|
||||
int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, float v0[3], float v1[3], float v2[3], float *lambda, float *ipoint)
|
||||
{
|
||||
float e1[3], e2[3], e3[3], point[3], vel[3], /*dist[3],*/ nor[3], temp[3], bv[3];
|
||||
float a, b, c, d, e, x, y, z, t, t0, t1, radius2=radius*radius;
|
||||
float a, b, c, d, e, x, y, z, radius2=radius*radius;
|
||||
float elen2,edotv,edotbv,nordotv,vel2;
|
||||
int embedded_in_plane=0, found_by_sweep=0;
|
||||
float newLambda;
|
||||
int found_by_sweep=0;
|
||||
|
||||
VecSubf(e1,v1,v0);
|
||||
VecSubf(e2,v2,v0);
|
||||
@@ -3687,44 +3853,41 @@ int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, f
|
||||
/*---test plane of tri---*/
|
||||
Crossf(nor,e1,e2);
|
||||
Normalize(nor);
|
||||
|
||||
/* flip normal */
|
||||
if(Inpf(nor,vel)>0.0f) VecMulf(nor,-1.0f);
|
||||
|
||||
a=Inpf(p1,nor)-Inpf(v0,nor);
|
||||
|
||||
nordotv=Inpf(nor,vel);
|
||||
|
||||
if ((nordotv > -0.000001) && (nordotv < 0.000001)) {
|
||||
if(fabs(a)>=1.0f)
|
||||
if (fabs(nordotv) < 0.000001)
|
||||
{
|
||||
if(fabs(a)>=radius)
|
||||
{
|
||||
return 0;
|
||||
else{
|
||||
embedded_in_plane=1;
|
||||
t0=0.0f;
|
||||
t1=1.0f;
|
||||
}
|
||||
}
|
||||
else{
|
||||
t0=(radius-a)/nordotv;
|
||||
t1=(-radius-a)/nordotv;
|
||||
/* make t0<t1 */
|
||||
if(t0>t1){b=t1; t1=t0; t0=b;}
|
||||
else
|
||||
{
|
||||
float t0=(-a+radius)/nordotv;
|
||||
float t1=(-a-radius)/nordotv;
|
||||
|
||||
if(t0>t1)
|
||||
SWAP(float, t0, t1);
|
||||
|
||||
if(t0>1.0f || t1<0.0f) return 0;
|
||||
|
||||
/* clamp to [0,1] */
|
||||
t0=(t0<0.0f)?0.0f:((t0>1.0f)?1.0:t0);
|
||||
t1=(t1<0.0f)?0.0f:((t1>1.0f)?1.0:t1);
|
||||
}
|
||||
CLAMP(t0, 0.0f, 1.0f);
|
||||
CLAMP(t1, 0.0f, 1.0f);
|
||||
|
||||
/*---test inside of tri---*/
|
||||
if(embedded_in_plane==0){
|
||||
/*---test inside of tri---*/
|
||||
/* plane intersection point */
|
||||
VecCopyf(point,vel);
|
||||
VecMulf(point,t0);
|
||||
VecAddf(point,point,p1);
|
||||
VecCopyf(temp,nor);
|
||||
VecMulf(temp,radius);
|
||||
VecSubf(point,point,temp);
|
||||
|
||||
point[0] = p1[0] + vel[0]*t0 - nor[0]*radius;
|
||||
point[1] = p1[1] + vel[1]*t0 - nor[1]*radius;
|
||||
point[2] = p1[2] + vel[2]*t0 - nor[2]*radius;
|
||||
|
||||
|
||||
/* is the point in the tri? */
|
||||
a=Inpf(e1,e1);
|
||||
@@ -3739,14 +3902,19 @@ int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, f
|
||||
y=e*a-d*b;
|
||||
z=x+y-(a*c-b*b);
|
||||
|
||||
if(( ((unsigned int)z)& ~(((unsigned int)x)|((unsigned int)y)) ) & 0x80000000){
|
||||
|
||||
if( z <= 0.0f && (x >= 0.0f && y >= 0.0f))
|
||||
{
|
||||
//( ((unsigned int)z)& ~(((unsigned int)x)|((unsigned int)y)) ) & 0x80000000){
|
||||
*lambda=t0;
|
||||
VecCopyf(ipoint,point);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
*lambda=1.0f;
|
||||
|
||||
/*---test points---*/
|
||||
a=vel2=Inpf(vel,vel);
|
||||
|
||||
@@ -3754,73 +3922,42 @@ int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, f
|
||||
VecSubf(temp,p1,v0);
|
||||
b=2.0f*Inpf(vel,temp);
|
||||
c=Inpf(temp,temp)-radius2;
|
||||
d=b*b-4*a*c;
|
||||
|
||||
if(d>=0.0f){
|
||||
if(d==0.0f)
|
||||
t=-b/2*a;
|
||||
else{
|
||||
z=sqrt(d);
|
||||
x=(-b-z)*0.5/a;
|
||||
y=(-b+z)*0.5/a;
|
||||
t=x<y?x:y;
|
||||
}
|
||||
|
||||
if(t>0.0 && t < *lambda){
|
||||
*lambda=t;
|
||||
VecCopyf(ipoint,v0);
|
||||
found_by_sweep=1;
|
||||
}
|
||||
if(getLowestRoot(a, b, c, *lambda, lambda))
|
||||
{
|
||||
VecCopyf(ipoint,v0);
|
||||
found_by_sweep=1;
|
||||
}
|
||||
|
||||
/*v1*/
|
||||
VecSubf(temp,p1,v1);
|
||||
b=2.0f*Inpf(vel,temp);
|
||||
c=Inpf(temp,temp)-radius2;
|
||||
d=b*b-4*a*c;
|
||||
|
||||
if(d>=0.0f){
|
||||
if(d==0.0f)
|
||||
t=-b/2*a;
|
||||
else{
|
||||
z=sqrt(d);
|
||||
x=(-b-z)*0.5/a;
|
||||
y=(-b+z)*0.5/a;
|
||||
t=x<y?x:y;
|
||||
}
|
||||
|
||||
if(t>0.0 && t < *lambda){
|
||||
*lambda=t;
|
||||
VecCopyf(ipoint,v1);
|
||||
found_by_sweep=1;
|
||||
}
|
||||
if(getLowestRoot(a, b, c, *lambda, lambda))
|
||||
{
|
||||
VecCopyf(ipoint,v1);
|
||||
found_by_sweep=1;
|
||||
}
|
||||
|
||||
/*v2*/
|
||||
VecSubf(temp,p1,v2);
|
||||
b=2.0f*Inpf(vel,temp);
|
||||
c=Inpf(temp,temp)-radius2;
|
||||
d=b*b-4*a*c;
|
||||
|
||||
if(d>=0.0f){
|
||||
if(d==0.0f)
|
||||
t=-b/2*a;
|
||||
else{
|
||||
z=sqrt(d);
|
||||
x=(-b-z)*0.5/a;
|
||||
y=(-b+z)*0.5/a;
|
||||
t=x<y?x:y;
|
||||
}
|
||||
|
||||
if(t>0.0 && t < *lambda){
|
||||
*lambda=t;
|
||||
VecCopyf(ipoint,v2);
|
||||
found_by_sweep=1;
|
||||
}
|
||||
if(getLowestRoot(a, b, c, *lambda, lambda))
|
||||
{
|
||||
VecCopyf(ipoint,v2);
|
||||
found_by_sweep=1;
|
||||
}
|
||||
|
||||
/*---test edges---*/
|
||||
VecSubf(e3,v2,v1); //wasnt yet calculated
|
||||
|
||||
|
||||
/*e1*/
|
||||
VecSubf(bv,v0,p1);
|
||||
|
||||
elen2 = Inpf(e1,e1);
|
||||
edotv = Inpf(e1,vel);
|
||||
edotbv = Inpf(e1,bv);
|
||||
@@ -3828,27 +3965,18 @@ int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, f
|
||||
a=elen2*(-Inpf(vel,vel))+edotv*edotv;
|
||||
b=2.0f*(elen2*Inpf(vel,bv)-edotv*edotbv);
|
||||
c=elen2*(radius2-Inpf(bv,bv))+edotbv*edotbv;
|
||||
d=b*b-4*a*c;
|
||||
if(d>=0.0f){
|
||||
if(d==0.0f)
|
||||
t=-b/2*a;
|
||||
else{
|
||||
z=sqrt(d);
|
||||
x=(-b-z)*0.5/a;
|
||||
y=(-b+z)*0.5/a;
|
||||
t=x<y?x:y;
|
||||
}
|
||||
|
||||
e=(edotv*t-edotbv)/elen2;
|
||||
if(getLowestRoot(a, b, c, *lambda, &newLambda))
|
||||
{
|
||||
e=(edotv*newLambda-edotbv)/elen2;
|
||||
|
||||
if((e>=0.0f) && (e<=1.0f)){
|
||||
if(t>0.0 && t < *lambda){
|
||||
*lambda=t;
|
||||
VecCopyf(ipoint,e1);
|
||||
VecMulf(ipoint,e);
|
||||
VecAddf(ipoint,ipoint,v0);
|
||||
found_by_sweep=1;
|
||||
}
|
||||
if(e >= 0.0f && e <= 1.0f)
|
||||
{
|
||||
*lambda = newLambda;
|
||||
VecCopyf(ipoint,e1);
|
||||
VecMulf(ipoint,e);
|
||||
VecAddf(ipoint,ipoint,v0);
|
||||
found_by_sweep=1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3861,32 +3989,27 @@ int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, f
|
||||
a=elen2*(-Inpf(vel,vel))+edotv*edotv;
|
||||
b=2.0f*(elen2*Inpf(vel,bv)-edotv*edotbv);
|
||||
c=elen2*(radius2-Inpf(bv,bv))+edotbv*edotbv;
|
||||
d=b*b-4*a*c;
|
||||
if(d>=0.0f){
|
||||
if(d==0.0f)
|
||||
t=-b/2*a;
|
||||
else{
|
||||
z=sqrt(d);
|
||||
x=(-b-z)*0.5/a;
|
||||
y=(-b+z)*0.5/a;
|
||||
t=x<y?x:y;
|
||||
}
|
||||
|
||||
e=(edotv*t-edotbv)/elen2;
|
||||
if(getLowestRoot(a, b, c, *lambda, &newLambda))
|
||||
{
|
||||
e=(edotv*newLambda-edotbv)/elen2;
|
||||
|
||||
if((e>=0.0f) && (e<=1.0f)){
|
||||
if(t>0.0 && t < *lambda){
|
||||
*lambda=t;
|
||||
VecCopyf(ipoint,e2);
|
||||
VecMulf(ipoint,e);
|
||||
VecAddf(ipoint,ipoint,v0);
|
||||
found_by_sweep=1;
|
||||
}
|
||||
if(e >= 0.0f && e <= 1.0f)
|
||||
{
|
||||
*lambda = newLambda;
|
||||
VecCopyf(ipoint,e2);
|
||||
VecMulf(ipoint,e);
|
||||
VecAddf(ipoint,ipoint,v0);
|
||||
found_by_sweep=1;
|
||||
}
|
||||
}
|
||||
|
||||
/*e3*/
|
||||
VecSubf(e3,v2,v1);
|
||||
VecSubf(bv,v0,p1);
|
||||
elen2 = Inpf(e1,e1);
|
||||
edotv = Inpf(e1,vel);
|
||||
edotbv = Inpf(e1,bv);
|
||||
|
||||
VecSubf(bv,v1,p1);
|
||||
elen2 = Inpf(e3,e3);
|
||||
edotv = Inpf(e3,vel);
|
||||
@@ -3895,30 +4018,22 @@ int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, f
|
||||
a=elen2*(-Inpf(vel,vel))+edotv*edotv;
|
||||
b=2.0f*(elen2*Inpf(vel,bv)-edotv*edotbv);
|
||||
c=elen2*(radius2-Inpf(bv,bv))+edotbv*edotbv;
|
||||
d=b*b-4*a*c;
|
||||
if(d>=0.0f){
|
||||
if(d==0.0f)
|
||||
t=-b/2*a;
|
||||
else{
|
||||
z=sqrt(d);
|
||||
x=(-b-z)*0.5/a;
|
||||
y=(-b+z)*0.5/a;
|
||||
t=x<y?x:y;
|
||||
}
|
||||
|
||||
e=(edotv*t-edotbv)/elen2;
|
||||
if(getLowestRoot(a, b, c, *lambda, &newLambda))
|
||||
{
|
||||
e=(edotv*newLambda-edotbv)/elen2;
|
||||
|
||||
if((e>=0.0f) && (e<=1.0f)){
|
||||
if(t>0.0 && t < *lambda){
|
||||
*lambda=t;
|
||||
VecCopyf(ipoint,e3);
|
||||
VecMulf(ipoint,e);
|
||||
VecAddf(ipoint,ipoint,v1);
|
||||
found_by_sweep=1;
|
||||
}
|
||||
if(e >= 0.0f && e <= 1.0f)
|
||||
{
|
||||
*lambda = newLambda;
|
||||
VecCopyf(ipoint,e3);
|
||||
VecMulf(ipoint,e);
|
||||
VecAddf(ipoint,ipoint,v1);
|
||||
found_by_sweep=1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return found_by_sweep;
|
||||
}
|
||||
int AxialLineIntersectsTriangle(int axis, float p1[3], float p2[3], float v0[3], float v1[3], float v2[3], float *lambda)
|
||||
@@ -3965,6 +4080,74 @@ int AxialLineIntersectsTriangle(int axis, float p1[3], float p2[3], float v0[3],
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Returns the number of point of interests
|
||||
* 0 - lines are colinear
|
||||
* 1 - lines are coplanar, i1 is set to intersection
|
||||
* 2 - i1 and i2 are the nearest points on line 1 (v1, v2) and line 2 (v3, v4) respectively
|
||||
* */
|
||||
int LineIntersectLine(float v1[3], float v2[3], float v3[3], float v4[3], float i1[3], float i2[3])
|
||||
{
|
||||
float a[3], b[3], c[3], ab[3], cb[3], dir1[3], dir2[3];
|
||||
float d;
|
||||
|
||||
VecSubf(c, v3, v1);
|
||||
VecSubf(a, v2, v1);
|
||||
VecSubf(b, v4, v3);
|
||||
|
||||
VecCopyf(dir1, a);
|
||||
Normalize(dir1);
|
||||
VecCopyf(dir2, b);
|
||||
Normalize(dir2);
|
||||
d = Inpf(dir1, dir2);
|
||||
if (d == 1.0f || d == -1.0f) {
|
||||
/* colinear */
|
||||
return 0;
|
||||
}
|
||||
|
||||
Crossf(ab, a, b);
|
||||
d = Inpf(c, ab);
|
||||
|
||||
/* test if the two lines are coplanar */
|
||||
if (d > -0.000001f && d < 0.000001f) {
|
||||
Crossf(cb, c, b);
|
||||
|
||||
VecMulf(a, Inpf(cb, ab) / Inpf(ab, ab));
|
||||
VecAddf(i1, v1, a);
|
||||
VecCopyf(i2, i1);
|
||||
|
||||
return 1; /* one intersection only */
|
||||
}
|
||||
/* if not */
|
||||
else {
|
||||
float n[3], t[3];
|
||||
float v3t[3], v4t[3];
|
||||
VecSubf(t, v1, v3);
|
||||
|
||||
/* offset between both plane where the lines lies */
|
||||
Crossf(n, a, b);
|
||||
Projf(t, t, n);
|
||||
|
||||
/* for the first line, offset the second line until it is coplanar */
|
||||
VecAddf(v3t, v3, t);
|
||||
VecAddf(v4t, v4, t);
|
||||
|
||||
VecSubf(c, v3t, v1);
|
||||
VecSubf(a, v2, v1);
|
||||
VecSubf(b, v4t, v3);
|
||||
|
||||
Crossf(ab, a, b);
|
||||
Crossf(cb, c, b);
|
||||
|
||||
VecMulf(a, Inpf(cb, ab) / Inpf(ab, ab));
|
||||
VecAddf(i1, v1, a);
|
||||
|
||||
/* for the second line, just substract the offset from the first intersection point */
|
||||
VecSubf(i2, i1, t);
|
||||
|
||||
return 2; /* two nearest points */
|
||||
}
|
||||
}
|
||||
|
||||
int AabbIntersectAabb(float min1[3], float max1[3], float min2[3], float max2[3])
|
||||
{
|
||||
return (min1[0]<max2[0] && min1[1]<max2[1] && min1[2]<max2[2] &&
|
||||
|
||||
@@ -883,6 +883,15 @@ void BLI_cleanup_file(const char *relabase, char *dir)
|
||||
dir = dir+2; /* skip the first // */
|
||||
}
|
||||
}
|
||||
|
||||
/* Note
|
||||
* memmove( start, eind, strlen(eind)+1 );
|
||||
* is the same as
|
||||
* strcpy( start, eind );
|
||||
* except strcpy should not be used because there is overlap,
|
||||
* so use memmove's slightly more obscure syntax - Campbell
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
if(dir[0]=='.') { /* happens for example in FILE_MAIN */
|
||||
get_default_root(dir);
|
||||
@@ -896,17 +905,21 @@ void BLI_cleanup_file(const char *relabase, char *dir)
|
||||
if (dir[a] == '\\') break;
|
||||
a--;
|
||||
}
|
||||
strcpy(dir+a,eind);
|
||||
if (a<0) {
|
||||
break;
|
||||
} else {
|
||||
memmove( dir+a, eind, strlen(eind)+1 );
|
||||
}
|
||||
}
|
||||
|
||||
while ( (start = strstr(dir,"\\.\\")) ){
|
||||
eind = start + strlen("\\.\\") - 1;
|
||||
strcpy(start,eind);
|
||||
memmove( start, eind, strlen(eind)+1 );
|
||||
}
|
||||
|
||||
while ( (start = strstr(dir,"\\\\" )) ){
|
||||
eind = start + strlen("\\\\") - 1;
|
||||
strcpy(start,eind);
|
||||
memmove( start, eind, strlen(eind)+1 );
|
||||
}
|
||||
|
||||
if((a = strlen(dir))){ /* remove the '\\' at the end */
|
||||
@@ -929,17 +942,21 @@ void BLI_cleanup_file(const char *relabase, char *dir)
|
||||
if (dir[a] == '/') break;
|
||||
a--;
|
||||
}
|
||||
strcpy(dir+a,eind);
|
||||
if (a<0) {
|
||||
break;
|
||||
} else {
|
||||
memmove( dir+a, eind, strlen(eind)+1 );
|
||||
}
|
||||
}
|
||||
|
||||
while ( (start = strstr(dir,"/./")) ){
|
||||
eind = start + strlen("/./") - 1;
|
||||
strcpy(start,eind);
|
||||
memmove( start, eind, strlen(eind)+1 );
|
||||
}
|
||||
|
||||
while ( (start = strstr(dir,"//" )) ){
|
||||
eind = start + strlen("//") - 1;
|
||||
strcpy(start,eind);
|
||||
memmove( start, eind, strlen(eind)+1 );
|
||||
}
|
||||
|
||||
if( (a = strlen(dir)) ){ /* remove all '/' at the end */
|
||||
@@ -1118,8 +1135,8 @@ int BLI_convertstringcode(char *path, const char *basepath)
|
||||
char vol[3] = {'\0', '\0', '\0'};
|
||||
|
||||
BLI_strncpy(vol, path, 3);
|
||||
wasrelative= (strncmp(vol, "//", 2)==0);
|
||||
|
||||
wasrelative= (vol[0]=='/' && vol[1]=='/');
|
||||
|
||||
#ifdef WIN32
|
||||
/* we are checking here if we have an absolute path that is not in the current
|
||||
blend file as a lib main - we are basically checking for the case that a
|
||||
@@ -1156,7 +1173,7 @@ int BLI_convertstringcode(char *path, const char *basepath)
|
||||
|
||||
/* Paths starting with // will get the blend file as their base,
|
||||
* this isnt standard in any os but is uesed in blender all over the place */
|
||||
if (tmp[0] == '/' && tmp[1] == '/') {
|
||||
if (wasrelative) {
|
||||
char *lslash= BLI_last_slash(base);
|
||||
if (lslash) {
|
||||
int baselen= (int) (lslash-base) + 1;
|
||||
@@ -1705,6 +1722,7 @@ void BLI_where_am_i(char *fullname, const char *name)
|
||||
path = br_find_exe( NULL );
|
||||
if (path) {
|
||||
strcpy(fullname, path);
|
||||
free(path);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2991,6 +2991,10 @@ static void lib_link_object(FileData *fd, Main *main)
|
||||
bActionActuator *aa= act->data;
|
||||
aa->act= newlibadr(fd, ob->id.lib, aa->act);
|
||||
}
|
||||
else if(act->type==ACT_SHAPEACTION) {
|
||||
bActionActuator *aa= act->data;
|
||||
aa->act= newlibadr(fd, ob->id.lib, aa->act);
|
||||
}
|
||||
else if(act->type==ACT_PROPERTY) {
|
||||
bPropertyActuator *pa= act->data;
|
||||
pa->ob= newlibadr(fd, ob->id.lib, pa->ob);
|
||||
@@ -3007,6 +3011,9 @@ static void lib_link_object(FileData *fd, Main *main)
|
||||
bParentActuator *parenta = act->data;
|
||||
parenta->ob = newlibadr(fd, ob->id.lib, parenta->ob);
|
||||
}
|
||||
else if(act->type==ACT_STATE) {
|
||||
/* bStateActuator *statea = act->data; */
|
||||
}
|
||||
act= act->next;
|
||||
}
|
||||
|
||||
@@ -3303,11 +3310,19 @@ static void direct_link_object(FileData *fd, Object *ob)
|
||||
direct_link_constraints(fd, &ob->constraints);
|
||||
|
||||
link_glob_list(fd, &ob->controllers);
|
||||
if (ob->init_state) {
|
||||
/* if a known first state is specified, set it so that the game will start ok */
|
||||
ob->state = ob->init_state;
|
||||
} else if (!ob->state) {
|
||||
ob->state = 1;
|
||||
}
|
||||
cont= ob->controllers.first;
|
||||
while(cont) {
|
||||
cont->data= newdataadr(fd, cont->data);
|
||||
cont->links= newdataadr(fd, cont->links);
|
||||
test_pointer_array(fd, (void **)&cont->links);
|
||||
if (cont->state_mask == 0)
|
||||
cont->state_mask = 1;
|
||||
cont= cont->next;
|
||||
}
|
||||
|
||||
@@ -7631,6 +7646,24 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
}
|
||||
}
|
||||
|
||||
/* sun/sky */
|
||||
if ((main->versionfile < 246) ){
|
||||
Lamp *la;
|
||||
for(la=main->lamp.first; la; la= la->id.next) {
|
||||
la->sun_effect_type = 0;
|
||||
la->horizon_brightness = 1.0;
|
||||
la->spread = 1.0;
|
||||
la->sun_brightness = 1.0;
|
||||
la->sun_size = 1.0;
|
||||
la->backscattered_light = 1.0;
|
||||
la->atm_turbidity = 2.0;
|
||||
la->atm_inscattering_factor = 1.0;
|
||||
la->atm_extinction_factor = 1.0;
|
||||
la->atm_distance_factor = 1.0;
|
||||
la->sun_intensity = 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
|
||||
/* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */
|
||||
|
||||
@@ -8399,6 +8432,10 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
|
||||
bActionActuator *aa= act->data;
|
||||
expand_doit(fd, mainvar, aa->act);
|
||||
}
|
||||
else if(act->type==ACT_SHAPEACTION) {
|
||||
bActionActuator *aa= act->data;
|
||||
expand_doit(fd, mainvar, aa->act);
|
||||
}
|
||||
else if(act->type==ACT_PROPERTY) {
|
||||
bPropertyActuator *pa= act->data;
|
||||
expand_doit(fd, mainvar, pa->ob);
|
||||
|
||||
@@ -603,6 +603,9 @@ static void write_sensors(WriteData *wd, ListBase *lb)
|
||||
case SENS_PROPERTY:
|
||||
writestruct(wd, DATA, "bPropertySensor", 1, sens->data);
|
||||
break;
|
||||
case SENS_ACTUATOR:
|
||||
writestruct(wd, DATA, "bActuatorSensor", 1, sens->data);
|
||||
break;
|
||||
case SENS_COLLISION:
|
||||
writestruct(wd, DATA, "bCollisionSensor", 1, sens->data);
|
||||
break;
|
||||
@@ -664,6 +667,7 @@ static void write_actuators(WriteData *wd, ListBase *lb)
|
||||
|
||||
switch(act->type) {
|
||||
case ACT_ACTION:
|
||||
case ACT_SHAPEACTION:
|
||||
writestruct(wd, DATA, "bActionActuator", 1, act->data);
|
||||
break;
|
||||
case ACT_SOUND:
|
||||
@@ -714,6 +718,9 @@ static void write_actuators(WriteData *wd, ListBase *lb)
|
||||
case ACT_PARENT:
|
||||
writestruct(wd, DATA, "bParentActuator", 1, act->data);
|
||||
break;
|
||||
case ACT_STATE:
|
||||
writestruct(wd, DATA, "bStateActuator", 1, act->data);
|
||||
break;
|
||||
default:
|
||||
; /* error: don't know how to write this file */
|
||||
}
|
||||
|
||||
@@ -149,6 +149,7 @@ typedef enum {
|
||||
#define IB_zbuffloat (1 << 16)
|
||||
#define IB_multilayer (1 << 17)
|
||||
#define IB_imginfo (1 << 18)
|
||||
#define IB_animdeinterlace (1 << 19)
|
||||
|
||||
/*
|
||||
* The bit flag is stored in the ImBuf.ftype variable.
|
||||
|
||||
@@ -183,8 +183,9 @@ struct anim {
|
||||
AVFormatContext *pFormatCtx;
|
||||
AVCodecContext *pCodecCtx;
|
||||
AVCodec *pCodec;
|
||||
AVFrame *pFrameRGB;
|
||||
AVFrame *pFrame;
|
||||
AVFrame *pFrameRGB;
|
||||
AVFrame *pFrameDeinterlaced;
|
||||
struct SwsContext *img_convert_ctx;
|
||||
int videoStream;
|
||||
#endif
|
||||
|
||||
@@ -600,6 +600,7 @@ static int startffmpeg(struct anim * anim) {
|
||||
anim->videoStream = videoStream;
|
||||
|
||||
anim->pFrame = avcodec_alloc_frame();
|
||||
anim->pFrameDeinterlaced = avcodec_alloc_frame();
|
||||
anim->pFrameRGB = avcodec_alloc_frame();
|
||||
|
||||
if (avpicture_get_size(PIX_FMT_BGR32, anim->x, anim->y)
|
||||
@@ -609,10 +610,20 @@ static int startffmpeg(struct anim * anim) {
|
||||
avcodec_close(anim->pCodecCtx);
|
||||
av_close_input_file(anim->pFormatCtx);
|
||||
av_free(anim->pFrameRGB);
|
||||
av_free(anim->pFrameDeinterlaced);
|
||||
av_free(anim->pFrame);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (anim->ib_flags & IB_animdeinterlace) {
|
||||
avpicture_fill((AVPicture*) anim->pFrameDeinterlaced,
|
||||
MEM_callocN(avpicture_get_size(
|
||||
anim->pCodecCtx->pix_fmt,
|
||||
anim->x, anim->y),
|
||||
"ffmpeg deinterlace"),
|
||||
anim->pCodecCtx->pix_fmt, anim->x, anim->y);
|
||||
}
|
||||
|
||||
if (pCodecCtx->has_b_frames) {
|
||||
anim->preseek = 25; /* FIXME: detect gopsize ... */
|
||||
} else {
|
||||
@@ -638,12 +649,13 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) {
|
||||
AVPacket packet;
|
||||
int64_t pts_to_search = 0;
|
||||
int pos_found = 1;
|
||||
int filter_y = 0;
|
||||
|
||||
if (anim == 0) return (0);
|
||||
|
||||
ibuf = IMB_allocImBuf(anim->x, anim->y, 24, IB_rect, 0);
|
||||
|
||||
avpicture_fill((AVPicture *)anim->pFrameRGB,
|
||||
avpicture_fill((AVPicture*) anim->pFrameRGB,
|
||||
(unsigned char*) ibuf->rect,
|
||||
PIX_FMT_BGR32, anim->x, anim->y);
|
||||
|
||||
@@ -722,6 +734,32 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) {
|
||||
}
|
||||
|
||||
if(frameFinished && pos_found == 1) {
|
||||
AVFrame * input = anim->pFrame;
|
||||
|
||||
/* This means the data wasnt read properly,
|
||||
this check stops crashing */
|
||||
if (input->data[0]==0 && input->data[1]==0
|
||||
&& input->data[2]==0 && input->data[3]==0){
|
||||
av_free_packet(&packet);
|
||||
break;
|
||||
}
|
||||
|
||||
if (anim->ib_flags & IB_animdeinterlace) {
|
||||
if (avpicture_deinterlace(
|
||||
(AVPicture*)
|
||||
anim->pFrameDeinterlaced,
|
||||
(const AVPicture*)
|
||||
anim->pFrame,
|
||||
anim->pCodecCtx->pix_fmt,
|
||||
anim->pCodecCtx->width,
|
||||
anim->pCodecCtx->height)
|
||||
< 0) {
|
||||
filter_y = 1;
|
||||
} else {
|
||||
input = anim->pFrameDeinterlaced;
|
||||
}
|
||||
}
|
||||
|
||||
if (G.order == B_ENDIAN) {
|
||||
int * dstStride
|
||||
= anim->pFrameRGB->linesize;
|
||||
@@ -735,8 +773,8 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) {
|
||||
unsigned char* top;
|
||||
|
||||
sws_scale(anim->img_convert_ctx,
|
||||
anim->pFrame->data,
|
||||
anim->pFrame->linesize,
|
||||
input->data,
|
||||
input->linesize,
|
||||
0,
|
||||
anim->pCodecCtx->height,
|
||||
dst2,
|
||||
@@ -793,27 +831,25 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) {
|
||||
int i;
|
||||
unsigned char* r;
|
||||
|
||||
/* This means the data wasnt read properly, this check stops crashing */
|
||||
if (anim->pFrame->data[0]!=0 || anim->pFrame->data[1]!=0 || anim->pFrame->data[2]!=0 || anim->pFrame->data[3]!=0) {
|
||||
|
||||
sws_scale(anim->img_convert_ctx,
|
||||
anim->pFrame->data,
|
||||
anim->pFrame->linesize,
|
||||
0,
|
||||
anim->pCodecCtx->height,
|
||||
dst2,
|
||||
dstStride2);
|
||||
sws_scale(anim->img_convert_ctx,
|
||||
input->data,
|
||||
input->linesize,
|
||||
0,
|
||||
anim->pCodecCtx->height,
|
||||
dst2,
|
||||
dstStride2);
|
||||
|
||||
/* workaround: sws_scale
|
||||
sets alpha = 0... */
|
||||
/* workaround: sws_scale
|
||||
sets alpha = 0... */
|
||||
|
||||
r = (unsigned char*) ibuf->rect;
|
||||
|
||||
for (i = 0; i < ibuf->x * ibuf->y;i++){
|
||||
r[3] = 0xff;
|
||||
r+=4;
|
||||
}
|
||||
r = (unsigned char*) ibuf->rect;
|
||||
|
||||
for (i = 0; i < ibuf->x * ibuf->y;i++){
|
||||
r[3] = 0xff;
|
||||
r+=4;
|
||||
}
|
||||
|
||||
av_free_packet(&packet);
|
||||
break;
|
||||
}
|
||||
@@ -823,6 +859,10 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) {
|
||||
av_free_packet(&packet);
|
||||
}
|
||||
|
||||
if (filter_y && ibuf) {
|
||||
IMB_filtery(ibuf);
|
||||
}
|
||||
|
||||
return(ibuf);
|
||||
}
|
||||
|
||||
@@ -834,6 +874,11 @@ static void free_anim_ffmpeg(struct anim * anim) {
|
||||
av_close_input_file(anim->pFormatCtx);
|
||||
av_free(anim->pFrameRGB);
|
||||
av_free(anim->pFrame);
|
||||
|
||||
if (anim->ib_flags & IB_animdeinterlace) {
|
||||
MEM_freeN(anim->pFrameDeinterlaced->data[0]);
|
||||
}
|
||||
av_free(anim->pFrameDeinterlaced);
|
||||
sws_freeContext(anim->img_convert_ctx);
|
||||
}
|
||||
anim->duration = 0;
|
||||
@@ -983,6 +1028,7 @@ struct ImBuf * IMB_anim_absolute(struct anim * anim, int position) {
|
||||
char head[256], tail[256];
|
||||
unsigned short digits;
|
||||
int pic;
|
||||
int filter_y = (anim->ib_flags & IB_animdeinterlace);
|
||||
|
||||
if (anim == NULL) return(0);
|
||||
|
||||
@@ -1040,6 +1086,7 @@ struct ImBuf * IMB_anim_absolute(struct anim * anim, int position) {
|
||||
case ANIM_FFMPEG:
|
||||
ibuf = ffmpeg_fetchibuf(anim, position);
|
||||
if (ibuf) anim->curposition = position;
|
||||
filter_y = 0; /* done internally */
|
||||
break;
|
||||
#endif
|
||||
#ifdef WITH_REDCODE
|
||||
@@ -1052,6 +1099,7 @@ struct ImBuf * IMB_anim_absolute(struct anim * anim, int position) {
|
||||
|
||||
if (ibuf) {
|
||||
if (anim->ib_flags & IB_ttob) IMB_flipy(ibuf);
|
||||
if (filter_y) IMB_filtery(ibuf);
|
||||
sprintf(ibuf->name, "%s.%04d", anim->name, anim->curposition + 1);
|
||||
|
||||
}
|
||||
|
||||
@@ -441,10 +441,15 @@ intern_dpxOpen(int mode, const char* bytestuff, int bufsize) {
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
dpx->bitsPerPixel = 10;
|
||||
/* dpx->bitsPerPixel = header.imageInfo.channel[0].bits_per_pixel; */
|
||||
dpx->imageOffset = ntohl(header.fileInfo.offset);
|
||||
/* dpx->bitsPerPixel = 10; */
|
||||
dpx->bitsPerPixel = header.imageInfo.channel[0].bits_per_pixel;
|
||||
if (dpx->bitsPerPixel != 10) {
|
||||
if (verbose) d_printf("Don't support depth: %d\n", dpx->bitsPerPixel);
|
||||
dpxClose(dpx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
dpx->imageOffset = ntohl(header.fileInfo.offset);
|
||||
dpx->lineBufferLength = pixelsToLongs(dpx->width * dpx->depth);
|
||||
dpx->lineBuffer = malloc(dpx->lineBufferLength * 4);
|
||||
if (dpx->lineBuffer == 0) {
|
||||
@@ -471,6 +476,26 @@ intern_dpxOpen(int mode, const char* bytestuff, int bufsize) {
|
||||
dpx->fileYPos = 0;
|
||||
|
||||
logImageGetByteConversionDefaults(&dpx->params);
|
||||
/* The SMPTE define this code:
|
||||
* 2 - Linear
|
||||
* 3 - Logarithmic
|
||||
*
|
||||
* Note that transfer_characteristics is U8, don't need
|
||||
* check the byte order.
|
||||
*/
|
||||
switch (header.imageInfo.channel[0].transfer_characteristics) {
|
||||
case 2:
|
||||
dpx->params.doLogarithm= 0;
|
||||
break;
|
||||
case 3:
|
||||
dpx->params.doLogarithm= 1;
|
||||
break;
|
||||
default:
|
||||
if (verbose) d_printf("Un-supported Transfer Characteristics: %d\n", header.imageInfo.channel[0].transfer_characteristics);
|
||||
dpxClose(dpx);
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
setupLut(dpx);
|
||||
|
||||
dpx->getRow = &dpxGetRowBytes;
|
||||
@@ -563,6 +588,18 @@ dpxCreate(const char* filename, int width, int height, int depth) {
|
||||
++shortFilename;
|
||||
}
|
||||
initDpxMainHeader(dpx, &header, shortFilename);
|
||||
logImageGetByteConversionDefaults(&dpx->params);
|
||||
/* Need set the file type before write the header!
|
||||
* 2 - Linear
|
||||
* 3 - Logarithmic
|
||||
*
|
||||
* Note that transfer characteristics is U8, don't need
|
||||
* check the byte order.
|
||||
*/
|
||||
if (dpx->params.doLogarithm == 0)
|
||||
header.imageInfo.channel[0].transfer_characteristics= 2;
|
||||
else
|
||||
header.imageInfo.channel[0].transfer_characteristics= 3;
|
||||
|
||||
if (fwrite(&header, sizeof(header), 1, dpx->file) == 0) {
|
||||
if (verbose) d_printf("Couldn't write image header\n");
|
||||
@@ -570,8 +607,6 @@ dpxCreate(const char* filename, int width, int height, int depth) {
|
||||
return 0;
|
||||
}
|
||||
dpx->fileYPos = 0;
|
||||
|
||||
logImageGetByteConversionDefaults(&dpx->params);
|
||||
setupLut(dpx);
|
||||
|
||||
dpx->getRow = 0;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user