Merged 2.5 -r 20124:21003

This commit is contained in:
Chingiz Dyussenov 2009-06-19 18:24:16 +00:00
commit 82725ce933
939 changed files with 86905 additions and 49736 deletions

@ -59,7 +59,24 @@ ENDMACRO(SETUP_LIBDIRS)
MACRO(SETUP_LIBLINKS
target)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS} ")
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LIB} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIB} ${LLIBS})
#TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LIB} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIB} ${LLIBS})
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIB} ${LLIBS})
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
IF(WIN32)
TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
ELSE(WIN32)
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
ENDIF(WIN32)
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIB} ${LLIBS})
TARGET_LINK_LIBRARIES(${target} ${FREETYPE_LIB})

@ -67,7 +67,6 @@ OPTION(WITH_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF)
OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON)
OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF)
OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF)
OPTION(WITH_YAFRAY "Enable Yafray (Renderer)" OFF)
IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
@ -100,20 +99,6 @@ IF(UNIX)
ENDIF(OPENAL_FOUND)
ENDIF(WITH_OPENAL)
FIND_LIBRARY(ALUT_LIBRARY
NAMES alut
PATHS
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
)
IF(ALUT_LIBRARY)
SET(OPENAL_LIB ${OPENAL_LIB} ${ALUT_LIBRARY})
ENDIF(ALUT_LIBRARY)
FIND_LIBRARY(INTL_LIBRARY
NAMES intl
PATHS
@ -289,7 +274,7 @@ IF(WIN32)
SET(FFMPEG ${LIBDIR}/ffmpeg)
SET(FFMPEG_INC ${FFMPEG}/include)
SET(FFMPEG_LIB avcodec-51 avformat-52 avdevice-52 avutil-49 swscale-0)
SET(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
IF(CMAKE_CL_64)
@ -469,20 +454,18 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ")
#-----------------------------------------------------------------------------
# Libraries
FILE(WRITE ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt "")
SUBDIRS(
intern
extern
source
)
ADD_SUBDIRECTORY(intern)
ADD_SUBDIRECTORY(extern)
ADD_SUBDIRECTORY(source)
#-----------------------------------------------------------------------------
# Blender Application
SUBDIRS(source/creator)
ADD_SUBDIRECTORY(source/creator)
#-----------------------------------------------------------------------------
# Blender Player
IF(WITH_PLAYER)
SUBDIRS(blenderplayer)
ADD_SUBDIRECTORY(blenderplayer)
ENDIF(WITH_PLAYER)

@ -279,7 +279,6 @@ if 'blenderlite' in B.targets:
target_env_defs['WITH_BF_OPENJPEG'] = False
target_env_defs['WITH_BF_FFMPEG'] = False
target_env_defs['WITH_BF_QUICKTIME'] = False
target_env_defs['WITH_BF_YAFRAY'] = False
target_env_defs['WITH_BF_REDCODE'] = False
target_env_defs['WITH_BF_DDS'] = False
target_env_defs['WITH_BF_ZLIB'] = False
@ -405,6 +404,9 @@ dobj = B.buildinfo(env, "dynamic") + B.resources
thestatlibs, thelibincs = B.setup_staticlibs(env)
thesyslibs = B.setup_syslibs(env)
if env['WITH_BF_PLAYER']:
print("Warning: Game player may not build on 2.5")
if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']:
#env.BlenderProg(B.root_build_dir, "blender", dobj , [], mainlist + thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
@ -466,27 +468,17 @@ if env['OURPLATFORM']!='darwin':
dotblenderinstall.append(env.Install(dir=td, source=srcfile))
if env['WITH_BF_PYTHON']:
#-- .blender/scripts
scriptpath='release/scripts'
for dp, dn, df in os.walk(scriptpath):
if 'CVS' in dn:
dn.remove('CVS')
if '.svn' in dn:
dn.remove('.svn')
dir=env['BF_INSTALLDIR']+'/.blender/scripts'+dp[len(scriptpath):]
source=[dp+os.sep+f for f in df]
scriptinstall.append(env.Install(dir=dir,source=source))
#-- .blender/ui
scriptpath='release/ui'
for dp, dn, df in os.walk(scriptpath):
if 'CVS' in dn:
dn.remove('CVS')
if '.svn' in dn:
dn.remove('.svn')
dir=env['BF_INSTALLDIR']+'/.blender/ui'+dp[len(scriptpath):]
source=[dp+os.sep+f for f in df]
scriptinstall.append(env.Install(dir=dir,source=source))
#-- .blender/scripts, .blender/ui, .blender/io
scriptpaths=['release/scripts', 'release/ui', 'release/io']
for scriptpath in scriptpaths:
for dp, dn, df in os.walk(scriptpath):
if 'CVS' in dn:
dn.remove('CVS')
if '.svn' in dn:
dn.remove('.svn')
dir=env['BF_INSTALLDIR']+'/.blender/'+os.path.basename(scriptpath)+dp[len(scriptpath):]
source=[dp+os.sep+f for f in df]
scriptinstall.append(env.Install(dir=dir,source=source))
#-- icons
if env['OURPLATFORM']=='linux2':

@ -155,8 +155,6 @@ BF_SOLID = '#extern/solid'
BF_SOLID_INC = '${BF_SOLID}'
BF_SOLID_LIB = 'extern_solid'
WITH_BF_YAFRAY = True
#WITH_BF_NSPR = True
#BF_NSPR = $(LIBDIR)/nspr
#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr

@ -20,11 +20,6 @@ BF_OPENAL_LIB = 'openal'
BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
BF_OPENAL_LIBPATH = LIBDIR + '/lib'
# some distros have a separate libalut
# if you get linker complaints, you need to uncomment the line below
# BF_OPENAL_LIB = 'openal alut'
# BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a ${BF_OPENAL}/lib/libalut.a'
BF_CXX = '/usr'
WITH_BF_STATICCXX = 'false'
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
@ -93,8 +88,6 @@ BF_SOLID = '#extern/solid'
BF_SOLID_INC = '${BF_SOLID}'
BF_SOLID_LIB = 'extern_solid'
WITH_BF_YAFRAY = 'true'
#WITH_BF_NSPR = 'true'
#BF_NSPR = $(LIBDIR)/nspr
#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr

@ -1,9 +1,17 @@
LCGDIR = '../lib/linux2'
LIBDIR = "${LCGDIR}"
def py_version_string():
'''
returns py version - "2.5", "2.6" etc
'''
import platform
ver = platform.python_version_tuple()
return '%d.%d' % (int(ver[0]), int(ver[1])) # py2.5 uses strings, 2.6 ints
BF_PYTHON = '/usr'
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
BF_PYTHON_VERSION = '2.5'
BF_PYTHON_VERSION = py_version_string()
WITH_BF_STATICPYTHON = False
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
@ -18,11 +26,6 @@ BF_OPENAL_INC = '${BF_OPENAL}/include'
BF_OPENAL_LIB = 'openal'
BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
# some distros have a separate libalut
# if you get linker complaints, you need to uncomment the line below
# BF_OPENAL_LIB = 'openal alut'
# BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a ${BF_OPENAL}/lib/libalut.a'
BF_CXX = '/usr'
WITH_BF_STATICCXX = False
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
@ -71,7 +74,8 @@ BF_GETTEXT_INC = '${BF_GETTEXT}/include'
BF_GETTEXT_LIB = 'gettextlib'
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE=False
WITH_BF_GAMEENGINE = True
WITH_BF_PLAYER = True
WITH_BF_ODE = False
BF_ODE = LIBDIR + '/ode'
@ -87,8 +91,6 @@ BF_SOLID = '#extern/solid'
BF_SOLID_INC = '${BF_SOLID}'
BF_SOLID_LIB = 'extern_solid'
WITH_BF_YAFRAY = True
#WITH_BF_NSPR = True
#BF_NSPR = $(LIBDIR)/nspr
#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr

@ -1,8 +1,6 @@
LCGDIR = '#../lib/windows'
LIBDIR = '${LCGDIR}'
WITH_BF_YAFRAY = True
BF_PYTHON = LIBDIR + '/python'
BF_PYTHON_VERSION = '2.5'
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'

@ -75,8 +75,6 @@ BF_SOLID = '#extern/solid'
BF_SOLID_INC = '${BF_SOLID}'
BF_SOLID_LIB = 'extern_solid'
WITH_BF_YAFRAY = True
#WITH_BF_NSPR = True
#BF_NSPR = $(LIBDIR)/nspr
#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr

@ -83,8 +83,6 @@ BF_SOLID = '#extern/solid'
BF_SOLID_INC = '${BF_SOLID}'
BF_SOLID_LIB = 'extern_solid'
WITH_BF_YAFRAY = True
#WITH_BF_NSPR = True
#BF_NSPR = $(LIBDIR)/nspr
#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr

@ -94,8 +94,6 @@ BF_SOLID_LIB = 'extern_solid'
BF_WINTAB = LIBDIR + '/wintab'
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
WITH_BF_YAFRAY = True
#WITH_BF_NSPR = True
#BF_NSPR = $(LIBDIR)/nspr
#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr

@ -9,10 +9,10 @@ BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
BF_FFMPEG_LIB = 'avformat-52.lib avcodec-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib'
BF_PYTHON = LIBDIR + '/python'
BF_PYTHON_VERSION = '2.5'
BF_PYTHON_VERSION = '2.6'
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
BF_PYTHON_BINARY = 'python'
BF_PYTHON_LIB = 'python25'
BF_PYTHON_LIB = 'python26'
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
WITH_BF_OPENAL = True
@ -107,8 +107,6 @@ BF_SOLID_LIB = 'extern_solid'
BF_WINTAB = LIBDIR + '/wintab'
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
WITH_BF_YAFRAY = True
WITH_BF_BINRELOC = False
#WITH_BF_NSPR = True

@ -110,8 +110,6 @@ BF_SOLID_LIB = 'extern_solid'
BF_WINTAB = LIBDIR + '/wintab'
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
WITH_BF_YAFRAY = True
WITH_BF_BINRELOC = False
#WITH_BF_NSPR = True
@ -184,7 +182,7 @@ WITH_BF_DOCS=False
BF_DEBUG=False
BF_BSC=False
CFLAGS = []
CCFLAGS = ['/nologo', '/Ob1', '/J', '/W3', '/Gd', '/MT', '/openmp']
CCFLAGS = ['/nologo', '/Ob1', '/J', '/W3', '/Gd', '/MT']
CXXFLAGS = ['/EHsc']
if BF_DEBUG:
@ -192,7 +190,7 @@ if BF_DEBUG:
else:
BF_NUMJOBS=6
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:X64','/ENTRY:mainCRTStartup','/INCREMENTAL:NO','/NODEFAULTLIB:"msvcprt.lib"','/NODEFAULTLIB:"glut32.lib"','/NODEFAULTLIB:"libc.lib"','/NODEFAULTLIB:"libcd.lib"','/NODEFAULTLIB:"libcpd.lib"','/NODEFAULTLIB:"libcp.lib"','/LARGEADDRESSAWARE']
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:X64','/ENTRY:mainCRTStartup','/INCREMENTAL:NO','/NODEFAULTLIB:"msvcprt.lib"','/NODEFAULTLIB:"glut32.lib"','/NODEFAULTLIB:"libc.lib"','/NODEFAULTLIB:"libcd.lib"','/NODEFAULTLIB:"libcpd.lib"','/NODEFAULTLIB:"libcp.lib"']
BF_BUILDDIR = '..\\build\\blender25-win64-vc'
BF_INSTALLDIR='..\\install\\blender25-win64-vc'

11
extern/CMakeLists.txt vendored

@ -25,19 +25,20 @@
# ***** END GPL LICENSE BLOCK *****
IF(WITH_GAMEENGINE)
SUBDIRS(qhull solid)
ADD_SUBDIRECTORY(qhull)
ADD_SUBDIRECTORY(solid)
ENDIF(WITH_GAMEENGINE)
IF(WITH_BULLET)
SUBDIRS(bullet2)
ADD_SUBDIRECTORY(bullet2)
ENDIF(WITH_BULLET)
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
SUBDIRS(binreloc)
ADD_SUBDIRECTORY(binreloc)
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
SUBDIRS(glew)
ADD_SUBDIRECTORY(glew)
IF(WITH_OPENJPEG)
SUBDIRS(libopenjpeg)
ADD_SUBDIRECTORY(libopenjpeg)
ENDIF(WITH_OPENJPEG)

7
extern/Makefile vendored

@ -41,9 +41,10 @@ ifeq ($(NAN_FFMPEG), $(LCGDIR)/gcc/ffmpeg)
endif
endif
ifneq ($(NAN_NO_KETSJI), true)
DIRS += bullet2
endif
# Cloth requires it
#ifneq ($(NAN_NO_KETSJI), true)
DIRS += bullet2
#endif
ifeq ($(WITH_BINRELOC), true)
DIRS += binreloc

@ -22,12 +22,13 @@ Written by: Marcus Hennix
#include "LinearMath/btMinMax.h"
#include <new>
//-----------------------------------------------------------------------------
//#define CONETWIST_USE_OBSOLETE_SOLVER true
#define CONETWIST_USE_OBSOLETE_SOLVER false
#define CONETWIST_DEF_FIX_THRESH btScalar(.05f)
//-----------------------------------------------------------------------------
btConeTwistConstraint::btConeTwistConstraint()
:btTypedConstraint(CONETWIST_CONSTRAINT_TYPE),
@ -63,13 +64,13 @@ void btConeTwistConstraint::init()
m_bMotorEnabled = false;
m_maxMotorImpulse = btScalar(-1);
setLimit(btScalar(1e30), btScalar(1e30), btScalar(1e30));
setLimit(btScalar(BT_LARGE_FLOAT), btScalar(BT_LARGE_FLOAT), btScalar(BT_LARGE_FLOAT));
m_damping = btScalar(0.01);
m_fixThresh = CONETWIST_DEF_FIX_THRESH;
}
//-----------------------------------------------------------------------------
void btConeTwistConstraint::getInfo1 (btConstraintInfo1* info)
{
@ -99,9 +100,9 @@ void btConeTwistConstraint::getInfo1 (btConstraintInfo1* info)
info->nub--;
}
}
} // btConeTwistConstraint::getInfo1()
}
//-----------------------------------------------------------------------------
void btConeTwistConstraint::getInfo2 (btConstraintInfo2* info)
{
@ -230,7 +231,7 @@ void btConeTwistConstraint::getInfo2 (btConstraintInfo2* info)
}
}
//-----------------------------------------------------------------------------
void btConeTwistConstraint::buildJacobian()
{
@ -239,6 +240,7 @@ void btConeTwistConstraint::buildJacobian()
m_appliedImpulse = btScalar(0.);
m_accTwistLimitImpulse = btScalar(0.);
m_accSwingLimitImpulse = btScalar(0.);
m_accMotorImpulse = btVector3(0.,0.,0.);
if (!m_angularOnly)
{
@ -277,7 +279,7 @@ void btConeTwistConstraint::buildJacobian()
}
}
//-----------------------------------------------------------------------------
void btConeTwistConstraint::solveConstraintObsolete(btSolverBody& bodyA,btSolverBody& bodyB,btScalar timeStep)
{
@ -406,10 +408,10 @@ void btConeTwistConstraint::solveConstraintObsolete(btSolverBody& bodyA,btSolver
}
}
else // no motor: do a little damping
else if (m_damping > SIMD_EPSILON) // no motor: do a little damping
{
const btVector3& angVelA = getRigidBodyA().getAngularVelocity();
const btVector3& angVelB = getRigidBodyB().getAngularVelocity();
btVector3 angVelA; bodyA.getAngularVelocity(angVelA);
btVector3 angVelB; bodyB.getAngularVelocity(angVelB);
btVector3 relVel = angVelB - angVelA;
if (relVel.length2() > SIMD_EPSILON)
{
@ -490,7 +492,7 @@ void btConeTwistConstraint::solveConstraintObsolete(btSolverBody& bodyA,btSolver
}
//-----------------------------------------------------------------------------
void btConeTwistConstraint::updateRHS(btScalar timeStep)
{
@ -498,7 +500,7 @@ void btConeTwistConstraint::updateRHS(btScalar timeStep)
}
//-----------------------------------------------------------------------------
void btConeTwistConstraint::calcAngleInfo()
{
@ -584,12 +586,12 @@ void btConeTwistConstraint::calcAngleInfo()
m_twistAxis.normalize();
}
}
} // btConeTwistConstraint::calcAngleInfo()
}
static btVector3 vTwist(1,0,0); // twist axis in constraint's space
//-----------------------------------------------------------------------------
void btConeTwistConstraint::calcAngleInfo2()
{
@ -597,13 +599,34 @@ void btConeTwistConstraint::calcAngleInfo2()
m_twistLimitSign = btScalar(0.);
m_solveTwistLimit = false;
m_solveSwingLimit = false;
// compute rotation of A wrt B (in constraint space)
if (m_bMotorEnabled && (!m_useSolveConstraintObsolete))
{ // it is assumed that setMotorTarget() was alredy called
// and motor target m_qTarget is within constraint limits
// TODO : split rotation to pure swing and pure twist
// compute desired transforms in world
btTransform trPose(m_qTarget);
btTransform trA = getRigidBodyA().getCenterOfMassTransform() * m_rbAFrame;
btTransform trB = getRigidBodyB().getCenterOfMassTransform() * m_rbBFrame;
btTransform trDeltaAB = trB * trPose * trA.inverse();
btQuaternion qDeltaAB = trDeltaAB.getRotation();
btVector3 swingAxis = btVector3(qDeltaAB.x(), qDeltaAB.y(), qDeltaAB.z());
m_swingAxis = swingAxis;
m_swingAxis.normalize();
m_swingCorrection = qDeltaAB.getAngle();
if(!btFuzzyZero(m_swingCorrection))
{
m_solveSwingLimit = true;
}
return;
}
{
// compute rotation of A wrt B (in constraint space)
btQuaternion qA = getRigidBodyA().getCenterOfMassTransform().getRotation() * m_rbAFrame.getRotation();
btQuaternion qB = getRigidBodyB().getCenterOfMassTransform().getRotation() * m_rbBFrame.getRotation();
btQuaternion qAB = qB.inverse() * qA;
// split rotation into cone and twist
// (all this is done from B's perspective. Maybe I should be averaging axes...)
btVector3 vConeNoTwist = quatRotate(qAB, vTwist); vConeNoTwist.normalize();
@ -756,7 +779,7 @@ void btConeTwistConstraint::calcAngleInfo2()
m_twistAngle = btScalar(0.f);
}
}
} // btConeTwistConstraint::calcAngleInfo2()
}
@ -982,8 +1005,5 @@ void btConeTwistConstraint::setMotorTargetInConstraintSpace(const btQuaternion &
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

@ -17,6 +17,22 @@ Written by: Marcus Hennix
/*
Overview:
btConeTwistConstraint can be used to simulate ragdoll joints (upper arm, leg etc).
It is a fixed translation, 3 degree-of-freedom (DOF) rotational "joint".
It divides the 3 rotational DOFs into swing (movement within a cone) and twist.
Swing is divided into swing1 and swing2 which can have different limits, giving an elliptical shape.
(Note: the cone's base isn't flat, so this ellipse is "embedded" on the surface of a sphere.)
In the contraint's frame of reference:
twist is along the x-axis,
and swing 1 and 2 are along the z and y axes respectively.
*/
#ifndef CONETWISTCONSTRAINT_H
#define CONETWISTCONSTRAINT_H
@ -141,7 +157,18 @@ public:
};
}
void setLimit(btScalar _swingSpan1,btScalar _swingSpan2,btScalar _twistSpan, btScalar _softness = 1.f, btScalar _biasFactor = 0.3f, btScalar _relaxationFactor = 1.0f)
// setLimit(), a few notes:
// _softness:
// 0->1, recommend ~0.8->1.
// describes % of limits where movement is free.
// beyond this softness %, the limit is gradually enforced until the "hard" (1.0) limit is reached.
// _biasFactor:
// 0->1?, recommend 0.3 +/-0.3 or so.
// strength with which constraint resists zeroth order (angular, not angular velocity) limit violation.
// __relaxationFactor:
// 0->1, recommend to stay near 1.
// the lower the value, the less the constraint will fight velocities which violate the angular limits.
void setLimit(btScalar _swingSpan1,btScalar _swingSpan2,btScalar _twistSpan, btScalar _softness = 1.f, btScalar _biasFactor = 0.3f, btScalar _relaxationFactor = 1.0f)
{
m_swingSpan1 = _swingSpan1;
m_swingSpan2 = _swingSpan2;

@ -77,7 +77,7 @@ struct btContactSolverInfo : public btContactSolverInfoData
m_splitImpulsePenetrationThreshold = -0.02f;
m_linearSlop = btScalar(0.0);
m_warmstartingFactor=btScalar(0.85);
m_solverMode = SOLVER_USE_WARMSTARTING | SOLVER_SIMD ;//SOLVER_RANDMIZE_ORDER
m_solverMode = SOLVER_USE_WARMSTARTING | SOLVER_USE_2_FRICTION_DIRECTIONS |SOLVER_SIMD | SOLVER_RANDMIZE_ORDER;
m_restingContactRestitutionThreshold = 2;//resting contact lifetime threshold to disable restitution
}
};

@ -22,11 +22,13 @@ http://gimpact.sf.net
#include "btGeneric6DofConstraint.h"
#include "BulletDynamics/Dynamics/btRigidBody.h"
#include "LinearMath/btTransformUtil.h"
#include "LinearMath/btTransformUtil.h"
#include <new>
#define D6_USE_OBSOLETE_METHOD false
//-----------------------------------------------------------------------------
btGeneric6DofConstraint::btGeneric6DofConstraint()
:btTypedConstraint(D6_CONSTRAINT_TYPE),
@ -35,7 +37,7 @@ m_useSolveConstraintObsolete(D6_USE_OBSOLETE_METHOD)
{
}
//-----------------------------------------------------------------------------
btGeneric6DofConstraint::btGeneric6DofConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB, bool useLinearReferenceFrameA)
: btTypedConstraint(D6_CONSTRAINT_TYPE, rbA, rbB)
@ -46,12 +48,12 @@ m_useSolveConstraintObsolete(D6_USE_OBSOLETE_METHOD)
{
}
//-----------------------------------------------------------------------------
#define GENERIC_D6_DISABLE_WARMSTARTING 1
//-----------------------------------------------------------------------------
btScalar btGetMatrixElem(const btMatrix3x3& mat, int index);
btScalar btGetMatrixElem(const btMatrix3x3& mat, int index)
@ -61,7 +63,7 @@ btScalar btGetMatrixElem(const btMatrix3x3& mat, int index)
return mat[i][j];
}
//-----------------------------------------------------------------------------
///MatrixToEulerXYZ from http://www.geometrictools.com/LibFoundation/Mathematics/Wm4Matrix3.inl.html
bool matrixToEulerXYZ(const btMatrix3x3& mat,btVector3& xyz);
@ -129,7 +131,7 @@ int btRotationalLimitMotor::testLimitValue(btScalar test_value)
}
//-----------------------------------------------------------------------------
btScalar btRotationalLimitMotor::solveAngularLimits(
btScalar timeStep,btVector3& axis,btScalar jacDiagABInv,
@ -191,8 +193,8 @@ btScalar btRotationalLimitMotor::solveAngularLimits(
// sort with accumulated impulses
btScalar lo = btScalar(-1e30);
btScalar hi = btScalar(1e30);
btScalar lo = btScalar(-BT_LARGE_FLOAT);
btScalar hi = btScalar(BT_LARGE_FLOAT);
btScalar oldaccumImpulse = m_accumulatedImpulse;
btScalar sum = oldaccumImpulse + clippedMotorImpulse;
@ -249,9 +251,9 @@ int btTranslationalLimitMotor::testLimitValue(int limitIndex, btScalar test_valu
m_currentLimit[limitIndex] = 0;//Free from violation
m_currentLimitError[limitIndex] = btScalar(0.f);
return 0;
} // btTranslationalLimitMotor::testLimitValue()
}
//-----------------------------------------------------------------------------
btScalar btTranslationalLimitMotor::solveLinearAxis(
btScalar timeStep,
@ -283,8 +285,8 @@ btScalar btTranslationalLimitMotor::solveLinearAxis(
//positional error (zeroth order error)
btScalar depth = -(pointInA - pointInB).dot(axis_normal_on_a);
btScalar lo = btScalar(-1e30);
btScalar hi = btScalar(1e30);
btScalar lo = btScalar(-BT_LARGE_FLOAT);
btScalar hi = btScalar(BT_LARGE_FLOAT);
btScalar minLimit = m_lowerLimit[limit_index];
btScalar maxLimit = m_upperLimit[limit_index];
@ -372,7 +374,7 @@ void btGeneric6DofConstraint::calculateAngleInfo()
}
//-----------------------------------------------------------------------------
void btGeneric6DofConstraint::calculateTransforms()
{
@ -382,7 +384,7 @@ void btGeneric6DofConstraint::calculateTransforms()
calculateAngleInfo();
}
//-----------------------------------------------------------------------------
void btGeneric6DofConstraint::buildLinearJacobian(
btJacobianEntry & jacLinear,const btVector3 & normalWorld,
@ -400,7 +402,7 @@ void btGeneric6DofConstraint::buildLinearJacobian(
m_rbB.getInvMass());
}
//-----------------------------------------------------------------------------
void btGeneric6DofConstraint::buildAngularJacobian(
btJacobianEntry & jacAngular,const btVector3 & jointAxisW)
@ -413,17 +415,18 @@ void btGeneric6DofConstraint::buildAngularJacobian(
}
//-----------------------------------------------------------------------------
bool btGeneric6DofConstraint::testAngularLimitMotor(int axis_index)
{
btScalar angle = m_calculatedAxisAngleDiff[axis_index];
m_angularLimits[axis_index].m_currentPosition = angle;
//test limits
m_angularLimits[axis_index].testLimitValue(angle);
return m_angularLimits[axis_index].needApplyTorques();
}
//-----------------------------------------------------------------------------
void btGeneric6DofConstraint::buildJacobian()
{
@ -483,7 +486,7 @@ void btGeneric6DofConstraint::buildJacobian()
}
}
//-----------------------------------------------------------------------------
void btGeneric6DofConstraint::getInfo1 (btConstraintInfo1* info)
{
@ -519,7 +522,7 @@ void btGeneric6DofConstraint::getInfo1 (btConstraintInfo1* info)
}
}
//-----------------------------------------------------------------------------
void btGeneric6DofConstraint::getInfo2 (btConstraintInfo2* info)
{
@ -528,7 +531,7 @@ void btGeneric6DofConstraint::getInfo2 (btConstraintInfo2* info)
setAngularLimits(info, row);
}
//-----------------------------------------------------------------------------
int btGeneric6DofConstraint::setLinearLimits(btConstraintInfo2* info)
{
@ -542,6 +545,7 @@ int btGeneric6DofConstraint::setLinearLimits(btConstraintInfo2* info)
{ // re-use rotational motor code
limot.m_bounce = btScalar(0.f);
limot.m_currentLimit = m_linearLimits.m_currentLimit[i];
limot.m_currentPosition = m_linearLimits.m_currentLinearDiff[i];
limot.m_currentLimitError = m_linearLimits.m_currentLimitError[i];
limot.m_damping = m_linearLimits.m_damping;
limot.m_enableMotor = m_linearLimits.m_enableMotor[i];
@ -559,7 +563,7 @@ int btGeneric6DofConstraint::setLinearLimits(btConstraintInfo2* info)
return row;
}
//-----------------------------------------------------------------------------
int btGeneric6DofConstraint::setAngularLimits(btConstraintInfo2 *info, int row_offset)
{
@ -582,7 +586,7 @@ int btGeneric6DofConstraint::setAngularLimits(btConstraintInfo2 *info, int row_o
return row;
}
//-----------------------------------------------------------------------------
void btGeneric6DofConstraint::solveConstraintObsolete(btSolverBody& bodyA,btSolverBody& bodyB,btScalar timeStep)
{
@ -643,7 +647,7 @@ void btGeneric6DofConstraint::solveConstraintObsolete(btSolverBody& bodyA,btSolv
}
}
//-----------------------------------------------------------------------------
void btGeneric6DofConstraint::updateRHS(btScalar timeStep)
{
@ -651,21 +655,26 @@ void btGeneric6DofConstraint::updateRHS(btScalar timeStep)
}
//-----------------------------------------------------------------------------
btVector3 btGeneric6DofConstraint::getAxis(int axis_index) const
{
return m_calculatedAxis[axis_index];
}
//-----------------------------------------------------------------------------
btScalar btGeneric6DofConstraint::getAngle(int axis_index) const
btScalar btGeneric6DofConstraint::getRelativePivotPosition(int axisIndex) const
{
return m_calculatedAxisAngleDiff[axis_index];
return m_calculatedLinearDiff[axisIndex];
}
//-----------------------------------------------------------------------------
btScalar btGeneric6DofConstraint::getAngle(int axisIndex) const
{
return m_calculatedAxisAngleDiff[axisIndex];
}
void btGeneric6DofConstraint::calcAnchorPos(void)
{
@ -684,9 +693,9 @@ void btGeneric6DofConstraint::calcAnchorPos(void)
const btVector3& pB = m_calculatedTransformB.getOrigin();
m_AnchorPos = pA * weight + pB * (btScalar(1.0) - weight);
return;
} // btGeneric6DofConstraint::calcAnchorPos()
}
//-----------------------------------------------------------------------------
void btGeneric6DofConstraint::calculateLinearInfo()
{
@ -694,11 +703,12 @@ void btGeneric6DofConstraint::calculateLinearInfo()
m_calculatedLinearDiff = m_calculatedTransformA.getBasis().inverse() * m_calculatedLinearDiff;
for(int i = 0; i < 3; i++)
{
m_linearLimits.m_currentLinearDiff[i] = m_calculatedLinearDiff[i];
m_linearLimits.testLimitValue(i, m_calculatedLinearDiff[i]);
}
} // btGeneric6DofConstraint::calculateLinearInfo()
}
//-----------------------------------------------------------------------------
int btGeneric6DofConstraint::get_limit_motor_info2(
btRotationalLimitMotor * limot,
@ -721,7 +731,7 @@ int btGeneric6DofConstraint::get_limit_motor_info2(
J2[srow+1] = -ax1[1];
J2[srow+2] = -ax1[2];
}
if((!rotational) && limit)
if((!rotational))
{
btVector3 ltd; // Linear Torque Decoupling vector
btVector3 c = m_calculatedTransformB.getOrigin() - body0->getCenterOfMassPosition();
@ -745,7 +755,14 @@ int btGeneric6DofConstraint::get_limit_motor_info2(
info->cfm[srow] = 0.0f;
if(!limit)
{
info->m_constraintError[srow] += limot->m_targetVelocity;
btScalar tag_vel = rotational ? limot->m_targetVelocity : -limot->m_targetVelocity;
btScalar mot_fact = getMotorFactor( limot->m_currentPosition,
limot->m_loLimit,
limot->m_hiLimit,
tag_vel,
info->fps * info->erp);
info->m_constraintError[srow] += mot_fact * limot->m_targetVelocity;
info->m_lowerLimit[srow] = -limot->m_maxMotorForce;
info->m_upperLimit[srow] = limot->m_maxMotorForce;
}
@ -824,6 +841,131 @@ int btGeneric6DofConstraint::get_limit_motor_info2(
else return 0;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
btGeneric6DofSpringConstraint::btGeneric6DofSpringConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA)
: btGeneric6DofConstraint(rbA, rbB, frameInA, frameInB, useLinearReferenceFrameA)
{
for(int i = 0; i < 6; i++)
{
m_springEnabled[i] = false;
m_equilibriumPoint[i] = btScalar(0.f);
m_springStiffness[i] = btScalar(0.f);
m_springDamping[i] = btScalar(1.f);
}
}
void btGeneric6DofSpringConstraint::enableSpring(int index, bool onOff)
{
btAssert((index >= 0) && (index < 6));
m_springEnabled[index] = onOff;
if(index < 3)
{
m_linearLimits.m_enableMotor[index] = onOff;
}
else
{
m_angularLimits[index - 3].m_enableMotor = onOff;
}
}
void btGeneric6DofSpringConstraint::setStiffness(int index, btScalar stiffness)
{
btAssert((index >= 0) && (index < 6));
m_springStiffness[index] = stiffness;
}
void btGeneric6DofSpringConstraint::setDamping(int index, btScalar damping)
{
btAssert((index >= 0) && (index < 6));
m_springDamping[index] = damping;
}
void btGeneric6DofSpringConstraint::setEquilibriumPoint()
{
calculateTransforms();
for(int i = 0; i < 3; i++)
{
m_equilibriumPoint[i] = m_calculatedLinearDiff[i];
}
for(int i = 0; i < 3; i++)
{
m_equilibriumPoint[i + 3] = m_calculatedAxisAngleDiff[i];
}
}
void btGeneric6DofSpringConstraint::setEquilibriumPoint(int index)
{
btAssert((index >= 0) && (index < 6));
calculateTransforms();
if(index < 3)
{
m_equilibriumPoint[index] = m_calculatedLinearDiff[index];
}
else
{
m_equilibriumPoint[index + 3] = m_calculatedAxisAngleDiff[index];
}
}
void btGeneric6DofSpringConstraint::internalUpdateSprings(btConstraintInfo2* info)
{
calculateTransforms();
// it is assumed that calculateTransforms() have been called before this call
int i;
btVector3 relVel = m_rbB.getLinearVelocity() - m_rbA.getLinearVelocity();
for(i = 0; i < 3; i++)
{
if(m_springEnabled[i])
{
// get current position of constraint
btScalar currPos = m_calculatedLinearDiff[i];
// calculate difference
btScalar delta = currPos - m_equilibriumPoint[i];
// spring force is (delta * m_stiffness) according to Hooke's Law
btScalar force = delta * m_springStiffness[i];
btScalar velFactor = info->fps * m_springDamping[i];
m_linearLimits.m_targetVelocity[i] = velFactor * force;
m_linearLimits.m_maxMotorForce[i] = btFabs(force) / info->fps;
}
}
for(i = 0; i < 3; i++)
{
if(m_springEnabled[i + 3])
{
// get current position of constraint
btScalar currPos = m_calculatedAxisAngleDiff[i];
// calculate difference
btScalar delta = currPos - m_equilibriumPoint[i+3];
// spring force is (-delta * m_stiffness) according to Hooke's Law
btScalar force = -delta * m_springStiffness[i+3];
btScalar velFactor = info->fps * m_springDamping[i+3];
m_angularLimits[i].m_targetVelocity = velFactor * force;
m_angularLimits[i].m_maxMotorForce = btFabs(force) / info->fps;
}
}
}
void btGeneric6DofSpringConstraint::getInfo2(btConstraintInfo2* info)
{
// this will be called by constraint solver at the constraint setup stage
// set current motor parameters
internalUpdateSprings(info);
// do the rest of job for constraint setup
btGeneric6DofConstraint::getInfo2(info);
}

@ -54,6 +54,7 @@ public:
//! temp_variables
//!@{
btScalar m_currentLimitError;//! How much is violated this limit
btScalar m_currentPosition; //! current value of angle
int m_currentLimit;//!< 0=free, 1=at lo limit, 2=at hi limit
btScalar m_accumulatedImpulse;
//!@}
@ -134,6 +135,7 @@ public:
btVector3 m_targetVelocity;//!< target motor velocity
btVector3 m_maxMotorForce;//!< max force on motor
btVector3 m_currentLimitError;//! How much is violated this limit
btVector3 m_currentLinearDiff;//! Current relative offset of constraint frames
int m_currentLimit[3];//!< 0=free, 1=at lower limit, 2=at upper limit
btTranslationalLimitMotor()
@ -380,14 +382,21 @@ public:
//! Get the relative Euler angle
/*!
\pre btGeneric6DofConstraint.buildJacobian must be called previously.
\pre btGeneric6DofConstraint::calculateTransforms() must be called previously.
*/
btScalar getAngle(int axis_index) const;
//! Get the relative position of the constraint pivot
/*!
\pre btGeneric6DofConstraint::calculateTransforms() must be called previously.
*/
btScalar getRelativePivotPosition(int axis_index) const;
//! Test angular limit.
/*!
Calculates angular correction and returns true if limit needs to be corrected.
\pre btGeneric6DofConstraint.buildJacobian must be called previously.
\pre btGeneric6DofConstraint::calculateTransforms() must be called previously.
*/
bool testAngularLimitMotor(int axis_index);
@ -477,4 +486,34 @@ public:
};
/// Generic 6 DOF constraint that allows to set spring motors to any translational and rotational DOF
/// DOF index used in enableSpring() and setStiffness() means:
/// 0 : translation X
/// 1 : translation Y
/// 2 : translation Z
/// 3 : rotation X (3rd Euler rotational around new position of X axis, range [-PI+epsilon, PI-epsilon] )
/// 4 : rotation Y (2nd Euler rotational around new position of Y axis, range [-PI/2+epsilon, PI/2-epsilon] )
/// 5 : rotation Z (1st Euler rotational around Z axis, range [-PI+epsilon, PI-epsilon] )
class btGeneric6DofSpringConstraint : public btGeneric6DofConstraint
{
protected:
bool m_springEnabled[6];
btScalar m_equilibriumPoint[6];
btScalar m_springStiffness[6];
btScalar m_springDamping[6]; // between 0 and 1 (1 == no damping)
void internalUpdateSprings(btConstraintInfo2* info);
public:
btGeneric6DofSpringConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA);
void enableSpring(int index, bool onOff);
void setStiffness(int index, btScalar stiffness);
void setDamping(int index, btScalar damping);
void setEquilibriumPoint(); // set the current constraint position/orientation as an equilibrium point for all DOF
void setEquilibriumPoint(int index); // set the current constraint position/orientation as an equilibrium point for given DOF
virtual void getInfo2 (btConstraintInfo2* info);
};
#endif //GENERIC_6DOF_CONSTRAINT_H

@ -490,7 +490,7 @@ void btSequentialImpulseConstraintSolver::convertContact(btPersistentManifold* m
///warm starting (or zero if disabled)
if (0)//infoGlobal.m_solverMode & SOLVER_USE_WARMSTARTING)
if (infoGlobal.m_solverMode & SOLVER_USE_WARMSTARTING)
{
solverConstraint.m_appliedImpulse = cp.m_appliedImpulse * infoGlobal.m_warmstartingFactor;
if (rb0)
@ -539,9 +539,6 @@ void btSequentialImpulseConstraintSolver::convertContact(btPersistentManifold* m
if (!(infoGlobal.m_solverMode & SOLVER_DISABLE_VELOCITY_DEPENDENT_FRICTION_DIRECTION) && lat_rel_vel > SIMD_EPSILON)
{
cp.m_lateralFrictionDir1 /= btSqrt(lat_rel_vel);
applyAnisotropicFriction(colObj0,cp.m_lateralFrictionDir1);
applyAnisotropicFriction(colObj1,cp.m_lateralFrictionDir1);
addFrictionConstraint(cp.m_lateralFrictionDir1,solverBodyIdA,solverBodyIdB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation);
if((infoGlobal.m_solverMode & SOLVER_USE_2_FRICTION_DIRECTIONS))
{
cp.m_lateralFrictionDir2 = cp.m_lateralFrictionDir1.cross(cp.m_normalWorldOnB);
@ -550,21 +547,26 @@ void btSequentialImpulseConstraintSolver::convertContact(btPersistentManifold* m
applyAnisotropicFriction(colObj1,cp.m_lateralFrictionDir2);
addFrictionConstraint(cp.m_lateralFrictionDir2,solverBodyIdA,solverBodyIdB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation);
}
applyAnisotropicFriction(colObj0,cp.m_lateralFrictionDir1);
applyAnisotropicFriction(colObj1,cp.m_lateralFrictionDir1);
addFrictionConstraint(cp.m_lateralFrictionDir1,solverBodyIdA,solverBodyIdB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation);
cp.m_lateralFrictionInitialized = true;
} else
{
//re-calculate friction direction every frame, todo: check if this is really needed
btPlaneSpace1(cp.m_normalWorldOnB,cp.m_lateralFrictionDir1,cp.m_lateralFrictionDir2);
applyAnisotropicFriction(colObj0,cp.m_lateralFrictionDir1);
applyAnisotropicFriction(colObj1,cp.m_lateralFrictionDir1);
addFrictionConstraint(cp.m_lateralFrictionDir1,solverBodyIdA,solverBodyIdB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation);
if ((infoGlobal.m_solverMode & SOLVER_USE_2_FRICTION_DIRECTIONS))
{
applyAnisotropicFriction(colObj0,cp.m_lateralFrictionDir2);
applyAnisotropicFriction(colObj1,cp.m_lateralFrictionDir2);
addFrictionConstraint(cp.m_lateralFrictionDir2,solverBodyIdA,solverBodyIdB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation);
}
applyAnisotropicFriction(colObj0,cp.m_lateralFrictionDir1);
applyAnisotropicFriction(colObj1,cp.m_lateralFrictionDir1);
addFrictionConstraint(cp.m_lateralFrictionDir1,solverBodyIdA,solverBodyIdB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation);
cp.m_lateralFrictionInitialized = true;
}

@ -18,14 +18,14 @@ Added by Roman Ponomarev (rponom@gmail.com)
April 04, 2008
*/
//-----------------------------------------------------------------------------
#include "btSliderConstraint.h"
#include "BulletDynamics/Dynamics/btRigidBody.h"
#include "LinearMath/btTransformUtil.h"
#include <new>
//-----------------------------------------------------------------------------
void btSliderConstraint::initParams()
{
@ -62,9 +62,9 @@ void btSliderConstraint::initParams()
m_maxAngMotorForce = btScalar(0.);
m_accumulatedAngMotorImpulse = btScalar(0.0);
} // btSliderConstraint::initParams()
}
//-----------------------------------------------------------------------------
btSliderConstraint::btSliderConstraint()
:btTypedConstraint(SLIDER_CONSTRAINT_TYPE),
@ -73,9 +73,9 @@ btSliderConstraint::btSliderConstraint()
// m_useSolveConstraintObsolete(true)
{
initParams();
} // btSliderConstraint::btSliderConstraint()
}
//-----------------------------------------------------------------------------
btSliderConstraint::btSliderConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB, bool useLinearReferenceFrameA)
: btTypedConstraint(SLIDER_CONSTRAINT_TYPE, rbA, rbB)
@ -86,9 +86,25 @@ btSliderConstraint::btSliderConstraint(btRigidBody& rbA, btRigidBody& rbB, const
// m_useSolveConstraintObsolete(true)
{
initParams();
} // btSliderConstraint::btSliderConstraint()
}
static btRigidBody s_fixed(0, 0, 0);
btSliderConstraint::btSliderConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB)
: btTypedConstraint(SLIDER_CONSTRAINT_TYPE, s_fixed, rbB)
,
m_frameInB(frameInB),
m_useLinearReferenceFrameA(useLinearReferenceFrameB),
m_useSolveConstraintObsolete(false)
// m_useSolveConstraintObsolete(true)
{
///not providing rigidbody B means implicitly using worldspace for body B
// m_frameInA.getOrigin() = m_rbA.getCenterOfMassTransform()(m_frameInA.getOrigin());
initParams();
}
//-----------------------------------------------------------------------------
void btSliderConstraint::buildJacobian()
{
@ -104,9 +120,9 @@ void btSliderConstraint::buildJacobian()
{
buildJacobianInt(m_rbB, m_rbA, m_frameInB, m_frameInA);
}
} // btSliderConstraint::buildJacobian()
}
//-----------------------------------------------------------------------------
void btSliderConstraint::buildJacobianInt(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB)
{
@ -159,9 +175,9 @@ void btSliderConstraint::buildJacobianInt(btRigidBody& rbA, btRigidBody& rbB, co
// clear accumulator for motors
m_accumulatedLinMotorImpulse = btScalar(0.0);
m_accumulatedAngMotorImpulse = btScalar(0.0);
} // btSliderConstraint::buildJacobianInt()
}
//-----------------------------------------------------------------------------
void btSliderConstraint::getInfo1(btConstraintInfo1* info)
{
@ -189,9 +205,9 @@ void btSliderConstraint::getInfo1(btConstraintInfo1* info)
info->nub--;
}
}
} // btSliderConstraint::getInfo1()
}
//-----------------------------------------------------------------------------
void btSliderConstraint::getInfo2(btConstraintInfo2* info)
{
@ -499,9 +515,9 @@ void btSliderConstraint::getInfo2(btConstraintInfo2* info)
info->m_constraintError[srow] *= getSoftnessLimAng();
} // if(limit)
} // if angular limit or powered
} // btSliderConstraint::getInfo2()
}
//-----------------------------------------------------------------------------
void btSliderConstraint::solveConstraintObsolete(btSolverBody& bodyA,btSolverBody& bodyB,btScalar timeStep)
{
@ -517,9 +533,9 @@ void btSliderConstraint::solveConstraintObsolete(btSolverBody& bodyA,btSolverBod
solveConstraintInt(m_rbB,bodyB, m_rbA,bodyA);
}
}
} // btSliderConstraint::solveConstraint()
}
//-----------------------------------------------------------------------------
void btSliderConstraint::solveConstraintInt(btRigidBody& rbA, btSolverBody& bodyA,btRigidBody& rbB, btSolverBody& bodyB)
{
@ -703,11 +719,11 @@ void btSliderConstraint::solveConstraintInt(btRigidBody& rbA, btSolverBody& body
bodyB.applyImpulse(btVector3(0,0,0), rbB.getInvInertiaTensorWorld()*axisA,-angImpulse);
}
}
} // btSliderConstraint::solveConstraint()
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void btSliderConstraint::calculateTransforms(void){
if(m_useLinearReferenceFrameA || (!m_useSolveConstraintObsolete))
@ -740,9 +756,9 @@ void btSliderConstraint::calculateTransforms(void){
normalWorld = m_calculatedTransformA.getBasis().getColumn(i);
m_depth[i] = m_delta.dot(normalWorld);
}
} // btSliderConstraint::calculateTransforms()
}
//-----------------------------------------------------------------------------
void btSliderConstraint::testLinLimits(void)
{
@ -769,9 +785,9 @@ void btSliderConstraint::testLinLimits(void)
{
m_depth[0] = btScalar(0.);
}
} // btSliderConstraint::testLinLimits()
}
//-----------------------------------------------------------------------------
void btSliderConstraint::testAngLimits(void)
{
@ -795,9 +811,9 @@ void btSliderConstraint::testAngLimits(void)
m_solveAngLim = true;
}
}
} // btSliderConstraint::testAngLimits()
}
//-----------------------------------------------------------------------------
btVector3 btSliderConstraint::getAncorInA(void)
{
@ -805,13 +821,13 @@ btVector3 btSliderConstraint::getAncorInA(void)
ancorInA = m_realPivotAInW + (m_lowerLinLimit + m_upperLinLimit) * btScalar(0.5) * m_sliderAxis;
ancorInA = m_rbA.getCenterOfMassTransform().inverse() * ancorInA;
return ancorInA;
} // btSliderConstraint::getAncorInA()
}
//-----------------------------------------------------------------------------
btVector3 btSliderConstraint::getAncorInB(void)
{
btVector3 ancorInB;
ancorInB = m_frameInB.getOrigin();
return ancorInB;
} // btSliderConstraint::getAncorInB();
}

@ -25,23 +25,23 @@ TODO:
#ifndef SLIDER_CONSTRAINT_H
#define SLIDER_CONSTRAINT_H
//-----------------------------------------------------------------------------
#include "LinearMath/btVector3.h"
#include "btJacobianEntry.h"
#include "btTypedConstraint.h"
//-----------------------------------------------------------------------------
class btRigidBody;
//-----------------------------------------------------------------------------
#define SLIDER_CONSTRAINT_DEF_SOFTNESS (btScalar(1.0))
#define SLIDER_CONSTRAINT_DEF_DAMPING (btScalar(1.0))
#define SLIDER_CONSTRAINT_DEF_RESTITUTION (btScalar(0.7))
//-----------------------------------------------------------------------------
class btSliderConstraint : public btTypedConstraint
{
@ -126,6 +126,7 @@ protected:
public:
// constructors
btSliderConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA);
btSliderConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB);
btSliderConstraint();
// overrides
virtual void buildJacobian();
@ -223,7 +224,7 @@ public:
btVector3 getAncorInB(void);
};
//-----------------------------------------------------------------------------
#endif //SLIDER_CONSTRAINT_H

@ -1 +1,4 @@
SUBDIRS( BulletCollision BulletDynamics LinearMath BulletSoftBody )
ADD_SUBDIRECTORY(BulletCollision)
ADD_SUBDIRECTORY(BulletDynamics)
ADD_SUBDIRECTORY(LinearMath)
ADD_SUBDIRECTORY(BulletSoftBody )

@ -168,8 +168,12 @@ inline int btGetVersion()
///The btScalar type abstracts floating point numbers, to easily switch between double and single floating point precision.
#if defined(BT_USE_DOUBLE_PRECISION)
typedef double btScalar;
//this number could be bigger in double precision
#define BT_LARGE_FLOAT 1e30
#else
typedef float btScalar;
//keep BT_LARGE_FLOAT*BT_LARGE_FLOAT < FLT_MAX
#define BT_LARGE_FLOAT 1e18f
#endif

@ -561,6 +561,7 @@ opj_image_t* jp2_decode(opj_jp2_t *jp2, opj_cio_t *cio, opj_codestream_info_t *c
image = j2k_decode(jp2->j2k, cio, cstr_info);
if(!image) {
opj_event_msg(cinfo, EVT_ERROR, "Failed to decode J2K image\n");
return NULL;
}
/* Set Image Color Space */

@ -24,10 +24,20 @@
#
# ***** END GPL LICENSE BLOCK *****
SUBDIRS(SoundSystem string ghost guardedalloc moto container memutil decimation iksolver boolop opennl)
ADD_SUBDIRECTORY(SoundSystem)
ADD_SUBDIRECTORY(string)
ADD_SUBDIRECTORY(ghost)
ADD_SUBDIRECTORY(guardedalloc)
ADD_SUBDIRECTORY(moto)
ADD_SUBDIRECTORY(container)
ADD_SUBDIRECTORY(memutil)
ADD_SUBDIRECTORY(decimation)
ADD_SUBDIRECTORY(iksolver)
ADD_SUBDIRECTORY(boolop)
ADD_SUBDIRECTORY(opennl)
IF(WITH_ELBEEM)
SUBDIRS(elbeem)
ADD_SUBDIRECTORY(elbeem)
ENDIF(WITH_ELBEEM)
SUBDIRS(bsp)
ADD_SUBDIRECTORY(bsp)

@ -1,574 +0,0 @@
/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
* SND_FmodDevice derived from SND_IAudioDevice
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef WIN32
#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
#endif //WIN32
#include "SND_FmodDevice.h"
#include "SoundDefines.h"
#include "SND_Utils.h"
SND_FmodDevice::SND_FmodDevice()
{
/* Removed the functionality for checking if noaudio was provided on */
/* the commandline. */
m_dspunit = NULL;
m_audio = true;
// let's check if we can get fmod to initialize...
if (m_audio)
{
signed char MinHardwareChannels = FSOUND_SetMinHardwareChannels(NUM_FMOD_MIN_HW_CHANNELS);
signed char MaxHardwareChannels = FSOUND_SetMaxHardwareChannels(NUM_FMOD_MAX_HW_CHANNELS);
if (FSOUND_Init(MIXRATE, NUM_SOURCES, 0))
{
m_max_channels = FSOUND_GetMaxChannels();
m_num_hardware_channels = FSOUND_GetNumHardwareChannels();
m_num_software_channels = NUM_SOURCES;
// let's get us a wavecache
m_wavecache = new SND_WaveCache();
int i;
for (i = 0; i < NUM_BUFFERS; i++)
m_buffers[i] = NULL;
for (i = 0; i < NUM_SOURCES; i++)
{
m_sources[i] = NULL;
m_frequencies[i] = 0;
m_channels[i] = 0;
}
}
else
{
m_audio = false;
}
}
#ifdef ONTKEVER
int numdrivers = FSOUND_GetNumDrivers();
int output = FSOUND_GetOutput();
int oputputrate = FSOUND_GetOutputRate();
int mixer = FSOUND_GetMixer();
printf("maxchannels is: %d\n", m_max_channels);
printf("num hw channels is: %d\n", m_num_hardware_channels);
printf("num sw channels is: %d\n", m_num_software_channels);
printf("numdrivers is: %d\n", numdrivers);
printf("output is: %d\n", output);
printf("oputputrate is: %d\n", oputputrate);
printf("mixer is: %d\n", mixer);
#endif
}
SND_FmodDevice::~SND_FmodDevice()
{
// let's see if we used the cd. if not, just leave it alone
SND_CDObject* pCD = SND_CDObject::Instance();
if (pCD)
{
this->StopCD();
SND_CDObject::DisposeSystem();
}
StopUsingDSP();
FSOUND_Close();
}
void SND_FmodDevice::UseCD() const
{
// only fmod has CD support, so only create it here
SND_CDObject::CreateSystem();
}
void SND_FmodDevice::MakeCurrent() const
{
// empty
}
SND_WaveSlot* SND_FmodDevice::LoadSample(const STR_String& name,
void* memlocation,
int size)
{
SND_WaveSlot* waveslot = NULL;
STR_String samplename = name;
if (m_audio)
{
/* first check if the sample is supported */
if (SND_IsSampleValid(name, memlocation))
{
/* create the waveslot */
waveslot = m_wavecache->GetWaveSlot(samplename);
if (waveslot)
{
int buffer = waveslot->GetBuffer();
/* load the sample from memory? */
if (size && memlocation)
{
m_buffers[buffer] = FSOUND_Sample_Load(buffer, (char*)memlocation, FSOUND_LOADMEMORY, size);
/* if the loading succeeded, fill the waveslot with info */
if (m_buffers[buffer])
{
int sampleformat = SND_GetSampleFormat(memlocation);
int numberofchannels = SND_GetNumberOfChannels(memlocation);
int samplerate = SND_GetSampleRate(memlocation);
int bitrate = SND_GetBitRate(memlocation);
int numberofsamples = SND_GetNumberOfSamples(memlocation, size);
waveslot->SetFileSize(size);
waveslot->SetData(memlocation);
waveslot->SetSampleFormat(sampleformat);
waveslot->SetNumberOfChannels(numberofchannels);
waveslot->SetSampleRate(samplerate);
waveslot->SetBitRate(bitrate);
waveslot->SetNumberOfSamples(numberofsamples);
}
}
/* or from file? */
else
{
m_buffers[buffer] = FSOUND_Sample_Load(buffer, samplename.Ptr(), FSOUND_LOOP_NORMAL, NULL);
}
#ifdef ONTKEVER
int error = FSOUND_GetError();
printf("sample load: errornumber is: %d\n", error);
#endif
/* if the loading succeeded, mark the waveslot */
if (m_buffers[buffer])
{
waveslot->SetLoaded(true);
}
/* or when it failed, free the waveslot */
else
{
m_wavecache->RemoveSample(waveslot->GetSampleName(), waveslot->GetBuffer());
waveslot = NULL;
}
}
}
}
return waveslot;
}
// listener's and general stuff //////////////////////////////////////////////////////
/* sets the global dopplervelocity */
void SND_FmodDevice::SetDopplerVelocity(MT_Scalar dopplervelocity) const
{
/* not supported by fmod */
FSOUND_3D_Listener_SetDopplerFactor(dopplervelocity);
}
/* sets the global dopplerfactor */
void SND_FmodDevice::SetDopplerFactor(MT_Scalar dopplerfactor) const
{
FSOUND_3D_Listener_SetDopplerFactor(dopplerfactor);
}
/* sets the global rolloff factor */
void SND_FmodDevice::SetListenerRollOffFactor(MT_Scalar rollofffactor) const
{
// not implemented in openal
}
void SND_FmodDevice::NextFrame() const
{
FSOUND_3D_Update();
}
// set the gain for the listener
void SND_FmodDevice::SetListenerGain(float gain) const
{
int fmod_gain = (int)(gain * 255);
FSOUND_SetSFXMasterVolume(fmod_gain);
}
void SND_FmodDevice::InitListener()
{
// initialize the listener with these values that won't change
// (as long as we can have only one listener)
// now we can superimpose all listeners on each other (for they
// have the same settings)
float lispos[3] = {0,0,0};
float lisvel[3] = {0,0,0};
FSOUND_3D_Listener_SetAttributes(lispos, lisvel, 0, -1, 0, 0, 0, 1);
}
// source playstate stuff ////////////////////////////////////////////////////////////
// check if the sound's still playing
int SND_FmodDevice::GetPlayState(int id)
{
int result = SND_STOPPED;
// klopt niet, fixen
signed char isplaying = FSOUND_IsPlaying(id);
if (isplaying)
{
result = SND_PLAYING;
}
/* hi reevan, just swap // of these 2 lines */
// return result;
return 0;
}
/* sets the buffer */
void SND_FmodDevice::SetObjectBuffer(int id, unsigned int buffer)
{
m_sources[id] = m_buffers[buffer];
}
// make the source play
void SND_FmodDevice::PlayObject(int id)
{
m_channels[id] = FSOUND_PlaySound(FSOUND_FREE, m_sources[id]);
m_frequencies[id] = FSOUND_GetFrequency(m_channels[id]);
// printf("fmod: play \n");
}
// make the source stop
void SND_FmodDevice::StopObject(int id) const
{
FSOUND_StopSound(m_channels[id]);
// printf("fmod: stop \n");
}
// stop all sources
void SND_FmodDevice::StopAllObjects()
{
FSOUND_StopSound(FSOUND_ALL);
}
// pause the source
void SND_FmodDevice::PauseObject(int id) const
{
FSOUND_StopSound(m_channels[id]);
}
// source properties stuff ////////////////////////////////////////////////////////////
// give openal the object's pitch
void SND_FmodDevice::SetObjectPitch(int id, MT_Scalar pitch) const
{
pitch = pitch * m_frequencies[id];
char result = FSOUND_SetFrequency(m_channels[id], (int)pitch);
}
// give openal the object's gain
void SND_FmodDevice::SetObjectGain(int id, MT_Scalar gain) const
{
int vol = (int)(gain * 255);
FSOUND_SetVolume(m_channels[id], vol);
}
// give openal the object's looping
void SND_FmodDevice::SetObjectLoop(int id, unsigned int loopmode) const
{
// printf("loopmode: %d\n", loopmode);
switch (loopmode)
{
case SND_LOOP_OFF:
{
#ifndef __APPLE__
char result = FSOUND_Sample_SetLoopMode(m_sources[id], FSOUND_LOOP_OFF);
#else
char result = FSOUND_SetLoopMode(m_sources[id], FSOUND_LOOP_OFF);
#endif
// char result = FSOUND_SetLoopMode(m_channels[id], FSOUND_LOOP_OFF);
break;
}
case SND_LOOP_NORMAL:
{
#ifndef __APPLE__
char result = FSOUND_Sample_SetLoopMode(m_sources[id], FSOUND_LOOP_NORMAL);
#else
char result = FSOUND_SetLoopMode(m_sources[id], FSOUND_LOOP_NORMAL);
#endif
// char result = FSOUND_SetLoopMode(m_channels[id], FSOUND_LOOP_NORMAL);
break;
}
case SND_LOOP_BIDIRECTIONAL:
{
#ifndef __APPLE__
char result = FSOUND_Sample_SetLoopMode(m_sources[id], FSOUND_LOOP_BIDI);
#else
char result = FSOUND_SetLoopMode(m_sources[id], FSOUND_LOOP_BIDI);
#endif
// char result = FSOUND_SetLoopMode(m_channels[id], FSOUND_LOOP_NORMAL);
break;
}
default:
break;
}
}
void SND_FmodDevice::SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const
{
FSOUND_Sample_SetLoopPoints(m_sources[id], loopstart, loopend);
}
void SND_FmodDevice::SetObjectMinGain(int id, MT_Scalar mingain) const
{
/* not supported by fmod */
}
void SND_FmodDevice::SetObjectMaxGain(int id, MT_Scalar maxgain) const
{
/* not supported by fmod */
}
void SND_FmodDevice::SetObjectRollOffFactor(int id, MT_Scalar rollofffactor) const
{
/* not supported by fmod */
}
void SND_FmodDevice::SetObjectReferenceDistance(int id, MT_Scalar referencedistance) const
{
/* not supported by fmod */
}
// give openal the object's position
void SND_FmodDevice::ObjectIs2D(int id) const
{
float obpos[3] = {0,0,0};
float obvel[3] = {0,0,0};
FSOUND_3D_SetAttributes(m_channels[id], obpos, obvel);
}
void SND_FmodDevice::SetObjectTransform(int id,
const MT_Vector3& position,
const MT_Vector3& velocity,
const MT_Matrix3x3& orientation,
const MT_Vector3& lisposition,
const MT_Scalar& rollofffactor) const
{
float obpos[3];
float obvel[3];
obpos[0] = (float)position[0] * (float)rollofffactor; //x (l/r)
obpos[1] = (float)position[1] * (float)rollofffactor;
obpos[2] = (float)position[2] * (float)rollofffactor;
velocity.getValue(obvel);
FSOUND_3D_SetAttributes(m_channels[id], obpos, obvel);
}
// cd support stuff ////////////////////////////////////////////////////////////
void SND_FmodDevice::PlayCD(int track) const
{
#ifndef __APPLE__
signed char result = FSOUND_CD_Play(track);
#else
signed char result = FSOUND_CD_Play(0, track);
#endif
#ifdef ONTKEVER
printf("SND_FmodDevice::PlayCD(): track=%d, result=%d\n", track, (int)result);
#endif
}
void SND_FmodDevice::PauseCD(bool pause) const
{
#ifndef __APPLE__
signed char result = FSOUND_CD_SetPaused(pause);
#else
signed char result = FSOUND_CD_SetPaused(0, pause);
#endif
#ifdef ONTKEVER
printf("SND_FmodDevice::PauseCD(): pause=%d, result=%d\n", pause, (int)result);
#endif
}
void SND_FmodDevice::StopCD() const
{
SND_CDObject* pCD = SND_CDObject::Instance();
if (pCD)
{
if (pCD->GetUsed())
{
#ifndef __APPLE__
signed char result = FSOUND_CD_Stop();
#else
signed char result = FSOUND_CD_Stop(0);
#endif
#ifdef ONTKEVER
printf("SND_FmodDevice::StopCD(): result=%d\n", (int)result);
#endif
}
}
}
void SND_FmodDevice::SetCDPlaymode(int playmode) const
{
#ifndef __APPLE__
FSOUND_CD_SetPlayMode(playmode);
#else
FSOUND_CD_SetPlayMode(0, playmode);
#endif
#ifdef ONTKEVER
printf("SND_FmodDevice::SetCDPlaymode(): playmode=%d,\n", playmode);
#endif
}
void SND_FmodDevice::SetCDGain(MT_Scalar gain) const
{
int volume = gain * 255;
#ifndef __APPLE__
signed char result = FSOUND_CD_SetVolume(volume);
#else
signed char result = FSOUND_CD_SetVolume(0, volume);
#endif
#ifdef ONTKEVER
printf("SND_FmodDevice::SetCDGain(): gain=%f, volume=%d, result=%d\n", gain, volume, (int)result);
#endif
}
void SND_FmodDevice::StartUsingDSP()
{
m_dspunit = FSOUND_DSP_GetFFTUnit();
FSOUND_DSP_SetActive(m_dspunit, true);
}
float* SND_FmodDevice::GetSpectrum()
{
m_spectrum = FSOUND_DSP_GetSpectrum();
return m_spectrum;
}
void SND_FmodDevice::StopUsingDSP()
{
if (m_dspunit)
FSOUND_DSP_SetActive(m_dspunit, false);
}

@ -1,103 +0,0 @@
/**
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef SND_FMODDEVICE
#define SND_FMODDEVICE
#include "fmod.h"
#include "SND_AudioDevice.h"
#include "SoundDefines.h"
class SND_FmodDevice : public SND_AudioDevice
{
public:
SND_FmodDevice();
~SND_FmodDevice();
SND_WaveSlot* LoadSample(const STR_String& samplename,
void* memlocation,
int size);
void InitListener();
void SetListenerGain(float gain) const;
void SetDopplerVelocity(MT_Scalar dopplervelocity) const;
void SetDopplerFactor(MT_Scalar dopplerfactor) const;
void SetListenerRollOffFactor(MT_Scalar rollofffactor) const;
void MakeCurrent() const;
void NextFrame() const;
void UseCD() const;
void SetObjectBuffer(int id, unsigned int buffer);
int GetPlayState(int id);
void PlayObject(int id);
void StopObject(int id) const;
void StopAllObjects();
void PauseObject(int id) const;
void SetObjectLoop(int id, unsigned int loopmode) const;
void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const;
void SetObjectPitch(int id, MT_Scalar pitch) const;
void SetObjectGain(int id, MT_Scalar gain) const;
void SetObjectMinGain(int id, MT_Scalar mingain) const;
void SetObjectMaxGain(int id, MT_Scalar maxgain) const;
void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const;
void SetObjectReferenceDistance(int id, MT_Scalar distance) const;
void SetObjectTransform(int id,
const MT_Vector3& position,
const MT_Vector3& velocity,
const MT_Matrix3x3& orientation,
const MT_Vector3& lisposition,
const MT_Scalar& rollofffactor) const;
void ObjectIs2D(int id) const;
void PlayCD(int track) const;
void PauseCD(bool pause) const;
void StopCD() const;
void SetCDPlaymode(int playmode) const;
void SetCDGain(MT_Scalar gain) const;
void StartUsingDSP();
float* GetSpectrum();
void StopUsingDSP();
private:
FSOUND_SAMPLE* m_buffers[NUM_BUFFERS];
FSOUND_SAMPLE* m_sources[NUM_SOURCES];
FSOUND_DSPUNIT* m_dspunit;
int m_frequencies[NUM_SOURCES];
int m_max_channels;
int m_num_hardware_channels;
int m_num_software_channels;
int m_channels[NUM_SOURCES];
float* m_spectrum;
};
#endif //SND_FMODDEVICE

@ -43,11 +43,9 @@
#ifdef APPLE_FRAMEWORK_FIX
#include <al.h>
#include <alc.h>
#include <alut.h>
#else
#include <AL/al.h>
#include <AL/alc.h>
#include <AL/alut.h>
#endif
#include <stdio.h>
@ -61,13 +59,12 @@
#include <signal.h>
/* untill openal gets unified we need this hack for non-windows systems */
#if !defined(WIN32) && !defined(ALC_MAJOR_VERSION)
/*************************** ALUT replacement *****************************/
#include <malloc.h>
/* instead of relying on alut, we just implement our own
* WAV loading functions, hopefully more reliable */
ALvoid alutLoadWAVMemory(ALbyte *memory,ALenum *format,ALvoid **data,ALsizei *size,ALsizei *freq,ALboolean *loop);
ALvoid alutUnloadWAV(ALenum format,ALvoid *data,ALsizei size,ALsizei freq);
#include <stdlib.h>
typedef struct /* WAV File-header */
{
@ -120,93 +117,189 @@ typedef struct /* WAV Chunk-header */
ALuint Size;
} WAVChunkHdr_Struct;
ALvoid alutLoadWAVMemory(ALbyte *memory,ALenum *format,ALvoid **data,ALsizei *size,ALsizei *freq,ALboolean *loop)
static void *SND_loadFileIntoMemory(const char *filename, int *len_r)
{
FILE *fp= fopen(filename, "rb");
void *data;
if (!fp) {
*len_r= -1;
return NULL;
}
fseek(fp, 0L, SEEK_END);
*len_r= ftell(fp);
fseek(fp, 0L, SEEK_SET);
data= malloc(*len_r);
if (!data) {
*len_r= -1;
return NULL;
}
if (fread(data, *len_r, 1, fp)!=1) {
*len_r= -1;
free(data);
return NULL;
}
return data;
}
#define TEST_SWITCH_INT(a) if(big_endian) { \
char s_i, *p_i; \
p_i= (char *)&(a); \
s_i=p_i[0]; p_i[0]=p_i[3]; p_i[3]=s_i; \
s_i=p_i[1]; p_i[1]=p_i[2]; p_i[2]=s_i; }
#define TEST_SWITCH_SHORT(a) if(big_endian) { \
char s_i, *p_i; \
p_i= (char *)&(a); \
s_i=p_i[0]; p_i[0]=p_i[1]; p_i[1]=s_i; }
static int stream_read(void *out, ALbyte **stream, ALsizei size, ALsizei *memsize)
{
if(size <= *memsize) {
memcpy(out, *stream, size);
return 1;
}
else {
memset(out, 0, size);
return 0;
}
}
static int stream_skip(ALbyte **stream, ALsizei size, ALsizei *memsize)
{
if(size <= *memsize) {
*stream += size;
*memsize -= size;
return 1;
}
else
return 0;
}
ALvoid SND_alutLoadWAVMemory(ALbyte *memory,ALsizei memsize,ALenum *format,ALvoid **data,ALsizei *size,ALsizei *freq,ALboolean *loop)
{
WAVChunkHdr_Struct ChunkHdr;
WAVFmtExHdr_Struct FmtExHdr;
WAVFileHdr_Struct FileHdr;
WAVSmplHdr_Struct SmplHdr;
WAVFmtHdr_Struct FmtHdr;
ALbyte *Stream;
ALbyte *Stream= memory;
int test_endian= 1;
int big_endian= !((char*)&test_endian)[0];
*format=AL_FORMAT_MONO16;
*data=NULL;
*size=0;
*freq=22050;
*loop=AL_FALSE;
if (memory)
if(!Stream)
return;
stream_read(&FileHdr,&Stream,sizeof(WAVFileHdr_Struct),&memsize);
stream_skip(&Stream,sizeof(WAVFileHdr_Struct),&memsize);
TEST_SWITCH_INT(FileHdr.Size);
FileHdr.Size=((FileHdr.Size+1)&~1)-4;
while((FileHdr.Size!=0) && stream_read(&ChunkHdr,&Stream,sizeof(WAVChunkHdr_Struct),&memsize))
{
Stream=memory;
if (Stream)
TEST_SWITCH_INT(ChunkHdr.Size);
stream_skip(&Stream,sizeof(WAVChunkHdr_Struct),&memsize);
if (!memcmp(ChunkHdr.Id,"fmt ",4))
{
memcpy(&FileHdr,Stream,sizeof(WAVFileHdr_Struct));
Stream+=sizeof(WAVFileHdr_Struct);
FileHdr.Size=((FileHdr.Size+1)&~1)-4;
while ((FileHdr.Size!=0)&&(memcpy(&ChunkHdr,Stream,sizeof(WAVChunkHdr_Struct))))
stream_read(&FmtHdr,&Stream,sizeof(WAVFmtHdr_Struct),&memsize);
TEST_SWITCH_SHORT(FmtHdr.Format);
TEST_SWITCH_SHORT(FmtHdr.Channels);
TEST_SWITCH_INT(FmtHdr.SamplesPerSec);
TEST_SWITCH_INT(FmtHdr.BytesPerSec);
TEST_SWITCH_SHORT(FmtHdr.BlockAlign);
TEST_SWITCH_SHORT(FmtHdr.BitsPerSample);
if (FmtHdr.Format==0x0001)
{
Stream+=sizeof(WAVChunkHdr_Struct);
if (!memcmp(ChunkHdr.Id,"fmt ",4))
{
memcpy(&FmtHdr,Stream,sizeof(WAVFmtHdr_Struct));
if (FmtHdr.Format==0x0001)
{
*format=(FmtHdr.Channels==1?
(FmtHdr.BitsPerSample==8?AL_FORMAT_MONO8:AL_FORMAT_MONO16):
(FmtHdr.BitsPerSample==8?AL_FORMAT_STEREO8:AL_FORMAT_STEREO16));
*freq=FmtHdr.SamplesPerSec;
Stream+=ChunkHdr.Size;
}
else
{
memcpy(&FmtExHdr,Stream,sizeof(WAVFmtExHdr_Struct));
Stream+=ChunkHdr.Size;
}
}
else if (!memcmp(ChunkHdr.Id,"data",4))
{
if (FmtHdr.Format==0x0001)
{
*size=ChunkHdr.Size;
*data=malloc(ChunkHdr.Size+31);
if (*data) memcpy(*data,Stream,ChunkHdr.Size);
memset(((char *)*data)+ChunkHdr.Size,0,31);
Stream+=ChunkHdr.Size;
}
else if (FmtHdr.Format==0x0011)
{
//IMA ADPCM
}
else if (FmtHdr.Format==0x0055)
{
//MP3 WAVE
}
}
else if (!memcmp(ChunkHdr.Id,"smpl",4))
{
memcpy(&SmplHdr,Stream,sizeof(WAVSmplHdr_Struct));
*loop = (SmplHdr.Loops ? AL_TRUE : AL_FALSE);
Stream+=ChunkHdr.Size;
}
else Stream+=ChunkHdr.Size;
Stream+=ChunkHdr.Size&1;
FileHdr.Size-=(((ChunkHdr.Size+1)&~1)+8);
*format=(FmtHdr.Channels==1?
(FmtHdr.BitsPerSample==8?AL_FORMAT_MONO8:AL_FORMAT_MONO16):
(FmtHdr.BitsPerSample==8?AL_FORMAT_STEREO8:AL_FORMAT_STEREO16));
*freq=FmtHdr.SamplesPerSec;
}
else
{
stream_read(&FmtExHdr,&Stream,sizeof(WAVFmtExHdr_Struct),&memsize);
TEST_SWITCH_SHORT(FmtExHdr.Size);
TEST_SWITCH_SHORT(FmtExHdr.SamplesPerBlock);
}
}
else if (!memcmp(ChunkHdr.Id,"data",4))
{
if (FmtHdr.Format==0x0001)
{
if((ALsizei)ChunkHdr.Size <= memsize)
{
*size=ChunkHdr.Size;
*data=malloc(ChunkHdr.Size+31);
if (*data) {
stream_read(*data,&Stream,ChunkHdr.Size,&memsize);
memset(((char *)*data)+ChunkHdr.Size,0,31);
if(FmtHdr.BitsPerSample == 16 && big_endian) {
int a, len= *size/2;
short *samples= (short*)*data;
for(a=0; a<len; a++) {
TEST_SWITCH_SHORT(samples[a])
}
}
}
}
}
else if (FmtHdr.Format==0x0011)
{
//IMA ADPCM
}
else if (FmtHdr.Format==0x0055)
{
//MP3 WAVE
}
}
else if (!memcmp(ChunkHdr.Id,"smpl",4))
{
stream_read(&SmplHdr,&Stream,sizeof(WAVSmplHdr_Struct),&memsize);
TEST_SWITCH_INT(SmplHdr.Manufacturer);
TEST_SWITCH_INT(SmplHdr.Product);
TEST_SWITCH_INT(SmplHdr.SamplePeriod);
TEST_SWITCH_INT(SmplHdr.Note);
TEST_SWITCH_INT(SmplHdr.FineTune);
TEST_SWITCH_INT(SmplHdr.SMPTEFormat);
TEST_SWITCH_INT(SmplHdr.SMPTEOffest);
TEST_SWITCH_INT(SmplHdr.Loops);
TEST_SWITCH_INT(SmplHdr.SamplerData);
*loop = (SmplHdr.Loops ? AL_TRUE : AL_FALSE);
}
if(!stream_skip(&Stream, ChunkHdr.Size + (ChunkHdr.Size&1), &memsize))
break;
FileHdr.Size-=(((ChunkHdr.Size+1)&~1)+8);
}
}
ALvoid alutUnloadWAV(ALenum format,ALvoid *data,ALsizei size,ALsizei freq)
ALvoid SND_alutUnloadWAV(ALenum format,ALvoid *data,ALsizei size,ALsizei freq)
{
if (data)
free(data);
}
#endif /* WIN32 */
#ifdef __APPLE__
#define OUDE_OPENAL 1
#endif
/************************ Device Implementation ****************************/
SND_OpenALDevice::SND_OpenALDevice()
: SND_AudioDevice(),
@ -223,10 +316,6 @@ SND_OpenALDevice::SND_OpenALDevice()
// let's check if we can get openal to initialize...
if (m_audio)
{
#ifdef OUDE_OPENAL
m_audio = true; // openal_2.12
alutInit(NULL, NULL); // openal_2.12
#else
m_audio = false;
ALCdevice *dev = alcOpenDevice(NULL);
@ -236,7 +325,6 @@ SND_OpenALDevice::SND_OpenALDevice()
if (m_context) {
#ifdef AL_VERSION_1_1
alcMakeContextCurrent((ALCcontext*)m_context);
alutInitWithoutContext(NULL, NULL); /* in this case we dont want alut to initialize the context, see above */
#else
alcMakeContextCurrent(m_context);
#endif
@ -259,7 +347,6 @@ SND_OpenALDevice::SND_OpenALDevice()
}
}
#endif
}
// then try to generate some buffers
@ -283,7 +370,7 @@ SND_OpenALDevice::SND_OpenALDevice()
// next: the sources
if (m_audio)
{
#ifdef OUDE_OPENAL
#ifdef __APPLE__
ALenum alc_error = ALC_NO_ERROR; // openal_2.12
#elif defined(_WIN32)
// alcGetError has no arguments on windows
@ -375,20 +462,11 @@ SND_OpenALDevice::~SND_OpenALDevice()
if (m_cdrom)
delete m_cdrom;
#endif
#ifdef OUDE_OPENAL
if (m_audio)
alutExit();
#else
if (m_device)
alcCloseDevice((ALCdevice*) m_device);
#ifdef AL_VERSION_1_1
alutExit();
#endif
#endif
}
SND_WaveSlot* SND_OpenALDevice::LoadSample(const STR_String& name,
void* memlocation,
int size)
@ -406,23 +484,22 @@ SND_WaveSlot* SND_OpenALDevice::LoadSample(const STR_String& name,
{
if (waveslot)
{
bool freemem = false;
int buffer = waveslot->GetBuffer();
void* data = NULL;
#ifndef __APPLE__
char loop = 'a';
#endif
int sampleformat, bitrate, numberofchannels;
ALenum al_error = alGetError();
#ifdef OUDE_OPENAL
ALsizei samplerate, numberofsamples; // openal_2.12
#else
int samplerate, numberofsamples; // openal_2.14+
#endif
ALsizei samplerate, numberofsamples; // openal_2.14+
/* Give them some safe defaults just incase */
bitrate = numberofchannels = 0;
if (!(size && memlocation)) {
memlocation = SND_loadFileIntoMemory(samplename.Ptr(), &size);
freemem = true;
}
/* load the sample from memory? */
if (size && memlocation)
{
@ -437,33 +514,14 @@ SND_WaveSlot* SND_OpenALDevice::LoadSample(const STR_String& name,
bitrate = SND_GetBitRate(memlocation);
/* load the sample into openal */
#if defined(OUDE_OPENAL) || defined (__APPLE__)
alutLoadWAVMemory((char*)memlocation, &sampleformat, &data, &numberofsamples, &samplerate); // openal_2.12
#else
#ifdef AL_VERSION_1_1
float frequency = 0.0f;
data = alutLoadMemoryFromFileImage(memlocation, size, &sampleformat, &numberofsamples, &frequency);
samplerate = (int)frequency;
#else
alutLoadWAVMemory((signed char*)memlocation, &sampleformat, &data, &numberofsamples, &samplerate, &loop);// openal_2.14+
#endif
#endif
/* put it in the buffer */
alBufferData(m_buffers[buffer], sampleformat, data, numberofsamples, samplerate);
}
/* or from file? */
else
{
#ifdef __APPLE__
alutLoadWAVFile((ALbyte *)samplename.Ptr(), &sampleformat, &data, &numberofsamples, &samplerate);
#else
alutLoadWAVFile((ALbyte *)samplename.Ptr(), &sampleformat, &data, &numberofsamples, &samplerate, &loop);
#endif
SND_alutLoadWAVMemory((ALbyte*)memlocation, size, &sampleformat, &data, &numberofsamples, &samplerate, &loop);
/* put it in the buffer */
alBufferData(m_buffers[buffer], sampleformat, data, numberofsamples, samplerate);
}
if(freemem)
free(memlocation);
/* fill the waveslot with info */
al_error = alGetError();
if (al_error == AL_NO_ERROR && m_buffers[buffer])
@ -486,11 +544,7 @@ SND_WaveSlot* SND_OpenALDevice::LoadSample(const STR_String& name,
}
/* and free the original stuff (copy was made in openal) */
#if defined(OUDE_OPENAL) || defined (__APPLE__) || !defined(AL_VERSION_1_1)
alutUnloadWAV(sampleformat, data, numberofsamples, samplerate);
#else
free(data);
#endif
SND_alutUnloadWAV(sampleformat, data, numberofsamples, samplerate);
}
}
else
@ -594,7 +648,7 @@ int SND_OpenALDevice::GetPlayState(int id)
#ifdef __APPLE__
alGetSourcei(m_sources[id], AL_SOURCE_STATE, &alstate);
#else
alGetSourceiv(m_sources[id], AL_SOURCE_STATE, &alstate);
alGetSourceiv(m_sources[id], AL_SOURCE_STATE, &alstate);
#endif
switch(alstate)

@ -43,6 +43,8 @@
#ifndef DISABLE_SDL
#include <SDL.h>
#else
#include <stdio.h>
#endif
SND_SDLCDDevice::SND_SDLCDDevice() :

@ -34,7 +34,6 @@
* @date May 7, 2001
*/
#include <Carbon/Carbon.h>
#include <ApplicationServices/ApplicationServices.h>
#include "GHOST_SystemCarbon.h"
@ -430,6 +429,29 @@ GHOST_IWindow* GHOST_SystemCarbon::createWindow(
return window;
}
GHOST_TSuccess GHOST_SystemCarbon::beginFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window, const bool stereoVisual)
{
GHOST_TSuccess success = GHOST_kFailure;
// need yo make this Carbon all on 10.5 for fullscreen to work correctly
CGCaptureAllDisplays();
success = GHOST_System::beginFullScreen( setting, window, stereoVisual);
if( success != GHOST_kSuccess ) {
// fullscreen failed for other reasons, release
CGReleaseAllDisplays();
}
return success;
}
GHOST_TSuccess GHOST_SystemCarbon::endFullScreen(void)
{
CGReleaseAllDisplays();
return GHOST_System::endFullScreen();
}
/* this is an old style low level event queue.
As we want to handle our own timers, this is ok.
the full screen hack should be removed */

@ -118,6 +118,14 @@ public:
const GHOST_TEmbedderWindowID parentWindow = 0
);
virtual GHOST_TSuccess beginFullScreen(
const GHOST_DisplaySetting& setting,
GHOST_IWindow** window,
const bool stereoVisual
);
virtual GHOST_TSuccess endFullScreen( void );
/***************************************************************************************
** Event management functionality
***************************************************************************************/

@ -117,16 +117,18 @@ GHOST_WindowWin32::GHOST_WindowWin32(
m_maxPressure(0)
{
if (state != GHOST_kWindowStateFullScreen) {
/* Convert client size into window size */
width += GetSystemMetrics(SM_CXSIZEFRAME)*2;
height += GetSystemMetrics(SM_CYSIZEFRAME)*2 + GetSystemMetrics(SM_CYCAPTION);
// take taskbar into account
RECT rect;
SystemParametersInfo(SPI_GETWORKAREA,0,&rect,0);
height = rect.bottom - rect.top;
width = rect.right - rect.left;
m_hWnd = ::CreateWindow(
s_windowClassName, // pointer to registered class name
title, // pointer to window name
WS_OVERLAPPEDWINDOW, // window style
left, // horizontal position of window
top, // vertical position of window
rect.left, // horizontal position of window
rect.top, // vertical position of window
width, // window width
height, // window height
0, // handle to parent or owner window
@ -239,7 +241,7 @@ GHOST_WindowWin32::~GHOST_WindowWin32()
if (m_wintab) {
GHOST_WIN32_WTClose fpWTClose = ( GHOST_WIN32_WTClose ) ::GetProcAddress( m_wintab, "WTClose" );
if (fpWTClose) {
if (m_tablet)
if (m_tablet)
fpWTClose(m_tablet);
if (m_tabletData)
delete m_tabletData;
@ -297,15 +299,17 @@ void GHOST_WindowWin32::getWindowBounds(GHOST_Rect& bounds) const
void GHOST_WindowWin32::getClientBounds(GHOST_Rect& bounds) const
{
RECT rect;
::GetWindowRect(m_hWnd, &rect);
LONG_PTR result = ::GetWindowLongPtr(m_hWnd, GWL_STYLE);
::GetWindowRect(m_hWnd, &rect);
if((result & (WS_POPUP | WS_MAXIMIZE)) != (WS_POPUP | WS_MAXIMIZE)) {
bounds.m_b = rect.bottom-GetSystemMetrics(SM_CYCAPTION)-GetSystemMetrics(SM_CYSIZEFRAME)*2;
bounds.m_l = rect.left;
bounds.m_r = rect.right-GetSystemMetrics(SM_CYSIZEFRAME)*2;
bounds.m_t = rect.top;
} else {
::GetWindowRect(m_hWnd, &rect);
bounds.m_b = rect.bottom;
bounds.m_l = rect.left;
bounds.m_r = rect.right;
@ -415,12 +419,12 @@ GHOST_TSuccess GHOST_WindowWin32::setState(GHOST_TWindowState state)
wp.length = sizeof(WINDOWPLACEMENT);
::GetWindowPlacement(m_hWnd, &wp);
switch (state) {
case GHOST_kWindowStateMinimized:
wp.showCmd = SW_SHOWMINIMIZED;
case GHOST_kWindowStateMinimized:
wp.showCmd = SW_SHOWMINIMIZED;
break;
case GHOST_kWindowStateMaximized:
case GHOST_kWindowStateMaximized:
ShowWindow(m_hWnd, SW_HIDE);
wp.showCmd = SW_SHOWMAXIMIZED;
wp.showCmd = SW_SHOWMAXIMIZED;
SetWindowLongPtr(m_hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW);
break;
case GHOST_kWindowStateFullScreen:
@ -429,10 +433,10 @@ GHOST_TSuccess GHOST_WindowWin32::setState(GHOST_TWindowState state)
wp.ptMaxPosition.y = 0;
SetWindowLongPtr(m_hWnd, GWL_STYLE, WS_POPUP | WS_MAXIMIZE);
break;
case GHOST_kWindowStateNormal:
default:
case GHOST_kWindowStateNormal:
default:
ShowWindow(m_hWnd, SW_HIDE);
wp.showCmd = SW_SHOWNORMAL;
wp.showCmd = SW_SHOWNORMAL;
SetWindowLongPtr(m_hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW);
break;
}
@ -490,7 +494,7 @@ GHOST_TSuccess GHOST_WindowWin32::installDrawingContext(GHOST_TDrawingContextTyp
switch (type) {
case GHOST_kDrawingContextTypeOpenGL:
{
if(m_stereoVisual)
if(m_stereoVisual)
sPreferredFormat.dwFlags |= PFD_STEREO;
// Attempt to match device context pixel format to the preferred format
@ -627,7 +631,7 @@ void GHOST_WindowWin32::loadCursor(bool visible, GHOST_TStandardCursor cursor) c
default:
success = false;
}
if (success) {
::SetCursor(::LoadCursor(0, id));
}
@ -660,7 +664,7 @@ void GHOST_WindowWin32::processWin32TabletInitEvent()
{
if (m_wintab) {
GHOST_WIN32_WTInfo fpWTInfo = ( GHOST_WIN32_WTInfo ) ::GetProcAddress( m_wintab, "WTInfoA" );
// let's see if we can initialize tablet here
/* check if WinTab available. */
if (fpWTInfo) {
@ -671,7 +675,7 @@ void GHOST_WindowWin32::processWin32TabletInitEvent()
m_maxPressure = Pressure.axMax;
else
m_maxPressure = 0;
BOOL tiltSupport = fpWTInfo (WTI_DEVICES, DVC_ORIENTATION, &Orientation);
if (tiltSupport) {
/* does the tablet support azimuth ([0]) and altitude ([1]) */
@ -737,7 +741,7 @@ void GHOST_WindowWin32::processWin32TabletEvent(WPARAM wParam, LPARAM lParam)
WACOM uses negative altitude values to show that the pen is inverted;
therefore we cast .orAltitude as an (int) and then use the absolute value.
*/
/* convert raw fixed point data to radians */
altRad = (float)((fabs((float)ort.orAltitude)/(float)m_maxAltitude) * M_PI/2.0);
azmRad = (float)(((float)ort.orAzimuth/(float)m_maxAzimuth) * M_PI*2.0);
@ -777,25 +781,25 @@ static GHOST_TUns16 uns16ReverseBits(GHOST_TUns16 shrt)
shrt= ((shrt>>8)&0x00FF) | ((shrt<<8)&0xFF00);
return shrt;
}
GHOST_TSuccess GHOST_WindowWin32::setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2],
GHOST_TSuccess GHOST_WindowWin32::setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2],
GHOST_TUns8 mask[16][2], int hotX, int hotY)
{
return setWindowCustomCursorShape((GHOST_TUns8*)bitmap, (GHOST_TUns8*)mask,
return setWindowCustomCursorShape((GHOST_TUns8*)bitmap, (GHOST_TUns8*)mask,
16, 16, hotX, hotY, 0, 1);
}
GHOST_TSuccess GHOST_WindowWin32::setWindowCustomCursorShape(GHOST_TUns8 *bitmap,
GHOST_TUns8 *mask, int sizeX, int sizeY, int hotX, int hotY,
GHOST_TSuccess GHOST_WindowWin32::setWindowCustomCursorShape(GHOST_TUns8 *bitmap,
GHOST_TUns8 *mask, int sizeX, int sizeY, int hotX, int hotY,
int fg_color, int bg_color)
{
GHOST_TUns32 andData[32];
GHOST_TUns32 xorData[32];
GHOST_TUns32 fullBitRow, fullMaskRow;
int x, y, cols;
cols=sizeX/8; /* Num of whole bytes per row (width of bm/mask) */
if (sizeX%8) cols++;
if (m_customCursor) {
DestroyCursor(m_customCursor);
m_customCursor = NULL;
@ -835,9 +839,9 @@ GHOST_TSuccess GHOST_WindowWin32::setWindowCustomCursorShape(GHOST_TUns8 *bitmap
static int WeightPixelFormat(PIXELFORMATDESCRIPTOR& pfd) {
int weight = 0;
/* assume desktop color depth is 32 bits per pixel */
/* cull unusable pixel formats */
/* if no formats can be found, can we determine why it was rejected? */
if( !(pfd.dwFlags & PFD_SUPPORT_OPENGL) ||
@ -846,45 +850,45 @@ static int WeightPixelFormat(PIXELFORMATDESCRIPTOR& pfd) {
( pfd.cDepthBits <= 8 ) ||
!(pfd.iPixelType == PFD_TYPE_RGBA) )
return 0;
weight = 1; /* it's usable */
/* the bigger the depth buffer the better */
/* give no weight to a 16-bit depth buffer, because those are crap */
weight += pfd.cDepthBits - 16;
weight += pfd.cColorBits - 8;
/* want swap copy capability -- it matters a lot */
if(pfd.dwFlags & PFD_SWAP_COPY) weight += 16;
/* but if it's a generic (not accelerated) view, it's really bad */
if(pfd.dwFlags & PFD_GENERIC_FORMAT) weight /= 10;
return weight;
}
/* A modification of Ron Fosner's replacement for ChoosePixelFormat */
/* A modification of Ron Fosner's replacement for ChoosePixelFormat */
/* returns 0 on error, else returns the pixel format number to be used */
static int EnumPixelFormats(HDC hdc) {
int iPixelFormat;
int i, n, w, weight = 0;
PIXELFORMATDESCRIPTOR pfd;
/* we need a device context to do anything */
if(!hdc) return 0;
iPixelFormat = 1; /* careful! PFD numbers are 1 based, not zero based */
/* obtain detailed information about
/* obtain detailed information about
the device context's first pixel format */
n = 1+::DescribePixelFormat(hdc, iPixelFormat,
n = 1+::DescribePixelFormat(hdc, iPixelFormat,
sizeof(PIXELFORMATDESCRIPTOR), &pfd);
/* choose a pixel format using the useless Windows function in case
we come up empty handed */
iPixelFormat = ::ChoosePixelFormat( hdc, &sPreferredFormat );
if(!iPixelFormat) return 0; /* couldn't find one to use */
for(i=1; i<=n; i++) { /* not the idiom, but it's right */
@ -899,7 +903,7 @@ static int EnumPixelFormats(HDC hdc) {
}
}
if (weight == 0) {
// we could find the correct stereo setting, just find any suitable format
// we could find the correct stereo setting, just find any suitable format
for(i=1; i<=n; i++) { /* not the idiom, but it's right */
::DescribePixelFormat( hdc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd );
w = WeightPixelFormat(pfd);

@ -162,6 +162,7 @@ intptr_t munmap(void *ptr, intptr_t size)
CloseHandle( mm->maphandle );
CloseHandle( mm->fhandle);
mmap_remlink(mmapbase, mm);
free(mm);
return 0;
}

@ -3,6 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 10.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj", "{F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}"
ProjectSection(ProjectDependencies) = postProject
{E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F} = {E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}
{6E24BF09-9653-4166-A871-F65CC9E98A9B} = {6E24BF09-9653-4166-A871-F65CC9E98A9B}
{A90C4918-4B21-4277-93BD-AF65F30951D9} = {A90C4918-4B21-4277-93BD-AF65F30951D9}
{FB88301F-F725-401B-ACD7-D2ABBF333B71} = {FB88301F-F725-401B-ACD7-D2ABBF333B71}
{98330220-47A6-42E0-9DE4-AD0FF5D204D6} = {98330220-47A6-42E0-9DE4-AD0FF5D204D6}
@ -11,6 +12,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj",
{9625642D-6F20-4FB6-A089-BE7441B223E3} = {9625642D-6F20-4FB6-A089-BE7441B223E3}
{D1A9312F-4557-4982-A0F4-4D08508235F4} = {D1A9312F-4557-4982-A0F4-4D08508235F4}
{884D8731-654C-4C7F-9A75-8F37A305BE1E} = {884D8731-654C-4C7F-9A75-8F37A305BE1E}
{E645CC32-4823-463E-82F0-46ADDE664018} = {E645CC32-4823-463E-82F0-46ADDE664018}
{7495FE37-933A-4AC1-BB2A-B3FDB4DE4284} = {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}
{FAF46346-65CC-4DB2-85C4-B99826F79D0C} = {FAF46346-65CC-4DB2-85C4-B99826F79D0C}
{51FB3D48-2467-4BFA-A321-D848252B437E} = {51FB3D48-2467-4BFA-A321-D848252B437E}
@ -20,6 +22,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj",
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E} = {B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}
{DB6BE55D-B6D9-494D-856A-8764FF7BA91D} = {DB6BE55D-B6D9-494D-856A-8764FF7BA91D}
{6461F05D-4698-47AB-A8E8-1CA2ACC9948B} = {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E} = {0A73055E-4DED-40CD-9F72-9093ED3EEC7E}
{09222F5E-1625-4FF3-A89A-384D16875EE5} = {09222F5E-1625-4FF3-A89A-384D16875EE5}
{D696C86B-0B53-4471-A50D-5B983A6FA4AD} = {D696C86B-0B53-4471-A50D-5B983A6FA4AD}
{138DD16C-CC78-4F6C-A898-C8DA68D89067} = {138DD16C-CC78-4F6C-A898-C8DA68D89067}
@ -27,10 +30,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj",
{106AE171-0083-41D6-A949-20DB0E8DC251} = {106AE171-0083-41D6-A949-20DB0E8DC251}
{670EC17A-0548-4BBF-A27B-636C7C188139} = {670EC17A-0548-4BBF-A27B-636C7C188139}
{4C3AB78A-52CA-4276-A041-39776E52D8C8} = {4C3AB78A-52CA-4276-A041-39776E52D8C8}
{6B801390-5F95-4F07-81A7-97FBA046AACC} = {6B801390-5F95-4F07-81A7-97FBA046AACC}
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94} = {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}
{76D90B92-ECC7-409C-9F98-A8814B90F3C0} = {76D90B92-ECC7-409C-9F98-A8814B90F3C0}
{9C71A793-C177-4CAB-8EC5-923D500B39F8} = {9C71A793-C177-4CAB-8EC5-923D500B39F8}
{F90BD995-FFA4-4B18-81E8-FA4322C939E8} = {F90BD995-FFA4-4B18-81E8-FA4322C939E8}
{BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23} = {BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}
{8154A59A-CAED-403D-AB94-BC4E7C032666} = {8154A59A-CAED-403D-AB94-BC4E7C032666}
{3648FB9A-C36F-43AB-AED0-1F1361E67FC7} = {3648FB9A-C36F-43AB-AED0-1F1361E67FC7}
{542A9FA1-B7FF-441C-AE15-054DB31D3488} = {542A9FA1-B7FF-441C-AE15-054DB31D3488}
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B} = {E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}
@ -39,7 +45,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj",
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A} = {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}
{E90C7BC2-CF30-4A60-A8F2-0050D592E358} = {E90C7BC2-CF30-4A60-A8F2-0050D592E358}
{8B8D4FC3-3234-4E54-8376-5AB83D00D164} = {8B8D4FC3-3234-4E54-8376-5AB83D00D164}
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879} = {9991A3C3-83FE-4AFE-9E18-9D01CB57E879}
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74} = {4B6AFCC5-968C-424A-8F20-76E41B3BEF74}
{0112CAD5-3584-412A-A2E5-1315A00437B4} = {0112CAD5-3584-412A-A2E5-1315A00437B4}
{EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9} = {EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}
@ -133,7 +138,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blenderplayer", "..\gameeng
{BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE} = {BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8} = {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}
{9625642D-6F20-4FB6-A089-BE7441B223E3} = {9625642D-6F20-4FB6-A089-BE7441B223E3}
{D1A9312F-4557-4982-A0F4-4D08508235F4} = {D1A9312F-4557-4982-A0F4-4D08508235F4}
{E645CC32-4823-463E-82F0-46ADDE664018} = {E645CC32-4823-463E-82F0-46ADDE664018}
{7495FE37-933A-4AC1-BB2A-B3FDB4DE4284} = {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}
{FAF46346-65CC-4DB2-85C4-B99826F79D0C} = {FAF46346-65CC-4DB2-85C4-B99826F79D0C}
{51FB3D48-2467-4BFA-A321-D848252B437E} = {51FB3D48-2467-4BFA-A321-D848252B437E}
{FFD3C64A-30E2-4BC7-BC8F-51818C320400} = {FFD3C64A-30E2-4BC7-BC8F-51818C320400}
@ -154,6 +161,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blenderplayer", "..\gameeng
{9C71A793-C177-4CAB-8EC5-923D500B39F8} = {9C71A793-C177-4CAB-8EC5-923D500B39F8}
{F90BD995-FFA4-4B18-81E8-FA4322C939E8} = {F90BD995-FFA4-4B18-81E8-FA4322C939E8}
{BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23} = {BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}
{8154A59A-CAED-403D-AB94-BC4E7C032666} = {8154A59A-CAED-403D-AB94-BC4E7C032666}
{3648FB9A-C36F-43AB-AED0-1F1361E67FC7} = {3648FB9A-C36F-43AB-AED0-1F1361E67FC7}
{542A9FA1-B7FF-441C-AE15-054DB31D3488} = {542A9FA1-B7FF-441C-AE15-054DB31D3488}
{D8ABD6A5-1B36-4D62-934E-B5C6801130B0} = {D8ABD6A5-1B36-4D62-934E-B5C6801130B0}
@ -165,6 +173,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blenderplayer", "..\gameeng
{8B8D4FC3-3234-4E54-8376-5AB83D00D164} = {8B8D4FC3-3234-4E54-8376-5AB83D00D164}
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74} = {4B6AFCC5-968C-424A-8F20-76E41B3BEF74}
{0112CAD5-3584-412A-A2E5-1315A00437B4} = {0112CAD5-3584-412A-A2E5-1315A00437B4}
{2AE0D2D9-6A7A-44DE-9EFF-99C9E3257B49} = {2AE0D2D9-6A7A-44DE-9EFF-99C9E3257B49}
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA} = {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}
{E86B7BDE-C33C-4E55-9433-E74C141D7538} = {E86B7BDE-C33C-4E55-9433-E74C141D7538}
{32CC75E2-EE85-45E6-8E3D-513F58464F43} = {32CC75E2-EE85-45E6-8E3D-513F58464F43}
@ -210,8 +219,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gen_messaging", "..\kernel\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PHY_Sumo", "..\gameengine\physics\PHY_Physics\PHY_Sumo\PHY_Sumo.vcproj", "{9625642D-6F20-4FB6-A089-BE7441B223E3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BRE_yafray", "yafray\BRE_yafray.vcproj", "{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PHY_Bullet", "..\gameengine\physics\PHY_Physics\PHY_Bullet\PHY_Bullet.vcproj", "{E90C7BC2-CF30-4A60-A8F2-0050D592E358}"
ProjectSection(ProjectDependencies) = postProject
{FFD3C64A-30E2-4BC7-BC8F-51818C320400} = {FFD3C64A-30E2-4BC7-BC8F-51818C320400}
@ -582,7 +589,9 @@ Global
{8154A59A-CAED-403D-AB94-BC4E7C032666}.3D Plugin Release|Win32.ActiveCfg = Blender Release|Win32
{8154A59A-CAED-403D-AB94-BC4E7C032666}.3D Plugin Release|Win32.Build.0 = Blender Release|Win32
{8154A59A-CAED-403D-AB94-BC4E7C032666}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{8154A59A-CAED-403D-AB94-BC4E7C032666}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{8154A59A-CAED-403D-AB94-BC4E7C032666}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{8154A59A-CAED-403D-AB94-BC4E7C032666}.Blender Release|Win32.Build.0 = Blender Release|Win32
{8154A59A-CAED-403D-AB94-BC4E7C032666}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{8154A59A-CAED-403D-AB94-BC4E7C032666}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{8154A59A-CAED-403D-AB94-BC4E7C032666}.Debug|Win32.ActiveCfg = Blender Debug|Win32
@ -594,7 +603,9 @@ Global
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.Blender Release|Win32.Build.0 = Blender Release|Win32
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.BlenderPlayer Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
@ -608,7 +619,9 @@ Global
{E645CC32-4823-463E-82F0-46ADDE664018}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{E645CC32-4823-463E-82F0-46ADDE664018}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{E645CC32-4823-463E-82F0-46ADDE664018}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{E645CC32-4823-463E-82F0-46ADDE664018}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{E645CC32-4823-463E-82F0-46ADDE664018}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{E645CC32-4823-463E-82F0-46ADDE664018}.Blender Release|Win32.Build.0 = Blender Release|Win32
{E645CC32-4823-463E-82F0-46ADDE664018}.BlenderPlayer Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
{E645CC32-4823-463E-82F0-46ADDE664018}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{E645CC32-4823-463E-82F0-46ADDE664018}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
@ -622,7 +635,9 @@ Global
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.Blender Release|Win32.Build.0 = Blender Release|Win32
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.BlenderPlayer Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
@ -636,7 +651,9 @@ Global
{6B801390-5F95-4F07-81A7-97FBA046AACC}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{6B801390-5F95-4F07-81A7-97FBA046AACC}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{6B801390-5F95-4F07-81A7-97FBA046AACC}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{6B801390-5F95-4F07-81A7-97FBA046AACC}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{6B801390-5F95-4F07-81A7-97FBA046AACC}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{6B801390-5F95-4F07-81A7-97FBA046AACC}.Blender Release|Win32.Build.0 = Blender Release|Win32
{6B801390-5F95-4F07-81A7-97FBA046AACC}.BlenderPlayer Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
{6B801390-5F95-4F07-81A7-97FBA046AACC}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{6B801390-5F95-4F07-81A7-97FBA046AACC}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
@ -650,7 +667,9 @@ Global
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.Blender Release|Win32.Build.0 = Blender Release|Win32
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.BlenderPlayer Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
@ -831,20 +850,6 @@ Global
{9625642D-6F20-4FB6-A089-BE7441B223E3}.Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{9625642D-6F20-4FB6-A089-BE7441B223E3}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{9625642D-6F20-4FB6-A089-BE7441B223E3}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.3D Plugin Debug|Win32.ActiveCfg = Blender Release|Win32
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.3D Plugin Debug|Win32.Build.0 = Blender Release|Win32
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.3D Plugin Release|Win32.ActiveCfg = Blender Release|Win32
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.3D Plugin Release|Win32.Build.0 = Blender Release|Win32
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.Blender Release|Win32.Build.0 = Blender Release|Win32
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.Debug|Win32.ActiveCfg = Blender Debug|Win32
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.Debug|Win32.Build.0 = Blender Debug|Win32
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.Release|Win32.ActiveCfg = Blender Release|Win32
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.Release|Win32.Build.0 = Blender Release|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
@ -853,8 +858,8 @@ Global
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.Blender Release|Win32.Build.0 = Blender Release|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.BlenderPlayer Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
@ -1335,8 +1340,8 @@ Global
{DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.Blender Release|Win32.Build.0 = Blender Release|Win32
{DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Release|Win32
{DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.BlenderPlayer Debug|Win32.Build.0 = Blender Release|Win32
{DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
{DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.Debug|Win32.ActiveCfg = Blender Debug|Win32

@ -119,7 +119,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\blenkey\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\source\blender;..\..\..\source\blender\img;..\..\..\source\blender\verify;..\..\..\source\blender\ftfont;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\editors\include;..\..\..\source\blender\renderui;..\..\..\source\blender\blenloader;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenfont;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\windowmanager;..\..\..\source\blender\blenpluginapi;..\..\..\source\blender\renderconverter;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\network;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;_CONSOLE;GAMEBLENDER;WITH_QUICKTIME;INTERNATIONAL;WITH_BF_INTERNATIONAL;WITH_FREETYPE2;WITH_OPENEXR;WITH_DDS;WITH_BULLET = 1;WITH_FFMPEG"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;_CONSOLE;GAMEBLENDER=1;WITH_QUICKTIME;INTERNATIONAL;WITH_BF_INTERNATIONAL;WITH_FREETYPE2;WITH_OPENEXR;WITH_DDS;WITH_BULLET = 1;WITH_FFMPEG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
DefaultCharIsUnsigned="true"
@ -309,6 +309,10 @@
RelativePath="..\..\..\source\blender\editors\include\ED_view3d.h"
>
</File>
<File
RelativePath="..\..\..\source\blender\editors\include\UI_icons.h"
>
</File>
<File
RelativePath="..\..\..\source\blender\editors\include\UI_interface.h"
>
@ -406,6 +410,10 @@
RelativePath="..\..\..\source\blender\editors\interface\interface_style.c"
>
</File>
<File
RelativePath="..\..\..\source\blender\editors\interface\interface_templates.c"
>
</File>
<File
RelativePath="..\..\..\source\blender\editors\interface\interface_utils.c"
>
@ -638,6 +646,10 @@
<Filter
Name="space_image"
>
<File
RelativePath="..\..\..\source\blender\editors\space_image\image_buttons.c"
>
</File>
<File
RelativePath="..\..\..\source\blender\editors\space_image\image_draw.c"
>
@ -654,10 +666,6 @@
RelativePath="..\..\..\source\blender\editors\space_image\image_ops.c"
>
</File>
<File
RelativePath="..\..\..\source\blender\editors\space_image\image_panels.c"
>
</File>
<File
RelativePath="..\..\..\source\blender\editors\space_image\image_render.c"
>
@ -710,6 +718,10 @@
<Filter
Name="space_buttons"
>
<File
RelativePath="..\..\..\source\blender\editors\space_buttons\buttons_context.c"
>
</File>
<File
RelativePath="..\..\..\source\blender\editors\space_buttons\buttons_header.c"
>
@ -718,6 +730,10 @@
RelativePath="..\..\..\source\blender\editors\space_buttons\buttons_intern.h"
>
</File>
<File
RelativePath="..\..\..\source\blender\editors\space_buttons\buttons_ops.c"
>
</File>
<File
RelativePath="..\..\..\source\blender\editors\space_buttons\space_buttons.c"
>
@ -866,6 +882,10 @@
RelativePath="..\..\..\source\blender\editors\space_sequencer\sequencer_add.c"
>
</File>
<File
RelativePath="..\..\..\source\blender\editors\space_sequencer\sequencer_buttons.c"
>
</File>
<File
RelativePath="..\..\..\source\blender\editors\space_sequencer\sequencer_draw.c"
>
@ -874,10 +894,6 @@
RelativePath="..\..\..\source\blender\editors\space_sequencer\sequencer_edit.c"
>
</File>
<File
RelativePath="..\..\..\source\blender\editors\space_sequencer\sequencer_header.c"
>
</File>
<File
RelativePath="..\..\..\source\blender\editors\space_sequencer\sequencer_intern.h"
>

@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"

@ -608,6 +608,10 @@
<Filter
Name="TEX_nodes"
>
<File
RelativePath="..\..\..\source\blender\nodes\intern\TEX_nodes\TEX_at.c"
>
</File>
<File
RelativePath="..\..\..\source\blender\nodes\intern\TEX_nodes\TEX_bricks.c"
>

@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\ketsji;..\..\..\source\gameengine\network;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Physics\Sumo;..\..\..\source\gameengine\Physics\common;..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\source\blender\gpu"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\ketsji;..\..\..\source\gameengine\network;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Physics\Sumo;..\..\..\source\gameengine\Physics\common;..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\blenfont"
PreprocessorDefinitions="WIN32;_LIB;_DEBUG;WITH_GLEXT;WITH_FFMPEG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -119,7 +119,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\ketsji;..\..\..\source\gameengine\network;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Physics\Sumo;..\..\..\source\gameengine\Physics\common;..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\source\blender\gpu"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\ketsji;..\..\..\source\gameengine\network;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Physics\Sumo;..\..\..\source\gameengine\Physics\common;..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\blenfont"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID;WITH_GLEXT;WITH_FFMPEG"
StringPooling="true"
BasicRuntimeChecks="0"

@ -42,7 +42,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager"
PreprocessorDefinitions="WIN32,_LIB,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -117,7 +117,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,USE_SUMO_SOLID"
StringPooling="true"
RuntimeLibrary="0"
@ -193,7 +193,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager"
PreprocessorDefinitions="WIN32,_LIB,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -268,7 +268,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,USE_SUMO_SOLID"
StringPooling="true"
RuntimeLibrary="2"
@ -344,7 +344,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager"
PreprocessorDefinitions="WIN32,_LIB,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -419,7 +419,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,USE_SUMO_SOLID"
StringPooling="true"
RuntimeLibrary="0"
@ -479,10 +479,6 @@
RelativePath="..\..\..\source\gameengine\Converter\BL_ActionActuator.cpp"
>
</File>
<File
RelativePath="..\..\..\source\gameengine\Converter\BL_ArmatureObject.cpp"
>
</File>
<File
RelativePath="..\..\..\source\gameengine\Converter\BL_BlenderDataConversion.cpp"
>
@ -495,6 +491,10 @@
RelativePath="..\..\..\source\gameengine\Converter\BL_MeshDeformer.cpp"
>
</File>
<File
RelativePath="..\..\..\source\gameengine\Converter\BL_ModifierDeformer.cpp"
>
</File>
<File
RelativePath="..\..\..\source\gameengine\Converter\BL_ShapeActionActuator.cpp"
>
@ -552,6 +552,10 @@
RelativePath="..\..\..\source\gameengine\Converter\BL_ActionActuator.h"
>
</File>
<File
RelativePath="..\..\..\source\gameengine\Converter\BL_ArmatureObject.cpp"
>
</File>
<File
RelativePath="..\..\..\source\gameengine\Converter\BL_ArmatureObject.h"
>
@ -568,6 +572,10 @@
RelativePath="..\..\..\source\gameengine\Converter\BL_MeshDeformer.h"
>
</File>
<File
RelativePath="..\..\..\source\gameengine\Converter\BL_ModifierDeformer.h"
>
</File>
<File
RelativePath="..\..\..\source\gameengine\Converter\BL_ShapeActionActuator.h"
>

@ -4,6 +4,7 @@
Version="9,00"
Name="EXP_expressions"
ProjectGUID="{EADC3C5A-6C51-4F03-8038-1553E7D7F740}"
RootNamespace="EXP_expressions"
TargetFrameworkVersion="131072"
>
<Platforms>
@ -42,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\SceneGraph"
PreprocessorDefinitions="WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -117,7 +118,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\SceneGraph"
PreprocessorDefinitions="WIN32,_LIB,EXP_PYTHON_EMBEDDING,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -192,7 +193,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\SceneGraph"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,EXP_PYTHON_EMBEDDING"
StringPooling="true"
RuntimeLibrary="2"
@ -267,7 +268,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\SceneGraph"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,EXP_PYTHON_EMBEDDING"
StringPooling="true"
RuntimeLibrary="0"
@ -342,7 +343,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\SceneGraph"
PreprocessorDefinitions="WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -417,7 +418,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\SceneGraph"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,EXP_PYTHON_EMBEDDING"
StringPooling="true"
RuntimeLibrary="0"

@ -4,6 +4,7 @@
Version="9,00"
Name="SCA_GameLogic"
ProjectGUID="{32CC75E2-EE85-45E6-8E3D-513F58464F43}"
RootNamespace="SCA_GameLogic"
TargetFrameworkVersion="131072"
>
<Platforms>
@ -42,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -117,7 +118,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,EXP_PYTHON_EMBEDDING"
StringPooling="true"
RuntimeLibrary="0"
@ -192,7 +193,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,EXP_PYTHON_EMBEDDING"
StringPooling="true"
RuntimeLibrary="2"
@ -267,7 +268,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="WIN32,_LIB,EXP_PYTHON_EMBEDDING,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -342,7 +343,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -417,7 +418,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,EXP_PYTHON_EMBEDDING"
StringPooling="true"
RuntimeLibrary="0"

@ -72,7 +72,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386&#x0D;&#x0A;"
AdditionalDependencies="odelib.lib fmodvc.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib openal_static.lib libjpeg.lib dxguid.lib libeay32.lib libpng.lib libz.lib qtmlClient.lib SDL.lib freetype2ST.lib python25_d.lib pthreadVSE2.lib pthreadVC2.lib Half_d.lib Iex_d.lib IlmImf_d.lib IlmThread_d.lib Imath_d.lib avcodec-52.lib avformat-52.lib avutil-50.lib swscale-0.lib avdevice-52.lib"
AdditionalDependencies="ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib openal_static.lib libjpeg.lib dxguid.lib libeay32.lib libpng.lib libz.lib qtmlClient.lib SDL.lib freetype2ST.lib python25_d.lib pthreadVSE2.lib pthreadVC2.lib Half_d.lib Iex_d.lib IlmImf_d.lib IlmThread_d.lib Imath_d.lib avcodec-52.lib avformat-52.lib avutil-50.lib swscale-0.lib avdevice-52.lib"
ShowProgress="0"
OutputFile="..\..\..\..\bin\debug\blenderplayer.exe"
LinkIncremental="2"
@ -166,12 +166,13 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="odelib.lib fmodvc.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib openal_static.lib libjpeg.lib dxguid.lib libeay32.lib libpng.lib libz.lib qtmlClient.lib SDL.lib freetype2ST.lib python25.lib pthreadVSE2.lib pthreadVC2.lib Half.lib Iex.lib IlmImf.lib IlmThread.lib Imath.lib avcodec-52.lib avformat-52.lib avutil-50.lib swscale-0.lib avdevice-52.lib"
AdditionalDependencies="odelib.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib openal_static.lib libjpeg.lib dxguid.lib libeay32.lib libpng.lib libz.lib qtmlClient.lib SDL.lib freetype2ST.lib python25.lib pthreadVSE2.lib pthreadVC2.lib Half.lib Iex.lib IlmImf.lib IlmThread.lib Imath.lib avcodec-52.lib avformat-52.lib avutil-50.lib swscale-0.lib avdevice-52.lib"
OutputFile="..\..\..\..\bin\blenderplayer.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\..\..\..\lib\windows\sdl\lib;..\..\..\..\..\lib\windows\zlib\lib;..\..\..\..\..\lib\windows\ode\lib;..\..\..\..\..\lib\windows\png\lib;..\..\..\..\..\lib\windows\jpeg\lib;..\..\..\..\..\lib\windows\fmod\lib;..\..\..\..\..\lib\windows\openal\lib;..\..\..\..\..\lib\windows\freetype\lib;..\..\..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\..\..\lib\windows\python\lib\lib25_vs2008;..\..\..\..\..\lib\windows\openssl\lib;..\..\..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\..\..\lib\windows\pthreads\lib;..\..\..\..\..\lib\windows\ffmpeg\lib"
IgnoreDefaultLibraryNames="libc.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib"
GenerateDebugInformation="true"
ProgramDatabaseFile="..\..\..\..\..\build\msvc_9\libs\blenderplayer.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
@ -232,10 +233,6 @@
RelativePath="..\..\..\..\source\gameengine\GamePlayer\ghost\GPG_System.cpp"
>
</File>
<File
RelativePath="..\..\..\..\source\blender\blenkernel\bad_level_call_stubs\stubs.c"
>
</File>
<File
RelativePath="..\..\..\..\source\icons\winplayer.rc"
>

@ -581,6 +581,10 @@
RelativePath="..\..\..\source\gameengine\Ketsji\KX_PythonInitTypes.cpp"
>
</File>
<File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_PythonSeq.cpp"
>
</File>
<File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_RayCast.cpp"
>
@ -890,6 +894,10 @@
RelativePath="..\..\..\source\gameengine\Ketsji\KX_PythonInitTypes.h"
>
</File>
<File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_PythonSeq.h"
>
</File>
<File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_RayCast.h"
>

@ -4,6 +4,7 @@
Version="9,00"
Name="KX_network"
ProjectGUID="{6E24BF09-9653-4166-A871-F65CC9E98A9B}"
RootNamespace="KX_network"
TargetFrameworkVersion="131072"
>
<Platforms>
@ -42,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic;..\..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="true"
RuntimeLibrary="0"
@ -117,7 +118,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic;..\..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="WIN32,_LIB,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -192,7 +193,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic;..\..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="true"
RuntimeLibrary="2"
@ -267,7 +268,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic;..\..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="WIN32,_LIB,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -342,7 +343,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic;..\..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="WIN32,_LIB,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -417,7 +418,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic;..\..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="true"
RuntimeLibrary="0"

@ -42,7 +42,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna"
AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna;..\..\..\..\..\source\blender\blenkernel;..\..\..\..\..\source\blender\blenlib"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="false"
BasicRuntimeChecks="3"
@ -110,7 +110,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna"
AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna;..\..\..\..\..\source\blender\blenkernel;..\..\..\..\..\source\blender\blenlib"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
@ -176,7 +176,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna"
AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna;..\..\..\..\..\source\blender\blenkernel;..\..\..\..\..\source\blender\blenlib"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
@ -243,7 +243,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna"
AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna;..\..\..\..\..\source\blender\blenkernel;..\..\..\..\..\source\blender\blenlib"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="false"
BasicRuntimeChecks="3"
@ -312,7 +312,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna"
AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna;..\..\..\..\..\source\blender\blenkernel;..\..\..\..\..\source\blender\blenlib"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="false"
BasicRuntimeChecks="3"
@ -380,7 +380,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna"
AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna;..\..\..\..\..\source\blender\blenkernel;..\..\..\..\..\source\blender\blenlib"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="2"
UsePrecompiledHeader="0"

@ -4,6 +4,7 @@
Version="9,00"
Name="RAS_rasterizer"
ProjectGUID="{51FB3D48-2467-4BFA-A321-D848252B437E}"
RootNamespace="RAS_rasterizer"
TargetFrameworkVersion="131072"
>
<Platforms>
@ -42,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\..\lib\windows\python\include\python2.5"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\SceneGraph;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_GLEXT"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -117,7 +118,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\SceneGraph;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="true"
RuntimeLibrary="2"
@ -192,7 +193,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\..\lib\windows\python\include\python2.5"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\SceneGraph;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_GLEXT"
StringPooling="true"
RuntimeLibrary="0"
@ -267,7 +268,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\SceneGraph;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -342,7 +343,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\..\lib\windows\python\include\python2.5"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\SceneGraph;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_GLEXT"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -417,7 +418,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\..\lib\windows\python\include\python2.5"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\SceneGraph;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_GLEXT"
StringPooling="true"
RuntimeLibrary="0"

@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\source\blender\gpu"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\source\blender\gpu;..\..\..\..\source\gameengine\Ketsji;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\blenlib"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -118,7 +118,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\source\blender\gpu"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\source\blender\gpu;..\..\..\..\source\gameengine\Ketsji;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\blenlib"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_GLEXT"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -193,7 +193,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\source\blender\gpu"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\source\blender\gpu;..\..\..\..\source\gameengine\Ketsji;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\blenlib"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="true"
RuntimeLibrary="2"
@ -268,7 +268,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\source\blender\gpu"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\source\blender\gpu;..\..\..\..\source\gameengine\Ketsji;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\blenlib"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_GLEXT"
StringPooling="true"
RuntimeLibrary="0"
@ -343,7 +343,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\source\blender\gpu"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\source\blender\gpu;..\..\..\..\source\gameengine\Ketsji;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\blenlib"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_GLEXT"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -418,7 +418,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\source\blender\gpu"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\source\blender\gpu;..\..\..\..\source\gameengine\Ketsji;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\blenlib"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_GLEXT"
StringPooling="true"
RuntimeLibrary="0"

@ -4,6 +4,7 @@
Version="9,00"
Name="SG_SceneGraph"
ProjectGUID="{09222F5E-1625-4FF3-A89A-384D16875EE5}"
RootNamespace="SG_SceneGraph"
TargetFrameworkVersion="131072"
>
<Platforms>
@ -509,6 +510,10 @@
RelativePath="..\..\..\source\gameengine\SceneGraph\SG_Controller.h"
>
</File>
<File
RelativePath="..\..\..\source\gameengine\SceneGraph\SG_DList.h"
>
</File>
<File
RelativePath="..\..\..\source\gameengine\SceneGraph\SG_IObject.h"
>
@ -521,6 +526,10 @@
RelativePath="..\..\..\source\gameengine\SceneGraph\SG_ParentRelation.h"
>
</File>
<File
RelativePath="..\..\..\source\gameengine\SceneGraph\SG_QList.h"
>
</File>
<File
RelativePath="..\..\..\source\gameengine\SceneGraph\SG_Spatial.h"
>

@ -126,7 +126,6 @@
ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\gameengine\videotexture\"
WarningLevel="2"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="0"
CompileAs="0"
ShowIncludes="false"
/>

@ -180,7 +180,7 @@ endif
else
@strip -x $(DISTDIR)/blender$(EXT0)
@if [ -f $(DISTDIR)/blenderplayer$(EXTO) ]; then \
strip -x $(DISTDIR)/blender$(EXT0) ; \
strip -x $(DISTDIR)/blenderplayer$(EXT0) ; \
fi
endif
endif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 KiB

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 KiB

After

Width:  |  Height:  |  Size: 192 KiB

@ -7,7 +7,7 @@ Group: 'Export'
Tooltip: 'Export to 3DS file format (.3ds).'
"""
__author__ = ["Campbell Barton", "Bob Holcomb", "Richard Lärkäng", "Damien McGinnes", "Mark Stijnman"]
__author__ = ["Campbell Barton", "Bob Holcomb", "Richard Lärkäng", "Damien McGinnes", "Mark Stijnman"]
__url__ = ("blenderartists.org", "www.blender.org", "www.gametutorials.com", "lib3ds.sourceforge.net/")
__version__ = "0.90a"
__bpydoc__ = """\
@ -50,7 +50,10 @@ import Blender
import bpy
from BPyMesh import getMeshFromObject
from BPyObject import getDerivedObjects
import struct
try:
import struct
except:
struct = None
# So 3ds max can open files, limit names to 12 in length
# this is verry annoying for filenames!
@ -1009,5 +1012,8 @@ def save_3ds(filename):
if __name__=='__main__':
Blender.Window.FileSelector(save_3ds, "Export 3DS", Blender.sys.makename(ext='.3ds'))
if struct:
Blender.Window.FileSelector(save_3ds, "Export 3DS", Blender.sys.makename(ext='.3ds'))
else:
Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
# save_3ds('/test_b.3ds')

@ -133,10 +133,12 @@ import BPyImage
import BPyMessages
import struct
from struct import calcsize, unpack
try:
from struct import calcsize, unpack
except:
calcsize= unpack= None
import os
# If python version is less than 2.4, try to get set stuff from module
try:
@ -958,7 +960,10 @@ def load_3ds(filename, PREF_UI= True):
DEBUG= False
if __name__=='__main__' and not DEBUG:
Blender.Window.FileSelector(load_3ds, 'Import 3DS', '*.3ds')
if calcsize==None:
Blender.Draw.PupMenu('Error%t|a full python installation not found')
else:
Blender.Window.FileSelector(load_3ds, 'Import 3DS', '*.3ds')
# For testing compatibility
#load_3ds('/metavr/convert/vehicle/truck_002/TruckTanker1.3DS', False)
@ -966,6 +971,7 @@ if __name__=='__main__' and not DEBUG:
'''
else:
import os
# DEBUG ONLY
TIME= Blender.sys.time()
import os

@ -45,7 +45,8 @@ from Blender import Types, Object, NMesh, Material,Armature,Mesh
from Blender.Mathutils import *
from Blender import Draw, BGL
from Blender.BGL import *
import math
try: import math
except: math = None
global mat_flip,index_list,space,bone_list,mat_dict
global anim,flip_norm,swap_zy,flip_z,speed,ticks,no_light,recalc_norm,Bl_norm

@ -6,7 +6,8 @@ Group: 'AddMesh'
"""
import BPyAddMesh
import Blender
from math import cos, sin, pi
try: from math import cos, sin, pi
except: math = None
def add_torus(PREF_MAJOR_RAD, PREF_MINOR_RAD, PREF_MAJOR_SEG, PREF_MINOR_SEG):
Vector = Blender.Mathutils.Vector
@ -61,5 +62,8 @@ def main():
BPyAddMesh.add_mesh_simple('Torus', verts, [], faces)
main()
if cos and sin and pi:
main()
else:
Blender.Draw.PupMenu("Error%t|This script requires a full python installation")

@ -0,0 +1,192 @@
#!BPY
"""
Name: 'Clean Animation Curves'
Blender: 249
Group: 'Animation'
Tooltip: 'Remove unused keyframes for ipo curves'
"""
# ***** BEGIN GPL LICENSE BLOCK *****
#
# Copyright (C) 2008-2009: Blender Foundation
#
# 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,
# --------------------------------------------------------------------------
import bpy
from Blender import IpoCurve, Draw, Window
def clean_ipos(ipos):
eul = 0.001
def isflat(vec):
prev_y = vec[0][1]
mid_y = vec[1][1]
next_y = vec[2][1]
# flat status for prev and next
return abs(mid_y-prev_y) < eul, abs(mid_y-next_y) < eul
X=0
Y=1
PREV=0
MID=1
NEXT=2
LEFT = 0
RIGHT = 1
TOT = 0
TOTBEZ = 0
# for ipo in bpy.data.ipos:
for ipo in ipos:
if ipo.lib:
continue
# print ipo
for icu in ipo:
interp = icu.interpolation
extend = icu.extend
bezierPoints = icu.bezierPoints
bezierVecs = [bez.vec for bez in bezierPoints]
l = len(bezierPoints)
TOTBEZ += l
# our aim is to simplify this ipo as much as possible!
if interp == IpoCurve.InterpTypes.BEZIER or interp == interp == IpoCurve.InterpTypes.LINEAR:
#print "Not yet supported"
if interp == IpoCurve.InterpTypes.BEZIER:
flats = [isflat(bez) for bez in bezierVecs]
else:
# A bit of a waste but fake the locations for these so they will always be flats
# IS better then too much duplicate code.
flats = [(True, True)] * l
for v in bezierVecs:
v[PREV][Y] = v[NEXT][Y] = v[MID][Y]
# remove middle points
if l>2:
done_nothing = False
while not done_nothing and len(bezierVecs) > 2:
done_nothing = True
i = l-2
while i > 0:
#print i
#print i, len(bezierVecs)
if flats[i]==(True,True) and flats[i-1][RIGHT] and flats[i+1][LEFT]:
if abs(bezierVecs[i][MID][Y] - bezierVecs[i-1][MID][Y]) < eul and abs(bezierVecs[i][MID][Y] - bezierVecs[i+1][MID][Y]) < eul:
done_nothing = False
del flats[i]
del bezierVecs[i]
icu.delBezier(i)
TOT += 1
l-=1
i-=1
# remove endpoints
if extend == IpoCurve.ExtendTypes.CONST and len(bezierVecs) > 1:
#print l, len(bezierVecs)
# start
while l > 2 and (flats[0][RIGHT] and flats[1][LEFT] and (abs(bezierVecs[0][MID][Y] - bezierVecs[1][MID][Y]) < eul)):
print "\tremoving 1 point from start of the curve"
del flats[0]
del bezierVecs[0]
icu.delBezier(0)
TOT += 1
l-=1
# End
while l > 2 and flats[-2][RIGHT] and flats[-1][LEFT] and (abs(bezierVecs[-2][MID][Y] - bezierVecs[-1][MID][Y]) < eul):
print "\tremoving 1 point from end of the curve", l
del flats[l-1]
del bezierVecs[l-1]
icu.delBezier(l-1)
TOT += 1
l-=1
if l==2:
if isflat( bezierVecs[0] )[RIGHT] and isflat( bezierVecs[1] )[LEFT] and abs(bezierVecs[0][MID][Y] - bezierVecs[1][MID][Y]) < eul:
# remove the second point
print "\tremoving 1 point from 2 point bez curve"
# remove the second point
del flats[1]
del bezierVecs[1]
icu.delBezier(1)
TOT+=1
l-=1
# Change to linear for faster evaluation
'''
if l==1:
print 'Linear'
icu.interpolation = IpoCurve.InterpTypes.LINEAR
'''
if interp== IpoCurve.InterpTypes.CONST:
print "Not yet supported"
print 'total', TOT, TOTBEZ
return TOT, TOTBEZ
def main():
ret = Draw.PupMenu('Clean Selected Objects Ipos%t|Object IPO%x1|Object Action%x2|%l|All IPOs (be careful!)%x3')
sce = bpy.data.scenes.active
ipos = []
if ret == 3:
ipos.extend(list(bpy.data.ipos))
else:
for ob in sce.objects.context:
if ret == 1:
ipo = ob.ipo
if ipo:
ipos.append(ipo)
elif ret == 2:
action = ob.action
if action:
ipos.extend([ipo for ipo in action.getAllChannelIpos().values() if ipo])
if not ipos:
Draw.PupMenu('Error%t|No ipos found')
else:
total_removed, total = clean_ipos(ipos)
Draw.PupMenu('Done!%t|Removed ' + str(total_removed) + ' of ' + str(total) + ' points')
Window.RedrawAll()
if __name__ == '__main__':
main()

@ -132,7 +132,6 @@ modified for Blender/Mathutils by Campell Barton
######################################################################
# Public interface
######################################################################
from Blender.Mathutils import DotVecs
def convexHull(point_list_2d):
"""Calculate the convex hull of a set of vectors
The vectors can be 3 or 4d but only the Xand Y are used.
@ -197,7 +196,7 @@ def plane2mat(plane, normalize= False):
up= cent - ((plane[0]+plane[1])/2.0)
right= cent - ((plane[1]+plane[2])/2.0)
z= CrossVecs(up, right)
z= up.cross(right)
if normalize:
up.normalize()

@ -569,12 +569,11 @@ def face_edges(me):
def facesPlanerIslands(me):
DotVecs= Blender.Mathutils.DotVecs
def roundvec(v):
return round(v[0], 4), round(v[1], 4), round(v[2], 4)
face_props= [(cent, no, roundvec(no), DotVecs(cent, no)) for f in me.faces for no, cent in ((f.no, f.cent),)]
face_props= [(cent, no, roundvec(no), cent.dot(no)) for f in me.faces for no, cent in ((f.no, f.cent),)]
face_edge_users= face_edges(me)
islands= []
@ -607,7 +606,7 @@ def facesPlanerIslands(me):
face_prop2= face_props[fidx2]
# normals are the same?
if face_prop1[2]==face_prop2[2]:
if abs(face_prop1[3] - DotVecs(face_prop1[1], face_prop2[0])) < 0.000001:
if abs(face_prop1[3] - face_prop1[1].dot(face_prop2[0])) < 0.000001:
used_faces[fidx2]= 1
island.append(fidx2)
islands.append([me.faces[i] for i in island])
@ -616,7 +615,6 @@ def facesPlanerIslands(me):
def facesUvIslands(me, PREF_IMAGE_DELIMIT=True):
DotVecs= Blender.Mathutils.DotVecs
def roundvec(v):
return round(v[0], 4), round(v[1], 4)

@ -1,332 +0,0 @@
from Blender import *
try:
import psyco
psyco.full()
except:
print 'no psyco for you!'
DotVecs= Mathutils.DotVecs
#========================================================
# SPACIAL TREE - Seperate Class - use if you want to
# USed for getting vert is a proximity
LEAF_SIZE = 128
class octreeNode:
def __init__(self, verts, parent):
# Assunme we are a leaf node, until split is run.
self.verts = verts
self.children = []
if parent == None: # ROOT NODE, else set bounds when making children,
# BOUNDS
v= verts[0]
maxx,maxy,maxz= v.co
minx,miny,minz= maxx,maxy,maxz
for v in verts:
x,y,z= v.co
if x>maxx: maxx= x
if y>maxy: maxy= y
if z>maxz: maxz= z
if x<minx: minx= x
if y<miny: miny= y
if z<minz: minz= z
self.minx= minx
self.miny= miny
self.minz= minz
self.maxx= maxx
self.maxy= maxy
self.maxz= maxz
# We have no parent to split us so split ourselves.
#self.setCornerPoints()
self.splitNode()
def splitNode(self):
if len(self.verts) > LEAF_SIZE:
self.makeChildren() # 8 new children,
self.verts = None
# Alredy assumed a leaf not so dont do anything here.
def makeChildren(self):
verts= self.verts
# Devide into 8 children.
axisDividedVerts = [[],[],[],[],[],[],[],[]] # Verts Only
divx = (self.maxx + self.minx) / 2
divy = (self.maxy + self.miny) / 2
divz = (self.maxz + self.minz) / 2
# Sort into 8
for v in verts:
x,y,z = v.co
if x > divx:
if y > divy:
if z > divz:
axisDividedVerts[0].append(v)
else:
axisDividedVerts[1].append(v)
else:
if z > divz:
axisDividedVerts[2].append(v)
else:
axisDividedVerts[3].append(v)
else:
if y > divy:
if z > divz:
axisDividedVerts[4].append(v)
else:
axisDividedVerts[5].append(v)
else:
if z > divz:
axisDividedVerts[6].append(v)
else:
axisDividedVerts[7].append(v)
# populate self.children
for i in xrange(8):
octNode = octreeNode(axisDividedVerts[i], self)
# Set bounds manually
if i == 0:
octNode.minx = divx
octNode.maxx = self.maxx
octNode.miny = divy
octNode.maxy = self.maxy
octNode.minz = divz
octNode.maxz = self.maxz
elif i == 1:
octNode.minx = divx
octNode.maxx = self.maxx
octNode.miny = divy
octNode.maxy = self.maxy
octNode.minz = self.minz #
octNode.maxz = divz #
elif i == 2:
octNode.minx = divx
octNode.maxx = self.maxx
octNode.miny = self.miny #
octNode.maxy = divy #
octNode.minz = divz
octNode.maxz = self.maxz
elif i == 3:
octNode.minx = divx
octNode.maxx = self.maxx
octNode.miny = self.miny #
octNode.maxy = divy #
octNode.minz = self.minz #
octNode.maxz = divz #
elif i == 4:
octNode.minx = self.minx #
octNode.maxx = divx #
octNode.miny = divy
octNode.maxy = self.maxy
octNode.minz = divz
octNode.maxz = self.maxz
elif i == 5:
octNode.minx = self.minx #
octNode.maxx = divx #
octNode.miny = divy
octNode.maxy = self.maxy
octNode.minz = self.minz #
octNode.maxz = divz #
elif i == 6:
octNode.minx = self.minx #
octNode.maxx = divx #
octNode.miny = self.miny #
octNode.maxy = divy #
octNode.minz = divz
octNode.maxz = self.maxz
elif i == 7:
octNode.minx = self.minx #
octNode.maxx = divx #
octNode.miny = self.miny #
octNode.maxy = divy #
octNode.minz = self.minz #
octNode.maxz = divz #
#octNode.setCornerPoints()
octNode.splitNode() # Splits the node if it can.
self.children.append(octNode)
# GETS VERTS IN A Distance RANGE-
def getVertsInRange(self, loc, normal, range_val, vertList):
#loc= Mathutils.Vector(loc) # MUST BE VECTORS
#normal= Mathutils.Vector(normal)
'''
loc: Vector of the location to search from
normal: None or Vector - if a vector- will only get verts on this side of the vector
range_val: maximum distance. A negative value will fill the list with teh closest vert only.
vertList: starts as an empty list
list that this function fills with verts that match
'''
xloc,yloc,zloc= loc
if range_val<0:
range_val= -range_val
FIND_CLOSEST= True
vertList.append(None) # just update the 1 vertex
else:
FIND_CLOSEST= False
if self.children:
# Check if the bounds are in range_val,
for childNode in self.children:
# First test if we are surrounding the point.
if\
childNode.minx - range_val < xloc and\
childNode.maxx + range_val > xloc and\
childNode.miny - range_val < yloc and\
childNode.maxy + range_val > yloc and\
childNode.minz - range_val < zloc and\
childNode.maxz + range_val > zloc:
# Recurse down or get virts.
childNode.getVertsInRange(loc, normal, range_val, vertList)
#continue # Next please
else: # we are a leaf node. Test vert locations.
if not normal:
# Length only check
for v in self.verts:
length = (loc - v.co).length
if length < range_val:
if FIND_CLOSEST:
# Just update the 1 vert
vertList[0]= (v, length)
range_val= length # Shink the length so we only get verts from their.
else:
vertList.append((v, length))
else:
# Lengh and am I infront of the vert.
for v in self.verts:
length = (loc - v.co).length
if length < range_val:
# Check if the points in front
dot= DotVecs(normal, loc) - DotVecs(normal, v.co)
if dot<0:
vertList.append((v, length))
# END TREE
# EXAMPLE RADIO IN PYTHON USING THE ABOVE FUNCTION
"""
import BPyMesh
# Radio bake
def bake():
_AngleBetweenVecs_= Mathutils.AngleBetweenVecs
def AngleBetweenVecs(a1,a2):
try:
return _AngleBetweenVecs_(a1,a2)
except:
return 180
scn = Scene.GetCurrent()
ob = scn.getActiveObject()
me = ob.getData(mesh=1)
dist= Draw.PupFloatInput('MaxDist:', 2.0, 0.1, 20.0, 0.1, 3)
if dist==None:
return
# Make nice normals
BPyMesh.meshCalcNormals(me)
len_verts= len(me.verts)
#me.sel= False
meshOctTree = octreeNode(me.verts, None)
# Store face areas
vertex_areas= [0.0] * len_verts
# Get vertex areas - all areas of face users
for f in me.faces:
a= f.area
for v in f.v:
vertex_areas[v.index] += a
bias= 0.001
t= sys.time()
# Tone for the verts
vert_tones= [0.0] * len_verts
maxtone= 0.0
mintone= 100000000
for i, v in enumerate(me.verts):
if not i%10:
print 'verts to go', len_verts-i
v_co= v.co
v_no= v.no
verts_in_range= []
meshOctTree.getVertsInRange(v_co, v_no, dist, verts_in_range)
tone= 0.0
# These are verts in our range
for test_v, length in verts_in_range:
if bias<length:
try:
# Make sure this isnt a back facing vert
normal_diff= AngleBetweenVecs(test_v.no, v_no)
except:
continue
if normal_diff > 90: # were facing this vert
#if 1:
# Current value us between zz90 and 180
# make between 0 and 90
# so 0 is right angles and 90 is direct opposite vertex normal
normal_diff= (normal_diff-90)
# Vertex area needs to be taken into account so we dont have small faces over influencing.
vertex_area= vertex_areas[test_v.index]
# Get the angle the vertex is in location from the location and normal of the vert.
above_diff= AngleBetweenVecs(test_v.co-v.co, v_no)
## Result will be between 0 :above and 90: horizon.. invert this so horizon has littel effect
above_diff= 90-above_diff
# dist-length or 1.0/length both work well
tone= (dist-length) * vertex_area * above_diff * normal_diff
vert_tones[i] += tone
if maxtone<vert_tones[i]:
maxtone= vert_tones[i]
if mintone>vert_tones[i]:
mintone= vert_tones[i]
if not maxtone:
Draw.PupMenu('No verts in range, use a larger range')
return
# Apply tones
for f in me.faces:
f_col= f.col
for i, v in enumerate(f.v):
c= f_col[i]
v_index= v.index
tone= int(((maxtone - vert_tones[v.index]) / maxtone) * 255 )
#print tone
c.r= c.g= c.b= tone
print 'time', sys.time()-t
if __name__=="__main__":
bake()
"""

@ -25,7 +25,6 @@ import Blender
import bpy
Vector= Blender.Mathutils.Vector
Ang= Blender.Mathutils.AngleBetweenVecs
CrossVecs= Blender.Mathutils.CrossVecs
MidpointVecs= Blender.Mathutils.MidpointVecs
import BPyMesh
@ -198,8 +197,8 @@ def redux(ob, REDUX=0.5, BOUNDRY_WEIGHT=2.0, REMOVE_DOUBLES=False, FACE_AREA_WEI
# the point of collapsing.
# Enlarge so we know they intersect: self.length*2
cv1= CrossVecs(v1no, CrossVecs(v1no, v1co-v2co))
cv2= CrossVecs(v2no, CrossVecs(v2no, v2co-v1co))
cv1= v1no.cross(v1no.cross(v1co-v2co))
cv2= v2no.cross(v2no.cross(v2co-v1co))
# Scale to be less then the edge lengths.
cv2.length = cv1.length = 1

@ -1,6 +1,6 @@
import Blender
from Blender import Mathutils, Window, Scene, Draw, Mesh
from Blender.Mathutils import CrossVecs, Matrix, Vector, Intersect
from Blender.Mathutils import Matrix, Vector, Intersect
# DESCRIPTION:
# screen_x, screen_y the origin point of the pick ray

@ -1,6 +1,6 @@
#dxfLibrary.py : provides functions for generating DXF files
# --------------------------------------------------------------------------
__version__ = "v1.29beta - 2008.12.28"
__version__ = "v1.33 - 2009.06.16"
__author__ = "Stani Michiels(Stani), Remigiusz Fiedler(migius)"
__license__ = "GPL"
__url__ = "http://wiki.blender.org/index.php/Scripts/Manual/Export/autodesk_dxf"
@ -18,31 +18,45 @@ IDEAs:
-
TODO:
- add support for SPLINEs, (bad idea, cause DXF r14 object :(
- add support for DXFr14 (needs extended file header)
- add support for SPLINEs (possible first in DXFr14 version)
- add user preset for floating point precision (3-16?)
History
v1.33 - 2009.06.16 by migius
- modif _point(): converts all coords to floats
- modif LineType class: implement elements
- added VPORT class, incl. defaults
- fix Insert class
v1.32 - 2009.06.06 by migius
- modif Style class: changed defaults to widthFactor=1.0, obliqueAngle=0.0
- modif Text class: alignment parameter reactivated
v1.31 - 2009.06.02 by migius
- modif _Entity class: added paperspace,elevation
v1.30 - 2009.05.28 by migius
- bugfix 3dPOLYLINE/POLYFACE: VERTEX needs x,y,z coordinates, index starts with 1 not 0
v1.29 - 2008.12.28 by Yorik
- modif POLYLINE to support bulge segments
- modif POLYLINE to support bulge segments
v1.28 - 2008.12.13 by Steeve/BlenderArtists
- bugfix for EXTMIN/EXTMAX to suit Cycas-CAD
- bugfix for EXTMIN/EXTMAX to suit Cycas-CAD
v1.27 - 2008.10.07 by migius
- beautifying output code: keys whitespace prefix
- refactoring DXF-strings format: NewLine moved to the end of
- beautifying output code: keys whitespace prefix
- refactoring DXF-strings format: NewLine moved to the end of
v1.26 - 2008.10.05 by migius
- modif POLYLINE to support POLYFACE
- modif POLYLINE to support POLYFACE
v1.25 - 2008.09.28 by migius
- modif FACE class for r12
- modif FACE class for r12
v1.24 - 2008.09.27 by migius
- modif POLYLINE class for r12
- changing output format from r9 to r12(AC1009)
- modif POLYLINE class for r12
- changing output format from r9 to r12(AC1009)
v1.1 (20/6/2005) by www.stani.be/python/sdxf
- Python library to generate dxf drawings
- Python library to generate dxf drawings
______________________________________________________________
""" % (__author__,__version__,__license__,__url__)
# --------------------------------------------------------------------------
# DXF Library: copyright (C) 2005 by Stani Michiels (AKA Stani)
# 2008 modif by Remigiusz Fiedler (AKA migius)
# 2008/2009 modif by Remigiusz Fiedler (AKA migius)
# --------------------------------------------------------------------------
# ***** BEGIN GPL LICENSE BLOCK *****
#
@ -80,12 +94,11 @@ _HEADER_POINTS=['insbase','extmin','extmax']
def _point(x,index=0):
"""Convert tuple to a dxf point"""
#print 'deb: _point=', x #-------------
return '\n'.join([' %s\n%s'%((i+1)*10+index,x[i]) for i in range(len(x))])
return '\n'.join([' %s\n%s'%((i+1)*10+index,float(x[i])) for i in range(len(x))])
def _points(plist):
"""Convert a list of tuples to dxf points"""
out = '\n'.join([_point(plist[i],i)for i in range(len(plist))])
#print 'deb: points=\n', out #-------------------
return out
#---base classes----------------------------------------
@ -104,17 +117,21 @@ class _Call:
#-------------------------------------------------------
class _Entity(_Call):
"""Base class for _common group codes for entities."""
def __init__(self,color=None,extrusion=None,layer='0',
def __init__(self,paperspace=None,color=None,layer='0',
lineType=None,lineTypeScale=None,lineWeight=None,
thickness=None,parent=None):
extrusion=None,elevation=None,thickness=None,
parent=None):
"""None values will be omitted."""
self.paperspace = paperspace
self.color = color
self.extrusion = extrusion
self.layer = layer
self.lineType = lineType
self.lineTypeScale = lineTypeScale
self.lineWeight = lineWeight
self.extrusion = extrusion
self.elevation = elevation
self.thickness = thickness
#self.visible = visible
self.parent = parent
def _common(self):
@ -122,13 +139,16 @@ class _Entity(_Call):
if self.parent:parent=self.parent
else:parent=self
result =''
if parent.paperspace==1: result+=' 67\n1\n'
if parent.layer!=None: result+=' 8\n%s\n'%parent.layer
if parent.color!=None: result+=' 62\n%s\n'%parent.color
if parent.extrusion!=None: result+='%s\n'%_point(parent.extrusion,200)
if parent.lineType!=None: result+=' 6\n%s\n'%parent.lineType
#TODO: if parent.lineWeight!=None: result+='370\n%s\n'%parent.lineWeight
# TODO: if parent.lineWeight!=None: result+='370\n%s\n'%parent.lineWeight
# TODO: if parent.visible!=None: result+='60\n%s\n'%parent.visible
if parent.lineTypeScale!=None: result+=' 48\n%s\n'%parent.lineTypeScale
if parent.elevation!=None: result+=' 38\n%s\n'%parent.elevation
if parent.thickness!=None: result+=' 39\n%s\n'%parent.thickness
if parent.extrusion!=None: result+='%s\n'%_point(parent.extrusion,200)
return result
#--------------------------
@ -273,7 +293,7 @@ class Insert(_Entity):
self.rotation=rotation
def __str__(self):
result=' 0\nINSERT\n 2\n%s\n%s\n%s\n'%\
result=' 0\nINSERT\n 2\n%s\n%s%s\n'%\
(self.name,self._common(),_point(self.point))
if self.xscale!=None:result+=' 41\n%s\n'%self.xscale
if self.yscale!=None:result+=' 42\n%s\n'%self.yscale
@ -307,6 +327,10 @@ class PolyLine(_Entity):
self.points=points
self.org_point=org_point
self.flag=flag
self.polyface = False
self.polyline2d = False
self.faces = [] # dummy value
self.width= None # dummy value
if self.flag & POLYFACE_MESH:
self.polyface=True
self.points=points[0]
@ -322,21 +346,21 @@ class PolyLine(_Entity):
def __str__(self):
result= ' 0\nPOLYLINE\n%s 70\n%s\n' %(self._common(),self.flag)
#print 'deb: self._common()', self._common() #----------
result+=' 66\n1\n'
result+='%s\n' %_point(self.org_point)
if self.polyface:
result+=' 71\n%s\n' %self.p_count
result+=' 72\n%s\n' %self.f_count
elif self.polyline2d:
if self.width: result+=' 40\n%s\n 41\n%s\n' %(self.width[0],self.width[1])
if self.width!=None: result+=' 40\n%s\n 41\n%s\n' %(self.width[0],self.width[1])
for point in self.points:
result+=' 0\nVERTEX\n'
result+=' 8\n%s\n' %self.layer
result+='%s\n' %_point(point[0:2])
if self.polyface:
result+='%s\n' %_point(point[0:3])
result+=' 70\n192\n'
elif self.polyline2d:
result+='%s\n' %_point(point[0:2])
if len(point)>4:
width1, width2 = point[3], point[4]
if width1!=None: result+=' 40\n%s\n' %width1
@ -344,6 +368,8 @@ class PolyLine(_Entity):
if len(point)==6:
bulge = point[5]
if bulge: result+=' 42\n%s\n' %bulge
else:
result+='%s\n' %_point(point[0:3])
for face in self.faces:
result+=' 0\nVERTEX\n'
result+=' 8\n%s\n' %self.layer
@ -363,7 +389,7 @@ class Point(_Entity):
def __init__(self,points=None,**common):
_Entity.__init__(self,**common)
self.points=points
def __str__(self): #TODO:
def __str__(self): # TODO:
return ' 0\nPOINT\n%s%s\n' %(self._common(),
_points(self.points)
)
@ -407,7 +433,7 @@ class Text(_Entity):
if self.style: result+=' 7\n%s\n'%self.style
if self.flag: result+=' 71\n%s\n'%self.flag
if self.justifyhor: result+=' 72\n%s\n'%self.justifyhor
#TODO: if self.alignment: result+='%s\n'%_point(self.alignment,1)
if self.alignment: result+='%s\n'%_point(self.alignment,1)
if self.justifyver: result+=' 73\n%s\n'%self.justifyver
return result
@ -495,7 +521,7 @@ class Block(_Collection):
self.name=name
self.flag=0
self.base=base
def __str__(self): #TODO:
def __str__(self): # TODO:
e=''.join([str(x)for x in self.entities])
return ' 0\nBLOCK\n 8\n%s\n 2\n%s\n 70\n%s\n%s\n 3\n%s\n%s 0\nENDBLK\n'%\
(self.layer,self.name.upper(),self.flag,_point(self.base),self.name.upper(),e)
@ -515,20 +541,27 @@ class Layer(_Call):
#-----------------------------------------------
class LineType(_Call):
"""Custom linetype"""
def __init__(self,name='continuous',description='Solid line',elements=[],flag=64):
# TODO: Implement lineType elements
def __init__(self,name='CONTINUOUS',description='Solid line',elements=[0.0],flag=0):
self.name=name
self.description=description
self.elements=copy.copy(elements)
self.flag=flag
def __str__(self):
return ' 0\nLTYPE\n 2\n%s\n 70\n%s\n 3\n%s\n 72\n65\n 73\n%s\n 40\n0.0\n'%\
(self.name.upper(),self.flag,self.description,len(self.elements))
result = ' 0\nLTYPE\n 2\n%s\n 70\n%s\n 3\n%s\n 72\n65\n'%\
(self.name.upper(),self.flag,self.description)
if self.elements:
elements = ' 73\n%s\n' %(len(self.elements)-1)
elements += ' 40\n%s\n' %(self.elements[0])
for e in self.elements[1:]:
elements += ' 49\n%s\n' %e
result += elements
return result
#-----------------------------------------------
class Style(_Call):
"""Text style"""
def __init__(self,name='standard',flag=0,height=0,widthFactor=40,obliqueAngle=50,
def __init__(self,name='standard',flag=0,height=0,widthFactor=1.0,obliqueAngle=0.0,
mirror=0,lastHeight=1,font='arial.ttf',bigFont=''):
self.name=name
self.flag=flag
@ -546,27 +579,137 @@ class Style(_Call):
self.font.upper(),self.bigFont.upper())
#-----------------------------------------------
class View(_Call):
def __init__(self,name,flag=0,width=1,height=1,center=(0.5,0.5),
direction=(0,0,1),target=(0,0,0),lens=50,
frontClipping=0,backClipping=0,twist=0,mode=0):
class VPort(_Call):
def __init__(self,name,flag=0,
leftBottom=(0.0,0.0),
rightTop=(1.0,1.0),
center=(0.5,0.5),
snap_base=(0.0,0.0),
snap_spacing=(0.1,0.1),
grid_spacing=(0.1,0.1),
direction=(0.0,0.0,1.0),
target=(0.0,0.0,0.0),
height=1.0,
ratio=1.0,
lens=50,
frontClipping=0,
backClipping=0,
snap_rotation=0,
twist=0,
mode=0,
circle_zoom=100,
fast_zoom=1,
ucsicon=1,
snap_on=0,
grid_on=0,
snap_style=0,
snap_isopair=0
):
self.name=name
self.flag=flag
self.width=width
self.height=height
self.leftBottom=leftBottom
self.rightTop=rightTop
self.center=center
self.snap_base=snap_base
self.snap_spacing=snap_spacing
self.grid_spacing=grid_spacing
self.direction=direction
self.target=target
self.height=float(height)
self.ratio=float(ratio)
self.lens=float(lens)
self.frontClipping=float(frontClipping)
self.backClipping=float(backClipping)
self.snap_rotation=float(snap_rotation)
self.twist=float(twist)
self.mode=mode
self.circle_zoom=circle_zoom
self.fast_zoom=fast_zoom
self.ucsicon=ucsicon
self.snap_on=snap_on
self.grid_on=grid_on
self.snap_style=snap_style
self.snap_isopair=snap_isopair
def __str__(self):
output = [' 0', 'VPORT',
' 2', self.name,
' 70', self.flag,
_point(self.leftBottom),
_point(self.rightTop,1),
_point(self.center,2), # View center point (in DCS)
_point(self.snap_base,3),
_point(self.snap_spacing,4),
_point(self.grid_spacing,5),
_point(self.direction,6), #view direction from target (in WCS)
_point(self.target,7),
' 40', self.height,
' 41', self.ratio,
' 42', self.lens,
' 43', self.frontClipping,
' 44', self.backClipping,
' 50', self.snap_rotation,
' 51', self.twist,
' 71', self.mode,
' 72', self.circle_zoom,
' 73', self.fast_zoom,
' 74', self.ucsicon,
' 75', self.snap_on,
' 76', self.grid_on,
' 77', self.snap_style,
' 78', self.snap_isopair
]
output_str = ''
for s in output:
output_str += '%s\n' %s
return output_str
#-----------------------------------------------
class View(_Call):
def __init__(self,name,flag=0,
width=1,
height=1,
center=(0.5,0.5),
direction=(0,0,1),
target=(0,0,0),
lens=50,
frontClipping=0,
backClipping=0,
twist=0,mode=0
):
self.name=name
self.flag=flag
self.width=float(width)
self.height=float(height)
self.center=center
self.direction=direction
self.target=target
self.lens=lens
self.frontClipping=frontClipping
self.backClipping=backClipping
self.twist=twist
self.lens=float(lens)
self.frontClipping=float(frontClipping)
self.backClipping=float(backClipping)
self.twist=float(twist)
self.mode=mode
def __str__(self):
return ' 0\nVIEW\n 2\n%s\n 70\n%s\n 40\n%s\n%s\n 41\n%s\n%s\n%s\n 42\n%s\n 43\n%s\n 44\n%s\n 50\n%s\n 71\n%s\n'%\
(self.name,self.flag,self.height,_point(self.center),self.width,
_point(self.direction,1),_point(self.target,2),self.lens,
self.frontClipping,self.backClipping,self.twist,self.mode)
output = [' 0', 'VIEW',
' 2', self.name,
' 70', self.flag,
' 40', self.height,
_point(self.center),
' 41', self.width,
_point(self.direction,1),
_point(self.target,2),
' 42', self.lens,
' 43', self.frontClipping,
' 44', self.backClipping,
' 50', self.twist,
' 71', self.mode
]
output_str = ''
for s in output:
output_str += '%s\n' %s
return output_str
#-----------------------------------------------
def ViewByWindow(name,leftBottom=(0,0),rightTop=(1,1),**options):
@ -581,7 +724,7 @@ class Drawing(_Collection):
"""Dxf drawing. Use append or any other list methods to add objects."""
def __init__(self,insbase=(0.0,0.0,0.0),extmin=(0.0,0.0,0.0),extmax=(0.0,0.0,0.0),
layers=[Layer()],linetypes=[LineType()],styles=[Style()],blocks=[],
views=[],entities=None,fileName='test.dxf'):
views=[],vports=[],entities=None,fileName='test.dxf'):
# TODO: replace list with None,arial
if not entities:
entities=[]
@ -593,6 +736,7 @@ class Drawing(_Collection):
self.linetypes=copy.copy(linetypes)
self.styles=copy.copy(styles)
self.views=copy.copy(views)
self.vports=copy.copy(vports)
self.blocks=copy.copy(blocks)
self.fileName=fileName
#private
@ -636,7 +780,8 @@ class Drawing(_Collection):
header=[self.acadver]+[self._point(attr,getattr(self,attr))+'\n' for attr in _HEADER_POINTS]
header=self._section('header',header)
tables=[self._table('ltype',[str(x) for x in self.linetypes]),
tables=[self._table('vport',[str(x) for x in self.vports]),
self._table('ltype',[str(x) for x in self.linetypes]),
self._table('layer',[str(x) for x in self.layers]),
self._table('style',[str(x) for x in self.styles]),
self._table('view',[str(x) for x in self.views]),
@ -720,17 +865,16 @@ def test():
d.append(Line(points=[(0,0,0),(1,1,1)]))
d.append(Mtext('Click on Ads\nmultiple lines with mtext',point=(1,1,1),color=5,rotation=90))
d.append(Text('Please donate!',point=(3,0,1)))
d.append(Rectangle(point=(2,2,2),width=4,height=3,color=6,solid=Solid(color=2)))
#d.append(Rectangle(point=(2,2,2),width=4,height=3,color=6,solid=Solid(color=2)))
d.append(Solid(points=[(4,4,0),(5,4,0),(7,8,0),(9,9,0)],color=3))
d.append(PolyLine(points=[(1,1,1),(2,1,1),(2,2,1),(1,2,1)],closed=1,color=1))
#d.append(PolyLine(points=[(1,1,1),(2,1,1),(2,2,1),(1,2,1)],flag=1,color=1))
#d.saveas('c:\\test.dxf')
d.saveas('test.dxf')
#-----------------------------------------------------
if __name__=='__main__':
if not copy:
Draw.PupMenu('Error%t|This script requires a full python install')
else: main()
else: test()

@ -6,7 +6,7 @@ import BPyWindow
mouseViewRay= BPyWindow.mouseViewRay
from Blender import Mathutils, Window, Scene, Draw, sys
from Blender.Mathutils import CrossVecs, Vector, Intersect, LineIntersect, AngleBetweenVecs
from Blender.Mathutils import Vector, Intersect, LineIntersect, AngleBetweenVecs
LMB= Window.MButs['L']
def mouseup():
@ -101,11 +101,11 @@ def vertexGradientPick(ob, MODE):
# make a line 90d to the grad in screenspace.
if (OriginA-OriginB).length <= eps: # Persp view. same origin different direction
cross_grad= CrossVecs(DirectionA, DirectionB)
cross_grad= DirectionA.cross(DirectionB)
ORTHO= False
else: # Ortho - Same direction, different origin
cross_grad= CrossVecs(DirectionA, OriginA-OriginB)
cross_grad= DirectionA.cross(OriginA-OriginB)
ORTHO= True
cross_grad.normalize()

@ -1,7 +1,7 @@
# -*- coding: latin-1 -*-
"""
SVG 2 OBJ translater, 0.5.9n
Copyright (c) jm soler juillet/novembre 2004-february 2009,
SVG 2 OBJ translater, 0.5.9o
Copyright (c) jm soler juillet/novembre 2004-april 2009,
# ---------------------------------------------------------------
released under GNU Licence
for the Blender 2.42 Python Scripts Bundle.
@ -255,7 +255,7 @@ Changelog:
- removed all debug statements
- correction of a zero division error in the calc_arc function.
0.5.9f: - 2007/15/7
0.5.9f: - 2007/15/7
- Correction de plusieurs bugs sur l'attributions des couleurs et le nommage
des courbes
@ -266,6 +266,8 @@ Changelog:
0.5.9k : - 14/01/2009
0.5.9l : - 31/01/2009
0.5.9n : - 01/02/2009
0.5.9o : - 04/04/2009, remove pattern if it made with path.
==================================================================================
=================================================================================="""
@ -280,6 +282,7 @@ LAST_ID=''
LAST_COLOR=[0.0,0.0,0.0,0.0]
SEPARATE_CURVES=0
USE_COLORS=0
PATTERN=0
SVGCOLORNAMELIST={ 'aliceblue':[240, 248, 255] ,'antiquewhite':[250, 235, 215]
,'aqua':[ 0, 255, 255], 'aquamarine':[127, 255, 212]
@ -787,6 +790,7 @@ def polygon(prp):
D.append('Z')
return D
#--------------------
# 0.5.8, to remove exec
#--------------------
@ -1462,13 +1466,13 @@ def collect_ATTRIBUTS(data):
# --------------------------------------------
def build_HIERARCHY(t):
global CP, curves, SCALE, DEBUG, BOUNDINGBOX, scale_, tagTRANSFORM
global LAST_ID
global LAST_ID, PATTERN
TRANSFORM=0
t=t.replace('\t',' ')
while t.find(' ')!=-1: t=t.replace(' ',' ')
n0=0
t0=t1=0
baliste=[]
#baliste=[]
balisetype=['?','?','/','/','!','!']
BALISES=['D', #DECL_TEXTE',
'D', #DECL_TEXTE',
@ -1490,26 +1494,37 @@ def build_HIERARCHY(t):
if t0>-1 and t1>-1:
if t[t0+1] in balisetype:
b=balisetype.index(t[t0+1])
if t[t0+2]=='-':
b=balisetype.index(t[t0+1])+1
balise=BALISES[b]
if b==2:
parent=STACK.pop(-1)
if parent!=None and TRANSFORM>0:
TRANSFORM-=1
elif t[t1-1] in balisetype:
balise=BALISES[balisetype.index(t[t1-1])+1]
else:
t2=t.find(' ',t0)
if t2>t1: t2=t1
ouvrante=1
NOM=t[t0+1:t2]
if '</'+NOM in t: #.find('</'+NOM)>-1:
balise=BALISES[-1]
if NOM=='pattern' and not PATTERN:
t1=t.find('</'+NOM+'>',t0)+len('</'+NOM+'>')
balise=BALISES[-3]
else:
balise=BALISES[-2]
if balise=='E' or balise=='O':
proprietes=collect_ATTRIBUTS(t[t0:t1+ouvrante])
if 'id' in proprietes:
@ -1532,6 +1547,11 @@ def build_HIERARCHY(t):
# 0.5.8, to remove exec
#--------------------
D=OTHERSSHAPES[proprietes['TYPE']](proprietes)
#elif proprietes['TYPE'] in ['pattern']:
# print 'pattern'
# D=''
CP=[0.0,0.0]
if len(D)>0:
cursor=0
@ -1567,7 +1587,7 @@ def build_HIERARCHY(t):
def scan_FILE(nom):
global CP, curves, SCALE, DEBUG, BOUNDINGBOX, scale_, tagTRANSFORM
global SEPARATE_CURVES, USE_COLORS
global SEPARATE_CURVES, USE_COLORS, PATTERN
dir,name=split(nom)
name=name.split('.')
@ -1583,13 +1603,14 @@ def scan_FILE(nom):
togAS = Blender.Draw.Create(0)
togSP = Blender.Draw.Create(0)
togCOL = Blender.Draw.Create(0)
Pattern= Blender.Draw.Create(0)
block=[\
("Clamp Width 1", togW, "Rescale the import with a Width of one unit"),\
("Clamp Height 1", togH, "Rescale the import with a Heightof one unit"),\
("No Rescaling", togAS, "No rescaling, the result can be very large"),\
("Separate Curves", togSP, "Create an object for each curve, Slower. May manage colors"),\
("Import Colors", togCOL, "try to import color if the path is set as 'fill'. Only With separate option")]
("Import Colors", togCOL, "try to import color if the path is set as 'fill'. Only With separate option"),\
("Import Patterns", Pattern, "import pattern content if it is made with paths.")]
retval = Blender.Draw.PupBlock("Import Options", block)
if togW.val: scale_=1
elif togH.val: scale_=2
@ -1598,6 +1619,8 @@ def scan_FILE(nom):
if togSP.val: SEPARATE_CURVES=1
if togCOL.val and SEPARATE_CURVES : USE_COLORS=1
if Pattern.val : PATTERN =1
t1=Blender.sys.time()
# 0.4.1 : to avoid to use sax and the xml
@ -1625,4 +1648,4 @@ def functionSELECT(nom):
if __name__=='__main__':
Blender.Window.FileSelector (functionSELECT, 'SELECT an .SVG FILE', '*.svg')
Blender.Window.FileSelector (functionSELECT, 'SELECT an .SVG FILE', '*.svg')

@ -527,9 +527,10 @@ def setupAnim(StartFrame, EndFrame, VideoFrameRate):
if VideoFrameRate>120: VideoFrameRate=120
# set up anim panel for them
context=scn.getRenderingContext()
context.startFrame(StartFrame)
context.endFrame(EndFrame)
context.framesPerSec(int(VideoFrameRate))
context.sFrame=StartFrame
context.eFrame=EndFrame
context.fps=int(VideoFrameRate)
Blender.Set("curframe",StartFrame)
Blender.Redraw()
return

@ -708,20 +708,23 @@ def draw_gui():
# Fixed margin. use a margin since 0 margin can be hard to seewhen close to a crt's edge.
margin = 4
# Convenience
FNT_NAME, FNT_HEIGHT = __FONT_SIZES__[__FONT_SIZE__]
# Draw cursor location colour
if __CONSOLE_LINE_OFFSET__ == 0:
cmd2curWidth = Draw.GetStringWidth(cmdBuffer[-1].cmd[:cursor], __FONT_SIZES__[__FONT_SIZE__][0])
cmd2curWidth = Draw.GetStringWidth(cmdBuffer[-1].cmd[:cursor], FNT_NAME)
BGL.glColor3f(0.8, 0.2, 0.2)
if cmd2curWidth == 0:
BGL.glRecti(margin,2,margin+2, __FONT_SIZES__[__FONT_SIZE__][1]+2)
BGL.glRecti(margin,2,margin+2, FNT_HEIGHT+2)
else:
BGL.glRecti(margin + cmd2curWidth-2,2, margin+cmd2curWidth, __FONT_SIZES__[__FONT_SIZE__][1]+2)
BGL.glRecti(margin + cmd2curWidth-2,2, margin+cmd2curWidth, FNT_HEIGHT+2)
BGL.glColor3f(1,1,1)
# Draw the set of cammands to the buffer
consoleLineIdx = __CONSOLE_LINE_OFFSET__ + 1
wrapLineIndex = 0
while consoleLineIdx < len(cmdBuffer) and __CONSOLE_RECT__[3] > (consoleLineIdx - __CONSOLE_LINE_OFFSET__) * __FONT_SIZES__[__FONT_SIZE__][1]:
while consoleLineIdx < len(cmdBuffer) and __CONSOLE_RECT__[3] > (consoleLineIdx - __CONSOLE_LINE_OFFSET__) * FNT_HEIGHT:
if cmdBuffer[-consoleLineIdx].type == 0:
BGL.glColor3f(1, 1, 1)
elif cmdBuffer[-consoleLineIdx].type == 1:
@ -734,53 +737,41 @@ def draw_gui():
BGL.glColor3f(1, 1, 0)
if consoleLineIdx == 1: # user input
BGL.glRasterPos2i(margin, (__FONT_SIZES__[__FONT_SIZE__][1] * (consoleLineIdx-__CONSOLE_LINE_OFFSET__)) - 8)
Draw.Text(cmdBuffer[-consoleLineIdx].cmd, __FONT_SIZES__[__FONT_SIZE__][0])
else:
BGL.glRasterPos2i(margin, (__FONT_SIZES__[__FONT_SIZE__][1] * ((consoleLineIdx-__CONSOLE_LINE_OFFSET__)+wrapLineIndex)) - 8)
Draw.Text(cmdBuffer[-consoleLineIdx].cmd, __FONT_SIZES__[__FONT_SIZE__][0])
# Wrapping is totally slow, can even hang blender - dont do it!
'''
if consoleLineIdx == 1: # NEVER WRAP THE USER INPUT
BGL.glRasterPos2i(margin, (__FONT_SIZES__[__FONT_SIZE__][1] * (consoleLineIdx-__CONSOLE_LINE_OFFSET__)) - 8)
# BUG, LARGE TEXT DOSENT DISPLAY
Draw.Text(cmdBuffer[-consoleLineIdx].cmd, __FONT_SIZES__[__FONT_SIZE__][0])
else: # WRAP?
# LINE WRAP
if Draw.GetStringWidth(cmdBuffer[-consoleLineIdx].cmd, __FONT_SIZES__[__FONT_SIZE__][0]) > __CONSOLE_RECT__[2]:
BGL.glRasterPos2i(margin, (FNT_HEIGHT * (consoleLineIdx-__CONSOLE_LINE_OFFSET__)) - 8)
Draw.Text(cmdBuffer[-consoleLineIdx].cmd, FNT_NAME)
else: # WRAP
lwid = Draw.GetStringWidth(cmdBuffer[-consoleLineIdx].cmd, FNT_NAME)
if margin + lwid > __CONSOLE_RECT__[2]:
wrapLineList = []
copyCmd = [cmdBuffer[-consoleLineIdx].cmd, '']
while copyCmd != ['','']:
while margin + Draw.GetStringWidth(copyCmd[0], __FONT_SIZES__[__FONT_SIZE__][0]) > __CONSOLE_RECT__[2]:
#print copyCmd
copyCmd[1] = '%s%s'% (copyCmd[0][-1], copyCmd[1]) # Add the char on the end
copyCmd[0] = copyCmd[0][:-1]# remove last chat
# Now we have copyCmd[0] at a good length we can print it.
if copyCmd[0] != '':
wrapLineList.append(copyCmd[0])
copyCmd[0]=''
copyCmd = [copyCmd[1], copyCmd[0]]
wtext = cmdBuffer[-consoleLineIdx].cmd
wlimit = len(wtext)
chunksz = int(( __CONSOLE_RECT__[2] - margin ) / (lwid / len(wtext)))
lstart = 0
fsize = FNT_NAME
while lstart < wlimit:
lend = min(lstart+chunksz,wlimit)
ttext = wtext[lstart:lend]
while lend < wlimit and Draw.GetStringWidth(ttext, fsize) + margin < __CONSOLE_RECT__[2]:
lend += 1
ttext = wtext[lstart:lend]
while lend > lstart+1 and Draw.GetStringWidth(ttext, fsize) + margin > __CONSOLE_RECT__[2]:
lend -= 1
ttext = wtext[lstart:lend]
wrapLineList.append(ttext)
lstart = lend
# Now we have a list of lines, draw them (OpenGLs reverse ordering requires this odd change)
wrapLineList.reverse()
for wline in wrapLineList:
BGL.glRasterPos2i(margin, (__FONT_SIZES__[__FONT_SIZE__][1]*((consoleLineIdx-__CONSOLE_LINE_OFFSET__) + wrapLineIndex)) - 8)
Draw.Text(wline, __FONT_SIZES__[__FONT_SIZE__][0])
BGL.glRasterPos2i(margin, (FNT_HEIGHT*((consoleLineIdx-__CONSOLE_LINE_OFFSET__) + wrapLineIndex)) - 8)
Draw.Text(wline, FNT_NAME)
wrapLineIndex += 1
wrapLineIndex-=1 # otherwise we get a silly extra line.
wrapLineIndex-=1 # otherwise we get a silly extra line.
else: # no wrapping.
BGL.glRasterPos2i(margin, (__FONT_SIZES__[__FONT_SIZE__][1] * ((consoleLineIdx-__CONSOLE_LINE_OFFSET__)+wrapLineIndex)) - 8)
Draw.Text(cmdBuffer[-consoleLineIdx].cmd, __FONT_SIZES__[__FONT_SIZE__][0])
'''
BGL.glRasterPos2i(margin, (FNT_HEIGHT * ((consoleLineIdx-__CONSOLE_LINE_OFFSET__)+wrapLineIndex)) - 8)
Draw.Text(cmdBuffer[-consoleLineIdx].cmd, FNT_NAME)
consoleLineIdx += 1
# This recieves the event index, call a function from here depending on the event.
def handle_button_event(evt):

@ -4,7 +4,7 @@
Name: 'Envelope Symmetry'
Blender: 234
Group: 'Animation'
Tooltip: 'Make envelope symetrical'
Tooltip: 'Make envelope symmetrical'
"""
__author__ = "Jonas Petersen"

File diff suppressed because it is too large Load Diff

@ -1,13 +1,13 @@
#!BPY
"""
Name: 'Autodesk FBX (.fbx)...'
Blender: 244
Blender: 249
Group: 'Export'
Tooltip: 'Selection to an ASCII Autodesk FBX '
"""
__author__ = "Campbell Barton"
__url__ = ['www.blender.org', 'blenderartists.org']
__version__ = "1.1"
__version__ = "1.2"
__bpydoc__ = """\
This script is an exporter to the FBX file format.
@ -93,8 +93,8 @@ def copy_images(dest_dir, textures):
dest_dir += Blender.sys.sep
image_paths = set()
for img in textures:
image_paths.add(Blender.sys.expandpath(img.filename))
for tex in textures:
image_paths.add(Blender.sys.expandpath(tex.filename))
# Now copy images
copyCount = 0
@ -157,14 +157,29 @@ def increment_string(t):
# todo - Disallow the name 'Scene' and 'blend_root' - it will bugger things up.
def sane_name(data, dct):
#if not data: return None
name = data.name
if type(data)==tuple: # materials are paired up with images
data, other = data
use_other = True
else:
other = None
use_other = False
if data: name = data.name
else: name = None
orig_name = name
if other:
orig_name_other = other.name
name = '%s #%s' % (name, orig_name_other)
else:
orig_name_other = None
# dont cache, only ever call once for each data type now,
# so as to avoid namespace collision between types - like with objects <-> bones
#try: return dct[name]
#except: pass
orig_name = name
if not name:
name = 'unnamed' # blank string, ASKING FOR TROUBLE!
else:
@ -173,7 +188,11 @@ def sane_name(data, dct):
while name in dct.itervalues(): name = increment_string(name)
dct[orig_name] = name
if use_other: # even if other is None - orig_name_other will be a string or None
dct[orig_name, orig_name_other] = name
else:
dct[orig_name] = name
return name
def sane_obname(data): return sane_name(data, sane_name_mapping_ob)
@ -511,7 +530,7 @@ def write(filename, batch_objects = None, \
if time:
curtime = time.localtime()[0:6]
else:
curtime = [0,0,0,0,0,0]
curtime = (0,0,0,0,0,0)
#
file.write(\
'''FBXHeaderExtension: {
@ -983,7 +1002,7 @@ def write(filename, batch_objects = None, \
#eDIRECTIONAL
#eSPOT
light_type = light.type
if light_type > 3: light_type = 0
if light_type > 2: light_type = 1 # hemi and area lights become directional
mode = light.mode
if mode & Blender.Lamp.Modes.RayShadow or mode & Blender.Lamp.Modes.Shadows:
@ -1333,17 +1352,20 @@ def write(filename, batch_objects = None, \
me = my_mesh.blenData
# if there are non NULL materials on this mesh
if [mat for mat in my_mesh.blenMaterials if mat]: do_materials = True
else: do_materials = False
if my_mesh.blenMaterials: do_materials = True
else: do_materials = False
if my_mesh.blenTextures: do_textures = True
else: do_textures = False
else: do_textures = False
do_uvs = me.faceUV
file.write('\n\tModel: "Model::%s", "Mesh" {' % my_mesh.fbxName)
file.write('\n\t\tVersion: 232') # newline is added in write_object_props
write_object_props(my_mesh.blenObject, None, my_mesh.parRelMatrix())
poseMatrix = write_object_props(my_mesh.blenObject, None, my_mesh.parRelMatrix())[3]
pose_items.append((my_mesh.fbxName, poseMatrix))
file.write('\n\t\t}')
file.write('\n\t\tMultiLayer: 0')
@ -1385,22 +1407,18 @@ def write(filename, batch_objects = None, \
else: file.write(',%i,%i,%i,%i' % fi )
i+=1
ed_val = [None, None]
LOOSE = Blender.Mesh.EdgeFlags.LOOSE
file.write('\n\t\tEdges: ')
i=-1
for ed in me.edges:
if ed.flag & LOOSE:
ed_val[0] = ed.v1.index
ed_val[1] = -(ed.v2.index+1)
if i==-1:
file.write('%i,%i' % tuple(ed_val) )
file.write('%i,%i' % (ed.v1.index, ed.v2.index))
i=0
else:
if i==13:
file.write('\n\t\t')
i=0
file.write(',%i,%i' % tuple(ed_val) )
file.write(',%i,%i' % (ed.v1.index, ed.v2.index))
i+=1
del LOOSE
file.write('\n\t\tGeometryVersion: 124')
@ -1423,6 +1441,51 @@ def write(filename, batch_objects = None, \
i+=1
file.write('\n\t\t}')
# Write Face Smoothing
file.write('''
LayerElementSmoothing: 0 {
Version: 102
Name: ""
MappingInformationType: "ByPolygon"
ReferenceInformationType: "Direct"
Smoothing: ''')
i=-1
for f in me.faces:
if i==-1:
file.write('%i' % f.smooth); i=0
else:
if i==54:
file.write('\n '); i=0
file.write(',%i' % f.smooth)
i+=1
file.write('\n\t\t}')
# Write Edge Smoothing
file.write('''
LayerElementSmoothing: 0 {
Version: 101
Name: ""
MappingInformationType: "ByEdge"
ReferenceInformationType: "Direct"
Smoothing: ''')
SHARP = Blender.Mesh.EdgeFlags.SHARP
i=-1
for ed in me.edges:
if i==-1:
file.write('%i' % ((ed.flag&SHARP)!=0)); i=0
else:
if i==54:
file.write('\n '); i=0
file.write(',%i' % ((ed.flag&SHARP)!=0))
i+=1
file.write('\n\t\t}')
del SHARP
# Write VertexColor Layers
# note, no programs seem to use this info :/
collayers = []
@ -1475,7 +1538,7 @@ def write(filename, batch_objects = None, \
# Write UV and texture layers.
uvlayers = []
if me.faceUV:
if do_uvs:
uvlayers = me.getUVLayerNames()
uvlayer_orig = me.activeUVLayer
for uvindex, uvlayer in enumerate(uvlayers):
@ -1538,13 +1601,13 @@ def write(filename, batch_objects = None, \
if len(my_mesh.blenTextures) == 1:
file.write('0')
else:
#texture_mapping_local = {None:0}
texture_mapping_local = {None:-1}
i = 0 # 1 for dummy
for tex in my_mesh.blenTextures:
texture_mapping_local[tex] = i
i+=1
if tex: # None is set above
texture_mapping_local[tex] = i
i+=1
i=-1
for f in me.faces:
@ -1594,32 +1657,32 @@ def write(filename, batch_objects = None, \
file.write('0')
else:
# Build a material mapping for this
#material_mapping_local = [0] * 16 # local-index : global index.
material_mapping_local = [-1] * 16 # local-index : global index.
i= 0 # 1
for j, mat in enumerate(my_mesh.blenMaterials):
if mat:
material_mapping_local[j] = i
i+=1
# else leave as -1
material_mapping_local = {} # local-mat & tex : global index.
for j, mat_tex_pair in enumerate(my_mesh.blenMaterials):
material_mapping_local[mat_tex_pair] = j
len_material_mapping_local = len(material_mapping_local)
mats = my_mesh.blenMaterialList
i=-1
for f in me.faces:
f_mat = f.mat
if f_mat >= len_material_mapping_local:
f_mat = 0
try: mat = mats[f.mat]
except:mat = None
if do_uvs: tex = f.image # WARNING - MULTI UV LAYER IMAGES NOT SUPPORTED :/
else: tex = None
if i==-1:
i=0
file.write( '%s' % (material_mapping_local[f_mat]))
file.write( '%s' % (material_mapping_local[mat, tex])) # None for mat or tex is ok
else:
if i==55:
file.write('\n\t\t\t\t')
i=0
file.write(',%s' % (material_mapping_local[f_mat]))
file.write(',%s' % (material_mapping_local[mat, tex]))
i+=1
file.write('\n\t\t}')
@ -1654,7 +1717,7 @@ def write(filename, batch_objects = None, \
TypedIndex: 0
}''')
if me.faceUV:
if do_uvs: # same as me.faceUV
file.write('''
LayerElement: {
Type: "LayerElementUV"
@ -1736,8 +1799,8 @@ def write(filename, batch_objects = None, \
ob_all_typegroups = [ob_meshes, ob_lights, ob_cameras, ob_arms, ob_null]
groups = [] # blender groups, only add ones that have objects in the selections
materials = {}
textures = {}
materials = {} # (mat, image) keys, should be a set()
textures = {} # should be a set()
tmp_ob_type = ob_type = None # incase no objects are exported, so as not to raise an error
@ -1837,30 +1900,34 @@ def write(filename, batch_objects = None, \
if EXP_MESH_HQ_NORMALS:
BPyMesh.meshCalcNormals(me) # high quality normals nice for realtime engines.
for mat in mats:
# 2.44 use mat.lib too for uniqueness
if mat: materials[mat] = mat
texture_mapping_local = {}
material_mapping_local = {}
if me.faceUV:
uvlayer_orig = me.activeUVLayer
for uvlayer in me.getUVLayerNames():
me.activeUVLayer = uvlayer
for f in me.faces:
img = f.image
textures[img] = texture_mapping_local[img] = img
tex = f.image
textures[tex] = texture_mapping_local[tex] = None
try: mat = mats[f.mat]
except: mat = None
materials[mat, tex] = material_mapping_local[mat, tex] = None # should use sets, wait for blender 2.5
me.activeUVLayer = uvlayer_orig
else:
for mat in mats:
# 2.44 use mat.lib too for uniqueness
materials[mat, None] = material_mapping_local[mat, None] = None
else:
materials[None, None] = None
if EXP_ARMATURE:
armob = BPyObject.getObjectArmature(ob)
blenParentBoneName = None
# Note - Fixed in BPyObject but for now just copy the function because testers wont have up to date modukes,
# TODO - remove this for 2.45 release since getObjectArmature has been fixed
if (not armob) and ob.parent and ob.parent.type == 'Armature' and ob.parentType == Blender.Object.ParentTypes.ARMATURE:
armob = ob.parent
# parent bone - special case
if (not armob) and ob.parent and ob.parent.type == 'Armature' and ob.parentType == Blender.Object.ParentTypes.BONE:
armob = ob.parent
@ -1876,8 +1943,9 @@ def write(filename, batch_objects = None, \
my_mesh = my_object_generic(ob, mtx)
my_mesh.blenData = me
my_mesh.origData = origData
my_mesh.blenMaterials = mats
my_mesh.blenTextures = texture_mapping_local.values()
my_mesh.blenMaterials = material_mapping_local.keys()
my_mesh.blenMaterialList = mats
my_mesh.blenTextures = texture_mapping_local.keys()
# if only 1 null texture then empty the list
if len(my_mesh.blenTextures) == 1 and my_mesh.blenTextures[0] == None:
@ -1996,8 +2064,8 @@ def write(filename, batch_objects = None, \
# Finished finding groups we use
materials = [(sane_matname(mat), mat) for mat in materials.itervalues() if mat]
textures = [(sane_texname(img), img) for img in textures.itervalues() if img]
materials = [(sane_matname(mat_tex_pair), mat_tex_pair) for mat_tex_pair in materials.iterkeys()]
textures = [(sane_texname(tex), tex) for tex in textures.iterkeys() if tex]
materials.sort() # sort by name
textures.sort()
@ -2126,8 +2194,8 @@ Objects: {''')
write_camera_default()
for matname, mat in materials:
write_material(matname, mat)
for matname, (mat, tex) in materials:
write_material(matname, mat) # We only need to have a material per image pair, but no need to write any image info into the material (dumb fbx standard)
# each texture uses a video, odd
for texname, tex in textures:
@ -2247,7 +2315,7 @@ Relations: {''')
Model: "Model::Camera Switcher", "CameraSwitcher" {
}''')
for matname, mat in materials:
for matname, (mat, tex) in materials:
file.write('\n\tMaterial: "Material::%s", "" {\n\t}' % matname)
if textures:
@ -2299,9 +2367,14 @@ Connections: {''')
if materials:
for my_mesh in ob_meshes:
# Connect all materials to all objects, not good form but ok for now.
for mat in my_mesh.blenMaterials:
if mat:
file.write('\n\tConnect: "OO", "Material::%s", "Model::%s"' % (sane_name_mapping_mat[mat.name], my_mesh.fbxName))
for mat, tex in my_mesh.blenMaterials:
if mat: mat_name = mat.name
else: mat_name = None
if tex: tex_name = tex.name
else: tex_name = None
file.write('\n\tConnect: "OO", "Material::%s", "Model::%s"' % (sane_name_mapping_mat[mat_name, tex_name], my_mesh.fbxName))
if textures:
for my_mesh in ob_meshes:
@ -2519,8 +2592,18 @@ Takes: {''')
for TX_LAYER, TX_CHAN in enumerate('TRS'): # transform, rotate, scale
if TX_CHAN=='T': context_bone_anim_vecs = [mtx[0].translationPart() for mtx in context_bone_anim_mats]
elif TX_CHAN=='R': context_bone_anim_vecs = [mtx[1].toEuler() for mtx in context_bone_anim_mats]
else: context_bone_anim_vecs = [mtx[0].scalePart() for mtx in context_bone_anim_mats]
elif TX_CHAN=='S': context_bone_anim_vecs = [mtx[0].scalePart() for mtx in context_bone_anim_mats]
elif TX_CHAN=='R':
# Was....
# elif TX_CHAN=='R': context_bone_anim_vecs = [mtx[1].toEuler() for mtx in context_bone_anim_mats]
#
# ...but we need to use the previous euler for compatible conversion.
context_bone_anim_vecs = []
prev_eul = None
for mtx in context_bone_anim_mats:
if prev_eul: prev_eul = mtx[1].toEuler(prev_eul)
else: prev_eul = mtx[1].toEuler()
context_bone_anim_vecs.append(prev_eul)
file.write('\n\t\t\t\tChannel: "%s" {' % TX_CHAN) # translation
@ -2539,10 +2622,9 @@ Takes: {''')
if frame!=act_start:
file.write(',')
# Curve types are
# Curve types are 'C,n' for constant, 'L' for linear
# C,n is for bezier? - linear is best for now so we can do simple keyframe removal
file.write('\n\t\t\t\t\t\t\t%i,%.15f,C,n' % (fbx_time(frame-1), context_bone_anim_vecs[frame-act_start][i] ))
#file.write('\n\t\t\t\t\t\t\t%i,%.15f,L' % (fbx_time(frame-1), context_bone_anim_vecs[frame-act_start][i] ))
file.write('\n\t\t\t\t\t\t\t%i,%.15f,L' % (fbx_time(frame-1), context_bone_anim_vecs[frame-act_start][i] ))
frame+=1
else:
# remove unneeded keys, j is the frame, needed when some frames are removed.
@ -2550,11 +2632,32 @@ Takes: {''')
# last frame to fisrt frame, missing 1 frame on either side.
# removeing in a backwards loop is faster
for j in xrange( (act_end-act_start)-1, 0, -1 ):
# Is this key reduenant?
if abs(context_bone_anim_keys[j][0] - context_bone_anim_keys[j-1][0]) < ANIM_OPTIMIZE_PRECISSION_FLOAT and\
abs(context_bone_anim_keys[j][0] - context_bone_anim_keys[j+1][0]) < ANIM_OPTIMIZE_PRECISSION_FLOAT:
#for j in xrange( (act_end-act_start)-1, 0, -1 ):
# j = (act_end-act_start)-1
j = len(context_bone_anim_keys)-2
while j > 0 and len(context_bone_anim_keys) > 2:
# print j, len(context_bone_anim_keys)
# Is this key the same as the ones next to it?
# co-linear horizontal...
if abs(context_bone_anim_keys[j][0] - context_bone_anim_keys[j-1][0]) < ANIM_OPTIMIZE_PRECISSION_FLOAT and\
abs(context_bone_anim_keys[j][0] - context_bone_anim_keys[j+1][0]) < ANIM_OPTIMIZE_PRECISSION_FLOAT:
del context_bone_anim_keys[j]
else:
frame_range = float(context_bone_anim_keys[j+1][1] - context_bone_anim_keys[j-1][1])
frame_range_fac1 = (context_bone_anim_keys[j+1][1] - context_bone_anim_keys[j][1]) / frame_range
frame_range_fac2 = 1.0 - frame_range_fac1
if abs(((context_bone_anim_keys[j-1][0]*frame_range_fac1 + context_bone_anim_keys[j+1][0]*frame_range_fac2)) - context_bone_anim_keys[j][0]) < ANIM_OPTIMIZE_PRECISSION_FLOAT:
del context_bone_anim_keys[j]
else:
j-=1
# keep the index below the list length
if j > len(context_bone_anim_keys)-2:
j = len(context_bone_anim_keys)-2
if len(context_bone_anim_keys) == 2 and context_bone_anim_keys[0][0] == context_bone_anim_keys[1][0]:
# This axis has no moton, its okay to skip KeyCount and Keys in this case
@ -2567,8 +2670,7 @@ Takes: {''')
if frame != context_bone_anim_keys[0][1]: # not the first
file.write(',')
# frame is alredy one less then blenders frame
file.write('\n\t\t\t\t\t\t\t%i,%.15f,C,n' % (fbx_time(frame), val ))
#file.write('\n\t\t\t\t\t\t\t%i,%.15f,L' % (fbx_time(frame), val ))
file.write('\n\t\t\t\t\t\t\t%i,%.15f,L' % (fbx_time(frame), val ))
if i==0: file.write('\n\t\t\t\t\t\tColor: 1,0,0')
elif i==1: file.write('\n\t\t\t\t\t\tColor: 0,1,0')
@ -2734,15 +2836,16 @@ def fbx_ui_exit(e,v):
GLOBALS['EVENT'] = e
def do_help(e,v):
url = 'http://wiki.blender.org/index.php/Scripts/Manual/Export/autodesk_fbx'
print 'Trying to open web browser with documentation at this address...'
print '\t' + url
try:
import webbrowser
webbrowser.open(url)
except:
print '...could not open a browser window.'
url = 'http://wiki.blender.org/index.php/Scripts/Manual/Export/autodesk_fbx'
print 'Trying to open web browser with documentation at this address...'
print '\t' + url
try:
import webbrowser
webbrowser.open(url)
except:
Blender.Draw.PupMenu("Error%t|Opening a webbrowser requires a full python installation")
print '...could not open a browser window.'
@ -2846,7 +2949,7 @@ def fbx_ui():
Draw.BeginAlign()
GLOBALS['ANIM_OPTIMIZE'] = Draw.Toggle('Optimize Keyframes', EVENT_REDRAW, x+20, y+0, 160, 20, GLOBALS['ANIM_OPTIMIZE'].val, 'Remove double keyframes', do_redraw)
if GLOBALS['ANIM_OPTIMIZE'].val:
GLOBALS['ANIM_OPTIMIZE_PRECISSION'] = Draw.Number('Precission: ', EVENT_NONE, x+180, y+0, 160, 20, GLOBALS['ANIM_OPTIMIZE_PRECISSION'].val, 3, 16, 'Tolerence for comparing double keyframes (higher for greater accuracy)')
GLOBALS['ANIM_OPTIMIZE_PRECISSION'] = Draw.Number('Precission: ', EVENT_NONE, x+180, y+0, 160, 20, GLOBALS['ANIM_OPTIMIZE_PRECISSION'].val, 1, 16, 'Tolerence for comparing double keyframes (higher for greater accuracy)')
Draw.EndAlign()
Draw.BeginAlign()
@ -2924,7 +3027,7 @@ def write_ui():
# animation opts
GLOBALS['ANIM_ENABLE'] = Draw.Create(1)
GLOBALS['ANIM_OPTIMIZE'] = Draw.Create(1)
GLOBALS['ANIM_OPTIMIZE_PRECISSION'] = Draw.Create(6) # decimal places
GLOBALS['ANIM_OPTIMIZE_PRECISSION'] = Draw.Create(4) # decimal places
GLOBALS['ANIM_ACTION_ALL'] = [Draw.Create(0), Draw.Create(1)] # not just the current action
# batch export options

@ -7,9 +7,9 @@ Group: 'Export'
Tooltip: 'Save a Wavefront OBJ File'
"""
__author__ = "Campbell Barton, Jiri Hnidek"
__author__ = "Campbell Barton, Jiri Hnidek, Paolo Ciccone"
__url__ = ['http://wiki.blender.org/index.php/Scripts/Manual/Export/wavefront_obj', 'www.blender.org', 'blenderartists.org']
__version__ = "1.2"
__version__ = "1.21"
__bpydoc__ = """\
This script is an exporter to OBJ file format.
@ -181,11 +181,89 @@ def copy_images(dest_dir):
copyCount+=1
print '\tCopied %d images' % copyCount
def test_nurbs_compat(ob):
if ob.type != 'Curve':
return False
for nu in ob.data:
if (not nu.knotsV) and nu.type != 1: # not a surface and not bezier
return True
return False
def write_nurb(file, ob, ob_mat):
tot_verts = 0
cu = ob.data
# use negative indices
Vector = Blender.Mathutils.Vector
for nu in cu:
if nu.type==0: DEG_ORDER_U = 1
else: DEG_ORDER_U = nu.orderU-1 # Tested to be correct
if nu.type==1:
print "\tWarning, bezier curve:", ob.name, "only poly and nurbs curves supported"
continue
if nu.knotsV:
print "\tWarning, surface:", ob.name, "only poly and nurbs curves supported"
continue
if len(nu) <= DEG_ORDER_U:
print "\tWarning, orderU is lower then vert count, skipping:", ob.name
continue
pt_num = 0
do_closed = (nu.flagU & 1)
do_endpoints = (do_closed==0) and (nu.flagU & 2)
for pt in nu:
pt = Vector(pt[0], pt[1], pt[2]) * ob_mat
file.write('v %.6f %.6f %.6f\n' % (pt[0], pt[1], pt[2]))
pt_num += 1
tot_verts += pt_num
file.write('g %s\n' % (fixName(ob.name))) # fixName(ob.getData(1)) could use the data name too
file.write('cstype bspline\n') # not ideal, hard coded
file.write('deg %d\n' % DEG_ORDER_U) # not used for curves but most files have it still
curve_ls = [-(i+1) for i in xrange(pt_num)]
# 'curv' keyword
if do_closed:
if DEG_ORDER_U == 1:
pt_num += 1
curve_ls.append(-1)
else:
pt_num += DEG_ORDER_U
curve_ls = curve_ls + curve_ls[0:DEG_ORDER_U]
file.write('curv 0.0 1.0 %s\n' % (' '.join( [str(i) for i in curve_ls] ))) # Blender has no U and V values for the curve
# 'parm' keyword
tot_parm = (DEG_ORDER_U + 1) + pt_num
tot_parm_div = float(tot_parm-1)
parm_ls = [(i/tot_parm_div) for i in xrange(tot_parm)]
if do_endpoints: # end points, force param
for i in xrange(DEG_ORDER_U+1):
parm_ls[i] = 0.0
parm_ls[-(1+i)] = 1.0
file.write('parm u %s\n' % ' '.join( [str(i) for i in parm_ls] ))
file.write('end\n')
return tot_verts
def write(filename, objects,\
EXPORT_TRI=False, EXPORT_EDGES=False, EXPORT_NORMALS=False, EXPORT_NORMALS_HQ=False,\
EXPORT_UV=True, EXPORT_MTL=True, EXPORT_COPY_IMAGES=False,\
EXPORT_APPLY_MODIFIERS=True, EXPORT_ROTX90=True, EXPORT_BLEN_OBS=True,\
EXPORT_GROUP_BY_OB=False, EXPORT_GROUP_BY_MAT=False, EXPORT_KEEP_VERT_ORDER=False):
EXPORT_GROUP_BY_OB=False, EXPORT_GROUP_BY_MAT=False, EXPORT_KEEP_VERT_ORDER=False,\
EXPORT_POLYGROUPS=False, EXPORT_CURVE_AS_NURBS=True):
'''
Basic write function. The context and options must be alredy set
This can be accessed externaly
@ -199,6 +277,29 @@ EXPORT_GROUP_BY_OB=False, EXPORT_GROUP_BY_MAT=False, EXPORT_KEEP_VERT_ORDER=Fal
def veckey2d(v):
return round(v.x, 6), round(v.y, 6)
def findVertexGroupName(face, vWeightMap):
"""
Searches the vertexDict to see what groups is assigned to a given face.
We use a frequency system in order to sort out the name because a given vetex can
belong to two or more groups at the same time. To find the right name for the face
we list all the possible vertex group names with their frequency and then sort by
frequency in descend order. The top element is the one shared by the highest number
of vertices is the face's group
"""
weightDict = {}
for vert in face:
vWeights = vWeightMap[vert.index]
for vGroupName, weight in vWeights:
weightDict[vGroupName] = weightDict.get(vGroupName, 0) + weight
if weightDict:
alist = [(weight,vGroupName) for vGroupName, weight in weightDict.iteritems()] # sort least to greatest amount of weight
alist.sort()
return(alist[-1][1]) # highest value last
else:
return '(null)'
print 'OBJ Export path: "%s"' % filename
temp_mesh_name = '~tmp-mesh'
@ -239,12 +340,23 @@ EXPORT_GROUP_BY_OB=False, EXPORT_GROUP_BY_MAT=False, EXPORT_KEEP_VERT_ORDER=Fal
globalNormals = {}
# Get all meshs
# Get all meshes
for ob_main in objects:
for ob, ob_mat in BPyObject.getDerivedObjects(ob_main):
# Nurbs curve support
if EXPORT_CURVE_AS_NURBS and test_nurbs_compat(ob):
if EXPORT_ROTX90:
ob_mat = ob_mat * mat_xrot90
totverts += write_nurb(file, ob, ob_mat)
continue
# end nurbs
# Will work for non meshes now! :)
# getMeshFromObject(ob, container_mesh=None, apply_modifiers=True, vgroups=True, scn=None)
me= BPyMesh.getMeshFromObject(ob, containerMesh, EXPORT_APPLY_MODIFIERS, False, scn)
me= BPyMesh.getMeshFromObject(ob, containerMesh, EXPORT_APPLY_MODIFIERS, EXPORT_POLYGROUPS, scn)
if not me:
continue
@ -397,6 +509,17 @@ EXPORT_GROUP_BY_OB=False, EXPORT_GROUP_BY_MAT=False, EXPORT_KEEP_VERT_ORDER=Fal
if not faceuv:
f_image = None
if EXPORT_POLYGROUPS:
# Retrieve the list of vertex groups
vertGroupNames = me.getVertGroupNames()
currentVGroup = ''
# Create a dictionary keyed by face id and listing, for each vertex, the vertex groups it belongs to
vgroupsMap = [[] for _i in xrange(len(me.verts))]
for vertexGroupName in vertGroupNames:
for vIdx, vWeight in me.getVertsFromGroup(vertexGroupName, 1):
vgroupsMap[vIdx].append((vertexGroupName, vWeight))
for f_index, f in enumerate(faces):
f_v= f.v
f_smooth= f.smooth
@ -411,9 +534,18 @@ EXPORT_GROUP_BY_OB=False, EXPORT_GROUP_BY_MAT=False, EXPORT_KEEP_VERT_ORDER=Fal
else:
key = materialNames[f_mat], None # No image, use None instead.
# Write the vertex group
if EXPORT_POLYGROUPS:
if vertGroupNames:
# find what vertext group the face belongs to
theVGroup = findVertexGroupName(f,vgroupsMap)
if theVGroup != currentVGroup:
currentVGroup = theVGroup
file.write('g %s\n' % theVGroup)
# CHECK FOR CONTEXT SWITCH
if key == contextMat:
pass # Context alredy switched, dont do anythoing
pass # Context alredy switched, dont do anything
else:
if key[0] == None and key[1] == None:
# Write a null material, since we know the context has changed.
@ -438,6 +570,7 @@ EXPORT_GROUP_BY_OB=False, EXPORT_GROUP_BY_MAT=False, EXPORT_KEEP_VERT_ORDER=Fal
if EXPORT_GROUP_BY_MAT:
file.write('g %s_%s_%s\n' % (fixName(ob.name), fixName(ob.getData(1)), mat_data[0]) ) # can be mat_image or (null)
file.write('usemtl %s\n' % mat_data[0]) # can be mat_image or (null)
contextMat = key
@ -539,7 +672,8 @@ def write_ui(filename):
EXPORT_NORMALS, EXPORT_NORMALS_HQ, EXPORT_UV,\
EXPORT_MTL, EXPORT_SEL_ONLY, EXPORT_ALL_SCENES,\
EXPORT_ANIMATION, EXPORT_COPY_IMAGES, EXPORT_BLEN_OBS,\
EXPORT_GROUP_BY_OB, EXPORT_GROUP_BY_MAT, EXPORT_KEEP_VERT_ORDER
EXPORT_GROUP_BY_OB, EXPORT_GROUP_BY_MAT, EXPORT_KEEP_VERT_ORDER,\
EXPORT_POLYGROUPS, EXPORT_CURVE_AS_NURBS
EXPORT_APPLY_MODIFIERS = Draw.Create(0)
EXPORT_ROTX90 = Draw.Create(1)
@ -557,6 +691,9 @@ def write_ui(filename):
EXPORT_GROUP_BY_OB = Draw.Create(0)
EXPORT_GROUP_BY_MAT = Draw.Create(0)
EXPORT_KEEP_VERT_ORDER = Draw.Create(1)
EXPORT_POLYGROUPS = Draw.Create(0)
EXPORT_CURVE_AS_NURBS = Draw.Create(1)
# Old UI
'''
@ -607,7 +744,7 @@ def write_ui(filename):
GLOBALS['EVENT'] = e
def do_split(e,v):
global EXPORT_BLEN_OBS, EXPORT_GROUP_BY_OB, EXPORT_GROUP_BY_MAT, EXPORT_APPLY_MODIFIERS, KEEP_VERT_ORDER
global EXPORT_BLEN_OBS, EXPORT_GROUP_BY_OB, EXPORT_GROUP_BY_MAT, EXPORT_APPLY_MODIFIERS, KEEP_VERT_ORDER, EXPORT_POLYGROUPS
if EXPORT_BLEN_OBS.val or EXPORT_GROUP_BY_OB.val or EXPORT_GROUP_BY_MAT.val or EXPORT_APPLY_MODIFIERS.val:
EXPORT_KEEP_VERT_ORDER.val = 0
else:
@ -621,6 +758,7 @@ def write_ui(filename):
if not (EXPORT_BLEN_OBS.val or EXPORT_GROUP_BY_OB.val or EXPORT_GROUP_BY_MAT.val or EXPORT_APPLY_MODIFIERS.val):
EXPORT_KEEP_VERT_ORDER.val = 1
def do_help(e,v):
url = __url__[0]
print 'Trying to open web browser with documentation at this address...'
@ -637,43 +775,47 @@ def write_ui(filename):
# Center based on overall pup size
ui_x -= 165
ui_y -= 110
ui_y -= 140
global EXPORT_APPLY_MODIFIERS, EXPORT_ROTX90, EXPORT_TRI, EXPORT_EDGES,\
EXPORT_NORMALS, EXPORT_NORMALS_HQ, EXPORT_UV,\
EXPORT_MTL, EXPORT_SEL_ONLY, EXPORT_ALL_SCENES,\
EXPORT_ANIMATION, EXPORT_COPY_IMAGES, EXPORT_BLEN_OBS,\
EXPORT_GROUP_BY_OB, EXPORT_GROUP_BY_MAT, EXPORT_KEEP_VERT_ORDER
EXPORT_GROUP_BY_OB, EXPORT_GROUP_BY_MAT, EXPORT_KEEP_VERT_ORDER,\
EXPORT_POLYGROUPS, EXPORT_CURVE_AS_NURBS
Draw.Label('Context...', ui_x+9, ui_y+209, 220, 20)
Draw.Label('Context...', ui_x+9, ui_y+239, 220, 20)
Draw.BeginAlign()
EXPORT_SEL_ONLY = Draw.Toggle('Selection Only', EVENT_NONE, ui_x+9, ui_y+189, 110, 20, EXPORT_SEL_ONLY.val, 'Only export objects in visible selection. Else export whole scene.')
EXPORT_ALL_SCENES = Draw.Toggle('All Scenes', EVENT_NONE, ui_x+119, ui_y+189, 110, 20, EXPORT_ALL_SCENES.val, 'Each scene as a separate OBJ file.')
EXPORT_ANIMATION = Draw.Toggle('Animation', EVENT_NONE, ui_x+229, ui_y+189, 110, 20, EXPORT_ANIMATION.val, 'Each frame as a numbered OBJ file.')
EXPORT_SEL_ONLY = Draw.Toggle('Selection Only', EVENT_NONE, ui_x+9, ui_y+219, 110, 20, EXPORT_SEL_ONLY.val, 'Only export objects in visible selection. Else export whole scene.')
EXPORT_ALL_SCENES = Draw.Toggle('All Scenes', EVENT_NONE, ui_x+119, ui_y+219, 110, 20, EXPORT_ALL_SCENES.val, 'Each scene as a separate OBJ file.')
EXPORT_ANIMATION = Draw.Toggle('Animation', EVENT_NONE, ui_x+229, ui_y+219, 110, 20, EXPORT_ANIMATION.val, 'Each frame as a numbered OBJ file.')
Draw.EndAlign()
Draw.Label('Output Options...', ui_x+9, ui_y+159, 220, 20)
Draw.Label('Output Options...', ui_x+9, ui_y+189, 220, 20)
Draw.BeginAlign()
EXPORT_APPLY_MODIFIERS = Draw.Toggle('Apply Modifiers', EVENT_REDRAW, ui_x+9, ui_y+140, 110, 20, EXPORT_APPLY_MODIFIERS.val, 'Use transformed mesh data from each object. May break vert order for morph targets.', do_split)
EXPORT_ROTX90 = Draw.Toggle('Rotate X90', EVENT_NONE, ui_x+119, ui_y+140, 110, 20, EXPORT_ROTX90.val, 'Rotate on export so Blenders UP is translated into OBJs UP')
EXPORT_COPY_IMAGES = Draw.Toggle('Copy Images', EVENT_NONE, ui_x+229, ui_y+140, 110, 20, EXPORT_COPY_IMAGES.val, 'Copy image files to the export directory, never overwrite.')
EXPORT_APPLY_MODIFIERS = Draw.Toggle('Apply Modifiers', EVENT_REDRAW, ui_x+9, ui_y+170, 110, 20, EXPORT_APPLY_MODIFIERS.val, 'Use transformed mesh data from each object. May break vert order for morph targets.', do_split)
EXPORT_ROTX90 = Draw.Toggle('Rotate X90', EVENT_NONE, ui_x+119, ui_y+170, 110, 20, EXPORT_ROTX90.val, 'Rotate on export so Blenders UP is translated into OBJs UP')
EXPORT_COPY_IMAGES = Draw.Toggle('Copy Images', EVENT_NONE, ui_x+229, ui_y+170, 110, 20, EXPORT_COPY_IMAGES.val, 'Copy image files to the export directory, never overwrite.')
Draw.EndAlign()
Draw.Label('Export...', ui_x+9, ui_y+109, 220, 20)
Draw.Label('Export...', ui_x+9, ui_y+139, 220, 20)
Draw.BeginAlign()
EXPORT_EDGES = Draw.Toggle('Edges', EVENT_NONE, ui_x+9, ui_y+90, 50, 20, EXPORT_EDGES.val, 'Edges not connected to faces.')
EXPORT_TRI = Draw.Toggle('Triangulate', EVENT_NONE, ui_x+59, ui_y+90, 70, 20, EXPORT_TRI.val, 'Triangulate quads.')
EXPORT_EDGES = Draw.Toggle('Edges', EVENT_NONE, ui_x+9, ui_y+120, 50, 20, EXPORT_EDGES.val, 'Edges not connected to faces.')
EXPORT_TRI = Draw.Toggle('Triangulate', EVENT_NONE, ui_x+59, ui_y+120, 70, 20, EXPORT_TRI.val, 'Triangulate quads.')
Draw.EndAlign()
Draw.BeginAlign()
EXPORT_MTL = Draw.Toggle('Materials', EVENT_NONE, ui_x+139, ui_y+90, 70, 20, EXPORT_MTL.val, 'Write a separate MTL file with the OBJ.')
EXPORT_UV = Draw.Toggle('UVs', EVENT_NONE, ui_x+209, ui_y+90, 31, 20, EXPORT_UV.val, 'Export texface UV coords.')
EXPORT_MTL = Draw.Toggle('Materials', EVENT_NONE, ui_x+139, ui_y+120, 70, 20, EXPORT_MTL.val, 'Write a separate MTL file with the OBJ.')
EXPORT_UV = Draw.Toggle('UVs', EVENT_NONE, ui_x+209, ui_y+120, 31, 20, EXPORT_UV.val, 'Export texface UV coords.')
Draw.EndAlign()
Draw.BeginAlign()
EXPORT_NORMALS = Draw.Toggle('Normals', EVENT_NONE, ui_x+250, ui_y+90, 59, 20, EXPORT_NORMALS.val, 'Export vertex normal data (Ignored on import).')
EXPORT_NORMALS_HQ = Draw.Toggle('HQ', EVENT_NONE, ui_x+309, ui_y+90, 31, 20, EXPORT_NORMALS_HQ.val, 'Calculate high quality normals for rendering.')
EXPORT_NORMALS = Draw.Toggle('Normals', EVENT_NONE, ui_x+250, ui_y+120, 59, 20, EXPORT_NORMALS.val, 'Export vertex normal data (Ignored on import).')
EXPORT_NORMALS_HQ = Draw.Toggle('HQ', EVENT_NONE, ui_x+309, ui_y+120, 31, 20, EXPORT_NORMALS_HQ.val, 'Calculate high quality normals for rendering.')
Draw.EndAlign()
EXPORT_POLYGROUPS = Draw.Toggle('Polygroups', EVENT_REDRAW, ui_x+9, ui_y+95, 120, 20, EXPORT_POLYGROUPS.val, 'Export vertex groups as OBJ groups (one group per face approximation).')
EXPORT_CURVE_AS_NURBS = Draw.Toggle('Nurbs', EVENT_NONE, ui_x+139, ui_y+95, 100, 20, EXPORT_CURVE_AS_NURBS.val, 'Export 3D nurbs curves and polylines as OBJ curves, (bezier not supported).')
Draw.Label('Blender Objects as OBJ:', ui_x+9, ui_y+59, 220, 20)
@ -727,7 +869,8 @@ def write_ui(filename):
EXPORT_GROUP_BY_OB = EXPORT_GROUP_BY_OB.val
EXPORT_GROUP_BY_MAT = EXPORT_GROUP_BY_MAT.val
EXPORT_KEEP_VERT_ORDER = EXPORT_KEEP_VERT_ORDER.val
EXPORT_POLYGROUPS = EXPORT_POLYGROUPS.val
EXPORT_CURVE_AS_NURBS = EXPORT_CURVE_AS_NURBS.val
base_name, ext = splitExt(filename)
@ -776,7 +919,8 @@ def write_ui(filename):
EXPORT_NORMALS_HQ, EXPORT_UV, EXPORT_MTL,\
EXPORT_COPY_IMAGES, EXPORT_APPLY_MODIFIERS,\
EXPORT_ROTX90, EXPORT_BLEN_OBS,\
EXPORT_GROUP_BY_OB, EXPORT_GROUP_BY_MAT, EXPORT_KEEP_VERT_ORDER)
EXPORT_GROUP_BY_OB, EXPORT_GROUP_BY_MAT, EXPORT_KEEP_VERT_ORDER,\
EXPORT_POLYGROUPS, EXPORT_CURVE_AS_NURBS)
Blender.Set('curframe', orig_frame)

@ -1,4 +1,3 @@
#!BPY
# flt_properties.py. For setting default OpenFLight ID property types
# Copyright (C) 2007 Blender Foundation
#

@ -36,6 +36,12 @@ This script opens the user's default web browser at http://www.blender.org's
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
import Blender, webbrowser
version = str(int(Blender.Get('version')))
webbrowser.open('http://www.blender.org/documentation/'+ version +'PythonDoc/')
import Blender
try: import webbrowser
except: webbrowser = None
if webbrowser:
version = str(int(Blender.Get('version')))
webbrowser.open('http://www.blender.org/documentation/'+ version +'PythonDoc/')
else:
Blender.Draw.PupMenu("Error%t|This script requires a full python installation")

@ -38,5 +38,13 @@ This script opens the user's default web browser at www.blender.org's
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
import Blender, webbrowser
webbrowser.open('http://www.blender.org/education-help/tutorials/getting-started/')
import Blender
try: import webbrowser
except: webbrowser = None
if webbrowser:
webbrowser.open('http://www.blender.org/education-help/tutorials/getting-started/')
else:
Blender.Draw.PupMenu("Error%t|This script requires a full python installation")

@ -36,5 +36,13 @@ This script opens the user's default web browser at www.blender.org's
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
import Blender, webbrowser
webbrowser.open('http://wiki.blender.org/index.php/Manual')
import Blender
try: import webbrowser
except: webbrowser = None
if webbrowser:
webbrowser.open('http://wiki.blender.org/index.php/Manual')
else:
Blender.Draw.PupMenu("Error%t|This script requires a full python installation")

@ -36,6 +36,12 @@ This script opens the user's default web browser at www.blender.org's
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
import Blender, webbrowser
import Blender
try: import webbrowser
except: webbrowser = None
if webbrowser:
webbrowser.open('http://www.blender.org/development/release-logs/')
else:
Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
webbrowser.open('http://www.blender.org/development/release-logs/')

@ -37,5 +37,11 @@ This script opens the user's default web browser at www.blender.org's
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
import Blender, webbrowser
webbrowser.open('http://www.blender.org/education-help/tutorials/')
import Blender
try: import webbrowser
except: webbrowser = None
if webbrowser:
webbrowser.open('http://www.blender.org/education-help/tutorials/')
else:
Blender.Draw.PupMenu("Error%t|This script requires a full python installation")

@ -38,5 +38,11 @@ www.blender.org.
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
import Blender, webbrowser
webbrowser.open('http://www.blender.org/')
import Blender
try: import webbrowser
except: webbrowser = None
if webbrowser:
webbrowser.open('http://www.blender.org/')
else:
Blender.Draw.PupMenu("Error%t|This script requires a full python installation")

@ -37,5 +37,11 @@ This script opens the user's default web browser at www.blender.org's
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
import webbrowser
webbrowser.open('http://www.blender.org/community/get-involved/')
import Blender
try: import webbrowser
except: webbrowser = None
if webbrowser:
webbrowser.open('http://www.blender.org/community/get-involved/')
else:
Blender.Draw.PupMenu("Error%t|This script requires a full python installation")

@ -37,5 +37,11 @@ This script opens the user's default web browser at www.blender.org's
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
import Blender, webbrowser
webbrowser.open('http://www.blender3d.org/e-shop')
import Blender
try: import webbrowser
except: webbrowser = None
if webbrowser:
webbrowser.open('http://www.blender3d.org/e-shop')
else:
Blender.Draw.PupMenu("Error%t|This script requires a full python installation")

@ -37,5 +37,11 @@ This script opens the user's default web browser at www.blender.org's
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
import webbrowser
webbrowser.open('http://www.blender.org/community/user-community/')
import Blender
try: import webbrowser
except: webbrowser = None
if webbrowser:
webbrowser.open('http://www.blender.org/community/user-community/')
else:
Blender.Draw.PupMenu("Error%t|This script requires a full python installation")

@ -0,0 +1,559 @@
#!BPY
"""
Name: '2D Cutout Image Importer'
Blender: 249
Group: 'Image'
Tooltip: 'Batch UV Map images to Planes'
"""
__author__ = "Kevin Morgan (forTe)"
__url__ = ("Home page, http://gamulabs.freepgs.com")
__version__ = "1.2.1"
__bpydoc__ = """\
This Script will take an image and
UV map it to a plane sharing the same width to height ratio as the image.
Import options allow for the image to be a still or sequence type image
<br><br>
Imports can be single images or whole directories of images depending on the chosen
option.
"""
####################################################
#Copyright (C) 2008: Kevin Morgan
####################################################
#-------------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 3 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hopes 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, see <http://www.gnu.org/licenses>.
####################################################
####################################################
#V1.0
#Basic Functionality
#Published June 28, 2007
####################################################
#V1.1
#Added Support for enabling viewport transparency
#Added more options to the UI for materials
#Added Proportionality code (Pixels per unit)
#Added GPL License Block
#Published June 29, 2007
####################################################
#V1.2
#Added Support for Copying Existing Materials
#Import Images as Sequences
#Refreshed GUI - now with more clutter :(
#Miscellaneous and Housekeeping
#Published June 16, 2008
####################################################
#V1.2.1
#Added Extend Texture Mode option at request of a user
#Published September 24, 2008
####################################################
import Blender
from Blender import BGL, Draw, Image, Mesh, Material, Texture, Window
from Blender.Mathutils import *
import bpy
# Global Constants
DIR = 0
SINGLE = 1
CUROFFS = 0
# GUI CONSTANTS
NO_EVT = 0
SINGLE_IMG = 1
DIRECTORY_IMG = 2
CLR_PATH = 3
CHG_EXT = 4
EXIT = 5
DO_SCRIPT = 6
VERSIONSTRING = '1.2.1'
# Note the two parameter dicts could be combined, I just, liked them seperate...
# GUI Buttons Dict
GUIPARAMS = {
'Path': Draw.Create(''),
'ImageExt': Draw.Create(''),
'Seq': Draw.Create(0),
'PackImage': Draw.Create(0),
'PPU': Draw.Create(50),
'VPTransp': Draw.Create(1),
'XOff': Draw.Create(0.0),
'YOff': Draw.Create(0.0),
'ZOff': Draw.Create(0.0),
'CopyMat': Draw.Create(0),
'MatId': Draw.Create(0),
'MatCol': Draw.Create(1.0, 0.0, 0.0),
'Ref': Draw.Create(0.8),
'Spec': Draw.Create(0.5),
'Hard': Draw.Create(50),
'Alpha': Draw.Create(1.0),
'ZTransp': Draw.Create(1),
'Shadeless': Draw.Create(0),
'TexChan': Draw.Create(1),
'MPTCol': Draw.Create(1),
'MPTAlpha': Draw.Create(1),
'UseAlpha': Draw.Create(1),
'CalcAlpha': Draw.Create(0),
'ExtendMode': Draw.Create(0),
'AutoRefresh': Draw.Create(0),
'Cyclic': Draw.Create(0),
'Frames': Draw.Create(100),
'Offs': Draw.Create(0),
'StartFr': Draw.Create(1),
'RedrawImp': Draw.Create(0)
}
# Script Execution Paramaters
PARAMS = {
'ImagePaths': [], # Path to images to import
'ImportType': SINGLE, # Import a Directory or a Single Image?
'ImageProp': Image.Sources.STILL, # What sources for the image, still or sequence
'PackImage': 0, # Pack the Image(s)?
'PPU': 20, # Pixels Per Blender Unit
'MakeTransp': 1, # Make face transparent in viewport
'NewMat': 1, # If true make a new material, otherwise duplicate an existing one, replacing appropriate attributes
'MaterialId': 0, # ID to take from the Materials list upon copy
'Materials': None, # Materials in Scene
'MatProps': {'Col': [1.0, 0.0, 0.0], 'Shadeless': 1, 'Ref': 0.5, 'Spec': 0.5, 'Hard': 200, 'Alpha': 1.0, 'ZTransp': 1},
'TexProps': {'UseAlpha': 1, 'CalcAlpha': 0, 'ExtendMode': 0}, # Texture Properties
'TexChannel': 0, # Texture Channel
'TexMapTo': {'Col': 1, 'Alpha': 1}, # Map to Col and/or Alpha
'SeqProps': {'AutoRefresh': 0, 'Cyclic': 0, 'Frames': 100, 'Offs': 0, 'StartFr': 1},
'ObOffset': Vector(1, 0, 0) # Offset by this vector upon creation for multifile import
}
# Get the Active Scene, of course
scn = bpy.data.scenes.active
##########################################
# MAIN SCRIPT FUNCTIONS
##########################################
def imgImport(imgPath):
global CUROFFS, PARAMS
######################################
# Load the image
######################################
try:
img = Image.Load(imgPath)
imgDimensions = img.getSize() # do this to ensure the data is available
except:
Blender.Draw.PupMenu('Error%t|Unsupported image format for "'+ imgPath.split('\\')[-1].split('/')[-1] +'"')
return
if PARAMS['PackImage']:
img.pack()
name = Blender.sys.makename(imgPath, strip = 1)
######################################
# Construct the mesh
######################################
me = Mesh.New(name)
# Calculate Dimensions from Image Size
dim = [float(i)/PARAMS['PPU'] for i in imgDimensions]
v = [[dim[0], dim[1], 0], [-dim[0], dim[1], 0], [-dim[0], -dim[1], 0], [dim[0], -dim[1], 0]]
me.verts.extend(v)
me.faces.extend([0, 1, 2, 3])
me.faces[0].image = img
me.faces[0].uv = [Vector(1.0, 1.0), Vector(0.0, 1.0), Vector(0.0, 0.0), Vector(1.0, 0.0)]
if PARAMS['MakeTransp']:
me.faces[0].transp = Mesh.FaceTranspModes.ALPHA
######################################
# Modify the Material
######################################
mat = None
if not PARAMS['NewMat']:
mat = PARAMS['Materials'][PARAMS['MaterialId']].__copy__()
mat.setName(name)
else:
mat = Material.New(name)
properties = PARAMS['MatProps']
mat.setRGBCol(properties['Col'])
mat.setRef(properties['Ref'])
mat.setSpec(properties['Spec'])
mat.setHardness(properties['Hard'])
mat.setAlpha(properties['Alpha'])
if properties['Shadeless']:
mat.mode |= Material.Modes.SHADELESS
if properties['ZTransp']:
mat.mode |= Material.Modes.ZTRANSP
properties = PARAMS['TexProps']
tex = Texture.New(name)
tex.setType('Image')
tex.setImage(img)
if properties['UseAlpha']:
tex.useAlpha = Texture.ImageFlags.USEALPHA
if properties['CalcAlpha']:
tex.calcAlpha = Texture.ImageFlags.CALCALPHA
if properties['ExtendMode']:
tex.setExtend('Extend')
if PARAMS['ImageProp'] == Image.Sources.SEQUENCE:
properties = PARAMS['SeqProps']
img.source = PARAMS['ImageProp'] # Needs to be done here, otherwise an error with earlier getSize()
tex.animStart = properties['StartFr']
tex.animOffset = properties['Offs']
tex.animFrames = properties['Frames']
tex.autoRefresh = properties['AutoRefresh']
tex.cyclic = properties['Cyclic']
texMapSetters = Texture.TexCo.UV
# PARAMS['TexMapTo']['Col'] (and alpha) will either be 0 or 1 because its from a toggle, otherwise this line doesn't work
texChanSetters = Texture.MapTo.COL * PARAMS['TexMapTo']['Col'] | Texture.MapTo.ALPHA * PARAMS['TexMapTo']['Alpha']
mat.setTexture(PARAMS['TexChannel'], tex, texMapSetters, texChanSetters)
me.materials += [mat]
######################################
# Object Construction
######################################
ob = scn.objects.new(me, name)
p = Vector(ob.getLocation()) # Should be the origin, but just to be safe, get it
ob.setLocation((CUROFFS * PARAMS['ObOffset']) + p)
return
def translateParams():
# Translates (or assigns for the most part) GUI values to those that can be read by the
# Import Function
global GUIPARAMS, PARAMS
if GUIPARAMS['Seq'].val and PARAMS['ImportType'] != DIR:
PARAMS['ImageProp'] = Image.Sources.SEQUENCE
PARAMS['PackImage'] = GUIPARAMS['PackImage'].val
PARAMS['PPU'] = GUIPARAMS['PPU'].val
PARAMS['MakeTransp'] = GUIPARAMS['VPTransp'].val
PARAMS['ObOffset'] = Vector(GUIPARAMS['XOff'].val, GUIPARAMS['YOff'].val, GUIPARAMS['ZOff'].val)
PARAMS['NewMat'] = not GUIPARAMS['CopyMat'].val
PARAMS['MaterialId'] = GUIPARAMS['MatId'].val
PARAMS['MatProps']['Col'] = list(GUIPARAMS['MatCol'].val)
PARAMS['MatProps']['Ref'] = GUIPARAMS['Ref'].val
PARAMS['MatProps']['Spec'] = GUIPARAMS['Spec'].val
PARAMS['MatProps']['Hard'] = GUIPARAMS['Hard'].val
PARAMS['MatProps']['Alpha'] = GUIPARAMS['Alpha'].val
PARAMS['MatProps']['ZTransp'] = GUIPARAMS['ZTransp'].val
PARAMS['MatProps']['Shadeless'] = GUIPARAMS['Shadeless'].val
PARAMS['TexChannel'] = GUIPARAMS['TexChan'].val - 1 #Channels are 0-9, but GUI shows 1-10
PARAMS['TexProps']['UseAlpha'] = GUIPARAMS['UseAlpha'].val
PARAMS['TexProps']['CalcAlpha'] = GUIPARAMS['CalcAlpha'].val
PARAMS['TexProps']['ExtendMode'] = GUIPARAMS['ExtendMode'].val
PARAMS['TexMapTo']['Col'] = GUIPARAMS['MPTCol'].val
PARAMS['TexMapTo']['Alpha'] = GUIPARAMS['MPTAlpha'].val
PARAMS['SeqProps']['AutoRefresh'] = GUIPARAMS['AutoRefresh'].val
PARAMS['SeqProps']['Cyclic'] = GUIPARAMS['Cyclic'].val
PARAMS['SeqProps']['Frames'] = GUIPARAMS['Frames'].val
PARAMS['SeqProps']['Offs'] = GUIPARAMS['Offs'].val
PARAMS['SeqProps']['StartFr'] = GUIPARAMS['StartFr'].val
return
def doScript():
# Main script Function
# Consists of choosing between 2 loops, one with a redraw, one without, see comments for why
global CUROFFS
translateParams()
total = len(PARAMS['ImagePaths'])
broken = 0
if GUIPARAMS['RedrawImp'].val: # Reduces the need to compare on every go through the loop
for i, path in enumerate(PARAMS['ImagePaths']):
CUROFFS = i # Could be passed to the import Function, but I chose a global instead
Window.DrawProgressBar(float(i)/total, "Importing %i of %i Images..." %(i+1, total))
imgImport(path)
Blender.Redraw()
if Blender.Get('version') >= 246:
if Window.TestBreak():
broken = 1
break
else:
for i, path in enumerate(PARAMS['ImagePaths']):
CUROFFS = i
Window.DrawProgressBar(float(i)/total, "Importing %i of %i Images..." %(i+1, total))
imgImport(path)
if Blender.Get('version') >= 246:
if Window.TestBreak():
broken = 1
break
if broken:
Window.DrawProgressBar(1.0, "Script Execution Aborted")
else:
Window.DrawProgressBar(1.0, "Finished Importing")
Blender.Redraw() # Force a refresh, since the user may have chosen to not refresh as they go along
return
##########################################
# PATH SETTERS AND CHANGERS
##########################################
def setSinglePath(filename):
global GUIPARAMS, PARAMS
GUIPARAMS['Path'].val = filename
PARAMS['ImagePaths'] = [filename]
return
def setDirPath(filename):
global GUIPARAMS, PARAMS
try:
import os
except:
Draw.PupMenu('Full install of python required to be able to set Directory Paths')
Draw.Exit()
return
path = os.path.dirname(filename) # Blender.sys.dirname fails on '/'
GUIPARAMS['Path'].val = path
ext_lower = GUIPARAMS['ImageExt'].val.lower()
for f in os.listdir(path):
if f.lower().endswith(ext_lower):
PARAMS['ImagePaths'].append(os.path.join(path, f))
return
def changeExtension():
global GUIPARAMS, PARAMS
if PARAMS['ImportType'] == SINGLE:
return
try:
import os
except:
Draw.PupMenu('Full install of python required to be able to set Directory Paths')
Draw.Exit()
return
PARAMS['ImagePaths'] = []
ext_lower = GUIPARAMS['ImageExt'].val.lower()
for f in os.listdir(GUIPARAMS['Path'].val):
if f.lower().endswith(ext_lower):
PARAMS['ImagePaths'].append(os.path.join(GUIPARAMS['Path'].val, f))
return
##########################################
# INTERFACE FUNCTIONS
##########################################
def compileMaterialList():
# Pretty straight forward, just grabs the materials in the blend file and constructs
# an appropriate string for use as a menu
mats = [mat for mat in bpy.data.materials]
PARAMS['Materials'] = mats
title = 'Materials%t|'
menStrs = [mat.name + '%x' + str(i) + '|' for i, mat in enumerate(mats)]
return title + ''.join(menStrs)
def event(evt, val):
# Disabled, since Esc is often used from the file browser
#if evt == Draw.ESCKEY:
# Draw.Exit()
return
def bevent(evt):
global GUIPARAMS, PARAMS
if evt == NO_EVT:
Draw.Redraw()
elif evt == SINGLE_IMG:
Window.FileSelector(setSinglePath, 'Image', Blender.sys.expandpath('//'))
Draw.Redraw()
PARAMS['ImportType'] = SINGLE
elif evt == DIRECTORY_IMG:
Window.FileSelector(setDirPath, 'Directory', Blender.sys.expandpath('//'))
Draw.Redraw()
PARAMS['ImportType'] = DIR
elif evt == CLR_PATH:
GUIPARAMS['Path'].val = ''
PARAMS['ImagePaths'] = []
GUIPARAMS['ImageExt'].val = ''
Draw.Redraw()
elif evt == CHG_EXT:
changeExtension()
Draw.Redraw()
elif evt == EXIT:
Draw.Exit()
elif evt == DO_SCRIPT:
doScript()
else:
print "ERROR: UNEXPECTED BUTTON EVENT"
return
# GUI Colors ######
ScreenColor = [0.7, 0.7, 0.7]
BackgroundColor = [0.8, 0.8, 0.8]
TitleBG = [0.6, 0.6, 0.6]
TitleCol = [1.0, 1.0, 1.0]
ErrCol = [1.0, 0.0, 0.0]
TextCol = [0.4, 0.4, 0.5]
###################
def GUI():
global GUIPARAMS, PARAMS
BGL.glClearColor(*(ScreenColor + [1.0]))
BGL.glClear(BGL.GL_COLOR_BUFFER_BIT)
minx = 5
maxx = 500
miny = 5
maxy = 450
lineheight = 24
buPad = 5 # Generic Button Padding, most buttons should have 24-19 (or 5) px space around them
lP = 5 # Left Padding
rP = 5 # Right Padding
# Draw Background Box
BGL.glColor3f(*BackgroundColor)
BGL.glRecti(minx, miny, maxx, maxy)
# Draw Title
BGL.glColor3f(*TitleBG)
BGL.glRecti(minx, maxy - (lineheight), maxx, maxy)
BGL.glColor3f(*TitleCol)
title = "2D Cutout Image Importer v" + VERSIONSTRING
BGL.glRasterPos2i(minx + lP, maxy - 15)
Draw.Text(title, 'large')
Draw.PushButton('Exit', EXIT, maxx-50-rP, maxy - lineheight + 2, 50, 19, "Exit Script")
# Path Buttons
if GUIPARAMS['Path'].val == '':
Draw.PushButton('Single Image', SINGLE_IMG, minx + lP, maxy - (2*lineheight), 150, 19, "Select a Single Image to Import")
Draw.PushButton('Directory', DIRECTORY_IMG, minx + lP + 150, maxy - (2*lineheight), 150, 19, "Select a Directory of Images to Import")
else:
Draw.PushButton('Clear', CLR_PATH, minx+lP, maxy - (2*lineheight), 50, 19, "Clear Path and Change Import Options")
GUIPARAMS['Path'] = Draw.String('Path: ', NO_EVT, minx + lP, maxy - (3*lineheight), (maxx-minx-lP-rP), 19, GUIPARAMS['Path'].val, 399, 'Path to Import From')
if PARAMS['ImportType'] == DIR:
GUIPARAMS['ImageExt'] = Draw.String('Image Ext: ', CHG_EXT, minx + lP, maxy - (4*lineheight), 110, 19, GUIPARAMS['ImageExt'].val, 6, 'Image extension for batch directory importing (case insensitive)')
GUIPARAMS['PackImage'] = Draw.Toggle('Pack', NO_EVT, maxx - rP - 50, maxy - (4*lineheight), 50, 19, GUIPARAMS['PackImage'].val, 'Pack Image(s) into .Blend File')
# Geometry and Viewport Options
BGL.glColor3f(*TextCol)
BGL.glRecti(minx+lP, maxy - (5*lineheight), maxx-rP, maxy - (5*lineheight) + 1)
BGL.glRasterPos2i(minx + lP, maxy-(5*lineheight) + 3)
Draw.Text('Geometry and Display Options', 'small')
GUIPARAMS['PPU'] = Draw.Slider('Pixels Per Unit: ', NO_EVT, minx + lP, maxy - (6*lineheight), (maxx-minx)/2 - lP, 19, GUIPARAMS['PPU'].val, 1, 5000, 0, 'Set the Number of Pixels Per Blender Unit to preserve Image Size Relations')
GUIPARAMS['VPTransp'] = Draw.Toggle('Viewport Transparency', NO_EVT, minx + lP, maxy - (8*lineheight), (maxx-minx)/2 - lP, 2*lineheight - buPad, GUIPARAMS['VPTransp'].val, 'Display Alpha Transparency in the Viewport')
GUIPARAMS['XOff'] = Draw.Slider('Offs X: ', NO_EVT, minx + lP + (maxx-minx)/2, maxy - (6*lineheight), (maxx-minx)/2 - lP - rP, 19, GUIPARAMS['XOff'].val, 0, 5.0, 0, 'Amount to Offset Each Imported in the X-Direction if Importing Multiple Images')
GUIPARAMS['YOff'] = Draw.Slider('Offs Y: ', NO_EVT, minx + lP + (maxx-minx)/2, maxy - (7*lineheight), (maxx-minx)/2 - lP - rP, 19, GUIPARAMS['YOff'].val, 0, 5.0, 0, 'Amount to Offset Each Imported in the Y-Direction if Importing Multiple Images')
GUIPARAMS['ZOff'] = Draw.Slider('Offs Z: ', NO_EVT, minx + lP + (maxx-minx)/2, maxy - (8*lineheight), (maxx-minx)/2 - lP - rP, 19, GUIPARAMS['ZOff'].val, 0, 5.0, 0, 'Amount to Offset Each Imported in the Z-Direction if Importing Multiple Images')
# Material and Texture Options
BGL.glColor3f(*TextCol)
BGL.glRecti(minx+lP, maxy - (9*lineheight), maxx-rP, maxy - (9*lineheight) + 1)
BGL.glRasterPos2i(minx + lP, maxy-(9*lineheight) + 3)
Draw.Text('Material and Texture Options', 'small')
half = (maxx-minx-lP-rP)/2
GUIPARAMS['CopyMat'] = Draw.Toggle('Copy Existing Material', NO_EVT, minx + lP, maxy-(10*lineheight), half, 19, GUIPARAMS['CopyMat'].val, 'Copy an Existing Material')
if GUIPARAMS['CopyMat'].val:
menStr = compileMaterialList()
GUIPARAMS['MatId'] = Draw.Menu(menStr, NO_EVT, minx + lP, maxy - (11*lineheight), half, 19, GUIPARAMS['MatId'].val, 'Material to Copy Settings From')
else:
GUIPARAMS['MatCol'] = Draw.ColorPicker(NO_EVT, minx+lP, maxy - (13*lineheight), 40, (3*lineheight) - buPad, GUIPARAMS['MatCol'].val, 'Color of Newly Created Material')
GUIPARAMS['Ref'] = Draw.Slider('Ref: ', NO_EVT, minx +lP+45, maxy - (11*lineheight), half-45, 19, GUIPARAMS['Ref'].val, 0.0, 1.0, 0, 'Set the Ref Value for Created Materials')
GUIPARAMS['Spec'] = Draw.Slider('Spec: ', NO_EVT, minx +lP+45, maxy - (12*lineheight), half-45, 19, GUIPARAMS['Spec'].val, 0.0, 2.0, 0, 'Set the Spec Value for Created Materials')
GUIPARAMS['Hard'] = Draw.Slider('Hard: ', NO_EVT, minx +lP+45, maxy - (13*lineheight), half-45, 19, GUIPARAMS['Hard'].val, 1, 500, 0, 'Set the Hardness Value for Created Materials')
GUIPARAMS['Alpha'] = Draw.Slider('A: ', NO_EVT, minx +lP, maxy - (14*lineheight), half, 19, GUIPARAMS['Alpha'].val, 0.0, 1.0, 0, 'Set the Alpha Value for Created Materials')
GUIPARAMS['ZTransp'] = Draw.Toggle('ZTransparency', NO_EVT, minx + lP, maxy - (15*lineheight), half, 19, GUIPARAMS['ZTransp'].val, 'Enable ZTransparency')
GUIPARAMS['Shadeless'] = Draw.Toggle('Shadeless', NO_EVT, minx + lP, maxy - (16*lineheight), half, 19, GUIPARAMS['Shadeless'].val, 'Enable Shadeless')
GUIPARAMS['TexChan'] = Draw.Number('Texture Channel: ', NO_EVT, minx + lP+ half + buPad, maxy - (10*lineheight), half-rP, 19, GUIPARAMS['TexChan'].val, 1, 10, 'Texture Channel for Image Texture')
GUIPARAMS['MPTCol'] = Draw.Toggle('Color', NO_EVT, minx + lP + half + buPad, maxy - (11*lineheight), half/2, 19, GUIPARAMS['MPTCol'].val, 'Map To Color Channel')
GUIPARAMS['MPTAlpha'] = Draw.Toggle('Alpha', NO_EVT, minx + lP + int((1.5)*half) + buPad, maxy - (11*lineheight), half/2 - rP, 19, GUIPARAMS['MPTAlpha'].val, 'Map To Alpha Channel')
third = int((maxx-minx-lP-rP)/6)
GUIPARAMS['UseAlpha'] = Draw.Toggle('Use Alpha', NO_EVT, minx + lP + half + buPad, maxy - (12*lineheight), third, 19, GUIPARAMS['UseAlpha'].val, "Use the Images' Alpha Values")
GUIPARAMS['CalcAlpha'] = Draw.Toggle('Calc Alpha', NO_EVT, minx + lP + half + third + buPad, maxy - (12*lineheight), third, 19, GUIPARAMS['CalcAlpha'].val, "Calculate Images' Alpha Values")
GUIPARAMS['ExtendMode'] = Draw.Toggle('Extend', NO_EVT, minx+lP+half+third+third+buPad, maxy - (12*lineheight), third-3, 19, GUIPARAMS['ExtendMode'].val, "Use Extend texture mode. If deselected, Repeat is used")
GUIPARAMS['Seq'] = Draw.Toggle('Sequence', NO_EVT, minx + lP + half + buPad, maxy - (13*lineheight), half-rP, 19, GUIPARAMS['Seq'].val, 'Set the Image(s) to use a Sequence instead of a Still')
if GUIPARAMS['Seq'].val and not PARAMS['ImportType'] == DIR:
GUIPARAMS['AutoRefresh'] = Draw.Toggle('Auto Refresh', NO_EVT, minx + lP + half + buPad, maxy - (14*lineheight), half/2, 19, GUIPARAMS['AutoRefresh'].val, 'Use Auto Refresh')
GUIPARAMS['Cyclic'] = Draw.Toggle('Cyclic', NO_EVT, minx + lP + half + buPad + half/2, maxy - (14*lineheight), half/2 - rP, 19, GUIPARAMS['Cyclic'].val, 'Repeat Frames Cyclically`')
GUIPARAMS['Frames'] = Draw.Number('Frames: ', NO_EVT, minx +lP + half + buPad, maxy - (15*lineheight), half - rP, 19, GUIPARAMS['Frames'].val, 1, 30000, 'Sets the Number of Images of a Movie to Use')
GUIPARAMS['Offs'] = Draw.Number('Offs: ', NO_EVT, minx +lP + half + buPad, maxy - (16*lineheight), half/2, 19, GUIPARAMS['Offs'].val, -30000, 30000, 'Offsets the Number of the Frame to use in the Animation')
GUIPARAMS['StartFr'] = Draw.Number('StartFr: ', NO_EVT, minx +lP + half + buPad + half/2, maxy - (16*lineheight), half/2 - rP, 19, GUIPARAMS['StartFr'].val, 1, 30000, 'Sets the Global Starting Frame of the Movie')
elif GUIPARAMS['Seq'].val and PARAMS['ImportType'] == DIR:
BGL.glColor3f(*ErrCol)
BGL.glRasterPos2i(minx + lP + half + buPad + 7, maxy-(14 * lineheight) + 5)
Draw.Text('Sequence only available for Single Image Import', 'small')
# Import Options
BGL.glColor3f(*TextCol)
BGL.glRecti(minx+lP, maxy - (17*lineheight), maxx-rP, maxy - (17*lineheight) + 1)
BGL.glRasterPos2i(minx + lP, maxy-(17*lineheight) + 3)
Draw.Text('Import', 'small')
if GUIPARAMS['Path'].val and GUIPARAMS['ImageExt'].val or GUIPARAMS['Path'].val and PARAMS['ImportType'] == SINGLE:
Draw.PushButton('Import', DO_SCRIPT, minx + lP, maxy - (18*lineheight), 75, 19, "Import Image(s)")
else:
BGL.glColor3f(*ErrCol)
BGL.glRasterPos2i(minx+lP, maxy - (18*lineheight) + 5)
Draw.Text('A path and image type must be specified to import images')
GUIPARAMS['RedrawImp'] = Draw.Toggle('Redraw During Import', NO_EVT, maxx - rP - 150, maxy - (18*lineheight), 150, 19, GUIPARAMS['RedrawImp'].val, 'Redraw the View as Images Import')
Draw.Register(GUI, event, bevent)

@ -2,12 +2,12 @@
"""
Name: 'Autodesk DXF (.dxf .dwg)'
Blender: 246
Blender: 249
Group: 'Import'
Tooltip: 'Import for DWG/DXF geometry data.'
"""
__author__ = 'Kitsu(Ed Blake) & migius(Remigiusz Fiedler)'
__version__ = '1.12 - 2009.04.11 by migius'
__version__ = '1.12 - 2009.05.27 by migius'
__url__ = ["http://blenderartists.org/forum/showthread.php?t=84319",
"http://wiki.blender.org/index.php/Scripts/Manual/Import/DXF-3D"]
__email__ = ["migius(at)4d-vectors.de","Kitsune_e(at)yahoo.com"]
@ -44,8 +44,8 @@ Supported DXF>r12 objects:
ELLIPSE,
LWPOLYLINE (LightWeight Polyline),
SPLINE,
(wip v1.13) MLINE,
(wip v1.13) MTEXT
(todo v1.13) MLINE,
(todo v1.13) MTEXT
Unsupported objects:
DXF r12: DIMENSION.
@ -74,7 +74,7 @@ thickness,
width,
color,
layer,
(wip v1.13: XDATA, grouped status)
(todo v1.13: XDATA, grouped status)
It is recommended to use DXF-object properties for assign Blender materials.
Notes:
@ -111,7 +111,11 @@ History:
-- support DXF-definitions of scene, lights and cameras
-- support ortho mode for VIEWs and VPORTs as cameras
v1.12 - 2009.05.27 by migius
d6 todo: bugfix negative scaled INSERTs - isLeftHand(Matrix) check
v1.12 - 2009.05.26 by migius
d5 changed to the new 2.49 method Vector.cross()
d5 bugfix WORLDY(1,1,0) to (0,1,0)
v1.12 - 2009.04.11 by migius
d4 added DWG support, Stani Michiels idea for binding an extern DXF-DWG-converter
v1.12 - 2009.03.14 by migius
@ -309,7 +313,7 @@ History:
import Blender
from Blender import Mathutils, BezTriple, Draw, Registry, sys,\
Text3d, Window, Mesh, Material, Group
Text3d, Window, Mesh, Material, Group, Curve
#from Blender.Mathutils import Vector, Matrix
#import bpy #not used yet
#import BPyMessages
@ -343,14 +347,12 @@ if os.name != 'mac':
except ImportError:
print 'psyco not imported'
#try: Curve.orderU
print '\n\n\n'
print 'DXF/DWG-Importer v%s *** start ***' %(__version__) #---------------------
SCENE = None
WORLDX = Mathutils.Vector((1,0,0))
WORLDY = Mathutils.Vector((1,1,0))
WORLDY = Mathutils.Vector((0,1,0))
WORLDZ = Mathutils.Vector((0,0,1))
G_SCALE = 1.0 #(0.0001-1000) global scaling factor for all dxf data
@ -375,7 +377,7 @@ GROUP_BYLAYER = 0 #(0/1) all entities from same layer import into one blender-
LAYER_DEF_NAME = 'AAAA' #default layer name
LAYER_DEF_COLOR = 4 #default layer color
E_M = 0
LAB = "*) parts under construction"
LAB = ". wip .. todo" #"*) parts under construction"
M_OBJ = 0
FILENAME_MAX = 180 #max length of path+file_name string (FILE_MAXDIR + FILE_MAXFILE)
@ -392,7 +394,20 @@ ALIGN = BezTriple.HandleTypes.ALIGN
UI_MODE = True #activates UI-popup-print, if not multiple files imported
#---- migration to 2.49-------------------------------------------------
if 'cross' in dir(Mathutils.Vector()):
#Draw.PupMenu('DXF exporter: Abort%t|This script version works for Blender up 2.49 only!')
def M_CrossVecs(v1,v2):
return v1.cross(v2) #for up2.49
def M_DotVecs(v1,v2):
return v1.dot(v2) #for up2.49
else:
def M_CrossVecs(v1,v2):
return Mathutils.CrossVecs(v1,v2) #for pre2.49
def M_DotVecs(v1,v2):
return Mathutils.DotVecs(v1,v2) #for pre2.49
#-------- DWG support ------------------------------------------
extCONV_OK = True
extCONV = 'DConvertCon.exe'
@ -2237,7 +2252,6 @@ class LWpolyline(Polyline): #--------------------------------------------------
self.spline = False
self.curved = False
#print 'deb:LWpolyline.obj.data:\n', obj.data #------------------------
#print 'deb:LWpolyline.ENDinit:----------------' #------------------------
@ -4419,11 +4433,11 @@ def getOCS(az): #--------------------------------------------------------------
cap = 0.015625 # square polar cap value (1/64.0)
if abs(az.x) < cap and abs(az.y) < cap:
ax = Mathutils.CrossVecs(WORLDY, az)
ax = M_CrossVecs(WORLDY,az)
else:
ax = Mathutils.CrossVecs(WORLDZ, az)
ax = M_CrossVecs(WORLDZ,az)
ax = ax.normalize()
ay = Mathutils.CrossVecs(az, ax)
ay = M_CrossVecs(az, ax)
ay = ay.normalize()
return ax, ay, az
@ -5166,17 +5180,17 @@ GUI_B = {} # GUI-buttons dictionary for drawingTypes
# settings default, initialize ------------------------
points_as_menu = "convert to: %t|empty %x1|mesh.vertex %x2|thin sphere %x3|thin box %x4|*curve.vertex %x5"
lines_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|thin box %x4|Bezier-curve %x5|*NURBS-curve %x6"
mlines_as_menu = "convert to: %t|*edge %x1|*mesh %x2|*thin cylinder %x3|*thin box %x|*curve %x5"
plines_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|*thin box %x4|Bezier-curve %x5|NURBS-curve %x6"
splines_as_menu = "convert to: %t|mesh %x2|*thin cylinder %x3|*thin box %x4|*Bezier-curve %x5|NURBS-curve %x6"
plines3_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|*thin box %x4|Bezier-curve %x5|NURBS-curve %x6"
plmesh_as_menu = "convert to: %t|*edge %x1|mesh %x2|*NURBS-surface %x6"
solids_as_menu = "convert to: %t|*edge %x1|mesh %x2"
blocks_as_menu = "convert to: %t|dupliGroup %x1|*real.Group %x2|*exploded %x3"
texts_as_menu = "convert to: %t|text %x1|*mesh %x2|*curve %x5"
material_from_menu= "material from: %t|*LINESTYLE %x7|COLOR %x1|LAYER %x2|*LAYER+COLOR %x3|*BLOCK %x4|*XDATA %x5|*INI-File %x6"
points_as_menu = "convert to: %t|empty %x1|mesh.vertex %x2|thin sphere %x3|thin box %x4|..curve.vertex %x5"
lines_as_menu = "convert to: %t|..edge %x1|mesh %x2|..thin cylinder %x3|thin box %x4|Bezier-curve %x5|..NURBS-curve %x6"
mlines_as_menu = "convert to: %t|..edge %x1|..mesh %x2|..thin cylinder %x3|..thin box %x|..curve %x5"
plines_as_menu = "convert to: %t|..edge %x1|mesh %x2|..thin cylinder %x3|..thin box %x4|Bezier-curve %x5|NURBS-curve %x6"
splines_as_menu = "convert to: %t|mesh %x2|..thin cylinder %x3|..thin box %x4|Bezier-curve %x5|NURBS-curve %x6"
plines3_as_menu = "convert to: %t|..edge %x1|mesh %x2|..thin cylinder %x3|..thin box %x4|Bezier-curve %x5|NURBS-curve %x6"
plmesh_as_menu = "convert to: %t|..edge %x1|mesh %x2|..NURBS-surface %x6"
solids_as_menu = "convert to: %t|..edge %x1|mesh %x2"
blocks_as_menu = "convert to: %t|dupliGroup %x1|..real.Group %x2|..exploded %x3"
texts_as_menu = "convert to: %t|text %x1|..mesh %x2|..curve %x5"
material_from_menu= "material from: %t|..LINESTYLE %x7|COLOR %x1|LAYER %x2|..LAYER+COLOR %x3|..BLOCK %x4|..XDATA %x5|..INI-File %x6"
g_scale_list = ''.join((
'scale factor: %t',
'|user def. %x12',
@ -5662,7 +5676,7 @@ def draw_UI(): #---------------------------------------------------------------
y -= 20
Draw.BeginAlign()
GUI_B['mline'] = Draw.Toggle('*MLINE', EVENT_REDRAW, b0, y, b0_, 20, GUI_B['mline'].val, "(*wip)support dxf-MLINE on/off")
GUI_B['mline'] = Draw.Toggle('..MLINE', EVENT_REDRAW, b0, y, b0_, 20, GUI_B['mline'].val, "(*todo)support dxf-MLINE on/off")
if GUI_B['mline'].val:
GUI_A['mlines_as'] = Draw.Menu(mlines_as_menu, EVENT_NONE, but1c, y, but_1c, 20, GUI_A['mlines_as'].val, "select target Blender-object")
Draw.EndAlign()
@ -5713,7 +5727,7 @@ def draw_UI(): #---------------------------------------------------------------
y -= 20
GUI_B['text'] = Draw.Toggle('TEXT', EVENT_NONE, b0, y, b0_, 20, GUI_B['text'].val, "support dxf-TEXT on/off")
GUI_B['mtext'] = Draw.Toggle('*MTEXT', EVENT_NONE, b1, y, b1_, 20, GUI_B['mtext'].val, "(*wip)support dxf-MTEXT on/off")
GUI_B['mtext'] = Draw.Toggle('..MTEXT', EVENT_NONE, b1, y, b1_, 20, GUI_B['mtext'].val, "(*todo)support dxf-MTEXT on/off")
# GUI_A['texts_as'] = Draw.Menu(texts_as_menu, EVENT_NONE, but3c, y, but_3c, 20, GUI_A['texts_as'].val, "select target Blender-object")
y -= 20
@ -5732,8 +5746,8 @@ def draw_UI(): #---------------------------------------------------------------
Draw.BeginAlign()
GUI_A['views_on'] = Draw.Toggle('views', EVENT_NONE, b0, y, b0_-25, 20, GUI_A['views_on'].val, "imports VIEWs and VIEWPORTs as cameras on/off")
GUI_A['cams_on'] = Draw.Toggle('*cams', EVENT_NONE, b1-25, y, b1_-25, 20, GUI_A['cams_on'].val, "(*wip) support ASHADE cameras on/off")
GUI_A['lights_on'] = Draw.Toggle('*lights', EVENT_NONE, b1+25, y, b1_-25, 20, GUI_A['lights_on'].val, "(*wip) support AVE_RENDER lights on/off")
GUI_A['cams_on'] = Draw.Toggle('..cams', EVENT_NONE, b1-25, y, b1_-25, 20, GUI_A['cams_on'].val, "(*todo) support ASHADE cameras on/off")
GUI_A['lights_on'] = Draw.Toggle('..lights', EVENT_NONE, b1+25, y, b1_-25, 20, GUI_A['lights_on'].val, "(*todo) support AVE_RENDER lights on/off")
Draw.EndAlign()
@ -5749,10 +5763,10 @@ def draw_UI(): #---------------------------------------------------------------
Draw.BeginAlign()
GUI_A['paper_space_on'] = Draw.Toggle('paper', EVENT_NONE, b0+but_*0, y, but_, 20, GUI_A['paper_space_on'].val, "import only from Paper-Space on/off")
GUI_A['layFrozen_on'] = Draw.Toggle ('frozen', EVENT_NONE, b0+but_*1, y, but_, 20, GUI_A['layFrozen_on'].val, "import also from frozen LAYERs on/off")
GUI_A['layerFilter_on'] = Draw.Toggle('layer', EVENT_NONE, b0+but_*2, y, but_, 20, GUI_A['layerFilter_on'].val, "(*wip) LAYER filtering on/off")
GUI_A['colorFilter_on'] = Draw.Toggle('color', EVENT_NONE, b0+but_*3, y, but_, 20, GUI_A['colorFilter_on'].val, "(*wip) COLOR filtering on/off")
GUI_A['groupFilter_on'] = Draw.Toggle('group', EVENT_NONE, b0+but_*4, y, but_, 20, GUI_A['groupFilter_on'].val, "(*wip) GROUP filtering on/off")
GUI_A['blockFilter_on'] = Draw.Toggle('block', EVENT_NONE, b0+but_*5, y, but_, 20, GUI_A['blockFilter_on'].val, "(*wip) BLOCK filtering on/off")
GUI_A['layerFilter_on'] = Draw.Toggle('..layer', EVENT_NONE, b0+but_*2, y, but_, 20, GUI_A['layerFilter_on'].val, "(*todo) LAYER filtering on/off")
GUI_A['colorFilter_on'] = Draw.Toggle('..color', EVENT_NONE, b0+but_*3, y, but_, 20, GUI_A['colorFilter_on'].val, "(*todo) COLOR filtering on/off")
GUI_A['groupFilter_on'] = Draw.Toggle('..group', EVENT_NONE, b0+but_*4, y, but_, 20, GUI_A['groupFilter_on'].val, "(*todo) GROUP filtering on/off")
GUI_A['blockFilter_on'] = Draw.Toggle('..block', EVENT_NONE, b0+but_*5, y, but_, 20, GUI_A['blockFilter_on'].val, "(*todo) BLOCK filtering on/off")
#GUI_A['dummy_on'] = Draw.Toggle('-', EVENT_NONE, but3c, y, but_3c, 20, GUI_A['dummy_on'].val, "dummy on/off")
Draw.EndAlign()
@ -5853,7 +5867,7 @@ def draw_UI(): #---------------------------------------------------------------
y -= 10
y -= 20
Draw.BeginAlign()
GUI_A['Z_force_on'] = Draw.Toggle('*elevation', EVENT_REDRAW, b0, y, b0_, 20, GUI_A['Z_force_on'].val, "*set objects Z-coordinates to elevation on/off")
GUI_A['Z_force_on'] = Draw.Toggle('.elevation', EVENT_REDRAW, b0, y, b0_, 20, GUI_A['Z_force_on'].val, ".set objects Z-coordinates to elevation on/off")
if GUI_A['Z_force_on'].val:
GUI_A['Z_elev'] = Draw.Number('', EVENT_NONE, b1, y, b1_, 20, GUI_A['Z_elev'].val, -1000, 1000, "set default elevation(Z-coordinate)")
Draw.EndAlign()
@ -6155,6 +6169,7 @@ def multi_import(DIR):
if __name__ == "__main__":
#Draw.PupMenu('DXF importer: Abort%t|This script version works for Blender up 2.49 only!')
UI_MODE = True
# recall last used DXF-file and INI-file names
dxffilename = check_RegistryKey('dxfFileName')

@ -2,14 +2,14 @@
"""
Name: 'Wavefront (.obj)...'
Blender: 248
Blender: 249
Group: 'Import'
Tooltip: 'Load a Wavefront OBJ File, Shift: batch import all dir.'
"""
__author__= "Campbell Barton", "Jiri Hnidek"
__author__= "Campbell Barton", "Jiri Hnidek", "Paolo Ciccone"
__url__= ['http://wiki.blender.org/index.php/Scripts/Manual/Import/wavefront_obj', 'blender.org', 'blenderartists.org']
__version__= "2.1"
__version__= "2.11"
__bpydoc__= """\
This script imports a Wavefront OBJ files to Blender.
@ -40,7 +40,7 @@ Note, This loads mesh objects and materials only, nurbs and curves are not suppo
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
from Blender import *
from Blender import Mesh, Draw, Window, Texture, Material, sys
import bpy
import BPyMesh
import BPyImage
@ -49,7 +49,6 @@ import BPyMessages
try: import os
except: os= False
# Generic path functions
def stripFile(path):
'''Return directory, where the file is'''
@ -167,12 +166,13 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
del temp_mtl
#Create new materials
for name in unique_materials.iterkeys():
unique_materials[name]= bpy.data.materials.new(name)
unique_material_images[name]= None, False # assign None to all material images to start with, add to later.
for name in unique_materials: # .keys()
if name != None:
unique_materials[name]= bpy.data.materials.new(name)
unique_material_images[name]= None, False # assign None to all material images to start with, add to later.
unique_materials[None]= None
unique_material_images[None]= None, False
for libname in material_libs:
mtlpath= DIR + libname
@ -320,7 +320,7 @@ def split_mesh(verts_loc, faces, unique_materials, filepath, SPLIT_OB_OR_GROUP,
return [(value[0], value[1], value[2], key_to_name(key)) for key, value in face_split_dict.iteritems()]
def create_mesh(scn, new_objects, has_ngons, CREATE_FGONS, CREATE_EDGES, verts_loc, verts_tex, faces, unique_materials, unique_material_images, unique_smooth_groups, dataname):
def create_mesh(scn, new_objects, has_ngons, CREATE_FGONS, CREATE_EDGES, verts_loc, verts_tex, faces, unique_materials, unique_material_images, unique_smooth_groups, vertex_groups, dataname):
'''
Takes all the data gathered and generates a mesh, adding the new object to new_objects
deals with fgons, sharp edges and assigning materials
@ -530,6 +530,105 @@ def create_mesh(scn, new_objects, has_ngons, CREATE_FGONS, CREATE_EDGES, verts_l
ob= scn.objects.new(me)
new_objects.append(ob)
# Create the vertex groups. No need to have the flag passed here since we test for the
# content of the vertex_groups. If the user selects to NOT have vertex groups saved then
# the following test will never run
for group_name, group_indicies in vertex_groups.iteritems():
me.addVertGroup(group_name)
me.assignVertsToGroup(group_name, group_indicies,1.00, Mesh.AssignModes.REPLACE)
def create_nurbs(scn, context_nurbs, vert_loc, new_objects):
'''
Add nurbs object to blender, only support one type at the moment
'''
deg = context_nurbs.get('deg', (3,))
curv_range = context_nurbs.get('curv_range', None)
curv_idx = context_nurbs.get('curv_idx', [])
parm_u = context_nurbs.get('parm_u', [])
parm_v = context_nurbs.get('parm_v', [])
name = context_nurbs.get('name', 'ObjNurb')
cstype = context_nurbs.get('cstype', None)
if cstype == None:
print '\tWarning, cstype not found'
return
if cstype != 'bspline':
print '\tWarning, cstype is not supported (only bspline)'
return
if not curv_idx:
print '\tWarning, curv argument empty or not set'
return
if len(deg) > 1 or parm_v:
print '\tWarning, surfaces not supported'
return
cu = bpy.data.curves.new(name, 'Curve')
cu.flag |= 1 # 3D curve
nu = None
for pt in curv_idx:
pt = vert_loc[pt]
pt = (pt[0], pt[1], pt[2], 1.0)
if nu == None:
nu = cu.appendNurb(pt)
else:
nu.append(pt)
nu.orderU = deg[0]+1
# get for endpoint flag from the weighting
if curv_range and len(parm_u) > deg[0]+1:
do_endpoints = True
for i in xrange(deg[0]+1):
if abs(parm_u[i]-curv_range[0]) > 0.0001:
do_endpoints = False
break
if abs(parm_u[-(i+1)]-curv_range[1]) > 0.0001:
do_endpoints = False
break
else:
do_endpoints = False
if do_endpoints:
nu.flagU |= 2
# close
'''
do_closed = False
if len(parm_u) > deg[0]+1:
for i in xrange(deg[0]+1):
#print curv_idx[i], curv_idx[-(i+1)]
if curv_idx[i]==curv_idx[-(i+1)]:
do_closed = True
break
if do_closed:
nu.flagU |= 1
'''
ob = scn.objects.new(cu)
new_objects.append(ob)
def strip_slash(line_split):
if line_split[-1][-1]== '\\':
if len(line_split[-1])==1:
line_split.pop() # remove the \ item
else:
line_split[-1]= line_split[-1][:-1] # remove the \ from the end last number
return True
return False
def get_float_func(filepath):
'''
find the float function for this obj file
@ -547,7 +646,17 @@ def get_float_func(filepath):
# incase all vert values were ints
return float
def load_obj(filepath, CLAMP_SIZE= 0.0, CREATE_FGONS= True, CREATE_SMOOTH_GROUPS= True, CREATE_EDGES= True, SPLIT_OBJECTS= True, SPLIT_GROUPS= True, SPLIT_MATERIALS= True, IMAGE_SEARCH=True):
def load_obj(filepath,
CLAMP_SIZE= 0.0,
CREATE_FGONS= True,
CREATE_SMOOTH_GROUPS= True,
CREATE_EDGES= True,
SPLIT_OBJECTS= True,
SPLIT_GROUPS= True,
SPLIT_MATERIALS= True,
ROTATE_X90= True,
IMAGE_SEARCH=True,
POLYGROUPS=False):
'''
Called by the user interface or another script.
load_obj(path) - should give acceptable results.
@ -556,13 +665,16 @@ def load_obj(filepath, CLAMP_SIZE= 0.0, CREATE_FGONS= True, CREATE_SMOOTH_GROUPS
'''
print '\nimporting obj "%s"' % filepath
if SPLIT_OBJECTS or SPLIT_GROUPS or SPLIT_MATERIALS:
POLYGROUPS = False
time_main= sys.time()
verts_loc= []
verts_tex= []
faces= [] # tuples of the faces
material_libs= [] # filanems to material libs this uses
vertex_groups = {} # when POLYGROUPS is true
# Get the string to float conversion func for this file- is 'float' for almost all files.
float_func= get_float_func(filepath)
@ -571,7 +683,13 @@ def load_obj(filepath, CLAMP_SIZE= 0.0, CREATE_FGONS= True, CREATE_SMOOTH_GROUPS
context_material= None
context_smooth_group= None
context_object= None
context_vgroup = None
# Nurbs
context_nurbs = {}
nurbs = []
context_parm = '' # used by nurbs too but could be used elsewhere
has_ngons= False
# has_smoothgroups= False - is explicit with len(unique_smooth_groups) being > 0
@ -585,10 +703,11 @@ def load_obj(filepath, CLAMP_SIZE= 0.0, CREATE_FGONS= True, CREATE_SMOOTH_GROUPS
# it means they are multiline-
# since we use xreadline we cant skip to the next line
# so we need to know weather
multi_line_face= False
context_multi_line= ''
print '\tpassing obj file "%s"...' % filepath,
print '\tparsing obj file "%s"...' % filepath,
time_sub= sys.time()
file= open(filepath, 'rU')
for line in file: #.xreadlines():
line = line.lstrip() # rare cases there is white space at the start of the line
@ -607,12 +726,11 @@ def load_obj(filepath, CLAMP_SIZE= 0.0, CREATE_FGONS= True, CREATE_SMOOTH_GROUPS
# Handel faces lines (as faces) and the second+ lines of fa multiline face here
# use 'f' not 'f ' because some objs (very rare have 'fo ' for faces)
elif line.startswith('f') or (line.startswith('l ') and CREATE_EDGES) or multi_line_face:
elif line.startswith('f') or context_multi_line == 'f':
if multi_line_face:
if context_multi_line:
# use face_vert_loc_indicies and face_vert_tex_indicies previously defined and used the obj_face
line_split= line.split()
multi_line_face= False
else:
line_split= line[2:].split()
@ -628,19 +746,19 @@ def load_obj(filepath, CLAMP_SIZE= 0.0, CREATE_FGONS= True, CREATE_SMOOTH_GROUPS
context_object\
))
if line_split[-1][-1]== '\\':
multi_line_face= True
if len(line_split[-1])==1:
line_split.pop() # remove the \ item
else:
line_split[-1]= line_split[-1][:-1] # remove the \ from the end last number
isline= line.startswith('l')
if strip_slash(line_split):
context_multi_line = 'f'
else:
context_multi_line = ''
for v in line_split:
obj_vert= v.split('/')
vert_loc_index= int(obj_vert[0])-1
# Add the vertex to the current group
# *warning*, this wont work for files that have groups defined around verts
if POLYGROUPS and context_vgroup:
vertex_groups[context_vgroup].append(vert_loc_index)
# Make relative negative vert indicies absolute
if vert_loc_index < 0:
@ -648,24 +766,60 @@ def load_obj(filepath, CLAMP_SIZE= 0.0, CREATE_FGONS= True, CREATE_SMOOTH_GROUPS
face_vert_loc_indicies.append(vert_loc_index)
if not isline:
if len(obj_vert)>1 and obj_vert[1]:
# formatting for faces with normals and textures us
# loc_index/tex_index/nor_index
vert_tex_index= int(obj_vert[1])-1
# Make relative negative vert indicies absolute
if vert_tex_index < 0:
vert_tex_index= len(verts_tex) + vert_tex_index + 1
face_vert_tex_indicies.append(vert_tex_index)
else:
# dummy
face_vert_tex_indicies.append(0)
if len(obj_vert)>1 and obj_vert[1]:
# formatting for faces with normals and textures us
# loc_index/tex_index/nor_index
vert_tex_index= int(obj_vert[1])-1
# Make relative negative vert indicies absolute
if vert_tex_index < 0:
vert_tex_index= len(verts_tex) + vert_tex_index + 1
face_vert_tex_indicies.append(vert_tex_index)
else:
# dummy
face_vert_tex_indicies.append(0)
if len(face_vert_loc_indicies) > 4:
has_ngons= True
elif CREATE_EDGES and (line.startswith('l ') or context_multi_line == 'l'):
# very similar to the face load function above with some parts removed
if context_multi_line:
# use face_vert_loc_indicies and face_vert_tex_indicies previously defined and used the obj_face
line_split= line.split()
else:
line_split= line[2:].split()
face_vert_loc_indicies= []
face_vert_tex_indicies= []
# Instance a face
faces.append((\
face_vert_loc_indicies,\
face_vert_tex_indicies,\
context_material,\
context_smooth_group,\
context_object\
))
if strip_slash(line_split):
context_multi_line = 'l'
else:
context_multi_line = ''
isline= line.startswith('l')
for v in line_split:
vert_loc_index= int(v)-1
# Make relative negative vert indicies absolute
if vert_loc_index < 0:
vert_loc_index= len(verts_loc) + vert_loc_index + 1
face_vert_loc_indicies.append(vert_loc_index)
elif line.startswith('s'):
if CREATE_SMOOTH_GROUPS:
context_smooth_group= line_value(line.split())
@ -684,12 +838,75 @@ def load_obj(filepath, CLAMP_SIZE= 0.0, CREATE_FGONS= True, CREATE_SMOOTH_GROUPS
context_object= line_value(line.split())
# print 'context_object', context_object
# unique_obects[context_object]= None
elif POLYGROUPS:
context_vgroup = line_value(line.split())
if context_vgroup and context_vgroup != '(null)':
vertex_groups.setdefault(context_vgroup, [])
else:
context_vgroup = None # dont assign a vgroup
elif line.startswith('usemtl'):
context_material= line_value(line.split())
unique_materials[context_material]= None
elif line.startswith('mtllib'): # usemap or usemat
material_libs.extend( line.split()[1:] ) # can have multiple mtllib filenames per line
# Nurbs support
elif line.startswith('cstype '):
context_nurbs['cstype']= line_value(line.split()) # 'rat bspline' / 'bspline'
elif line.startswith('curv ') or context_multi_line == 'curv':
line_split= line.split()
curv_idx = context_nurbs['curv_idx'] = context_nurbs.get('curv_idx', []) # incase were multiline
if not context_multi_line:
context_nurbs['curv_range'] = float_func(line_split[1]), float_func(line_split[2])
line_split[0:3] = [] # remove first 3 items
if strip_slash(line_split):
context_multi_line = 'curv'
else:
context_multi_line = ''
for i in line_split:
vert_loc_index = int(i)-1
if vert_loc_index < 0:
vert_loc_index= len(verts_loc) + vert_loc_index + 1
curv_idx.append(vert_loc_index)
elif line.startswith('parm') or context_multi_line == 'parm':
line_split= line.split()
if context_multi_line:
context_multi_line = ''
else:
context_parm = line_split[1]
line_split[0:2] = [] # remove first 2
if strip_slash(line_split):
context_multi_line = 'parm'
else:
context_multi_line = ''
if context_parm.lower() == 'u':
context_nurbs.setdefault('parm_u', []).extend( [float_func(f) for f in line_split] )
elif context_parm.lower() == 'v': # surfaces not suported yet
context_nurbs.setdefault('parm_v', []).extend( [float_func(f) for f in line_split] )
# else: # may want to support other parm's ?
elif line.startswith('deg '):
context_nurbs['deg']= [int(i) for i in line.split()[1:]]
elif line.startswith('end'):
# Add the nurbs curve
if context_object:
context_nurbs['name'] = context_object
nurbs.append(context_nurbs)
context_nurbs = {}
context_parm = ''
''' # How to use usemap? depricated?
elif line.startswith('usema'): # usemap or usemat
@ -709,6 +926,8 @@ def load_obj(filepath, CLAMP_SIZE= 0.0, CREATE_FGONS= True, CREATE_SMOOTH_GROUPS
print '%.4f sec' % (time_new-time_sub)
time_sub= time_new
if not ROTATE_X90:
verts_loc[:] = [(v[0], v[2], -v[1]) for v in verts_loc]
# deselect all
scn = bpy.data.scenes.active
@ -721,8 +940,13 @@ def load_obj(filepath, CLAMP_SIZE= 0.0, CREATE_FGONS= True, CREATE_SMOOTH_GROUPS
else: SPLIT_OB_OR_GROUP = False
for verts_loc_split, faces_split, unique_materials_split, dataname in split_mesh(verts_loc, faces, unique_materials, filepath, SPLIT_OB_OR_GROUP, SPLIT_MATERIALS):
# Create meshes from the data
create_mesh(scn, new_objects, has_ngons, CREATE_FGONS, CREATE_EDGES, verts_loc_split, verts_tex, faces_split, unique_materials_split, unique_material_images, unique_smooth_groups, dataname)
# Create meshes from the data, warning 'vertex_groups' wont support splitting
create_mesh(scn, new_objects, has_ngons, CREATE_FGONS, CREATE_EDGES, verts_loc_split, verts_tex, faces_split, unique_materials_split, unique_material_images, unique_smooth_groups, vertex_groups, dataname)
# nurbs support
for context_nurbs in nurbs:
create_nurbs(scn, context_nurbs, verts_loc, new_objects)
axis_min= [ 1000000000]*3
axis_max= [-1000000000]*3
@ -745,6 +969,11 @@ def load_obj(filepath, CLAMP_SIZE= 0.0, CREATE_FGONS= True, CREATE_SMOOTH_GROUPS
for ob in new_objects:
ob.setSize(scale, scale, scale)
# Better rotate the vert locations
#if not ROTATE_X90:
# for ob in new_objects:
# ob.RotX = -1.570796326794896558
time_new= sys.time()
print '%.4f sec' % (time_new-time_sub)
@ -758,7 +987,7 @@ def load_obj_ui(filepath, BATCH_LOAD= False):
if BPyMessages.Error_NoFile(filepath):
return
global CREATE_SMOOTH_GROUPS, CREATE_FGONS, CREATE_EDGES, SPLIT_OBJECTS, SPLIT_GROUPS, SPLIT_MATERIALS, CLAMP_SIZE, IMAGE_SEARCH, KEEP_VERT_ORDER
global CREATE_SMOOTH_GROUPS, CREATE_FGONS, CREATE_EDGES, SPLIT_OBJECTS, SPLIT_GROUPS, SPLIT_MATERIALS, CLAMP_SIZE, IMAGE_SEARCH, POLYGROUPS, KEEP_VERT_ORDER, ROTATE_X90
CREATE_SMOOTH_GROUPS= Draw.Create(0)
CREATE_FGONS= Draw.Create(1)
@ -768,7 +997,9 @@ def load_obj_ui(filepath, BATCH_LOAD= False):
SPLIT_MATERIALS= Draw.Create(0)
CLAMP_SIZE= Draw.Create(10.0)
IMAGE_SEARCH= Draw.Create(1)
POLYGROUPS= Draw.Create(0)
KEEP_VERT_ORDER= Draw.Create(1)
ROTATE_X90= Draw.Create(1)
# Get USER Options
@ -817,9 +1048,10 @@ def load_obj_ui(filepath, BATCH_LOAD= False):
GLOBALS['EVENT'] = e
def do_split(e,v):
global SPLIT_OBJECTS, SPLIT_GROUPS, SPLIT_MATERIALS, KEEP_VERT_ORDER
global SPLIT_OBJECTS, SPLIT_GROUPS, SPLIT_MATERIALS, KEEP_VERT_ORDER, POLYGROUPS
if SPLIT_OBJECTS.val or SPLIT_GROUPS.val or SPLIT_MATERIALS.val:
KEEP_VERT_ORDER.val = 0
POLYGROUPS.val = 0
else:
KEEP_VERT_ORDER.val = 1
@ -831,6 +1063,11 @@ def load_obj_ui(filepath, BATCH_LOAD= False):
if not (SPLIT_OBJECTS.val or SPLIT_GROUPS.val or SPLIT_MATERIALS.val):
KEEP_VERT_ORDER.val = 1
def do_polygroups(e,v):
global SPLIT_OBJECTS, SPLIT_GROUPS, SPLIT_MATERIALS, KEEP_VERT_ORDER, POLYGROUPS
if POLYGROUPS.val:
SPLIT_OBJECTS.val = SPLIT_GROUPS.val = SPLIT_MATERIALS.val = 0
def do_help(e,v):
url = __url__[0]
print 'Trying to open web browser with documentation at this address...'
@ -849,7 +1086,7 @@ def load_obj_ui(filepath, BATCH_LOAD= False):
ui_x -= 165
ui_y -= 90
global CREATE_SMOOTH_GROUPS, CREATE_FGONS, CREATE_EDGES, SPLIT_OBJECTS, SPLIT_GROUPS, SPLIT_MATERIALS, CLAMP_SIZE, IMAGE_SEARCH, KEEP_VERT_ORDER
global CREATE_SMOOTH_GROUPS, CREATE_FGONS, CREATE_EDGES, SPLIT_OBJECTS, SPLIT_GROUPS, SPLIT_MATERIALS, CLAMP_SIZE, IMAGE_SEARCH, POLYGROUPS, KEEP_VERT_ORDER, ROTATE_X90
Draw.Label('Import...', ui_x+9, ui_y+159, 220, 21)
Draw.BeginAlign()
@ -860,17 +1097,20 @@ def load_obj_ui(filepath, BATCH_LOAD= False):
Draw.Label('Separate objects by OBJ...', ui_x+9, ui_y+110, 220, 20)
Draw.BeginAlign()
SPLIT_OBJECTS = Draw.Toggle('Object', EVENT_REDRAW, ui_x+9, ui_y+89, 70, 21, SPLIT_OBJECTS.val, 'Import OBJ Objects into Blender Objects', do_split)
SPLIT_GROUPS = Draw.Toggle('Group', EVENT_REDRAW, ui_x+79, ui_y+89, 70, 21, SPLIT_GROUPS.val, 'Import OBJ Groups into Blender Objects', do_split)
SPLIT_MATERIALS = Draw.Toggle('Material', EVENT_REDRAW, ui_x+149, ui_y+89, 70, 21, SPLIT_MATERIALS.val, 'Import each material into a seperate mesh (Avoids > 16 per mesh error)', do_split)
SPLIT_OBJECTS = Draw.Toggle('Object', EVENT_REDRAW, ui_x+9, ui_y+89, 55, 21, SPLIT_OBJECTS.val, 'Import OBJ Objects into Blender Objects', do_split)
SPLIT_GROUPS = Draw.Toggle('Group', EVENT_REDRAW, ui_x+64, ui_y+89, 55, 21, SPLIT_GROUPS.val, 'Import OBJ Groups into Blender Objects', do_split)
SPLIT_MATERIALS = Draw.Toggle('Material', EVENT_REDRAW, ui_x+119, ui_y+89, 60, 21, SPLIT_MATERIALS.val, 'Import each material into a seperate mesh (Avoids > 16 per mesh error)', do_split)
Draw.EndAlign()
# Only used for user feedback
KEEP_VERT_ORDER = Draw.Toggle('Keep Vert Order', EVENT_REDRAW, ui_x+229, ui_y+89, 110, 21, KEEP_VERT_ORDER.val, 'Keep vert and face order, disables split options, enable for morph targets', do_vertorder)
KEEP_VERT_ORDER = Draw.Toggle('Keep Vert Order', EVENT_REDRAW, ui_x+184, ui_y+89, 113, 21, KEEP_VERT_ORDER.val, 'Keep vert and face order, disables split options, enable for morph targets', do_vertorder)
ROTATE_X90 = Draw.Toggle('-X90', EVENT_REDRAW, ui_x+302, ui_y+89, 38, 21, ROTATE_X90.val, 'Rotate X 90.')
Draw.Label('Options...', ui_x+9, ui_y+60, 211, 20)
CLAMP_SIZE = Draw.Number('Clamp Scale: ', EVENT_NONE, ui_x+9, ui_y+39, 211, 21, CLAMP_SIZE.val, 0.0, 1000.0, 'Clamp the size to this maximum (Zero to Disable)')
IMAGE_SEARCH = Draw.Toggle('Image Search', EVENT_NONE, ui_x+229, ui_y+39, 110, 21, IMAGE_SEARCH.val, 'Search subdirs for any assosiated images (Warning, may be slow)')
CLAMP_SIZE = Draw.Number('Clamp Scale: ', EVENT_NONE, ui_x+9, ui_y+39, 130, 21, CLAMP_SIZE.val, 0.0, 1000.0, 'Clamp the size to this maximum (Zero to Disable)')
POLYGROUPS = Draw.Toggle('Poly Groups', EVENT_REDRAW, ui_x+144, ui_y+39, 90, 21, POLYGROUPS.val, 'Import OBJ groups as vertex groups.', do_polygroups)
IMAGE_SEARCH = Draw.Toggle('Image Search', EVENT_NONE, ui_x+239, ui_y+39, 100, 21, IMAGE_SEARCH.val, 'Search subdirs for any assosiated images (Warning, may be slow)')
Draw.BeginAlign()
Draw.PushButton('Online Help', EVENT_REDRAW, ui_x+9, ui_y+9, 110, 21, 'Load the wiki page for this script', do_help)
Draw.PushButton('Cancel', EVENT_EXIT, ui_x+119, ui_y+9, 110, 21, '', obj_ui_set_event)
@ -920,7 +1160,9 @@ def load_obj_ui(filepath, BATCH_LOAD= False):
SPLIT_OBJECTS.val,\
SPLIT_GROUPS.val,\
SPLIT_MATERIALS.val,\
ROTATE_X90.val,\
IMAGE_SEARCH.val,\
POLYGROUPS.val
)
else: # Normal load
@ -932,7 +1174,9 @@ def load_obj_ui(filepath, BATCH_LOAD= False):
SPLIT_OBJECTS.val,\
SPLIT_GROUPS.val,\
SPLIT_MATERIALS.val,\
ROTATE_X90.val,\
IMAGE_SEARCH.val,\
POLYGROUPS.val
)
Window.WaitCursor(0)
@ -949,34 +1193,28 @@ if __name__=='__main__' and not DEBUG:
else:
Window.FileSelector(load_obj_ui, 'Import a Wavefront OBJ', '*.obj')
# For testing compatibility
'''
# For testing compatibility
else:
# DEBUG ONLY
TIME= sys.time()
DIR = '/fe/obj'
import os
print 'Searching for files'
os.system('find /fe/obj -iname "*.obj" > /tmp/temp3ds_list')
def fileList(path):
for dirpath, dirnames, filenames in os.walk(path):
for filename in filenames:
yield os.path.join(dirpath, filename)
print '...Done'
file= open('/tmp/temp3ds_list', 'rU')
lines= file.readlines()
file.close()
def between(v,a,b):
if v <= max(a,b) and v >= min(a,b):
return True
return False
for i, _obj in enumerate(lines):
if between(i, 0,20):
_obj= _obj[:-1]
print 'Importing', _obj, '\nNUMBER', i, 'of', len(lines)
_obj_file= _obj.split('/')[-1].split('\\')[-1]
newScn= bpy.data.scenes.new(_obj_file)
files = [f for f in fileList(DIR) if f.lower().endswith('.obj')]
files.sort()
for i, obj_file in enumerate(files):
if 0 < i < 20:
print 'Importing', obj_file, '\nNUMBER', i, 'of', len(files)
newScn= bpy.data.scenes.new(os.path.basename(obj_file))
newScn.makeCurrent()
load_obj(_obj, False)
load_obj(obj_file, False, IMAGE_SEARCH=0)
print 'TOTAL TIME: %.6f' % (sys.time() - TIME)
'''

@ -85,7 +85,7 @@ def imageConvertCompat(path):
def vrmlFormat(data):
'''
Keep this as a valid vrml file, but format in a way we can pradict.
Keep this as a valid vrml file, but format in a way we can predict.
'''
# Strip all commends - # not in strings - warning multiline strings are ignored.
def strip_comment(l):

@ -68,8 +68,13 @@ v5.5 format.
# ***** END GPL LICENCE BLOCK *****
import Blender
import struct, cStringIO, operator
import BPyMesh
try: import struct
except: struct = None
try: import cStringIO
except: cStringIO = None
try: import operator
except: operator = None
VCOL_NAME = "\251 Per-Face Vertex Colors"
DEFAULT_NAME = "\251 Blender Default"
@ -95,12 +100,16 @@ def write(filename):
icon = "" #generate_icon()
meshes = []
mesh_object_name_lookup = {} # for name lookups only
for obj in objects:
mesh = BPyMesh.getMeshFromObject(obj, None, True, False, scn)
if mesh:
mesh.transform(obj.matrixWorld)
meshes.append(mesh)
mesh_object_name_lookup[mesh] = obj.name
del obj
material_names = get_used_material_names(meshes)
tags = generate_tags(material_names)
surfs = generate_surfs(material_names)
@ -111,7 +120,7 @@ def write(filename):
layer_index = 0
for mesh in meshes:
layr = generate_layr(obj.name, layer_index)
layr = generate_layr(mesh_object_name_lookup[mesh], layer_index)
pnts = generate_pnts(mesh)
bbox = generate_bbox(mesh)
pols = generate_pols(mesh)
@ -149,7 +158,9 @@ def write(filename):
layer_index += 1
mesh.verts = None # save some ram
del mesh_object_name_lookup
for surf in surfs:
chunks.append(surf)
@ -345,23 +356,28 @@ def generate_vmad_vc(mesh):
# === Generate Per-Face UV Coords (VMAD Chunk) ===
# ================================================
def generate_vmad_uv(mesh):
data = cStringIO.StringIO()
data.write("TXUV") # type
data.write(struct.pack(">H", 2)) # dimension
data.write(generate_nstring("Blender's UV Coordinates")) # name
layers = mesh.getUVLayerNames()
org_uv = mesh.activeUVLayer
for l in layers:
mesh.activeUVLayer = l
data = cStringIO.StringIO()
data.write("TXUV") # type
data.write(struct.pack(">H", 2)) # dimension
data.write(generate_nstring(l)) # name
for i, f in enumerate(mesh.faces):
if not i%100:
Blender.Window.DrawProgressBar(float(i)/len(mesh.faces), "Writing UV Coordinates")
uv = f.uv
f_v = f.v
for j in xrange(len(f)-1, -1, -1): # Reverse order
U,V = uv[j]
v = f_v[j].index
data.write(struct.pack(">H", v)) # vertex index
data.write(struct.pack(">H", i)) # face index
data.write(struct.pack(">ff", U, V))
for i, f in enumerate(mesh.faces):
if not i%100:
Blender.Window.DrawProgressBar(float(i)/len(mesh.faces), "Writing UV Coordinates")
uv = f.uv
f_v = f.v
for j in xrange(len(f)-1, -1, -1): # Reverse order
U,V = uv[j]
v = f_v[j].index
data.write(struct.pack(">H", v)) # vertex index
data.write(struct.pack(">H", i)) # face index
data.write(struct.pack(">ff", U, V))
mesh.activeUVLayer = org_uv
return data.getvalue()
# ======================================
@ -685,4 +701,7 @@ def fs_callback(filename):
if not filename.lower().endswith('.lwo'): filename += '.lwo'
write(filename)
Blender.Window.FileSelector(fs_callback, "Export LWO", Blender.sys.makename(ext='.lwo'))
if struct and cStringIO and operator:
Blender.Window.FileSelector(fs_callback, "Export LWO", Blender.sys.makename(ext='.lwo'))
else:
Blender.Draw.PupMenu("Error%t|This script requires a full python installation")

@ -612,29 +612,9 @@ class md2_obj:
######################################################
# Validation
######################################################
def validation(object):
global user_frame_list
#move the object to the origin if it's not already there
if object.getLocation('worldspace')!=(0.0, 0.0, 0.0):
print "Model not centered at origin"
result=Blender.Draw.PupMenu("Model not centered at origin%t|Center (will not work with animations!)|Do not center")
if result==1:
object.setLocation(0.0,0.0,0.0)
#resize the object in case it is not the right size
if object.getSize('worldspace')!=(1.0,1.0,1.0):
print "Object is scaled-You should scale the mesh verts, not the object"
result=Blender.Draw.PupMenu("Object is scaled-You should scale the mesh verts, not the object%t|Fix scale (will not work with animations!)|Do not scale")
if result==1:
object.setSize(1.0,1.0,1.0)
if object.getEuler('worldspace')!=Blender.Mathutils.Euler(0.0,0.0,0.0):
print "object.rot: ", object.getEuler('worldspace')
print "Object is rotated-You should rotate the mesh verts, not the object"
result=Blender.Draw.PupMenu("Object is rotated-You should rotate the mesh verts, not the object%t|Fix rotation (will not work with animations!)|Do not rotate")
if result==1:
object.setEuler([0.0,0.0,0.0])
#get access to the mesh data
mesh=object.getData(False, True) #get the object (not just name) and the Mesh, not NMesh
@ -696,7 +676,8 @@ def validation(object):
result=Blender.Draw.PupMenu("Model has more than 1 texture map assigned%t|Quit")
#return False
if mesh_image:
size=mesh_image.getSize()
try: size=mesh_image.getSize()
except: size= 256,256 # No image data
#is this really what the user wants
if (size[0]!=256 or size[1]!=256):
print "Texture map size is non-standard (not 256x256), it is: ",size[0],"x",size[1]
@ -753,6 +734,8 @@ def fill_md2(md2, object):
#create the vertex list from the first frame
Blender.Set("curframe", 1)
has_uvs = mesh.faceUV
#header information
md2.ident=844121161
md2.version=8
@ -761,9 +744,11 @@ def fill_md2(md2, object):
#get the skin information
#use the first faces' image for the texture information
if mesh.faceUV:
if has_uvs:
mesh_image=mesh.faces[0].image
size=mesh_image.getSize()
try: size=mesh_image.getSize()
except: size= 256,256
md2.skin_width=size[0]
md2.skin_height=size[1]
md2.num_skins=1
@ -777,12 +762,14 @@ def fill_md2(md2, object):
#put texture information in the md2 structure
#build UV coord dictionary (prevents double entries-saves space)
if not has_uvs:
t=(0,0)
for face in mesh.faces:
for i in xrange(0,3):
if mesh.faceUV:
if has_uvs:
t=(face.uv[i])
else:
t=(0,0)
tex_key=(t[0],t[1])
if not tex_list.has_key(tex_key):
tex_list[tex_key]=tex_count
@ -798,16 +785,25 @@ def fill_md2(md2, object):
#put faces in the md2 structure
#for each face in the model
if not has_uvs:
uv_coords=[(0,0)]*3
for this_face in xrange(0, md2.num_faces):
md2.faces.append(md2_face())
mf = mesh.faces[this_face]
mf_v = mf.v
if has_uvs:
uv_coords = mf.uv
for i in xrange(0,3):
#blender uses indexed vertexes so this works very well
md2.faces[this_face].vertex_index[i]=mesh.faces[this_face].verts[i].index
md2.faces[this_face].vertex_index[i] = mf_v[i].index
#lookup texture index in dictionary
if mesh.faceUV:
uv_coord=(mesh.faces[this_face].uv[i])
else:
uv_coord=(0,0)
if has_uvs:
uv_coord = uv_coords[i]
# otherwise we set it before
tex_key=(uv_coord[0],uv_coord[1])
tex_index=tex_list[tex_key]
md2.faces[this_face].texture_index[i]=tex_index
@ -837,13 +833,18 @@ def fill_md2(md2, object):
for frame_counter in xrange(0,md2.num_frames):
progress+=progressIncrement
Blender.Window.DrawProgressBar(progress, "Calculating Frame: "+str(frame_counter))
Blender.Window.DrawProgressBar(progress, "Calculating Frame: %d of %d" % (frame_counter, md2.num_frames))
#add a frame
md2.frames.append(md2_frame())
#update the mesh objects vertex positions for the animation
Blender.Set("curframe", frame_counter) #set blender to the correct frame
mesh.getFromObject(object.name) #update the mesh to make verts current
mesh.getFromObject(object) #update the mesh to make verts current
mesh.transform(object.matrixWorld)
#each frame has a scale and transform value that gets the vertex value between 0-255
#since the scale and transform are the same for the all the verts in the frame, we only need
@ -862,13 +863,14 @@ def fill_md2(md2, object):
frame_max_z=-100000.0
for face in mesh.faces:
for vert in face.verts:
if frame_min_x>vert.co[1]: frame_min_x=vert.co[1]
if frame_max_x<vert.co[1]: frame_max_x=vert.co[1]
if frame_min_y>vert.co[0]: frame_min_y=vert.co[0]
if frame_max_y<vert.co[0]: frame_max_y=vert.co[0]
if frame_min_z>vert.co[2]: frame_min_z=vert.co[2]
if frame_max_z<vert.co[2]: frame_max_z=vert.co[2]
for vert in face:
co = vert.co
if frame_min_x>co[1]: frame_min_x=co[1]
if frame_max_x<co[1]: frame_max_x=co[1]
if frame_min_y>co[0]: frame_min_y=co[0]
if frame_max_y<co[0]: frame_max_y=co[0]
if frame_min_z>co[2]: frame_min_z=co[2]
if frame_max_z<co[2]: frame_max_z=co[2]
#the scale is the difference between the min and max (on that axis) / 255
frame_scale_x=(frame_max_x-frame_min_x)/255
@ -896,9 +898,10 @@ def fill_md2(md2, object):
#then translates the point so it's not less than 0
#then scale it so it's between 0..255
#print "frame scale : ", frame_scale_x, " ", frame_scale_y, " ", frame_scale_z
new_x=int((mesh.verts[vert_counter].co[1]-frame_trans_x)/frame_scale_x)
new_y=int((mesh.verts[vert_counter].co[0]-frame_trans_y)/frame_scale_y)
new_z=int((mesh.verts[vert_counter].co[2]-frame_trans_z)/frame_scale_z)
co = mesh.verts[vert_counter].co
new_x=int((co[1]-frame_trans_x)/frame_scale_x)
new_y=int((co[0]-frame_trans_y)/frame_scale_y)
new_z=int((co[2]-frame_trans_z)/frame_scale_z)
#put them in the structure
md2.frames[frame_counter].vertices[vert_counter].vertices=(new_x, new_y, new_z)
@ -908,14 +911,14 @@ def fill_md2(md2, object):
#swap y and x for difference in axis orientation
x1=-mesh.verts[vert_counter].no[1]
y1=mesh.verts[vert_counter].no[0]
z1=mesh.verts[vert_counter].no[2]
no = mesh.verts[vert_counter].no
x1= -no[1]
y1= no[0]
z1= no[2]
for j in xrange(0,162):
#dot = (x[0]*y[0]+x[1]*y[1]+x[2]*y[2])
dot = (x1*MD2_NORMALS[j][0]+
y1*MD2_NORMALS[j][1]+
z1*MD2_NORMALS[j][2]);
dot = (x1*MD2_NORMALS[j][0] + y1*MD2_NORMALS[j][1]+ z1*MD2_NORMALS[j][2]);
if (dot > maxdot):
maxdot = dot;
maxdotindex = j;

@ -3,7 +3,7 @@
Name: 'Mirror Vertex Locations & Weight'
Blender: 241
Group: 'Mesh'
Tooltip: 'Snap Verticies to X mirrord locations and weights.'
Tooltip: 'Snap Verticies to X mirrored locations and weights.'
"""
__author__ = "Campbell Barton aka ideasman42"
@ -11,11 +11,11 @@ __url__ = ["www.blender.org", "blenderartists.org", "www.python.org"]
__version__= '1.0'
__bpydoc__= '''\
This script is used to mirror vertex locations and weights
It is usefull if you have a model that was made symetrical
It is useful if you have a model that was made symmetrical
but has verts that have moved from their mirrored locations slightly,
casuing blenders X-Mirror options not to work.
causing blenders X-Mirror options not to work.
Weights can be mirrored too, this is usefull if you want to model 1 side of a mesh, copy the mesh and flip it.
Weights can be mirrored too, this is useful if you want to model 1 side of a mesh, copy the mesh and flip it.
You can then use this script to mirror to the copy, even creating new flipped vertex groups, renaming group name left to right or .L to .R
Vertex positions are mirrored by doing a locational lookup,

@ -3,7 +3,7 @@
Name: 'Poly Reduce Selection (Unsubsurf)'
Blender: 245
Group: 'Mesh'
Tooltip: 'pradictable mesh simplifaction maintaining face loops'
Tooltip: 'predictable mesh simplifaction maintaining face loops'
"""
from Blender import Scene, Mesh, Window, sys
@ -50,7 +50,7 @@ def my_mesh_util(me):
for edkey, count in edge_count.iteritems():
# Ignore verts that connect to edges with more then 2 faces.
# Ignore verts that connect to edges with more than 2 faces.
if count != 2:
vert_faces[edkey[0]] = None
vert_faces[edkey[1]] = None

@ -52,7 +52,7 @@ A pop-up will provide further options, if the results of a method are not adequa
import Blender
import bpy
from Blender import Window
from Blender.Mathutils import MidpointVecs, Vector, CrossVecs
from Blender.Mathutils import MidpointVecs, Vector
from Blender.Mathutils import AngleBetweenVecs as _AngleBetweenVecs_
import BPyMessages
@ -119,7 +119,7 @@ class edgeLoop(object):
# GENERATE AN AVERAGE NORMAL FOR THE WHOLE LOOP.
self.normal = Vector()
for e in self.edges:
n = CrossVecs(self.centre-e.co1, self.centre-e.co2)
n = (self.centre-e.co1).cross(self.centre-e.co2)
# Do we realy need tot normalize?
n.normalize()
self.normal += n
@ -149,7 +149,7 @@ class edgeLoop(object):
a = n1-n2
b = n1-n3
normal1 = CrossVecs(a,b)
normal1 = a.cross(b)
normal1.normalize()
n1 = e.co2
@ -159,7 +159,7 @@ class edgeLoop(object):
a = n1-n2
b = n1-n3
normal2 = CrossVecs(a,b)
normal2 = a.cross(b)
normal2.normalize()
# Reuse normal1 var

@ -164,8 +164,8 @@ class Fold:
sangle = Mathutils.AngleBetweenVecs(self.refPolyNormal, self.polyNormal)
if(sangle!=sangle):
sangle=0.0
ncp = Mathutils.CrossVecs(self.refPolyNormal, self.polyNormal)
dp = Mathutils.DotVecs(ncp, self.edge.vector)
ncp = self.refPolyNormal.cross(self.polyNormal)
dp = ncp.dot(self.edge.vector)
if(dp>0.0):
return +sangle
else:
@ -855,7 +855,7 @@ class Poly:
p.resize3D()
q = a-c
q.resize3D()
return CrossVecs(p,q)
return p.cross(q)
def makeEdges(self):
self.edges = []
for i in xrange(self.nPoints()):

@ -0,0 +1,58 @@
#!BPY
"""
Name: 'Copy Active to Selected'
Blender: 249
Group: 'Object'
Tooltip: 'For every selected object, copy the active to their loc/size/rot'
"""
# ***** BEGIN GPL LICENSE BLOCK *****
#
# Script copyright (C) Campbell Barton
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
from Blender import Window, sys, Draw
import bpy
def my_object_util(sce):
ob_act = sce.objects.active
if not ob_act:
Draw.PupMenu('Error%t|No active object selected')
return
mats = [ob.matrixWorld for ob in sce.objects.context if ob != ob_act]
for m in mats:
ob_copy = ob_act.copy()
sce.objects.link(ob_copy)
ob_copy.setMatrix(m)
ob_copy.Layers = ob.Layers
def main():
sce = bpy.data.scenes.active
Window.WaitCursor(1)
my_object_util(sce)
Window.WaitCursor(0)
if __name__ == '__main__':
main()

@ -10,7 +10,7 @@ __url__= ["blender", "blenderartist"]
__version__= "1.0"
__bpydoc__= """\
This script takes the selected mesh objects, devides them into 2 groups
This script takes the selected mesh objects, divides them into 2 groups
Cutters and The objects to be cut.
Cutters are meshes with no faces, just edge loops. and any meshes with faces will be cut.
@ -128,14 +128,14 @@ def sorted_indicies(i1, i2):
def fake_length2d(pt1, pt2):
'''
Only used for comparison so dont sqrt
Only used for comparison so don't sqrt
'''
#return math.sqrt(abs(pow(x1-x2, 2)+ pow(y1-y2, 2)))
return pow(pt1[0]-pt2[0], 2) + pow(pt1[1]- pt2[1], 2)
def length2d(pt1, pt2):
'''
Only used for comparison so dont sqrt
Only used for comparison so don't sqrt
'''
#return math.sqrt(abs(pow(x1-x2, 2)+ pow(y1-y2, 2)))
return sqrt(pow(pt1[0]-pt2[0], 2) + pow(pt1[1]- pt2[1], 2))
@ -150,7 +150,7 @@ def tri_area_2d(v1, v2, v3):
return 0.25 * sqrt(abs(p*(p-2*e1)*(p-2*e2)*(p-2*e3)))
def tri_pt_find_z_2d(pt, tri):
""" Takes a face and 3d vector and assigns teh vectors Z to its on the face"""
""" Takes a face and 3d vector and assigns the vectors Z to its on the face"""
l1= tri_area_2d(tri[1], tri[2], pt)
l2= tri_area_2d(tri[0], tri[2], pt)
@ -170,7 +170,7 @@ def tri_pt_find_z_2d(pt, tri):
def tri_pt_find_uv_2d(pt, tri, uvs):
""" Takes a face and 3d vector and assigns teh vectors Z to its on the face"""
""" Takes a face and 3d vector and assigns the vectors Z to its on the face"""
l1= tri_area_2d(tri[1], tri[2], pt)
l2= tri_area_2d(tri[0], tri[2], pt)
@ -288,12 +288,12 @@ def terrain_cut_2d(t, c, PREF_Z_LOC):
# Loop through the cutter edges.
for ei_c, ed_c in enumerate(me_c.edges):
# If the cutter edge has 2 verts inside the same face then we can ignore it
# Bothe are different faces or None
# Both are different faces or None
if cut_vert_terrain_faces[ed_c.v1.index] != cut_vert_terrain_faces[ed_c.v2.index] or\
cut_vert_terrain_faces[ed_c.v1.index] == cut_vert_terrain_faces[ed_c.v2.index] == None:
eb_c= c.edge_bounds[ei_c]
if bounds_intersect(eb_t, eb_c): # face/edge bounds intersect?
# Now we know the 2 edges might intersect, we'll do a propper test
# Now we know the 2 edges might intersect, we'll do a proper test
x= LineIntersect2D(ed_t.v1.co, ed_t.v2.co, ed_c.v1.co, ed_c.v2.co)
if x:
@ -340,7 +340,7 @@ def terrain_cut_2d(t, c, PREF_Z_LOC):
for f in faces:
faces_intersecting.setdefault(f.index, []).append(ed_isect)
# this list is used to store edges that are totaly inside a face ( no intersections with terrain)
# this list is used to store edges that are totally inside a face ( no intersections with terrain)
# we can remove these as we
face_containing_edges= [[] for i in xrange(len(me_t.faces))]
for ed_c in me_c.edges:
@ -412,8 +412,8 @@ def terrain_cut_2d(t, c, PREF_Z_LOC):
# edges that dont have a vert in the face have to span between to intersection points
# since we dont know the other point at any 1 time we need to remember edges that
# edges that don't have a vert in the face have to span between to intersection points
# since we don't know the other point at any 1 time we need to remember edges that
# span a face and add them once we'v collected both
# first add outline edges
edge_span_face= {}
@ -507,7 +507,7 @@ def terrain_cut_2d(t, c, PREF_Z_LOC):
# 0,2,3
f_uv_mod= f_uv[0], f_uv[2], f_uv[3]
f_vco_mod= f_vco[0], f_vco[2], f_vco[3]
# else - side of 0,1,2 - dont modify the quad
# else - side of 0,1,2 - don't modify the quad
uvs[i]= tri_pt_find_uv_2d(v_co, f_vco_mod, f_uv_mod)
@ -579,7 +579,7 @@ def main():
for ob in obs:
if ob.type == 'Mesh':
me= ob.getData(mesh=1)
elif ob.data.flag & 1: # Is the curve 3D? else dont use.
elif ob.data.flag & 1: # Is the curve 3D? else don't use.
me= BPyMesh.getMeshFromObject(ob) # get the curve
else:
continue

@ -1,13 +1,13 @@
#!BPY
"""
Name: 'Drop Onto Ground'
Blender: 245
Blender: 249
Group: 'Object'
Tooltip: 'Drop the selected objects onto "ground" objects'
"""
__author__= "Campbell Barton"
__url__= ["blender.org", "blenderartists.org"]
__version__= "1.0"
__version__= "1.1"
__bpydoc__= """
"""
@ -36,6 +36,7 @@ __bpydoc__= """
from Blender import Draw, Geometry, Mathutils, Window
from Blender.Mathutils import Vector, AngleBetweenVecs, RotationMatrix
import bpy
@ -44,6 +45,8 @@ GLOBALS['GROUND_SOURCE'] = [Draw.Create(1), Draw.Create(0)]
GLOBALS['GROUND_GROUP_NAME'] = Draw.Create('terrain')
GLOBALS['DROP_AXIS'] = [Draw.Create(1), Draw.Create(0)] # on what axis will we drop?
GLOBALS['DROP_OVERLAP_CHECK'] = Draw.Create(1) # is the terrain a single skin?
GLOBALS['DROP_ORIENT'] = Draw.Create(1)
GLOBALS['DROP_ORIENT_VALUE'] = Draw.Create(100.0)
GLOBALS['EVENT'] = 2
GLOBALS['MOUSE'] = None
@ -52,19 +55,18 @@ def collect_terrain_triangles(obs_terrain):
me = bpy.data.meshes.new()
for ob in obs_terrain:
# this matrix takes the object and drop matrix into account
ob_mat = ob.matrixWorld # * drop_matrix
def blend_face_to_terrain_tris(f):
cos = [v.co*ob_mat for v in f]
if len(cos) == 4: return [(cos[0], cos[1], cos[2]), (cos[0], cos[2], cos[3])]
else: return [(cos[0], cos[1], cos[2]), ]
no = f.no
cos = [v.co for v in f]
if len(cos) == 4: return [(cos[0], cos[1], cos[2], no), (cos[0], cos[2], cos[3], no)]
else: return [(cos[0], cos[1], cos[2], no), ]
# Clear
me.verts = None
try: me.getFromObject(ob)
except: pass
me.transform(ob.matrixWorld)
for f in me.faces: # may be [], thats ok
terrain_tris.extend( blend_face_to_terrain_tris(f) )
@ -72,30 +74,34 @@ def collect_terrain_triangles(obs_terrain):
return terrain_tris
def calc_drop_loc(ob, terrain_tris, axis):
pt = Mathutils.Vector(ob.loc)
pt = Vector(ob.loc)
isect = None
isect_best = None
isect_best_no = None
isect_best_len = 0.0
for t1,t2,t3 in terrain_tris:
for t1,t2,t3, no in terrain_tris:
#if Geometry.PointInTriangle2D(pt, t1,t2,t3):
isect = Mathutils.Intersect(t1, t2, t3, axis, pt, 1) # 1==clip
if isect:
if not GLOBALS['DROP_OVERLAP_CHECK'].val:
# Find the first location
return isect
return isect, no
else:
if isect_best:
isect_len = (pt-isect).length
if isect_len < isect_best_len:
isect_best_len = isect_len
isect_best = isect
isect_best_no = no
else:
isect_best_len = (pt-isect).length
isect_best = isect;
return isect_best
isect_best_no = no
return isect_best, isect_best_no
def error_nogroup():
@ -135,13 +141,28 @@ def terrain_clamp(event, value):
if GLOBALS['DROP_AXIS'][0].val:
axis = Mathutils.Vector(0,0,-1)
axis = Vector(0,0,-1)
else:
axis = Mathutils.Vector(Window.GetViewVector())
axis = Vector(Window.GetViewVector())
do_orient = GLOBALS['DROP_ORIENT'].val
do_orient_val = GLOBALS['DROP_ORIENT_VALUE'].val/100.0
if not do_orient_val: do_orient = False
for ob in obs_clamp:
loc = calc_drop_loc(ob, terrain_tris, axis)
loc, no = calc_drop_loc(ob, terrain_tris, axis)
if loc:
if do_orient:
try: ang = AngleBetweenVecs(no, axis)
except:ang = 0.0
if ang > 90.0:
no = -no
ang = 180.0-ang
if ang > 0.0001:
ob_matrix = ob.matrixWorld * RotationMatrix(ang * do_orient_val, 4, 'r', axis.cross(no))
ob.setMatrix(ob_matrix)
ob.loc = loc
# to make the while loop exist
@ -175,7 +196,8 @@ def do_ground_group_name(e,v):
if not g: error_nogroup()
GLOBALS['EVENT'] = e
def do_dummy(e,v):
GLOBALS['EVENT'] = e
EVENT_NONE = 0
EVENT_EXIT = 1
@ -185,7 +207,7 @@ def terain_clamp_ui():
# Only to center the UI
x,y = GLOBALS['MOUSE']
x-=40
y-=60
y-=70
Draw.Label('Drop Axis', x-70,y+120, 60, 20)
Draw.BeginAlign()
@ -204,7 +226,13 @@ def terain_clamp_ui():
GLOBALS['DROP_OVERLAP_CHECK'] = Draw.Toggle('Overlapping Terrain', EVENT_NONE, x-70, y+20, 190, 20, GLOBALS['DROP_OVERLAP_CHECK'].val, "Check all terrain triangles and use the top most (slow)")
Draw.PushButton('Drop Objects', EVENT_EXIT, x+20, y-10, 100, 20, 'Drop the selected objects', terrain_clamp)
Draw.BeginAlign()
GLOBALS['DROP_ORIENT'] = Draw.Toggle('Orient Normal', EVENT_REDRAW, x-70, y-10, 110, 20, GLOBALS['DROP_ORIENT'].val, "Rotate objects to the face normal", do_dummy)
if GLOBALS['DROP_ORIENT'].val:
GLOBALS['DROP_ORIENT_VALUE'] = Draw.Number('', EVENT_NONE, x+40, y-10, 80, 20, GLOBALS['DROP_ORIENT_VALUE'].val, 0.0, 100.0, "Percentage to orient 0.0 - 100.0")
Draw.EndAlign()
Draw.PushButton('Drop Objects', EVENT_EXIT, x+20, y-40, 100, 20, 'Drop the selected objects', terrain_clamp)
# So moving the mouse outside the popup exits the while loop
GLOBALS['EVENT'] = EVENT_EXIT

@ -149,6 +149,7 @@ def read(filename):
'uint8': 'B',
'int16': 'h',
'uint16': 'H',
'ushort': 'H',
'int': 'i',
'int32': 'i',
'uint': 'I',
@ -156,6 +157,7 @@ def read(filename):
'float': 'f',
'float32': 'f',
'float64': 'd',
'double': 'd',
'string': 's'}
obj_spec = object_spec()

@ -2,7 +2,7 @@
# coding: utf-8
""" Registration info for Blender menus: <- these words are ignored
Name: 'Deformed mesh to Rvk'
Blender: 243
Blender: 248
Group: 'Mesh'
Tip: 'Copy deform data (not surf. subdiv) of active obj to rvk of the 2nd selected obj'
"""
@ -11,21 +11,24 @@ __author__ = "Jean-Michel Soler (jms)"
__url__ = ("blender", "blenderartists.org",
"Script's homepage, http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_rvk1versrvk2.htm",
"Communicate problems and errors, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender")
__version__ = "2007/04/27"
__version__ = "2009/05/18"
__bpydoc__ = """\
"DEFORM to RVK2" copies deform data (except EDGESPLIT,DECIMATE,SUBSURF,BOOLEAN,
BUILD,MIRROR,ARRAY) of the active object to the RVK (relative vertex key) of
the other selected object.
"DEFORM to RVK2" copies deformed data (except all data with not exactly
the same number of vertices like EDGESPLIT,DECIMATE,SUBSURF, BOOLEAN,
BUILD, MIRROR, ARRAY) of the active object to the RVK (relative vertex
key, now called Shapes key) of the other selected object.
It is presupposed that the second mesh object is built exactly like the first
one. In fact, it is better to use a true copy with at least one basic shape
key.
key. If there is no other object selected, the script can create a copy.
The new version of this scrit (Blender 2.43) manages the modifier changes.
There are a lot of modifiers but only the ones which just deforms the shape
can be used : LATTICE, CURVE, WAVE, ARMATURE. You can unset these modifiers
from the script.
can be used : LATTICE, CURVE, WAVE, ARMATURE, CAST, DISPLACE, SMOOTH.
SIMPLEDEFORM and SHRINKWRAP are not correctly seen before Blender 2.49, but
they can be copied too. You can unset one or more of these modifiers from
the script.
Usage:
@ -37,9 +40,9 @@ the rvk it will also ask whether it should replace or add a new vertex group.
"""
#----------------------------------------------
# jm soler (c) 2004-2007 : 'Deformed mesh to Rvk' released under GPL licence
# jm soler (c) 2004-2009 : 'Deformed mesh to Rvk'
# released under GPL licence
#----------------------------------------------
"""
Ce programme est libre, vous pouvez le redistribuer et/ou
@ -72,11 +75,6 @@ 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 St, Fifth Floor, Boston, MA 02110-1301 USA
"""
# Copy the rvk (1, or armature, lattice, or
# any mesh deformation except surface
# sbdivision) of the active object to rvk (2) of
# the second selected object. Create rvk or modify
# absolute key if needed.
#----------------------------------------------
# official Page :
# http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_rvk1versrvk2.htm
@ -90,7 +88,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Communiquer les problemes et erreurs sur:
# http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender
#---------------------------------------------
#---------------------------------------------
import Blender
from Blender import NMesh,Draw,Object,Modifier
@ -99,175 +96,246 @@ DEBUG=0
def Value(t):
exec "t=Modifier.Types.%s"%t
return t
return t
def deform2rvk():
def copy_shapes(RVK1,RVK2):
POSSMOD_list=['EDGESPLIT',
'DECIMATE',
'SUBSURF',
'BOOLEAN',
'BUILD',
'MIRROR',
'ARRAY']
'DECIMATE',
'SUBSURF',
'BOOLEAN',
'BUILD',
'MIRROR',
'ARRAY',
'BEVEL',
'EXPLODE']
AUTHMOD_list=['LATTICE',
'CURVE',
'WAVE',
'ARMATURE']
MODIFIERS=0
'CURVE',
'WAVE',
'ARMATURE',
'SMOOTH',
'SIMPLEDEFORM',
'SHRINKWRAP',
'CAST',
'DISPLACE',
'MESHDEFORM']
BMOD=[['Possible Modifiers'],
['Allowed Modifiers']]
# =================================================================
# at leat 2 objects ===============================================
# =================================================================
if len(Object.GetSelected())>1 :
RVK1=Object.GetSelected()[0]
RVK2=Object.GetSelected()[1]
# =============================================================
# must be 2 meshes ============================================
# =============================================================
if RVK1.getType()=='Mesh' and RVK2.getType()=='Mesh':
FRAME=Blender.Get('curframe')
['Allowed Modifiers']]
# =============================================================
# must be 2 meshes ============================================
# =============================================================
if RVK1.getType()=='Mesh' and RVK2.getType()=='Mesh':
#MODIFIERS=0
FRAME=Blender.Get('curframe')
DATA2=RVK2.getData()
if DEBUG: print DATA2.getKey()
# ============================================================
# at least the second must have a shape key ==================
# ============================================================
def select_modifier(RVK1, RVK2, DATA2):
# ======================================================
# in case of modifiers, use =============================
# ======================================================
if RVK1.modifiers:
#MODIFIERS=1
POSSMOD=[Value(t) for t in POSSMOD_list]
AUTHMOD=[Value(t) for t in AUTHMOD_list]
if DEBUG: print 'POSSMOD:',POSSMOD,'\nAUTHMOD:', AUTHMOD
MODRVK1=RVK1.modifiers
block = []
# ===================================================
# === Bloc Menu Modifiers ===1 doc =================
# ===================================================
m=0
for mod in MODRVK1:
if DEBUG: print mod.type
if mod.type in POSSMOD:
BMOD[0].append([Draw.Create(0),mod.type,
m,
POSSMOD_list[POSSMOD.index(mod.type)],
mod[Modifier.Settings.RENDER]==1,
mod[Modifier.Settings.EDITMODE]==1
])
elif mod.type in AUTHMOD:
BMOD[1].append([Draw.Create(1),
mod.type,
m,
AUTHMOD_list[AUTHMOD.index(mod.type)],
mod[Modifier.Settings.RENDER]==1,
mod[Modifier.Settings.EDITMODE]==1
])
m+=1
# ===================================================
# === Bloc Menu Modifiers ===2 display =============
# ===================================================
block.append(BMOD[1][0])
for B in BMOD[1][1:]:
block.append((B[3],B[0],""))
block.append(BMOD[0][0])
block.append("not alredy implemented")
block.append("in this script.")
for B in BMOD[0][1:]:
block.append((B[3],B[0],""))
retval = Blender.Draw.PupBlock("MESH 2 RVK", block)
# ===================================================
# === unset Modifiers =============================
# ===================================================
for B in BMOD[0][1:]:
if DEBUG: print B[2]
MODRVK1[B[2]][Modifier.Settings.RENDER]=0
for B in BMOD[1]:
if not B[1]:
MODRVK1[B[2]][Modifier.Settings.RENDER]=0
# ===================================================
# === update Modifiers =============================
# ===================================================
#RVK1.makeDisplayList()
# =======================================================
# === get deformed mesh ================================
# =======================================================
RVK1NAME=Object.GetSelected()[0].getName()
meshrvk1=NMesh.GetRawFromObject(RVK1NAME)
if DEBUG: print len(meshrvk1.verts)
# =======================================================
# === get normal mesh for vertex group =================
# =======================================================
DATA1=RVK1.getData()
# =======================================================
# === get destination mesh ============================
# =======================================================
DATA2=RVK2.getData()
if DEBUG: print DATA2.getKey()
# ============================================================
# at least the second must have a shape key ==================
# ============================================================
if DATA2.getKey():
# ======================================================
# in case of modifiers use =============================
# ======================================================
if DEBUG: print len(meshrvk1.verts)
if DEBUG: print len(DATA2.verts)
# ========================================================
# ===== is there the same number of vertices =============
# ========================================================
if len(meshrvk1.verts)==len(DATA2.verts):
name = "Do you want to replace or add vertex groups ? %t| YES %x1| NO ? %x2 "
result = Draw.PupMenu(name)
if result==1:
# =====================================================
# ===== Do we save vertex groups ? ===================
# =====================================================
GROUPNAME2=DATA2.getVertGroupNames()
if len(GROUPNAME2)!=0:
for GROUP2 in GROUPNAME2:
DATA2.removeVertGroup(GROUP2)
GROUPNAME1=DATA1.getVertGroupNames()
if len(GROUPNAME1)!=0:
for GROUP1 in GROUPNAME1:
DATA2.addVertGroup(GROUP1)
DATA2.assignVertsToGroup(GROUP1,DATA1.getVertsFromGroup(GROUP1),1.0,'replace')
# ========================================================
# ===== now copy the vertices coords =====================
# ========================================================
for v in meshrvk1.verts:
i= meshrvk1.verts.index(v)
v1=DATA2.verts[i]
for n in [0,1,2]:
v1.co[n]=v.co[n]
DATA2.update()
DATA2.insertKey(FRAME,'relative')
DATA2.update()
RVK2.makeDisplayList()
if RVK1.modifiers:
MODIFIERS=1
POSSMOD=[Value(t) for t in POSSMOD_list]
AUTHMOD=[Value(t) for t in AUTHMOD_list]
if DEBUG: print 'POSSMOD:',POSSMOD,'\nAUTHMOD:', AUTHMOD
MODRVK1=RVK1.modifiers
block = []
# ===================================================
# === Bloc Menu Modifiers ===1 doc =================
# ===================================================
m=0
for mod in MODRVK1:
if DEBUG: print mod.type
if mod.type in POSSMOD:
BMOD[0].append([Draw.Create(0),mod.type,
m,
POSSMOD_list[POSSMOD.index(mod.type)],
mod[Modifier.Settings.RENDER]==1,
mod[Modifier.Settings.EDITMODE]==1
])
elif mod.type in AUTHMOD:
BMOD[1].append([Draw.Create(1),
mod.type,
m,
AUTHMOD_list[AUTHMOD.index(mod.type)],
mod[Modifier.Settings.RENDER]==1,
mod[Modifier.Settings.EDITMODE]==1
])
m+=1
# ===================================================
# === Bloc Menu Modifiers ===2 display =============
# ===================================================
block.append(BMOD[1][0])
for B in BMOD[1][1:]:
block.append((B[3],B[0],""))
block.append(BMOD[0][0])
block.append("not alredy implemented")
block.append("in this script.")
for B in BMOD[0][1:]:
block.append((B[3],B[0],""))
retval = Blender.Draw.PupBlock("MESH 2 RVK", block)
# ===================================================
# === unset Modifiers =============================
# ===================================================
for B in BMOD[0][1:]:
if DEBUG: print B[2]
MODRVK1[B[2]][Modifier.Settings.RENDER]=0
MODRVK1[B[2]][Modifier.Settings.RENDER]|=B[-2]
for B in BMOD[1]:
if not B[1]:
MODRVK1[B[2]][Modifier.Settings.RENDER]=0
# ===================================================
# === update Modifiers =============================
# ===================================================
#RVK1.makeDisplayList()
# =======================================================
# === get deformed mesh ================================
# =======================================================
RVK1NAME=Object.GetSelected()[0].getName()
meshrvk1=NMesh.GetRawFromObject(RVK1NAME)
if DEBUG: print len(meshrvk1.verts)
# =======================================================
# === get normal mesh for vertex group =================
# =======================================================
DATA1=RVK1.getData()
# =======================================================
# === get destination mesh ============================
# =======================================================
DATA2=RVK2.getData()
if DEBUG: print len(meshrvk1.verts)
if DEBUG: print len(DATA2.verts)
# ========================================================
# ===== is there the same number of vertices =============
# ========================================================
if len(meshrvk1.verts)==len(DATA2.verts):
name = "Do you want to replace or add vertex groups ? %t| YES %x1| NO ? %x2 "
result = Draw.PupMenu(name)
if result==1:
# =====================================================
# ===== Do we save vertex groups ? ===================
# =====================================================
GROUPNAME2=DATA2.getVertGroupNames()
if len(GROUPNAME2)!=0:
for GROUP2 in GROUPNAME2:
DATA2.removeVertGroup(GROUP2)
GROUPNAME1=DATA1.getVertGroupNames()
if len(GROUPNAME1)!=0:
for GROUP1 in GROUPNAME1:
DATA2.addVertGroup(GROUP1)
DATA2.assignVertsToGroup(GROUP1,DATA1.getVertsFromGroup(GROUP1),1.0,'replace')
# ========================================================
# ===== now copy the vertices coords =====================
# ========================================================
for v in meshrvk1.verts:
i= meshrvk1.verts.index(v)
v1=DATA2.verts[i]
for n in [0,1,2]:
v1.co[n]=v.co[n]
DATA2.update()
DATA2.insertKey(FRAME,'relative')
DATA2.update()
RVK2.makeDisplayList()
if MODIFIERS:
# ===================================================
# === unset Modifiers =============================
# ===================================================
for B in BMOD[0][1:]:
MODRVK1[B[2]][Modifier.Settings.RENDER]|=B[-2]
for B in BMOD[1]:
if not B[1]:
MODRVK1[B[2]][Modifier.Settings.RENDER]|=B[-2]
else:
name = "Meshes Objects must the same number of vertices %t| Ok. %x1"
result = Draw.PupMenu(name)
return
else:
name = "Second Object must have at least a shape key %t| Ok. %x1"
name = "Meshes Objects must have the same number of vertices %t|Ok. %x1"
result = Draw.PupMenu(name)
return
return
if DATA2.getKey():
select_modifier(RVK1, RVK2, DATA2)
else:
name = "Object must be Meshes %t| Ok. %x1"
name = "Second Object must have at least a shape key %t| Ok. %x1| Add one ? %x2"
result = Draw.PupMenu(name)
return
else :
name = "At least 2 Meshes as to be selected %t| Ok. %x1"
if result :
RVK2.insertShapeKey()
DATA2=RVK2.getData()
select_modifier(RVK1, RVK2, DATA2)
else:
return
else:
name = "Object must be Meshes %t| Ok. %x1"
result = Draw.PupMenu(name)
return
def deform2rvk():
scn = Blender.Scene.GetCurrent()
# =================================================================
# at leat 2 objects ===============================================
# =================================================================
if len(scn.objects.selected) >1 :
RVK1 = Object.GetSelected()[0]
RVK2=Object.GetSelected()[1]
if RVK2.getType()=='Mesh' :
copy_shapes(RVK1,RVK2)
# =================================================================
# ... but if only one...===========================================
# =================================================================
elif len(scn.objects.selected)==1:
name = "At least 2 Meshes must be selected %t| Ok. %x1| Add one ? %x2"
result = Draw.PupMenu(name)
RVK1 = Object.GetSelected()[0]
if result and RVK1.getType()=='Mesh' :
Blender.Object.Duplicate(mesh=1)
RVK2=scn.objects.active
mod = RVK2.modifiers
for m in mod :
RVK2.modifiers.remove(m)
RVK2.LocX+=2.0
copy_shapes(RVK1,RVK2)
scn.objects.selected=[]
RVK2.sel=1
RVK1.sel=1
# ================================================================
# ... and not a mesh...===========================================
# ================================================================
elif result:
name = "Selected object must be a mesh %t| Ok. %x1"
result = Draw.PupMenu(name)
return
else :
return
# ================================================================
# ... if not object at all. =====================================
# ================================================================
else:
name = "At least one Mesh object must be selected %t| Ok. %x1"
result = Draw.PupMenu(name)
return
Blender.Redraw()
EDITMODE=Blender.Window.EditMode()
Blender.Window.EditMode(0)
deform2rvk()
Blender.Window.EditMode(EDITMODE)
END = 0
DEFAULT= Blender.Get('curframe')
while not END:
deform2rvk()
name = "Do you want to copy at a new frame %t| Yes ? %x1| No ? %x2"
result = Draw.PupMenu(name)
if result == 1:
msg = "Frame :"
inputresult = Draw.PupIntInput(msg, DEFAULT , Blender.Get('staframe'), Blender.Get('endframe'))
print inputresult
if inputresult != None:
Blender.Set('curframe',inputresult)
Blender.Window.RedrawAll()
else:
END = 1
else:
END = 1
Blender.Window.EditMode(EDITMODE)

@ -1,7 +1,7 @@
#!BPY
"""
Name: 'GameLogic Example'
Blender: 245
Blender: 249
Group: 'ScriptTemplate'
Tooltip: 'Script template with examples of how to use game logic'
"""
@ -29,63 +29,63 @@ def main():
cont = GameLogic.getCurrentController()
# The KX_GameObject that owns this controller.
own = cont.getOwner()
own = cont.owner
# for scripts that deal with spacial logic
own_pos = own.getPosition()
own_pos = own.worldPosition
# Some example functions, remove to write your own script.
# check for a positive sensor, will run on any object without errors.
print 'Logic info for KX_GameObject', own.getName()
print 'Logic info for KX_GameObject', own.name
input = False
for sens in cont.getSensors():
for sens in cont.sensors:
# The sensor can be on another object, we may want to use it
own_sens = sens.getOwner()
print ' sensor:', sens.getName(),
if sens.isPositive():
own_sens = sens.owner
print ' sensor:', sens.name,
if sens.positive:
print '(true)'
input = True
else:
print '(false)'
for actu in cont.getActuators():
for actu in cont.actuators:
# The actuator can be on another object, we may want to use it
own_actu = actu.getOwner()
print ' actuator:', actu.getName()
own_actu = actu.owner
print ' actuator:', actu.name
# This runs the actuator or turns it off
# note that actuators will continue to run unless explicitly turned off.
if input:
GameLogic.addActiveActuator(actu, True)
cont.activate(actu)
else:
GameLogic.addActiveActuator(actu, False)
cont.deactivate(actu)
# Its also good practice to get sensors and actuators by names
# so any changes to their order wont break the script.
# Its also good practice to get sensors and actuators by name
# rather then index so any changes to their order wont break the script.
# sens_key = cont.getSensor('key_sensor')
# actu_motion = cont.getActuator('motion')
# sens_key = cont.sensors['key_sensor']
# actu_motion = cont.actuators['motion']
# Loop through all other objects in the scene
sce = GameLogic.getCurrentScene()
print 'Scene Objects:', sce.getName()
for ob in sce.getObjectList():
print ' ', ob.getName(), ob.getPosition()
print 'Scene Objects:', sce.name
for ob in sce.objects:
print ' ', ob.name, ob.worldPosition
# Example where collision objects are checked for their properties
# adding to our objects "life" property
"""
actu_collide = cont.getSensor('collision_sens')
for ob in actu_collide.getHitObjectList():
actu_collide = cont.sensors['collision_sens']
for ob in actu_collide.objectHitList:
# Check to see the object has this property
if hasattr(ob, 'life'):
own.life += ob.life
ob.life = 0
print own.life
if ob.has_key('life'):
own['life'] += ob['life']
ob['life'] = 0
print own['life']
"""
main()

@ -1,7 +1,7 @@
#!BPY
"""
Name: 'GameLogic Template'
Blender: 245
Blender: 249
Group: 'ScriptTemplate'
Tooltip: 'Basic template for new game logic scripts'
"""
@ -14,15 +14,15 @@ script_data = \
def main():
cont = GameLogic.getCurrentController()
own = cont.getOwner()
own = cont.owner
sens = cont.getSensor('mySensor')
actu = cont.getActuator('myActuator')
sens = cont.sensors['mySensor']
actu = cont.actuators['myActuator']
if sens.isPositive():
GameLogic.addActiveActuator(actu, True)
if sens.positive:
cont.activate(actu)
else:
GameLogic.addActiveActuator(actu, False)
cont.deactivate(actu)
main()
'''

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