Merged changes in the trunk up to revision 28536.
This commit is contained in:
@@ -102,9 +102,9 @@ ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
|
|||||||
|
|
||||||
# For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
|
# For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
|
||||||
# On Unix:
|
# On Unix:
|
||||||
# cmake -D PYTHON_LIB=/usr/local/lib/python2.3/config/libpython2.3.so -D PYTHON_INC=/usr/local/include/python2.3 -D PYTHON_BINARY=/usr/local/bin/python2.3 -G "Unix Makefiles" ../blender
|
# cmake -D PYTHON_LIB=/usr/local/lib/python3.1/config/libpython3.1.so -D PYTHON_INC=/usr/local/include/python3.1 -G "Unix Makefiles" ../blender
|
||||||
# On Macs:
|
# On Macs:
|
||||||
# cmake -D PYTHON_INC=/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config -D PYTHON_BINARY=/System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5 -G Xcode ../blender
|
# cmake -D PYTHON_INC=/System/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1 -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/config -G Xcode ../blender
|
||||||
#
|
#
|
||||||
# When changing any of this remember to update the notes in doc/blender-cmake.txt
|
# When changing any of this remember to update the notes in doc/blender-cmake.txt
|
||||||
|
|
||||||
@@ -479,7 +479,7 @@ IF(APPLE)
|
|||||||
# otherwise, use custom system framework
|
# otherwise, use custom system framework
|
||||||
|
|
||||||
SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/)
|
SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/)
|
||||||
SET(PYTHON_VERSION 2.5)
|
SET(PYTHON_VERSION 3.1)
|
||||||
SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}")
|
SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}")
|
||||||
# SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION}) # not used yet
|
# SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION}) # not used yet
|
||||||
SET(PYTHON_LIB "")
|
SET(PYTHON_LIB "")
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
|
|||||||
BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
|
BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
|
||||||
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' #BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
|
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' #BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
|
||||||
BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']
|
BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']
|
||||||
BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/python2.5/config/libpython${BF_PYTHON_VERSION}.a'
|
BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}/config/libpython${BF_PYTHON_VERSION}.a'
|
||||||
|
|
||||||
WITH_BF_OPENAL = 'false'
|
WITH_BF_OPENAL = 'false'
|
||||||
WITH_BF_STATICOPENAL = 'false'
|
WITH_BF_STATICOPENAL = 'false'
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
|
|||||||
BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
|
BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
|
||||||
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' #BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
|
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' #BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
|
||||||
BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']
|
BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']
|
||||||
BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/python2.5/config/libpython${BF_PYTHON_VERSION}.a'
|
BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}/config/libpython${BF_PYTHON_VERSION}.a'
|
||||||
|
|
||||||
WITH_BF_OPENAL = 'true'
|
WITH_BF_OPENAL = 'true'
|
||||||
WITH_BF_STATICOPENAL = 'true'
|
WITH_BF_STATICOPENAL = 'true'
|
||||||
|
|||||||
@@ -175,10 +175,10 @@ CXX = 'g++'
|
|||||||
##ifeq ($CPU),alpha)
|
##ifeq ($CPU),alpha)
|
||||||
## CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee
|
## CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee
|
||||||
|
|
||||||
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
|
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
|
||||||
|
|
||||||
CPPFLAGS = []
|
CPPFLAGS = []
|
||||||
CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
|
CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
|
||||||
REL_CFLAGS = ['-O2']
|
REL_CFLAGS = ['-O2']
|
||||||
REL_CCFLAGS = ['-O2']
|
REL_CCFLAGS = ['-O2']
|
||||||
##BF_DEPEND = True
|
##BF_DEPEND = True
|
||||||
|
|||||||
@@ -132,9 +132,9 @@ $Id$
|
|||||||
The commandline can be used to override detected/default settings, e.g:
|
The commandline can be used to override detected/default settings, e.g:
|
||||||
|
|
||||||
On Unix:
|
On Unix:
|
||||||
cmake -D PYTHON_LIB=/usr/local/lib/python2.3/config/libpython2.3.so -D PYTHON_INC=/usr/local/include/python2.3 -D PYTHON_BINARY=/usr/local/bin/python2.3 -G "Unix Makefiles" ../blender
|
cmake -D PYTHON_LIB=/usr/local/lib/python3.1/config/libpython3.1.so -D PYTHON_INC=/usr/local/include/python3.1 -G "Unix Makefiles" ../blender
|
||||||
On Macs:
|
On Macs:
|
||||||
cmake -D PYTHON_INC=/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config -D PYTHON_BINARY=/System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5 -G Xcode ../blender
|
cmake -D PYTHON_INC=/System/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1 -G Xcode ../blender
|
||||||
|
|
||||||
Mote that this should only be needed once per build directory generation because it will keep the overrides in CMakeCache.txt for subsequent runs.
|
Mote that this should only be needed once per build directory generation because it will keep the overrides in CMakeCache.txt for subsequent runs.
|
||||||
|
|
||||||
|
|||||||
2
extern/libopenjpeg/opj_malloc.h
vendored
2
extern/libopenjpeg/opj_malloc.h
vendored
@@ -76,7 +76,7 @@ Allocate memory aligned to a 16 byte boundry
|
|||||||
#if defined(__sun)
|
#if defined(__sun)
|
||||||
#define HAVE_MEMALIGN
|
#define HAVE_MEMALIGN
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
#ifndef __APPLE__
|
#if !defined(__APPLE__) && !defined(__FreeBSD__)
|
||||||
#define HAVE_MEMALIGN
|
#define HAVE_MEMALIGN
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
13
extern/libopenjpeg/patches/fbsd.patch
vendored
Normal file
13
extern/libopenjpeg/patches/fbsd.patch
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
Index: extern/libopenjpeg/opj_malloc.h
|
||||||
|
===================================================================
|
||||||
|
--- extern/libopenjpeg/opj_malloc.h (revision 27736)
|
||||||
|
+++ extern/libopenjpeg/opj_malloc.h (working copy)
|
||||||
|
@@ -76,7 +76,7 @@
|
||||||
|
#if defined(__sun)
|
||||||
|
#define HAVE_MEMALIGN
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
- #ifndef __APPLE__
|
||||||
|
+ #if !defined(__APPLE__) && !defined(__FreeBSD__)
|
||||||
|
#define HAVE_MEMALIGN
|
||||||
|
#include <malloc.h>
|
||||||
|
#endif
|
||||||
@@ -84,11 +84,15 @@ static AUD_IDevice* AUD_device = NULL;
|
|||||||
static int AUD_available_devices[4];
|
static int AUD_available_devices[4];
|
||||||
static AUD_I3DDevice* AUD_3ddevice = NULL;
|
static AUD_I3DDevice* AUD_3ddevice = NULL;
|
||||||
|
|
||||||
int AUD_init(AUD_DeviceType device, AUD_DeviceSpecs specs, int buffersize)
|
void AUD_initOnce()
|
||||||
{
|
{
|
||||||
#ifdef WITH_FFMPEG
|
#ifdef WITH_FFMPEG
|
||||||
av_register_all();
|
av_register_all();
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int AUD_init(AUD_DeviceType device, AUD_DeviceSpecs specs, int buffersize)
|
||||||
|
{
|
||||||
AUD_IDevice* dev = NULL;
|
AUD_IDevice* dev = NULL;
|
||||||
|
|
||||||
if(AUD_device)
|
if(AUD_device)
|
||||||
|
|||||||
@@ -55,6 +55,11 @@ typedef struct
|
|||||||
typedef void (*AUD_syncFunction)(void*, int, float);
|
typedef void (*AUD_syncFunction)(void*, int, float);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes FFMPEG if it is enabled.
|
||||||
|
*/
|
||||||
|
extern void AUD_initOnce();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes an audio device.
|
* Initializes an audio device.
|
||||||
* \param device The device type that should be used.
|
* \param device The device type that should be used.
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "BSP_MeshPrimitives.h"
|
#include "BSP_MeshPrimitives.h"
|
||||||
|
|
||||||
#include "MT_assert.h"
|
#include "MT_assert.h"
|
||||||
|
|||||||
@@ -30,10 +30,6 @@
|
|||||||
* Implementation of external api for CSG part of BSP lib interface.
|
* Implementation of external api for CSG part of BSP lib interface.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "../extern/CSG_BooleanOps.h"
|
#include "../extern/CSG_BooleanOps.h"
|
||||||
#include "BSP_CSGMesh_CFIterator.h"
|
#include "BSP_CSGMesh_CFIterator.h"
|
||||||
#include "MEM_RefCountPtr.h"
|
#include "MEM_RefCountPtr.h"
|
||||||
|
|||||||
@@ -31,10 +31,6 @@
|
|||||||
* $Id$
|
* $Id$
|
||||||
* Copyright (C) 2001 NaN Technologies B.V.
|
* Copyright (C) 2001 NaN Technologies B.V.
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(WIN32) || defined(__APPLE__)
|
#if defined(WIN32) || defined(__APPLE__)
|
||||||
# ifdef WIN32
|
# ifdef WIN32
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "BSP_MeshDrawer.h"
|
#include "BSP_MeshDrawer.h"
|
||||||
|
|
||||||
#include "BSP_TMesh.h"
|
#include "BSP_TMesh.h"
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "BSP_PlyLoader.h"
|
#include "BSP_PlyLoader.h"
|
||||||
|
|
||||||
#include "MT_Vector3.h"
|
#include "MT_Vector3.h"
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "BSP_GhostTest3D.h"
|
#include "BSP_GhostTest3D.h"
|
||||||
|
|
||||||
#include "BSP_TMesh.h"
|
#include "BSP_TMesh.h"
|
||||||
|
|||||||
@@ -67,10 +67,6 @@ WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "ply.h"
|
#include "ply.h"
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
char *type_names[] = {
|
char *type_names[] = {
|
||||||
"invalid",
|
"invalid",
|
||||||
"char", "short", "int",
|
"char", "short", "int",
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "CTR_List.h"
|
#include "CTR_List.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "LOD_EdgeCollapser.h"
|
#include "LOD_EdgeCollapser.h"
|
||||||
|
|
||||||
#include "LOD_ManMesh2.h"
|
#include "LOD_ManMesh2.h"
|
||||||
|
|||||||
@@ -29,10 +29,6 @@
|
|||||||
#include "LOD_ExternNormalEditor.h"
|
#include "LOD_ExternNormalEditor.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,10 +29,6 @@
|
|||||||
// implementation of LOD_FaceNormalEditor.h
|
// implementation of LOD_FaceNormalEditor.h
|
||||||
|
|
||||||
///////////////////////////////////////
|
///////////////////////////////////////
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "LOD_FaceNormalEditor.h"
|
#include "LOD_FaceNormalEditor.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "LOD_ManMesh2.h"
|
#include "LOD_ManMesh2.h"
|
||||||
|
|
||||||
#include "MT_assert.h"
|
#include "MT_assert.h"
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "LOD_MeshPrimitives.h"
|
#include "LOD_MeshPrimitives.h"
|
||||||
|
|
||||||
#include "MT_assert.h"
|
#include "MT_assert.h"
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "LOD_QSDecimator.h"
|
#include "LOD_QSDecimator.h"
|
||||||
|
|
||||||
#include "LOD_ExternBufferEditor.h"
|
#include "LOD_ExternBufferEditor.h"
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "LOD_QuadricEditor.h"
|
#include "LOD_QuadricEditor.h"
|
||||||
#include "LOD_ExternNormalEditor.h"
|
#include "LOD_ExternNormalEditor.h"
|
||||||
|
|
||||||
|
|||||||
@@ -27,10 +27,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// implementation of external c api
|
// implementation of external c api
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "../extern/LOD_decimation.h"
|
#include "../extern/LOD_decimation.h"
|
||||||
#include "LOD_DecimationClass.h"
|
#include "LOD_DecimationClass.h"
|
||||||
|
|
||||||
|
|||||||
@@ -28,10 +28,6 @@
|
|||||||
|
|
||||||
#include "GHOST_Buttons.h"
|
#include "GHOST_Buttons.h"
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GHOST_Buttons::GHOST_Buttons()
|
GHOST_Buttons::GHOST_Buttons()
|
||||||
|
|||||||
@@ -37,10 +37,6 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "intern/GHOST_Debug.h"
|
#include "intern/GHOST_Debug.h"
|
||||||
#include "GHOST_C-api.h"
|
#include "GHOST_C-api.h"
|
||||||
#include "GHOST_ISystem.h"
|
#include "GHOST_ISystem.h"
|
||||||
|
|||||||
@@ -34,10 +34,6 @@
|
|||||||
* @date October 25, 2001
|
* @date October 25, 2001
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "GHOST_Debug.h"
|
#include "GHOST_Debug.h"
|
||||||
#include "GHOST_C-api.h"
|
#include "GHOST_C-api.h"
|
||||||
#include "GHOST_CallbackEventConsumer.h"
|
#include "GHOST_CallbackEventConsumer.h"
|
||||||
|
|||||||
@@ -32,10 +32,6 @@
|
|||||||
* @date September 21, 2001
|
* @date September 21, 2001
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "GHOST_DisplayManager.h"
|
#include "GHOST_DisplayManager.h"
|
||||||
#include "GHOST_Debug.h"
|
#include "GHOST_Debug.h"
|
||||||
|
|
||||||
|
|||||||
@@ -34,10 +34,6 @@
|
|||||||
* @date September 21, 2001
|
* @date September 21, 2001
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "GHOST_DisplayManagerCarbon.h"
|
#include "GHOST_DisplayManagerCarbon.h"
|
||||||
#include "GHOST_Debug.h"
|
#include "GHOST_Debug.h"
|
||||||
|
|
||||||
|
|||||||
@@ -34,10 +34,6 @@
|
|||||||
* @date September 21, 2001
|
* @date September 21, 2001
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "GHOST_DisplayManagerWin32.h"
|
#include "GHOST_DisplayManagerWin32.h"
|
||||||
#include "GHOST_Debug.h"
|
#include "GHOST_Debug.h"
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "GHOST_DisplayManagerX11.h"
|
#include "GHOST_DisplayManagerX11.h"
|
||||||
#include "GHOST_SystemX11.h"
|
#include "GHOST_SystemX11.h"
|
||||||
|
|
||||||
|
|||||||
@@ -38,10 +38,6 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "GHOST_Debug.h"
|
#include "GHOST_Debug.h"
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
GHOST_EventManager::GHOST_EventManager()
|
GHOST_EventManager::GHOST_EventManager()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,10 +36,6 @@
|
|||||||
#include "GHOST_EventDragnDrop.h"
|
#include "GHOST_EventDragnDrop.h"
|
||||||
#include "GHOST_Debug.h"
|
#include "GHOST_Debug.h"
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
bool GHOST_EventPrinter::processEvent(GHOST_IEvent* event)
|
bool GHOST_EventPrinter::processEvent(GHOST_IEvent* event)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,10 +34,6 @@
|
|||||||
* @date May 7, 2001
|
* @date May 7, 2001
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "GHOST_ISystem.h"
|
#include "GHOST_ISystem.h"
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
|||||||
@@ -34,10 +34,6 @@
|
|||||||
* @date May 31, 2001
|
* @date May 31, 2001
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "GHOST_ModifierKeys.h"
|
#include "GHOST_ModifierKeys.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "GHOST_Rect.h"
|
#include "GHOST_Rect.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -34,10 +34,6 @@
|
|||||||
* @date May 7, 2001
|
* @date May 7, 2001
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "GHOST_System.h"
|
#include "GHOST_System.h"
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|||||||
@@ -34,10 +34,6 @@
|
|||||||
* @date May 7, 2001
|
* @date May 7, 2001
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "GHOST_SystemWin32.h"
|
#include "GHOST_SystemWin32.h"
|
||||||
#include "GHOST_EventDragnDrop.h"
|
#include "GHOST_EventDragnDrop.h"
|
||||||
|
|
||||||
|
|||||||
@@ -29,10 +29,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "GHOST_SystemX11.h"
|
#include "GHOST_SystemX11.h"
|
||||||
#include "GHOST_WindowX11.h"
|
#include "GHOST_WindowX11.h"
|
||||||
#include "GHOST_WindowManager.h"
|
#include "GHOST_WindowManager.h"
|
||||||
|
|||||||
@@ -34,10 +34,6 @@
|
|||||||
* @date May 31, 2001
|
* @date May 31, 2001
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "GHOST_TimerManager.h"
|
#include "GHOST_TimerManager.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|||||||
@@ -32,10 +32,6 @@
|
|||||||
* @date May 10, 2001
|
* @date May 10, 2001
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "GHOST_Window.h"
|
#include "GHOST_Window.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -34,10 +34,6 @@
|
|||||||
* @date May 10, 2001
|
* @date May 10, 2001
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "GHOST_WindowCarbon.h"
|
#include "GHOST_WindowCarbon.h"
|
||||||
#include "GHOST_Debug.h"
|
#include "GHOST_Debug.h"
|
||||||
|
|
||||||
|
|||||||
@@ -34,10 +34,6 @@
|
|||||||
* @date May 11, 2001
|
* @date May 11, 2001
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "GHOST_WindowManager.h"
|
#include "GHOST_WindowManager.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "GHOST_Debug.h"
|
#include "GHOST_Debug.h"
|
||||||
|
|||||||
@@ -34,10 +34,6 @@
|
|||||||
* @date May 10, 2001
|
* @date May 10, 2001
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "GHOST_WindowWin32.h"
|
#include "GHOST_WindowWin32.h"
|
||||||
#include "GHOST_SystemWin32.h"
|
#include "GHOST_SystemWin32.h"
|
||||||
|
|||||||
@@ -45,10 +45,6 @@
|
|||||||
|
|
||||||
#define FALSE 0
|
#define FALSE 0
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "GHOST_C-api.h"
|
#include "GHOST_C-api.h"
|
||||||
|
|
||||||
#if defined(WIN32) || defined(__APPLE__)
|
#if defined(WIN32) || defined(__APPLE__)
|
||||||
|
|||||||
@@ -41,10 +41,6 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(WIN32) || defined(__APPLE__)
|
#if defined(WIN32) || defined(__APPLE__)
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|||||||
@@ -28,10 +28,6 @@
|
|||||||
|
|
||||||
#include "Basic.h"
|
#include "Basic.h"
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int min_i(int a, int b) {
|
int min_i(int a, int b) {
|
||||||
return (a<b)?a:b;
|
return (a<b)?a:b;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,10 +30,6 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
|
|
||||||
#include "GHOST_C-api.h"
|
#include "GHOST_C-api.h"
|
||||||
|
|||||||
@@ -39,10 +39,6 @@
|
|||||||
|
|
||||||
#include "GL.h"
|
#include "GL.h"
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
|
|
||||||
#include "GHOST_C-api.h"
|
#include "GHOST_C-api.h"
|
||||||
|
|||||||
@@ -30,10 +30,6 @@
|
|||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
|
|
||||||
#include "Basic.h"
|
#include "Basic.h"
|
||||||
|
|||||||
@@ -32,10 +32,6 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
|
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
|
|||||||
@@ -28,10 +28,6 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
|
|
||||||
#include "GHOST_C-api.h"
|
#include "GHOST_C-api.h"
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ extern "C" {
|
|||||||
/** Returns the lenght of the allocated memory segment pointed at
|
/** Returns the lenght of the allocated memory segment pointed at
|
||||||
* by vmemh. If the pointer was not previously allocated by this
|
* by vmemh. If the pointer was not previously allocated by this
|
||||||
* module, the result is undefined.*/
|
* module, the result is undefined.*/
|
||||||
int MEM_allocN_len(void *vmemh);
|
size_t MEM_allocN_len(void *vmemh);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Release memory previously allocatred by this module.
|
* Release memory previously allocatred by this module.
|
||||||
@@ -89,23 +89,23 @@ extern "C" {
|
|||||||
* allocated block, the old one is freed. this is not as optimized
|
* allocated block, the old one is freed. this is not as optimized
|
||||||
* as a system realloc but just makes a new allocation and copies
|
* as a system realloc but just makes a new allocation and copies
|
||||||
* over from existing memory. */
|
* over from existing memory. */
|
||||||
void *MEM_reallocN(void *vmemh, unsigned int len);
|
void *MEM_reallocN(void *vmemh, size_t len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allocate a block of memory of size len, with tag name str. The
|
* Allocate a block of memory of size len, with tag name str. The
|
||||||
* memory is cleared. The name must be static, because only a
|
* memory is cleared. The name must be static, because only a
|
||||||
* pointer to it is stored ! */
|
* pointer to it is stored ! */
|
||||||
void *MEM_callocN(unsigned int len, const char * str);
|
void *MEM_callocN(size_t len, const char * str);
|
||||||
|
|
||||||
/** Allocate a block of memory of size len, with tag name str. The
|
/** Allocate a block of memory of size len, with tag name str. The
|
||||||
* name must be a static, because only a pointer to it is stored !
|
* name must be a static, because only a pointer to it is stored !
|
||||||
* */
|
* */
|
||||||
void *MEM_mallocN(unsigned int len, const char * str);
|
void *MEM_mallocN(size_t len, const char * str);
|
||||||
|
|
||||||
/** Same as callocN, clears memory and uses mmap (disk cached) if supported.
|
/** Same as callocN, clears memory and uses mmap (disk cached) if supported.
|
||||||
Can be free'd with MEM_freeN as usual.
|
Can be free'd with MEM_freeN as usual.
|
||||||
* */
|
* */
|
||||||
void *MEM_mapallocN(unsigned int len, const char * str);
|
void *MEM_mapallocN(size_t len, const char * str);
|
||||||
|
|
||||||
/** Print a list of the names and sizes of all allocated memory
|
/** Print a list of the names and sizes of all allocated memory
|
||||||
* blocks. as a python dict for easy investigation */
|
* blocks. as a python dict for easy investigation */
|
||||||
|
|||||||
@@ -36,13 +36,20 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h> /* memcpy */
|
#include <string.h> /* memcpy */
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
/* Blame Microsoft for LLP64 and no inttypes.h, quick workaround needed: */
|
||||||
|
#if defined(WIN64)
|
||||||
|
#define SIZET_FORMAT "%I64u"
|
||||||
|
#define SIZET_ARG(a) ((unsigned long long)(a))
|
||||||
|
#else
|
||||||
|
#define SIZET_FORMAT "%lu"
|
||||||
|
#define SIZET_ARG(a) ((unsigned long)(a))
|
||||||
|
#endif
|
||||||
|
|
||||||
/* mmap exception */
|
/* mmap exception */
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
#include <sys/types.h>
|
|
||||||
#include "mmap_win.h"
|
#include "mmap_win.h"
|
||||||
#else
|
#else
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -82,7 +89,7 @@ typedef struct localListBase
|
|||||||
/* note: keep this struct aligned (e.g., irix/gcc) - Hos */
|
/* note: keep this struct aligned (e.g., irix/gcc) - Hos */
|
||||||
typedef struct MemHead {
|
typedef struct MemHead {
|
||||||
int tag1;
|
int tag1;
|
||||||
int len;
|
size_t len;
|
||||||
struct MemHead *next,*prev;
|
struct MemHead *next,*prev;
|
||||||
const char * name;
|
const char * name;
|
||||||
const char * nextname;
|
const char * nextname;
|
||||||
@@ -213,7 +220,7 @@ void MEM_set_memory_debug(void)
|
|||||||
malloc_debug_memset= 1;
|
malloc_debug_memset= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int MEM_allocN_len(void *vmemh)
|
size_t MEM_allocN_len(void *vmemh)
|
||||||
{
|
{
|
||||||
if (vmemh) {
|
if (vmemh) {
|
||||||
MemHead *memh= vmemh;
|
MemHead *memh= vmemh;
|
||||||
@@ -245,7 +252,7 @@ void *MEM_dupallocN(void *vmemh)
|
|||||||
return newp;
|
return newp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *MEM_reallocN(void *vmemh, unsigned int len)
|
void *MEM_reallocN(void *vmemh, size_t len)
|
||||||
{
|
{
|
||||||
void *newp= NULL;
|
void *newp= NULL;
|
||||||
|
|
||||||
@@ -267,7 +274,7 @@ void *MEM_reallocN(void *vmemh, unsigned int len)
|
|||||||
return newp;
|
return newp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void make_memhead_header(MemHead *memh, unsigned int len, const char *str)
|
static void make_memhead_header(MemHead *memh, size_t len, const char *str)
|
||||||
{
|
{
|
||||||
MemTail *memt;
|
MemTail *memt;
|
||||||
|
|
||||||
@@ -288,7 +295,7 @@ static void make_memhead_header(MemHead *memh, unsigned int len, const char *str
|
|||||||
mem_in_use += len;
|
mem_in_use += len;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *MEM_mallocN(unsigned int len, const char *str)
|
void *MEM_mallocN(size_t len, const char *str)
|
||||||
{
|
{
|
||||||
MemHead *memh;
|
MemHead *memh;
|
||||||
|
|
||||||
@@ -312,11 +319,11 @@ void *MEM_mallocN(unsigned int len, const char *str)
|
|||||||
return (++memh);
|
return (++memh);
|
||||||
}
|
}
|
||||||
mem_unlock_thread();
|
mem_unlock_thread();
|
||||||
print_error("Malloc returns nill: len=%d in %s, total %u\n",len, str, mem_in_use);
|
print_error("Malloc returns null: len=" SIZET_FORMAT " in %s, total %u\n", SIZET_ARG(len), str, mem_in_use);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *MEM_callocN(unsigned int len, const char *str)
|
void *MEM_callocN(size_t len, const char *str)
|
||||||
{
|
{
|
||||||
MemHead *memh;
|
MemHead *memh;
|
||||||
|
|
||||||
@@ -337,12 +344,12 @@ void *MEM_callocN(unsigned int len, const char *str)
|
|||||||
return (++memh);
|
return (++memh);
|
||||||
}
|
}
|
||||||
mem_unlock_thread();
|
mem_unlock_thread();
|
||||||
print_error("Calloc returns nill: len=%d in %s, total %u\n",len, str, mem_in_use);
|
print_error("Calloc returns null: len=" SIZET_FORMAT " in %s, total %u\n", SIZET_ARG(len), str, mem_in_use);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* note; mmap returns zero'd memory */
|
/* note; mmap returns zero'd memory */
|
||||||
void *MEM_mapallocN(unsigned int len, const char *str)
|
void *MEM_mapallocN(size_t len, const char *str)
|
||||||
{
|
{
|
||||||
MemHead *memh;
|
MemHead *memh;
|
||||||
|
|
||||||
@@ -380,7 +387,7 @@ void *MEM_mapallocN(unsigned int len, const char *str)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mem_unlock_thread();
|
mem_unlock_thread();
|
||||||
print_error("Mapalloc returns nill, fallback to regular malloc: len=%d in %s, total %u\n",len, str, mmap_in_use);
|
print_error("Mapalloc returns null, fallback to regular malloc: len=" SIZET_FORMAT " in %s, total %u\n", SIZET_ARG(len), str, mmap_in_use);
|
||||||
return MEM_callocN(len, str);
|
return MEM_callocN(len, str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -492,12 +499,12 @@ static void MEM_printmemlist_internal( int pydict )
|
|||||||
}
|
}
|
||||||
while(membl) {
|
while(membl) {
|
||||||
if (pydict) {
|
if (pydict) {
|
||||||
fprintf(stderr, "{'len':%i, 'name':'''%s''', 'pointer':'%p'},\\\n", membl->len, membl->name, membl+1);
|
fprintf(stderr, "{'len':" SIZET_FORMAT ", 'name':'''%s''', 'pointer':'%p'},\\\n", SIZET_ARG(membl->len), membl->name, membl+1);
|
||||||
} else {
|
} else {
|
||||||
#ifdef DEBUG_MEMCOUNTER
|
#ifdef DEBUG_MEMCOUNTER
|
||||||
print_error("%s len: %d %p, count: %d\n",membl->name,membl->len, membl+1, membl->_count);
|
print_error("%s len: " SIZET_FORMAT " %p, count: %d\n", membl->name, SIZET_ARG(membl->len), membl+1, membl->_count);
|
||||||
#else
|
#else
|
||||||
print_error("%s len: %d %p\n",membl->name,membl->len, membl+1);
|
print_error("%s len: " SIZET_FORMAT " %p\n", membl->name, SIZET_ARG(membl->len), membl+1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if(membl->next)
|
if(membl->next)
|
||||||
|
|||||||
@@ -43,10 +43,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void mem_error_cb(const char *errorStr)
|
static void mem_error_cb(const char *errorStr)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s", errorStr);
|
fprintf(stderr, "%s", errorStr);
|
||||||
|
|||||||
@@ -28,9 +28,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "IK_QSegment.h"
|
#include "IK_QSegment.h"
|
||||||
#ifdef WIN32
|
|
||||||
#define _USE_MATH_DEFINES
|
|
||||||
#endif
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
// Utility functions
|
// Utility functions
|
||||||
@@ -372,8 +369,8 @@ void IK_QSphericalSegment::SetLimit(int axis, MT_Scalar lmin, MT_Scalar lmax)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (axis == 1) {
|
if (axis == 1) {
|
||||||
lmin = MT_clamp(lmin, -M_PI, M_PI);
|
lmin = MT_clamp(lmin, -MT_PI, MT_PI);
|
||||||
lmax = MT_clamp(lmax, -M_PI, M_PI);
|
lmax = MT_clamp(lmax, -MT_PI, MT_PI);
|
||||||
|
|
||||||
m_min_y = lmin;
|
m_min_y = lmin;
|
||||||
m_max_y = lmax;
|
m_max_y = lmax;
|
||||||
@@ -382,8 +379,8 @@ void IK_QSphericalSegment::SetLimit(int axis, MT_Scalar lmin, MT_Scalar lmax)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// clamp and convert to axis angle parameters
|
// clamp and convert to axis angle parameters
|
||||||
lmin = MT_clamp(lmin, -M_PI, M_PI);
|
lmin = MT_clamp(lmin, -MT_PI, MT_PI);
|
||||||
lmax = MT_clamp(lmax, -M_PI, M_PI);
|
lmax = MT_clamp(lmax, -MT_PI, MT_PI);
|
||||||
|
|
||||||
lmin = sin(lmin*0.5);
|
lmin = sin(lmin*0.5);
|
||||||
lmax = sin(lmax*0.5);
|
lmax = sin(lmax*0.5);
|
||||||
@@ -615,8 +612,8 @@ void IK_QRevoluteSegment::SetLimit(int axis, MT_Scalar lmin, MT_Scalar lmax)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// clamp and convert to axis angle parameters
|
// clamp and convert to axis angle parameters
|
||||||
lmin = MT_clamp(lmin, -M_PI, M_PI);
|
lmin = MT_clamp(lmin, -MT_PI, MT_PI);
|
||||||
lmax = MT_clamp(lmax, -M_PI, M_PI);
|
lmax = MT_clamp(lmax, -MT_PI, MT_PI);
|
||||||
|
|
||||||
m_min = lmin;
|
m_min = lmin;
|
||||||
m_max = lmax;
|
m_max = lmax;
|
||||||
@@ -754,8 +751,8 @@ void IK_QSwingSegment::SetLimit(int axis, MT_Scalar lmin, MT_Scalar lmax)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// clamp and convert to axis angle parameters
|
// clamp and convert to axis angle parameters
|
||||||
lmin = MT_clamp(lmin, -M_PI, M_PI);
|
lmin = MT_clamp(lmin, -MT_PI, MT_PI);
|
||||||
lmax = MT_clamp(lmax, -M_PI, M_PI);
|
lmax = MT_clamp(lmax, -MT_PI, MT_PI);
|
||||||
|
|
||||||
lmin = sin(lmin*0.5);
|
lmin = sin(lmin*0.5);
|
||||||
lmax = sin(lmax*0.5);
|
lmax = sin(lmax*0.5);
|
||||||
@@ -900,8 +897,8 @@ void IK_QElbowSegment::SetLimit(int axis, MT_Scalar lmin, MT_Scalar lmax)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// clamp and convert to axis angle parameters
|
// clamp and convert to axis angle parameters
|
||||||
lmin = MT_clamp(lmin, -M_PI, M_PI);
|
lmin = MT_clamp(lmin, -MT_PI, MT_PI);
|
||||||
lmax = MT_clamp(lmax, -M_PI, M_PI);
|
lmax = MT_clamp(lmax, -MT_PI, MT_PI);
|
||||||
|
|
||||||
lmin = lmin;
|
lmin = lmin;
|
||||||
lmax = lmax;
|
lmax = lmax;
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "GlutDrawer.h"
|
#include "GlutDrawer.h"
|
||||||
|
|
||||||
#include "MT_assert.h"
|
#include "MT_assert.h"
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "GlutKeyboardManager.h"
|
#include "GlutKeyboardManager.h"
|
||||||
#include "MT_assert.h"
|
#include "MT_assert.h"
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "GlutMouseManager.h"
|
#include "GlutMouseManager.h"
|
||||||
#include "MT_assert.h"
|
#include "MT_assert.h"
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "MEM_SmartPtr.h"
|
#include "MEM_SmartPtr.h"
|
||||||
|
|
||||||
#ifdef USE_QUATERNIONS
|
#ifdef USE_QUATERNIONS
|
||||||
|
|||||||
@@ -20,10 +20,6 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "MEM_CacheLimiter.h"
|
#include "MEM_CacheLimiter.h"
|
||||||
#include "MEM_CacheLimiterC-Api.h"
|
#include "MEM_CacheLimiterC-Api.h"
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "MEM_RefCountedC-Api.h"
|
#include "MEM_RefCountedC-Api.h"
|
||||||
#include "MEM_RefCounted.h"
|
#include "MEM_RefCounted.h"
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "MT_CmMatrix4x4.h"
|
#include "MT_CmMatrix4x4.h"
|
||||||
#include "MT_Vector3.h"
|
#include "MT_Vector3.h"
|
||||||
#include "MT_Point3.h"
|
#include "MT_Point3.h"
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "MT_Matrix3x3.h"
|
#include "MT_Matrix3x3.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "MT_Matrix4x4.h"
|
#include "MT_Matrix4x4.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef GEN_INLINED
|
#ifndef GEN_INLINED
|
||||||
#include "MT_Plane3.h"
|
#include "MT_Plane3.h"
|
||||||
#include "MT_Plane3.inl"
|
#include "MT_Plane3.inl"
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "MT_Point3.h"
|
#include "MT_Point3.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "MT_Quaternion.h"
|
#include "MT_Quaternion.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -47,10 +47,6 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "MT_Transform.h"
|
#include "MT_Transform.h"
|
||||||
|
|
||||||
void MT_Transform::setValue(const float *m) {
|
void MT_Transform::setValue(const float *m) {
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "MT_Vector2.h"
|
#include "MT_Vector2.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "MT_Vector3.h"
|
#include "MT_Vector3.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "MT_Vector4.h"
|
#include "MT_Vector4.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -55,10 +55,6 @@
|
|||||||
/* When you use this, send an email to: matumoto@math.keio.ac.jp */
|
/* When you use this, send an email to: matumoto@math.keio.ac.jp */
|
||||||
/* with an appropriate reference to your work. */
|
/* with an appropriate reference to your work. */
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "MT_random.h"
|
#include "MT_random.h"
|
||||||
|
|
||||||
/* Period parameters */
|
/* Period parameters */
|
||||||
|
|||||||
@@ -234,6 +234,10 @@
|
|||||||
RelativePath="..\..\..\source\blender\editors\include\ED_keyframing.h"
|
RelativePath="..\..\..\source\blender\editors\include\ED_keyframing.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\source\blender\editors\include\ED_logic.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\source\blender\editors\include\ED_markers.h"
|
RelativePath="..\..\..\source\blender\editors\include\ED_markers.h"
|
||||||
>
|
>
|
||||||
@@ -1475,6 +1479,10 @@
|
|||||||
RelativePath="..\..\..\source\blender\editors\space_logic\logic_intern.h"
|
RelativePath="..\..\..\source\blender\editors\space_logic\logic_intern.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\source\blender\editors\space_logic\logic_ops.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\source\blender\editors\space_logic\logic_window.c"
|
RelativePath="..\..\..\source\blender\editors\space_logic\logic_window.c"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -606,6 +606,14 @@
|
|||||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_PythonController.cpp"
|
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_PythonController.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_PythonKeyboard.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_PythonMouse.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_RandomActuator.cpp"
|
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_RandomActuator.cpp"
|
||||||
>
|
>
|
||||||
@@ -775,6 +783,14 @@
|
|||||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_PythonController.h"
|
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_PythonController.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_PythonKeyboard.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_PythonMouse.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_RandomActuator.h"
|
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_RandomActuator.h"
|
||||||
>
|
>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 205 KiB After Width: | Height: | Size: 202 KiB |
@@ -880,6 +880,30 @@ for member in dir(properties_material):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
del properties_material
|
del properties_material
|
||||||
|
import properties_data_mesh
|
||||||
|
for member in dir(properties_data_mesh):
|
||||||
|
subclass = getattr(properties_data_mesh, member)
|
||||||
|
try:
|
||||||
|
subclass.COMPAT_ENGINES.add('POVRAY_RENDER')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
del properties_data_mesh
|
||||||
|
import properties_texture
|
||||||
|
for member in dir(properties_texture):
|
||||||
|
subclass = getattr(properties_texture, member)
|
||||||
|
try:
|
||||||
|
subclass.COMPAT_ENGINES.add('POVRAY_RENDER')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
del properties_texture
|
||||||
|
import properties_data_camera
|
||||||
|
for member in dir(properties_data_camera):
|
||||||
|
subclass = getattr(properties_data_camera, member)
|
||||||
|
try:
|
||||||
|
subclass.COMPAT_ENGINES.add('POVRAY_RENDER')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
del properties_data_camera
|
||||||
|
|
||||||
|
|
||||||
class RenderButtonsPanel(bpy.types.Panel):
|
class RenderButtonsPanel(bpy.types.Panel):
|
||||||
|
|||||||
@@ -54,50 +54,11 @@ import time
|
|||||||
import math # math.pi
|
import math # math.pi
|
||||||
import shutil # for file copying
|
import shutil # for file copying
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# import Blender
|
|
||||||
import bpy
|
import bpy
|
||||||
import mathutils
|
from mathutils import Vector, Euler, Matrix, RotationMatrix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def copy_file(source, dest):
|
def copy_file(source, dest):
|
||||||
|
# XXX - remove, can use shutil
|
||||||
file = open(source, 'rb')
|
file = open(source, 'rb')
|
||||||
data = file.read()
|
data = file.read()
|
||||||
file.close()
|
file.close()
|
||||||
@@ -135,7 +96,7 @@ def copy_images(dest_dir, textures):
|
|||||||
# I guess FBX uses degrees instead of radians (Arystan).
|
# I guess FBX uses degrees instead of radians (Arystan).
|
||||||
# Call this function just before writing to FBX.
|
# Call this function just before writing to FBX.
|
||||||
def eulerRadToDeg(eul):
|
def eulerRadToDeg(eul):
|
||||||
ret = mathutils.Euler()
|
ret = Euler()
|
||||||
|
|
||||||
ret.x = 180 / math.pi * eul[0]
|
ret.x = 180 / math.pi * eul[0]
|
||||||
ret.y = 180 / math.pi * eul[1]
|
ret.y = 180 / math.pi * eul[1]
|
||||||
@@ -143,10 +104,10 @@ def eulerRadToDeg(eul):
|
|||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
mtx4_identity = mathutils.Matrix()
|
mtx4_identity = Matrix()
|
||||||
|
|
||||||
# testing
|
# testing
|
||||||
mtx_x90 = mathutils.RotationMatrix( math.pi/2, 3, 'X') # used
|
mtx_x90 = RotationMatrix( math.pi/2, 3, 'X') # used
|
||||||
#mtx_x90n = RotationMatrix(-90, 3, 'x')
|
#mtx_x90n = RotationMatrix(-90, 3, 'x')
|
||||||
#mtx_y90 = RotationMatrix( 90, 3, 'y')
|
#mtx_y90 = RotationMatrix( 90, 3, 'y')
|
||||||
#mtx_y90n = RotationMatrix(-90, 3, 'y')
|
#mtx_y90n = RotationMatrix(-90, 3, 'y')
|
||||||
@@ -154,11 +115,11 @@ mtx_x90 = mathutils.RotationMatrix( math.pi/2, 3, 'X') # used
|
|||||||
#mtx_z90n = RotationMatrix(-90, 3, 'z')
|
#mtx_z90n = RotationMatrix(-90, 3, 'z')
|
||||||
|
|
||||||
#mtx4_x90 = RotationMatrix( 90, 4, 'x')
|
#mtx4_x90 = RotationMatrix( 90, 4, 'x')
|
||||||
mtx4_x90n = mathutils.RotationMatrix(-math.pi/2, 4, 'X') # used
|
mtx4_x90n = RotationMatrix(-math.pi/2, 4, 'X') # used
|
||||||
#mtx4_y90 = RotationMatrix( 90, 4, 'y')
|
#mtx4_y90 = RotationMatrix( 90, 4, 'y')
|
||||||
mtx4_y90n = mathutils.RotationMatrix(-math.pi/2, 4, 'Y') # used
|
mtx4_y90n = RotationMatrix(-math.pi/2, 4, 'Y') # used
|
||||||
mtx4_z90 = mathutils.RotationMatrix( math.pi/2, 4, 'Z') # used
|
mtx4_z90 = RotationMatrix( math.pi/2, 4, 'Z') # used
|
||||||
mtx4_z90n = mathutils.RotationMatrix(-math.pi/2, 4, 'Z') # used
|
mtx4_z90n = RotationMatrix(-math.pi/2, 4, 'Z') # used
|
||||||
|
|
||||||
# def strip_path(p):
|
# def strip_path(p):
|
||||||
# return p.split('\\')[-1].split('/')[-1]
|
# return p.split('\\')[-1].split('/')[-1]
|
||||||
@@ -333,7 +294,7 @@ def write(filename, batch_objects = None, \
|
|||||||
EXP_CAMERA = True,
|
EXP_CAMERA = True,
|
||||||
EXP_EMPTY = True,
|
EXP_EMPTY = True,
|
||||||
EXP_IMAGE_COPY = False,
|
EXP_IMAGE_COPY = False,
|
||||||
GLOBAL_MATRIX = mathutils.Matrix(),
|
GLOBAL_MATRIX = Matrix(),
|
||||||
ANIM_ENABLE = True,
|
ANIM_ENABLE = True,
|
||||||
ANIM_OPTIMIZE = True,
|
ANIM_OPTIMIZE = True,
|
||||||
ANIM_OPTIMIZE_PRECISSION = 6,
|
ANIM_OPTIMIZE_PRECISSION = 6,
|
||||||
@@ -600,8 +561,8 @@ def write(filename, batch_objects = None, \
|
|||||||
matrix_rot = matrix_rot * mtx_x90
|
matrix_rot = matrix_rot * mtx_x90
|
||||||
elif type =='CAMERA':
|
elif type =='CAMERA':
|
||||||
# elif ob and type =='Camera':
|
# elif ob and type =='Camera':
|
||||||
y = matrix_rot * mathutils.Vector(0,1,0)
|
y = matrix_rot * Vector((0.0, 1.0, 0.0))
|
||||||
matrix_rot = mathutils.RotationMatrix(math.pi/2, 3, y) * matrix_rot
|
matrix_rot = RotationMatrix(math.pi/2, 3, y) * matrix_rot
|
||||||
|
|
||||||
return matrix_rot
|
return matrix_rot
|
||||||
|
|
||||||
@@ -702,8 +663,8 @@ def write(filename, batch_objects = None, \
|
|||||||
matrix_rot = matrix_rot * mtx_x90
|
matrix_rot = matrix_rot * mtx_x90
|
||||||
rot = tuple(matrix_rot.to_euler())
|
rot = tuple(matrix_rot.to_euler())
|
||||||
elif ob and ob.type =='Camera':
|
elif ob and ob.type =='Camera':
|
||||||
y = matrix_rot * mathutils.Vector(0,1,0)
|
y = matrix_rot * Vector((0.0, 1.0, 0.0))
|
||||||
matrix_rot = mathutils.RotationMatrix(math.pi/2, 3, y) * matrix_rot
|
matrix_rot = RotationMatrix(math.pi/2, 3, y) * matrix_rot
|
||||||
rot = tuple(matrix_rot.to_euler())
|
rot = tuple(matrix_rot.to_euler())
|
||||||
else:
|
else:
|
||||||
rot = tuple(matrix_rot.to_euler())
|
rot = tuple(matrix_rot.to_euler())
|
||||||
@@ -1088,8 +1049,8 @@ def write(filename, batch_objects = None, \
|
|||||||
file.write('\n\t\tTypeFlags: "Camera"')
|
file.write('\n\t\tTypeFlags: "Camera"')
|
||||||
file.write('\n\t\tGeometryVersion: 124')
|
file.write('\n\t\tGeometryVersion: 124')
|
||||||
file.write('\n\t\tPosition: %.6f,%.6f,%.6f' % loc)
|
file.write('\n\t\tPosition: %.6f,%.6f,%.6f' % loc)
|
||||||
file.write('\n\t\tUp: %.6f,%.6f,%.6f' % tuple(matrix_rot * mathutils.Vector(0,1,0)) )
|
file.write('\n\t\tUp: %.6f,%.6f,%.6f' % tuple(matrix_rot * Vector((0.0, 1.0, 0.0))))
|
||||||
file.write('\n\t\tLookAt: %.6f,%.6f,%.6f' % tuple(matrix_rot * mathutils.Vector(0,0,-1)) )
|
file.write('\n\t\tLookAt: %.6f,%.6f,%.6f' % tuple(matrix_rot * Vector((0.0, 0.0, -1.0))))
|
||||||
|
|
||||||
#file.write('\n\t\tUp: 0,0,0' )
|
#file.write('\n\t\tUp: 0,0,0' )
|
||||||
#file.write('\n\t\tLookAt: 0,0,0' )
|
#file.write('\n\t\tLookAt: 0,0,0' )
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ def eulerRotate(x, y, z, rot_order):
|
|||||||
|
|
||||||
# Should work but doesnt!
|
# Should work but doesnt!
|
||||||
'''
|
'''
|
||||||
eul = Euler(x,y,z)
|
eul = Euler((x, y, z))
|
||||||
eul.order = "XYZ"[rot_order[0]] + "XYZ"[rot_order[1]] + "XYZ"[rot_order[2]]
|
eul.order = "XYZ"[rot_order[0]] + "XYZ"[rot_order[1]] + "XYZ"[rot_order[2]]
|
||||||
return tuple(eul.to_matrix().to_euler())
|
return tuple(eul.to_matrix().to_euler())
|
||||||
'''
|
'''
|
||||||
@@ -136,7 +136,7 @@ def read_bvh(context, file_path, ROT_MODE='XYZ', GLOBAL_SCALE=1.0):
|
|||||||
#print '%snode: %s, parent: %s' % (len(bvh_nodes_serial) * ' ', name, bvh_nodes_serial[-1])
|
#print '%snode: %s, parent: %s' % (len(bvh_nodes_serial) * ' ', name, bvh_nodes_serial[-1])
|
||||||
|
|
||||||
lineIdx += 2 # Incriment to the next line (Offset)
|
lineIdx += 2 # Incriment to the next line (Offset)
|
||||||
rest_head_local = Vector(float(file_lines[lineIdx][1]), float(file_lines[lineIdx][2]), float(file_lines[lineIdx][3])) * GLOBAL_SCALE
|
rest_head_local = Vector((float(file_lines[lineIdx][1]), float(file_lines[lineIdx][2]), float(file_lines[lineIdx][3]))) * GLOBAL_SCALE
|
||||||
lineIdx += 1 # Incriment to the next line (Channels)
|
lineIdx += 1 # Incriment to the next line (Channels)
|
||||||
|
|
||||||
# newChannel[Xposition, Yposition, Zposition, Xrotation, Yrotation, Zrotation]
|
# newChannel[Xposition, Yposition, Zposition, Xrotation, Yrotation, Zrotation]
|
||||||
@@ -188,7 +188,7 @@ def read_bvh(context, file_path, ROT_MODE='XYZ', GLOBAL_SCALE=1.0):
|
|||||||
# Account for an end node
|
# Account for an end node
|
||||||
if file_lines[lineIdx][0].lower() == 'end' and file_lines[lineIdx][1].lower() == 'site': # There is somtimes a name after 'End Site' but we will ignore it.
|
if file_lines[lineIdx][0].lower() == 'end' and file_lines[lineIdx][1].lower() == 'site': # There is somtimes a name after 'End Site' but we will ignore it.
|
||||||
lineIdx += 2 # Incriment to the next line (Offset)
|
lineIdx += 2 # Incriment to the next line (Offset)
|
||||||
rest_tail = Vector(float(file_lines[lineIdx][1]), float(file_lines[lineIdx][2]), float(file_lines[lineIdx][3])) * GLOBAL_SCALE
|
rest_tail = Vector((float(file_lines[lineIdx][1]), float(file_lines[lineIdx][2]), float(file_lines[lineIdx][3]))) * GLOBAL_SCALE
|
||||||
|
|
||||||
bvh_nodes_serial[-1].rest_tail_world = bvh_nodes_serial[-1].rest_head_world + rest_tail
|
bvh_nodes_serial[-1].rest_tail_world = bvh_nodes_serial[-1].rest_head_world + rest_tail
|
||||||
bvh_nodes_serial[-1].rest_tail_local = bvh_nodes_serial[-1].rest_head_local + rest_tail
|
bvh_nodes_serial[-1].rest_tail_local = bvh_nodes_serial[-1].rest_head_local + rest_tail
|
||||||
@@ -267,8 +267,8 @@ def read_bvh(context, file_path, ROT_MODE='XYZ', GLOBAL_SCALE=1.0):
|
|||||||
# raise 'error, bvh node has no end and no children. bad file'
|
# raise 'error, bvh node has no end and no children. bad file'
|
||||||
|
|
||||||
# Removed temp for now
|
# Removed temp for now
|
||||||
rest_tail_world = Vector(0.0, 0.0, 0.0)
|
rest_tail_world = Vector((0.0, 0.0, 0.0))
|
||||||
rest_tail_local = Vector(0.0, 0.0, 0.0)
|
rest_tail_local = Vector((0.0, 0.0, 0.0))
|
||||||
for bvh_node_child in bvh_node.children:
|
for bvh_node_child in bvh_node.children:
|
||||||
rest_tail_world += bvh_node_child.rest_head_world
|
rest_tail_world += bvh_node_child.rest_head_world
|
||||||
rest_tail_local += bvh_node_child.rest_head_local
|
rest_tail_local += bvh_node_child.rest_head_local
|
||||||
@@ -328,7 +328,7 @@ def bvh_node_dict2objects(context, bvh_nodes, IMPORT_START_FRAME=1, IMPORT_LOOP=
|
|||||||
lx, ly, lz, rx, ry, rz = bvh_node.anim_data[frame_current]
|
lx, ly, lz, rx, ry, rz = bvh_node.anim_data[frame_current]
|
||||||
|
|
||||||
rest_head_local = bvh_node.rest_head_local
|
rest_head_local = bvh_node.rest_head_local
|
||||||
bvh_node.temp.loc = rest_head_local + Vector(lx, ly, lz)
|
bvh_node.temp.loc = rest_head_local + Vector((lx, ly, lz))
|
||||||
|
|
||||||
bvh_node.temp.rot = rx, ry, rz
|
bvh_node.temp.rot = rx, ry, rz
|
||||||
|
|
||||||
@@ -531,7 +531,7 @@ def bvh_node_dict2armature(context, bvh_nodes, ROT_MODE='XYZ', IMPORT_START_FRAM
|
|||||||
prev_euler[i] = euler
|
prev_euler[i] = euler
|
||||||
|
|
||||||
if bvh_node.has_loc:
|
if bvh_node.has_loc:
|
||||||
pose_bone.location = (bone_rest_matrix_inv * TranslationMatrix(Vector(lx, ly, lz) - bvh_node.rest_head_local)).translation_part()
|
pose_bone.location = (bone_rest_matrix_inv * TranslationMatrix(Vector((lx, ly, lz)) - bvh_node.rest_head_local)).translation_part()
|
||||||
|
|
||||||
if bvh_node.has_loc:
|
if bvh_node.has_loc:
|
||||||
pose_bone.keyframe_insert("location")
|
pose_bone.keyframe_insert("location")
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ from netrender import master_html
|
|||||||
from netrender import utils
|
from netrender import utils
|
||||||
from netrender import balancing
|
from netrender import balancing
|
||||||
from netrender import ui
|
from netrender import ui
|
||||||
|
from netrender import repath
|
||||||
|
|
||||||
jobs = []
|
jobs = []
|
||||||
slaves = []
|
slaves = []
|
||||||
|
|||||||
@@ -125,6 +125,10 @@ def clientSendJob(conn, scene, anim = False):
|
|||||||
file_path = bpy.utils.expandpath(image.filename)
|
file_path = bpy.utils.expandpath(image.filename)
|
||||||
if os.path.exists(file_path):
|
if os.path.exists(file_path):
|
||||||
job.addFile(file_path)
|
job.addFile(file_path)
|
||||||
|
|
||||||
|
tex_path = os.path.splitext(file_path)[0] + ".tex"
|
||||||
|
if os.path.exists(tex_path):
|
||||||
|
job.addFile(tex_path)
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
# FLUID + POINT CACHE
|
# FLUID + POINT CACHE
|
||||||
@@ -144,6 +148,9 @@ def clientSendJob(conn, scene, anim = False):
|
|||||||
addPointCache(job, object, modifier.domain_settings.point_cache_low, default_path)
|
addPointCache(job, object, modifier.domain_settings.point_cache_low, default_path)
|
||||||
if modifier.domain_settings.highres:
|
if modifier.domain_settings.highres:
|
||||||
addPointCache(job, object, modifier.domain_settings.point_cache_high, default_path)
|
addPointCache(job, object, modifier.domain_settings.point_cache_high, default_path)
|
||||||
|
elif modifier.type == "MULTIRES" and modifier.external:
|
||||||
|
file_path = bpy.utils.expandpath(modifier.filename)
|
||||||
|
job.addFile(file_path)
|
||||||
|
|
||||||
# particles modifier are stupid and don't contain data
|
# particles modifier are stupid and don't contain data
|
||||||
# we have to go through the object property
|
# we have to go through the object property
|
||||||
@@ -284,3 +291,6 @@ def compatible(module):
|
|||||||
#compatible("properties_render")
|
#compatible("properties_render")
|
||||||
compatible("properties_world")
|
compatible("properties_world")
|
||||||
compatible("properties_material")
|
compatible("properties_material")
|
||||||
|
compatible("properties_data_mesh")
|
||||||
|
compatible("properties_data_camera")
|
||||||
|
compatible("properties_texture")
|
||||||
|
|||||||
@@ -27,12 +27,16 @@ import netrender.balancing
|
|||||||
import netrender.master_html
|
import netrender.master_html
|
||||||
|
|
||||||
class MRenderFile(netrender.model.RenderFile):
|
class MRenderFile(netrender.model.RenderFile):
|
||||||
def __init__(self, filepath, index, start, end):
|
def __init__(self, filepath, index, start, end, signature):
|
||||||
super().__init__(filepath, index, start, end)
|
super().__init__(filepath, index, start, end, signature)
|
||||||
self.found = False
|
self.found = False
|
||||||
|
|
||||||
def test(self):
|
def test(self):
|
||||||
self.found = os.path.exists(self.filepath)
|
self.found = os.path.exists(self.filepath)
|
||||||
|
if self.found:
|
||||||
|
found_signature = hashFile(self.filepath)
|
||||||
|
self.found = self.signature == found_signature
|
||||||
|
|
||||||
return self.found
|
return self.found
|
||||||
|
|
||||||
|
|
||||||
@@ -74,7 +78,7 @@ class MRenderJob(netrender.model.RenderJob):
|
|||||||
# special server properties
|
# special server properties
|
||||||
self.last_update = 0
|
self.last_update = 0
|
||||||
self.save_path = ""
|
self.save_path = ""
|
||||||
self.files = [MRenderFile(rfile.filepath, rfile.index, rfile.start, rfile.end) for rfile in job_info.files]
|
self.files = [MRenderFile(rfile.filepath, rfile.index, rfile.start, rfile.end, rfile.signature) for rfile in job_info.files]
|
||||||
|
|
||||||
self.resolution = None
|
self.resolution = None
|
||||||
|
|
||||||
@@ -190,6 +194,11 @@ pause_pattern = re.compile("/pause_([a-zA-Z0-9]+)")
|
|||||||
edit_pattern = re.compile("/edit_([a-zA-Z0-9]+)")
|
edit_pattern = re.compile("/edit_([a-zA-Z0-9]+)")
|
||||||
|
|
||||||
class RenderHandler(http.server.BaseHTTPRequestHandler):
|
class RenderHandler(http.server.BaseHTTPRequestHandler):
|
||||||
|
def log_message(self, format, *args):
|
||||||
|
# override because the original calls self.address_string(), which
|
||||||
|
# is extremely slow due to some timeout..
|
||||||
|
sys.stderr.write("[%s] %s\n" % (self.log_date_time_string(), format%args))
|
||||||
|
|
||||||
def send_head(self, code = http.client.OK, headers = {}, content = "application/octet-stream"):
|
def send_head(self, code = http.client.OK, headers = {}, content = "application/octet-stream"):
|
||||||
self.send_response(code)
|
self.send_response(code)
|
||||||
self.send_header("Content-type", content)
|
self.send_header("Content-type", content)
|
||||||
@@ -711,7 +720,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler):
|
|||||||
buf = self.rfile.read(length)
|
buf = self.rfile.read(length)
|
||||||
|
|
||||||
# add same temp file + renames as slave
|
# add same temp file + renames as slave
|
||||||
|
|
||||||
f = open(file_path, "wb")
|
f = open(file_path, "wb")
|
||||||
f.write(buf)
|
f.write(buf)
|
||||||
f.close()
|
f.close()
|
||||||
@@ -870,7 +879,7 @@ class RenderMasterServer(socketserver.ThreadingMixIn, http.server.HTTPServer):
|
|||||||
self.job_id = 0
|
self.job_id = 0
|
||||||
self.path = path + "master_" + str(os.getpid()) + os.sep
|
self.path = path + "master_" + str(os.getpid()) + os.sep
|
||||||
|
|
||||||
self.slave_timeout = 30 # 30 mins: need a parameter for that
|
self.slave_timeout = 5 # 5 mins: need a parameter for that
|
||||||
|
|
||||||
self.balancer = netrender.balancing.Balancer()
|
self.balancer = netrender.balancing.Balancer()
|
||||||
self.balancer.addRule(netrender.balancing.RatingUsageByCategory(self.getJobs))
|
self.balancer.addRule(netrender.balancing.RatingUsageByCategory(self.getJobs))
|
||||||
@@ -1010,7 +1019,7 @@ def runMaster(address, broadcast, clear, path, update_stats, test_break):
|
|||||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
|
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
|
||||||
|
|
||||||
start_time = time.time()
|
start_time = time.time() - 2
|
||||||
|
|
||||||
while not test_break():
|
while not test_break():
|
||||||
try:
|
try:
|
||||||
@@ -1018,7 +1027,7 @@ def runMaster(address, broadcast, clear, path, update_stats, test_break):
|
|||||||
except select.error:
|
except select.error:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if time.time() - start_time >= 10: # need constant here
|
if time.time() - start_time >= 2: # need constant here
|
||||||
httpd.timeoutSlaves()
|
httpd.timeoutSlaves()
|
||||||
|
|
||||||
httpd.updateUsage()
|
httpd.updateUsage()
|
||||||
@@ -1031,3 +1040,4 @@ def runMaster(address, broadcast, clear, path, update_stats, test_break):
|
|||||||
httpd.server_close()
|
httpd.server_close()
|
||||||
if clear:
|
if clear:
|
||||||
clearMaster(httpd.path)
|
clearMaster(httpd.path)
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ def get(handler):
|
|||||||
|
|
||||||
def head(title):
|
def head(title):
|
||||||
output("<html><head>")
|
output("<html><head>")
|
||||||
|
output("<meta http-equiv='refresh' content=5>")
|
||||||
output("<script src='/html/netrender.js' type='text/javascript'></script>")
|
output("<script src='/html/netrender.js' type='text/javascript'></script>")
|
||||||
# output("<script src='/html/json2.js' type='text/javascript'></script>")
|
# output("<script src='/html/json2.js' type='text/javascript'></script>")
|
||||||
output("<title>")
|
output("<title>")
|
||||||
@@ -105,53 +106,6 @@ def get(handler):
|
|||||||
handler.send_head(content = "text/html")
|
handler.send_head(content = "text/html")
|
||||||
head("NetRender")
|
head("NetRender")
|
||||||
|
|
||||||
output("<h2>Master</h2>")
|
|
||||||
|
|
||||||
output("""<button title="remove all jobs" onclick="clear_jobs();">CLEAR JOB LIST</button>""")
|
|
||||||
|
|
||||||
startTable(caption = "Rules", class_style = "rules")
|
|
||||||
|
|
||||||
headerTable("type", "enabled", "description", "limit")
|
|
||||||
|
|
||||||
for rule in handler.server.balancer.rules:
|
|
||||||
rowTable(
|
|
||||||
"rating",
|
|
||||||
checkbox("", rule.enabled, "balance_enable('%i', '%s')" % (id(rule), str(not rule.enabled))),
|
|
||||||
rule,
|
|
||||||
rule.str_limit() +
|
|
||||||
"""<button title="edit limit" onclick="balance_edit('%i', '%s');">edit</button>""" % (id(rule), str(rule.limit)) if hasattr(rule, "limit") else " "
|
|
||||||
)
|
|
||||||
|
|
||||||
for rule in handler.server.balancer.priorities:
|
|
||||||
rowTable(
|
|
||||||
"priority",
|
|
||||||
checkbox("", rule.enabled, "balance_enable('%i', '%s')" % (id(rule), str(not rule.enabled))),
|
|
||||||
rule,
|
|
||||||
rule.str_limit() +
|
|
||||||
"""<button title="edit limit" onclick="balance_edit('%i', '%s');">edit</button>""" % (id(rule), str(rule.limit)) if hasattr(rule, "limit") else " "
|
|
||||||
)
|
|
||||||
|
|
||||||
for rule in handler.server.balancer.exceptions:
|
|
||||||
rowTable(
|
|
||||||
"exception",
|
|
||||||
checkbox("", rule.enabled, "balance_enable('%i', '%s')" % (id(rule), str(not rule.enabled))),
|
|
||||||
rule,
|
|
||||||
rule.str_limit() +
|
|
||||||
"""<button title="edit limit" onclick="balance_edit('%i', '%s');">edit</button>""" % (id(rule), str(rule.limit)) if hasattr(rule, "limit") else " "
|
|
||||||
)
|
|
||||||
|
|
||||||
endTable()
|
|
||||||
|
|
||||||
output("<h2>Slaves</h2>")
|
|
||||||
|
|
||||||
startTable()
|
|
||||||
headerTable("name", "address", "last seen", "stats", "job")
|
|
||||||
|
|
||||||
for slave in handler.server.slaves:
|
|
||||||
rowTable(slave.name, slave.address[0], time.ctime(slave.last_seen), slave.stats, link(slave.job.name, "/html/job" + slave.job.id) if slave.job else "None")
|
|
||||||
|
|
||||||
endTable()
|
|
||||||
|
|
||||||
output("<h2>Jobs</h2>")
|
output("<h2>Jobs</h2>")
|
||||||
|
|
||||||
startTable()
|
startTable()
|
||||||
@@ -203,6 +157,53 @@ def get(handler):
|
|||||||
)
|
)
|
||||||
|
|
||||||
endTable()
|
endTable()
|
||||||
|
|
||||||
|
output("<h2>Slaves</h2>")
|
||||||
|
|
||||||
|
startTable()
|
||||||
|
headerTable("name", "address", "last seen", "stats", "job")
|
||||||
|
|
||||||
|
for slave in handler.server.slaves:
|
||||||
|
rowTable(slave.name, slave.address[0], time.ctime(slave.last_seen), slave.stats, link(slave.job.name, "/html/job" + slave.job.id) if slave.job else "None")
|
||||||
|
|
||||||
|
endTable()
|
||||||
|
|
||||||
|
output("<h2>Configuration</h2>")
|
||||||
|
|
||||||
|
output("""<button title="remove all jobs" onclick="clear_jobs();">CLEAR JOB LIST</button>""")
|
||||||
|
|
||||||
|
startTable(caption = "Rules", class_style = "rules")
|
||||||
|
|
||||||
|
headerTable("type", "enabled", "description", "limit")
|
||||||
|
|
||||||
|
for rule in handler.server.balancer.rules:
|
||||||
|
rowTable(
|
||||||
|
"rating",
|
||||||
|
checkbox("", rule.enabled, "balance_enable('%i', '%s')" % (id(rule), str(not rule.enabled))),
|
||||||
|
rule,
|
||||||
|
rule.str_limit() +
|
||||||
|
"""<button title="edit limit" onclick="balance_edit('%i', '%s');">edit</button>""" % (id(rule), str(rule.limit)) if hasattr(rule, "limit") else " "
|
||||||
|
)
|
||||||
|
|
||||||
|
for rule in handler.server.balancer.priorities:
|
||||||
|
rowTable(
|
||||||
|
"priority",
|
||||||
|
checkbox("", rule.enabled, "balance_enable('%i', '%s')" % (id(rule), str(not rule.enabled))),
|
||||||
|
rule,
|
||||||
|
rule.str_limit() +
|
||||||
|
"""<button title="edit limit" onclick="balance_edit('%i', '%s');">edit</button>""" % (id(rule), str(rule.limit)) if hasattr(rule, "limit") else " "
|
||||||
|
)
|
||||||
|
|
||||||
|
for rule in handler.server.balancer.exceptions:
|
||||||
|
rowTable(
|
||||||
|
"exception",
|
||||||
|
checkbox("", rule.enabled, "balance_enable('%i', '%s')" % (id(rule), str(not rule.enabled))),
|
||||||
|
rule,
|
||||||
|
rule.str_limit() +
|
||||||
|
"""<button title="edit limit" onclick="balance_edit('%i', '%s');">edit</button>""" % (id(rule), str(rule.limit)) if hasattr(rule, "limit") else " "
|
||||||
|
)
|
||||||
|
|
||||||
|
endTable()
|
||||||
|
|
||||||
output("</body></html>")
|
output("</body></html>")
|
||||||
|
|
||||||
@@ -234,13 +235,17 @@ def get(handler):
|
|||||||
tot_cache = 0
|
tot_cache = 0
|
||||||
tot_fluid = 0
|
tot_fluid = 0
|
||||||
|
|
||||||
|
rowTable(job.files[0].filepath)
|
||||||
|
rowTable("Other Files", class_style = "toggle", extra = "onclick='toggleDisplay(".other", "none", "table-row")'")
|
||||||
|
|
||||||
for file in job.files:
|
for file in job.files:
|
||||||
if file.filepath.endswith(".bphys"):
|
if file.filepath.endswith(".bphys"):
|
||||||
tot_cache += 1
|
tot_cache += 1
|
||||||
elif file.filepath.endswith(".bobj.gz") or file.filepath.endswith(".bvel.gz"):
|
elif file.filepath.endswith(".bobj.gz") or file.filepath.endswith(".bvel.gz"):
|
||||||
tot_fluid += 1
|
tot_fluid += 1
|
||||||
else:
|
else:
|
||||||
rowTable(file.filepath)
|
if file != job.files[0]:
|
||||||
|
rowTable(file.filepath, class_style = "other")
|
||||||
|
|
||||||
if tot_cache > 0:
|
if tot_cache > 0:
|
||||||
rowTable("%i physic cache files" % tot_cache, class_style = "toggle", extra = "onclick='toggleDisplay(".cache", "none", "table-row")'")
|
rowTable("%i physic cache files" % tot_cache, class_style = "toggle", extra = "onclick='toggleDisplay(".cache", "none", "table-row")'")
|
||||||
@@ -256,9 +261,9 @@ def get(handler):
|
|||||||
|
|
||||||
endTable()
|
endTable()
|
||||||
|
|
||||||
output("<h2>Blacklist</h2>")
|
|
||||||
|
|
||||||
if job.blacklist:
|
if job.blacklist:
|
||||||
|
output("<h2>Blacklist</h2>")
|
||||||
|
|
||||||
startTable()
|
startTable()
|
||||||
headerTable("name", "address")
|
headerTable("name", "address")
|
||||||
|
|
||||||
@@ -267,8 +272,6 @@ def get(handler):
|
|||||||
rowTable(slave.name, slave.address[0])
|
rowTable(slave.name, slave.address[0])
|
||||||
|
|
||||||
endTable()
|
endTable()
|
||||||
else:
|
|
||||||
output("<i>Empty</i>")
|
|
||||||
|
|
||||||
output("<h2>Frames</h2>")
|
output("<h2>Frames</h2>")
|
||||||
|
|
||||||
|
|||||||
@@ -103,8 +103,10 @@ JOB_TYPES = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class RenderFile:
|
class RenderFile:
|
||||||
def __init__(self, filepath = "", index = 0, start = -1, end = -1):
|
def __init__(self, filepath = "", index = 0, start = -1, end = -1, signature=0):
|
||||||
self.filepath = filepath
|
self.filepath = filepath
|
||||||
|
self.original_path = filepath
|
||||||
|
self.signature = signature
|
||||||
self.index = index
|
self.index = index
|
||||||
self.start = start
|
self.start = start
|
||||||
self.end = end
|
self.end = end
|
||||||
@@ -112,9 +114,11 @@ class RenderFile:
|
|||||||
def serialize(self):
|
def serialize(self):
|
||||||
return {
|
return {
|
||||||
"filepath": self.filepath,
|
"filepath": self.filepath,
|
||||||
|
"original_path": self.original_path,
|
||||||
"index": self.index,
|
"index": self.index,
|
||||||
"start": self.start,
|
"start": self.start,
|
||||||
"end": self.end
|
"end": self.end,
|
||||||
|
"signature": self.signature
|
||||||
}
|
}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -122,7 +126,8 @@ class RenderFile:
|
|||||||
if not data:
|
if not data:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
rfile = RenderFile(data["filepath"], data["index"], data["start"], data["end"])
|
rfile = RenderFile(data["filepath"], data["index"], data["start"], data["end"], data["signature"])
|
||||||
|
rfile.original_path = data["original_path"]
|
||||||
|
|
||||||
return rfile
|
return rfile
|
||||||
|
|
||||||
@@ -153,7 +158,8 @@ class RenderJob:
|
|||||||
self.blacklist = job_info.blacklist
|
self.blacklist = job_info.blacklist
|
||||||
|
|
||||||
def addFile(self, file_path, start=-1, end=-1):
|
def addFile(self, file_path, start=-1, end=-1):
|
||||||
self.files.append(RenderFile(file_path, len(self.files), start, end))
|
signature = hashFile(file_path)
|
||||||
|
self.files.append(RenderFile(file_path, len(self.files), start, end, signature))
|
||||||
|
|
||||||
def addFrame(self, frame_number, command = ""):
|
def addFrame(self, frame_number, command = ""):
|
||||||
frame = RenderFrame(frame_number, command)
|
frame = RenderFrame(frame_number, command)
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ button {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.other {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.rules {
|
.rules {
|
||||||
width: 60em;
|
width: 60em;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|||||||
@@ -158,6 +158,36 @@ class RENDER_OT_netclientsend(bpy.types.Operator):
|
|||||||
def invoke(self, context, event):
|
def invoke(self, context, event):
|
||||||
return self.execute(context)
|
return self.execute(context)
|
||||||
|
|
||||||
|
@rnaType
|
||||||
|
class RENDER_OT_netclientsendframe(bpy.types.Operator):
|
||||||
|
'''Send Render Job with current frame to the Network'''
|
||||||
|
bl_idname = "render.netclientsendframe"
|
||||||
|
bl_label = "Send current frame job"
|
||||||
|
|
||||||
|
def poll(self, context):
|
||||||
|
return True
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
scene = context.scene
|
||||||
|
netsettings = scene.network_render
|
||||||
|
|
||||||
|
try:
|
||||||
|
conn = clientConnection(netsettings.server_address, netsettings.server_port, self.report)
|
||||||
|
|
||||||
|
if conn:
|
||||||
|
# Sending file
|
||||||
|
scene.network_render.job_id = client.clientSendJob(conn, scene, False)
|
||||||
|
conn.close()
|
||||||
|
self.report('INFO', "Job sent to master")
|
||||||
|
except Exception as err:
|
||||||
|
self.report('ERROR', str(err))
|
||||||
|
|
||||||
|
|
||||||
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
def invoke(self, context, event):
|
||||||
|
return self.execute(context)
|
||||||
|
|
||||||
@rnaType
|
@rnaType
|
||||||
class RENDER_OT_netclientstatus(bpy.types.Operator):
|
class RENDER_OT_netclientstatus(bpy.types.Operator):
|
||||||
'''Refresh the status of the current jobs'''
|
'''Refresh the status of the current jobs'''
|
||||||
|
|||||||
145
release/scripts/io/netrender/repath.py
Executable file
145
release/scripts/io/netrender/repath.py
Executable file
@@ -0,0 +1,145 @@
|
|||||||
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
|
import sys, os
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
import bpy
|
||||||
|
|
||||||
|
from netrender.utils import *
|
||||||
|
import netrender.model
|
||||||
|
|
||||||
|
BLENDER_PATH = sys.argv[0]
|
||||||
|
|
||||||
|
def reset(job):
|
||||||
|
main_file = job.files[0]
|
||||||
|
|
||||||
|
job_full_path = main_file.filepath
|
||||||
|
|
||||||
|
if os.path.exists(job_full_path + ".bak"):
|
||||||
|
os.remove(job_full_path) # repathed file
|
||||||
|
os.renames(job_full_path + ".bak", job_full_path)
|
||||||
|
|
||||||
|
def update(job):
|
||||||
|
paths = []
|
||||||
|
|
||||||
|
main_file = job.files[0]
|
||||||
|
|
||||||
|
job_full_path = main_file.filepath
|
||||||
|
|
||||||
|
|
||||||
|
path, ext = os.path.splitext(job_full_path)
|
||||||
|
|
||||||
|
new_path = path + ".remap" + ext
|
||||||
|
|
||||||
|
all = main_file.filepath == main_file.original_path
|
||||||
|
|
||||||
|
for rfile in job.files[1:]:
|
||||||
|
if all or rfile.original_path != rfile.filepath:
|
||||||
|
paths.append(rfile.original_path)
|
||||||
|
paths.append(rfile.filepath)
|
||||||
|
|
||||||
|
# Only update if needed
|
||||||
|
if paths:
|
||||||
|
process = subprocess.Popen([BLENDER_PATH, "-b", "-noaudio", job_full_path, "-P", __file__, "--", new_path] + paths, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
|
process.wait()
|
||||||
|
|
||||||
|
os.renames(job_full_path, job_full_path + ".bak")
|
||||||
|
os.renames(new_path, job_full_path)
|
||||||
|
|
||||||
|
def process(paths):
|
||||||
|
def processPointCache(point_cache):
|
||||||
|
point_cache.external = False
|
||||||
|
|
||||||
|
def processFluid(fluid):
|
||||||
|
new_path = path_map.get(fluid.path, None)
|
||||||
|
if new_path:
|
||||||
|
fluid.path = new_path
|
||||||
|
|
||||||
|
path_map = {}
|
||||||
|
for i in range(0, len(paths), 2):
|
||||||
|
# special case for point cache
|
||||||
|
if paths[i].endswith(".bphys"):
|
||||||
|
pass # Don't need them in the map, they all use the default external path
|
||||||
|
# NOTE: This is probably not correct all the time, need to be fixed.
|
||||||
|
# special case for fluids
|
||||||
|
elif paths[i].endswith(".bobj.gz"):
|
||||||
|
path_map[os.path.split(paths[i])[0]] = os.path.split(paths[i+1])[0]
|
||||||
|
else:
|
||||||
|
path_map[paths[i]] = paths[i+1]
|
||||||
|
|
||||||
|
###########################
|
||||||
|
# LIBRARIES
|
||||||
|
###########################
|
||||||
|
for lib in bpy.data.libraries:
|
||||||
|
file_path = bpy.utils.expandpath(lib.filename)
|
||||||
|
new_path = path_map.get(file_path, None)
|
||||||
|
if new_path:
|
||||||
|
lib.filename = new_path
|
||||||
|
|
||||||
|
###########################
|
||||||
|
# IMAGES
|
||||||
|
###########################
|
||||||
|
for image in bpy.data.images:
|
||||||
|
if image.source == "FILE" and not image.packed_file:
|
||||||
|
file_path = bpy.utils.expandpath(image.filename)
|
||||||
|
new_path = path_map.get(file_path, None)
|
||||||
|
if new_path:
|
||||||
|
image.filename = new_path
|
||||||
|
|
||||||
|
|
||||||
|
###########################
|
||||||
|
# FLUID + POINT CACHE
|
||||||
|
###########################
|
||||||
|
for object in bpy.data.objects:
|
||||||
|
for modifier in object.modifiers:
|
||||||
|
if modifier.type == 'FLUID_SIMULATION' and modifier.settings.type == "DOMAIN":
|
||||||
|
processFluid(settings)
|
||||||
|
elif modifier.type == "CLOTH":
|
||||||
|
processPointCache(modifier.point_cache)
|
||||||
|
elif modifier.type == "SOFT_BODY":
|
||||||
|
processPointCache(modifier.point_cache)
|
||||||
|
elif modifier.type == "SMOKE" and modifier.smoke_type == "TYPE_DOMAIN":
|
||||||
|
processPointCache(modifier.domain_settings.point_cache_low)
|
||||||
|
if modifier.domain_settings.highres:
|
||||||
|
processPointCache(modifier.domain_settings.point_cache_high)
|
||||||
|
elif modifier.type == "MULTIRES" and modifier.external:
|
||||||
|
file_path = bpy.utils.expandpath(modifier.filename)
|
||||||
|
new_path = path_map.get(file_path, None)
|
||||||
|
if new_path:
|
||||||
|
modifier.filename = new_path
|
||||||
|
|
||||||
|
# particles modifier are stupid and don't contain data
|
||||||
|
# we have to go through the object property
|
||||||
|
for psys in object.particle_systems:
|
||||||
|
processPointCache(psys.point_cache)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
try:
|
||||||
|
i = sys.argv.index("--")
|
||||||
|
except:
|
||||||
|
i = 0
|
||||||
|
|
||||||
|
if i:
|
||||||
|
new_path = sys.argv[i+1]
|
||||||
|
args = sys.argv[i+2:]
|
||||||
|
|
||||||
|
process(args)
|
||||||
|
|
||||||
|
bpy.ops.wm.save_as_mainfile(path=new_path, check_existing=False)
|
||||||
@@ -22,6 +22,7 @@ import subprocess, time
|
|||||||
|
|
||||||
from netrender.utils import *
|
from netrender.utils import *
|
||||||
import netrender.model
|
import netrender.model
|
||||||
|
import netrender.repath
|
||||||
|
|
||||||
BLENDER_PATH = sys.argv[0]
|
BLENDER_PATH = sys.argv[0]
|
||||||
|
|
||||||
@@ -64,12 +65,22 @@ def testCancel(conn, job_id, frame_number):
|
|||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def testFile(conn, job_id, slave_id, file_index, JOB_PREFIX, file_path, main_path = None):
|
def testFile(conn, job_id, slave_id, rfile, JOB_PREFIX, main_path = None):
|
||||||
job_full_path = prefixPath(JOB_PREFIX, file_path, main_path)
|
job_full_path = prefixPath(JOB_PREFIX, rfile.filepath, main_path)
|
||||||
|
|
||||||
|
found = os.path.exists(job_full_path)
|
||||||
|
|
||||||
|
if found:
|
||||||
|
found_signature = hashFile(job_full_path)
|
||||||
|
found = found_signature == rfile.signature
|
||||||
|
|
||||||
|
if not found:
|
||||||
|
print("Found file %s at %s but signature mismatch!" % (rfile.filepath, job_full_path))
|
||||||
|
job_full_path = prefixPath(JOB_PREFIX, rfile.filepath, main_path, force = True)
|
||||||
|
|
||||||
if not os.path.exists(job_full_path):
|
if not found:
|
||||||
temp_path = JOB_PREFIX + "slave.temp.blend"
|
temp_path = JOB_PREFIX + "slave.temp"
|
||||||
conn.request("GET", fileURL(job_id, file_index), headers={"slave-id":slave_id})
|
conn.request("GET", fileURL(job_id, rfile.index), headers={"slave-id":slave_id})
|
||||||
response = conn.getresponse()
|
response = conn.getresponse()
|
||||||
|
|
||||||
if response.status != http.client.OK:
|
if response.status != http.client.OK:
|
||||||
@@ -85,6 +96,8 @@ def testFile(conn, job_id, slave_id, file_index, JOB_PREFIX, file_path, main_pat
|
|||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
os.renames(temp_path, job_full_path)
|
os.renames(temp_path, job_full_path)
|
||||||
|
|
||||||
|
rfile.filepath = job_full_path
|
||||||
|
|
||||||
return job_full_path
|
return job_full_path
|
||||||
|
|
||||||
@@ -105,6 +118,8 @@ def render_slave(engine, netsettings, threads):
|
|||||||
if not os.path.exists(NODE_PREFIX):
|
if not os.path.exists(NODE_PREFIX):
|
||||||
os.mkdir(NODE_PREFIX)
|
os.mkdir(NODE_PREFIX)
|
||||||
|
|
||||||
|
engine.update_stats("", "Network render connected to master, waiting for jobs")
|
||||||
|
|
||||||
while not engine.test_break():
|
while not engine.test_break():
|
||||||
conn.request("GET", "/job", headers={"slave-id":slave_id})
|
conn.request("GET", "/job", headers={"slave-id":slave_id})
|
||||||
response = conn.getresponse()
|
response = conn.getresponse()
|
||||||
@@ -113,6 +128,7 @@ def render_slave(engine, netsettings, threads):
|
|||||||
timeout = 1 # reset timeout on new job
|
timeout = 1 # reset timeout on new job
|
||||||
|
|
||||||
job = netrender.model.RenderJob.materialize(eval(str(response.read(), encoding='utf8')))
|
job = netrender.model.RenderJob.materialize(eval(str(response.read(), encoding='utf8')))
|
||||||
|
engine.update_stats("", "Network render processing job from master")
|
||||||
|
|
||||||
JOB_PREFIX = NODE_PREFIX + "job_" + job.id + os.sep
|
JOB_PREFIX = NODE_PREFIX + "job_" + job.id + os.sep
|
||||||
if not os.path.exists(JOB_PREFIX):
|
if not os.path.exists(JOB_PREFIX):
|
||||||
@@ -123,14 +139,17 @@ def render_slave(engine, netsettings, threads):
|
|||||||
job_path = job.files[0].filepath # path of main file
|
job_path = job.files[0].filepath # path of main file
|
||||||
main_path, main_file = os.path.split(job_path)
|
main_path, main_file = os.path.split(job_path)
|
||||||
|
|
||||||
job_full_path = testFile(conn, job.id, slave_id, 0, JOB_PREFIX, job_path)
|
job_full_path = testFile(conn, job.id, slave_id, job.files[0], JOB_PREFIX)
|
||||||
print("Fullpath", job_full_path)
|
print("Fullpath", job_full_path)
|
||||||
print("File:", main_file, "and %i other files" % (len(job.files) - 1,))
|
print("File:", main_file, "and %i other files" % (len(job.files) - 1,))
|
||||||
engine.update_stats("", "Render File "+ main_file+ " for job "+ job.id)
|
|
||||||
|
|
||||||
for rfile in job.files[1:]:
|
for rfile in job.files[1:]:
|
||||||
|
testFile(conn, job.id, slave_id, rfile, JOB_PREFIX, main_path)
|
||||||
print("\t", rfile.filepath)
|
print("\t", rfile.filepath)
|
||||||
testFile(conn, job.id, slave_id, rfile.index, JOB_PREFIX, rfile.filepath, main_path)
|
|
||||||
|
netrender.repath.update(job)
|
||||||
|
|
||||||
|
engine.update_stats("", "Render File "+ main_file+ " for job "+ job.id)
|
||||||
|
|
||||||
# announce log to master
|
# announce log to master
|
||||||
logfile = netrender.model.LogFile(job.id, slave_id, [frame.number for frame in job.frames])
|
logfile = netrender.model.LogFile(job.id, slave_id, [frame.number for frame in job.frames])
|
||||||
@@ -175,6 +194,10 @@ def render_slave(engine, netsettings, threads):
|
|||||||
# (only need to update on one frame, they are linked
|
# (only need to update on one frame, they are linked
|
||||||
conn.request("PUT", logURL(job.id, first_frame), stdout, headers=headers)
|
conn.request("PUT", logURL(job.id, first_frame), stdout, headers=headers)
|
||||||
response = conn.getresponse()
|
response = conn.getresponse()
|
||||||
|
|
||||||
|
# Also output on console
|
||||||
|
if netsettings.slave_thumb:
|
||||||
|
print(str(stdout, encoding='utf8'), end="")
|
||||||
|
|
||||||
stdout = bytes()
|
stdout = bytes()
|
||||||
|
|
||||||
@@ -182,6 +205,9 @@ def render_slave(engine, netsettings, threads):
|
|||||||
if testCancel(conn, job.id, first_frame):
|
if testCancel(conn, job.id, first_frame):
|
||||||
cancelled = True
|
cancelled = True
|
||||||
|
|
||||||
|
if job.type == netrender.model.JOB_BLENDER:
|
||||||
|
netrender.repath.reset(job)
|
||||||
|
|
||||||
# read leftovers if needed
|
# read leftovers if needed
|
||||||
stdout += process.stdout.read()
|
stdout += process.stdout.read()
|
||||||
|
|
||||||
@@ -191,6 +217,17 @@ def render_slave(engine, netsettings, threads):
|
|||||||
process.terminate()
|
process.terminate()
|
||||||
continue # to next frame
|
continue # to next frame
|
||||||
|
|
||||||
|
# flush the rest of the logs
|
||||||
|
if stdout:
|
||||||
|
# Also output on console
|
||||||
|
if netsettings.slave_thumb:
|
||||||
|
print(str(stdout, encoding='utf8'), end="")
|
||||||
|
|
||||||
|
# (only need to update on one frame, they are linked
|
||||||
|
conn.request("PUT", logURL(job.id, first_frame), stdout, headers=headers)
|
||||||
|
if conn.getresponse().status == http.client.NO_CONTENT:
|
||||||
|
continue
|
||||||
|
|
||||||
total_t = time.time() - start_t
|
total_t = time.time() - start_t
|
||||||
|
|
||||||
avg_t = total_t / len(job.frames)
|
avg_t = total_t / len(job.frames)
|
||||||
@@ -199,13 +236,6 @@ def render_slave(engine, netsettings, threads):
|
|||||||
|
|
||||||
print("status", status)
|
print("status", status)
|
||||||
|
|
||||||
# flush the rest of the logs
|
|
||||||
if stdout:
|
|
||||||
# (only need to update on one frame, they are linked
|
|
||||||
conn.request("PUT", logURL(job.id, first_frame), stdout, headers=headers)
|
|
||||||
if conn.getresponse().status == http.client.NO_CONTENT:
|
|
||||||
continue
|
|
||||||
|
|
||||||
headers = {"job-id":job.id, "slave-id":slave_id, "job-time":str(avg_t)}
|
headers = {"job-id":job.id, "slave-id":slave_id, "job-time":str(avg_t)}
|
||||||
|
|
||||||
|
|
||||||
@@ -245,6 +275,8 @@ def render_slave(engine, netsettings, threads):
|
|||||||
conn.request("PUT", "/render", headers=headers)
|
conn.request("PUT", "/render", headers=headers)
|
||||||
if conn.getresponse().status == http.client.NO_CONTENT:
|
if conn.getresponse().status == http.client.NO_CONTENT:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
engine.update_stats("", "Network render connected to master, waiting for jobs")
|
||||||
else:
|
else:
|
||||||
if timeout < MAX_TIMEOUT:
|
if timeout < MAX_TIMEOUT:
|
||||||
timeout += INCREMENT_TIMEOUT
|
timeout += INCREMENT_TIMEOUT
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ def verify_address(netsettings):
|
|||||||
else:
|
else:
|
||||||
netsettings.server_address = "[default]"
|
netsettings.server_address = "[default]"
|
||||||
|
|
||||||
class RenderButtonsPanel(bpy.types.Panel):
|
class RenderButtonsPanel():
|
||||||
bl_space_type = "PROPERTIES"
|
bl_space_type = "PROPERTIES"
|
||||||
bl_region_type = "WINDOW"
|
bl_region_type = "WINDOW"
|
||||||
bl_context = "render"
|
bl_context = "render"
|
||||||
@@ -88,7 +88,7 @@ class RenderButtonsPanel(bpy.types.Panel):
|
|||||||
|
|
||||||
# Setting panel, use in the scene for now.
|
# Setting panel, use in the scene for now.
|
||||||
@rnaType
|
@rnaType
|
||||||
class RENDER_PT_network_settings(RenderButtonsPanel):
|
class RENDER_PT_network_settings(bpy.types.Panel, RenderButtonsPanel):
|
||||||
bl_label = "Network Settings"
|
bl_label = "Network Settings"
|
||||||
COMPAT_ENGINES = {'NET_RENDER'}
|
COMPAT_ENGINES = {'NET_RENDER'}
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ class RENDER_PT_network_settings(RenderButtonsPanel):
|
|||||||
layout.operator("render.netclientweb", icon='QUESTION')
|
layout.operator("render.netclientweb", icon='QUESTION')
|
||||||
|
|
||||||
@rnaType
|
@rnaType
|
||||||
class RENDER_PT_network_slave_settings(RenderButtonsPanel):
|
class RENDER_PT_network_slave_settings(bpy.types.Panel, RenderButtonsPanel):
|
||||||
bl_label = "Slave Settings"
|
bl_label = "Slave Settings"
|
||||||
COMPAT_ENGINES = {'NET_RENDER'}
|
COMPAT_ENGINES = {'NET_RENDER'}
|
||||||
|
|
||||||
@@ -141,13 +141,14 @@ class RENDER_PT_network_slave_settings(RenderButtonsPanel):
|
|||||||
|
|
||||||
layout.prop(netsettings, "slave_clear")
|
layout.prop(netsettings, "slave_clear")
|
||||||
layout.prop(netsettings, "slave_thumb")
|
layout.prop(netsettings, "slave_thumb")
|
||||||
|
layout.prop(netsettings, "slave_outputlog")
|
||||||
layout.label(text="Threads:")
|
layout.label(text="Threads:")
|
||||||
layout.prop(rd, "threads_mode", expand=True)
|
layout.prop(rd, "threads_mode", expand=True)
|
||||||
sub = layout.column()
|
sub = layout.column()
|
||||||
sub.enabled = rd.threads_mode == 'FIXED'
|
sub.enabled = rd.threads_mode == 'FIXED'
|
||||||
sub.prop(rd, "threads")
|
sub.prop(rd, "threads")
|
||||||
@rnaType
|
@rnaType
|
||||||
class RENDER_PT_network_master_settings(RenderButtonsPanel):
|
class RENDER_PT_network_master_settings(bpy.types.Panel, RenderButtonsPanel):
|
||||||
bl_label = "Master Settings"
|
bl_label = "Master Settings"
|
||||||
COMPAT_ENGINES = {'NET_RENDER'}
|
COMPAT_ENGINES = {'NET_RENDER'}
|
||||||
|
|
||||||
@@ -166,7 +167,7 @@ class RENDER_PT_network_master_settings(RenderButtonsPanel):
|
|||||||
layout.prop(netsettings, "master_clear")
|
layout.prop(netsettings, "master_clear")
|
||||||
|
|
||||||
@rnaType
|
@rnaType
|
||||||
class RENDER_PT_network_job(RenderButtonsPanel):
|
class RENDER_PT_network_job(bpy.types.Panel, RenderButtonsPanel):
|
||||||
bl_label = "Job Settings"
|
bl_label = "Job Settings"
|
||||||
COMPAT_ENGINES = {'NET_RENDER'}
|
COMPAT_ENGINES = {'NET_RENDER'}
|
||||||
|
|
||||||
@@ -186,6 +187,7 @@ class RENDER_PT_network_job(RenderButtonsPanel):
|
|||||||
if netsettings.server_address != "[default]":
|
if netsettings.server_address != "[default]":
|
||||||
layout.operator("render.netclientanim", icon='RENDER_ANIMATION')
|
layout.operator("render.netclientanim", icon='RENDER_ANIMATION')
|
||||||
layout.operator("render.netclientsend", icon='FILE_BLEND')
|
layout.operator("render.netclientsend", icon='FILE_BLEND')
|
||||||
|
layout.operator("render.netclientsendframe", icon='RENDER_STILL')
|
||||||
if netsettings.job_id:
|
if netsettings.job_id:
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.operator("render.render", text="Get Image", icon='RENDER_STILL')
|
row.operator("render.render", text="Get Image", icon='RENDER_STILL')
|
||||||
@@ -206,16 +208,17 @@ class RENDER_PT_network_job(RenderButtonsPanel):
|
|||||||
row.prop(netsettings, "chunks")
|
row.prop(netsettings, "chunks")
|
||||||
|
|
||||||
@rnaType
|
@rnaType
|
||||||
class RENDER_PT_network_slaves(RenderButtonsPanel):
|
class RENDER_PT_network_slaves(bpy.types.Panel, RenderButtonsPanel):
|
||||||
bl_label = "Slaves Status"
|
bl_label = "Slaves Status"
|
||||||
COMPAT_ENGINES = {'NET_RENDER'}
|
COMPAT_ENGINES = {'NET_RENDER'}
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
netsettings = scene.network_render
|
netsettings = scene.network_render
|
||||||
|
if netsettings.mode != "RENDER_CLIENT":
|
||||||
|
return False
|
||||||
verify_address(netsettings)
|
verify_address(netsettings)
|
||||||
return (super().poll(context)
|
return (super().poll(context)
|
||||||
and netsettings.mode == "RENDER_CLIENT"
|
|
||||||
and netsettings.server_address != "[default]")
|
and netsettings.server_address != "[default]")
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
@@ -244,16 +247,17 @@ class RENDER_PT_network_slaves(RenderButtonsPanel):
|
|||||||
layout.label(text="Stats: " + slave.stats)
|
layout.label(text="Stats: " + slave.stats)
|
||||||
|
|
||||||
@rnaType
|
@rnaType
|
||||||
class RENDER_PT_network_slaves_blacklist(RenderButtonsPanel):
|
class RENDER_PT_network_slaves_blacklist(bpy.types.Panel, RenderButtonsPanel):
|
||||||
bl_label = "Slaves Blacklist"
|
bl_label = "Slaves Blacklist"
|
||||||
COMPAT_ENGINES = {'NET_RENDER'}
|
COMPAT_ENGINES = {'NET_RENDER'}
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
netsettings = scene.network_render
|
netsettings = scene.network_render
|
||||||
|
if netsettings.mode != "RENDER_CLIENT":
|
||||||
|
return False
|
||||||
verify_address(netsettings)
|
verify_address(netsettings)
|
||||||
return (super().poll(context)
|
return (super().poll(context)
|
||||||
and netsettings.mode == "RENDER_CLIENT"
|
|
||||||
and netsettings.server_address != "[default]")
|
and netsettings.server_address != "[default]")
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
@@ -281,16 +285,17 @@ class RENDER_PT_network_slaves_blacklist(RenderButtonsPanel):
|
|||||||
layout.label(text="Stats: " + slave.stats)
|
layout.label(text="Stats: " + slave.stats)
|
||||||
|
|
||||||
@rnaType
|
@rnaType
|
||||||
class RENDER_PT_network_jobs(RenderButtonsPanel):
|
class RENDER_PT_network_jobs(bpy.types.Panel, RenderButtonsPanel):
|
||||||
bl_label = "Jobs"
|
bl_label = "Jobs"
|
||||||
COMPAT_ENGINES = {'NET_RENDER'}
|
COMPAT_ENGINES = {'NET_RENDER'}
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
netsettings = scene.network_render
|
netsettings = scene.network_render
|
||||||
|
if netsettings.mode != "RENDER_CLIENT":
|
||||||
|
return False
|
||||||
verify_address(netsettings)
|
verify_address(netsettings)
|
||||||
return (super().poll(context)
|
return (super().poll(context)
|
||||||
and netsettings.mode == "RENDER_CLIENT"
|
|
||||||
and netsettings.server_address != "[default]")
|
and netsettings.server_address != "[default]")
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
@@ -362,6 +367,11 @@ NetRenderSettings.BoolProperty( attr="slave_thumb",
|
|||||||
description="Generate thumbnails on slaves instead of master",
|
description="Generate thumbnails on slaves instead of master",
|
||||||
default = False)
|
default = False)
|
||||||
|
|
||||||
|
NetRenderSettings.BoolProperty( attr="slave_outputlog",
|
||||||
|
name="Output render log on console",
|
||||||
|
description="Output render text log to console as well as sending it to the master",
|
||||||
|
default = True)
|
||||||
|
|
||||||
NetRenderSettings.BoolProperty( attr="master_clear",
|
NetRenderSettings.BoolProperty( attr="master_clear",
|
||||||
name="Clear on exit",
|
name="Clear on exit",
|
||||||
description="delete saved files on exit",
|
description="delete saved files on exit",
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
import sys, os
|
import sys, os
|
||||||
import re
|
import re
|
||||||
import http, http.client, http.server, urllib, socket
|
import http, http.client, http.server, urllib, socket
|
||||||
import subprocess, shutil, time, hashlib
|
import subprocess, shutil, time, hashlib, zlib
|
||||||
|
|
||||||
import netrender.model
|
import netrender.model
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ try:
|
|||||||
except:
|
except:
|
||||||
bpy = None
|
bpy = None
|
||||||
|
|
||||||
VERSION = bytes("0.8", encoding='utf8')
|
VERSION = bytes("0.9", encoding='utf8')
|
||||||
|
|
||||||
# Jobs status
|
# Jobs status
|
||||||
JOB_WAITING = 0 # before all data has been entered
|
JOB_WAITING = 0 # before all data has been entered
|
||||||
@@ -154,18 +154,33 @@ def renderURL(job_id, frame_number):
|
|||||||
def cancelURL(job_id):
|
def cancelURL(job_id):
|
||||||
return "/cancel_%s" % (job_id)
|
return "/cancel_%s" % (job_id)
|
||||||
|
|
||||||
def prefixPath(prefix_directory, file_path, prefix_path):
|
def hashFile(path):
|
||||||
|
f = open(path, "rb")
|
||||||
|
value = hashData(f.read())
|
||||||
|
f.close()
|
||||||
|
return value
|
||||||
|
|
||||||
|
def hashData(data):
|
||||||
|
m = hashlib.md5()
|
||||||
|
m.update(data)
|
||||||
|
return m.hexdigest()
|
||||||
|
|
||||||
|
|
||||||
|
def prefixPath(prefix_directory, file_path, prefix_path, force = False):
|
||||||
if os.path.isabs(file_path):
|
if os.path.isabs(file_path):
|
||||||
# if an absolute path, make sure path exists, if it doesn't, use relative local path
|
# if an absolute path, make sure path exists, if it doesn't, use relative local path
|
||||||
full_path = file_path
|
full_path = file_path
|
||||||
if not os.path.exists(full_path):
|
if force or not os.path.exists(full_path):
|
||||||
p, n = os.path.split(full_path)
|
p, n = os.path.split(full_path)
|
||||||
|
|
||||||
if prefix_path and p.startswith(prefix_path):
|
if prefix_path and p.startswith(prefix_path):
|
||||||
directory = prefix_directory + p[len(prefix_path):]
|
if len(prefix_path) < len(p):
|
||||||
full_path = directory + os.sep + n
|
directory = prefix_directory + p[len(prefix_path)+1:] + os.sep # +1 to remove separator
|
||||||
if not os.path.exists(directory):
|
if not os.path.exists(directory):
|
||||||
os.mkdir(directory)
|
os.mkdir(directory)
|
||||||
|
else:
|
||||||
|
directory = prefix_directory
|
||||||
|
full_path = directory + n
|
||||||
else:
|
else:
|
||||||
full_path = prefix_directory + n
|
full_path = prefix_directory + n
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -205,12 +205,30 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
|
|||||||
|
|
||||||
|
|
||||||
def expandpath(path):
|
def expandpath(path):
|
||||||
|
"""
|
||||||
|
Returns the absolute path relative to the current blend file using the "//" prefix.
|
||||||
|
"""
|
||||||
if path.startswith("//"):
|
if path.startswith("//"):
|
||||||
return _os.path.join(_os.path.dirname(_bpy.data.filename), path[2:])
|
return _os.path.join(_os.path.dirname(_bpy.data.filename), path[2:])
|
||||||
|
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
|
||||||
|
def relpath(path, start=None):
|
||||||
|
"""
|
||||||
|
Returns the path relative to the current blend file using the "//" prefix.
|
||||||
|
|
||||||
|
:arg start: Relative to this path, when not set the current filename is used.
|
||||||
|
:type start: string
|
||||||
|
"""
|
||||||
|
if not path.startswith("//"):
|
||||||
|
if start is None:
|
||||||
|
start = _os.path.dirname(_bpy.data.filename)
|
||||||
|
return "//" + _os.path.relpath(path, start)
|
||||||
|
|
||||||
|
return path
|
||||||
|
|
||||||
|
|
||||||
_unclean_chars = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, \
|
_unclean_chars = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, \
|
||||||
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, \
|
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, \
|
||||||
35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 58, 59, 60, 61, 62, 63, \
|
35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 58, 59, 60, 61, 62, 63, \
|
||||||
|
|||||||
@@ -95,19 +95,19 @@ class _GenericBone:
|
|||||||
def x_axis(self):
|
def x_axis(self):
|
||||||
""" Vector pointing down the x-axis of the bone.
|
""" Vector pointing down the x-axis of the bone.
|
||||||
"""
|
"""
|
||||||
return self.matrix.rotation_part() * Vector(1.0, 0.0, 0.0)
|
return self.matrix.rotation_part() * Vector((1.0, 0.0, 0.0))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def y_axis(self):
|
def y_axis(self):
|
||||||
""" Vector pointing down the x-axis of the bone.
|
""" Vector pointing down the x-axis of the bone.
|
||||||
"""
|
"""
|
||||||
return self.matrix.rotation_part() * Vector(0.0, 1.0, 0.0)
|
return self.matrix.rotation_part() * Vector((0.0, 1.0, 0.0))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def z_axis(self):
|
def z_axis(self):
|
||||||
""" Vector pointing down the x-axis of the bone.
|
""" Vector pointing down the x-axis of the bone.
|
||||||
"""
|
"""
|
||||||
return self.matrix.rotation_part() * Vector(0.0, 0.0, 1.0)
|
return self.matrix.rotation_part() * Vector((0.0, 0.0, 1.0))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def basename(self):
|
def basename(self):
|
||||||
@@ -237,7 +237,7 @@ class EditBone(StructRNA, _GenericBone):
|
|||||||
Expects a 4x4 or 3x3 matrix.
|
Expects a 4x4 or 3x3 matrix.
|
||||||
"""
|
"""
|
||||||
from mathutils import Vector
|
from mathutils import Vector
|
||||||
z_vec = self.matrix.rotation_part() * Vector(0.0, 0.0, 1.0)
|
z_vec = self.matrix.rotation_part() * Vector((0.0, 0.0, 1.0))
|
||||||
self.tail = matrix * self.tail
|
self.tail = matrix * self.tail
|
||||||
self.head = matrix * self.head
|
self.head = matrix * self.head
|
||||||
scalar = matrix.median_scale
|
scalar = matrix.median_scale
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ changes have been made:
|
|||||||
- limit list of modules to prefix in case of "from w"
|
- limit list of modules to prefix in case of "from w"
|
||||||
- sorted modules
|
- sorted modules
|
||||||
- added sphinx documentation
|
- added sphinx documentation
|
||||||
|
- complete() returns a blank list of the module isnt found
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
@@ -183,3 +184,8 @@ def complete(line):
|
|||||||
if len(words) >= 3 and words[0] == 'from':
|
if len(words) >= 3 and words[0] == 'from':
|
||||||
mod = words[1]
|
mod = words[1]
|
||||||
return filter_prefix(try_import(mod), words[-1])
|
return filter_prefix(try_import(mod), words[-1])
|
||||||
|
|
||||||
|
# get here if the import is not found
|
||||||
|
# import invalidmodule
|
||||||
|
# ^, in this case return nothing
|
||||||
|
return []
|
||||||
|
|||||||
@@ -157,17 +157,18 @@ def graph_armature(obj, path, FAKE_PARENT=True, CONSTRAINTS=True, DRIVERS=True,
|
|||||||
pbone = rna_path_as_pbone(rna_path)
|
pbone = rna_path_as_pbone(rna_path)
|
||||||
|
|
||||||
if pbone:
|
if pbone:
|
||||||
for target in fcurve_driver.driver.targets:
|
for var in fcurve_driver.driver.variables:
|
||||||
pbone_target = rna_path_as_pbone(target.data_path)
|
for target in var.targets:
|
||||||
rna_path_target = target.data_path
|
pbone_target = rna_path_as_pbone(target.data_path)
|
||||||
if pbone_target:
|
rna_path_target = target.data_path
|
||||||
opts = ['dir=forward', "weight=1", "arrowhead=normal", "arrowtail=none", "constraint=false", 'color="blue"', "labelfontsize=4"] # ,
|
if pbone_target:
|
||||||
display_source = rna_path.replace("pose.bones", "")
|
opts = ['dir=forward', "weight=1", "arrowhead=normal", "arrowtail=none", "constraint=false", 'color="blue"', "labelfontsize=4"] # ,
|
||||||
display_target = rna_path_target.replace("pose.bones", "")
|
display_source = rna_path.replace("pose.bones", "")
|
||||||
if XTRA_INFO:
|
display_target = rna_path_target.replace("pose.bones", "")
|
||||||
label = "%s\\n%s" % (display_source, display_target)
|
if XTRA_INFO:
|
||||||
opts.append('label="%s"' % compat_str(label))
|
label = "%s\\n%s" % (display_source, display_target)
|
||||||
fw('"%s" -> "%s" [%s] ;\n' % (pbone_target.name, pbone.name, ','.join(opts)))
|
opts.append('label="%s"' % compat_str(label))
|
||||||
|
fw('"%s" -> "%s" [%s] ;\n' % (pbone_target.name, pbone.name, ','.join(opts)))
|
||||||
|
|
||||||
fw(footer)
|
fw(footer)
|
||||||
fileobject.close()
|
fileobject.close()
|
||||||
|
|||||||
@@ -39,10 +39,10 @@ def add_torus(major_rad, minor_rad, major_seg, minor_seg):
|
|||||||
for minor_index in range(minor_seg):
|
for minor_index in range(minor_seg):
|
||||||
angle = 2 * pi * minor_index / minor_seg
|
angle = 2 * pi * minor_index / minor_seg
|
||||||
|
|
||||||
vec = Vector(major_rad + (cos(angle) * minor_rad), 0.0,
|
vec = Vector((major_rad + (cos(angle) * minor_rad), 0.0,
|
||||||
(sin(angle) * minor_rad)) * quat
|
(sin(angle) * minor_rad))) * quat
|
||||||
|
|
||||||
verts.extend([vec.x, vec.y, vec.z])
|
verts.extend(vec[:])
|
||||||
|
|
||||||
if minor_index + 1 == minor_seg:
|
if minor_index + 1 == minor_seg:
|
||||||
i2 = (major_index) * minor_seg
|
i2 = (major_index) * minor_seg
|
||||||
|
|||||||
@@ -55,6 +55,13 @@ def get_console(console_id):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
console, stdout, stderr = consoles[console_id]
|
console, stdout, stderr = consoles[console_id]
|
||||||
|
|
||||||
|
# XXX, bug in python 3.1.2 ?
|
||||||
|
# seems there is no way to clear StringIO objects for writing, have to make new ones each time.
|
||||||
|
import io
|
||||||
|
stdout = io.StringIO()
|
||||||
|
stderr = io.StringIO()
|
||||||
|
|
||||||
except:
|
except:
|
||||||
namespace = {'__builtins__': __builtins__, 'bpy': bpy}
|
namespace = {'__builtins__': __builtins__, 'bpy': bpy}
|
||||||
console = InteractiveConsole(namespace)
|
console = InteractiveConsole(namespace)
|
||||||
@@ -190,7 +197,7 @@ def banner(context):
|
|||||||
add_scrollback("Execute: Enter", 'OUTPUT')
|
add_scrollback("Execute: Enter", 'OUTPUT')
|
||||||
add_scrollback("Autocomplete: Ctrl+Space", 'OUTPUT')
|
add_scrollback("Autocomplete: Ctrl+Space", 'OUTPUT')
|
||||||
add_scrollback("Ctrl +/- Wheel: Zoom", 'OUTPUT')
|
add_scrollback("Ctrl +/- Wheel: Zoom", 'OUTPUT')
|
||||||
add_scrollback("Builtin Modules: bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.context, bgl, blf, mathutils, Geometry", 'OUTPUT')
|
add_scrollback("Builtin Modules: bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.context, bgl, blf, mathutils, geometry", 'OUTPUT')
|
||||||
add_scrollback("", 'OUTPUT')
|
add_scrollback("", 'OUTPUT')
|
||||||
add_scrollback(" WARNING!!! Blender 2.5 API is subject to change, see API reference for more info.", 'ERROR')
|
add_scrollback(" WARNING!!! Blender 2.5 API is subject to change, see API reference for more info.", 'ERROR')
|
||||||
add_scrollback("", 'OUTPUT')
|
add_scrollback("", 'OUTPUT')
|
||||||
|
|||||||
@@ -457,7 +457,7 @@ class MakeDupliFace(bpy.types.Operator):
|
|||||||
|
|
||||||
SCALE_FAC = 0.01
|
SCALE_FAC = 0.01
|
||||||
offset = 0.5 * SCALE_FAC
|
offset = 0.5 * SCALE_FAC
|
||||||
base_tri = Vector(-offset, -offset, 0.0), Vector(offset, -offset, 0.0), Vector(offset, offset, 0.0), Vector(-offset, offset, 0.0)
|
base_tri = Vector((-offset, -offset, 0.0)), Vector((offset, -offset, 0.0)), Vector((offset, offset, 0.0)), Vector((-offset, offset, 0.0))
|
||||||
|
|
||||||
def matrix_to_quat(matrix):
|
def matrix_to_quat(matrix):
|
||||||
# scale = matrix.median_scale
|
# scale = matrix.median_scale
|
||||||
|
|||||||
@@ -198,6 +198,9 @@ class AddPresetInteraction(AddPresetBase):
|
|||||||
"bpy.context.user_preferences.inputs.zoom_axis",
|
"bpy.context.user_preferences.inputs.zoom_axis",
|
||||||
"bpy.context.user_preferences.inputs.view_rotation",
|
"bpy.context.user_preferences.inputs.view_rotation",
|
||||||
"bpy.context.user_preferences.inputs.invert_zoom_direction",
|
"bpy.context.user_preferences.inputs.invert_zoom_direction",
|
||||||
|
"bpy.context.user_preferences.inputs.emulate_numpad",
|
||||||
|
"bpy.context.user_preferences.inputs.emulate_3_button_mouse",
|
||||||
|
"bpy.context.user_preferences.inputs.continuous_mouse",
|
||||||
]
|
]
|
||||||
|
|
||||||
preset_subdir = "interaction"
|
preset_subdir = "interaction"
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
|
from bpy.props import *
|
||||||
|
|
||||||
class SequencerCrossfadeSounds(bpy.types.Operator):
|
class SequencerCrossfadeSounds(bpy.types.Operator):
|
||||||
'''Do crossfading volume animation of two selected sound strips.'''
|
'''Do crossfading volume animation of two selected sound strips.'''
|
||||||
@@ -71,12 +72,52 @@ class SequencerCrossfadeSounds(bpy.types.Operator):
|
|||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
|
|
||||||
|
class SequencerCutMulticam(bpy.types.Operator):
|
||||||
|
'''Cut multicam strip and select camera.'''
|
||||||
|
|
||||||
|
bl_idname = "sequencer.cut_multicam"
|
||||||
|
bl_label = "Cut multicam"
|
||||||
|
bl_options = {'REGISTER', 'UNDO'}
|
||||||
|
|
||||||
|
camera = IntProperty(name="Camera",
|
||||||
|
default=1, min=1, max=32, soft_min=1, soft_max=32)
|
||||||
|
|
||||||
|
def poll(self, context):
|
||||||
|
if context.scene and context.scene.sequence_editor and context.scene.sequence_editor.active_strip:
|
||||||
|
return context.scene.sequence_editor.active_strip.type == 'MULTICAM'
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
camera = self.properties.camera
|
||||||
|
|
||||||
|
s = context.scene.sequence_editor.active_strip
|
||||||
|
|
||||||
|
if not s.selected:
|
||||||
|
s.selected = True
|
||||||
|
|
||||||
|
cfra = context.scene.frame_current
|
||||||
|
bpy.ops.sequencer.cut(frame=cfra,type='HARD',side='RIGHT')
|
||||||
|
for s in context.scene.sequence_editor.sequences:
|
||||||
|
if s.selected and s.type == 'MULTICAM' and s.frame_final_start <= cfra and cfra < s.frame_final_end:
|
||||||
|
context.scene.sequence_editor.active_strip = s
|
||||||
|
|
||||||
|
context.scene.sequence_editor.active_strip.multicam_source = camera
|
||||||
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
bpy.types.register(SequencerCrossfadeSounds)
|
register = bpy.types.register
|
||||||
|
|
||||||
|
register(SequencerCrossfadeSounds)
|
||||||
|
register(SequencerCutMulticam)
|
||||||
|
|
||||||
|
|
||||||
def unregister():
|
def unregister():
|
||||||
bpy.types.unregister(SequencerCrossfadeSounds)
|
unregister = bpy.types.unregister
|
||||||
|
|
||||||
|
unregister(SequencerCrossfadeSounds)
|
||||||
|
unregister(SequencerCutMulticam)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
register()
|
register()
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user