The code from the orange branch has now been copied into HEAD.

Here are some notes written by Ton:

There's several areas I still have to work on, so don't immediately
report bugs!

- Preview renders in buttons window only supports materials now (no
lamp, texture or world)
- Yafray code has to be checked, it might not work
- unified render doesn't work, might not come back even
- lens flares dont work yet
- motion blur and field render doesnt work yet
- exr libraries are static linked still, we look at making it dynamic
loadable
- the compositor is fully in development still

I really advise people to check on the orange cvs logs too (in case you
ignored it), this has most of the information in it.

At this moment I still have to code for Orange deadlines, that defines
my priority listing mostly. And since we don't use Windows there, doing
testing and bugfixing for that platform would be of great help!

Best features of this commit to checkout:

- Grouping
- full fixed library linking system
- custom bone drawing
- bone layers
- Material/Shading nodes
- recode of render engine
- preview renders
- Compositing options

When the work pressure is a bit lower, I'll make nice docs for all of
this!

-Ton-
This commit is contained in:
Chris Want 2006-01-28 18:33:28 +00:00
commit 0d0255f3f5
414 changed files with 46352 additions and 27555 deletions

@ -54,8 +54,8 @@ if os.path.isdir (bs_globals.root_build_dir) == 0:
os.makedirs (bs_globals.root_build_dir+os.sep+'source')
# Blender version.
version='2.41'
shortversion = '241' # for wininst target -> nsis installer creation
version='2.40-alpha1'
shortversion = '240alpha1' # for wininst target -> nsis installer creation
sdl_env = Environment (ENV = os.environ)
freetype_env = Environment (ENV = os.environ)
@ -64,9 +64,10 @@ env = Environment (ENV = os.environ)
if sys.platform == 'linux2' or sys.platform == 'linux-i386':
use_international = 'true'
use_gameengine = 'true'
use_openal = 'true'
use_openal = 'false'
use_fmod = 'false'
use_quicktime = 'false'
use_openexr = 'true'
use_sumo = 'true'
use_ode = 'false'
use_bullet = 'true'
@ -95,6 +96,12 @@ if sys.platform == 'linux2' or sys.platform == 'linux-i386':
png_lib = ['png']
png_libpath = ['/usr/lib']
png_include = ['/usr/include']
# OpenEXR library information
if use_openexr == 'true':
defines += ['WITH_OPENEXR']
openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
openexr_libpath = ['/usr/lib']
openexr_include = ['/usr/include/OpenEXR']
# jpeg library information
jpeg_lib = ['jpeg']
jpeg_libpath = ['/usr/lib']
@ -152,11 +159,12 @@ if sys.platform == 'linux2' or sys.platform == 'linux-i386':
elif sys.platform == 'darwin':
use_international = 'true'
use_gameengine = 'true'
use_gameengine = 'false'
use_openal = 'true'
use_fmod = 'false'
use_openal = 'true'
use_openal = 'false'
use_quicktime = 'true'
use_openexr = 'true'
use_precomp = 'true'
use_sumo = 'true'
use_ode = 'false'
@ -176,7 +184,7 @@ elif sys.platform == 'darwin':
fink_path = '/sw/'
# TODO : try -mpowerpc -mpowerpc-gopt -mpowerpc-gfxopt optims
# doing actual profiling
extra_flags = ['-pipe', '-fPIC', '-funsigned-char', '-mpowerpc', '-mtune=G5']
extra_flags = ['-pipe', '-fPIC', '-funsigned-char', '-ffast-math', '-mpowerpc', '-mtune=G4']
# , '-malign-natural'] malign is causing problems with jpeg lib but worth a 1-2% speedup
#'-force_cpusubtype_ALL', '-mpowerpc-gpopt',
@ -198,6 +206,12 @@ elif sys.platform == 'darwin':
png_lib = ['libpng']
png_libpath = [darwin_precomp + 'png/lib']
png_include = [darwin_precomp + 'png/include']
# OpenEXR library information
if use_openexr == 'true':
defines += ['WITH_OPENEXR']
openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
openexr_libpath = ['/usr/local/lib']
openexr_include = ['/usr/local/include/OpenEXR']
# jpeg library information
jpeg_lib = ['libjpeg']
jpeg_libpath = [darwin_precomp + 'jpeg/lib']
@ -275,10 +289,11 @@ elif sys.platform == 'darwin':
elif sys.platform == 'cygwin':
use_international = 'false'
use_gameengine = 'true'
use_openal = 'true'
use_gameengine = 'false'
use_openal = 'false'
use_fmod = 'false'
use_quicktime = 'false'
use_openexr = 'true'
use_sumo = 'false'
use_ode = 'false'
use_bullet = 'false'
@ -309,6 +324,12 @@ elif sys.platform == 'cygwin':
png_lib = ['png']
png_libpath = ['#../lib/windows/png/lib']
png_include = ['#../lib/windows/png/include']
# OpenEXR library information
if use_openexr == 'true':
defines += ['WITH_OPENEXR']
openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
openexr_libpath = ['/usr/lib']
openexr_include = ['/usr/include/OpenEXR']
# jpeg library information
jpeg_lib = ['jpeg']
jpeg_libpath = ['#../lib/windows/jpeg/lib']
@ -365,6 +386,7 @@ elif sys.platform == 'win32':
use_openal = 'true'
use_fmod = 'false'
use_quicktime = 'true'
use_openexr = 'true'
use_bullet = 'true'
use_sumo = 'true'
use_ode = 'false'
@ -417,6 +439,12 @@ elif sys.platform == 'win32':
png_lib = ['libpng_st']
png_libpath = ['#../lib/windows/png/lib']
png_include = ['#../lib/windows/png/include']
# OpenEXR library information
if use_openexr == 'true':
defines += ['WITH_OPENEXR']
openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
openexr_libpath = ['/usr/lib']
openexr_include = ['/usr/include/OpenEXR']
# jpeg library information
jpeg_lib = ['libjpeg']
jpeg_libpath = ['#../lib/windows/jpeg/lib']
@ -477,6 +505,7 @@ elif string.find (sys.platform, 'sunos') != -1:
use_openal = 'false'
use_fmod = 'false'
use_quicktime = 'false'
use_openexr = 'false'
use_sumo = 'false'
use_ode = 'false'
use_bullet = 'false'
@ -505,6 +534,12 @@ elif string.find (sys.platform, 'sunos') != -1:
png_lib = ['png']
png_libpath = []
png_include = []
# OpenEXR library information
if use_openexr == 'true':
defines += ['WITH_OPENEXR']
openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
openexr_libpath = ['/usr/lib']
openexr_include = ['/usr/include/OpenEXR']
# jpeg library information
jpeg_lib = ['jpeg']
jpeg_libpath = []
@ -561,6 +596,7 @@ elif string.find (sys.platform, 'irix') != -1:
use_openal = 'false'
use_fmod = 'false'
use_quicktime = 'false'
use_openexr = 'false'
use_sumo = 'false'
use_ode = 'false'
use_bullet = 'false'
@ -597,6 +633,12 @@ elif string.find (sys.platform, 'irix') != -1:
png_lib = ['png']
png_libpath = [irix_precomp + '/png/lib']
png_include = [irix_precomp + '/png/include']
# OpenEXR library information
if use_openexr == 'true':
defines += ['WITH_OPENEXR']
openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
openexr_libpath = ['/usr/lib']
openexr_include = ['/usr/include/OpenEXR']
# jpeg library information
jpeg_lib = ['jpeg']
jpeg_libpath = [irix_precomp + '/jpeg/lib']
@ -657,6 +699,7 @@ elif sys.platform=='openbsd3':
use_openal = 'false'
use_fmod = 'false'
use_quicktime = 'false'
use_openexr = 'false'
use_sumo = 'false'
use_ode = 'false'
use_bullet = 'false'
@ -684,6 +727,12 @@ elif sys.platform=='openbsd3':
png_lib = ['png']
png_libpath = ['/usr/local/lib']
png_include = ['/usr/local/include/libpng']
# OpenEXR library information
if use_openexr == 'true':
defines += ['WITH_OPENEXR']
openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
openexr_libpath = ['/usr/lib']
openexr_include = ['/usr/include/OpenEXR']
# jpeg library information
jpeg_lib = ['jpeg']
jpeg_libpath = ['/usr/local/lib']
@ -742,6 +791,7 @@ elif sys.platform=='freebsd4' or sys.platform=='freebsd5':
use_openal = 'false'
use_fmod = 'false'
use_quicktime = 'false'
use_openexr = 'false'
use_sumo = 'false'
use_ode = 'false'
use_bullet = 'false'
@ -769,6 +819,12 @@ elif sys.platform=='freebsd4' or sys.platform=='freebsd5':
png_lib = ['png']
png_libpath = ['/usr/local/lib']
png_include = ['/usr/local/include']
# OpenEXR library information
if use_openexr == 'true':
defines += ['WITH_OPENEXR']
openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
openexr_libpath = ['/usr/lib']
openexr_include = ['/usr/include/OpenEXR']
# jpeg library information
jpeg_lib = ['jpeg']
jpeg_libpath = ['/usr/local/lib']
@ -870,6 +926,7 @@ else:
config.write ("USE_OPENAL = %r\n"%(use_openal))
config.write ("USE_FMOD = %r\n"%(use_fmod))
config.write ("USE_QUICKTIME = %r\n"%(use_quicktime))
config.write ("USE_OPENEXR = %r\n"%(use_openexr))
config.write ("USE_FLUIDSIM = %r\n"%(use_fluidsim))
config.write ("\n# Compiler information.\n")
config.write ("HOST_CC = %r\n"%(env_dict['CC']))
@ -896,6 +953,9 @@ else:
config.write ("PNG_INCLUDE = %r\n"%(png_include))
config.write ("PNG_LIBPATH = %r\n"%(png_libpath))
config.write ("PNG_LIBRARY = %r\n"%(png_lib))
config.write ("OPENEXR_INCLUDE = %r\n"%(openexr_include))
config.write ("OPENEXR_LIBPATH = %r\n"%(openexr_libpath))
config.write ("OPENEXR_LIBRARY = %r\n"%(openexr_lib))
config.write ("JPEG_INCLUDE = %r\n"%(jpeg_include))
config.write ("JPEG_LIBPATH = %r\n"%(jpeg_libpath))
config.write ("JPEG_LIBRARY = %r\n"%(jpeg_lib))
@ -982,6 +1042,9 @@ user_options.AddOptions (
(BoolOption ('USE_QUICKTIME',
'Set to 1 to add support for QuickTime.',
'false')),
(BoolOption ('USE_OPENEXR',
'Set to 1 to add support for OpenEXR.',
'false')),
(BoolOption ('USE_FLUIDSIM', # NT test new
'Set to 0 to disable compilation of fluid simulation library El\'Beem.',
'true')),
@ -1008,6 +1071,9 @@ user_options.AddOptions (
('PNG_INCLUDE', 'Include directory for png header files.'),
('PNG_LIBPATH', 'Library path where the png library is located.'),
('PNG_LIBRARY', 'png library name.'),
('OPENEXR_INCLUDE', 'Include directory for OpenEXR header files.'),
('OPENEXR_LIBPATH', 'Library path where the OpenEXR libraries are located.'),
('OPENEXR_LIBRARY', 'OpenEXR library names.'),
('JPEG_INCLUDE', 'Include directory for jpeg header files.'),
('JPEG_LIBPATH', 'Library path where the jpeg library is located.'),
('JPEG_LIBRARY', 'jpeg library name.'),

@ -13,6 +13,4 @@ Brazilian Portuguese:pt_br
Simplified Chinese:zh_CN
Russian:ru_RU
Croatian:hr_HR
Serbian:sr
Ukrainian:uk
Polish:pl_PL

@ -46,7 +46,6 @@ CCSRCS = FTBitmapGlyph.cpp FTCharmap.cpp FTContour.cpp FTExtrdGlyph.cpp \
include nan_compile.mk
CPPFLAGS += -I../include
CPPFLAGS += -I/usr/X11R6/include
CPPFLAGS += -I$(NAN_FREETYPE)/include -I$(NAN_FREETYPE)/include/freetype2
install: all debug

@ -0,0 +1,11 @@
#ifndef COLLISION_MARGIN_H
#define COLLISION_MARGIN_H
//used by Gjk and some other algorithms
#define CONVEX_DISTANCE_MARGIN 0.04f// 0.1f//;//0.01f
#endif //COLLISION_MARGIN_H

@ -231,11 +231,7 @@ SND_OpenALDevice::SND_OpenALDevice()
m_context = alcCreateContext(dev, NULL);
if (m_context) {
#ifdef AL_VERSION_1_1
alcMakeContextCurrent((ALCcontext*)m_context);
#else
alcMakeContextCurrent(m_context);
#endif
m_audio = true;
m_device = dev;
#ifdef __linux__
@ -343,11 +339,7 @@ SND_OpenALDevice::~SND_OpenALDevice()
if (m_context) {
MakeCurrent();
#ifdef AL_VERSION_1_1
alcDestroyContext((ALCcontext*)m_context);
#else
alcDestroyContext(m_context);
#endif
m_context = NULL;
}
@ -418,7 +410,7 @@ SND_WaveSlot* SND_OpenALDevice::LoadSample(const STR_String& name,
waveslot->SetFileSize(size);
/* what was (our) buffer? */
int buffer = waveslot->GetBuffer();
buffer = waveslot->GetBuffer();
/* get some info out of the sample */
SND_GetSampleInfo((signed char*)memlocation, waveslot);
@ -427,14 +419,9 @@ SND_WaveSlot* SND_OpenALDevice::LoadSample(const STR_String& name,
/* load the sample into openal */
#if defined(OUDE_OPENAL) || defined (__APPLE__)
alutLoadWAVMemory((char*)memlocation, &sampleformat, &data, &numberofsamples, &samplerate); // openal_2.12
alutLoadWAVMemory((ALbyte *)memlocation, &sampleformat, &data, &numberofsamples, &samplerate); // openal_2.12
#else
#ifdef AL_VERSION_1_1
alutLoadWAVMemory((ALbyte *)memlocation, &sampleformat, &data, &numberofsamples, &samplerate, &loop);// openal_2.14+
#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);

@ -59,86 +59,6 @@
#include "BMF_BitmapFont.h"
#ifdef __APPLE__
#include <stdio.h>
static int needs_nvidia_rasterpos_workaround(void)
{
static int well_is_it= -1;
if (well_is_it==-1)
{
well_is_it= (strncmp((char *)glGetString(GL_RENDERER), "NVIDIA GeForce 6800", 18) == 0);
if ( well_is_it != 0)
{
const GLubyte* vers = glGetString(GL_VERSION);
const GLubyte* v = vers;
int major = 0, minor = 0, sub = 0;
//advance to the '-'
while ((*v != 0) && (*v!='-'))
v++;
if (*v == '-')
{
int i = 0;
v++;
while ((v[i] <= '9') && (v[i] >= '0'))
{
major *=10;
major += v[i]-'0';
i++;
}
if (v[i] == '.')
{
i++;
while ((v[i] <= '9') && (v[i] >= '0'))
{
minor *=10;
minor += v[i]-'0';
i++;
}
}
else
major = -1;
if (v[i] == '.')
{
i++;
while ((v[i] <= '9') && (v[i] >= '0'))
{
sub *=10;
sub += v[i]-'0';
i++;
}
}
else
minor = -1;
}
//OS X 10.4.3 is the first version that contained the fix for this problem
// and the 6800's driver version in it is 1.4.16. So anything after that
// doesn't need the workaround
if ( (major == -1) || (minor == -1))
//If anything went wrong don't do the workaround
//
well_is_it = 0;
else if ( (major <= 1) && (minor <= 4) && (sub < 16))
well_is_it = 1;
else
well_is_it = 0;
}
}
return well_is_it;
}
#endif
BMF_BitmapFont::BMF_BitmapFont(BMF_FontData* fontData)
: m_fontData(fontData)
{
@ -154,18 +74,6 @@ void BMF_BitmapFont::DrawString(char* str)
GLint alignment;
unsigned char c;
#ifdef __APPLE__
GLint vp[4]; // hack stuff
GLubyte nullm = 0; // hack stuff
if(needs_nvidia_rasterpos_workaround()) { // was is_a_really_crappy_nvidia_card()
glGetIntegerv(GL_VIEWPORT, vp); // hack stuff
glBitmap(1, 1, 0, 0, -vp[0], vp[1], &nullm);
}
#endif
glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

@ -121,9 +121,6 @@ BoolOpState BOP_performBooleanOperation(BoolOpType opType,
// Add B-mesh into C-mesh
BOP_addMesh(&meshC, &meshBFacesId, &materials, obBProps, obBFaces, obBVertices, invertMeshB);
if (!meshC.isClosedMesh())
return BOP_NO_SOLID;
// Perform the intersection boolean operation.
BoolOpState result = BOP_intersectionBoolOp(&meshC, &meshAFacesId, &meshBFacesId,
invertMeshA, invertMeshB);

@ -553,23 +553,6 @@ BOP_Index BOP_Mesh::replaceVertexIndex(BOP_Index oldIndex, BOP_Index newIndex)
return newIndex;
}
bool BOP_Mesh::isClosedMesh()
{
for(unsigned int i=0; i<m_edges.size(); i++) {
BOP_Edge *edge = m_edges[i];
BOP_Indexs faces = edge->getFaces();
unsigned int count = 0;
const BOP_IT_Indexs facesEnd = faces.end();
for(BOP_IT_Indexs it = faces.begin();it!=facesEnd;it++) {
if (m_faces[*it]->getTAG()!=BROKEN)
count++;
}
if ((count%2)!=0) return false;
}
return true;
}
/** ***************************************************************************

@ -82,7 +82,6 @@ public:
unsigned int getNumVertexs(BOP_TAG tag);
unsigned int getNumFaces(BOP_TAG tag);
BOP_Index replaceVertexIndex(BOP_Index oldIndex, BOP_Index newIndex);
bool isClosedMesh();
// Debug functions
void print();

@ -178,6 +178,7 @@ BSP_CSGMesh_FaceIt_Fill(
// assume CSG_IteratorPtr is of the correct type.
BSP_CSGMesh_FaceIt * face_it = (BSP_CSGMesh_FaceIt *)it;
// essentially iterating through a triangle fan here.
const int tri_index = face_it->face_triangle;
if (face_it->pos->m_verts.size()>3) {
// QUAD

@ -33,6 +33,10 @@
* Implementation of external api for CSG part of BSP lib interface.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "../extern/CSG_BooleanOps.h"
#include "BSP_CSGMesh_CFIterator.h"
#include "BSP_CSGMeshBuilder.h"
@ -43,7 +47,7 @@
#include "../../boolop/extern/BOP_Interface.h"
#include <iostream>
using namespace std;
#include "BSP_MeshPrimitives.h"
#include "BSP_MeshPrimitives.h";
struct BSP_MeshInfo {
BSP_CSGMesh *output_mesh;
@ -113,6 +117,8 @@ CSG_PerformBooleanOperation(
BSP_MeshInfo * mesh_info = static_cast<BSP_MeshInfo *>(operation->CSG_info);
if (mesh_info == NULL) return 0;
bool success = 1;
obAFaces.Reset(obAFaces.it);
obBFaces.Reset(obBFaces.it);
obAVertices.Reset(obAVertices.it);
@ -132,9 +138,8 @@ CSG_PerformBooleanOperation(
break;
}
BoolOpState boolOpResult;
try {
boolOpResult= BOP_performBooleanOperation( boolType,
BOP_performBooleanOperation( boolType,
mesh_info->output_descriptor,
(BSP_CSGMesh**) &(mesh_info->output_mesh),
mesh_info->obB_descriptor,
@ -149,12 +154,7 @@ CSG_PerformBooleanOperation(
return 0;
}
switch (boolOpResult) {
case BOP_OK: return 1;
case BOP_NO_SOLID: return -2;
case BOP_ERROR: return 0;
default: return 1;
}
return success;
}
int

@ -10,8 +10,6 @@ elbeem_env.Append(CPPDEFINES= [('ELBEEM_BLENDER',1)] );
if use_fluidsim=='false':
# print "El'Beem Fluid Simulation Disabled..." # debug
elbeem_env.Append (CPPPATH = user_options_dict['PNG_INCLUDE'])
elbeem_env.Append (CPPPATH = user_options_dict['SDL_INCLUDE'])
elbeem_env.Append(CPPDEFINES= 'ELBEEM_DUMMIES');
# dummy interface build
Sources = [
"intern/utilities.cpp",

@ -9,30 +9,11 @@
*
*****************************************************************************/
#ifdef ELBEEM_DUMMIES
#include <stdlib.h>
#include "ntl_vector3dim.h"
extern "C"
int performElbeemSimulation(char *cfgfilename) {
return 1; // dummy
return 1;
};
// dummies from intern/elbeem/intern/solver_interface.cpp
// for utilities.cpp
void initGridSizes(int &sizex, int &sizey, int &sizez,
ntlVec3Gfx &geoStart, ntlVec3Gfx &geoEnd,
int mMaxRefine, bool parallel)
{
// dummy
}
void calculateMemreqEstimate( int resx,int resy,int resz, int refine,
double *reqret, string *reqstr) {
*reqret = 0.0; // dummy
}
#endif // ELBEEM_DUMMIES

File diff suppressed because it is too large Load Diff

@ -273,9 +273,6 @@ ECHO Done
<File
RelativePath="..\..\intern\ntl_scene.cpp">
</File>
<File
RelativePath="..\..\intern\ntl_world.cpp">
</File>
<File
RelativePath="..\..\intern\parametrizer.cpp">
</File>
@ -285,18 +282,6 @@ ECHO Done
<File
RelativePath="..\..\intern\simulation_object.cpp">
</File>
<File
RelativePath="..\..\intern\solver_init.cpp">
</File>
<File
RelativePath="..\..\intern\solver_interface.cpp">
</File>
<File
RelativePath="..\..\intern\solver_main.cpp">
</File>
<File
RelativePath="..\..\intern\solver_util.cpp">
</File>
<File
RelativePath="..\..\intern\utilities.cpp">
</File>
@ -311,9 +296,6 @@ ECHO Done
<File
RelativePath="..\..\intern\cfgparser.h">
</File>
<File
RelativePath="..\..\intern\elbeem.h">
</File>
<File
RelativePath="..\..\intern\globals.h">
</File>
@ -368,9 +350,6 @@ ECHO Done
<File
RelativePath="..\..\intern\ntl_vector3dim.h">
</File>
<File
RelativePath="..\..\intern\ntl_world.h">
</File>
<File
RelativePath="..\..\intern\parametrizer.h">
</File>
@ -380,18 +359,6 @@ ECHO Done
<File
RelativePath="..\..\intern\simulation_object.h">
</File>
<File
RelativePath="..\..\intern\solver_class.h">
</File>
<File
RelativePath="..\..\intern\solver_dimenions.h">
</File>
<File
RelativePath="..\..\intern\solver_interface.h">
</File>
<File
RelativePath="..\..\intern\solver_relax.h">
</File>
<File
RelativePath="..\..\intern\utilities.h">
</File>

@ -67,19 +67,19 @@ public:
* Returns the timer callback.
* @return The timer callback.
*/
virtual GHOST_TimerProcPtr getTimerProc() const = 0;
inline virtual GHOST_TimerProcPtr getTimerProc() const = 0;
/**
* Changes the timer callback.
* @param timerProc The timer callback.
*/
virtual void setTimerProc(const GHOST_TimerProcPtr timerProc) = 0;
inline virtual void setTimerProc(const GHOST_TimerProcPtr timerProc) = 0;
/**
* Returns the timer user data.
* @return The timer user data.
*/
virtual GHOST_TUserDataPtr getUserData() const = 0;
inline virtual GHOST_TUserDataPtr getUserData() const = 0;
/**
* Changes the time user data.

@ -79,7 +79,7 @@ public:
* Returns the type of drawing context used in this window.
* @return The current type of drawing context.
*/
virtual GHOST_TDrawingContextType getDrawingContextType() = 0;
inline virtual GHOST_TDrawingContextType getDrawingContextType() = 0;
/**
* Tries to install a rendering context in this window.
@ -193,7 +193,7 @@ public:
* Returns the window user data.
* @return The window user data.
*/
virtual GHOST_TUserDataPtr getUserData() const = 0;
inline virtual GHOST_TUserDataPtr getUserData() const = 0;
/**
* Changes the window user data.

@ -655,7 +655,6 @@ OSStatus GHOST_SystemCarbon::handleWindowEvent(EventRef event)
case kEventWindowActivated:
m_windowManager->setActiveWindow(window);
window->loadCursor(window->getCursorVisibility(), window->getCursorShape());
window->updateDrawingContext();
pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowActivate, window) );
break;
case kEventWindowDeactivated:
@ -664,7 +663,6 @@ OSStatus GHOST_SystemCarbon::handleWindowEvent(EventRef event)
break;
case kEventWindowUpdate:
//if (getFullScreen()) GHOST_PRINT("GHOST_SystemCarbon::handleWindowEvent(): full-screen update event\n");
window->updateDrawingContext();
pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowUpdate, window) );
break;
case kEventWindowBoundsChanged:

@ -39,14 +39,11 @@
#include <list>
using namespace std;
class IK_QSolver {
public:
IK_QSolver() {};
typedef struct {
IK_QJacobianSolver solver;
IK_QSegment *root;
std::list<IK_QTask*> tasks;
};
} IK_QSolver;
IK_QSegment *CreateSegment(int flag, bool translate)
{

@ -39,6 +39,7 @@
#include <stdlib.h>
#include <assert.h>
#include <iostream>
#include <strstream>
#ifdef TNT_USE_REGIONS
#include "region2d.h"
#endif
@ -203,6 +204,18 @@ class Matrix
copy(v);
}
Matrix(Subscript M, Subscript N, const char *s)
{
initialize(M,N);
std::istrstream ins(s);
Subscript i, j;
for (i=0; i<M; i++)
for (j=0; j<N; j++)
ins >> row_[i][j];
}
// destructor
//

@ -38,6 +38,7 @@
#include <cstdlib>
#include <cassert>
#include <iostream>
#include <strstream>
#ifdef TNT_USE_REGIONS
#include "region2d.h"
#endif
@ -197,6 +198,18 @@ class Fortran_Matrix
}
Fortran_Matrix(Subscript M, Subscript N, char *s)
{
initialize(M,N);
std::istrstream ins(s);
Subscript i, j;
for (i=1; i<=M; i++)
for (j=1; j<=N; j++)
ins >> (*this)(i,j);
}
// destructor
~Fortran_Matrix()
{

@ -39,6 +39,7 @@
#include <cstdlib>
#include <cassert>
#include <iostream>
#include <strstream>
using namespace std;

@ -37,6 +37,7 @@
#include <stdlib.h>
#include <assert.h>
#include <iostream>
#include <strstream>
namespace TNT
{
@ -185,6 +186,17 @@ class Vector
copy(v);
}
Vector(Subscript N, char *s) : v_(0), vm1_(0), n_(0)
{
initialize(N);
std::istrstream ins(s);
Subscript i;
for (i=0; i<N; i++)
ins >> v_[i];
}
// methods
//

@ -33,6 +33,7 @@
#include <cstdlib>
#include <iostream>
#include <strstream>
#include <cassert>
#include "subscript.h"
@ -116,6 +117,15 @@ class Vector_Adaptor
}
Vector_Adaptor(Subscript N, /*const*/ char *s) : v_(N)
{
istrstream ins(s);
for (Subscript i=0; i<N; i++)
ins >> v_[i] ;
vm1_ = ( v_.size() > 0 ? &(v_[0]) -1 : NULL);
};
Vector_Adaptor(Subscript N, const T& value = T()) : v_(N)
{
for (Subscript i=0; i<N; i++)

@ -45,9 +45,6 @@ Package=<4>
Project_Dep_Name MoTo
End Project Dependency
Begin Project Dependency
Project_Dep_Name OpenALSoundSystem
End Project Dependency
Begin Project Dependency
Project_Dep_Name SoundSystem
End Project Dependency
Begin Project Dependency
@ -59,6 +56,9 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name boolop
End Project Dependency
Begin Project Dependency
Project_Dep_Name OpenALSoundSystem
End Project Dependency
}}}
###############################################################################

@ -89,10 +89,6 @@ typedef void* NLContext;
#define NL_SYMMETRIC 0x106
#define NL_ERROR 0x108
/* Enable / Disable */
#define NL_NORMALIZE_ROWS 0x400
/* Row parameters */
#define NL_RIGHT_HAND_SIDE 0x500
@ -142,7 +138,9 @@ void nlRightHandSideAdd(NLuint index, NLfloat value);
/* Solve */
NLboolean nlSolve(void);
void nlPrintMatrix(void);
NLboolean nlSolve();
NLboolean nlSolveAdvanced(NLint *permutation, NLboolean solveAgain);
#ifdef __cplusplus
}

@ -449,7 +449,7 @@ typedef struct {
#define __NL_STATE_ROW 3
#define __NL_STATE_MATRIX_CONSTRUCTED 4
#define __NL_STATE_SYSTEM_CONSTRUCTED 5
#define __NL_STATE_SOLVED 6
#define __NL_STATE_SYSTEM_SOLVED 7
typedef struct {
NLenum state;
@ -458,25 +458,29 @@ typedef struct {
__NLSparseMatrix M;
__NLRowColumn af;
__NLRowColumn al;
__NLRowColumn xl;
NLfloat* x;
NLfloat* b;
NLfloat right_hand_side;
NLfloat row_scaling;
NLuint nb_variables;
NLuint current_row;
NLboolean least_squares;
NLboolean symmetric;
NLboolean normalize_rows;
NLboolean solve_again;
NLboolean alloc_M;
NLboolean alloc_af;
NLboolean alloc_al;
NLboolean alloc_xl;
NLboolean alloc_variable;
NLboolean alloc_x;
NLboolean alloc_b;
NLfloat error;
__NLMatrixFunc matrix_vector_prod;
struct __NLSuperLUContext {
NLboolean alloc_slu;
SuperMatrix L, U;
NLint *perm_c, *perm_r;
SuperLUStat_t stat;
} slu;
} __NLContext;
static __NLContext* __nlCurrentContext = NULL;
@ -489,13 +493,14 @@ static void __nlMatrixVectorProd_default(NLfloat* x, NLfloat* y) {
NLContext nlNewContext(void) {
__NLContext* result = __NL_NEW(__NLContext);
result->state = __NL_STATE_INITIAL;
result->row_scaling = 1.0;
result->right_hand_side = 0.0;
result->matrix_vector_prod = __nlMatrixVectorProd_default;
nlMakeCurrent(result);
return result;
}
static void __nlFree_SUPERLU(__NLContext *context);
void nlDeleteContext(NLContext context_in) {
__NLContext* context = (__NLContext*)(context_in);
if(__nlCurrentContext == context) {
@ -510,9 +515,6 @@ void nlDeleteContext(NLContext context_in) {
if(context->alloc_al) {
__nlRowColumnDestroy(&context->al);
}
if(context->alloc_xl) {
__nlRowColumnDestroy(&context->xl);
}
if(context->alloc_variable) {
__NL_DELETE_ARRAY(context->variable);
}
@ -522,6 +524,9 @@ void nlDeleteContext(NLContext context_in) {
if(context->alloc_b) {
__NL_DELETE_ARRAY(context->b);
}
if (context->slu.alloc_slu) {
__nlFree_SUPERLU(context);
}
#ifdef NL_PARANOID
__NL_CLEAR(__NLContext, context);
@ -593,9 +598,6 @@ void nlRowParameterf(NLenum pname, NLfloat param) {
case NL_RIGHT_HAND_SIDE: {
__nlCurrentContext->right_hand_side = param;
} break;
case NL_ROW_SCALING: {
__nlCurrentContext->row_scaling = param;
} break;
}
}
@ -605,9 +607,6 @@ void nlRowParameteri(NLenum pname, NLint param) {
case NL_RIGHT_HAND_SIDE: {
__nlCurrentContext->right_hand_side = (NLfloat)param;
} break;
case NL_ROW_SCALING: {
__nlCurrentContext->row_scaling = (NLfloat)param;
} break;
}
}
@ -667,10 +666,6 @@ void nlGetIntergerv(NLenum pname, NLint* params) {
void nlEnable(NLenum pname) {
switch(pname) {
case NL_NORMALIZE_ROWS: {
__nl_assert(__nlCurrentContext->state != __NL_STATE_ROW);
__nlCurrentContext->normalize_rows = NL_TRUE;
} break;
default: {
__nl_assert_not_reached;
}
@ -679,10 +674,6 @@ void nlEnable(NLenum pname) {
void nlDisable(NLenum pname) {
switch(pname) {
case NL_NORMALIZE_ROWS: {
__nl_assert(__nlCurrentContext->state != __NL_STATE_ROW);
__nlCurrentContext->normalize_rows = NL_FALSE;
} break;
default: {
__nl_assert_not_reached;
}
@ -691,9 +682,6 @@ void nlDisable(NLenum pname) {
NLboolean nlIsEnabled(NLenum pname) {
switch(pname) {
case NL_NORMALIZE_ROWS: {
return __nlCurrentContext->normalize_rows;
} break;
default: {
__nl_assert_not_reached;
}
@ -763,15 +751,20 @@ static void __nlVectorToVariables() {
}
}
static void __nlBeginSystem() {
__nlTransition(__NL_STATE_INITIAL, __NL_STATE_SYSTEM);
__nl_assert(__nlCurrentContext->nb_variables > 0);
if (__nlCurrentContext->solve_again)
__nlTransition(__NL_STATE_SYSTEM_SOLVED, __NL_STATE_SYSTEM);
else {
__nlTransition(__NL_STATE_INITIAL, __NL_STATE_SYSTEM);
__nlCurrentContext->variable = __NL_NEW_ARRAY(
__NLVariable, __nlCurrentContext->nb_variables
);
__nlCurrentContext->alloc_variable = NL_TRUE;
}
}
static void __nlEndSystem() {
__nlTransition(__NL_STATE_MATRIX_CONSTRUCTED, __NL_STATE_SYSTEM_CONSTRUCTED);
@ -784,25 +777,22 @@ static void __nlBeginMatrix() {
__nlTransition(__NL_STATE_SYSTEM, __NL_STATE_MATRIX);
if (!__nlCurrentContext->solve_again) {
for(i=0; i<__nlCurrentContext->nb_variables; i++) {
if(!__nlCurrentContext->variable[i].locked) {
__nlCurrentContext->variable[i].index = n;
n++;
} else {
if(!__nlCurrentContext->variable[i].locked)
__nlCurrentContext->variable[i].index = n++;
else
__nlCurrentContext->variable[i].index = ~0;
}
}
__nlCurrentContext->n = n;
/* a least squares problem results in a symmetric matrix */
if(__nlCurrentContext->least_squares) {
if(__nlCurrentContext->least_squares)
__nlCurrentContext->symmetric = NL_TRUE;
}
if(__nlCurrentContext->symmetric) {
if(__nlCurrentContext->symmetric)
storage = (storage | __NL_SYMMETRIC);
}
/* SuperLU storage does not support symmetric storage */
storage = (storage & ~__NL_SYMMETRIC);
@ -815,6 +805,11 @@ static void __nlBeginMatrix() {
__nlCurrentContext->b = __NL_NEW_ARRAY(NLfloat, n);
__nlCurrentContext->alloc_b = NL_TRUE;
}
else {
/* need to recompute b only, A is not constructed anymore */
__NL_CLEAR_ARRAY(NLfloat, __nlCurrentContext->b, __nlCurrentContext->n);
}
__nlVariablesToVector();
@ -822,8 +817,6 @@ static void __nlBeginMatrix() {
__nlCurrentContext->alloc_af = NL_TRUE;
__nlRowColumnConstruct(&__nlCurrentContext->al);
__nlCurrentContext->alloc_al = NL_TRUE;
__nlRowColumnConstruct(&__nlCurrentContext->xl);
__nlCurrentContext->alloc_xl = NL_TRUE;
__nlCurrentContext->current_row = 0;
}
@ -835,8 +828,6 @@ static void __nlEndMatrix() {
__nlCurrentContext->alloc_af = NL_FALSE;
__nlRowColumnDestroy(&__nlCurrentContext->al);
__nlCurrentContext->alloc_al = NL_FALSE;
__nlRowColumnDestroy(&__nlCurrentContext->xl);
__nlCurrentContext->alloc_al = NL_FALSE;
#if 0
if(!__nlCurrentContext->least_squares) {
@ -852,45 +843,11 @@ static void __nlBeginRow() {
__nlTransition(__NL_STATE_MATRIX, __NL_STATE_ROW);
__nlRowColumnZero(&__nlCurrentContext->af);
__nlRowColumnZero(&__nlCurrentContext->al);
__nlRowColumnZero(&__nlCurrentContext->xl);
}
static void __nlScaleRow(NLfloat s) {
__NLRowColumn* af = &__nlCurrentContext->af;
__NLRowColumn* al = &__nlCurrentContext->al;
NLuint nf = af->size;
NLuint nl = al->size;
NLuint i;
for(i=0; i<nf; i++) {
af->coeff[i].value *= s;
}
for(i=0; i<nl; i++) {
al->coeff[i].value *= s;
}
__nlCurrentContext->right_hand_side *= s;
}
static void __nlNormalizeRow(NLfloat weight) {
__NLRowColumn* af = &__nlCurrentContext->af;
__NLRowColumn* al = &__nlCurrentContext->al;
NLuint nf = af->size;
NLuint nl = al->size;
NLuint i;
NLfloat norm = 0.0;
for(i=0; i<nf; i++) {
norm += af->coeff[i].value * af->coeff[i].value;
}
for(i=0; i<nl; i++) {
norm += al->coeff[i].value * al->coeff[i].value;
}
norm = sqrt(norm);
__nlScaleRow(weight / norm);
}
static void __nlEndRow() {
__NLRowColumn* af = &__nlCurrentContext->af;
__NLRowColumn* al = &__nlCurrentContext->al;
__NLRowColumn* xl = &__nlCurrentContext->xl;
__NLSparseMatrix* M = &__nlCurrentContext->M;
NLfloat* b = __nlCurrentContext->b;
NLuint nf = af->size;
@ -901,13 +858,8 @@ static void __nlEndRow() {
NLfloat S;
__nlTransition(__NL_STATE_ROW, __NL_STATE_MATRIX);
if(__nlCurrentContext->normalize_rows) {
__nlNormalizeRow(__nlCurrentContext->row_scaling);
} else {
__nlScaleRow(__nlCurrentContext->row_scaling);
}
if(__nlCurrentContext->least_squares) {
if (!__nlCurrentContext->solve_again) {
for(i=0; i<nf; i++) {
for(j=0; j<nf; j++) {
__nlSparseMatrixAdd(
@ -916,27 +868,29 @@ static void __nlEndRow() {
);
}
}
}
S = -__nlCurrentContext->right_hand_side;
for(j=0; j<nl; j++) {
S += al->coeff[j].value * xl->coeff[j].value;
}
for(i=0; i<nf; i++) {
for(j=0; j<nl; j++)
S += al->coeff[j].value;
for(i=0; i<nf; i++)
b[ af->coeff[i].index ] -= af->coeff[i].value * S;
}
} else {
if (!__nlCurrentContext->solve_again) {
for(i=0; i<nf; i++) {
__nlSparseMatrixAdd(
M, current_row, af->coeff[i].index, af->coeff[i].value
);
}
}
b[current_row] = -__nlCurrentContext->right_hand_side;
for(i=0; i<nl; i++) {
b[current_row] -= al->coeff[i].value * xl->coeff[i].value;
b[current_row] -= al->coeff[i].value;
}
}
__nlCurrentContext->current_row++;
__nlCurrentContext->right_hand_side = 0.0;
__nlCurrentContext->row_scaling = 1.0;
}
void nlMatrixAdd(NLuint row, NLuint col, NLfloat value)
@ -967,13 +921,11 @@ void nlCoefficient(NLuint index, NLfloat value) {
__nlCheckState(__NL_STATE_ROW);
__nl_range_assert(index, zero, __nlCurrentContext->nb_variables - 1);
v = &(__nlCurrentContext->variable[index]);
if(v->locked) {
__nlRowColumnAppend(&(__nlCurrentContext->al), 0, value);
__nlRowColumnAppend(&(__nlCurrentContext->xl), 0, v->value);
} else {
if(v->locked)
__nlRowColumnAppend(&(__nlCurrentContext->al), 0, value*v->value);
else
__nlRowColumnAppend(&(__nlCurrentContext->af), v->index, value);
}
}
void nlBegin(NLenum prim) {
switch(prim) {
@ -1014,36 +966,24 @@ void nlEnd(NLenum prim) {
/* Note: SuperLU is difficult to call, but it is worth it. */
/* Here is a driver inspired by A. Sheffer's "cow flattener". */
static NLboolean __nlSolve_SUPERLU( NLboolean do_perm) {
static NLboolean __nlFactorize_SUPERLU(__NLContext *context, NLint *permutation) {
/* OpenNL Context */
__NLSparseMatrix* M = &(__nlCurrentContext->M);
NLfloat* b = __nlCurrentContext->b;
NLfloat* x = __nlCurrentContext->x;
__NLSparseMatrix* M = &(context->M);
NLuint n = context->n;
NLuint nnz = __nlSparseMatrixNNZ(M); /* number of non-zero coeffs */
/* Compressed Row Storage matrix representation */
NLuint n = __nlCurrentContext->n;
NLuint nnz = __nlSparseMatrixNNZ(M); /* Number of Non-Zero coeffs */
NLint *xa = __NL_NEW_ARRAY(NLint, n+1);
NLfloat *rhs = __NL_NEW_ARRAY(NLfloat, n);
NLfloat *a = __NL_NEW_ARRAY(NLfloat, nnz);
NLint *asub = __NL_NEW_ARRAY(NLint, nnz);
/* Permutation vector */
NLint* perm_r = __NL_NEW_ARRAY(NLint, n);
NLint* perm = __NL_NEW_ARRAY(NLint, n);
NLint *etree = __NL_NEW_ARRAY(NLint, n);
/* SuperLU variables */
SuperMatrix A, B; /* System */
SuperMatrix L, U; /* Inverse of A */
NLint info; /* status code */
DNformat *vals = NULL; /* access to result */
float *rvals = NULL; /* access to result */
/* SuperLU options and stats */
SuperMatrix At, AtP;
NLint info, panel_size, relax;
superlu_options_t options;
SuperLUStat_t stat;
/* Temporary variables */
__NLRowColumn* Ri = NULL;
@ -1053,41 +993,87 @@ static NLboolean __nlSolve_SUPERLU( NLboolean do_perm) {
__nl_assert(M->storage & __NL_ROWS);
__nl_assert(M->m == M->n);
/*
* Step 1: convert matrix M into SuperLU compressed column
* representation.
* -------------------------------------------------------
*/
count = 0;
for(i=0; i<n; i++) {
Ri = &(M->row[i]);
/* Convert M to compressed column format */
for(i=0, count=0; i<n; i++) {
__NLRowColumn *Ri = M->row + i;
xa[i] = count;
for(jj=0; jj<Ri->size; jj++) {
for(jj=0; jj<Ri->size; jj++, count++) {
a[count] = Ri->coeff[jj].value;
asub[count] = Ri->coeff[jj].index;
count++;
}
}
xa[n] = nnz;
/* Save memory for SuperLU */
/* Free M, don't need it anymore at this point */
__nlSparseMatrixClear(M);
/*
* Rem: symmetric storage does not seem to work with
* SuperLU ... (->deactivated in main SLS::Solver driver)
*/
/* Create superlu A matrix transposed */
sCreate_CompCol_Matrix(
&A, n, n, nnz, a, asub, xa,
SLU_NR, /* Row_wise, no supernode */
&At, n, n, nnz, a, asub, xa,
SLU_NC, /* Colum wise, no supernode */
SLU_S, /* floats */
SLU_GE /* general storage */
);
/* Step 2: create vector */
/* Set superlu options */
set_default_options(&options);
options.ColPerm = MY_PERMC;
options.Fact = DOFACT;
StatInit(&(context->slu.stat));
panel_size = sp_ienv(1); /* sp_ienv give us the defaults */
relax = sp_ienv(2);
/* Compute permutation and permuted matrix */
context->slu.perm_r = __NL_NEW_ARRAY(NLint, n);
context->slu.perm_c = __NL_NEW_ARRAY(NLint, n);
if ((permutation == NULL) || (*permutation == -1)) {
get_perm_c(3, &At, context->slu.perm_c);
if (permutation)
memcpy(permutation, context->slu.perm_c, sizeof(NLint)*n);
}
else
memcpy(context->slu.perm_c, permutation, sizeof(NLint)*n);
sp_preorder(&options, &At, context->slu.perm_c, etree, &AtP);
/* Decompose into L and U */
sgstrf(&options, &AtP, relax, panel_size,
etree, NULL, 0, context->slu.perm_c, context->slu.perm_r,
&(context->slu.L), &(context->slu.U), &(context->slu.stat), &info);
/* Cleanup */
Destroy_SuperMatrix_Store(&At);
Destroy_SuperMatrix_Store(&AtP);
__NL_DELETE_ARRAY(etree);
__NL_DELETE_ARRAY(xa);
__NL_DELETE_ARRAY(rhs);
__NL_DELETE_ARRAY(a);
__NL_DELETE_ARRAY(asub);
context->slu.alloc_slu = NL_TRUE;
return (info == 0);
}
static NLboolean __nlInvert_SUPERLU(__NLContext *context) {
/* OpenNL Context */
NLfloat* b = context->b;
NLfloat* x = context->x;
NLuint n = context->n;
/* SuperLU variables */
SuperMatrix B;
NLint info;
/* Create superlu array for B */
sCreate_Dense_Matrix(
&B, n, 1, b, n,
SLU_DN, /* Fortran-type column-wise storage */
@ -1095,83 +1081,89 @@ static NLboolean __nlSolve_SUPERLU( NLboolean do_perm) {
SLU_GE /* general */
);
/* Forward/Back substitution to compute x */
sgstrs(TRANS, &(context->slu.L), &(context->slu.U),
context->slu.perm_c, context->slu.perm_r, &B,
&(context->slu.stat), &info);
/* Step 3: get permutation matrix
* ------------------------------
* com_perm: 0 -> no re-ordering
* 1 -> re-ordering for A^t.A
* 2 -> re-ordering for A^t+A
* 3 -> approximate minimum degree ordering
*/
get_perm_c(do_perm ? 3 : 0, &A, perm);
if(info == 0)
memcpy(x, ((DNformat*)B.Store)->nzval, sizeof(*x)*n);
/* Step 4: call SuperLU main routine
* ---------------------------------
*/
set_default_options(&options);
options.ColPerm = MY_PERMC;
StatInit(&stat);
sgssv(&options, &A, perm, perm_r, &L, &U, &B, &stat, &info);
/* Step 5: get the solution
* ------------------------
* Fortran-type column-wise storage
*/
vals = (DNformat*)B.Store;
rvals = (float*)(vals->nzval);
if(info == 0) {
for(i = 0; i < n; i++){
x[i] = rvals[i];
}
}
/* Step 6: cleanup
* ---------------
*/
/*
* For these two ones, only the "store" structure
* needs to be deallocated (the arrays have been allocated
* by us).
*/
Destroy_SuperMatrix_Store(&A);
Destroy_SuperMatrix_Store(&B);
/*
* These ones need to be fully deallocated (they have been
* allocated by SuperLU).
*/
Destroy_SuperNode_Matrix(&L);
Destroy_CompCol_Matrix(&U);
StatFree(&stat);
__NL_DELETE_ARRAY(xa);
__NL_DELETE_ARRAY(rhs);
__NL_DELETE_ARRAY(a);
__NL_DELETE_ARRAY(asub);
__NL_DELETE_ARRAY(perm_r);
__NL_DELETE_ARRAY(perm);
return (info == 0);
}
static void __nlFree_SUPERLU(__NLContext *context) {
Destroy_SuperNode_Matrix(&(context->slu.L));
Destroy_CompCol_Matrix(&(context->slu.U));
StatFree(&(context->slu.stat));
__NL_DELETE_ARRAY(context->slu.perm_r);
__NL_DELETE_ARRAY(context->slu.perm_c);
context->slu.alloc_slu = NL_FALSE;
}
void nlPrintMatrix(void) {
__NLSparseMatrix* M = &(__nlCurrentContext->M);
float *b = __nlCurrentContext->b;
NLuint i, jj, k;
NLuint n = __nlCurrentContext->n;
__NLRowColumn* Ri = NULL;
float *value = malloc(sizeof(*value)*n);
printf("A:\n");
for(i=0; i<n; i++) {
Ri = &(M->row[i]);
memset(value, 0.0, sizeof(*value)*n);
for(jj=0; jj<Ri->size; jj++)
value[Ri->coeff[jj].index] = Ri->coeff[jj].value;
for (k = 0; k<n; k++)
printf("%.3f ", value[k]);
printf("\n");
}
printf("b:\n");
for(i=0; i<n; i++)
printf("%f ", b[i]);
printf("\n");
free(value);
}
/************************************************************************/
/* nlSolve() driver routine */
NLboolean nlSolve(void) {
NLboolean nlSolveAdvanced(NLint *permutation, NLboolean solveAgain) {
NLboolean result = NL_TRUE;
__nlCheckState(__NL_STATE_SYSTEM_CONSTRUCTED);
result = __nlSolve_SUPERLU(NL_TRUE);
if (!__nlCurrentContext->solve_again)
result = __nlFactorize_SUPERLU(__nlCurrentContext, permutation);
if (result) {
result = __nlInvert_SUPERLU(__nlCurrentContext);
if (result) {
__nlVectorToVariables();
__nlTransition(__NL_STATE_SYSTEM_CONSTRUCTED, __NL_STATE_SOLVED);
if (solveAgain)
__nlCurrentContext->solve_again = NL_TRUE;
__nlTransition(__NL_STATE_SYSTEM_CONSTRUCTED, __NL_STATE_SYSTEM_SOLVED);
}
}
return result;
}
NLboolean nlSolve() {
return nlSolveAdvanced(NULL, NL_FALSE);
}

@ -40,9 +40,12 @@
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <ctype.h>
#include "STR_String.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/*-------------------------------------------------------------------------------------------------
Construction / destruction
-------------------------------------------------------------------------------------------------*/
@ -540,10 +543,15 @@ STR_String& STR_String::Lower()
STR_String& STR_String::Capitalize()
{
assertd(pData != NULL);
#ifdef WIN32
if (Len>0) pData[0] = toupper(pData[0]);
if (Len>1) _strlwr(pData+1);
#else
if (Len > 0)
pData[0] = (pData[0] >= 'A' && pData[0] <= 'A')?pData[0]+'a'-'A':pData[0];
for (int i=1;i<Len;i++)
pData[i] = (pData[i] >= 'a' && pData[i] <= 'z')?pData[i]+'A'-'a':pData[i];
#endif
return *this;
}

@ -36,7 +36,7 @@ SOURCEDIR = blender/po
include nan_definitions.mk
LINGUAS = ca cs de es fr it ja nl pl pt_br sr sv uk
LINGUAS = ca cs de es fr it ja nl sv
ifeq ($(OS), darwin)
DIR = $(OCGDIR)/bin/blender.app/Contents/Resources/locale/$@/LC_MESSAGES/
else

@ -40,6 +40,7 @@ RSC=rc.exe
# PROP Output_Dir "..\..\..\obj\windows\blender\bpython"
# PROP Intermediate_Dir "..\..\..\obj\windows\blender\bpython"
# PROP Target_Dir ""
MTL=midl.exe
LINK32=link.exe -lib
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\..\lib\windows\python\include\python2.4" /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\img" /I "..\..\..\source\blender\radiosity\extern\include" /I "..\..\..\..\lib\windows\bmfont\include" /I "..\..\source\blender\misc" /I "..\..\..\lib\windows\guardedalloc\include" /I "..\..\source\blender\blenlib" /I "..\..\source\kernel\gen_messaging" /I "..\..\source\blender\include" /I "..\..\source\blender" /I "..\..\source\blender\makesdna" /I "..\..\source\blender\blenkernel" /I "..\..\source\blender\blenloader" /I "..\..\source\blender\bpython\include" /I "..\..\source\blender\imbuf" /I "..\..\source\blender\render\extern\include" /I "..\..\source\blender\radiosity\extern\include" /I "..\..\source\kernel\gen_system" /I "..\..\source\blender\renderconverter\\" /I "..\..\source\blender\renderui\\" /I "..\..\source\blender\python" /I "../../../../lib/windows/bsp/include" /I "..\..\..\source\blender\renderconverter" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\avi" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\blender" /I "..\..\..\source\blender\bpython\include" /I "../../../source/gameengine\SoundSystem\\" /I "../../../../lib/windows/iksolver/include" /I "..\..\..\source\blender\python" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /J /FD /c
@ -64,6 +65,7 @@ LIB32=link.exe -lib
# PROP Output_Dir "..\..\..\obj\windows\blender\bpython\debug"
# PROP Intermediate_Dir "..\..\..\obj\windows\blender\bpython\debug"
# PROP Target_Dir ""
MTL=midl.exe
LINK32=link.exe -lib
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /w /W0 /Gm /GX /Zi /Od /I "..\..\..\..\lib\windows\python\include\python2.4" /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\img" /I "..\..\..\..\lib\windows\bmfont\include" /I "..\..\source\blender\misc" /I "..\..\..\lib\windows\guardedalloc\include" /I "..\..\source\blender\blenlib" /I "..\..\source\kernel\gen_messaging" /I "..\..\source\blender\include" /I "..\..\source\blender" /I "..\..\source\blender\makesdna" /I "..\..\source\blender\blenkernel" /I "..\..\source\blender\blenloader" /I "..\..\..\source\blender\radiosity\extern\include" /I "..\..\source\blender\bpython\include" /I "..\..\source\blender\imbuf" /I "..\..\source\blender\render\extern\include" /I "..\..\source\kernel\gen_system" /I "..\..\source\blender\renderconverter\\" /I "..\..\source\blender\renderui\\" /I "..\..\source\blender\python" /I "../../../../lib/windows/bsp/include" /I "..\..\..\source\blender\renderconverter" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\avi" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\blender" /I "..\..\..\source\blender\bpython\include" /I "../../../source/gameengine\SoundSystem\\" /I "../../../../lib/windows/iksolver/include" /I "..\..\..\source\blender\python" /D "WIN32" /D "_MBCS" /D "_LIB" /U "_DEBUG" /YX /J /FD /GZ /c
@ -187,10 +189,6 @@ SOURCE=..\..\..\source\blender\python\api2_2x\Library.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\python\api2_2x\Pose.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\python\api2_2x\logic.c
# End Source File
# Begin Source File
@ -243,6 +241,10 @@ SOURCE=..\..\..\source\blender\python\api2_2x\point.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\python\api2_2x\Pose.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\python\api2_2x\quat.c
# End Source File
# Begin Source File

@ -660,18 +660,6 @@ Package=<4>
Project_Dep_Name gen_messaging
End Project Dependency
Begin Project Dependency
Project_Dep_Name KX_blenderhook
End Project Dependency
Begin Project Dependency
Project_Dep_Name KX_converter
End Project Dependency
Begin Project Dependency
Project_Dep_Name KX_ketsji
End Project Dependency
Begin Project Dependency
Project_Dep_Name KX_network
End Project Dependency
Begin Project Dependency
Project_Dep_Name NG_loopbacknetwork
End Project Dependency
Begin Project Dependency
@ -693,9 +681,6 @@ Package=<4>
Project_Dep_Name SYS_system
End Project Dependency
Begin Project Dependency
Project_Dep_Name BRE_renderconverter
End Project Dependency
Begin Project Dependency
Project_Dep_Name BL_src_pub
End Project Dependency
Begin Project Dependency

@ -42,6 +42,7 @@ RSC=rc.exe
# PROP Output_Dir "..\..\..\obj\windows\blender\blenkernel"
# PROP Intermediate_Dir "..\..\..\obj\windows\blender\blenkernel"
# PROP Target_Dir ""
MTL=midl.exe
LINK32=link.exe -lib
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\..\lib\windows\decimation\include" /I "../../../../lib/windows/zlib/include" /I "..\..\..\intern\elbeem\extern" /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\renderconverter" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\avi" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\blender" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\blenlib" /I "../../../source/gameengine\SoundSystem\\" /I "../../../../lib/windows/iksolver/include" /I "../../../../lib/windows/bsp/include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "WITH_FREETYPE2" /D "USE_CCGSUBSURFLIB" /YX /J /FD /c
@ -66,6 +67,7 @@ LIB32=link.exe -lib
# PROP Output_Dir "..\..\..\obj\windows\blender\blenkernel\debug"
# PROP Intermediate_Dir "..\..\..\obj\windows\blender\blenkernel\debug"
# PROP Target_Dir ""
MTL=midl.exe
LINK32=link.exe -lib
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\lib\windows\decimation\include" /I "../../../../lib/windows/zlib/include" /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\renderconverter" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\avi" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\blender" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\blenlib" /I "../../../source/gameengine\SoundSystem\\" /I "../../../../lib/windows/iksolver/include" /I "../../../../lib/windows/bsp/include" /I "..\..\..\intern\elbeem\extern" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "WITH_FREETYPE2" /YX /J /FD /GZ /c
@ -90,6 +92,7 @@ LIB32=link.exe -lib
# PROP Output_Dir "..\..\..\obj\windows\blender\blenkernel\mtdll_debug"
# PROP Intermediate_Dir "..\..\..\obj\windows\blender\blenkernel\mtdll_debug"
# PROP Target_Dir ""
MTL=midl.exe
LINK32=link.exe -lib
# ADD BASE CPP /nologo /Gm /GX /ZI /Od /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\avi" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\source\gameengine\soundsystem" /I "..\..\..\source\gameengine\soundsystem\snd_openal" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\blender" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\gameengine\soundsystem\snd_blenderwavecache" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /GZ /c
# SUBTRACT BASE CPP /WX
@ -116,6 +119,7 @@ LIB32=link.exe -lib
# PROP Output_Dir "..\..\..\obj\windows\blender\blenkernel\mtdll"
# PROP Intermediate_Dir "..\..\..\obj\windows\blender\blenkernel\mtdll"
# PROP Target_Dir ""
MTL=midl.exe
LINK32=link.exe -lib
# ADD BASE CPP /nologo /GX /O2 /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\avi" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\source\gameengine\soundsystem" /I "..\..\..\source\gameengine\soundsystem\snd_openal" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\blender" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\gameengine\soundsystem\snd_blenderwavecache" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /c
# ADD CPP /nologo /MD /GX /O2 /I "..\..\..\source\gameengine\soundsystem" /I "..\..\..\source\gameengine\soundsystem\snd_openal" /I "..\..\..\source\gameengine\soundsystem\snd_blenderwavecache" /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\renderconverter" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\avi" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\blender" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\blenlib" /I "../../../source/gameengine\SoundSystem\\" /I "../../../../lib/windows/iksolver/include" /I "../../../../lib/windows/bsp/include" /I "..\..\..\intern\elbeem\extern" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /c
@ -165,6 +169,10 @@ SOURCE=..\..\..\source\blender\blenkernel\intern\CCGSubSurf.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\blenkernel\intern\colortools.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\blenkernel\intern\constraint.c
# End Source File
# Begin Source File
@ -205,6 +213,10 @@ SOURCE=..\..\..\source\blender\blenkernel\intern\group.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\blenkernel\intern\icons.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\blenkernel\intern\image.c
# End Source File
# Begin Source File
@ -245,6 +257,18 @@ SOURCE=..\..\..\source\blender\blenkernel\intern\nla.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\blenkernel\intern\node.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\blenkernel\intern\node_composit.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\blenkernel\intern\node_shaders.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\blenkernel\intern\object.c
# End Source File
# Begin Source File

@ -42,6 +42,7 @@ RSC=rc.exe
# PROP Output_Dir "..\..\..\obj\windows\blender\blenlib"
# PROP Intermediate_Dir "..\..\..\obj\windows\blender\blenlib"
# PROP Target_Dir ""
MTL=midl.exe
LINK32=link.exe -lib
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\..\lib\windows\freetype\include" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\makesdna" /I "../../../../lib/windows/zlib/include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "WITH_FREETYPE2" /J /FD /c
@ -66,6 +67,7 @@ LIB32=link.exe -lib
# PROP Output_Dir "..\..\..\obj\windows\blender\blenlib\debug"
# PROP Intermediate_Dir "..\..\..\obj\windows\blender\blenlib\debug"
# PROP Target_Dir ""
MTL=midl.exe
LINK32=link.exe -lib
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\..\lib\windows\freetype\include" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\makesdna" /I "../../../../lib/windows/zlib/include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "WITH_FREETYPE2" /J /FD /GZ /c
@ -90,6 +92,7 @@ LIB32=link.exe -lib
# PROP Output_Dir "..\..\..\obj\windows\blender\blenlib\mtdll_debug"
# PROP Intermediate_Dir "..\..\..\obj\windows\blender\blenlib\mtdll_debug"
# PROP Target_Dir ""
MTL=midl.exe
LINK32=link.exe -lib
# ADD BASE CPP /nologo /Gm /GX /ZI /Od /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\makesdna" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /GZ /c
# ADD CPP /nologo /MDd /Gm /GX /ZI /Od /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\makesdna" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /GZ /c
@ -114,6 +117,7 @@ LIB32=link.exe -lib
# PROP Output_Dir "..\..\..\obj\windows\blender\blenlib\mtdll"
# PROP Intermediate_Dir "..\..\..\obj\windows\blender\blenlib\mtdll"
# PROP Target_Dir ""
MTL=midl.exe
LINK32=link.exe -lib
# ADD BASE CPP /nologo /GX /O2 /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\makesdna" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /c
# ADD CPP /nologo /MD /GX /O2 /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\makesdna" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /c
@ -179,6 +183,10 @@ SOURCE=..\..\..\source\blender\blenlib\intern\gsqueue.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\blenlib\intern\jitter.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\blenlib\intern\matrixops.c
# End Source File
# Begin Source File

@ -70,7 +70,7 @@ LIB32=link.exe -lib
MTL=midl.exe
LINK32=link.exe -lib
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\source\blender\imbuf\intern" /I "..\..\..\source\blender\quicktime" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\avi" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\include" /I "..\..\..\..\lib\windows\jpeg\include" /I "..\..\..\..\lib\windows\zlib\include" /I "..\..\..\..\lib\windows\png\include" /I "..\..\..\source\blender\makesdna" /I "..\..\..\..\lib\windows\tiff\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "WITH_QUICKTIME" /YX /FD /I /GZ "..\..\..\source\blender\imbuf" /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\source\blender\imbuf\intern" /I "..\..\..\source\blender\quicktime" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\avi" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\include" /I "..\..\..\..\lib\windows\jpeg\include" /I "..\..\..\..\lib\windows\zlib\include" /I "..\..\..\..\lib\windows\png\include" /I "..\..\..\source\blender\makesdna" /I "..\..\..\..\lib\windows\tiff\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "WITH_QUICKTIME" /YX /FD /I /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe

@ -41,8 +41,9 @@ RSC=rc.exe
# PROP Intermediate_Dir "..\..\..\obj\windows\blender\radiosity"
# PROP Target_Dir ""
LINK32=link.exe -lib
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\radiosity\extern\include" /I "..\..\..\source\blender" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\misc" /I "..\..\..\source\blender\makesdna" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\radiosity\extern\include" /I "..\..\..\source\blender" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\misc" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\blender\render\intern\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@ -65,8 +66,9 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "..\..\..\obj\windows\blender\radiosity\debug"
# PROP Target_Dir ""
LINK32=link.exe -lib
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\radiosity\extern\include" /I "..\..\..\source\blender" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\misc" /I "..\..\..\source\blender\makesdna" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\radiosity\extern\include" /I "..\..\..\source\blender" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\misc" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\blender\render\intern\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /GZ /c
# SUBTRACT CPP /Fr
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"

@ -40,6 +40,7 @@ RSC=rc.exe
# PROP Output_Dir "..\..\..\obj\windows\blender\render"
# PROP Intermediate_Dir "..\..\..\obj\windows\blender\render"
# PROP Target_Dir ""
MTL=midl.exe
LINK32=link.exe -lib
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\..\lib\windows\sdl\include" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\kernel\gen_messaging" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\quicktime" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\misc" /I "..\..\..\source\kernel" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\radiosity\extern\include" /I "..\..\..\source\blender\render\intern\include" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender" /I "..\..\..\source\blender\yafray" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "WITH_QUICKTIME" /YX /J /FD /c
@ -64,6 +65,7 @@ LIB32=link.exe -lib
# PROP Output_Dir "..\..\..\obj\windows\blender\render\debug"
# PROP Intermediate_Dir "..\..\..\obj\windows\blender\render\debug"
# PROP Target_Dir ""
MTL=midl.exe
LINK32=link.exe -lib
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\..\lib\windows\sdl\include" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\kernel\gen_messaging" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\quicktime" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\misc" /I "..\..\..\source\kernel" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\radiosity\extern\include" /I "..\..\..\source\blender\render\intern\include" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender" /I "..\..\..\source\blender\yafray" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "WITH_QUICKTIME" /YX /J /FD /GZ /c
@ -87,6 +89,10 @@ LIB32=link.exe -lib
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\source\convertblender.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\source\edgeRender.c
# End Source File
# Begin Source File
@ -95,10 +101,6 @@ SOURCE=..\..\..\source\blender\render\intern\source\envmap.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\source\errorHandler.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\source\gammaCorrectionTables.c
# End Source File
# Begin Source File
@ -111,7 +113,7 @@ SOURCE=..\..\..\source\blender\render\intern\source\initrender.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\source\jitter.c
SOURCE=..\..\..\source\blender\render\intern\source\pipeline.c
# End Source File
# Begin Source File
@ -127,10 +129,6 @@ SOURCE=..\..\..\source\blender\render\intern\source\ray.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\source\RE_callbacks.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\source\rendercore.c
# End Source File
# Begin Source File
@ -139,14 +137,6 @@ SOURCE=..\..\..\source\blender\render\intern\source\renderdatabase.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\source\renderHelp.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\source\renderPreAndPost.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\source\shadbuf.c
# End Source File
# Begin Source File
@ -155,20 +145,8 @@ SOURCE=..\..\..\source\blender\render\intern\source\texture.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\source\vanillaRenderPipe.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\source\zblur.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\source\zbuf.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\source\zbufferdatastruct.c
# End Source File
# End Group
# Begin Group "Header Files"
@ -183,10 +161,6 @@ SOURCE=..\..\..\source\blender\render\intern\include\envmap.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\include\errorHandler.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\include\gammaCorrectionTables.h
# End Source File
# Begin Source File
@ -195,14 +169,6 @@ SOURCE=..\..\..\source\blender\render\intern\include\initrender.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\include\jitter.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\include\outerRenderLoop.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\include\pixelblending.h
# End Source File
# Begin Source File
@ -211,22 +177,10 @@ SOURCE=..\..\..\source\blender\render\intern\include\pixelshading.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\include\RE_callbacks.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\include\rendercore.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\include\renderHelp.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\include\renderPreAndPost.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\include\shadbuf.h
# End Source File
# Begin Source File
@ -235,28 +189,8 @@ SOURCE=..\..\..\source\blender\render\intern\include\texture.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\include\vanillaRenderPipe.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\include\vanillaRenderPipe_types.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\include\zbuf.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\include\zbuf_types.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\include\zbufferdatastruct.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\render\intern\include\zbufferdatastruct_types.h
# End Source File
# End Group
# End Target
# End Project

@ -40,9 +40,10 @@ RSC=rc.exe
# PROP Output_Dir "..\..\..\obj\windows\blender\src"
# PROP Intermediate_Dir "..\..\..\obj\windows\blender\src"
# PROP Target_Dir ""
MTL=midl.exe
LINK32=link.exe -lib
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\..\lib\windows\sdl\include\\" /I "..\..\..\source\blender\img" /I "..\..\..\source\blender\renderui" /I "..\..\..\..\lib\windows\soundsystem\include\\" /I "..\..\..\..\lib\windows\python\include\python2.0\\" /I "..\..\..\..\lib\windows\bmfont\include" /I "..\..\..\source\blender\ftfont" /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\renderconverter" /I "..\..\..\source\blender\verify" /I "..\..\..\source\blender\readstreamglue" /I "..\..\..\source\gameengine\soundsystem\snd_openal" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\blender\quicktime" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\misc" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\radiosity\extern\include" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\gameengine\network" /I "..\..\..\..\lib\windows\decimation\include" /I "..\..\..\source\blender\blenpluginapi\\" /I "..\..\..\..\lib\windows\blenkey\include" /I "..\..\..\..\lib\windows\ghost\include" /I "..\..\..\..\lib\windows\bsp\include" /I "..\..\..\..\lib\windows\opennl\include" /I "..\..\..\intern\elbeem\extern" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "_CONSOLE" /D "GAMEBLENDER" /D "WITH_QUICKTIME" /D "INTERNATIONAL" /FR /J /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\..\lib\windows\sdl\include\\" /I "..\..\..\source\blender\img" /I "..\..\..\source\blender\renderui" /I "..\..\..\..\lib\windows\soundsystem\include\\" /I "..\..\..\..\lib\windows\python\include\python2.0\\" /I "..\..\..\..\lib\windows\bmfont\include" /I "..\..\..\source\blender\ftfont" /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\renderconverter" /I "..\..\..\source\blender\verify" /I "..\..\..\source\blender\readstreamglue" /I "..\..\..\source\gameengine\soundsystem\snd_openal" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\blender\quicktime" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\misc" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\radiosity\extern\include" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\gameengine\network" /I "..\..\..\..\lib\windows\decimation\include" /I "..\..\..\source\blender\blenpluginapi\\" /I "..\..\..\..\lib\windows\blenkey\include" /I "..\..\..\..\lib\windows\ghost\include" /I "..\..\..\..\lib\windows\bsp\include" /I "..\..\..\..\lib\windows\opennl\include" /I "..\..\..\intern\elbeem\extern" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "_CONSOLE" /D "GAMEBLENDERx" /D "WITH_QUICKTIME" /D "INTERNATIONAL" /FR /J /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@ -64,9 +65,10 @@ LIB32=link.exe -lib
# PROP Output_Dir "..\..\..\obj\windows\blender\src\debug"
# PROP Intermediate_Dir "..\..\..\obj\windows\blender\src\debug"
# PROP Target_Dir ""
MTL=midl.exe
LINK32=link.exe -lib
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\lib\windows\sdl\include\\" /I "..\..\..\source\blender\img" /I "..\..\..\source\blender\renderui" /I "..\..\..\..\lib\windows\soundsystem\include\\" /I "..\..\..\..\lib\windows\python\include\python2.0\\" /I "..\..\..\..\lib\windows\bmfont\include" /I "..\..\..\source\blender\ftfont" /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\renderconverter" /I "..\..\..\source\blender\verify" /I "..\..\..\source\blender\readstreamglue" /I "..\..\..\source\gameengine\soundsystem\snd_openal" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\blender\quicktime" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\misc" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\radiosity\extern\include" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\gameengine\network" /I "..\..\..\..\lib\windows\decimation\include" /I "..\..\..\source\blender\blenpluginapi\\" /I "..\..\..\..\lib\windows\blenkey\include" /I "..\..\..\..\lib\windows\ghost\include" /I "..\..\..\..\lib\windows\bsp\include" /I "..\..\..\..\lib\windows\opennl\include" /I "..\..\..\intern\elbeem\extern" /D "WIN32" /D "_MBCS" /D "_LIB" /D "_CONSOLE" /D "GAMEBLENDER" /D "WITH_QUICKTIME" /D "INTERNATIONAL" /U "_DEBUG" /J /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\lib\windows\sdl\include\\" /I "..\..\..\source\blender\img" /I "..\..\..\source\blender\renderui" /I "..\..\..\..\lib\windows\soundsystem\include\\" /I "..\..\..\..\lib\windows\python\include\python2.0\\" /I "..\..\..\..\lib\windows\bmfont\include" /I "..\..\..\source\blender\ftfont" /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\renderconverter" /I "..\..\..\source\blender\verify" /I "..\..\..\source\blender\readstreamglue" /I "..\..\..\source\gameengine\soundsystem\snd_openal" /I "..\..\..\source\blender\imbuf" /I "..\..\..\source\blender\blenloader" /I "..\..\..\source\blender\quicktime" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\misc" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\radiosity\extern\include" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\gameengine\network" /I "..\..\..\..\lib\windows\decimation\include" /I "..\..\..\source\blender\blenpluginapi\\" /I "..\..\..\..\lib\windows\blenkey\include" /I "..\..\..\..\lib\windows\ghost\include" /I "..\..\..\..\lib\windows\bsp\include" /I "..\..\..\..\lib\windows\opennl\include" /I "..\..\..\intern\elbeem\extern" /D "WIN32" /D "_MBCS" /D "_LIB" /D "_CONSOLE" /D "GAMEBLENDERx" /D "WITH_QUICKTIME" /D "INTERNATIONAL" /U "_DEBUG" /J /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
@ -187,6 +189,10 @@ SOURCE=..\..\..\source\blender\src\drawnla.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\src\drawnode.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\src\drawobject.c
# End Source File
# Begin Source File
@ -319,6 +325,10 @@ SOURCE=..\..\..\source\blender\src\editnla.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\src\editnode.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\src\editobject.c
# End Source File
# Begin Source File
@ -403,6 +413,10 @@ SOURCE=..\..\..\source\blender\src\header_nla.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\src\header_node.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\src\header_oops.c
# End Source File
# Begin Source File
@ -451,6 +465,10 @@ SOURCE=..\..\..\source\blender\src\interface_draw.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\src\interface_icons.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\src\interface_panel.c
# End Source File
# Begin Source File
@ -487,6 +505,10 @@ SOURCE=..\..\..\source\blender\src\outliner.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\src\parametrizer.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\src\playanim.c
# End Source File
# Begin Source File
@ -499,6 +521,10 @@ SOURCE=..\..\..\source\blender\src\poseobject.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\src\preview.blend.c
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\src\previewrender.c
# End Source File
# Begin Source File
@ -955,6 +981,14 @@ SOURCE=..\..\..\source\blender\include\editmesh.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\src\parametrizer.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\src\parametrizer_intern.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\blender\include\transform.h
# End Source File
# Begin Source File

@ -45,7 +45,7 @@ RSC=rc.exe
MTL=midl.exe
LINK32=link.exe -lib
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GR /GX /O2 /I "..\..\..\source\gameengine\physics\common\dummy" /I "..\..\..\extern\solid" /I "..\..\..\..\lib\windows\string\include" /I "..\..\..\..\lib\windows\moto\include" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\..\lib\windows\soundsystem\include" /I "..\..\..\source\gameengine\rasterizer" /I "..\..\..\source\gameengine\scenegraph" /I "..\..\..\source\gameengine\gamelogic" /I "..\..\..\source\gameengine\expressions" /I "..\..\..\source\sumo\include" /I "..\..\..\source\sumo\fuzzics\include" /I "..\..\..\source\gameengine\network" /I "..\..\..\source\gameengine\Converter" /I "..\..\..\source\gameengine\ketsji\kxnetwork" /I "..\..\..\source\gameengine\physics" /I "..\..\..\source\gameengine\physics\common" /I "..\..\..\source\gameengine\physics\dummy" /I "..\..\..\source\gameengine\physics\sumo" /I "..\..\..\source\gameengine\physics\sumo\fuzzics\include" /I "..\..\..\source\gameengine\physics\sumo\include" /I "..\..\..\source\gameengine\physics\BlOde" /I "..\..\..\..\lib\windows\python\include\python2.4" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\imbuf" /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\gameengine\physics\bullet" /I "..\..\..\extern\bullet\linearmath" /I "..\..\..\extern\bullet\Bulletdynamics" /I "..\..\..\extern\bullet\Bullet" /I "..\..\..\source\gameengine/Rasterizer/RAS_OpenGLRasterizer" /I "..\..\..\source\blender\blenlib" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "EXP_PYTHON_EMBEDDING" /D "USE_SUMO_SOLID" /YX /J /FD /c
# ADD CPP /nologo /MT /W3 /GR /GX /O2 /I "..\..\..\source\gameengine\physics\common\dummy" /I "..\..\..\extern\solid" /I "..\..\..\..\lib\windows\string\include" /I "..\..\..\..\lib\windows\moto\include" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\..\lib\windows\soundsystem\include" /I "..\..\..\source\gameengine\rasterizer" /I "..\..\..\source\gameengine\scenegraph" /I "..\..\..\source\gameengine\gamelogic" /I "..\..\..\source\gameengine\expressions" /I "..\..\..\source\sumo\include" /I "..\..\..\source\sumo\fuzzics\include" /I "..\..\..\source\gameengine\network" /I "..\..\..\source\gameengine\Converter" /I "..\..\..\source\gameengine\ketsji\kxnetwork" /I "..\..\..\source\gameengine\physics" /I "..\..\..\source\gameengine\physics\common" /I "..\..\..\source\gameengine\physics\dummy" /I "..\..\..\source\gameengine\physics\sumo" /I "..\..\..\source\gameengine\physics\sumo\fuzzics\include" /I "..\..\..\source\gameengine\physics\sumo\include" /I "..\..\..\source\gameengine\physics\BlOde" /I "..\..\..\..\lib\windows\python\include\python2.4" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\imbuf" /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\gameengine\physics\bullet" /I "..\..\..\extern\bullet\linearmath" /I "..\..\..\extern\bullet\Bulletdynamics" /I "..\..\..\extern\bullet\Bullet" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "EXP_PYTHON_EMBEDDING" /D "USE_SUMO_SOLID" /YX /J /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@ -70,7 +70,7 @@ LIB32=link.exe -lib
MTL=midl.exe
LINK32=link.exe -lib
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GR /GX /Zi /Od /I "..\..\..\source\gameengine\physics\common\dummy" /I "..\..\..\extern\solid" /I "..\..\..\..\lib\windows\string\include" /I "..\..\..\..\lib\windows\moto\include" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\..\lib\windows\soundsystem\include" /I "..\..\..\source\gameengine\rasterizer" /I "..\..\..\source\gameengine\scenegraph" /I "..\..\..\source\gameengine\gamelogic" /I "..\..\..\source\gameengine\expressions" /I "..\..\..\source\sumo\include" /I "..\..\..\source\sumo\fuzzics\include" /I "..\..\..\source\gameengine\network" /I "..\..\..\source\gameengine\Converter" /I "..\..\..\source\gameengine\ketsji\kxnetwork" /I "..\..\..\source\gameengine\physics" /I "..\..\..\source\gameengine\physics\common" /I "..\..\..\source\gameengine\physics\dummy" /I "..\..\..\source\gameengine\physics\sumo" /I "..\..\..\source\gameengine\physics\sumo\fuzzics\include" /I "..\..\..\source\gameengine\physics\sumo\include" /I "..\..\..\source\gameengine\physics\BlOde" /I "..\..\..\..\lib\windows\python\include\python2.4" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\imbuf" /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\gameengine\physics\bullet" /I "..\..\..\extern\bullet\linearmath" /I "..\..\..\extern\bullet\Bulletdynamics" /I "..\..\..\extern\bullet\Bullet" /I "..\..\..\source\gameengine/Rasterizer/RAS_OpenGLRasterizer" /I "..\..\..\source\blender\blenlib" /D "JANCODEPANCO" /D "WIN32" /D "_MBCS" /D "_LIB" /D "EXP_PYTHON_EMBEDDING" /D "USE_SUMO_SOLID" /U "_DEBUG" /YX /J /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GR /GX /Zi /Od /I "..\..\..\source\gameengine\physics\common\dummy" /I "..\..\..\extern\solid" /I "..\..\..\..\lib\windows\string\include" /I "..\..\..\..\lib\windows\moto\include" /I "..\..\..\source\kernel\gen_system" /I "..\..\..\..\lib\windows\soundsystem\include" /I "..\..\..\source\gameengine\rasterizer" /I "..\..\..\source\gameengine\scenegraph" /I "..\..\..\source\gameengine\gamelogic" /I "..\..\..\source\gameengine\expressions" /I "..\..\..\source\sumo\include" /I "..\..\..\source\sumo\fuzzics\include" /I "..\..\..\source\gameengine\network" /I "..\..\..\source\gameengine\Converter" /I "..\..\..\source\gameengine\ketsji\kxnetwork" /I "..\..\..\source\gameengine\physics" /I "..\..\..\source\gameengine\physics\common" /I "..\..\..\source\gameengine\physics\dummy" /I "..\..\..\source\gameengine\physics\sumo" /I "..\..\..\source\gameengine\physics\sumo\fuzzics\include" /I "..\..\..\source\gameengine\physics\sumo\include" /I "..\..\..\source\gameengine\physics\BlOde" /I "..\..\..\..\lib\windows\python\include\python2.4" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\imbuf" /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\gameengine\physics\bullet" /I "..\..\..\extern\bullet\linearmath" /I "..\..\..\extern\bullet\Bulletdynamics" /I "..\..\..\extern\bullet\Bullet" /D "JANCODEPANCO" /D "WIN32" /D "_MBCS" /D "_LIB" /D "EXP_PYTHON_EMBEDDING" /D "USE_SUMO_SOLID" /U "_DEBUG" /YX /J /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
@ -267,22 +267,6 @@ SOURCE=..\..\..\source\gameengine\Ketsji\KX_ScalingInterpolator.cpp
# End Group
# Begin Source File
SOURCE=..\..\..\source\gameengine\Ketsji\BL_Material.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\gameengine\Ketsji\BL_Shader.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\gameengine\Ketsji\BL_Texture.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\gameengine\Ketsji\KX_BlenderMaterial.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\gameengine\Ketsji\KX_BulletPhysicsController.cpp
# End Source File
# Begin Source File
@ -319,10 +303,6 @@ SOURCE=..\..\..\source\gameengine\Ketsji\KX_Light.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\gameengine\Ketsji\KX_MaterialIpoController.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\gameengine\Ketsji\KX_MeshProxy.cpp
# End Source File
# Begin Source File
@ -535,22 +515,6 @@ SOURCE=..\..\..\source\gameengine\Ketsji\KX_ScalingInterpolator.h
# End Group
# Begin Source File
SOURCE=..\..\..\source\gameengine\Ketsji\BL_Material.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\gameengine\Ketsji\BL_Shader.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\gameengine\Ketsji\BL_Texture.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\gameengine\Ketsji\KX_BlenderMaterial.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\gameengine\Ketsji\KX_BulletPhysicsController.h
# End Source File
# Begin Source File
@ -599,10 +563,6 @@ SOURCE=..\..\..\source\gameengine\Ketsji\KX_Light.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\gameengine\Ketsji\KX_MaterialIpoController.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\gameengine\Ketsji\KX_MeshProxy.h
# End Source File
# Begin Source File

@ -190,9 +190,6 @@
<File
RelativePath="..\..\..\source\blender\python\api2_2x\Object.c">
</File>
<File
RelativePath="..\..\..\source\blender\python\api2_2x\Pose.c">
</File>
<File
RelativePath="..\..\..\source\blender\python\api2_2x\Registry.c">
</File>
@ -360,9 +357,6 @@
<File
RelativePath="..\..\..\source\blender\python\api2_2x\Object.h">
</File>
<File
RelativePath="..\..\..\source\blender\python\api2_2x\Pose.h">
</File>
<File
RelativePath="..\..\..\source\blender\python\api2_2x\Registry.h">
</File>

@ -117,6 +117,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GP_axctl", "..\gameengine\g
{09222F5E-1625-4FF3-A89A-384D16875EE5} = {09222F5E-1625-4FF3-A89A-384D16875EE5}
{E013786A-9575-4F34-81B2-33290357EE87} = {E013786A-9575-4F34-81B2-33290357EE87}
{415BFD6E-64CF-422B-AF88-C07F040A7292} = {415BFD6E-64CF-422B-AF88-C07F040A7292}
{EC405272-28E3-4840-AAC2-53D6DE4E163D} = {EC405272-28E3-4840-AAC2-53D6DE4E163D}
{6B801390-5F95-4F07-81A7-97FBA046AACC} = {6B801390-5F95-4F07-81A7-97FBA046AACC}
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94} = {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}
{F90BD995-FFA4-4B18-81E8-FA4322C939E8} = {F90BD995-FFA4-4B18-81E8-FA4322C939E8}
@ -151,6 +152,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GP_ghost", "..\gameengine\g
{09222F5E-1625-4FF3-A89A-384D16875EE5} = {09222F5E-1625-4FF3-A89A-384D16875EE5}
{E013786A-9575-4F34-81B2-33290357EE87} = {E013786A-9575-4F34-81B2-33290357EE87}
{415BFD6E-64CF-422B-AF88-C07F040A7292} = {415BFD6E-64CF-422B-AF88-C07F040A7292}
{EC405272-28E3-4840-AAC2-53D6DE4E163D} = {EC405272-28E3-4840-AAC2-53D6DE4E163D}
{6B801390-5F95-4F07-81A7-97FBA046AACC} = {6B801390-5F95-4F07-81A7-97FBA046AACC}
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94} = {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}
{F90BD995-FFA4-4B18-81E8-FA4322C939E8} = {F90BD995-FFA4-4B18-81E8-FA4322C939E8}
@ -193,6 +195,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PHY_Dummy", "..\GAMEENGINE\
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PHY_Ode", "..\gameengine\physics\PHY_Physics\PHY_Ode\PHY_Ode.vcproj", "{EC405272-28E3-4840-AAC2-53D6DE4E163D}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PHY_Physics", "..\gameengine\physics\PHY_Physics\PHY_Physics.vcproj", "{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
@ -523,6 +529,16 @@ Global
{3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.BlenderPlayer Debug.Build.0 = BlenderPlayer Debug|Win32
{3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.BlenderPlayer Release.ActiveCfg = BlenderPlayer Release|Win32
{3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.BlenderPlayer Release.Build.0 = BlenderPlayer Release|Win32
{EC405272-28E3-4840-AAC2-53D6DE4E163D}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32
{EC405272-28E3-4840-AAC2-53D6DE4E163D}.3D Plugin Debug.Build.0 = 3D Plugin Debug|Win32
{EC405272-28E3-4840-AAC2-53D6DE4E163D}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32
{EC405272-28E3-4840-AAC2-53D6DE4E163D}.3D Plugin Release.Build.0 = 3D Plugin Release|Win32
{EC405272-28E3-4840-AAC2-53D6DE4E163D}.Blender Debug.ActiveCfg = BlenderPlayer Debug|Win32
{EC405272-28E3-4840-AAC2-53D6DE4E163D}.Blender Release.ActiveCfg = BlenderPlayer Release|Win32
{EC405272-28E3-4840-AAC2-53D6DE4E163D}.BlenderPlayer Debug.ActiveCfg = BlenderPlayer Debug|Win32
{EC405272-28E3-4840-AAC2-53D6DE4E163D}.BlenderPlayer Debug.Build.0 = BlenderPlayer Debug|Win32
{EC405272-28E3-4840-AAC2-53D6DE4E163D}.BlenderPlayer Release.ActiveCfg = BlenderPlayer Release|Win32
{EC405272-28E3-4840-AAC2-53D6DE4E163D}.BlenderPlayer Release.Build.0 = BlenderPlayer Release|Win32
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.3D Plugin Debug.Build.0 = 3D Plugin Debug|Win32
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32

@ -63,7 +63,6 @@ ECHO Copying required 3rd party dlls...
XCOPY /Y ..\..\..\lib\windows\python\lib\python24.dll ..\..\bin
XCOPY /Y ..\..\..\lib\windows\gettext\lib\*.dll ..\..\bin
XCOPY /Y ..\..\..\lib\windows\sdl\lib\*.dll ..\..\bin
XCOPY /Y ..\..\..\lib\windows\tiff\lib\libtiff.dll ..\..\bin
ECHO Copying language folder
ECHO Done
"/>
@ -141,7 +140,6 @@ XCOPY /Y ..\..\..\lib\windows\gettext\lib\*.dll ..\..\bin\debug
XCOPY /Y ..\..\..\lib\windows\sdl\lib\*.dll ..\..\bin\debug
XCOPY /Y ..\..\..\lib\windows\python\lib\python24_d.dll ..\..\bin\debug
XCOPY /Y ..\..\..\lib\windows\CRTL\lib\msvcrtd.dll ..\..\bin\debug
XCOPY /Y ..\..\..\lib\windows\tiff\lib\libtiff.dll ..\..\bin\debug
ECHO Copying language folder
IF NOT EXIST ..\..\bin\debug\.blender MKDIR ..\..\bin\debug\.blender
XCOPY /Y ..\..\bin\.blender ..\..\bin\debug\.blender /E

@ -21,7 +21,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\tiff\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB,WITH_QUICKTIME"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -73,7 +73,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\tiff\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -124,7 +124,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\tiff\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,WITH_QUICKTIME"
StringPooling="TRUE"
RuntimeLibrary="2"
@ -176,7 +176,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\tiff\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,WITH_QUICKTIME"
StringPooling="TRUE"
RuntimeLibrary="0"
@ -228,7 +228,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\tiff\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB,WITH_QUICKTIME"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -280,7 +280,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\tiff\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,WITH_QUICKTIME"
StringPooling="TRUE"
RuntimeLibrary="0"
@ -363,9 +363,6 @@
<File
RelativePath="..\..\..\source\blender\imbuf\intern\divers.c">
</File>
<File
RelativePath="..\..\..\source\blender\imbuf\intern\dynlibtiff.c">
</File>
<File
RelativePath="..\..\..\source\blender\imbuf\intern\filter.c">
</File>
@ -414,9 +411,6 @@
<File
RelativePath="..\..\..\source\blender\imbuf\intern\targa.c">
</File>
<File
RelativePath="..\..\..\source\blender\imbuf\intern\tiff.c">
</File>
<File
RelativePath="..\..\..\source\blender\imbuf\intern\util.c">
</File>
@ -427,9 +421,6 @@
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="..\..\..\source\blender\imbuf\intern\dynlibtiff.h">
</File>
<File
RelativePath="..\..\..\source\blender\imbuf\intern\IMB_allocimbuf.h">
</File>
@ -487,9 +478,6 @@
<File
RelativePath="..\..\..\source\blender\imbuf\intern\IMB_targa.h">
</File>
<File
RelativePath="..\..\..\source\blender\imbuf\intern\IMB_tiff.h">
</File>
<File
RelativePath="..\..\..\source\blender\imbuf\intern\imbuf.h">
</File>

@ -488,9 +488,6 @@ DNA_makesdna.exe dna.c
<File
RelativePath="..\..\..\source\blender\makesdna\DNA_mesh_types.h">
</File>
<File
RelativePath="..\..\..\source\blender\makesdna\DNA_meshdata_types.h">
</File>
<File
RelativePath="..\..\..\source\blender\makesdna\DNA_meta_types.h">
</File>

@ -21,7 +21,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.4;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.4;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID"
StringPooling="TRUE"
RuntimeLibrary="2"
@ -74,7 +74,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.4;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.4;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
PreprocessorDefinitions="WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG;USE_SUMO_SOLID"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -126,7 +126,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.4;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.4;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
PreprocessorDefinitions="JANCODEPANCO;WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG;USE_SUMO_SOLID"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -179,7 +179,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.4;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.4;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID"
StringPooling="TRUE"
RuntimeLibrary="0"
@ -232,7 +232,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.4;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.4;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
PreprocessorDefinitions="JANCODEPANCO;WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG;USE_SUMO_SOLID"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -284,7 +284,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.4;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.4;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID"
StringPooling="TRUE"
RuntimeLibrary="0"
@ -332,18 +332,6 @@
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="..\..\..\source\gameengine\Ketsji\BL_Material.cpp">
</File>
<File
RelativePath="..\..\..\source\gameengine\Ketsji\BL_Shader.cpp">
</File>
<File
RelativePath="..\..\..\source\gameengine\Ketsji\BL_Texture.cpp">
</File>
<File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_BlenderMaterial.cpp">
</File>
<File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_BulletPhysicsController.cpp">
</File>
@ -371,15 +359,15 @@
<File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_Light.cpp">
</File>
<File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_MaterialIpoController.cpp">
</File>
<File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_MeshProxy.cpp">
</File>
<File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_MotionState.cpp">
</File>
<File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_OdePhysicsController.cpp">
</File>
<File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_PhysicsObjectWrapper.cpp">
</File>
@ -529,18 +517,6 @@
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="..\..\..\source\gameengine\Ketsji\BL_Material.h">
</File>
<File
RelativePath="..\..\..\source\gameengine\Ketsji\BL_Shader.h">
</File>
<File
RelativePath="..\..\..\source\gameengine\Ketsji\BL_Texture.h">
</File>
<File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_BlenderMaterial.h">
</File>
<File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_BulletPhysicsController.h">
</File>
@ -577,9 +553,6 @@
<File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_Light.h">
</File>
<File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_MaterialIpoController.h">
</File>
<File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_MeshProxy.h">
</File>

@ -19,7 +19,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet"
AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="FALSE"
BasicRuntimeChecks="3"
@ -64,7 +64,7 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet"
AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="0"
UsePrecompiledHeader="2"
@ -107,7 +107,7 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet"
AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="0"
UsePrecompiledHeader="2"
@ -151,7 +151,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet"
AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="FALSE"
BasicRuntimeChecks="3"
@ -197,7 +197,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet"
AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="FALSE"
BasicRuntimeChecks="3"
@ -242,7 +242,7 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet"
AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="2"
UsePrecompiledHeader="2"

@ -341,15 +341,9 @@
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="..\..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer\ARB_multitexture.h">
</File>
<File
RelativePath="..\..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer\EXT_separate_specular_color.h">
</File>
<File
RelativePath="..\..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer\glext.h">
</File>
<File
RelativePath="..\..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer\RAS_GLExtensionManager.h">
</File>

@ -55,7 +55,14 @@ all:
ifeq ($(CPU),alpha)
@$(MAKE) pkg TYPE="" TAR="tar cf" EXT1=".tar" \
COMPRESS="gzip -f --best" EXT2=".gz"
else
endif
ifeq ($(CPU),i386)
@$(MAKE) pkg TYPE="" TAR="tar cf" EXT1=".tar" \
COMPRESS="gzip -f --best" EXT2=".gz"
@$(MAKE) pkg TYPE="-static" TAR="tar cf" EXT1=".tar" \
COMPRESS="gzip -f --best" EXT2=".gz"
endif
ifeq ($(CPU),powerpc)
@$(MAKE) pkg TYPE="" TAR="tar cf" EXT1=".tar" \
COMPRESS="gzip -f --best" EXT2=".gz"
@$(MAKE) pkg TYPE="-static" TAR="tar cf" EXT1=".tar" \
@ -89,7 +96,6 @@ install: package
@#echo "****> Install text"
@cp text/blender.html $(DISTDIR)
@cp text/*.txt $(DISTDIR)
@cp text/*.pdf $(DISTDIR)
@echo "----> Make Config dir .blender"
@mkdir -p $(CONFDIR)
@# possible overruling .txt text documents

@ -1 +1 @@
2.41
2.40-alpha1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 59 KiB

@ -54,55 +54,49 @@ directly manipulate or export its data.
#
# ***** END GPL LICENCE BLOCK *****
import Blender
Blender.Window.EditMode(0)
NAME_LENGTH = 19
PREFIX = "_def"
PREFIX_LENGTH = len(PREFIX)
ob_list = Blender.Object.GetSelected()
for ob in ob_list:
ob.sel = 0
used_names = [ob.name for ob in Blender.Object.Get()]
used_names.extend(Blender.NMesh.GetNames())
deformedList = []
for ob in ob_list:
if ob.getType() == "Mesh":
name = ob.getName()
new_name = "%s_def" % name[:NAME_LENGTH-PREFIX_LENGTH]
new_name = name + "_deformed"
num = 0
new_mesh = Blender.NMesh.GetRawFromObject(name)
while new_name in used_names:
new_name = "%s_def.%.3i" % (name[:NAME_LENGTH-(PREFIX_LENGTH+PREFIX_LENGTH)], num)
mesh = Blender.NMesh.GetRaw(new_name)
while mesh:
num += 1
used_names.append(new_name)
new_name = name + "_deformed." + "%03i" % num
mesh = Blender.NMesh.GetRaw(new_name)
new_ob = Blender.NMesh.PutRaw(new_mesh, new_name)
new_ob.setMatrix(ob.getMatrix())
try:
new_ob = Blender.Object.Get(new_name)
while 1:
num += 1
new_name = name + "_deformed." + "%03i" % num
new_ob = Blender.Object.Get(new_name)
except:
pass
new_ob.setName(new_name)
deformedList.append(new_ob)
# Vert groups.
ob_mesh = ob.getData()
new_ob_mesh = new_ob.getData()
# If SubSurf is off on the original, copy the vertex weight
if not ob_mesh.getMode() & Blender.NMesh.Modes['SUBSURF']:
for vgroupname in ob_mesh.getVertGroupNames():
new_ob_mesh.addVertGroup(vgroupname)
if len(ob_mesh.verts) == len(new_ob_mesh.verts):
vlist = ob_mesh.getVertsFromGroup(vgroupname, True)
try:
new_ob_mesh.addVertGroup(vgroupname)
for vpair in vlist:
new_ob_mesh.assignVertsToGroup(vgroupname, [vpair[0]], vpair[1], 'add')
except:
pass
# If it's on, just add the vertex groups
else:
for vgroupname in ob_mesh.getVertGroupNames():
new_ob_mesh.addVertGroup(vgroupname)
for ob in deformedList:
ob.sel = 1
deformedList[0].sel = 1 # Keep the same object active.
new_ob_mesh.update()
Blender.Window.EditMode(1)

@ -2,7 +2,7 @@
""" Registration info for Blender menus: <- these words are ignored
Name: 'Axis Orientation Copy'
Blender: 239
Blender: 233
Group: 'Object'
Tip: 'Copy the axis orientation of the active object to all selected mesh objects'
"""
@ -10,7 +10,7 @@ Tip: 'Copy the axis orientation of the active object to all selected mesh object
__author__ = "A Vanpoucke (xand)"
__url__ = ("blender", "elysiun",
"French Blender support forum, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender")
__version__ = "2 17/12/05"
__version__ = "1.1 11/05/04"
__bpydoc__ = """\
This script copies the axis orientation -- X, Y and Z rotations -- of the
@ -75,7 +75,7 @@ from Blender.Mathutils import *
def applyTransform(mesh,mat):
for v in mesh.verts:
vec = v.co*mat
vec = VecMultMat(v.co,mat)
v.co[0], v.co[1], v.co[2] = vec[0], vec[1], vec[2]
@ -87,12 +87,12 @@ lenob=len(oblist)
error = 0
for o in oblist[1:]:
if o.getType() != "Mesh":
Draw.PupMenu("Error: selected objects must be meshes")
Draw.PupMenu("ERROR%t|Selected objects must be meshes")
error = 1
if not error:
if lenob<2:
Draw.PupMenu("Error: you must select at least 2 objects")
Draw.PupMenu("ERROR%t|You must select at least 2 objects")
else :
source=oblist[0]
nsource=source.name
@ -102,9 +102,9 @@ if not error:
for cible in oblist[1:]:
if source.rot!=cible.rot:
rotcible=cible.mat.rotationPart().toEuler().toMatrix()
rotsource=source.mat.rotationPart().toEuler().toMatrix()
rotsourcet = Matrix(rotsource)
rotcible=cible.mat.toEuler().toMatrix()
rotsource=source.mat.toEuler().toMatrix()
rotsourcet = CopyMat(rotsource)
rotsourcet.invert()
mat=rotcible*rotsourcet
ncible=cible.name

@ -1,16 +1,17 @@
#!BPY
""" Registration info for Blender menus:
Name: 'DirectX(.x)...'
Blender: 240
Name: 'DirectX8(.x)...'
Blender: 239
Group: 'Export'
Submenu: 'Export all the scene' export
Submenu: 'Export selected obj' exportsel
Tip: 'Export to DirectX text file format format.'
Tip: 'Export to DirectX8 text file format format.'
"""
__author__ = "Arben (Ben) Omari"
__url__ = ("blender", "elysiun", "Author's site, http://www.omariben.too.it")
__version__ = "2.0"
__version__ = "1.0"
__bpydoc__ = """\
This script exports a Blender mesh with armature to DirectX 8's text file
@ -20,8 +21,8 @@ Notes:<br>
Check author's site or the elYsiun forum for a new beta version of the
DX exporter.
"""
# DirectXExporter.py version 2.0
# Copyright (C) 2006 Arben OMARI -- omariarben@everyday.com
# DirectX8Exporter.py version 1.0
# Copyright (C) 2003 Arben OMARI -- omariarben@everyday.com
#
# 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
@ -41,17 +42,10 @@ DX exporter.
import Blender
from Blender import Types, Object, NMesh, Material,Armature
from Blender.Mathutils import *
import math
global mat_flip,index_list,space,bone_list,mat_dict
bone_list =[]
global new_bon,mat_flip,index_list
index_list = []
mat_dict = {}
space = 0
ANIM = 1
NORMAL = 1
TEXCOORDS = 1
TEXTURE = 1
new_bon = {}
mat_flip = Matrix([1, 0, 0, 0], [0, 1, 0, 0], [0, 0, -1, 0], [0, 0, 0, 1])
@ -70,7 +64,6 @@ class xExport:
#Select Scene objects
#***********************************************
def SelectObjs(self):
global chld_obj
print "exporting..."
self.writeHeader()
for obj in Object.Get():
@ -161,117 +154,115 @@ class xExport:
#Export Root Bone
#***********************************************
def writeRootBone(self,am_ob,child_obj):
global mat_flip,space,root_bon,mat_ob
arms = am_ob.getData()
self.writeArmFrames(mat_flip, "RootFrame")
for bon in arms.bones.values():
if bon.hasParent():
pass
else:
root_bon = bon
space += 1
mat_rb = self.writeCombineMatrix(root_bon)
mat_r = mat_rb #* am_ob.matrixLocal
name_r = root_bon.name
name_f = name_r.replace(".","")
self.writeArmFrames(mat_r, name_f)
bon_c = self.findChildrens(root_bon)
self.writeChildren(bon_c)
global new_bon,mat_flip
space = 0
arm = am_ob.getData()
Blender.Set('curframe',1)
mat_ob = mat_flip * am_ob.matrixWorld
self.writeArmFrames(mat_ob, "RootFrame", 0)
root_bon = arm.getBones()
mat_r = self.writeCombineMatrix(root_bon[0])
name_r = root_bon[0].getName()
new_bon[name_r] = len(root_bon[0].getChildren())
self.writeArmFrames(mat_r, name_r, 1)
self.writeListOfChildrens(root_bon[0],2,arm)
self.file.write("}\n")
self.exportMeshArm(arms,am_ob,child_obj)
self.exportMeshArm(arm,am_ob,child_obj)
#***********************************************
#Export Children Bones
#***********************************************
def writeListOfChildrens(self,bon,space,arm):
global new_bon
bon_c = bon.getChildren()
Blender.Set('curframe',1)
for n in range(len(bon_c)):
name_h = bon_c[n].getName()
chi_h = bon_c[n].getChildren()
new_bon[name_h] = len(chi_h)
if bon_c == [] :
self.CloseBrackets(bon, new_bon, space, arm.getBones()[0])
for nch in range(len(bon_c)):
mat = self.writeCombineMatrix(bon_c[nch])
name_ch = bon_c[nch].getName()
self.writeArmFrames(mat, name_ch,space)
self.findChildrens(bon_c[nch],space,arm)
#***********************************************
#Create Children structure
#***********************************************
def writeBon(self,bon):
global space
mat_r = self.writeCombineMatrix(bon)
name_r = bon.name
name_f = name_r.replace(".","")
self.writeArmFrames(mat_r, name_f)
def findChildrens(self,bon):
bon_c = bon.children
return bon_c
def writeChildren(self,bon_c):
global space,bone_list
space += 1
if bon_c:
for bo in bon_c:
if bo.name not in bone_list:
self.writeBon(bo)
bone_list.append(bo.name)
bo_c = bo.children
self.writeChildren(bo_c)
self.closeBrackets()
def closeBrackets(self):
global space
space = space-1
def CloseBrackets(self, bon, new_bon, space, root_bon):
tab = " "
self.file.write("%s" % (tab * space))
self.file.write("%s" % (tab * (space -1)))
self.file.write("}\n")
while bon.hasParent():
if new_bon[bon.getName()] == 0:
pare = bon.getParent()
name_p = pare.getName()
if new_bon[name_p] > 0:
new_bon[name_p] = new_bon[name_p] - 1
if new_bon[name_p] == 0 and pare != root_bon:
self.file.write("%s" % (tab * (space-2)))
self.file.write("}\n")
space = space - 1
bon = pare
else:
break
#***********************************************
#Create Children structure
#***********************************************
def findChildrens(self,bon_c,space,arm):
bon_cc = bon_c
space += 1
self.writeListOfChildrens(bon_cc,space,arm)
#***********************************************
#Offset Matrix
#***********************************************
def writeMatrixOffset(self,bon):
global chld_obj
Blender.Set('curframe',1)
pose = chld_obj.getPose()
pos_b = pose.bones[bon.name]
mat_b = pos_b.poseMatrix
mat_b = bon.getRestMatrix()
mat_b.invert()
return mat_b
#***********************************************
#Combine Matrix
#***********************************************
def writeCombineMatrix(self,bon):
global chld_obj
Blender.Set('curframe',1)
pose = chld_obj.getPose()
pos_b = pose.bones[bon.name]
mat_b = pos_b.poseMatrix
mat_b = bon.getRestMatrix()
if bon.hasParent():
pare = bon.parent
pos_p = pose.bones[pare.name]
mat_p = pos_p.poseMatrix
pare = bon.getParent()
mat_p = pare.getRestMatrix()
else :
mat_p = Matrix([1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1])
mat_p.invert()
mat_f = mat_b * mat_p
mat_rb = mat_b * mat_p
return mat_rb
return mat_f
#***********************************************
#Combine Matrix
#***********************************************
def writeAnimCombineMatrix(self,bon,fre):
global chld_obj
Blender.Set('curframe', fre)
pose = chld_obj.getPose()
pos_b = pose.bones[bon.name]
mat_b = pos_b.poseMatrix
if bon.hasParent():
pare = bon.parent
pos_p = pose.bones[pare.name]
mat_p = pos_p.poseMatrix
def writeCombineAnimMatrix(self,bon):
mat_b = bon.getRestMatrix()
if bon.hasParent():
pare = bon.getParent()
mat_p = pare.getRestMatrix()
else :
mat_p = Matrix([1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1])
mat_p.invert()
mat_f = mat_b * mat_p
return mat_f
mat_rb = mat_b * mat_p
return mat_rb
#*********************************************************************************************************************************************
@ -280,23 +271,16 @@ class xExport:
#***********************************************
def writeSkinWeights(self, arm, mesh):
global index_list
v_dict = {}
Blender.Set('curframe',1)
self.file.write(" XSkinMeshHeader {\n")
max_infl = 0
#this part supply the missing getVertexInfluences(index)
for v in index_list:
v_dict[v] = []
for bo in arm.bones.values() :
name = bo.name
for bo in arm.getBones() :
name = bo.getName()
try :
vertx_list = mesh.getVertsFromGroup(name,1)
for vn in vertx_list:
v_dict[vn[0]].append(name)
#---------------------------------------------------
for inde in vertx_list :
vert_infl = v_dict[inde[0]]
vert_infl = mesh.getVertexInfluences(inde[0])
ln_infl = len(vert_infl)
if ln_infl > max_infl :
max_infl = ln_infl
@ -304,21 +288,20 @@ class xExport:
except:
pass
self.file.write(" %d; \n" % (max_infl))
self.file.write(" %d; \n" % (max_infl * 3))
self.file.write(" %d; \n" % (len(arm.bones.values())))
self.file.write(" %s; \n" % (max_infl))
self.file.write(" %s; \n" % (max_infl * 3))
self.file.write(" %s; \n" % (len(arm.getBones())))
self.file.write(" }\n")
for bo in arm.bones.values() :
for bo in arm.getBones() :
bo_list = []
weight_list = []
name = bo.name
f_name = name.replace(".","")
name = bo.getName()
try :
vert_list = mesh.getVertsFromGroup(name,1)
le = 0
for indx in vert_list:
ver_infl = v_dict[indx[0]]
ver_infl = mesh.getVertexInfluences(indx[0])
len_infl = float(len(ver_infl))
infl = 1 / len_infl
i = -1
@ -331,27 +314,28 @@ class xExport:
self.file.write(" SkinWeights {\n")
self.file.write(' "%s"; \n' % (f_name))
self.file.write(' %d; \n' % (le))
self.file.write(' "%s"; \n' % (name))
self.file.write(' %s; \n' % (le))
count = 0
for ind in bo_list :
count += 1
if count == len(bo_list):
self.file.write(" %d; \n" % (ind))
self.file.write(" %s; \n" % (ind))
else :
self.file.write(" %d, \n" % (ind))
self.file.write(" %s, \n" % (ind))
cou = 0
for wegh in weight_list :
cou += 1
if cou == len(weight_list):
self.file.write(" %f; \n" % (round(wegh,6)))
self.file.write(" %s; \n" % (round(wegh,6)))
else :
self.file.write(" %f, \n" % (round(wegh,6)))
self.file.write(" %s, \n" % (round(wegh,6)))
matx = self.writeMatrixOffset(bo)
self.writeOffsFrames(matx, name)
self.writeOffsFrames(matx, name, 1)
except :
pass
self.file.write(" }\n")
@ -360,8 +344,7 @@ class xExport:
#***********************************************
# Write Matrices
#***********************************************
def writeArmFrames(self, matx, name):
global space
def writeArmFrames(self, matx, name, space):
tab = " "
self.file.write("%s" % (tab * space))
self.file.write("Frame ")
@ -369,16 +352,16 @@ class xExport:
self.file.write("%s" % (tab * space))
self.file.write(" FrameTransformMatrix {\n")
self.file.write("%s" % (tab * space))
self.file.write(" %f,%f,%f,%f,\n" %
self.file.write(" %s,%s,%s,%s,\n" %
(round(matx[0][0],4),round(matx[0][1],4),round(matx[0][2],4),round(matx[0][3],4)))
self.file.write("%s" % (tab * space))
self.file.write(" %f,%f,%f,%f,\n" %
self.file.write(" %s,%s,%s,%s,\n" %
(round(matx[1][0],4),round(matx[1][1],4),round(matx[1][2],4),round(matx[1][3],4)))
self.file.write("%s" % (tab * space))
self.file.write(" %f,%f,%f,%f,\n" %
self.file.write(" %s,%s,%s,%s,\n" %
(round(matx[2][0],4),round(matx[2][1],4),round(matx[2][2],4),round(matx[2][3],4)))
self.file.write("%s" % (tab * space))
self.file.write(" %f,%f,%f,%f;;\n" %
self.file.write(" %s,%s,%s,%s;;\n" %
(round(matx[3][0],4),round(matx[3][1],4),round(matx[3][2],4),round(matx[3][3],6)))
self.file.write("%s" % (tab * space))
self.file.write(" }\n")
@ -386,20 +369,19 @@ class xExport:
#***********************************************
# Write Matrices
#***********************************************
def writeOffsFrames(self, matx, name):
space = 1
def writeOffsFrames(self, matx, name, space):
tab = " "
self.file.write("%s" % (tab * space))
self.file.write(" %f,%f,%f,%f,\n" %
self.file.write(" %s,%s,%s,%s,\n" %
(round(matx[0][0],4),round(matx[0][1],4),round(matx[0][2],4),round(matx[0][3],4)))
self.file.write("%s" % (tab * space))
self.file.write(" %f,%f,%f,%f,\n" %
self.file.write(" %s,%s,%s,%s,\n" %
(round(matx[1][0],4),round(matx[1][1],4),round(matx[1][2],4),round(matx[1][3],4)))
self.file.write("%s" % (tab * space))
self.file.write(" %f,%f,%f,%f,\n" %
self.file.write(" %s,%s,%s,%s,\n" %
(round(matx[2][0],4),round(matx[2][1],4),round(matx[2][2],4),round(matx[2][3],4)))
self.file.write("%s" % (tab * space))
self.file.write(" %f,%f,%f,%f;;\n" %
self.file.write(" %s,%s,%s,%s;;\n" %
(round(matx[3][0],4),round(matx[3][1],4),round(matx[3][2],4),round(matx[3][3],6)))
self.file.write("%s" % (tab * space))
self.file.write(" }\n")
@ -463,8 +445,7 @@ template SkinWeights {\n\
mat_ob.invert()
mat = mat_arm * mat_ob
mat.invert()
name_f = name.name.replace(".","")
self.writeArmFrames(mat, name_f)
self.writeArmFrames(mat, name.name, 1)
mesh = NMesh.GetRawFromObject(name.name)
self.file.write("Mesh {\n")
numface=len(mesh.faces)
@ -480,8 +461,8 @@ template SkinWeights {\n\
for n in range(len(face.v)):
index_list.append(face.v[n].index)
vec_vert = Vector([face.v[n].co[0], face.v[n].co[1], face.v[n].co[2], 1])
f_vec_vert = vec_vert * mat
self.file.write("%f; %f; %f;" % (round(f_vec_vert[0],4), round(f_vec_vert[1],4), round(f_vec_vert[2],4)))
f_vec_vert = VecMultMat(vec_vert, mat)
self.file.write("%s; %s; %s;" % (f_vec_vert[0], f_vec_vert[1], f_vec_vert[2]))
if counter == numface :
if n == len(face.v)-1 :
self.file.write(";\n")
@ -524,8 +505,7 @@ template SkinWeights {\n\
global index_list
#ROTATION
mat_ob = mat_flip * name.matrixWorld
name_f = name.name.replace(".","")
self.writeArmFrames(mat_ob, name_f)
self.writeArmFrames(mat_ob, name.name, 0)
self.file.write("Mesh {\n")
numface=len(mesh.faces)
@ -609,9 +589,10 @@ template SkinWeights {\n\
##MATERIAL NAME
for mat in Material.Get():
self.file.write(" Material")
name_m = mat.name
name_f = name_m.replace(".","")
self.file.write(" %s "% (name_f))
for a in range(0,len(mat.name)):
if mat.name[a] == ".":
print "WARNING:the material " + mat.name + " contains '.' within.Many viewers may refuse to read the exported file"
self.file.write(" %s "% (mat.name))
self.file.write("{\n")
self.file.write(" %s; %s; %s;" % (mat.R, mat.G, mat.B))
self.file.write("%s;;\n" % (mat.alpha))
@ -628,7 +609,7 @@ template SkinWeights {\n\
self.file.write(" 1.0;\n")
self.file.write(" 1.0; 1.0; 1.0;;\n")
self.file.write(" 0.0; 0.0; 0.0;;\n")
self.file.write(" TextureFilename {")
self.file.write(" TextureFilename {\n")
self.file.write(' "%s" ;'% (mat))
self.file.write(" }\n")
self.file.write(" }\n")
@ -731,44 +712,46 @@ template SkinWeights {\n\
#***********************************************
#WRITE ANIMATION KEYS
#***********************************************
def writeAnimation(self,arm_ob):
global mat_dict
arm = arm_ob.getData()
act_list = arm_ob.getAction()
ip = act_list.getAllChannelIpos()
for bon in arm.bones.values() :
for bon in arm.getBones() :
point_list = []
name = bon.name
name_f = name.replace(".", "")
try :
ip_bon_channel = ip[bon.name]
ip_bon_name = ip_bon_channel.getName()
ip_bon = Blender.Ipo.Get(ip_bon_name)
poi = ip_bon.getCurves()
for po in poi[3].getPoints():
a = po.getPoints()
point_list.append(int(a[0]))
#point_list.pop(0)
point_list.pop(0)
self.file.write(" Animation { \n")
self.file.write(" {%s}\n" %(name_f))
self.file.write(" {%s}\n" %(bon.getName()))
self.file.write(" AnimationKey { \n")
self.file.write(" 4;\n")
self.file.write(" %s; \n" % (len(point_list)))
self.file.write(" %s; \n" % (len(point_list)+1))
self.file.write(" %s;" % (1))
self.file.write("16;")
mat = self.writeCombineMatrix(bon)
self.writeFrames(mat)
self.file.write(",\n")
for fr in point_list:
mat = self.writeAnimCombineMatrix(bon,fr)
self.file.write(" %s;" % (fr))
self.file.write("16;")
Blender.Set('curframe',fr)
self.writeFrames(mat)
mat_new = self.writeCombineAnimMatrix(bon)
self.writeFrames(mat_new)
if fr == point_list[len(point_list)-1]:
self.file.write(";\n")
@ -881,8 +864,8 @@ arg = __script__['arg']
if arg == 'exportsel':
fname = Blender.sys.makename(ext = ".x")
Blender.Window.FileSelector(my_callback_sel, "Export DirectX", fname)
Blender.Window.FileSelector(my_callback_sel, "Export DirectX8", fname)
else:
fname = Blender.sys.makename(ext = ".x")
Blender.Window.FileSelector(my_callback, "Export DirectX", fname)
Blender.Window.FileSelector(my_callback, "Export DirectX8", fname)

@ -202,8 +202,7 @@ def transform_verts(verts, m):
vecs = []
for v in verts:
vec = Mathutils.Vector([v[0],v[1],v[2], 1])
#vecs.append(Mathutils.VecMultMat(vec, m))
vecs.append(vec*m)
vecs.append(Mathutils.VecMultMat(vec, m))
return vecs
# ---

@ -10,7 +10,7 @@ Tip: 'Import an AC3D (.ac) file.'
__author__ = "Willian P. Germano"
__url__ = ("blender", "elysiun", "AC3D's homepage, http://www.ac3d.org",
"PLib 3d gaming lib, http://plib.sf.net")
__version__ = "2.36a 2005-12-04"
__version__ = "2.36 2005-04-14"
__bpydoc__ = """\
This script imports AC3D models into Blender.
@ -43,9 +43,9 @@ users can configure (see config options above).
# $Id$
#
# --------------------------------------------------------------------------
# AC3DImport version 2.36a Dec 04, 2005
# AC3DImport version 2.36 Apr 14, 2005
# Program versions: Blender 2.36+ and AC3Db files (means version 0xb)
# changed: fixed a bug: error on 1 vertex "closed" polylines
# changed: updated to use the Scripts Config Editor facilities
# --------------------------------------------------------------------------
# ***** BEGIN GPL LICENSE BLOCK *****
#
@ -366,7 +366,7 @@ class AC3DImport:
faces.append(cut)
face = face[1:]
if flaglow == 1 and faces:
if flaglow == 1:
face = [faces[-1][-1], faces[0][0]]
faces.append(face)
@ -498,9 +498,7 @@ class AC3DImport:
for vi in range(len(f)):
bface.v.append(mesh.verts[f[vi][0]])
bface.uv.append((f[vi][1][0], f[vi][1][1]))
#mesh.faces.append(bface)
# quick hack, will switch from NMesh to Mesh later:
if len(bface.v) > 1: mesh.addFace(bface)
mesh.faces.append(bface)
mesh.mode = 0
object = Blender.NMesh.PutRaw(mesh)

@ -0,0 +1,131 @@
#!BPY
"""
Name: 'Batch Object Name Edit'
Blender: 232
Group: 'Object'
Tooltip: 'Apply the chosen rule to rename all selected objects at once.'
"""
__author__ = "Campbell Barton"
__url__ = ("blender", "elysiun")
__version__ = "1.0"
__bpydoc__ = """\
"Batch Object Name Edit" allows you to change multiple names of Blender
objects at once. It provides options to define if you want to: replace text
in the current names, truncate their beginnings or endings or prepend / append
strings to them.
Usage:
Select the objects to be renamed and run this script from the Object->Scripts
menu of the 3d View.
"""
# $Id$
#
# --------------------------------------------------------------------------
# Batch Name Edit by Campbell Barton (AKA Ideasman)
# --------------------------------------------------------------------------
# ***** 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.
#
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
from Blender import *
def main():
def new():
newname = Draw.PupStrInput('Name: ', '', 32)
if newname == None: return
Window.WaitCursor(1)
for ob in Object.GetSelected():
ob.name = newname
def replace():
replace = Draw.PupStrInput('Replace: ', '', 32)
if replace == None: return
with = Draw.PupStrInput('With: ', '', 32)
if with == None: return
Window.WaitCursor(1)
for ob in Object.GetSelected():
ob.name = ob.name.replace(replace, with)
# Use pythons replace, its better.
'''
if replace in ob.name:
chIdx = ob.name.index(replace)
# Remove the offending word and replace it with - 'with'
ob.name = ob.name[ :chIdx] + with + ob.name[chIdx + len(replace):]
'''
def prefix():
prefix = Draw.PupStrInput('prefix: ', '', 32)
if prefix == None: return
Window.WaitCursor(1)
for ob in Object.GetSelected():
ob.name = prefix + ob.name
def suffix():
suffix = Draw.PupStrInput('Suffix: ', '', 32)
if suffix == None: return
Window.WaitCursor(1)
for ob in Object.GetSelected():
ob.name = ob.name + suffix
def truncate_start():
truncate = Draw.PupIntInput('Truncate Start: ', 0, 0, 31)
if truncate != None:
Window.WaitCursor(1)
for ob in Object.GetSelected():
ob.name = ob.name[truncate: ]
def truncate_end():
truncate = Draw.PupIntInput('Truncate End: ', 0, 0, 31)
if truncate == None: return
Window.WaitCursor(1)
for ob in Object.GetSelected():
ob.name = ob.name[ :-truncate]
name = "Selected Object Names%t|New Name|Replace Text|Add Prefix|Add Suffix|Truncate Start|Truncate End"
result = Draw.PupMenu(name)
if result == -1:
pass
elif result == 1:
new()
elif result == 2:
replace()
elif result == 3:
prefix()
elif result == 4:
suffix()
elif result == 5:
truncate_start()
elif result == 6:
truncate_end()
Window.WaitCursor(0)
main()

@ -2,21 +2,21 @@
""" Registration info for Blender menus
Name: 'Bevel Center'
Blender: 240
Blender: 236
Group: 'Mesh'
Tip: 'Bevel selected faces, edges, and vertices'
Tip: 'Bevel selected vertices'
"""
__author__ = "Loic BERTHE"
__author__ = "Loic Berthe"
__url__ = ("blender", "elysiun")
__version__ = "2.0"
__version__ = "1.0"
__bpydoc__ = """\
This script implements vertex and edges bevelling in Blender.
This script implements vertex bevelling in Blender.
Usage:
Select the mesh you want to work on, enter Edit Mode and select the edges
Select the mesh you want to work on, enter Edit Mode and select the vertices
to bevel. Then run this script from the 3d View's Mesh->Scripts menu.
You can control the thickness of the bevel with the slider -- redefine the
@ -26,293 +26,356 @@ after applying the bevel, as many times as needed.
For an extra smoothing after or instead of direct bevel, set the level of
recursiveness and use the "Recursive" button.
This "Recursive" Button, won't work in face select mode, unless you choose
"faces" in the select mode menu.
Notes:<br>
You can undo and redo your steps just like with normal mesh operations in
Blender.
"""
# $Id$
#
######################################################################
# Bevel Center v2.0 for Blender
# This script lets you bevel the selected vertices or edges and control the
# Bevel Center v1 for Blender
#
# This script lets you bevel the selected vertices and control the
# thickness of the bevel
# (c) 2004-2006 Loïc Berthe (loic+blender@lilotux.net)
#
# (c) 2004 Loïc Berthe (loic.berthe@lilotux.net)
# released under Blender Artistic License
#
######################################################################
import Blender
from Blender import NMesh, Window, Scene
from Blender import NMesh, Window
from Blender.Draw import *
from Blender.Mathutils import *
from Blender.BGL import *
from math import pi, sin, sqrt
######################################################################
# Functions to handle the global structures of the script NF, NE and NC
# which contain informations about faces and corners to be created
# Functions to handle the global structures of the script NV, NE and NC
# which contain informations about the vertices, faces and corners to be
# created
global E_selected
E_selected = NMesh.EdgeFlags['SELECT']
class Dir:
def __init__(self, co):
self.co = co
def make_sel_vert(*co):
vi= NMesh.Vert(*co)
def add_to_NV(old,co,new):
dir = Dir(co)
#
if old in NV.keys():
NV[old][dir] = new
else:
NV[old] = {dir:new}
def is_in_NV(old,co):
if old in NV.keys():
for dir in NV[old]:
if dir.co == co : return NV[old][dir]
#
return False
def add_to_NE(old, new):
ind1 = old[0].index
ind2 = old[1].index
if ind1 > ind2:
new.reverse()
ind1,ind2 = ind2,ind1
id = str(ind1)+"_"+str(ind2)
if id in NE.keys():
[NE[id].append(v) for v in new]
else:
NE[id] = new
def add_to_NC(old,edge):
if old in NC.keys():
NC[old].append(edge)
else:
NC[old] = [edge]
######################################################################
# Geometric functions
def norm(vec):
n = sqrt(vec[0]**2+vec[1]**2+vec[2]**2)
return [vec[0]/n,vec[1]/n,vec[2]/n]
def parall_coord(old, dir):
co = old.co
vec = [0.0,0.0,0.0]
nco = [0.0,0.0,0.0]
#
if len(dir) == 1:
for i in range(3): vec[i] = dir[0].co[i] - co[i]
vec = norm(vec)
#
elif len(dir) == 2:
vec1 = [0.0,0.0,0.0]
vec2 = [0.0,0.0,0.0]
for i in range(3):
vec1[i] = dir[0].co[i] - co[i]
vec2[i] = dir[1].co[i] - co[i]
vec1 = norm(vec1)
vec2 = norm(vec2)
for i in range(3) : vec[i] = vec1[i]+vec2[i]
#
for i in range(3): nco[i] = co[i] + dist.val*vec[i]
return (nco,vec)
def get_vert(old, dir):
""" Look in NV if a vertice corresponding to the vertex old and the
direction dir already exists, and create one otherwise"""
(nco, vec) = parall_coord(old, dir)
v = is_in_NV(old,vec)
if v: return v
#
v = NMesh.Vert(nco[0],nco[1],nco[2])
v.sel = 1
me.verts.append(v)
add_to_NV(old,vec,v)
return v
def make_sel_face(verts):
f = NMesh.Face(verts)
f.sel = 1
me.addFace(f)
######################################################################
# Functions to create the differents faces
def add_to_NV(old,dir,new):
if old in NV.keys(): NV[old][dir] = new
else: NV[old] = {dir:new}
def get_v(old, *neighbors):
# compute the direction of the new vert
if len(neighbors) == 1 : dir = (neighbors[0].co - old.co).normalize()
else : dir = (neighbors[0].co - old.co).normalize() + (neighbors[1].co-old.co).normalize()
# look in NV if this vert already exists
key = tuple(dir)
if old in NV and key in NV[old] : return NV[old][key]
# else, create it
new = old.co + dist.val*dir
v = make_sel_vert(new.x,new.y,new.z)
add_to_NV(old,key,v)
return v
def make_faces():
""" Analyse the mesh, make the faces corresponding to selected faces and
fill the structures NE and NC """
# make the differents flags consistent
for e in me.edges:
if e.flag & E_selected :
e.v1.sel = 1
e.v2.sel = 1
NF =[] # NF : New faces
def make_NF():
""" Analyse the mesh, sort the faces containing selected vertices and
create a liste NF : NF = [[flag, vertlist, old_face]]. Flag describes the
topology of the face."""
#
for f in me.faces:
V = f.v
nV = len(V)
enumV = range(nV)
E = [me.findEdge(V[i],V[(i+1) % nV]) for i in enumV]
Esel = [x.flag & E_selected for x in E]
# look for selected vertices and creates a list containing the new vertices
newV = V[:]
changes = False
for (i,v) in enumerate(V):
if v.sel :
changes = True
if Esel[i-1] == 0 and Esel[i] == 1 : newV[i] = get_v(v,V[i-1])
elif Esel[i-1] == 1 and Esel[i] == 0 : newV[i] = get_v(v,V[(i+1) % nV])
elif Esel[i-1] == 1 and Esel[i] == 1 : newV[i] = get_v(v,V[i-1],V[(i+1) % nV])
else : newV[i] = [get_v(v,V[i-1]),get_v(v,V[(i+1) % nV])]
if changes:
# determine and store the face to be created
lenV = [len(x) for x in newV]
if 2 not in lenV :
new_f = NMesh.Face(newV)
if sum(Esel) == nV : new_f.sel = 1
NF.append(new_f)
v_sel = [x.sel for x in V]
nb_sel = sum(v_sel)
if nb_sel == 0 :
pass
else:
nb2 = lenV.count(2)
if nV == 4 : # f is a quad
if nb2 == 1 :
ind2 = lenV.index(2)
NF.append(NMesh.Face([newV[ind2-1],newV[ind2][0],newV[ind2][1],newV[ind2-3]]))
NF.append(NMesh.Face([newV[ind2-1],newV[ind2-2],newV[ind2-3]]))
elif nb2 == 2 :
# We must know if the tuples are neighbours
ind2 = ''.join([str(x) for x in lenV+lenV[:1]]).find('22')
if ind2 != -1 : # They are
NF.append(NMesh.Face([newV[ind2][0],newV[ind2][1],newV[ind2-3][0],newV[ind2-3][1]]))
NF.append(NMesh.Face([newV[ind2][0],newV[ind2-1],newV[ind2-2],newV[ind2-3][1]]))
else: # They aren't
ind2 = lenV.index(2)
NF.append(NMesh.Face([newV[ind2][0],newV[ind2][1],newV[ind2-2][0],newV[ind2-2][1]]))
NF.append(NMesh.Face([newV[ind2][1],newV[ind2-3],newV[ind2-2][0]]))
NF.append(NMesh.Face([newV[ind2][0],newV[ind2-1],newV[ind2-2][1]]))
elif nb2 == 3 :
ind2 = lenV.index(3)
NF.append(NMesh.Face([newV[ind2-1][1],newV[ind2],newV[ind2-3][0]]))
NF.append(NMesh.Face([newV[ind2-1][0],newV[ind2-1][1],newV[ind2-3][0],newV[ind2-3][1]]))
NF.append(NMesh.Face([newV[ind2-3][1],newV[ind2-2][0],newV[ind2-2][1],newV[ind2-1][0]]))
nb_v = len(V)
#
if nb_v == 4:
#
if nb_sel == 4:
NF.append([1,V,f])
#
elif nb_sel == 3:
if v_sel == [0,1,1,1]: V = [V[1],V[2],V[3],V[0]]
elif v_sel == [1,0,1,1]: V = [V[2],V[3],V[0],V[1]]
elif v_sel == [1,1,0,1]: V = [V[3],V[0],V[1],V[2]]
NF.append([2,V,f])
#
elif nb_sel == 2:
if v_sel == [1,0,1,0] or v_sel == [0,1,0,1]:
if v_sel == [0,1,0,1]: V = [V[1],V[2],V[3],V[0]]
NF.append([5,[V[0],V[1],V[3]],f])
NF.append([5,[V[2],V[1],V[3]]])
else:
if (newV[0][1].co-newV[3][0].co).length + (newV[1][0].co-newV[2][1].co).length \
< (newV[0][0].co-newV[1][1].co).length + (newV[2][0].co-newV[3][1].co).length :
ind2 = 0
if v_sel == [0,1,1,0]: V = [V[1],V[2],V[3],V[0]]
elif v_sel == [0,0,1,1]: V = [V[2],V[3],V[0],V[1]]
elif v_sel == [1,0,0,1]: V = [V[3],V[0],V[1],V[2]]
NF.append([3,V,f])
#
else:
ind2 = 1
NF.append(NMesh.Face([newV[ind2-1][0],newV[ind2-1][1],newV[ind2][0],newV[ind2][1]]))
NF.append(NMesh.Face([newV[ind2][1],newV[ind2-3][0],newV[ind2-2][1],newV[ind2-1][0]]))
NF.append(NMesh.Face([newV[ind2-3][0],newV[ind2-3][1],newV[ind2-2][0],newV[ind2-2][1]]))
else : # f is a tri
if nb2 == 1:
ind2 = lenV.index(2)
NF.append(NMesh.Face([newV[ind2-2],newV[ind2-1],newV[ind2][0],newV[ind2][1]]))
elif nb2 == 2:
ind2 = lenV.index(3)
NF.append(NMesh.Face([newV[ind2-1][1],newV[ind2],newV[ind2-2][0]]))
NF.append(NMesh.Face([newV[ind2-2][0],newV[ind2-2][1],newV[ind2-1][0],newV[ind2-1][1]]))
if v_sel == [0,1,0,0]: V = [V[1],V[2],V[3],V[0]]
elif v_sel == [0,0,1,0]: V = [V[2],V[3],V[0],V[1]]
elif v_sel == [0,0,0,1]: V = [V[3],V[0],V[1],V[2]]
NF.append([4,V,f])
#
elif nb_v == 3:
#
if nb_sel == 3:
NF.append([6,V,f])
#
elif nb_sel == 2:
if v_sel == [0,1,1]: V = [V[1],V[2],V[0]]
elif v_sel == [1,0,1]: V = [V[2],V[0],V[1]]
NF.append([7,V,f])
#
else:
ind2 = min(((newV[i][1].co-newV[i-1][0].co).length, i) for i in enumV)[1]
NF.append(NMesh.Face([newV[ind2-1][1],newV[ind2][0],newV[ind2][1],newV[ind2-2][0]]))
NF.append(NMesh.Face([newV[ind2-2][0],newV[ind2-2][1],newV[ind2-1][0],newV[ind2-1][1]]))
if v_sel == [0,1,0]: V = [V[1],V[2],V[0]]
elif v_sel == [0,0,1]: V = [V[2],V[0],V[1]]
NF.append([5,V,f])
# Preparing the corners
for i in enumV:
if lenV[i] == 2 : NC.setdefault(V[i],[]).append(newV[i])
old_faces.append(f)
# Preparing the Edges
for i in enumV:
if Esel[i]:
verts = [newV[i],newV[(i+1) % nV]]
if V[i].index > V[(i+1) % nV].index : verts.reverse()
NE.setdefault(E[i],[]).append(verts)
# Create the faces
for f in NF: me.addFace(f)
def make_faces():
""" Make the new faces according to NF """
#
for N in NF:
cas = N[0]
V = N[1]
#
if cas < 6:
new_v = [0,0,0,0]
if cas == 1: # v_sel = [1,1,1,1]
for i in range(-1,3):
new_v[i] = get_vert(V[i],[V[i-1],V[i+1]])
new_f = NMesh.Face(new_v)
me.faces.append(new_f)
for i in range(-1,3):
add_to_NE([V[i],V[i+1]],[new_v[i],new_v[i+1]])
#
elif cas == 2: # v_sel = [1,1,1,0]
new_v[0] = get_vert(V[0],[V[3]])
new_v[1] = get_vert(V[1],[V[0],V[2]])
new_v[2] = get_vert(V[2],[V[3]])
new_v[3] = V[3]
#
new_f = NMesh.Face(new_v)
me.faces.append(new_f)
#
add_to_NE([V[0],V[1]],[new_v[0],new_v[1]])
add_to_NE([V[1],V[2]],[new_v[1],new_v[2]])
#
elif cas == 3: # v_sel = [1,1,0,0]
new_v[0] = get_vert(V[0],[V[3]])
new_v[1] = get_vert(V[1],[V[2]])
new_v[2] = V[2]
new_v[3] = V[3]
#
new_f = NMesh.Face(new_v)
me.faces.append(new_f)
#
add_to_NE([V[0],V[1]],[new_v[0],new_v[1]])
#
elif cas == 4: # v_sel = [1,0,0,0]
new_v[0] = get_vert(V[0],[V[3]])
new_v[1] = get_vert(V[0],[V[1]])
new_v[2] = V[1]
new_v[3] = V[3]
#
new_f = NMesh.Face(new_v)
me.faces.append(new_f)
#
add_to_NC(V[0], new_v[0:2])
#
new_v[0] = V[1]
new_v[1] = V[2]
new_v[2] = V[3]
#
new_f = NMesh.Face(new_v[:3])
me.faces.append(new_f)
#
else: # v_sel = [1,0,0]
new_v[0] = get_vert(V[0],[V[2]])
new_v[1] = get_vert(V[0],[V[1]])
new_v[2] = V[1]
new_v[3] = V[2]
#
new_f = NMesh.Face(new_v)
me.faces.append(new_f)
#
add_to_NC(V[0], new_v[0:2])
#
else:
new_v = [0,0,0]
#
if cas == 6: # v_sel = [1,1,1]
for i in range(-1,2):
new_v[i] = get_vert(V[i],[V[i-1],V[i+1]])
new_f = NMesh.Face(new_v)
me.faces.append(new_f)
for i in range(-1,2):
add_to_NE([V[i],V[i+1]],[new_v[i],new_v[i+1]])
#
elif cas == 7: # v_sel = [1,1,0]
new_v[0] = get_vert(V[0],[V[2]])
new_v[1] = get_vert(V[1],[V[2]])
new_v[2] = V[2]
#
new_f = NMesh.Face(new_v)
me.faces.append(new_f)
add_to_NE([V[0],V[1]],[new_v[0],new_v[1]])
def make_edges():
""" Make the faces corresponding to selected edges """
for old,new in NE.iteritems() :
if len(new) == 1 : # This edge was on a border
oldv = [old.v1, old.v2]
if old.v1.index < old.v2.index : oldv.reverse()
make_sel_face(oldv+new[0])
me.findEdge(*oldv).flag |= E_selected
me.findEdge(*new[0]).flag |= E_selected
for v in oldv : NV_ext.add(v)
else:
make_sel_face(new[0] + new[1][::-1])
me.findEdge(*new[0]).flag |= E_selected
me.findEdge(*new[1]).flag |= E_selected
#
for l in NE.values():
if len(l) == 4:
f = NMesh.Face([l[0],l[1],l[3],l[2]])
me.faces.append(f)
def make_corners():
""" Make the faces corresponding to corners """
""" Make the faces corresponding to selected corners """
#
for v in NV.keys():
V = NV[v].values()
nV = len(V)
if nV == 1: pass
elif nV == 2 :
if v in NV_ext:
make_sel_face(V+[v])
me.findEdge(*V).flag |= E_selected
nb_v = len(V)
#
if nb_v < 3:
pass
#
elif nb_v == 3:
new_f = NMesh.Face(V)
me.faces.append(new_f)
#
else:
if nV == 3 and v not in NV_ext : make_sel_face(V)
else :
# We need to know which are the edges around the corner.
# First, we look for the quads surrounding the corner.
eed = []
for old, new in NE.iteritems():
if v in (old.v1,old.v2) :
if v.index == min(old.v1.index,old.v2.index) : ind = 0
else : ind = 1
if len(new) == 1: eed.append([v,new[0][ind]])
else : eed.append([new[0][ind],new[1][ind]])
q = [NE[id] for id in NE.keys() if str(v.index) in id.split('_')]
#
# We will put the associated edges in the list eed
is_in_v = lambda x:x in V
eed = [filter(is_in_v, l) for l in q]
#
# We will add the edges coming from faces where only one vertice is selected.
# They are stored in NC.
if v in NC: eed = eed+NC[v]
# Now we have to sort these vertices
hc = {}
for (a,b) in eed :
hc.setdefault(a,[]).append(b)
hc.setdefault(b,[]).append(a)
for x0,edges in hc.iteritems():
if len(edges) == 1 : break
b = [x0] # b will contain the sorted list of vertices
for i in range(len(hc)-1):
for x in hc[x0] :
if x not in b : break
b.append(x)
x0 = x
b.append(b[0])
# They are stocked in NC.
if v in NC.keys():
eed = eed+NC[v]
b = eed.pop()
# b will contain the sorted list of vertices
#
while eed:
for l in eed:
if l[0] == b[-1]:
b.append(l[1])
eed.remove(l)
break
elif l[1] == b[-1]:
b.append(l[0])
eed.remove(l)
break
# Now we can create the faces
if len(b) == 5: make_sel_face(b[:4])
if nb_v == 4:
new_f = NMesh.Face(b[:4])
me.faces.append(new_f)
#
else:
New_V = Vector(0.0, 0.0,0.0)
New_d = [0.0, 0.0,0.0]
for x in hc.keys(): New_V += x.co
co = [0.0, 0.0,0.0]
vec = [0.0, 0.0,0.0]
for x in V:
co[0] += x[0]
co[1] += x[1]
co[2] += x[2]
#
for dir in NV[v]:
for i in xrange(3): New_d[i] += dir[i]
New_V *= 1./len(hc)
for i in range(3) : New_d[i] /= nV
center = make_sel_vert(New_V.x,New_V.y,New_V.z)
add_to_NV(v,tuple(New_d),center)
for k in range(len(b)-1): make_sel_face([center, b[k], b[k+1]])
if 2 < nV and v in NC :
for edge in NC[v] : me.findEdge(*edge).flag |= E_selected
vec[0] += dir.co[0]
vec[1] += dir.co[1]
vec[2] += dir.co[2]
#
co = [x/nb_v for x in co]
vec = [x/nb_v for x in vec]
center = NMesh.Vert(co[0],co[1],co[2])
center.sel = 1
me.verts.append(center)
add_to_NV(v,vec,center)
#
for k in range(nb_v):
new_f = NMesh.Face([center, b[k], b[k+1]])
me.faces.append(new_f)
#
def clear_old():
""" Erase old faces and vertices """
for f in old_faces: me.removeFace(f)
for F in NF:
if len(F) == 3:
me.faces.remove(F[2])
#
for v in NV.keys():
if v not in NV_ext : me.verts.remove(v)
for e in me.edges:
if e.flag & E_selected :
e.v1.sel = 1
e.v2.sel = 1
me.verts.remove(v)
######################################################################
# Interface
#
global dist
NV = {}
dist = Create(0.2)
left = Create(0.0)
right = Create(1.0)
@ -330,79 +393,83 @@ def draw():
global EVENT_NOEVENT, EVENT_BEVEL, EVENT_UPDATE, EVENT_RECURS, EVENT_EXIT
glClear(GL_COLOR_BUFFER_BIT)
Button("Bevel",EVENT_BEVEL,10,100,280,25)
left=Number('', EVENT_NOEVENT,10,70,45, 20,left.val,0,right.val,'Set the minimum of the slider')
right = Number("",EVENT_NOEVENT,245,70,45,20,right.val,left.val,200,"Set the maximum of the slider")
dist=Slider("Thickness ",EVENT_UPDATE,60,70,180,20,dist.val,left.val,right.val,0, \
"Thickness of the bevel, can be changed even after bevelling")
glRasterPos2d(8,40)
Button("Bevel",EVENT_BEVEL,10,100,300,25)
left=Number('', EVENT_NOEVENT,10,70,50, 20,left.val,0,right.val,'Set the minimum of the slider')
right = Number("",EVENT_NOEVENT,260,70,50,20,right.val,left.val,200,"Set the maximum of the slider")
dist=Slider("Thickness ",EVENT_UPDATE,65,70,190,20,dist.val,left.val,right.val,0,"Thickness of the bevel, can be changed even after bevelling")
glRasterPos2d(10,40)
Text('To finish, you can use recursive bevel to smooth it')
num=Number('', EVENT_NOEVENT,10,10,40, 16,num.val,1,100,'Recursion level')
Button("Recursive",EVENT_RECURS,55,10,100,16)
Button("Exit",EVENT_EXIT,210,10,80,20)
num=Number('', EVENT_NOEVENT,10,10,50, 16,num.val,1,100,'Recursion level')
Button("Recursive",EVENT_RECURS,65,10,100,16)
Button("Exit",EVENT_EXIT,230,10,80,20)
def event(evt, val):
if ((evt == QKEY or evt == ESCKEY) and not val): Exit()
if ((evt == QKEY or evt == ESCKEY) and not val):
Exit()
def bevent(evt):
if evt == EVENT_EXIT : Exit()
elif evt == EVENT_BEVEL : bevel()
if evt == EVENT_EXIT :
Exit()
#
elif evt == EVENT_BEVEL:
bevel()
#
elif evt == EVENT_UPDATE:
try: bevel_update()
except NameError : pass
elif evt == EVENT_RECURS : recursive()
try:
bevel_update()
except NameError:
pass
#
elif evt == EVENT_RECURS:
recursive()
Register(draw, event, bevent)
######################################################################
def bevel():
""" The main function, which creates the bevel """
global me,NV,NV_ext,NE,NC, old_faces,old_dist
scn = Scene.GetCurrent()
ob = scn.getActiveObject()
if ob == None or ob.getType() != 'Mesh':
Draw.PupMenu('ERROR%t|Select a mesh object.')
return
Window.WaitCursor(1) # Change the Cursor
global me,NF,NV,NE,NC, old_dist
#
is_editmode = Window.EditMode()
if is_editmode: Window.EditMode(0)
me = ob.getData()
objects = Blender.Object.GetSelected()
bev_obj = objects[0]
if bev_obj.getType() != "Mesh":
PupMenu("ERROR: active object must be a mesh")
return
me = NMesh.GetRaw(bev_obj.getData(name_only = True))
#
NF = []
NV = {}
NV_ext = set()
NE = {}
NC = {}
old_faces = []
#
make_NF()
make_faces()
make_edges()
make_corners()
clear_old()
#
old_dist = dist.val
#
me.update(1)
if is_editmode: Window.EditMode(1)
Window.WaitCursor(0)
Blender.Redraw()
def bevel_update():
""" Use NV to update the bevel """
global dist, old_dist
global dist, old_dist, NV
if not NV: return
is_editmode = Window.EditMode()
if is_editmode: Window.EditMode(0)
fac = dist.val - old_dist
old_dist = dist.val
#
for old_v in NV.keys():
for dir in NV[old_v].keys():
for i in range(3):
NV[old_v][dir].co[i] += fac*dir[i]
NV[old_v][dir].co[i] += fac*dir.co[i]
#
me.update(1)
if is_editmode: Window.EditMode(1)
Blender.Redraw()
@ -410,23 +477,24 @@ def bevel_update():
def recursive():
""" Make a recursive bevel... still experimental """
global dist
from math import pi, sin
#
if num.val > 1:
a = pi/4
ang = []
for k in range(num.val):
ang.append(a)
a = (pi+2*a)/4
#
l = [2*(1-sin(x))/sin(2*x) for x in ang]
R = dist.val/sum(l)
l = [x*R for x in l]
#
dist.val = l[0]
bevel_update()
#
for x in l[1:]:
dist.val = x
bevel()
# vim:set ts=4 sw=4:

@ -5,28 +5,12 @@
# | http://www.redrival.com/scorpius |
# | scorpius@netzero.com |
# | September 28, 2002 |
# | Released under the Blender Artistic Licence (BAL) |
# | Import Export Suite v0.5 |
# +---------------------------------------------------------+
# | Common Functions & Global Variables For All IO Modules |
# +---------------------------------------------------------+
# ***** 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.
#
# ***** END GPL LICENCE BLOCK *****
import Blender
import sys
@ -51,16 +35,7 @@ def append_faces(mesh, faces, facesuv, uvcoords):
for i in range(len(faces)):
if not i%100 and show_progress: Blender.Window.DrawProgressBar(float(i)/len(faces), "Generating Faces")
numfaceverts=len(faces[i])
if numfaceverts == 2: #This is not a face is an edge
if mesh.edges == None: #first run
mesh.addEdgeData()
#rev_face = revert(cur_face)
i1 = faces[i][0]
i2 = faces[i][1]
ee = mesh.addEdge(mesh.verts[i1],mesh.verts[i2])
ee.flag |= Blender.NMesh.EdgeFlags.EDGEDRAW
ee.flag |= Blender.NMesh.EdgeFlags.EDGERENDER
elif numfaceverts in [3,4]: # This face is a triangle or quad
if numfaceverts <= 4: # This face is a triangle or quad
face = Blender.NMesh.Face()
for j in range(numfaceverts):
index = faces[i][j]

File diff suppressed because it is too large Load Diff

@ -1,60 +1,40 @@
#!BPY
"""
Name: 'Empties to Armature'
Blender: 241
Name: 'BVH Empties to Armature'
Blender: 237
Group: 'Animation'
Tooltip: 'Create Armature from a parented-empties chain'
Tooltip: 'Create Armature from Empties created by BVH importer'
"""
__author__ = " Jean-Baptiste PERIN (jb_perin(at)yahoo.fr) with valuable help from Vincent BILLET "
__author__ = " Jean-Baptiste PERIN (jb_perin(at)yahoo.fr)"
__url__ = ("blender", "elysiun",
"BVH 2 ARMATURE, http://perso.wanadoo.fr/jb.perin/",
"BVH 2 ARMATURE, http://www.zoo-logique.org/3D.Blender/index.php3?zoo=dld&rep=zip ",
"Communicate problems and errors, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender")
__version__ = "2.42"
__version__ = "2.2"
__bpydoc__ = """ BVH2ARM.py
__bpydoc__ = """ BVH2ARM.py v2.2
Script for generating armature on BVH empties.
This script generates an armature upon an empty-made parented chain,
and make the armature follow the empties
This script generates an armature and make bones
follow empties created by Blender BVH import script.
Usage:<br>
- Import a bvh in Blender (File->Import->BVH);<br>
- Rotate some empties to match your model and insert Rot key for them. <br>
- Select the root empty of the hierarchical chain.<br>
- Launch this script ;<br>
- Launch this script (Alt-P);<br>
- Set up variables:<br>
"hipbonename": the name of the main bone (automatically set to the selected empty).<br>
"hipbonename": the name of the main bone;<br>
"startframe": the first frame of your anim;<br>
"endframe": the last frame of your anim;<br>
"decimation": the frequency (in number of frame) to which the armature's pos is updated;<br>
"decimation": the frequency (in number of frame) to which the armature is updated;<br>
"scale" to size the created armature.<br>
- Press "Create Armature".
Notes: <br>
- The start frame configuration is used as the rest pose for the armature.<br>
- If the armature already exists when script is launched, the current armature is re-used.
"""
# --------------------------------------------------------------------------
# BVH2ARM.py
# --------------------------------------------------------------------------
# ***** 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.
#
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
#----------------------------------------------
# (c) Jean-Baptiste PERIN june 2005, released under Blender Artistic Licence
# for the Blender 2.34-2.36 Python Scripts Bundle.
#----------------------------------------------
@ -70,9 +50,6 @@ dicEmptyChild={}
dicBoneRestInvEmpRest={}
dicEmpRestInvBoneRest={}
restFrame = 1
bonerest={}
emprest={}
emp2bone={}
########################################################################
#
@ -134,8 +111,8 @@ def getEmpty(name):
p = o
return p
##def getChild(emp, emp_list):
## return dicEmptyChild[emp.getName()]
def getChild(emp, emp_list):
return dicEmptyChild[emp.getName()]
#########
@ -229,6 +206,53 @@ def GetOrCreateCurve(ipo, curvename):
#
########################################################################
def computeRootQuat2(empty, bone):
M1=dicBoneRestInvEmpRest[bone.getName()].rotationPart()
M2=dicEmpRestInvBoneRest[bone.getName()].rotationPart()
emprot = empty.getMatrix('worldspace').rotationPart()
emprot.transpose()
mat = M1*emprot*M2
mat.transpose()
return (mat.toQuat())
#emprest = dicEmptiesRestMatrix[empty.getName()].rotationPart()
#invemprest= dicEmptiesRestMatrix[empty.getName()].rotationPart()
##invemprest= emprest
##invemprest.invert()
##invemprest= dicEmptiesInvRestMatrix[empty.getName()].rotationPart()
#emprot = empty.getMatrix('worldspace').rotationPart()
#bonerest = dicBoneRestMatrix[bone.getName()].rotationPart()
#invbonerest = dicBoneRestMatrix[bone.getName()].rotationPart()
#invbonerest.invert()
#T2=emprot*invemprest
#T2.transpose()
#mat = bonerest*invemprest*T2*emprest*invbonerest
#mat.transpose()
#return (mat.toQuat())
#########
# Cette fonction
# in :
# out :
#########
def computeRootPos(empty, bone):
vec = computeScaledPos(empty.getMatrix('worldspace').translationPart()) - dicBoneRestMatrix[bone.getName()].translationPart()
mat = dicBoneRestMatrix[bone.getName()].rotationPart()
vec2 = Mathutils.MatMultVec (mat, vec)
return vec2
def computeRelativePos(empty,bone):
vec = computeScaledPos(empty.getMatrix('worldspace').translationPart()) - dicBoneRestMatrix[bone.getName()].translationPart()
rootempty = getEmpty(hipbonename)
vec3 = computeScaledPos(rootempty.getMatrix('worldspace').translationPart())
mat = dicBoneRestMatrix[bone.getName()].rotationPart()
vec2 = Mathutils.MatMultVec (mat, vec-vec3)
return vec2
#########
@ -253,28 +277,31 @@ def computeScaledPos(vec):
# out :
#########
def createBone (armature, empty, bone, empties):
global bonerest, emprest
children = getChildren(empty, empties)
if len(children) != 0:
for ch in children:
if len(children) >= 2:
bonename = empty.getName()[1:len(empty.getName())]+'_'+ch.getName()[1:len(ch.getName())]
else :
bonename = empty.getName()[1:len(empty.getName())]
print "creating Bone %s"%(bonename)
b=Blender.Armature.Editbone()
b.head = (computeScaledPos(empty.getMatrix('worldspace').translationPart()))
b.tail = (computeScaledPos(ch.getMatrix('worldspace').translationPart()))
b.parent = bone
# armature.makeEditable() should already be editable????
armature.bones[bonename] = b
#print b.matrix
bonerest[bonename]=Blender.Mathutils.Matrix(b.matrix).resize4x4()
emprest[empty.getName()]=Blender.Mathutils.Matrix(empty.getMatrix('localspace')).resize4x4()
#M = Blender.Mathutils.Matrix(emprest[empty.getName()])
#emp2bone[bonename] = Blender.Mathutils.Matrix(M.invert().rotationPart()*bonerest[bonename].rotationPart()).resize4x4()
#print emp2bone[bonename].rotationPart().toEuler()
dicBone[b.name]=b
b=Blender.Armature.Bone.New(bonename)
b.setHead(computeScaledPos(empty.getMatrix('worldspace').translationPart()))
b.setTail(computeScaledPos(ch.getMatrix('worldspace').translationPart()))
#b.setParent(bone)
matrice = empty.getMatrix('worldspace')
invmatrice = empty.getMatrix('worldspace')
invmatrice.invert()
invmatricet=empty.getMatrix('worldspace')
invmatricet.invert()
invmatricet.transpose()
dicEmptiesRestMatrix[empty.getName()] = matrice
dicEmptiesInvRestMatrix[empty.getName()] = invmatrice
armature.addBone(b)
invbonerest=b.getRestMatrix()
invbonerest.invert()
dicBoneRestMatrix[b.getName()] = b.getRestMatrix()
dicBoneRestInvEmpRest[b.getName()]=b.getRestMatrix()*invmatrice*invmatricet
dicEmpRestInvBoneRest[b.getName()]=matrice*invbonerest
dicBone[b.getName()]=b
createBone(armature, ch, b, empties)
#########
@ -283,12 +310,13 @@ def createBone (armature, empty, bone, empties):
# out :
#########
def f_createBone (armData, empty, bone, empties):
bones = armData.bones.values()
bones = armData.getBones()
def getBone(bonename):
bone = None
for b in bones:
#print b.getName()
if b.name == bonename:
if b.getName() == bonename:
bone = b
return bone
@ -300,41 +328,56 @@ def f_createBone (armData, empty, bone, empties):
bonename = empty.getName()[1:len(empty.getName())]
#b=Blender.Armature.Bone.New(bonename)
b=getBone(bonename)
b.head = (computeScaledPos(empty.getMatrix('worldspace').translationPart()))
b.tail = (computeScaledPos(ch.getMatrix('worldspace').translationPart()))
b.parent = bone
bonerest[bonename]=Blender.Mathutils.Matrix(b.matrix).resize4x4()
emprest[empty.getName()]=Blender.Mathutils.Matrix(empty.getMatrix('localspace')).resize4x4()
dicBone[b.name]=b
#b.setHead(empty.getMatrix('worldspace').translationPart())
#b.setTail(ch.getMatrix('worldspace').translationPart())
#b.setParent(bone)
matrice = empty.getMatrix('worldspace')
invmatrice = empty.getMatrix('worldspace')
invmatrice.invert()
invmatricet=empty.getMatrix('worldspace')
invmatricet.invert()
invmatricet.transpose()
dicEmptiesRestMatrix[empty.getName()] = matrice
dicEmptiesInvRestMatrix[empty.getName()] = invmatrice
#armature.addBone(b)
invbonerest=b.getRestMatrix()
invbonerest.invert()
dicBoneRestMatrix[b.getName()] = b.getRestMatrix()
dicBoneRestInvEmpRest[b.getName()]=b.getRestMatrix()*invmatrice*invmatricet
dicEmpRestInvBoneRest[b.getName()]=matrice*invbonerest
dicBone[b.getName()]=b
#print "Ajout de ", b.getName()," au dictionnaire"
f_createBone(armData, ch, b, empties)
#########
# Cette fonction fabrique une arma
# in :
# out :
#########
def createArmature (armObj, rootEmpty, empties):
global bonerest, emprest
armData=Blender.Armature.Armature('monArmature')
def createArmature (rootEmpty, empties):
armData=Blender.Armature.New('monArmature')
children = getChildren(rootEmpty, empties)
armObj.link(armData)
armData.makeEditable()
for ch in children:
b=Blender.Armature.Editbone()
bonename = rootEmpty.getName()[1:len(rootEmpty.getName())] + ch.getName()[1:len(ch.getName())]
print "creating Bone %s"%(bonename)
#print b, dir([b])
b.head=(computeScaledPos(rootEmpty.getMatrix('worldspace').translationPart()))
b.tail=(computeScaledPos(ch.getMatrix('worldspace').translationPart()))
bonerest[bonename]=Blender.Mathutils.Matrix(b.matrix).resize4x4()
emprest[rootEmpty.getName()]=Blender.Mathutils.Matrix(rootEmpty.getMatrix('localspace')).resize4x4()
armData.bones[bonename] = b
dicBone[b.name]=b
b=Blender.Armature.Bone.New(rootEmpty.getName()[1:len(rootEmpty.getName())] + ch.getName()[1:len(ch.getName())])
b.setHead(computeScaledPos(rootEmpty.getMatrix('worldspace').translationPart()))
b.setTail(computeScaledPos(ch.getMatrix('worldspace').translationPart()))
armData.addBone(b)
matrice = ch.getMatrix('worldspace')
invmatrice = ch.getMatrix('worldspace')
invmatrice.invert()
invmatricet=ch.getMatrix('worldspace')
invmatricet.invert()
invmatricet.transpose()
dicEmptiesRestMatrix[rootEmpty.getName()] = matrice
dicEmptiesInvRestMatrix[rootEmpty.getName()] = invmatrice
invbonerest=b.getRestMatrix()
invbonerest.invert()
dicBoneRestMatrix[b.getName()] = b.getRestMatrix()
dicBoneRestInvEmpRest[b.getName()]=b.getRestMatrix()*invmatrice*invmatricet
dicEmpRestInvBoneRest[b.getName()]=matrice*invbonerest
dicBone[b.getName()]=b
createBone(armData, ch, b, empties)
armData.update()
return armData
@ -345,27 +388,37 @@ def createArmature (armObj, rootEmpty, empties):
# out :
#########
def f_createArmature (rootEmpty, empties, armData):
armData.makeEditable()
bones = armData.bones.values()
bones = armData.getBones()
def getBone(bonename):
bone = None
for b in bones:
#print b.getName()
if b.name == bonename:
if b.getName() == bonename:
bone = b
return bone
children = getChildren(rootEmpty, empties)
for ch in children:
b=getBone(rootEmpty.getName()[1:len(rootEmpty.getName())] + ch.getName()[1:len(ch.getName())])
dicBone[b.name]=b
matrice = ch.getMatrix('worldspace')
invmatrice = ch.getMatrix('worldspace')
invmatrice.invert()
invmatricet=ch.getMatrix('worldspace')
invmatricet.invert()
invmatricet.transpose()
dicEmptiesRestMatrix[rootEmpty.getName()] = matrice
dicEmptiesInvRestMatrix[rootEmpty.getName()] = invmatrice
invbonerest=b.getRestMatrix()
invbonerest.invert()
dicBoneRestMatrix[b.getName()] = b.getRestMatrix()
dicBoneRestInvEmpRest[b.getName()]=b.getRestMatrix()*invmatrice*invmatricet
dicEmpRestInvBoneRest[b.getName()]=matrice*invbonerest
dicBone[b.getName()]=b
#print "Ajout de ", b.getName()," au dictionnaire"
bonerest[b.name]=Blender.Mathutils.Matrix(b.matrix).resize4x4()
emprest[rootEmpty.getName()]=Blender.Mathutils.Matrix(rootEmpty.getMatrix('localspace')).resize4x4()
f_createBone(armData, ch, b, empties)
armData.update()
#########
@ -373,34 +426,20 @@ def f_createArmature (rootEmpty, empties, armData):
# in :
# out :
#########
def moveBones(larmature, empty, empties):
#print "move bones"
global bonerest, emprest
def moveBones(armature, empty, empties):
children = dicEmptyChild[empty.getName()]
thepose = larmature.getPose()
for ch in children:
if len(children) >= 2:
bonename = empty.getName()[1:len(empty.getName())]+'_'+ch.getName()[1:len(ch.getName())]
else :
bonename = empty.getName()[1:len(empty.getName())]
thebone = thepose.bones[bonename]
trMatrix = empty.getMatrix('localspace')
bonerestmat = Blender.Mathutils.Matrix(bonerest[bonename])
invbonerestmat = Blender.Mathutils.Matrix(bonerest[bonename])
invbonerestmat.invert()
trMatrix[3][0] = 0.0
trMatrix[3][1] = 0.0
trMatrix[3][2] = 0.0
invemprestmat = Blender.Mathutils.Matrix(emprest[empty.getName()].rotationPart()).resize4x4()
invemprestmat.invert()
emprestmat = Blender.Mathutils.Matrix(emprest[empty.getName()].rotationPart()).resize4x4()
thebone.localMatrix = bonerestmat* invemprestmat *trMatrix * invbonerestmat
thepose.update()
thebone.insertKey(larmature, Blender.Get('curframe'), [Blender.Object.Pose.ROT, Blender.Object.Pose.LOC])
thepose.update()
bone = dicBone[bonename]
#bone.setLoc(computeRootPos(empty,bone))
bone.setLoc(computeRelativePos(empty,bone))
bone.setQuat(computeRootQuat2(empty,bone))
chch = dicEmptyChild[ch.getName()]
if len(chch) >= 1:
moveBones(larmature, ch, empties)
moveBones(armature, ch, empties)
#########
@ -408,20 +447,26 @@ def moveBones(larmature, empty, empties):
# in :
# out :
#########
def moveArmature (larmature, empties):
global bonerest, emprest
#print "move armature"
thepose = larmature.getPose()
#armature.makeEditable()
def moveArmature (armature, empties):
root = Blender.Object.Get(hipbonename)
children = dicEmptyChild[hipbonename]
for ch in children:
b=dicBone[hipbonename[1:len(hipbonename)] + ch.getName()[1:len(ch.getName())]]
moveBones(larmature, ch, empties)
#armature.update()
#b.setLoc(computeRootPos(root, b))
b.setLoc([0.0, 0.0, 0.0])
b.setQuat(computeRootQuat2(root, b))
moveBones(armature, ch, empties)
def eraseIPO (objectname):
object = Blender.Object.Get(objectname)
lIpo = object.getIpo()
if lIpo != None:
nbCurves = lIpo.getNcurves()
for i in range(nbCurves):
nbBezPoints = lIpo.getNBezPoints(i)
for j in range(nbBezPoints):
lIpo.delBezPoint(i)
########################################################################
@ -467,7 +512,7 @@ def Main():
lesEmpties = getEmpties()
#print dicEmptyChild
print "creating armature"
#armData = createArmature(em0, lesEmpties)
objects = Blender.Object.Get()
if 'OBArmature' in map(names,objects):
@ -478,16 +523,15 @@ def Main():
#print armData.getBones()
f_createArmature(em0, lesEmpties, armData)
else:
armData= createArmature(em0, lesEmpties)
armObj=Blender.Object.New('Armature', 'OBArmature')
armData= createArmature(armObj, em0, lesEmpties)
#armObj.link(armData)
armObj.link(armData)
scn = Blender.Scene.getCurrent()
scn.link (armObj)
print 'OBArmature'+' was created'
#return myobj
print emprest
armData.drawType = Blender.Armature.STICK
##-----------
## Creation de l'ipo de l'armature
##-----------
@ -496,11 +540,7 @@ def Main():
curvX = GetOrCreateCurve(lipo, 'LocX')
curvY = GetOrCreateCurve(lipo, 'LocY')
curvZ = GetOrCreateCurve(lipo, 'LocZ')
curvrX = GetOrCreateCurve(lipo, 'RotX')
curvrY = GetOrCreateCurve(lipo, 'RotY')
curvrZ = GetOrCreateCurve(lipo, 'RotZ')
print "animating armature"
#armData.drawAxes(1)
#armData.drawNames(1)
@ -509,16 +549,13 @@ def Main():
Blender.Redraw()
action = Blender.Armature.NLA.NewAction()
action.setActive(armObj)
##-----------
## Enregistrement de la position de l'armature
##-----------
bones = armData.bones.values()
bones = armData.getBones()
for bo in bones:
bo.setPose([Blender.Armature.Bone.ROT, Blender.Armature.Bone.LOC])
curvX.addBezier((Blender.Get("curframe"), getEmpty(hipbonename).getMatrix('worldspace').translationPart()[0]*scalef))
curvY.addBezier((Blender.Get("curframe"), getEmpty(hipbonename).getMatrix('worldspace').translationPart()[1]*scalef))
@ -529,12 +566,6 @@ def Main():
curvY.setExtrapolation('Constant')
curvZ.setInterpolation('Linear')
curvZ.setExtrapolation('Constant')
curvrX.setInterpolation('Linear')
curvrX.setExtrapolation('Constant')
curvrY.setInterpolation('Linear')
curvrY.setExtrapolation('Constant')
curvrZ.setInterpolation('Linear')
curvrZ.setExtrapolation('Constant')
Blender.Redraw()
@ -545,19 +576,18 @@ def Main():
## Positionnement des os
##-----------
moveArmature(armObj, lesEmpties)
moveArmature(armData, lesEmpties)
##-----------
## Enregistrement de la position de l'armature
##-----------
for bo in bones:
bo.setPose([Blender.Armature.Bone.ROT, Blender.Armature.Bone.LOC])
curvX.addBezier((Blender.Get("curframe"), (getEmpty(hipbonename).getMatrix('worldspace').translationPart()[0])*scalef))
curvY.addBezier((Blender.Get("curframe"), (getEmpty(hipbonename).getMatrix('worldspace').translationPart()[1])*scalef))
curvZ.addBezier((Blender.Get("curframe"), (getEmpty(hipbonename).getMatrix('worldspace').translationPart()[2])*scalef))
curvrX.addBezier((Blender.Get("curframe"), (getEmpty(hipbonename).getMatrix('worldspace').rotationPart().toEuler()[0])*scalef/10))
curvrY.addBezier((Blender.Get("curframe"), (getEmpty(hipbonename).getMatrix('worldspace').rotationPart().toEuler()[1])*scalef/10))
curvrZ.addBezier((Blender.Get("curframe"), (getEmpty(hipbonename).getMatrix('worldspace').rotationPart().toEuler()[2])*scalef/10))
##-----------
## Passage a la frame suivante
@ -566,12 +596,6 @@ def Main():
print num_frame
Blender.Set("curframe", num_frame)
curvX.Recalc()
curvY.Recalc()
curvZ.Recalc()
curvrX.Recalc()
curvrY.Recalc()
curvrZ.Recalc()
Blender.Set("curframe",startframe)
Blender.Redraw()
@ -603,35 +627,26 @@ def button_event(evt):
global endframe, startframe, insertionframe, hipbonename, framedecimation , scalef
if evt==1:
startframe = SFrame2.val
insertionframe = 100 #IFrame.val
insertionframe = IFrame.val
endframe = EFrame.val
hipbonename = HBName.val
framedecimation = FrameDecimation.val
scalef= 1.0 #eval(str(ScaleF.val))
scalef= eval(str(ScaleF.val))
#print "scalef = ", scalef
if startframe>=endframe:
Msg = 'Start frame must be lower than End frame'
error_txt = "Error|Start frame must be lower than End frame"
Blender.Draw.PupMenu(error_txt)
else:
ob = getEmpty(hipbonename)
if (ob!=None):
if ob.getParent()!=None:
Msg = 'Empty '+hipbonename+ ' is not a root bone.'
error_txt = "Error|Empty %s is not a root bone"%hipbonename
Blender.Draw.PupMenu(error_txt)
else:
if (0.0 > scalef):
Msg = 'Scale factor must be greater than 0'
error_txt = "Error|Scale factor must be greater than 0"
Blender.Draw.PupMenu(error_txt)
else:
#Blender.Draw.Exit()
Main()
#Main()
else:
error_txt = "Error|Empty %s not found"%hipbonename
Blender.Draw.PupMenu(error_txt)
Msg = 'Empty '+ hipbonename+ ' not found'
#Blender.Draw.Redraw(1)
@ -640,9 +655,6 @@ def button_event(evt):
ob = getEmpty(hipbonename)
if (ob!=None):
if ob.getParent()!=None:
error_txt = "Error|Empty %s is not a root bone"%hipbonename
Blender.Draw.PupMenu(error_txt)
Msg = 'Empty '+hipbonename+ ' is not a root bone.'
else:
#Blender.Draw.Exit()
@ -659,17 +671,15 @@ def GUI():
Blender.BGL.glClear(Blender.BGL.GL_COLOR_BUFFER_BIT)
Blender.BGL.glColor3f(1,1,1)
Blender.BGL.glRasterPos2i(20,200)
selobj = Blender.Object.GetSelected()
if len(selobj) == 1 and type (selobj[0]) == Blender.Types.ObjectType:
hipname = selobj[0].getName()
else:
hipname = '_Hips'
Blender.Draw.Text ("BVH 2 ARMATURE v%s by %s"%(__version__, __author__), 'normal')
HBName = Blender.Draw.String("HipBoneName: ", 0, 20, 175, 250, 20, hipname, 100)
Blender.Draw.Text ("BVH 2 ARMATURE v2.2 by Jean-Baptiste PERIN", 'normal')
HBName = Blender.Draw.String("HipBoneName: ", 0, 20, 175, 250, 20, '_Hips', 100)
SFrame2 = Blender.Draw.Number("Startframe: ", 0, 20, 150, 250, 20, 1, 1,3000,"Start frame of anim")
EFrame = Blender.Draw.Number("Endframe: ", 0, 20, 125, 250, 20, Blender.Get("endframe"), 1,3000,"Last frame of anim")
FrameDecimation = Blender.Draw.Number("FrameDecimation: ", 0, 20, 75, 250, 20,1, 1,10,'number of frame to skip between two action keys')
#IFrame = Blender.Draw.Number("Insertionframe: ", 0, 20, 100, 250, 20, Blender.Get("staframe"), 1,3000,"")
FrameDecimation = Blender.Draw.Number("FrameDecimation: ", 0, 20, 75, 250, 20,5, 1,10,'number of frame to skip between two action keys')
ScaleF = Blender.Draw.Number("Scale: ", 0, 20, 50, 250, 20, 1.0, 0.0, 10.0, 'Scale Factor')
Blender.Draw.Toggle("Create Armature", 1, 20, 10, 100, 20, 0, "Create Armature")
#Blender.Draw.Toggle("Remove Empties", 2, 200, 10, 100, 20, 0, "Remove Empties")
Blender.BGL.glRasterPos2i(20,40)
Blender.Draw.Text (Msg, 'normal')

@ -9,7 +9,7 @@ Tip: 'Export a (.bvh) motion capture file'
__author__ = "Campbell Barton"
__url__ = ("blender", "elysiun")
__version__ = "1.1 12/16/05"
__version__ = "1.0 03/30/04"
__bpydoc__ = """\
This script exports animation data to BVH motion capture file format.
@ -30,11 +30,12 @@ Notes:<br>
# BVH Export script 1.0 by Campbell Barton #
# Copyright MetaVR 30/03/2004, #
# if you have any questions about this script #
# email me cbarton@metavr.com #
# email me ideasman@linuxmail.org #
# #
#===============================================#
# --------------------------------------------------------------------------
# BVH Export v1.1 by Campbell Barton (AKA Ideasman)
# BVH Export v0.9 by Campbell Barton (AKA Ideasman)
# --------------------------------------------------------------------------
# ***** BEGIN GPL LICENSE BLOCK *****
#
@ -58,22 +59,21 @@ Notes:<br>
import Blender
from Blender import Scene, Object
import math
time = Blender.sys.time
from math import *
# Get the current scene.
scn = Scene.GetCurrent()
context = scn.getRenderingContext()
frameRate = 1.0/context.framesPerSec() # 0.04 = 25fps
scale = 1.0
frameRate = 0.3333 # 0.04 = 25fps
scale = 1
indent = '\t' # 2 space indent per object
indent = ' ' # 2 space indent per object
prefixDelimiter = '_'
# Vars used in eular rotation funtcion
RAD_TO_DEG = 180.0/3.14159265359
DEG_TO_RAD = math.pi/180.0
#====================================================#
@ -82,8 +82,8 @@ DEG_TO_RAD = math.pi/180.0
def getChildren(parent):
children = [] # We'll assume none.
for child in Object.Get():
if child.parent == parent:
children.append( child )
if child.getParent() == Object.Get(parent):
children.append( child.getName() )
return children
#====================================================#
@ -91,10 +91,10 @@ def getChildren(parent):
# hierarchy as a list and then eval it #
#====================================================#
def getHierarchy(root, hierarchy):
hierarchy = '%s["%s",' % (hierarchy, root.name)
hierarchy = hierarchy + '["' + root + '",'
for child in getChildren(root):
hierarchy = getHierarchy(child, hierarchy)
hierarchy = '%s],' % hierarchy
hierarchy += '],'
return hierarchy
@ -105,10 +105,26 @@ def stripName(name): # name is a string
# WARNING!!! Special case for a custom RIG for output
# for MetaVR's HPX compatable RIG.
# print 'stripname', name[0:10]
if name.lower().startswith('transform('):
name = name[10:].split(prefixDelimiter)[0]
return name.split('_')[0]
print 'stripname', name[0:10]
if name[0:10] == 'Transform(':
name = name[10:]
while name[-1] != ')':
name = name[0:-1]
print name
name = name[:-1]
return name[1+name.find(prefixDelimiter): ]
#====================================================#
# Return a 6 deciaml point floating point value #
# as a string that dosent have any python chars #
#====================================================#
def saneFloat(float):
#return '%(float)b' % vars() # 6 fp as house.hqx
return str('%f' % float) + ' '
#====================================================#
@ -116,84 +132,86 @@ def stripName(name): # name is a string
# node from blender and returns it for formatting #
# and writing to a file. #
#====================================================#
def getNodeData(nodeOb):
ob = nodeOb
obipo = ob.getIpo()
def getNodeData(nodeName):
Object.Get(nodeName)
# Get real location
offset = [o*scale for o in ob.getLocation()]
offset = Object.Get(nodeName).getLocation()
offset = (offset[0]*scale, offset[1]*scale, offset[2]*scale,)
#=========================#
# Test for X/Y/Z IPO's #
#=========================#
obipo = Object.Get(nodeName).getIpo()
# IF we dont have an IPO then dont check the curves.
# This was added to catch end nodes that never have an IPO, only an offset.
if obipo == None:
xloc=yloc=zloc=xrot=yrot=zrot = 0
# DUMMY channels xloc, yloc, zloc, xrot, yrot, zrot
# [<bool>, <bool>, <bool>, <bool>, <bool>, <bool>]
channels = [0,0,0,0,0,0] # xloc,yloc,zloc,xrot,yrot,zrot
if obipo != None: # Do have an IPO, checkout which curves are in use.
# Assume the rot's/loc's dont exist until they proven they do.
if obipo.getCurve('LocX') != None:
channels[0] = 1
if obipo.getCurve('LocY') != None:
channels[1] = 1
if obipo.getCurve('LocZ') != None:
channels[2] = 1
else: # Do have an IPO, checkout which curves are in use.
# Assume the rot's/loc's exist until proven they dont
xloc=yloc=zloc=xrot=yrot=zrot = 1
if obipo.getCurve('LocX') == None:
xloc = 0
if obipo.getCurve('LocY') == None:
yloc = 0
if obipo.getCurve('LocZ') == None:
zloc = 0
# Now for the rotations, Because of the conversion of rotation coords
# if there is one rotation er need to store all 3
if obipo.getCurve('RotX') != None or \
obipo.getCurve('RotY') != None or \
obipo.getCurve('RotZ') != None:
channels[3] = channels[4] = channels[5] = 1
#print ob, channels
if obipo.getCurve('RotX') == None and \
obipo.getCurve('RotY') == None and \
obipo.getCurve('RotZ') == None:
xrot=yrot=zrot = 0
# DUMMY channels xloc, yloc, zloc, xrot, yrot, zrot
# [<bool>, <bool>, <bool>, <bool>, <bool>, <bool>]
channels = [xloc, yloc, zloc, xrot, yrot, zrot]
return offset, channels
#====================================================#
# Writes the BVH hierarchy to a file #
# Return the BVH hierarchy to a file from a list #
# hierarchy: is a list of the empty hierarcht #
# bvhHierarchy: a string, in the bvh format to write #
# level: how many levels we are down the tree, #
# ...used for indenting #
# Also gathers channelList , so we know the order to #
# write the motiondata in #
#====================================================#
def hierarchy2bvh(file, hierarchy, level, channelList, nodeObjectList):
def hierarchy2bvh(hierarchy, bvhHierarchy, level, channelList, nodeObjectList):
nodeName = hierarchy[0]
ob = Object.Get(nodeName)
'''
obipo = ob.getIpo()
if obipo != None:
obcurves = obipo.getCurves()
else:
obcurves = None
'''
# Add object to nodeObjectList
nodeObjectList.append(Object.Get(nodeName))
#============#
# JOINT NAME #
#============#
file.write(level * indent)
bvhHierarchy += level * indent
if level == 0:
# Add object to nodeObjectList
#nodeObjectList.append( (ob, obipo, obcurves) )
nodeObjectList.append( ob )
file.write( 'ROOT %s\n' % stripName(nodeName) )
nodeObjectList.append(Object.Get(nodeName))
bvhHierarchy+= 'ROOT '
bvhHierarchy += stripName(nodeName) + '\n'
# If this is the last object in the list then we
# dont bother withwriting its real name, use "End Site" instead
elif len(hierarchy) == 1:
file.write( 'End Site\n' )
bvhHierarchy+= 'End Site\n'
# Ok This is a normal joint
else:
# Add object to nodeObjectList
#nodeObjectList.append((ob, obipo, obcurves))
nodeObjectList.append( ob )
file.write( 'JOINT %s\n' % stripName(nodeName) )
nodeObjectList.append(Object.Get(nodeName))
bvhHierarchy+= 'JOINT '
bvhHierarchy += stripName(nodeName) + '\n'
#================#
# END JOINT NAME #
#================#
# Indent again, this line is just for the brackets
file.write( '%s{\n' % (level * indent) )
bvhHierarchy += level * indent + '{' + '\n'
# Indent
level += 1
@ -201,54 +219,59 @@ def hierarchy2bvh(file, hierarchy, level, channelList, nodeObjectList):
#================================================#
# Data for writing to a file offset and channels #
#================================================#
offset, channels = getNodeData(ob)
offset, channels = getNodeData(nodeName)
#============#
# Offset #
#============#
file.write( '%sOFFSET %.6f %.6f %.6f\n' %\
(level*indent, scale*offset[0], scale*offset[1], scale*offset[2]) )
bvhHierarchy += level * indent + 'OFFSET ' + saneFloat(scale * offset[0]) + ' ' + saneFloat(scale * offset[1]) + ' ' + saneFloat(scale * offset[2]) + '\n'
#============#
# Channels #
#============#
if len(hierarchy) != 1:
# Channels, remember who is where so when we write motiondata
file.write('%sCHANNELS %i ' % (level*indent, len([c for c in channels if c ==1]) ))
bvhHierarchy += level * indent + 'CHANNELS '
# Count the channels
chCount = 0
for chn in channels:
chCount += chn
bvhHierarchy += str(chCount) + ' '
if channels[0]:
file.write('Xposition ')
bvhHierarchy += 'Xposition '
channelList.append([len(nodeObjectList)-1, 0])
if channels[1]:
file.write('Yposition ')
bvhHierarchy += 'Yposition '
channelList.append([len(nodeObjectList)-1, 1])
if channels[2]:
file.write('Zposition ')
bvhHierarchy += 'Zposition '
channelList.append([len(nodeObjectList)-1, 2])
if channels[5]:
file.write('Zrotation ')
bvhHierarchy += 'Zrotation '
channelList.append([len(nodeObjectList)-1, 5])
if channels[3]:
file.write('Xrotation ')
bvhHierarchy += 'Xrotation '
channelList.append([len(nodeObjectList)-1, 3])
if channels[4]:
file.write('Yrotation ')
bvhHierarchy += 'Yrotation '
channelList.append([len(nodeObjectList)-1, 4])
file.write('\n')
bvhHierarchy += '\n'
# Loop through children if any and run this function (recursively)
for hierarchyIdx in range(len(hierarchy)-1):
level = hierarchy2bvh(file, hierarchy[hierarchyIdx+1], level, channelList, nodeObjectList)
bvhHierarchy, level, channelList, nodeObjectList = hierarchy2bvh(hierarchy[hierarchyIdx+1], bvhHierarchy, level, channelList, nodeObjectList)
# Unindent
level -= 1
file.write('%s}\n' % (level * indent))
bvhHierarchy += level * indent + '}' + '\n'
return level
return bvhHierarchy, level, channelList, nodeObjectList
# added by Ben Batt 30/3/2004 to make the exported rotations correct
def ZYXToZXY(x, y, z):
'''
Converts a set of Euler rotations (x, y, z) (which are intended to be
applied in z, y, x order, into a set which are intended to be applied in
applied in z, y, x order) into a set which are intended to be applied in
z, x, y order (the order expected by .bvh files)
'''
A,B = cos(x),sin(x)
@ -260,39 +283,36 @@ def ZYXToZXY(x, y, z):
z = atan2(-B*D*E + A*F, B*D*F + A*E)
# this seems to be necessary - not sure why (right/left-handed coordinates?)
# x = -x # x is negative, see below.
return -x*RAD_TO_DEG, y*RAD_TO_DEG, z*RAD_TO_DEG
x = -x
return x*RAD_TO_DEG, y*RAD_TO_DEG, z*RAD_TO_DEG
''' # UNUSED, JUST GET OBJECT LOC/ROT
def getIpoLocation(object, obipo, curves, frame):
x = y = z = rx = ry = rz =0
if obipo:
for i in range(obipo.getNcurves()):
if curves[i].getName() =='LocX':
x = obipo.EvaluateCurveOn(i,frame)
elif curves[i].getName() =='LocY':
y = obipo.EvaluateCurveOn(i,frame)
elif curves[i].getName() =='LocZ':
z = obipo.EvaluateCurveOn(i,frame)
elif curves[i].getName() =='RotX':
rx = obipo.EvaluateCurveOn(i,frame)
elif curves[i].getName() =='RotY':
ry = obipo.EvaluateCurveOn(i,frame)
elif curves[i].getName() =='RotZ':
rz = obipo.EvaluateCurveOn(i,frame)
return x, y, z, rx*10*DEG_TO_RAD, ry*10*DEG_TO_RAD, rz*10*DEG_TO_RAD
'''
def getIpoLocation(object, frame):
x = y = z = 0
obipo = object.getIpo()
for i in range(object.getIpo().getNcurves()):
if obipo.getCurves()[i].getName() =='LocX':
x = object.getIpo().EvaluateCurveOn(i,frame)
elif obipo.getCurves()[i].getName() =='LocY':
y = object.getIpo().EvaluateCurveOn(i,frame)
elif obipo.getCurves()[i].getName() =='LocZ':
z = object.getIpo().EvaluateCurveOn(i,frame)
return x, y, z
#====================================================#
# Return the BVH motion for the spesified frame #
# hierarchy: is a list of the empty hierarcht #
# bvhHierarchy: a string, in the bvh format to write #
# level: how many levels we are down the tree, #
# ...used for indenting #
#====================================================#
def motion2bvh(file, frame, chennelList, nodeObjectList):
def motion2bvh(frame, chennelList, nodeObjectList):
motionData = '' # We'll append the frames to the string.
for chIdx in chennelList:
#ob, obipo, obcurves = nodeObjectList[chIdx[0]]
ob = nodeObjectList[chIdx[0]]
chType = chIdx[1]
@ -302,38 +322,36 @@ def motion2bvh(file, frame, chennelList, nodeObjectList):
# Convert the rotation from ZYX order to ZXY order
x, y, z = ZYXToZXY(x, y, z)
# Location
xloc, yloc, zloc = ob.matrixLocal[3][:3]
# Using regular Locations stuffs upIPO locations stuffs up
# Get IPO locations instead
#xloc, yloc, zloc, x, y, z = getIpoLocation(ob, obipo, obcurves, frame)
# Convert the rotation from ZYX order to ZXY order
#x, y, z = ZYXToZXY(x, y, z)
xloc, yloc, zloc = getIpoLocation(ob, frame)
# WARNING non standard Location
# xloc, zloc, yloc = -xloc, yloc, zloc
xloc, zloc, yloc = -xloc, yloc, zloc
if chType == 0:
file.write('%.6f ' % (scale * xloc))
motionData += saneFloat(scale * (xloc))
if chType == 1:
file.write('%.6f ' % (scale * yloc))
motionData += saneFloat(scale * (yloc))
if chType == 2:
file.write('%.6f ' % (scale * zloc))
motionData += saneFloat(scale * (zloc))
if chType == 3:
file.write('%.6f ' % x)
motionData += saneFloat(x)
if chType == 4:
file.write('%.6f ' % y)
motionData += saneFloat(y)
if chType == 5:
file.write('%.6f ' % z)
file.write('\n')
motionData += saneFloat(z)
motionData += ' '
motionData += '\n'
return motionData
def saveBVH(filename):
t = time()
if not filename.lower().endswith('.bvh'):
filename += '.bvh' # for safety
if filename.find('.bvh', -4) <= 0: filename += '.bvh' # for safety
# Here we store a serialized list of blender objects as they appier
# in the hierarchy, this is refred to when writing motiondata
@ -345,19 +363,21 @@ def saveBVH(filename):
# 2) The type if channel x/y/z rot:x/y/z - Use 0-5 to indicate this
chennelList = []
print '\nBVH 1.1 by Campbell Barton (Ideasman) - cbarton@metavr.com'
print ''
print 'BVH 1.0 by Campbell Barton (Ideasman) - ideasman@linuxmail.org'
# Get the active object and recursively traverse its kids to build
# the BVH hierarchy, then eval the string to make a hierarchy list.
hierarchy = eval(getHierarchy(scn.getActiveObject(),''))[0] # somhow this returns a tuple with one list in it.
hierarchy = eval(getHierarchy(Object.GetSelected()[0].getName(),''))[0] # somhow this returns a tuple with one list in it.
# Put all data in the file we have selected file.
file = open(filename, "w")
file.write('HIERARCHY\n') # all bvh files have this on the first line
# Write the whole hirarchy to a list
level = 0 # Indenting level, start with no indent
level = hierarchy2bvh(file, hierarchy, level, chennelList, nodeObjectList)
bvhHierarchy, level, chennelList, nodeObjectList = hierarchy2bvh(hierarchy, '', 0, chennelList, nodeObjectList)
file.write( bvhHierarchy ) # Rwite the var fileBlock to the output.
bvhHierarchy = None # Save a tit bit of memory
#====================================================#
# MOTION: Loop through the frames ande write out #
@ -365,21 +385,22 @@ def saveBVH(filename):
#====================================================#
# Do some basic motion file header stuff
file.write('MOTION\n')
file.write( 'Frames: %i\n' % ( 1 + context.endFrame() - context.startFrame() ) )
file.write( 'Frame Time: %.6f\n' % frameRate )
file.write( 'Frames: ' + str(1 + context.endFrame() - context.startFrame()) + '\n' )
file.write( 'Frame Time: ' + saneFloat(frameRate) + '\n' )
frames = range(context.startFrame()+1, context.endFrame()+1)
print 'exporting %i of motion...' % len(frames)
#print 'WARNING- exact frames might be stuffed up- inclusive whatever, do some tests later on.'
frames = range(context.startFrame(), context.endFrame()+1)
print 'exporting ' + str(len(frames)) + ' of motion...'
for frame in frames:
context.currentFrame(frame)
scn.update(1) # Update locations so we can write the new locations. This is the SLOW part.
# Blender.Window.RedrawAll() # Debugging.
scn.update(1) # Update locations so we can write the new locations
#Blender.Window.RedrawAll() # causes crash
motion2bvh(file, frame, chennelList, nodeObjectList) # Write the motion to a file.
file.write( motion2bvh(frame, chennelList, nodeObjectList) )
file.write('\n') # newline
file.close()
print '...Done in %.4f seconds.' % (time()-t)
print 'done'
Blender.Window.FileSelector(saveBVH, 'Export BVH')

@ -2,14 +2,14 @@
"""
Name: 'Motion Capture (.bvh)...'
Blender: 239
Blender: 236
Group: 'Import'
Tip: 'Import a (.bvh) motion capture file'
"""
__author__ = "Campbell Barton"
__url__ = ("blender", "elysiun")
__version__ = "1.0.4 05/12/04"
__url__ = ("blender", "elysiun", "http://jmsoler.free.fr/util/blenderfile/py/bvh_import.py")
__version__ = "1.0.2 04/12/28"
__bpydoc__ = """\
This script imports BVH motion capture data to Blender.
@ -29,26 +29,6 @@ Empties created by this importer, it's in the Scripts window -> Scripts -> Anima
# $Id$
#
#===============================================#
# BVH Import script 1.05 patched by Campbell #
# Modified to use Mathutils for matrix math, #
# Fixed possible joint naming bug, #
# Imports BVH's with bad EOF gracefully #
# Fixed duplicate joint names, make them unique #
# Use \r as well as \n for newlines #
# Added suppot for nodes with 0 motion channels #
# Rotation IPOs never cross more then 180d #
# fixes sub frame tweening and time scaling #
# 5x overall speedup. #
# 06/12/2005, #
#===============================================#
#===============================================#
# BVH Import script 1.04 patched by jms #
# Small modif for blender 2.40 #
# 04/12/2005, #
#===============================================#
#===============================================#
# BVH Import script 1.03 patched by Campbell #
# Small optimizations and scale input #
@ -65,8 +45,8 @@ Empties created by this importer, it's in the Scripts window -> Scripts -> Anima
# BVH Import script 1.0 by Campbell Barton #
# 25/03/2004, euler rotation code taken from #
# Reevan Mckay's BVH import script v1.1 #
# if you have any questions about this scrip. #
# email me cbarton@metavr.com #
# if you have any questions about this script #
# email me ideasman@linuxmail.org #
#===============================================#
#===============================================#
@ -77,7 +57,7 @@ Empties created by this importer, it's in the Scripts window -> Scripts -> Anima
#===============================================#
# --------------------------------------------------------------------------
# BVH Import v1.05 by Campbell Barton (AKA Ideasman)
# BVH Import v0.9 by Campbell Barton (AKA Ideasman)
# --------------------------------------------------------------------------
# ***** BEGIN GPL LICENSE BLOCK *****
#
@ -98,43 +78,33 @@ Empties created by this importer, it's in the Scripts window -> Scripts -> Anima
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
import string
import math
import Blender
from Blender import Window, Object, Scene, Ipo, Draw
from Blender.Scene import Render
# Attempt to load psyco, speed things up
try:
import psyco
psyco.full()
print 'using psyco to speed up BVH importing'
except:
# # PSYCO IS CRASHING ON MY SYSTEM
# # Attempt to load psyco, speed things up
# try:
# print 'using psyco to speed up BVH importing'
# import psyco
# psyco.full()
#
# except:
# print 'psyco is not present on this system'
pass
def main():
global scale
scale = None
# Default scale
scale = 0.01
# Update as we load?
debug = 0
def getScale():
return Draw.PupFloatInput('BVH Scale: ', 0.01, 0.001, 10.0, 0.1, 3)
#===============================================#
# MAIN FUNCTION - All things are done from here #
#===============================================#
def loadBVH(filename):
global scale
print '\nBVH Importer 1.05 by Campbell Barton (Ideasman) - cbarton@metavr.com'
objectCurveMapping = {}
objectNameMapping = {}
objectMotiondataMapping = {}
# Get the current scene.
scn = Scene.GetCurrent()
context = scn.getRenderingContext()
# Here we store the Ipo curves in the order they load.
channelCurves = []
@ -144,71 +114,155 @@ def main():
# Chenging there rotation to EULER rotation
objectList = []
if scale == None:
tempscale = getScale()
if tempscale:
scale = tempscale
else:
scale = 0.01
def getScale():
return Draw.PupFloatInput('BVH Scale: ', 0.01, 0.001, 10.0, 0.1, 3)
Window.WaitCursor(1)
# Unique names, dont reuse any of these names.
uniqueObNames = [ob.name for ob in Object.Get()]
def MAT(m):
if len(m) == 3:
return Blender.Mathutils.Matrix(m[0], m[1], m[2])
elif len(m) == 4:
return Blender.Mathutils.Matrix(m[0], m[1], m[2], m[3])
# FUNCTIONS ====================================#
def getUniqueObName(name):
i = 0
newname = name[:min(len(name), 12)] # Concatinate to 12 chars
while newname in uniqueObNames:
newname = name + str(i)
i+=1
return newname
# Change the order rotation is applied.
RotationMatrix = Blender.Mathutils.RotationMatrix
MATRIX_IDENTITY_3x3 = Blender.Mathutils.Matrix([1.0,0.0,0.0],[0.0,1.0,0.0],[0.0,0.0,1.0])
#===============================================#
# eulerRotation: converts X, Y, Z rotation #
# to eular Rotation. This entire function #
# is copied from Reevan Mckay's BVH script #
#===============================================#
# Vars used in eular rotation funtcion
DEG_TO_RAD = math.pi/180.0
RAD_TO_DEG = 180.0/math.pi
PI=3.14159
def eulerRotate(x,y,z):
x,y,z = x%360,y%360,z%360 # Clamp all values between 0 and 360, values outside this raise an error.
xmat = RotationMatrix(x,3,'x')
ymat = RotationMatrix(y,3,'y')
zmat = RotationMatrix(z,3,'z')
# Standard BVH multiplication order, apply the rotation in the order Z,X,Y
return (ymat*(xmat * (zmat * MATRIX_IDENTITY_3x3))).toEuler()
#=================================
def RVMatMult3 (mat1,mat2):
#=================================
mat3=[[0.0,0.0,0.0],[0.0,0.0,0.0],[0.0,0.0,0.0]]
for i in range(3):
for k in range(3):
for j in range(3):
mat3[i][k]=mat3[i][k]+mat1[i][j]*mat2[j][k]
return mat3
#=================================
def RVAxisAngleToMat3 (rot4):
# Takes a direction vector and
# a rotation (in rads) and
# returns the rotation matrix.
# Graphics Gems I p. 466:
#=================================
mat3=[[0.0,0.0,0.0],[0.0,0.0,0.0],[0.0,0.0,0.0]]
if math.fabs(rot4[3])>0.01:
s=math.sin(rot4[3])
c=math.cos(rot4[3])
t=1.0-math.cos(rot4[3])
else:
s=rot4[3]
c=1.0
t=0.0
x=rot4[0]; y=rot4[1]; z=rot4[2]
mat3[0][0]=t*x*x+c
mat3[0][1]=t*x*y+s*z
mat3[0][2]=t*x*z-s*y
mat3[1][0]=t*x*y-s*z
mat3[1][1]=t*y*y+c
mat3[1][2]=t*y*z+s*x
mat3[2][0]=t*x*z+s*y
mat3[2][1]=t*y*z-s*x
mat3[2][2]=t*z*z+c
return mat3
eul = [x,y,z]
for jj in range(3):
while eul[jj] < 0:
eul[jj] = eul[jj] + 360.0
while eul[jj] >= 360.0:
eul[jj] = eul[jj] - 360.0
eul[0] = eul[0]*DEG_TO_RAD
eul[1] = eul[1]*DEG_TO_RAD
eul[2] = eul[2]*DEG_TO_RAD
xmat=RVAxisAngleToMat3([1,0,0,eul[0]])
ymat=RVAxisAngleToMat3([0,1,0,eul[1]])
zmat=RVAxisAngleToMat3([0,0,1,eul[2]])
mat=[[1.0,0.0,0.0],[0.0,1.0,0.0],[0.0,0.0,1.0]]
# Standard BVH multiplication order
mat=RVMatMult3 (zmat,mat)
mat=RVMatMult3 (xmat,mat)
mat=RVMatMult3 (ymat,mat)
'''
# Screwy Animation Master BVH multiplcation order
mat=RVMatMult3 (ymat,mat)
mat=RVMatMult3 (xmat,mat)
mat=RVMatMult3 (zmat,mat)
'''
mat = MAT(mat)
eul = mat.toEuler()
x =- eul[0]/-10
y =- eul[1]/-10
z =- eul[2]/-10
return x, y, z # Returm euler roration values.
currentFrame = 1 # Set the initial frame to import all data to.
#===============================================#
# makeJoint: Here we use the node data #
# from the BVA file to create an empty #
#===============================================#
BVH2BLEND_TX_NAME = {'Xposition':'LocX','Yposition':'LocY','Zposition':'LocZ','Xrotation':'RotX','Yrotation':'RotY','Zrotation':'RotZ'}
def makeJoint(name, parent, offset, channels):
ob = Object.New('Empty', name) # New object, ob is shorter and nicer to use.
objectNameMapping[name] = ob
def makeJoint(name, parent, prefix, offset, channels):
global scale
# Make Empty, with the prefix in front of the name
ob = Object.New('Empty', prefix + name) # New object, ob is shorter and nicer to use.
scn.link(ob) # place the object in the current scene
ob.sel = 1
# Offset Empty
ob.setLocation(offset[0]*scale, offset[1]*scale, offset[2]*scale)
# Make me a child of another empty.
# Vale of None will make the empty a root node (no parent)
if parent[-1]: # != None
obParent = objectNameMapping[parent[-1]] # We use this a bit so refrence it here.
obParent.makeParent([ob], 1, 0) #ojbs, noninverse, 1 = not fast.
# Offset Empty from BVH's initial joint location.
ob.setLocation(offset[0]*scale, offset[1]*scale, offset[2]*scale)
if parent[-1] != None:
obParent = Object.Get(prefix + parent[-1]) # We use this a bit so refrence it here.
obParent.makeParent([ob], 0, 1) #ojbs, noninverse, 1 = not fast.
# Add Ipo's for necessary channels
newIpo = Ipo.New('Object', name)
newIpo = Ipo.New('Object', prefix + name)
ob.setIpo(newIpo)
obname = ob.name
for channelType in channels:
channelType = BVH2BLEND_TX_NAME[channelType]
curve = newIpo.addCurve(channelType)
curve.setInterpolation('Linear')
objectCurveMapping[(obname, channelType)] = curve
if channelType == 'Xposition':
newIpo.addCurve('LocX')
newIpo.getCurve('LocX').setInterpolation('Linear')
if channelType == 'Yposition':
newIpo.addCurve('LocY')
newIpo.getCurve('LocY').setInterpolation('Linear')
if channelType == 'Zposition':
newIpo.addCurve('LocZ')
newIpo.getCurve('LocZ').setInterpolation('Linear')
if channelType == 'Zrotation':
newIpo.addCurve('RotZ')
newIpo.getCurve('RotZ').setInterpolation('Linear')
if channelType == 'Yrotation':
newIpo.addCurve('RotY')
newIpo.getCurve('RotY').setInterpolation('Linear')
if channelType == 'Xrotation':
newIpo.addCurve('RotX')
newIpo.getCurve('RotX').setInterpolation('Linear')
# Add to object list
objectList.append(ob)
@ -221,52 +275,66 @@ def main():
# makeEnd: Here we make an end node #
# This is needed when adding the last bone #
#===============================================#
def makeEnd(parent, offset):
new_name = parent[-1] + '_end'
ob = Object.New('Empty', new_name) # New object, ob is shorter and nicer to use.
objectNameMapping[new_name] = ob
def makeEnd(parent, prefix, offset):
# Make Empty, with the prefix in front of the name, end nodes have no name so call it its parents name+'_end'
ob = Object.New('Empty', prefix + parent[-1] + '_end') # New object, ob is shorter and nicer to use.
scn.link(ob)
ob.sel = 1
# Dont check for a parent, an end node MUST have a parent
obParent = objectNameMapping[parent[-1]] # We use this a bit so refrence it here.
obParent.makeParent([ob], 1, 0) #ojbs, noninverse, 1 = not fast.
obParent = Object.Get(prefix + parent[-1]) # We use this a bit so refrence it here.
obParent.makeParent([ob], 0, 1) #ojbs, noninverse, 1 = not fast.
# Offset Empty
ob.setLocation(offset[0]*scale, offset[1]*scale, offset[2]*scale)
# Redraw if debugging
if debug: Blender.Redraw()
# END FUNCTION DEFINITIONS ====================================#
#===============================================#
# MAIN FUNCTION - All things are done from here #
#===============================================#
def loadBVH(filename):
global scale
print ''
print 'BVH Importer 1.0 by Campbell Barton (Ideasman) - ideasman@linuxmail.org'
alpha='abcdefghijklmnopqrstuvewxyz'
ALPHA=alpha+alpha.upper()
ALPHA+=' 0123456789+-{}. '
time1 = Blender.sys.time()
# Get the current scene.
scn = Scene.GetCurrent()
#context = scn.getRenderingContext()
# DeSelect All
for ob in scn.getChildren():
ob.sel = 0
tmpScale = getScale()
if tmpScale != None:
scale = tmpScale
# File loading stuff
# Open the file for importing
file = open(filename, 'r')
fileData = file.readlines()
# Make a list of lines
lines = []
for fileLine in fileData:
fileLine=fileLine.replace('..','.')
newLine = string.split(fileLine)
if newLine != []:
t=[]
for n in newLine:
for n0 in n:
if n0 not in ALPHA:
n=n.replace(n0,'')
t.append(n)
lines.append(t)
# Seperate into a list of lists, each line a list of words.
lines = file.readlines()
# Non standard carrage returns?
if len(lines) == 1:
lines = lines[0].split('\r')
# Split by whitespace.
lines =[ll for ll in [ [w for w in l.split() if w != '\n' ] for l in lines] if ll]
del fileData
# End file loading code
# Call object names with this prefix, mainly for scenes with multiple BVH's - Can imagine most partr names are the same
# So in future
#prefix = str(len(lines)) + '_'
prefix = '_'
# Create Hirachy as empties
if lines[0][0] == 'HIERARCHY':
@ -279,35 +347,33 @@ def main():
# ZERO is a place holder that means we are a root node. (no parents)
parent = [None]
#channelList, sync with objectList: [[channelType1, channelType2...], [channelType1, channelType2...)]
#channelList [(<objectName>, [channelType1, channelType2...]), (<objectName>, [channelType1, channelType2...)]
channelList = []
channelIndex = -1
lineIdx = 0 # An index for the file.
lineIdx = 1 # An index for the file.
while lineIdx < len(lines) -1:
#...
if lines[lineIdx][0] == 'ROOT' or lines[lineIdx][0] == 'JOINT':
# Join spaces into 1 word with underscores joining it.
if len(lines[lineIdx]) > 2:
lines[lineIdx][1] = '_'.join(lines[lineIdx][1:])
lines[lineIdx] = lines[lineIdx][:2]
if lines[lineIdx][0] == 'JOINT' and len(lines[lineIdx])>2:
for j in range(2,len(lines[lineIdx])) :
lines[lineIdx][1]+='_'+lines[lineIdx][j]
# MAY NEED TO SUPPORT MULTIPLE ROOT's HERE!!!, Still unsure weather multiple roots are possible.??
# Make sure the names are unique- Object names will match joint names exactly and both will be unique.
name = getUniqueObName(lines[lineIdx][1])
uniqueObNames.append(name)
print '%snode: %s, parent: %s' % (len(parent) * ' ', name, parent[-1])
print len(parent) * ' ' + 'node:',lines[lineIdx][1],' parent:',parent[-1]
print lineIdx
name = lines[lineIdx][1]
print name,lines[lineIdx+1],lines[lineIdx+2]
lineIdx += 2 # Incriment to the next line (Offset)
offset = ( float(lines[lineIdx][1]), float(lines[lineIdx][2]), float(lines[lineIdx][3]) )
lineIdx += 1 # Incriment to the next line (Channels)
# newChannel[Xposition, Yposition, Zposition, Xrotation, Yrotation, Zrotation]
# newChannel references indecies to the motiondata,
# if not assigned then -1 refers to the last value that will be added on loading at a value of zero, this is appended
# newChannel has Indecies to the motiondata,
# -1 refers to the last value that will be added on loading at a value of zero
# We'll add a zero value onto the end of the MotionDATA so this is always refers to a value.
newChannel = [-1, -1, -1, -1, -1, -1]
for channel in lines[lineIdx][2:]:
@ -330,70 +396,64 @@ def main():
channels = lines[lineIdx][2:]
# Call funtion that uses the gatrhered data to make an empty.
makeJoint(name, parent, offset, channels)
makeJoint(name, parent, prefix, offset, channels)
# If we have another child then we can call ourselves a parent, else
parent.append(name)
# Account for an end node
if lines[lineIdx][0] == 'End' and lines[lineIdx][1] == 'Site': # There is somtimes a name after 'End Site' but we will ignore it.
if lines[lineIdx][0] == 'End' and lines[lineIdx][1] == 'Site': # There is somtimes a name afetr 'End Site' but we will ignore it.
lineIdx += 2 # Incriment to the next line (Offset)
offset = ( float(lines[lineIdx][1]), float(lines[lineIdx][2]), float(lines[lineIdx][3]) )
makeEnd(parent, offset)
makeEnd(parent, prefix, offset)
# Just so we can remove the Parents in a uniform way- End end never has kids
# so this is a placeholder
parent.append(None)
if len(lines[lineIdx]) == 1 and lines[lineIdx][0] == '}': # == ['}']
parent.pop() # Remove the last item
if lines[lineIdx] == ['}']:
parent = parent[:-1] # Remove the last item
#=============================================#
# BVH Structure loaded, Now import motion #
#=============================================#
if len(lines[lineIdx]) == 1 and lines[lineIdx][0] == 'MOTION':
if lines[lineIdx] == ['MOTION']:
print '\nImporting motion data'
lineIdx += 3 # Set the cursor to the first frame
lineIdx += 3 # Set the cursor to the forst frame
#=============================================#
# Loop through frames, each line a frame #
#=============================================#
currentFrame = 1
print 'frames: ',
#=============================================#
# Add a ZERO keyframe, this keeps the rig #
# so when we export we know where all the #
# joints start from #
#=============================================#
for obIdx, ob in enumerate(objectList):
obname = ob.name
obIdx = 0
while obIdx < len(objectList) -1:
if channelList[obIdx][0] != -1:
objectCurveMapping[obname, 'LocX'].addBezier((currentFrame,0))
objectMotiondataMapping[obname, 'LocX'] = []
objectList[obIdx].getIpo().getCurve('LocX').addBezier((currentFrame,0))
if channelList[obIdx][1] != -1:
objectCurveMapping[obname, 'LocY'].addBezier((currentFrame,0))
objectMotiondataMapping[obname, 'LocY'] = []
objectList[obIdx].getIpo().getCurve('LocY').addBezier((currentFrame,0))
if channelList[obIdx][2] != -1:
objectCurveMapping[obname, 'LocZ'].addBezier((currentFrame,0))
objectMotiondataMapping[obname, 'LocZ'] = []
if\
channelList[obIdx][3] != -1 or\
channelList[obIdx][4] != -1 or\
channelList[obIdx][5] != -1:
objectMotiondataMapping[obname, 'RotX'] = []
objectMotiondataMapping[obname, 'RotY'] = []
objectMotiondataMapping[obname, 'RotZ'] = []
objectList[obIdx].getIpo().getCurve('LocZ').addBezier((currentFrame,0))
if channelList[obIdx][3] != '-1' or channelList[obIdx][4] != '-1' or channelList[obIdx][5] != '-1':
objectList[obIdx].getIpo().getCurve('RotX').addBezier((currentFrame,0))
objectList[obIdx].getIpo().getCurve('RotY').addBezier((currentFrame,0))
objectList[obIdx].getIpo().getCurve('RotZ').addBezier((currentFrame,0))
obIdx += 1
#=============================================#
# Loop through frames, each line a frame #
#=============================================#
MOTION_DATA_LINE_LEN = len(lines[lineIdx])
while lineIdx < len(lines):
line = lines[lineIdx]
if MOTION_DATA_LINE_LEN != len(line):
print 'ERROR: Incomplete motion data on line %i, finishing import.' % lineIdx
break
# Exit loop if we are past the motiondata.
# Some BVH's have extra tags like 'CONSTRAINTS and MOTIONTAGS'
# I dont know what they do and I dont care, they'll be ignored here.
if len(line) < len(objectList):
if len(lines[lineIdx]) < len(objectList):
print '...ending on unknown tags'
break
@ -403,95 +463,62 @@ def main():
#=============================================#
# Import motion data and assign it to an IPO #
#=============================================#
line.append(0.0) # Use this as a dummy var for objects that dont have a loc/rotate channel.
lines[lineIdx].append('0') # Use this as a dummy var for objects that dont have a rotate channel.
obIdx = 0
if debug: Blender.Redraw()
for obIdx, ob in enumerate(objectList):
obname = ob.name
obChannel = channelList[obIdx]
while obIdx < len(objectList) -1:
if channelList[obIdx][0] != -1:
objectMotiondataMapping[obname, 'LocX'].append((currentFrame, scale * float( line[obChannel[0]] )))
VAL0=lines[lineIdx][channelList[obIdx][0]]
if VAL0.find('.')==-1:
VAL0=VAL0[:len(VAL0)-6]+'.'+VAL0[-6:]
objectList[obIdx].getIpo().getCurve('LocX').addBezier((currentFrame, scale * float(VAL0)))
if channelList[obIdx][1] != -1:
objectMotiondataMapping[obname, 'LocY'].append((currentFrame, scale * float( line[obChannel[1]] )))
VAL1=lines[lineIdx][channelList[obIdx][1]]
if VAL1.find('.')==-1:
VAL1=VAL1[:len(VAL1)-6]+'.'+VAL1[-6:]
objectList[obIdx].getIpo().getCurve('LocY').addBezier((currentFrame, scale * float(VAL1)))
if channelList[obIdx][2] != -1:
objectMotiondataMapping[obname, 'LocZ'].append((currentFrame, scale * float( line[obChannel[2]] )))
VAL2=lines[lineIdx][channelList[obIdx][2]]
if VAL2.find('.')==-1:
VAL2=VAL2[:len(VAL2)-6]+'.'+VAL2[-6:]
objectList[obIdx].getIpo().getCurve('LocZ').addBezier((currentFrame, scale * float(VAL2)))
if obChannel[3] != -1 or obChannel[4] != -1 or obChannel[5] != -1:
x, y, z = eulerRotate(float( line[obChannel[3]] ), float( line[obChannel[4]] ), float( line[obChannel[5]] ))
x,y,z = x/10.0, y/10.0, z/10.0 # For IPO's 36 is 360d
motionMappingRotX = objectMotiondataMapping[obname, 'RotX']
motionMappingRotY = objectMotiondataMapping[obname, 'RotY']
motionMappingRotZ = objectMotiondataMapping[obname, 'RotZ']
if channelList[obIdx][3] != '-1' or channelList[obIdx][4] != '-1' or channelList[obIdx][5] != '-1':
VAL3=lines[lineIdx][channelList[obIdx][3]]
if VAL3.find('.')==-1:
VAL3=VAL3[:len(VAL3)-6]+'.'+VAL3[-6:]
# Make interpolation not cross between 180d, thjis fixes sub frame interpolation and time scaling.
# Will go from (355d to 365d) rather then to (355d to 5d) - inbetween these 2 there will now be a correct interpolation.
if len(motionMappingRotX) > 1:
while (motionMappingRotX[-1][1] - x) > 18: x+=36
while (motionMappingRotX[-1][1] - x) < -18: x-=36
VAL4=lines[lineIdx][channelList[obIdx][4]]
if VAL4.find('.')==-1:
VAL4=VAL4[:len(VAL4)-6]+'.'+VAL4[-6:]
while (motionMappingRotY[-1][1] - y) > 18: y+=36
while (motionMappingRotY[-1][1] - y) < -18: y-=36
VAL5=lines[lineIdx][channelList[obIdx][5]]
if VAL5.find('.')==-1:
VAL5=VAL5[:len(VAL5)-6]+'.'+VAL5[-6:]
while (motionMappingRotZ[-1][1] - z) > 18: z+=36
while (motionMappingRotZ[-1][1] - z) < -18: z-=36
x, y, z = eulerRotate(float(VAL3), float(VAL4), float(VAL5))
motionMappingRotX.append((currentFrame, x))
motionMappingRotY.append((currentFrame, y))
motionMappingRotZ.append((currentFrame, z))
objectList[obIdx].getIpo().getCurve('RotX').addBezier((currentFrame, x))
objectList[obIdx].getIpo().getCurve('RotY').addBezier((currentFrame, y))
objectList[obIdx].getIpo().getCurve('RotZ').addBezier((currentFrame, z))
obIdx += 1
# Done importing motion data #
# lines[lineIdx] = None # Scrap old motion data, save some memory?
lineIdx += 1
#=======================================#
# Now Write the motion to the IPO's #
#=======================================#
for key, motion_data in objectMotiondataMapping.iteritems():
# Strip the motion data where all the points have the same falue.
i = len(motion_data) -2
while i > 0 and len(motion_data) > 2:
if motion_data[i][1] == motion_data[i-1][1] == motion_data[i+1][1]:
motion_data.pop(i)
i-=1
# Done stripping.
obname, tx_type = key
curve = objectCurveMapping[obname, tx_type]
for point_data in motion_data:
curve.addBezier( point_data )
# Imported motion to an IPO
# We have finished now
print currentFrame, 'done.'
# No point in looking further, when this loop is done
# There is nothine else left to do
print 'Imported ', currentFrame, ' frames'
break
# Main file loop
lineIdx += 1
print 'bvh import time for %i frames: %.6f' % (currentFrame, Blender.sys.time() - time1)
Window.RedrawAll()
Window.WaitCursor(0)
print "bvh import time: ", Blender.sys.time() - time1
Blender.Window.FileSelector(loadBVH, "Import BVH")
#=============#
# TESTING #
#=============#
'''
#loadBVH('/metavr/mocap/bvh/boxer.bvh')
#loadBVH('/metavr/mocap/bvh/dg-306-g.bvh') # Incompleate EOF
#loadBVH('/metavr/mocap/bvh/wa8lk.bvh') # duplicate joint names, \r line endings.
#loadBVH('/metavr/mocap/bvh/walk4.bvh') # 0 channels
scale = 0.01
import os
DIR = '/metavr/mocap/bvh/'
for f in os.listdir(DIR):
if f.endswith('.bvh'):
s = Scene.New(f)
s.makeCurrent()
loadBVH(DIR + f)
'''
if __name__ == '__main__':
main()

@ -0,0 +1,213 @@
#!BPY
"""
Name: 'Clean Mesh'
Blender: 234
Group: 'Mesh'
Tooltip: 'Clean unused data from all selected meshes'
"""
__author__ = "Campbell Barton"
__url__ = ("blender", "elysiun")
__version__ = "1.1 04/25/04"
__bpydoc__ = """\
This script cleans specific data from all selected meshes.
Usage:
Select the meshes to be cleaned and run this script. A pop-up will ask
you what you want to remove:
- Free standing vertices;<br>
- Edges that are not part of any face;<br>
- Edges below a threshold length;<br>
- Faces below a threshold area;<br>
- All of the above.
After choosing one of the above alternatives, if your choice requires a
threshold value you'll be prompted with a number pop-up to set it.
"""
# $Id$
#
# --------------------------------------------------------------------------
# Mesh Cleaner 1.0 By Campbell Barton (AKA Ideasman)
# --------------------------------------------------------------------------
# ***** 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.
#
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
# Made by Ideasman/Campbell 2004/04/25 - ideasman@linuxmail.org
import Blender
from Blender import *
from math import sqrt
time1 = Blender.sys.time()
VRemNum = ERemNum = FRemNum = 0 # Remember for statistics
#================#
# Math functions #
#================#
def compare(f1, f2, limit):
if f1 + limit > f2 and f1 - limit < f2:
return 1
return 0
def measure(v1, v2):
return Mathutils.Vector([v1[0]-v2[0], v1[1] - v2[1], v1[2] - v2[2]]).length
def triArea2D(v1, v2, v3):
e1 = measure(v1, v2)
e2 = measure(v2, v3)
e3 = measure(v3, v1)
p = e1+e2+e3
return 0.25 * sqrt(p*(p-2*e1)*(p-2*e2)*(p-2*e3))
#=============================#
# Blender functions/shortcuts #
#=============================#
def error(str):
Draw.PupMenu('ERROR%t|'+str)
def getLimit(text):
return Draw.PupFloatInput(text, 0.001, 0.0, 1.0, 0.1, 3)
def faceArea(f):
if len(f.v) == 4:
return triArea2D(f.v[0].co, f.v[1].co, f.v[2].co) + triArea2D(f.v[0].co, f.v[2].co, f.v[3].co)
elif len(f.v) == 3:
return triArea2D(f.v[0].co, f.v[1].co, f.v[2].co)
#================#
# Mesh functions #
#================#
def delFreeVert(mesh):
global VRemNum
usedList = eval('[' + ('False,' * len(mesh.verts) )+ ']')
# Now tag verts that areused
for f in mesh.faces:
for v in f.v:
usedList[mesh.verts.index(v)] = True
vIdx = 0
for bool in usedList:
if bool == False:
mesh.verts.pop(vIdx)
vIdx -= 1
VRemNum += 1
vIdx += 1
mesh.update()
def delEdge(mesh):
global ERemNum
fIdx = 0
while fIdx < len(mesh.faces):
if len(mesh.faces[fIdx].v) == 2:
mesh.faces.pop(fIdx)
ERemNum += 1
fIdx -= 1
fIdx +=1
mesh.update()
def delEdgeLen(mesh, limit):
global ERemNum
fIdx = 0
while fIdx < len(mesh.faces):
if len(mesh.faces[fIdx].v) == 2:
if measure(mesh.faces[fIdx].v[0].co, mesh.faces[fIdx].v[1].co) <= limit:
mesh.faces(fIdx)
ERemNum += 1
fIdx -= 1
fIdx +=1
mesh.update()
def delFaceArea(mesh, limit):
global FRemNum
fIdx = 0
while fIdx < len(mesh.faces):
if len(mesh.faces[fIdx].v) > 2:
if faceArea(mesh.faces[fIdx]) <= limit:
mesh.faces.pop(fIdx)
FRemNum += 1
fIdx -= 1
fIdx +=1
mesh.update()
#====================#
# Make a mesh list #
#====================#
is_editmode = Window.EditMode()
if is_editmode: Window.EditMode(0)
meshList = []
if len(Object.GetSelected()) > 0:
for ob in Object.GetSelected():
if ob.getType() == 'Mesh':
meshList.append(ob.getData())
#====================================#
# Popup menu to select the functions #
#====================================#
if len(meshList) == 0:
error('no meshes in selection')
else:
method = Draw.PupMenu(\
'Clean Mesh, Remove...%t|\
Verts: free standing|\
Edges: not in a face|\
Edges: below a length|\
Faces: below an area|%l|\
All of the above|')
if method >= 3:
limit = getLimit('threshold: ')
if method != -1:
for mesh in meshList:
if method == 1:
delFreeVert(mesh)
elif method == 2:
delEdge(mesh)
elif method == 3:
delEdgeLen(mesh, limit)
elif method == 4:
delFaceArea(mesh, limit)
elif method == 6: # All of them
delFaceArea(mesh, limit)
delEdge(mesh)
delFreeVert(mesh)
mesh.update(0)
Redraw()
print 'mesh cleanup time',Blender.sys.time() - time1
if is_editmode: Window.EditMode(1)
if method != -1:
Draw.PupMenu('Removed from ' + str(len(meshList)) +' Mesh(es)%t|' + 'Verts:' + str(VRemNum) + ' Edges:' + str(ERemNum) + ' Faces:' + str(FRemNum))

@ -29,26 +29,6 @@ Usage:<br>
__author__ = "Campbell Barton AKA Ideasman"
__url__ = ["http://members.iinet.net.au/~cpbarton/ideasman/", "blender", "elysiun"]
# --------------------------------------------------------------------------
# ***** 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.
#
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
import Blender
from Blender import *
import sys as python_sys
@ -152,7 +132,7 @@ def unzip(list):
this function will fail
"""
if not list: return ()
if len(list) == 0: return ()
l = []
for t in range(len(list[0])):
l.append(map( lambda x,t=t: x[t], list ))
@ -233,7 +213,7 @@ def rdir(dirString, depth=0):
# Dont bother with this data.
continue
if type(dirItem) != types.StringType:
if type(dirItem) != type('str'):
print dirItem, type(dirItem)
if dirItem not in COLLECTED_VAR_NAMES.keys():
@ -249,17 +229,17 @@ def rdir(dirString, depth=0):
#print type(dirItem)
#if type(dirData) == types.ClassType or \
# type(dirData) == types.ModuleType:
type_dirData = type(dirData)
if type_dirData != types.StringType and\
type_dirData != types.DictType and\
type_dirData != types.DictionaryType and\
type_dirData != types.FloatType and\
type_dirData != types.IntType and\
type_dirData != types.NoneType and\
type_dirData != types.StringTypes and\
type_dirData != types.TypeType and\
type_dirData != types.TupleType and\
type_dirData != types.BuiltinFunctionType:
if type(dirData) != types.StringType and\
type(dirData) != types.DictType and\
type(dirData) != types.DictionaryType and\
type(dirData) != types.FloatType and\
type(dirData) != types.IntType and\
type(dirData) != types.NoneType and\
type(dirData) != types.StringTypes and\
type(dirData) != types.TypeType and\
type(dirData) != types.TupleType and\
type(dirData) != types.BuiltinFunctionType:
# print type(dirData), dirItem
# Dont loop up dirs for strings ints etc.
if dirItem not in dirStringSplit:
@ -539,17 +519,16 @@ def handle_event(evt, val):
menuList.sort()
choice = PupMenuLess( # Menu for the user to choose the autocompleate
'Choices (Shift for local name, Ctrl for Docs)%t|' + # Title Text
'Choices (Shift for Whole name, Ctrl for Docs)%t|' + # Title Text
'|'.join(['%s, %s' % m for m in menuList])) # Use Absolute names m[0]
if choice != -1:
if Window.GetKeyQualifiers() & Window.Qual.CTRL: # Help
cmdBuffer[-1].cmd = ('help(%s%s) ' % (cmdBuffer[-1].cmd[:cursor - len(editVar)], menuList[choice-1][0]))
elif Window.GetKeyQualifiers() & Window.Qual.SHIFT: # Put in the long name
cmdBuffer[-1].cmd = ('%s%s%s' % (cmdBuffer[-1].cmd[:cursor - len(editVar)], menuList[choice-1][1], cmdBuffer[-1].cmd[cursor:]))
else: # Only paste in the Short name
cmdBuffer[-1].cmd = ('%s%s%s' % (cmdBuffer[-1].cmd[:cursor - len(editVar)], menuList[choice-1][0], cmdBuffer[-1].cmd[cursor:]))
else: # Only paste in the Short name
cmdBuffer[-1].cmd = ('%s%s%s' % (cmdBuffer[-1].cmd[:cursor - len(editVar)], menuList[choice-1][1], cmdBuffer[-1].cmd[cursor:]))
else:
# print 'NO EDITVAR'
@ -560,8 +539,11 @@ def handle_event(evt, val):
# Quit from menu only
#if (evt == Draw.ESCKEY and not val):
# Draw.Exit()
if evt == Draw.MOUSEX or evt == Draw.MOUSEY: # AVOID TOO MANY REDRAWS.
if evt == Draw.MOUSEX: # AVOID TOO MANY REDRAWS.
return
elif evt == Draw.MOUSEY:
return
global cursor

@ -11,7 +11,7 @@ __author__ = "Jean-Michel Soler (jms)"
__url__ = ("blender", "elysiun",
"Script's homepage, http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_hotkeyscript.htm",
"Communicate problems and errors, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender")
__version__ = "12/18/2005"
__version__ = "10/04/2005"
__bpydoc__ = """\
This script is a reference about all hotkeys and mouse actions in Blender.
@ -26,9 +26,10 @@ Notes:<br>
"""
# $Id$
#------------------------
# Hotkeys script
# jm soler (2003-->12/2005)
# jm soler (2003-->10/2004)
# -----------------------
# Page officielle :
# http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_hotkeyscript.htm
@ -74,17 +75,16 @@ hotkeys={
['Ctrl-,', 'Set Median Point rotation scaling pivot'],
['.', 'Set 3D cursor as rotation scaling pivot'],
['Ctrl-.', 'Set Individual Object Centers as rotation scaling pivot'],
['~', 'Display all layers (German keys: ö,french keyboard: ù)'],
['Shift-~', 'Display all/previous layers (German keys: Shift-ö, french keyboard: shift-ù)'],
['~', 'Display all layers (German keys: ö)'],
['Shift-~', 'Display all/previous layers (German keys: Shift-ö)'],
['Space', 'Popup menu'],
['Space', '3D View: camera selected + fly mode, accept'],
['Ctrl-Space', 'Manipulator (transform widget) Menu'],
['TAB', 'Enter/exit Edit Mode'],
['TAB', 'Edit Mode and Numerical Edit (see N key) : move to next input value'],
['TAB', 'Sequencer: Edit meta strip'],
['TAB', 'IPO: Edit selected'],
['Ctrl-TAB', 'ARMATURE : Enter/exit Pose Mode'],
['Shift-TAB', 'EDIT MODE : Enter Object Mode'],
['Ctrl-TAB', 'Enter/exit Pose Mode'],
['Shift-TAB', 'Enter Object Mode'],
['Ctrl-Open menu /', ''],
['Ctrl-Load Image', 'Opens a thumbnail browser instead of file browser for images']
],
@ -97,25 +97,20 @@ hotkeys={
['LMB hold down', 'Popup menu'],
['LMB hold down drag', 'Gesture'],
['Ctrl-LMB', 'IPO: Add key'],
['Ctrl-LMB', '3D View: OBJECT or EDIT mode, select with the Lasso tool'],
['Ctrl-LMB', '3D View: ARMATURE EDIT mode, add a new bone to the selected end '],
['Shift-LMB','MANIPULATOR (transform widget): select the axe to remove in the current transformation ( if there is a problem with small step adjustment, first select the axe or axes with LBM alone)'],
['MMB', 'Rotate'],
['Ctrl-MMB', 'Zoom view'],
['Shift-MMB', 'Move view'],
['RMB', 'Select'],
['RMB drag', 'Border select circle: subtract from selection'],
['RMB hold down', 'Popup menu'],
['Alt-RMB', 'Object Mode :Select but in a displayed list of objects located under the mouse cursor'],
['Alt-RMB', 'Edit Mode: Select EDGES LOOP '],
['Alt+Ctrl-RMB', 'Edit Mode: Select FACES LOOP'],
['Alt+Ctrl-RMB', 'Edit Mode: Select edge'],
['Alt+Ctrl-RMB', 'UV Image Editor: Select face'],
['Shift-RMB', 'Add/subtract to/from selection'],
['Wheel', 'Zoom view'],
['Transformations:', ''],
['Drag+Ctrl', 'Step adjustment'],
['Drag+Ctrl+Shift', 'Small step adjustment (Transform Widget : first select the axe or axes with LBM alone)'],
['Drag+Shift', 'Fine adjustment (Transform Widget : first select the axe or axes with LBM alone)'],
['Drag+Ctrl+Shift', 'Small step adjustment'],
['Drag+Shift', 'Fine adjustment'],
['LMB', 'Confirm transformation'],
['MMB', 'Toggle optional transform feature'],
['RMB', 'Abort transformation']
@ -123,36 +118,33 @@ hotkeys={
'F-Keys ':[
['F1', 'Open File'],
['Shift-F1', 'Library Data Select'],
['F2', 'Save File'],
['Shift-F2', 'Export DXF'],
['Ctrl-F2', 'Save/export in vrml 1.0 format' ],
['F3', 'Save image'],
['Ctrl-F3', 'Save image : dump 3d view'],
['Ctrl-Shift-F3', 'Save image : dump screen'],
['F4', 'Logic Window (may change)'],
['Shift-F4', 'Object manager Data Select '],
['F5', 'Material Window'],
['Shift-F5', '3D Window'],
['F6', 'Texture Window'],
['Shift-F6', 'IPO Window'],
['F7', 'Object Window'],
['Shift-F7', 'Buttons Window'],
['F8', 'World Window'],
['Shift-F8', 'Video Sequencer Window'],
['F9', 'Edit Mode Window'],
['F10', 'Render Window'],
['F11', 'Recall the last rendered image'],
['F12', 'Render current Scene'],
['Ctrl-Shift-F12', 'NLA Editor'],
['Shift-F1', 'Library Data Select'],
['Shift-F2', 'Export DXF'],
['Shift-F4', 'Object manager Data Select '],
['Shift-F5', '3D Window'],
['Shift-F6', 'IPO Window'],
['Shift-F7', 'Buttons Window'],
['Shift-F8', 'Video Sequencer Window'],
['Shift-F9', 'OOP Window'],
['Alt-Shift-F9', 'OutLiner Window'],
['F10', 'Render Window'],
['Shift-F10', 'UV Image Editor'],
['F11', 'Recall the last rendered image'],
['Shift-F11', 'Text Editor'],
['ctrl-F11', 'replay the last rendered animation'],
['F12', 'Render current Scene'],
['Ctrl-F12', 'Render animation'],
['Ctrl-Shift-F12', 'NLA Editor'],
['Shift-F12', 'Action Editor'],
['Shift-F12', 'Action Editor']
['Ctrl-F2', 'Save/export in vrml 1.0 format' ],
['Ctrl-F3', 'Save image : dump 3d view'],
['Ctrl-Shift-F3', 'Save image : dump screen']
],
'Numbers ':[
@ -160,10 +152,7 @@ hotkeys={
['1..2..0-=', 'Edit Mode with Size, Grab, rotate tools : enter value'],
['Alt-1..2..0', 'Show layer 11..12..20'],
['Shift-1..2..0-=', 'Toggle layer 1..2..12'],
['Shift-ALT-...', 'Toggle layer 11..12..20'],
['Crtl-Shift-ALT-3', 'Edit Mode & Face Mode : Triangle faces'],
['Crtl-Shift-ALT-4', 'Edit Mode & Face Mode : Quad faces'],
['Crtl-Shift-ALT-5', 'Edit Mode & Face Mode : Non quad or triangle faces'],
['Shift-ALT-...', 'Toggle layer 11..12..20']
],
'Numpad ':[
@ -178,10 +167,9 @@ hotkeys={
['Numpad +', 'In OutLiner window, Expand one level of the hierarchy'],
['Alt-Numpad -', 'Proportional vertex Edit Mode: Decrease range of influence'],
['Ctrl-Numpad +', 'Edit Mode: Select Less vertices'],
['Numpad 0', 'Set Camera view'],
['Ctrl-Numpad 0', 'Set active object as camera'],
['Alt-Numbad 0', 'Restore old camera'],
['Ctrl-Alt-Numpad 0', 'Align active camera to view'],
['Numpad INS', 'Set Camera view'],
['Ctrl-Numpad INS', 'Set active object as camera'],
['Alt-Numbad INS', 'Restore old camera'],
['Numpad 1', 'Front view'],
['Ctrl-Numpad 1', 'Back view'],
['Numpad 3', 'Right view'],
@ -191,9 +179,7 @@ hotkeys={
['Numpad 5', 'Toggle orthogonal/perspective view'],
['Numpad 9', 'Redraw view'],
['Numpad 4', 'Rotate view left'],
['ctrl-Shift-Numpad 4', 'Previous Screen'],
['Numpad 6', 'Rotate view right'],
['ctrl-Shift-Numpad 6', 'Next Screen'],
['Numpad 8', 'Rotate view up'],
['Numpad 2', 'Rotate view down']
],
@ -221,7 +207,6 @@ hotkeys={
['Alt-Up', 'Blender in Fullscreen mode'],
['Ctrl-Left', 'Previous screen'],
['Ctrl-Right', 'Next screen'],
['Ctrl-Alt-C', 'Object Mode : Add Constraint'],
['Ctrl-Down', 'Maximize window toggle'],
['Ctrl-Up', 'Maximize window toggle'],
['Shift-Arrow', 'Toggle first frame/ last frame']
@ -283,12 +268,6 @@ hotkeys={
['EZ', 'Edit Mode: Extrude along Z axis'],
['Alt-E', 'Edit Mode: exit Edit Mode'],
['Ctrl-E', 'Edit Mode: Edge Specials menu'],
['Ctrl-E', 'Edit Mode: Edge Specials menu, Mark seams'],
['Ctrl-E', 'Edit Mode: Edge Specials menu, Clear seams'],
['Ctrl-E', 'Edit Mode: Edge Specials menu, Rotate Edge CW'],
['Ctrl-E', 'Edit Mode: Edge Specials menu, Rotate Edge CCW'],
['Ctrl-E', 'Edit Mode: Edge Specials menu, Loop Cut'],
['Ctrl-E', 'Edit Mode: Edge Specials menu, Edge Slide'],
['Shift-E', 'Edit Mode: SubSurf Edge Sharpness']
],
@ -308,7 +287,6 @@ hotkeys={
['Alt-G', 'Clear location'],
['Shift-ALT-G', 'Remove selected objects from group'],
['Ctrl-G', 'Add selected objects to group'],
['Ctrl-Alt-G', 'MANIPULATOR (transform widget): set in Grab Mode'],
['Shift-G', 'Selected Group menu']
],
@ -317,11 +295,11 @@ hotkeys={
['H', 'Curves: Set handle type'],
['H', 'Action editor: Handle type aligned'],
['H', 'Action editor: Handle type free'],
['Alt-H', 'Edit Mode : Show Hidden vertices/faces'],
['Alt-H', 'Show Hidden vertices/faces'],
['Shift-H', 'Curves: Automatic handle calculation'],
['Shift-H', 'Action editor: Handle type auto'],
['Shift-H', 'Edit Mode : Hide deselected vertices/faces'],
['Ctrl-H', 'Edit Mode : Add a hook on selected points or show the hook menu .']
['Shift-H', 'Edit Mode, Hide deselected vertices/faces'],
['Ctrl-H', 'Edit Mode, Add a hook on selected points or show the hook menu .']
],
"I":[
@ -351,7 +329,7 @@ hotkeys={
"L":[
['L', 'Make local menu'],
['L', 'Edit Mode: Select linked vertices (near mouse pointer)'],
['L', 'Edit mode: Select linked vertices (near mouse pointer)'],
['L', 'OOPS window: Select linked objects'],
['L', 'UV Face Select: Select linked faces'],
['Ctrl-L', 'Make links menu (for instance : to scene...)'],
@ -375,7 +353,7 @@ hotkeys={
['N', 'OOPS window: Rename object/linked objects'] ,
['Ctrl-N', 'Armature: Recalculate bone roll angles'] ,
['Ctrl-N', 'Edit Mode: Recalculate normals to outside'] ,
['Ctrl-Shift-N', 'Edit Mode: Recalculate normals to inside'] ],
['Ctrl-ALT-N', 'Edit Mode: Recalculate normals to inside'] ],
"O":[
['O', 'Edit Mode/UV Image Editor: Toggle proportional vertex editing'],
@ -387,7 +365,6 @@ hotkeys={
"P":[
['P', 'Object Mode: Start realtime engine'],
['P', 'Edit mode: Seperate vertices to new object'],
['shift-P', 'Edit mode: Push-Pull'],
['P', 'UV Image Editor: Pin UVs'],
['Alt-P', 'Clear parent relationship'],
['Alt-P', 'UV Image Editor: Unpin UVs'],
@ -410,7 +387,6 @@ hotkeys={
['RZZ', "Rotate around object's local Z axis"],
['Alt-R', 'Clear object rotation'],
['Ctrl-R', 'Edit Mode: Knife, cut selected edges, accept left mouse/ cancel right mouse'],
['Ctrl-Alt-R', 'MANIPULATOR (transform widget): set in Rotate Mode'],
['Shift-R', 'Edit Mode: select Face Loop'],
['Shift-R', 'Nurbs: Select row'] ],
@ -424,11 +400,8 @@ hotkeys={
['SYY', 'Flip around Y axis and show axis'] ,
['SZZ', 'Flip around Z axis and show axis'] ,
['Alt-S', 'Edit mode: Shrink/fatten (Scale along vertex normals)'] ,
['Ctrl-Shift-S', 'Edit mode: To Sphere'] ,
['Ctrl-Alt-Shift-S', 'Edit mode: Shear'] ,
['Alt-S', 'Clear object size'] ,
['Ctrl-S', 'Edit mode: Shear'] ,
['Ctrl-Alt-G', 'MANIPULATOR (transform widget): set in Size Mode'],
['Shift-S', 'Cursor/Grid snap menu'] ],
"T":[
@ -445,15 +418,15 @@ hotkeys={
"U":[
['U', 'Make single user menu (for import completly linked object to another scene for instance) '] ,
['U', '3D View: Make Single user Menu'] ,
['U', 'Edit Mode: Reload object data from before entering Edit Mode'] ,
['U', 'UV Face Select: Automatic UV calculation menu'] ,
['U', 'Vertex-/Weightpaint mode: Undo'] ,
['Ctrl-U', 'Save current state as user default'],
['Shift-U', 'Edit Mode: Redo Menu'],
['Alt-U', 'Edit Mode & Object Mode: Undo Menu']],
['Alt-U', 'Edit Mode: Undo Menu'] ],
"V":[
['V', 'Curves/Nurbs: Vector handle'],
['V', 'Edit Mode : Rip selected vertices'],
['V', 'Vertexpaint mode'],
['V', 'UV Image Editor: Stitch UVs'],
['V', 'Action editor: Vector'],
@ -464,37 +437,13 @@ hotkeys={
],
"W":[
['W', 'Edit Mode: Specials menu'],
['W', 'Edit Mode: Specials menu, ARMATURE 1 Subdivide'],
['W', 'Edit Mode: Specials menu, ARMATURE 2 Flip Left-Right Name'],
['W', 'Edit Mode: Specials menu, CURVE 1 Subdivide'],
['W', 'Edit Mode: Specials menu, CURVE 2 Swich Direction'],
['W', 'Edit Mode: Specials menu, MESH 1 Subdivide'],
['W', 'Edit Mode: Specials menu, MESH 2 Subdivide Multi'],
['W', 'Edit Mode: Specials menu, MESH 3 Subdivide Multi Fractal'],
['W', 'Edit Mode: Specials menu, MESH 4 Subdivide Smooth'],
['W', 'Edit Mode: Specials menu, MESH 5 Merge'],
['W', 'Edit Mode: Specials menu, MESH 6 Remove Double'],
['W', 'Edit Mode: Specials menu, MESH 7 Hide'],
['W', 'Edit Mode: Specials menu, MESH 8 Reveal'],
['W', 'Edit Mode: Specials menu, MESH 9 Select Swap'],
['W', 'Edit Mode: Specials menu, MESH 10 Flip Normal'],
['W', 'Edit Mode: Specials menu, MESH 11 Smooth'],
['W', 'Edit Mode: Specials menu, MESH 12 Bevel'],
['W', 'Edit Mode: Specials menu, MESH 13 Set Smooth'],
['W', 'Edit Mode : Specials menu, MESH 14 Set Solid'],
['W', 'Object Mode : on MESH objects, Boolean Tools menu'],
['W', 'Object Mode : on MESH objects, Boolean Tools 1 Intersect'],
['W', 'Object Mode : on MESH objects, Boolean Tools 2 union'],
['W', 'Object Mode : on MESH objects, Boolean Tools 3 difference'],
['W', 'Object Mode : on MESH objects, Boolean Tools 4 Add an intersect Modifier'],
['W', 'Object Mode : on MESH objects, Boolean Tools 5 Add an union Modifier'],
['W', 'Object Mode : on MESH objects, Boolean Tools 6 Add a difference Modifier'],
['W', 'Object mode : on TEXT object, Split characters, a new TEXT object by character in the selected string '],
['W', 'Object Mode: Boolean operations menu'],
['W', 'Edit mode: Specials menu'],
['W', 'UV Image Editor: Weld/Align'],
['WX', 'UV Image Editor: Weld/Align X axis'],
['WY', 'UV Image Editor: Weld/Align Y axis'],
['Ctrl-W', 'Save current file'] ,
['Ctrl-W', 'Nurbs: Switch direction'] ,
['Shift-W', 'Warp/bend selected vertices around cursor'],
['alt-W', 'Export in videoscape format']
],
@ -507,15 +456,13 @@ hotkeys={
],
"Y":[
['Y', 'Edit Mode & Mesh : Split selected vertices/faces from the rest'],
['Ctrl-Y', 'Object Mode : Redo'],
],
['Y', 'Mesh: Split selected vertices/faces from the rest'] ],
"Z":[
['Z', 'Render Window: 200% zoom from mouse position'],
['Z', 'Switch 3d draw type : solide/ wireframe (see also D)'],
['Alt-Z', 'Switch 3d draw type : solid / textured (see also D)'],
['Ctrl-Z', 'Object Mode : Undo'],
['Ctrl-Z', 'Switch 3d draw type : shaded (see also D)'],
['Shift-Z', 'Switch 3d draw type : shaded / wireframe (see also D)'],
]}]}
@ -551,15 +498,12 @@ def searchfor(SEARCHLINE):
#print 'k, l : ', k, l, l[1]
if l[1].upper().find(SEARCHLINE.upper())!=-1:
FINDLIST.append(l)
elif k == 'Letters ':
for l in hotL :
for l0 in hotkeys['Letters '][0][l][:-1]:
#print 'k, l : ',l, k, l0
if l0[1].upper().find(SEARCHLINE.upper())!=-1:
FINDLIST.append(l0)
#print 'FINDLIST',FINDLIST
FINDLIST.append(['Find list','Entry'])
return FINDLIST
@ -625,7 +569,6 @@ def draw():
listed=hot.index(k)
l=0
size[3]=size[3]-4
if hot[listed]!='Letters ' and hot[listed]!='Search ' :
size[3]=size[3]-8
SCROLL=size[3]/21
@ -651,7 +594,6 @@ def draw():
glRasterPos2f(4+8*15, size[3]-(58+21*l))
Text(' : '+n[1])
l+=1
elif hot[listed]=='Search ' :
r=[0,size[3]-70,
size[2], size[3]-44]
@ -662,7 +604,6 @@ def draw():
size[3]=size[3]-8
SCROLL=size[3]/21
END=-1
if SCROLL < len(FINDED):
Button('/\\',up,4,size[3]+8,20,14,'Scroll up')
Button('\\/',down,4,size[3]-8,20,14,'Scroll down')

@ -46,27 +46,12 @@ v5.5 format.
# | http://www.redrival.com/scorpius |
# | scorpius@netzero.com |
# | April 21, 2002 |
# | Released under the Blender Artistic Licence (BAL) |
# | Import Export Suite v0.5 |
# +---------------------------------------------------------+
# | Read and write LightWave Object File Format (*.lwo) |
# +---------------------------------------------------------+
# ***** 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.
#
# ***** END GPL LICENCE BLOCK *****
import Blender, meshtools
import struct, chunk, os, cStringIO, time, operator

File diff suppressed because it is too large Load Diff

@ -53,27 +53,12 @@ field.
# | http://www.redrival.com/scorpius |
# | scorpius@netzero.com |
# | September 25, 2001 |
# | Released under the Blender Artistic Licence (BAL) |
# | Import Export Suite v0.5 |
# +---------------------------------------------------------+
# | Read and write Nendo File Format (*.nendo) |
# +---------------------------------------------------------+
# ***** 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.
#
# ***** END GPL LICENCE BLOCK *****
import Blender, meshtools
import struct, time, sys, os

@ -48,27 +48,12 @@ edges during the course of modeling.
# | http://www.redrival.com/scorpius |
# | scorpius@netzero.com |
# | September 25, 2001 |
# | Released under the Blender Artistic Licence (BAL) |
# | Import Export Suite v0.5 |
# +---------------------------------------------------------+
# | Read and write Nendo File Format (*.nendo) |
# +---------------------------------------------------------+
# ***** 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.
#
# ***** END GPL LICENCE BLOCK *****
import Blender, meshtools
import struct, time, sys, os

@ -21,7 +21,7 @@ Run this script from "File->Export" menu to export all meshes.
# --------------------------------------------------------------------------
# OBJ Export v1.0 by Campbell Barton (AKA Ideasman)
# OBJ Export v0.9b by Campbell Barton (AKA Ideasman)
# --------------------------------------------------------------------------
# ***** BEGIN GPL LICENSE BLOCK *****
#
@ -42,18 +42,12 @@ Run this script from "File->Export" menu to export all meshes.
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
#==================================================#
# New name based on old with a different extension #
#==================================================#
def newFName(ext):
return Get('filename')[: -len(Get('filename').split('.', -1)[-1]) ] + ext
import Blender
from Blender import Mesh, Scene, Window, sys, Image, Draw
# Returns a tuple - path,extension.
# 'hello.obj' > ('hello', '.obj')
def splitExt(path):
dotidx = path.rfind('.')
if dotidx == -1:
return path, ''
else:
return path[:dotidx], path[dotidx:]
def fixName(name):
if name == None:
@ -61,53 +55,10 @@ def fixName(name):
else:
return name.replace(' ', '_')
# Used to add the scene name into the filename without using odd chars
def saneFilechars(name):
for ch in ' /\\~!@#$%^&*()+=[];\':",./<>?\t\r\n':
name = name.replace(ch, '_')
return name
def sortPair(a,b):
return min(a,b), max(a,b)
def getMeshFromObject(object, name=None, mesh=None):
if mesh:
mesh.verts = None # Clear the mesh
else:
if not name:
mesh = Mesh.New()
else:
mesh = Mesh.New(name)
type = object.getType()
dataname = object.getData(1)
try:
mesh.getFromObject(object.name)
except:
return None
if type == 'Mesh':
tempMe = Mesh.Get( dataname )
mesh.materials = tempMe.materials
mesh.degr = tempMe.degr
mesh.mode = tempMe.mode
else:
try:
# Will only work for curves!!
# Text- no material access in python interface.
# Surf- no python interface
# MBall- no material access in python interface.
data = object.getData()
materials = data.getMaterials()
mesh.materials = materials
print 'assigning materials for non mesh'
except:
print 'Cant assign materials to', type
return mesh
from Blender import *
global MTL_DICT
@ -115,17 +66,17 @@ global MTL_DICT
# (material.name, image.name):matname_imagename # matname_imagename has gaps removed.
MTL_DICT = {}
def write_mtl(filename):
def save_mtl(filename):
global MTL_DICT
world = Blender.World.GetCurrent()
world = World.GetCurrent()
if world:
worldAmb = world.getAmb()
else:
worldAmb = (0,0,0) # Default value
file = open(filename, "w")
file.write('# Blender MTL File: %s\n' % Blender.Get('filename').split('\\')[-1].split('/')[-1])
file.write('# Blender MTL File: %s\n' % Get('filename').split('\\')[-1].split('/')[-1])
file.write('# Material Count: %i\n' % len(MTL_DICT))
# Write material/image combinations we have used.
for key, mtl_mat_name in MTL_DICT.iteritems():
@ -145,7 +96,7 @@ def write_mtl(filename):
file.write('illum 2\n') # light normaly
else:
mat = Blender.Material.Get(key[0])
mat = Material.Get(key[0])
file.write('Ns %s\n' % round((mat.getHardness()-1) * 1.9607843137254901 ) ) # Hardness, convert blenders 1-511 to MTL's
file.write('Ka %s %s %s\n' % tuple([round(c*mat.getAmb(), 6) for c in worldAmb]) ) # Ambient, uses mirror colour,
file.write('Kd %s %s %s\n' % tuple([round(c*mat.getRef(), 6) for c in mat.getRGBCol()]) ) # Diffuse
@ -154,7 +105,7 @@ def write_mtl(filename):
file.write('d %s\n' % round(mat.getAlpha(), 6)) # Alpha (obj uses 'd' for dissolve)
# 0 to disable lighting, 1 for ambient & diffuse only (specular color set to black), 2 for full lighting.
if mat.getMode() & Blender.Material.Modes['SHADELESS']:
if mat.getMode() & Material.Modes['SHADELESS']:
file.write('illum 0\n') # ignore lighting
elif mat.getSpec() == 0:
file.write('illum 1\n') # no specular.
@ -169,7 +120,7 @@ def write_mtl(filename):
elif key[0] != None: # No face image. if we havea material search for MTex image.
for mtex in mat.getTextures():
if mtex and mtex.tex.type == Blender.Texture.Types.IMAGE:
if mtex and mtex.tex.type == Texture.Types.IMAGE:
try:
filename = mtex.tex.image.filename.split('\\')[-1].split('/')[-1]
file.write('map_Kd %s\n' % filename) # Diffuse mapping image
@ -182,84 +133,24 @@ def write_mtl(filename):
file.close()
def copy_file(source, dest):
file = open(source, 'rb')
data = file.read()
file.close()
file = open(dest, 'wb')
file.write(data)
file.close()
def copy_images(dest_dir):
if dest_dir[-1] != sys.sep:
dest_dir += sys.sep
# Get unique image names
uniqueImages = {}
for matname, imagename in MTL_DICT.iterkeys(): # Only use image name
if imagename != None:
uniqueImages[imagename] = None # Should use sets here. wait until Python 2.4 is default.
# Now copy images
copyCount = 0
for imageName in uniqueImages.iterkeys():
print imageName
bImage = Image.Get(imageName)
image_path = sys.expandpath(bImage.filename)
if sys.exists(image_path):
# Make a name for the target path.
dest_image_path = dest_dir + image_path.split('\\')[-1].split('/')[-1]
if not sys.exists(dest_image_path): # Image isnt alredy there
print '\tCopying "%s" > "%s"' % (image_path, dest_image_path)
copy_file(image_path, dest_image_path)
copyCount+=1
print '\tCopied %d images' % copyCount
def write(filename, objects,\
EXPORT_TRI=False, EXPORT_EDGES=False, EXPORT_NORMALS=False,\
EXPORT_UV=True, EXPORT_MTL=True, EXPORT_COPY_IMAGES=False,\
EXPORT_APPLY_MODIFIERS=True, EXPORT_BLEN_OBS=True,\
EXPORT_GROUP_BY_OB=False, EXPORT_GROUP_BY_MAT=False):
'''
Basic write function. The context and options must be alredy set
This can be accessed externaly
eg.
write( 'c:\\test\\foobar.obj', Blender.Object.GetSelected() ) # Using default options.
'''
print 'OBJ Export path: "%s"' % filename
def save_obj(filename):
global MTL_DICT
temp_mesh_name = '~tmp-mesh'
time1 = sys.time()
scn = Scene.GetCurrent()
file = open(filename, "w")
# Write Header
file.write('# Blender v%s OBJ File: %s\n' % (Blender.Get('version'), Blender.Get('filename').split('/')[-1].split('\\')[-1] ))
file.write('# www.blender3d.org\n')
file.write('# Blender OBJ File: %s\n' % (Get('filename').split('/')[-1].split('\\')[-1] ))
file.write('# www.blender.org\n')
# Tell the obj file what material file to use.
mtlfilename = '%s.mtl' % '.'.join(filename.split('.')[:-1])
file.write('mtllib %s\n' % ( mtlfilename.split('\\')[-1].split('/')[-1] ))
# Get the container mesh.
if EXPORT_APPLY_MODIFIERS:
containerMesh = meshName = tempMesh = None
for meshName in Blender.NMesh.GetNames():
if meshName.startswith(temp_mesh_name):
tempMesh = Mesh.Get(meshName)
if not tempMesh.users:
containerMesh = tempMesh
if not containerMesh:
containerMesh = Mesh.New(temp_mesh_name)
del meshName
del tempMesh
# Initialize totals, these are updated each object
totverts = totuvco = totno = 1
@ -267,61 +158,28 @@ EXPORT_GROUP_BY_OB=False, EXPORT_GROUP_BY_MAT=False):
globalNormals = {}
# Get all meshs
for ob in objects:
for ob in scn.getChildren():
#for ob in Object.GetSelected():
try:
# Will work for non meshes now! :)
if EXPORT_APPLY_MODIFIERS or ob.getType() != 'Mesh':
m = getMeshFromObject(ob, temp_mesh_name, containerMesh)
if not m:
m = NMesh.GetRawFromObject(ob.name)
except:
continue
# We have a valid mesh
if m and EXPORT_APPLY_MODIFIERS and EXPORT_TRI:
# Add a dummy object to it.
oldmode = Mesh.Mode()
Mesh.Mode(Mesh.SelectModes['FACE'])
quadcount = 0
for f in m.faces:
if len(f.v) == 4:
f.sel = 1
quadcount +=1
faces = [ f for f in m.faces if len(f) > 2 ]
if quadcount:
tempob = Blender.Object.New('Mesh')
tempob.link(m)
scn.link(tempob)
m.quadToTriangle(0) # more=0 shortest length
oldmode = Mesh.Mode(oldmode)
scn.unlink(tempob)
Mesh.Mode(oldmode)
else: # We are a mesh. get the data.
m = ob.getData(mesh=1)
faces = [ f for f in m.faces ]
if EXPORT_EDGES:
edges = [ ed for ed in m.edges ]
else:
edges = []
if not (len(faces)+len(edges)): # Make sure there is somthing to write
if not faces: # Make sure there is somthing to write
continue # dont bother with this mesh.
m.transform(ob.matrix)
# # Crash Blender
#materials = m.getMaterials(1) # 1 == will return None in the list.
materials = m.materials
materials = m.getMaterials()
materialNames = []
if materials:
for mat in materials:
if mat: # !=None
materialNames.append(mat.name)
else:
materialNames.append(None)
# Cant use LC because some materials are None.
# materialNames = map(lambda mat: mat.name, materials) # Bug Blender, dosent account for null materials, still broken.
materialNames = map(lambda mat: mat.name, materials) # Bug Blender, dosent account for null materials, still broken.
else:
materialNames = []
@ -332,40 +190,30 @@ EXPORT_GROUP_BY_OB=False, EXPORT_GROUP_BY_MAT=False):
# Sort by Material, then images
# so we dont over context switch in the obj file.
if m.faceUV and EXPORT_UV:
faces.sort(lambda a,b: cmp((a.mat, a.image, a.smooth), (b.mat, b.image, b.smooth)))
else:
faces.sort(lambda a,b: cmp((a.mat, a.smooth), (b.mat, b.smooth)))
# Set the default mat to no material and no image.
contextMat = (0, 0) # Can never be this, so we will label a new material teh first chance we get.
contextSmooth = None # Will either be true or false, set bad to force initialization switch.
if EXPORT_BLEN_OBS or EXPORT_GROUP_BY_OB:
obnamestring = '%s_%s' % (fixName(ob.name), fixName(ob.getData(1)))
if EXPORT_BLEN_OBS:
file.write('o %s\n' % obnamestring) # Write Object name
else: # if EXPORT_GROUP_BY_OB:
file.write('g %s\n' % obnamestring)
file.write('o %s_%s\n' % (fixName(ob.name), fixName(m.name))) # Write Object name
# Vert
for v in m.verts:
file.write('v %.6f %.6f %.6f\n' % tuple(v.co))
# UV
if m.faceUV and EXPORT_UV:
if m.hasFaceUV():
for f in faces:
for uvKey in f.uv:
uvKey = tuple(uvKey)
if not globalUVCoords.has_key(uvKey):
globalUVCoords[uvKey] = totuvco
totuvco +=1
file.write('vt %.6f %.6f 0.0\n' % uvKey)
# NORMAL, Smooth/Non smoothed.
if EXPORT_NORMALS:
for f in faces:
if f.smooth:
for v in f.v:
@ -387,7 +235,7 @@ EXPORT_GROUP_BY_OB=False, EXPORT_GROUP_BY_MAT=False):
for f in faces:
# MAKE KEY
if EXPORT_UV and m.faceUV and f.image: # Object is always true.
if f.image: # Object is always true.
key = materialNames[f.mat], f.image.name
else:
key = materialNames[f.mat], None # No image, use None instead.
@ -395,17 +243,15 @@ EXPORT_GROUP_BY_OB=False, EXPORT_GROUP_BY_MAT=False):
# CHECK FOR CONTEXT SWITCH
if key == contextMat:
pass # Context alredy switched, dont do anythoing
else:
if key[0] == None and key[1] == None:
elif key[0] == None and key[1] == None:
# Write a null material, since we know the context has changed.
matstring = '(null)'
file.write('usemtl (null)\n') # mat, image
else:
try: # Faster to try then 2x dict lookups.
# We have the material, just need to write the context switch,
matstring = MTL_DICT[key]
# We have the material, just need to write the context switch,
file.write('usemtl %s\n' % MTL_DICT[key]) # mat, image
except KeyError:
# First add to global dict so we can export to mtl
@ -416,13 +262,12 @@ EXPORT_GROUP_BY_OB=False, EXPORT_GROUP_BY_MAT=False):
# If none image dont bother adding it to the name
if key[1] == None:
matstring = MTL_DICT[key] ='%s' % fixName(key[0])
else:
matstring = MTL_DICT[key] = '%s_%s' % (fixName(key[0]), fixName(key[1]))
tmp_matname = MTL_DICT[key] ='%s' % fixName(key[0])
file.write('usemtl %s\n' % tmp_matname) # mat, image
if EXPORT_GROUP_BY_MAT:
file.write('g %s_%s_%s\n' % (fixName(ob.name), fixName(ob.getData(1)), matstring) ) # can be mat_image or (null)
file.write('usemtl %s\n' % matstring) # can be mat_image or (null)
else:
tmp_matname = MTL_DICT[key] = '%s_%s' % (fixName(key[0]), fixName(key[1]))
file.write('usemtl %s\n' % tmp_matname) # mat, image
contextMat = key
@ -434,31 +279,22 @@ EXPORT_GROUP_BY_OB=False, EXPORT_GROUP_BY_MAT=False):
contextSmooth = f.smooth
file.write('f')
if m.faceUV and EXPORT_UV:
if EXPORT_NORMALS:
if m.hasFaceUV():
if f.smooth: # Smoothed, use vertex normals
for vi, v in enumerate(f.v):
file.write( ' %d/%d/%d' % (\
v.index+totverts,\
globalUVCoords[ tuple(f.uv[vi]) ],\
globalUVCoords[ f.uv[vi] ],\
globalNormals[ tuple(v.no) ])) # vert, uv, normal
else: # No smoothing, face normals
no = globalNormals[ tuple(f.no) ]
for vi, v in enumerate(f.v):
file.write( ' %d/%d/%d' % (\
v.index+totverts,\
globalUVCoords[ tuple(f.uv[vi]) ],\
globalUVCoords[ f.uv[vi] ],\
no)) # vert, uv, normal
else: # No Normals
for vi, v in enumerate(f.v):
file.write( ' %d/%d' % (\
v.index+totverts,\
globalUVCoords[ tuple(f.uv[vi])])) # vert, uv
else: # No UV's
if EXPORT_NORMALS:
if f.smooth: # Smoothed, use vertex normals
for v in f.v:
file.write( ' %d//%d' % (\
@ -470,162 +306,30 @@ EXPORT_GROUP_BY_OB=False, EXPORT_GROUP_BY_MAT=False):
file.write( ' %d//%d' % (\
v.index+totverts,\
no))
else: # No Normals
for v in f.v:
file.write( ' %d' % (\
v.index+totverts))
file.write('\n')
# Write edges.
if EXPORT_EDGES:
edgeUsers = {}
for f in faces:
for i in xrange(len(f.v)):
faceEdgeVKey = sortPair(f.v[i].index, f.v[i-1].index)
# We dont realy need to keep count. Just that a face uses it
# so dont export.
edgeUsers[faceEdgeVKey] = 1
for ed in edges:
edgeVKey = sortPair(ed.v1.index, ed.v2.index)
if not edgeUsers.has_key(edgeVKey): # No users? Write the edge.
file.write('f %d %d\n' % (edgeVKey[0]+totverts, edgeVKey[1]+totverts))
# Make the indicies global rather then per mesh
totverts += len(m.verts)
file.close()
# Now we have all our materials, save them
if EXPORT_MTL:
write_mtl(mtlfilename)
if EXPORT_COPY_IMAGES:
dest_dir = filename
# Remove chars until we are just the path.
while dest_dir and dest_dir[-1] not in '\\/':
dest_dir = dest_dir[:-1]
if dest_dir:
copy_images(dest_dir)
else:
print '\tError: "%s" could not be used as a base for an image path.' % filename
save_mtl(mtlfilename)
print "OBJ Export time: %.2f" % (sys.time() - time1)
print "obj export time: %.2f" % (sys.time() - time1)
Window.FileSelector(save_obj, 'Export Wavefront OBJ', newFName('obj'))
'''
TIME = sys.time()
import os
OBJDIR = '/obj_out/'
for scn in Scene.Get():
scn.makeCurrent()
obj = OBJDIR + scn.name
print obj
save_obj(obj)
def write_ui(filename):
for s in Window.GetScreenInfo():
Window.QHandle(s['id'])
EXPORT_APPLY_MODIFIERS = Draw.Create(1)
EXPORT_TRI = Draw.Create(0)
EXPORT_EDGES = Draw.Create(0)
EXPORT_NORMALS = Draw.Create(0)
EXPORT_UV = Draw.Create(1)
EXPORT_MTL = Draw.Create(1)
EXPORT_SEL_ONLY = Draw.Create(1)
EXPORT_ALL_SCENES = Draw.Create(0)
EXPORT_ANIMATION = Draw.Create(0)
EXPORT_COPY_IMAGES = Draw.Create(0)
EXPORT_BLEN_OBS = Draw.Create(1)
EXPORT_GROUP_BY_OB = Draw.Create(0)
EXPORT_GROUP_BY_MAT = Draw.Create(0)
# Get USER Options
pup_block = [\
('Mesh Options...'),\
('Apply Modifiers', EXPORT_APPLY_MODIFIERS, 'Use transformed mesh data from each object. May break vert order for morph targets.'),\
('Triangulate', EXPORT_TRI, 'Triangulate quads (Depends on "Apply Modifiers").'),\
('Edges', EXPORT_EDGES, 'Edges not connected to faces.'),\
('Normals', EXPORT_NORMALS, 'Export vertex normal data (Ignored on import).'),\
('UVs', EXPORT_UV, 'Export texface UV coords.'),\
('Materials', EXPORT_MTL, 'Write a seperate MTL file with the OBJ.'),\
('Context...'),\
('Selection Only', EXPORT_SEL_ONLY, 'Only export objects in visible selection. Else export whole scene.'),\
('All Scenes', EXPORT_ALL_SCENES, 'Each scene as a seperate OBJ file.'),\
('Animation', EXPORT_ANIMATION, 'Each frame as a numbered OBJ file.'),\
('Copy Images', EXPORT_COPY_IMAGES, 'Copy image files to the export directory, never overwrite.'),\
('Grouping...'),\
('Objects', EXPORT_BLEN_OBS, 'Export blender objects as OBJ objects.'),\
('Object Groups', EXPORT_GROUP_BY_OB, 'Export blender objects as OBJ groups.'),\
('Material Groups', EXPORT_GROUP_BY_MAT, 'Group by materials.'),\
]
if not Draw.PupBlock('Export...', pup_block):
return
Window.WaitCursor(1)
EXPORT_APPLY_MODIFIERS = EXPORT_APPLY_MODIFIERS.val
EXPORT_TRI = EXPORT_TRI.val
EXPORT_EDGES = EXPORT_EDGES.val
EXPORT_NORMALS = EXPORT_NORMALS.val
EXPORT_UV = EXPORT_UV.val
EXPORT_MTL = EXPORT_MTL.val
EXPORT_SEL_ONLY = EXPORT_SEL_ONLY.val
EXPORT_ALL_SCENES = EXPORT_ALL_SCENES.val
EXPORT_ANIMATION = EXPORT_ANIMATION.val
EXPORT_COPY_IMAGES = EXPORT_COPY_IMAGES.val
EXPORT_BLEN_OBS = EXPORT_BLEN_OBS.val
EXPORT_GROUP_BY_OB = EXPORT_GROUP_BY_OB.val
EXPORT_GROUP_BY_MAT = EXPORT_GROUP_BY_MAT.val
base_name, ext = splitExt(filename)
context_name = [base_name, '', '', ext] # basename, scene_name, framenumber, extension
# Use the options to export the data using write()
# def write(filename, objects, EXPORT_EDGES=False, EXPORT_NORMALS=False, EXPORT_MTL=True, EXPORT_COPY_IMAGES=False, EXPORT_APPLY_MODIFIERS=True):
orig_scene = Scene.GetCurrent()
if EXPORT_ALL_SCENES:
export_scenes = Scene.Get()
else:
export_scenes = [orig_scene]
# Export all scenes.
for scn in export_scenes:
scn.makeCurrent() # If alredy current, this is not slow.
context = scn.getRenderingContext()
orig_frame = Blender.Get('curframe')
if EXPORT_ALL_SCENES: # Add scene name into the context_name
context_name[1] = '_%s' % saneFilechars(scn.name) # WARNING, its possible that this could cause a collision. we could fix if were feeling parranoied.
# Export an animation?
if EXPORT_ANIMATION:
scene_frames = range(context.startFrame(), context.endFrame()+1) # up to and including the end frame.
else:
scene_frames = [orig_frame] # Dont export an animation.
# Loop through all frames in the scene and export.
for frame in scene_frames:
if EXPORT_ANIMATION: # Add frame to the filename.
context_name[2] = '_%.6d' % frame
Blender.Set('curframe', frame)
if EXPORT_SEL_ONLY:
export_objects = Blender.Object.GetSelected() # Export Context
else:
export_objects = scn.getChildren()
# EXPORT THE FILE.
write(''.join(context_name), export_objects,\
EXPORT_TRI, EXPORT_EDGES, EXPORT_NORMALS,\
EXPORT_UV, EXPORT_MTL, EXPORT_COPY_IMAGES,\
EXPORT_APPLY_MODIFIERS,\
EXPORT_BLEN_OBS, EXPORT_GROUP_BY_OB, EXPORT_GROUP_BY_MAT)
Blender.Set('curframe', orig_frame)
# Restore old active scene.
orig_scene.makeCurrent()
Window.WaitCursor(0)
if __name__ == '__main__':
Window.FileSelector(write_ui, 'Export Wavefront OBJ', sys.makename(ext='.obj'))
print "TOTAL EXPORT TIME: ", sys.time() - TIME
'''

@ -269,6 +269,8 @@ def comprehansiveImageLoad(imagePath, filePath):
break
return img
# No go.
print '\t\tImage Not Found "%s"' % imagePath
return None
@ -276,6 +278,22 @@ def comprehansiveImageLoad(imagePath, filePath):
#==================================================================================#
# This function sets textures defined in .mtl file #
@ -359,7 +377,9 @@ def load_mtl(dir, mtl_file, meshDict, materialDict):
l = fileLines[lIdx].split()
# Detect a line that will be ignored
if len(l) == 0 or l[0].startswith('#'):
if len(l) == 0:
pass
elif l[0] == '#' or len(l) == 0:
pass
elif l[0] == 'newmtl':
currentMat = getMat('_'.join(l[1:]), materialDict) # Material should alredy exist.
@ -408,27 +428,30 @@ def load_mtl(dir, mtl_file, meshDict, materialDict):
# Returns unique name of object/mesh (preserve overwriting existing meshes) #
#===========================================================================#
def getUniqueName(name):
newName = name[:19] # 19 chars is the longest name.
newName = name
uniqueInt = 0
while newName in getUniqueName.uniqueNames:
newName = '%s.%.3i' % (name[:15], uniqueInt)
while 1:
try:
ob = Object.Get(newName)
# Okay, this is working, so lets make a new name
newName = '%s.%d' % (name, uniqueInt)
uniqueInt +=1
getUniqueName.uniqueNames.append(newName)
except AttributeError:
if newName not in NMesh.GetNames():
return newName
getUniqueName.uniqueNames = []
else:
newName = '%s.%d' % (name, uniqueInt)
uniqueInt +=1
#==================================================================================#
# This loads data from .obj file #
#==================================================================================#
def load_obj(file, IMPORT_MTL=1, IMPORT_EDGES=1, IMPORT_SMOOTH_ALL=0):
def load_obj(file):
print '\nImporting OBJ file: "%s"' % file
time1 = sys.time()
getUniqueName.uniqueNames.extend( [ob.name for ob in Object.Get()] )
getUniqueName.uniqueNames.extend( NMesh.GetNames() )
# Deselect all objects in the scene.
# do this first so we dont have to bother, with objects we import
for ob in Scene.GetCurrent().getChildren():
@ -446,7 +469,7 @@ def load_obj(file, IMPORT_MTL=1, IMPORT_EDGES=1, IMPORT_SMOOTH_ALL=0):
tempFile = open(file, 'r')
fileLines = tempFile.readlines()
tempFile.close()
del tempFile
uvMapList = [] # store tuple uv pairs here
# This dummy vert makes life a whole lot easier-
@ -466,9 +489,6 @@ def load_obj(file, IMPORT_MTL=1, IMPORT_EDGES=1, IMPORT_SMOOTH_ALL=0):
currentMat = nullMat # Use this mat.
currentImg = None # Null image is a string, otherwise this should be set to an image object.\
if IMPORT_SMOOTH_ALL:
currentSmooth = True
else:
currentSmooth = False
# Store a list of unnamed names
@ -483,36 +503,63 @@ def load_obj(file, IMPORT_MTL=1, IMPORT_EDGES=1, IMPORT_SMOOTH_ALL=0):
#==================================================================================#
# Load all verts first (texture verts too) #
#==================================================================================#
nonVertFileLines = []
smoothingGroups = {}
materialDict = {} # Store all imported materials as unique dict, names are key
lIdx = 0
print '\tfile length: %d' % len(fileLines)
# Ignore normals and comments.
fileLines = [lsplit for l in fileLines if not l.startswith('vn') if not l.startswith('#') for lsplit in (l.split(),) if lsplit]
Vert = NMesh.Vert
vertList = [Vert(float(l[1]), float(l[2]), float(l[3]) ) for l in fileLines if l[0] == 'v']
uvMapList = [(float(l[1]), float(l[2])) for l in fileLines if l[0] == 'vt']
smoothingGroups = dict([('_'.join(l[1:]), None) for l in fileLines if l[0] == 's' ])
materialDict = dict([('_'.join(l[1:]), None) for l in fileLines if l[0] == 'usemtl']) # Store all imported materials as unique dict, names are key
print '\tvert:%i texverts:%i smoothgroups:%i materials:%s' % (len(vertList), len(uvMapList), len(smoothingGroups), len(materialDict))
while lIdx < len(fileLines):
# Ignore vert normals
if fileLines[lIdx].startswith('vn'):
lIdx+=1
continue
# Replace filelines, Excluding v excludes "v ", "vn " and "vt "
# Dont Bother splitting empty or comment lines.
if len(fileLines[lIdx]) == 0 or\
fileLines[lIdx][0] == '\n' or\
fileLines[lIdx][0] == '#':
pass
# Remove any variables we may have created.
try: del _dummy
except: pass
try: del _x
except: pass
try: del _y
except: pass
try: del _z
except: pass
try: del lsplit
except: pass
del Vert
else:
fileLines[lIdx] = fileLines[lIdx].split()
l = fileLines[lIdx]
# With negative values this is used a lot. make faster access.
len_uvMapList = len(uvMapList)
len_vertList = len(vertList)
# Splitting may
if len(l) == 0:
pass
# Verts
elif l[0] == 'v':
vertList.append( NMesh.Vert(float(l[1]), float(l[2]), float(l[3]) ) )
# UV COORDINATE
elif l[0] == 'vt':
uvMapList.append( (float(l[1]), float(l[2])) )
# Smoothing groups, make a list of unique.
elif l[0] == 's':
if len(l) > 1:
smoothingGroups['_'.join(l[1:])] = None # Can we assign something more usefull? cant use sets yet
# Keep Smoothing group line
nonVertFileLines.append(l)
# Smoothing groups, make a list of unique.
elif l[0] == 'usemtl':
if len(l) > 1:
materialDict['_'.join(l[1:])] = None # Can we assign something more usefull? cant use sets yet
# Keep Smoothing group line
nonVertFileLines.append(l)
else:
nonVertFileLines.append(l)
lIdx+=1
del fileLines
fileLines = nonVertFileLines
del nonVertFileLines
# Only want unique keys anyway
smoothingGroups['(null)'] = None # Make sure we have at least 1.
@ -525,7 +572,7 @@ def load_obj(file, IMPORT_MTL=1, IMPORT_EDGES=1, IMPORT_SMOOTH_ALL=0):
# Make a list of all unused vert indicies that we can copy from
VERT_USED_LIST = [0]*len_vertList
VERT_USED_LIST = [0]*len(vertList)
# Here we store a boolean list of which verts are used or not
# no we know weather to add them to the current mesh
@ -537,9 +584,9 @@ def load_obj(file, IMPORT_MTL=1, IMPORT_EDGES=1, IMPORT_SMOOTH_ALL=0):
# We ignore it when naming the object.
currentObjectName = 'unnamed_obj_0' # If we cant get one, use this
#meshDict = {} # The 3 variables below are stored in a tuple within this dict for each mesh
meshDict = {} # The 3 variables below are stored in a tuple within this dict for each mesh
currentMesh = NMesh.GetRaw() # The NMesh representation of the OBJ group/Object
#currentUsedVertList = {} # A Dict of smooth groups, each smooth group has a list of used verts and they are generated on demand so as to save memory.
currentUsedVertList = {} # A Dict of smooth groups, each smooth group has a list of used verts and they are generated on demand so as to save memory.
currentMaterialMeshMapping = {} # Used to store material indicies so we dont have to search the mesh for materials every time.
# Every mesh has a null smooth group, this is used if there are no smooth groups in the OBJ file.
@ -548,13 +595,14 @@ def load_obj(file, IMPORT_MTL=1, IMPORT_EDGES=1, IMPORT_SMOOTH_ALL=0):
# For direct accsess to the Current Meshes, Current Smooth Groups- Used verts.
# This is of course context based and changes on the fly.
# Set the initial '(null)' Smooth group, every mesh has one.
currentUsedVertListSmoothGroup = VERT_USED_LIST[:]
currentUsedVertList= {currentSmoothGroup: currentUsedVertListSmoothGroup }
# Set the initial '(null)' Smooth group, every mesh has one.
currentUsedVertList[currentSmoothGroup] = currentUsedVertListSmoothGroup
# 0:NMesh, 1:SmoothGroups[UsedVerts[0,0,0,0]], 2:materialMapping['matname':matIndexForThisNMesh]
meshDict = {currentObjectName: (currentMesh, currentUsedVertList, currentMaterialMeshMapping) }
meshDict[currentObjectName] = (currentMesh, currentUsedVertList, currentMaterialMeshMapping)
# Only show the bad uv error once
badObjUvs = 0
@ -563,23 +611,20 @@ def load_obj(file, IMPORT_MTL=1, IMPORT_EDGES=1, IMPORT_SMOOTH_ALL=0):
#currentMesh.verts.append(vertList[0]) # So we can sync with OBJ indicies where 1 is the first item.
if len_uvMapList > 1:
if len(uvMapList) > 1:
currentMesh.hasFaceUV(1) # Turn UV's on if we have ANY texture coords in this obj file.
#==================================================================================#
# Load all faces into objects, main loop #
#==================================================================================#
#lIdx = 0
lIdx = 0
# Face and Object loading LOOP
#while lIdx < len(fileLines):
# l = fileLines[lIdx]
#for lIdx
for l in fileLines:
if len(l) == 0:
continue
while lIdx < len(fileLines):
l = fileLines[lIdx]
# FACE
elif l[0] == 'f':
if l[0] == 'f':
# Make a face with the correct material.
# Add material to mesh
@ -601,19 +646,15 @@ def load_obj(file, IMPORT_MTL=1, IMPORT_EDGES=1, IMPORT_SMOOTH_ALL=0):
vtIdxLs = []
fHasUV = len_uvMapList # Assume the face has a UV until it sho it dosent, if there are no UV coords then this will start as 0.
fHasUV = len(uvMapList) # Assume the face has a UV until it sho it dosent, if there are no UV coords then this will start as 0.
for v in l[1:]:
# OBJ files can have // or / to seperate vert/texVert/normal
# this is a bit of a pain but we must deal with it.
objVert = v.split('/')
# Vert Index - OBJ supports negative index assignment (like python)
index = int(objVert[0])-1
# Account for negative indicies.
if index < 0:
index = len_vertList+index+1
vIdxLs.append(index)
vIdxLs.append(int(objVert[0])-1)
if fHasUV:
# UV
index = 0 # Dummy var
@ -621,17 +662,15 @@ def load_obj(file, IMPORT_MTL=1, IMPORT_EDGES=1, IMPORT_SMOOTH_ALL=0):
index = vIdxLs[-1]
elif objVert[1]: # != '' # Its possible that theres no texture vert just he vert and normal eg 1//2
index = int(objVert[1])-1
if index < 0:
index = len_uvMapList+index+1
if len_uvMapList > index:
if len(uvMapList) > index:
vtIdxLs.append(index) # Seperate UV coords
else:
# BAD FILE, I have found this so I account for it.
# INVALID UV COORD
# Could ignore this- only happens with 1 in 1000 files.
badObjFaceTexCo +=1
vtIdxLs.append(1)
vtIdxLs.append(0)
fHasUV = 0
@ -639,26 +678,12 @@ def load_obj(file, IMPORT_MTL=1, IMPORT_EDGES=1, IMPORT_SMOOTH_ALL=0):
# The OBJ file would have to be corrupt or badly written for thi to happen
# but account for it anyway.
if len(vtIdxLs) > 0:
if vtIdxLs[-1] > len_uvMapList:
if vtIdxLs[-1] > len(uvMapList):
fHasUV = 0
badObjUvs +=1 # ERROR, Cont
# Quads only, we could import quads using the method below but it polite to import a quad as a quad.
#print lIdx, len(vIdxLs), len(currentUsedVertListSmoothGroup)
#print fileLines[lIdx]
if len(vIdxLs) == 2:
if IMPORT_EDGES:
# Edge
for i in (0,1):
if currentUsedVertListSmoothGroup[vIdxLs[i]] == 0:
faceQuadVList[i] = vertList[vIdxLs[i]]
currentMesh.verts.append(faceQuadVList[i])
currentUsedVertListSmoothGroup[vIdxLs[i]] = len(currentMesh.verts)-1
else:
faceQuadVList[i] = currentMesh.verts[currentUsedVertListSmoothGroup[vIdxLs[i]]]
currentMesh.addEdge(faceQuadVList[0], faceQuadVList[1])
elif len(vIdxLs) == 4:
if len(vIdxLs) == 4:
# Have found some files where wach face references the same vert
# - This causes a bug and stopts the import so lets check here
@ -726,19 +751,21 @@ def load_obj(file, IMPORT_MTL=1, IMPORT_EDGES=1, IMPORT_SMOOTH_ALL=0):
if len(l) == 1:
currentSmooth = True
currentSmoothGroup = '(null)'
else:
if l[1] == 'off': # We all have a null group so dont need to try, will try anyway to avoid code duplication.
if not IMPORT_SMOOTH_ALL:
currentSmooth = False
currentSmoothGroup = '(null)'
else:
currentSmooth = True
currentSmoothGroup = '_'.join(l[1:])
try:
currentUsedVertListSmoothGroup = currentUsedVertList[currentSmoothGroup]
except KeyError:
currentUsedVertList[currentSmoothGroup] = currentUsedVertListSmoothGroup = VERT_USED_LIST[:]
currentUsedVertListSmoothGroup = VERT_USED_LIST[:]
currentUsedVertList[currentSmoothGroup] = currentUsedVertListSmoothGroup
else:
if l[1] == 'off':
currentSmooth = False
currentSmoothGroup = '(null)'
# We all have a null group so dont need to try
currentUsedVertListSmoothGroup = currentUsedVertList['(null)']
else:
currentSmooth = True
currentSmoothGroup = '_'.join(l[1:])
# OBJECT / GROUP
elif l[0] == 'o' or l[0] == 'g':
@ -756,10 +783,10 @@ def load_obj(file, IMPORT_MTL=1, IMPORT_EDGES=1, IMPORT_SMOOTH_ALL=0):
else: # No name given
# Make a new empty name
if l[0] == 'g': # Make a blank group name
currentObjectName = 'unnamed_grp_%.4d' % currentUnnamedGroupIdx
currentObjectName = 'unnamed_grp_%d' % currentUnnamedGroupIdx
currentUnnamedGroupIdx +=1
else: # is an object.
currentObjectName = 'unnamed_ob_%.4d' % currentUnnamedObjectIdx
currentObjectName = 'unnamed_ob_%d' % currentUnnamedObjectIdx
currentUnnamedObjectIdx +=1
@ -774,10 +801,11 @@ def load_obj(file, IMPORT_MTL=1, IMPORT_EDGES=1, IMPORT_SMOOTH_ALL=0):
currentUsedVertList = {}
# Sg is a string
########currentSmoothGroup = '(null)' # From examplesm changing the g/o shouldent change the smooth group.
currentUsedVertList[currentSmoothGroup] = currentUsedVertListSmoothGroup = VERT_USED_LIST[:]
currentSmoothGroup = '(null)'
currentUsedVertListSmoothGroup = VERT_USED_LIST[:]
currentUsedVertList[currentSmoothGroup] = currentUsedVertListSmoothGroup
currentMaterialMeshMapping = {}
meshDict[currentObjectName] = (currentMesh, currentUsedVertList, currentMaterialMeshMapping)
currentMesh.hasFaceUV(1)
contextMeshMatIdx = -1
@ -794,13 +822,8 @@ def load_obj(file, IMPORT_MTL=1, IMPORT_EDGES=1, IMPORT_SMOOTH_ALL=0):
contextMeshMatIdx -1
# For new meshes switch smoothing groups to null
########currentSmoothGroup = '(null)' # From examplesm changing the g/o shouldent change the smooth group.
try:
currentSmoothGroup = '(null)'
currentUsedVertListSmoothGroup = currentUsedVertList[currentSmoothGroup]
except:
currentUsedVertList[currentSmoothGroup] = currentUsedVertListSmoothGroup = VERT_USED_LIST[:]
# MATERIAL
elif l[0] == 'usemtl':
@ -836,10 +859,9 @@ def load_obj(file, IMPORT_MTL=1, IMPORT_EDGES=1, IMPORT_SMOOTH_ALL=0):
# MATERIAL FILE
elif l[0] == 'mtllib':
mtl_fileName.append(' '.join(l[1:]) ) # SHOULD SUPPORT MULTIPLE MTL?
#lIdx+=1
lIdx+=1
# Applies material properties to materials alredy on the mesh as well as Textures.
if IMPORT_MTL:
for mtl in mtl_fileName:
load_mtl(DIR, mtl, meshDict, materialDict)
@ -873,77 +895,44 @@ def load_obj(file, IMPORT_MTL=1, IMPORT_EDGES=1, IMPORT_SMOOTH_ALL=0):
print "obj import time: ", sys.time() - time1
def load_obj_ui(file):
# Batch directory loading.
def load_obj_dir(obj_dir):
IMPORT_MTL = Draw.Create(1)
IMPORT_DIR = Draw.Create(0)
IMPORT_NEW_SCENE = Draw.Create(0)
IMPORT_EDGES = Draw.Create(1)
IMPORT_SMOOTH_ALL = Draw.Create(0)
# Get USER Options
pup_block = [\
('Material (*.mtl)', IMPORT_MTL, 'Imports material settings and images from the obj\'s .mtl file'),\
('All *.obj\'s in dir', IMPORT_DIR, 'Import all obj files in this dir (avoid overlapping data with "Create scene")'),\
('Create scene', IMPORT_NEW_SCENE, 'Imports each obj into its own scene, named from the file'),\
'Geometry...',\
('Edges', IMPORT_EDGES, 'Import faces with 2 verts as in edge'),\
('Smooths all faces', IMPORT_SMOOTH_ALL, 'Smooth all faces even if they are not in a smoothing group'),\
]
if not os:
pup_block.pop(1) # Make sure this is the IMPORT_DIR option that requires OS
if not Draw.PupBlock('Import...', pup_block):
return
Window.WaitCursor(1)
Window.DrawProgressBar(0, '')
# Strip file
obj_dir = stripFile(obj_dir)
time = sys.time()
IMPORT_MTL = IMPORT_MTL.val
IMPORT_DIR = IMPORT_DIR.val
IMPORT_NEW_SCENE = IMPORT_NEW_SCENE.val
IMPORT_EDGES = IMPORT_EDGES.val
IMPORT_SMOOTH_ALL = IMPORT_SMOOTH_ALL.val
objFiles = [f for f in os.listdir(obj_dir) if f.lower().endswith('obj')]
#orig_scene = Scene.GetCurrent()
obj_dir = stripFile(file)
if IMPORT_DIR:
obj_files = [(obj_dir,f) for f in os.listdir(obj_dir) if f.lower().endswith('obj')]
else:
obj_files = [(obj_dir,stripPath(file))]
obj_len = len(obj_files)
Window.DrawProgressBar(0, '')
count = 0
for d, f in obj_files:
obj_len = len(objFiles)
for obj in objFiles:
count+=1
if not sys.exists(d+f):
print 'Error: "%s%s" does not exist' % (d,f)
else:
if IMPORT_NEW_SCENE:
scn = Scene.New('.'.join(f.split('.')[0:-1]))
scn.makeCurrent()
newScn = Scene.New(obj)
newScn.makeCurrent()
Window.DrawProgressBar((float(count)/obj_len) - 0.01, '%s: %i of %i' % (f, count, obj_len))
load_obj(d+f, IMPORT_MTL, IMPORT_EDGES, IMPORT_SMOOTH_ALL)
Window.DrawProgressBar((float(count)/obj_len) - 0.01, '%s: %i of %i' % (obj, count, obj_len))
load_obj(obj_dir + obj)
#orig_scene.makeCurrent() # We can leave them in there new scene.
Window.DrawProgressBar(1, '')
Window.WaitCursor(0)
if count > 1:
print 'Total obj import "%s" dir: %.2f' % (obj_dir, sys.time() - time)
def main():
Window.FileSelector(load_obj_ui, 'Import a Wavefront OBJ')
TEXT_IMPORT = 'Import a Wavefront OBJ'
TEXT_BATCH_IMPORT = 'Import *.obj to Scenes'
if Window.GetKeyQualifiers() & Window.Qual.SHIFT:
if not os:
Draw.PupMenu('Module "os" not found, needed for batch load, using normal selector.')
Window.FileSelector(load_obj, TEXT_IMPORT)
else:
Window.FileSelector(load_obj_dir, TEXT_BATCH_IMPORT)
else:
Window.FileSelector(load_obj, TEXT_IMPORT)
if __name__ == '__main__':
main()

@ -28,34 +28,17 @@ Notes:<br>
Only exports a single selected mesh.
"""
# $Id:
#
# +---------------------------------------------------------+
# | Copyright (c) 2002 Anthony D'Agostino |
# | http://www.redrival.com/scorpius |
# | scorpius@netzero.com |
# | February 3, 2001 |
# | Released under the Blender Artistic Licence (BAL) |
# | Import Export Suite v0.5 |
# +---------------------------------------------------------+
# | Read and write Object File Format (*.off) |
# +---------------------------------------------------------+
# ***** 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.
#
# ***** END GPL LICENCE BLOCK *****
import Blender, meshtools
#import time

@ -29,34 +29,18 @@ Notes:<br>
UV Coordinate support has been added.
"""
# $Id:
#
# +---------------------------------------------------------+
# | Copyright (c) 2002 Anthony D'Agostino |
# | http://www.redrival.com/scorpius |
# | scorpius@netzero.com |
# | February 3, 2001 |
# | Released under the Blender Artistic Licence (BAL) |
# | Import Export Suite v0.5 |
# +---------------------------------------------------------+
# | Read and write Object File Format (*.off) |
# +---------------------------------------------------------+
# ***** 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.
#
# ***** END GPL LICENCE BLOCK *****
import Blender, meshtools
#import time

@ -46,27 +46,12 @@ specular highlights to the vertex colors.
# | http://www.redrival.com/scorpius |
# | scorpius@netzero.com |
# | April 11, 2002 |
# | Released under the Blender Artistic Licence (BAL) |
# | Import Export Suite v0.5 |
# +---------------------------------------------------------+
# | Read and write Radiosity File Format (*.radio) |
# +---------------------------------------------------------+
# ***** 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.
#
# ***** END GPL LICENCE BLOCK *****
import Blender, meshtools
#import time

@ -31,27 +31,12 @@ file to open.
# | http://www.redrival.com/scorpius |
# | scorpius@netzero.com |
# | April 11, 2002 |
# | Released under the Blender Artistic Licence (BAL) |
# | Import Export Suite v0.5 |
# +---------------------------------------------------------+
# | Read and write Radiosity File Format (*.radio) |
# +---------------------------------------------------------+
# ***** 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.
#
# ***** END GPL LICENCE BLOCK *****
import Blender, meshtools
#import time

@ -25,6 +25,7 @@ Usage:<br>
Select meshes to be exported and run this script from "File->Export" menu.
"""
# $Id$
#
# +---------------------------------------------------------+
@ -32,27 +33,12 @@ Usage:<br>
# | http://www.redrival.com/scorpius |
# | scorpius@netzero.com |
# | April 28, 2002 |
# | Released under the Blender Artistic Licence (BAL) |
# | Import Export Suite v0.5 |
# +---------------------------------------------------------+
# | Read and write RAW Triangle File Format (*.raw) |
# +---------------------------------------------------------+
# ***** 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.
#
# ***** END GPL LICENCE BLOCK *****
import Blender, meshtools
import sys
#import time

@ -38,27 +38,12 @@ tolerance.
# | http://www.redrival.com/scorpius |
# | scorpius@netzero.com |
# | April 28, 2002 |
# | Released under the Blender Artistic Licence (BAL) |
# | Import Export Suite v0.5 |
# +---------------------------------------------------------+
# | Read and write RAW Triangle File Format (*.raw) |
# +---------------------------------------------------------+
# ***** 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.
#
# ***** END GPL LICENCE BLOCK *****
import Blender, meshtools
#import time

@ -2,14 +2,14 @@
"""
Name: 'Save Current Theme...'
Blender: 240
Blender: 237
Group: 'Export'
Tooltip: 'Save current theme as a BPython script'
Tooltip: 'Save current theme as a bpython script'
"""
__author__ = "Willian P. Germano"
__url__ = ("blender", "elysiun")
__version__ = "2.41 2006/01/16"
__version__ = "2.37 2005/06/06"
__bpydoc__ = """\
This script saves the current Theme in Blender as a Blender Python script.
@ -39,32 +39,15 @@ some information on it before sharing it with others.
# $Id$
#
# --------------------------------------------------------------------------
# Copyright (C) 2004: Willian P. Germano, wgermano _at_ ig com br
# Copyright (C) 2004: Willian P. Germano, wgermano _at_ ig.com.br
# --------------------------------------------------------------------------
# Released under the Blender Artistic License (BAL):
# http://download.blender.org/documentation/html/x21254.html
#
# The scripts generated by this script are put under Public Domain by
# default, but you are free to edit the ones you generate with this script
# and change their license to another one of your choice.
# --------------------------------------------------------------------------
# ***** BEGIN GPL LICENSE BLOCK *****
#
# Copyright (C) 2005: Willian P. Germano, wgermano _at_ ig.com.br
#
# 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 *****
# --------------------------------------------------------------------------
import Blender
from Blender.Window import Theme, FileSelector
@ -87,13 +70,13 @@ def write_theme(filename):
# \"\"\"
# Name: '%s'
# Blender: 241
# Blender: 237
# Group: 'Themes'
# Tooltip: 'Change current theme'
# \"\"\"
__%s__ = "????"
__%s__ = "2.41"
__%s__ = "2.37"
__%s__ = ["blender"]
__%s__ = \"\"\"\\
You can edit this section to write something about your script that can

@ -483,9 +483,7 @@ def main():
if choice == 1 and len(edgeOrderedList) > 2: # Loop
skin2EdgeLoops(edgeOrderedList[0], edgeOrderedList[-1], me, ob, 0)
print '\nArray done in %.4f sec.' % (sys.time()-time1)
me.update(1, 1, 0)
if is_editmode: Window.EditMode(1)
if __name__ == '__main__':
main()

@ -36,27 +36,12 @@ tolerance.
# | http://www.redrival.com/scorpius |
# | scorpius@netzero.com |
# | May 3, 2004 |
# | Released under the Blender Artistic Licence (BAL) |
# | Import Export Suite v0.5 |
# +---------------------------------------------------------+
# | Read and write SLP Triangle File Format (*.slp) |
# +---------------------------------------------------------+
# ***** 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.
#
# ***** END GPL LICENCE BLOCK *****
import Blender, meshtools
#import time

@ -2,7 +2,7 @@
""" Registration info for Blender menus:
Name: 'Texture Baker'
Blender: 239
Blender: 236
Group: 'UV'
Tooltip: 'Procedural to uvmapped texture baker'
"""
@ -11,7 +11,7 @@ __author__ = "Jean-Michel Soler (jms)"
__url__ = ("blender", "elysiun",
"Official Page, http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_mesh3d2uv2d_en.htm",
"Communicate problems and errors, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender")
__version__ = "0.3.2 2005/12/28"
__version__ = "0.3.1 2005/10/21"
__bpydoc__ = """\
This script "bakes" Blender procedural materials (including textures): it saves
@ -49,10 +49,6 @@ Notes:<br>
#
# Released under Blender Artistic Licence
#
# 0.3.2
# blender 2.40 update to deal with the new shape
# key system .
#
# 0.3.1
# stupid bug correction
#
@ -437,85 +433,6 @@ def REST_Shadeless(SHADEDict):
# release : 0.2.6 , 2005/05/29 , end
#-----------------------------------
#-----------------------------------
# release : 0.3.2 , 2005/12/28 , 13h00
#-----------------------------------
def Blender240update(MESH2,FRAME):
"""
# ---------------------------
# Function Blender240update
#
# IN : MESH2 a mesh data bloc
# FRAME , the animation frame limit
#
# ADD : an ipo curve to the shape key
# named "Key 1"
#
# OUT : nothing
# ---------------------------
"""
# ---------------------------
# recuperation des clef de morphing pour ce mesh
# ---------------------------
key = MESH2.getKey()
# ---------------------------
# recuperation de l'Ipo
# ---------------------------
ipo = key.ipo
# ---------------------------
# si l'ipo n'existe pas on la cree
# ---------------------------
if ipo == None:
noipo = Blender.Ipo.New("Key","keyipo")
key.ipo = noipo
# ---------------------------
# raccourci de l'expression
# ---------------------------
ipo = key.ipo
# ---------------------------
# identification de la clef de morphing
# ---------------------------
keyidentity = "Key 1"
# ---------------------------
# recuperation de la courbe correspondante
# c'est toujours la courbe 0
# ---------------------------
ipocurve = ipo.getCurve(0)
# ---------------------------
# si la courbe n'existe pas (normalement, elle n'existe pas mais
# on gère le risque pour faciliter une eventuelle récupération de
# cette fonction dans un autre script ou pour les cas , certe peu
# probable, ou blender viendrait a etre modifie pour les ajouter
# automatiquement ) on la cree ...
# ---------------------------
if ipocurve == None:
ipocurve = ipo.addCurve(keyidentity)
# ---------------------------
# On applique l'attribut d'inetrpolation qui permet d'avoir
# une ligne droite
# ---------------------------
ipocurve.setInterpolation("Linear")
# ---------------------------
# On retire tous les sommets qui pourraient se trouver sur la
# courbe (dans l'état actuel, cette opération est une sécurité
# superflue ) .
# ---------------------------
while len(ipocurve.getPoints()) > 0:
ipocurve.delBezier(0)
ipocurve.recalc()
# ---------------------------
# On ajouter les sommets necessaires ...
# ---------------------------
ipocurve.addBezier((-1,1))
# ---------------------------
# ... ce dernire n'est peut-être pas absolument obligatoire .
# ---------------------------
ipocurve.addBezier((FRAME+1,1))
#-----------------------------------
# release : 0.3.2 , 2005/12/28 , end
#-----------------------------------
def Mesh2UVCoord (LIMIT):
"""
# ---------------------------
@ -538,7 +455,6 @@ def Mesh2UVCoord (LIMIT):
except:
NewOBJECT, CurSCENE = GET_newobject('Mesh','UVOBJECT')
MESH2 = NewOBJECT.getData()
MESH2.edges=[]
NewOBJECT.layers=[RENDERLAYER]
MESH2.faces=[]
@ -569,6 +485,7 @@ def Mesh2UVCoord (LIMIT):
NewOBJECT.setLocation (OBJPOS, OBJPOS, 0.0)
NewOBJECT.setEuler (0.0, 0.0, 0.0)
MESH2.removeAllKeys()
MESH2.update()
@ -589,14 +506,6 @@ def Mesh2UVCoord (LIMIT):
MESH2.insertKey (FRAME, 'absolute')
MESH2.update()
#-----------------------------------
# release : 0.3.2 , 2005/12/28 , 13h00
#-----------------------------------
Blender240update(MESH2,FRAME)
#-----------------------------------
# release : 0.3.2 , 2005/12/28 , end
#-----------------------------------
imagename = 'uvtext'
name = "CHANGE IMAGE NAME ? %t | Replace it | No replace | Script help"

@ -49,6 +49,7 @@ For Cameras: The matrix here gets a little confusing, and I'm not sure of
how to handle it.
"""
# $Id$
#
# +---------------------------------------------------------+
@ -56,27 +57,12 @@ how to handle it.
# | http://www.redrival.com/scorpius |
# | scorpius@netzero.com |
# | June 12, 2001 |
# | Released under the Blender Artistic Licence (BAL) |
# | Import Export Suite v0.5 |
# +---------------------------------------------------------+
# | Read and write Caligari trueSpace File Format (*.cob) |
# +---------------------------------------------------------+
# ***** 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.
#
# ***** END GPL LICENCE BLOCK *****
import Blender, meshtools
import struct, os, cStringIO, time

@ -62,27 +62,12 @@ how to handle it.
# | http://www.redrival.com/scorpius |
# | scorpius@netzero.com |
# | June 12, 2001 |
# | Released under the Blender Artistic Licence (BAL) |
# | Import Export Suite v0.5 |
# +---------------------------------------------------------+
# | Read and write Caligari trueSpace File Format (*.cob) |
# +---------------------------------------------------------+
# ***** 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.
#
# ***** END GPL LICENCE BLOCK *****
import Blender, meshtools
import struct, chunk, os, cStringIO, time

@ -9,7 +9,7 @@ Tooltip: 'Export the UV face layout of the selected object to a .TGA file'
__author__ = "Martin 'theeth' Poirier"
__url__ = ("http://www.blender.org", "http://www.elysiun.com")
__version__ = "1.4"
__version__ = "1.3a"
__bpydoc__ = """\
This script exports the UV face layout of the selected mesh object to
@ -26,9 +26,8 @@ There are more options to configure, like setting export path, if image should
use object's name and more.
Notes:<br>
Jean-Michel Soler (jms) wrote TGA functions used by this script.<br>
Zaz added the default path code and Selected Face option.<br>
Macouno fixed a rounding error in the step calculations<br>
Jean-Michel Soler (jms) wrote TGA functions used by this script.
Zaz added the default path code and Selected Face option.
"""
@ -76,9 +75,6 @@ Notes:<br>
# Version 1.3a
# Corrected a minor typo and added the tga extension to both export call
# --------------------------
# Version 1.4 Updates by Macouno from Elysiun.com
# Fixed rounding error that can cause breaks in lines.
# --------------------------
import Blender
from math import *
@ -242,12 +238,11 @@ def UV_Export(size, wsize, file):
co2 = f[index + 1]
else:
co2 = f[0]
step = int(ceil(size*sqrt((co1[0]-co2[0])**2+(co1[1]-co2[1])**2)))
step = int(size*sqrt((co1[0]-co2[0])**2+(co1[1]-co2[1])**2))
if step:
for t in range(step):
x = int(floor((co1[0] + t*(co2[0]-co1[0])/step) * size))
y = int(floor((co1[1] + t*(co2[1]-co1[1])/step) * size))
for t in range(step + 1):
x = int((co1[0] + t*(co2[0]-co1[0])/step) * size)
y = int((co1[1] + t*(co2[1]-co1[1])/step) * size)
if bWrap.val:
x = x % wrapSize
@ -256,17 +251,16 @@ def UV_Export(size, wsize, file):
x = int ((x - minx) * scale)
y = int ((y - miny) * scale)
co = x * 3 + y * 3 * size;
co = x * 3 + y * 3 * size
img[co] = 0
img[co+1] = 0
img[co+2] = 0
img[co+2] = 255
if wsize > 1:
for x in range(-1*wsize + 1,wsize):
for y in range(-1*wsize,wsize):
img[co + 3 * x + y * 3 * size] = 0
img[co + 3 * x + y * 3 * size +1] = 0
img[co + 3 * x + y * 3 * size +2] = 0
img[co + 3 * x + y * 3 * size +2] = 255
for v in f:
x = int(v[0] * size)
@ -282,7 +276,8 @@ def UV_Export(size, wsize, file):
co = x * 3 + y * 3 * size
img[co] = 0
img[co+1] = 0
img[co+2] = 255
img[co+2] = 0
write_tgafile(file,img,size,size,3)

@ -43,6 +43,7 @@ specular highlights to the vertex colors.
5. The Videoscape format also allows vertex colors to be specified.
"""
# $Id$
#
# +---------------------------------------------------------+
@ -50,27 +51,12 @@ specular highlights to the vertex colors.
# | http://www.redrival.com/scorpius |
# | scorpius@netzero.com |
# | June 5, 2001 |
# | Released under the Blender Artistic Licence (BAL) |
# | Import Export Suite v0.5 |
# +---------------------------------------------------------+
# | Write Videoscape File Format (*.obj NOT WAVEFRONT OBJ) |
# +---------------------------------------------------------+
# ***** 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.
#
# ***** END GPL LICENCE BLOCK *****
import Blender, meshtools
#import time

@ -4,7 +4,6 @@ Name: 'VRML97 (.wrl)...'
Blender: 235
Group: 'Export'
Submenu: 'All Objects...' all
Submenu: 'All Objects compressed...' comp
Submenu: 'Selected Objects...' selected
Tooltip: 'Export to VRML97 file (.wrl)'
"""
@ -13,8 +12,8 @@ __author__ = ("Rick Kimball", "Ken Miller", "Steve Matthews", "Bart")
__url__ = ["blender", "elysiun",
"Author's (Rick) homepage, http://kimballsoftware.com/blender",
"Author's (Bart) homepage, http://www.neeneenee.de/vrml"]
__email__ = ["Bart, bart:neeneenee*de"]
__version__ = "2006/01/17"
__version__ = "2005/06/03"
__bpydoc__ = """\
This script exports to VRML97 format.
@ -38,6 +37,8 @@ for each texture);<br>
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
# Copyright (C) 2003,2004: Rick Kimball rick@vrmlworld.net
#
# 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
@ -60,7 +61,7 @@ for each texture);<br>
####################################
import Blender
from Blender import Object, NMesh, Lamp, Draw, BGL, Image, Text, sys, Mathutils
from Blender import Object, NMesh, Lamp, Draw, BGL, Image, Text
from Blender.Scene import Render
try:
from os.path import exists, join
@ -79,9 +80,15 @@ world = Blender.World.Get()
worldmat = Blender.Texture.Get()
filename = Blender.Get('filename')
_safeOverwrite = True
extension = ''
radD=math.pi/180.0
ARG=''
def rad2deg(v):
return round(v*180.0/math.pi,4)
def deg2rad(v):
return (v*math.pi)/180.0;
class DrawTypes:
"""Object DrawTypes enum values
BOUNDS - draw only the bounding box of the object
@ -154,12 +161,11 @@ class VRML2Export:
##########################################################
def writeHeader(self):
bfile = sys.expandpath(Blender.Get('filename'))
self.file.write("#VRML V2.0 utf8\n\n")
self.file.write("# This file was authored with Blender (http://www.blender.org/)\n")
self.file.write("# Blender version %s\n" % Blender.Get('version'))
self.file.write("# Blender file %s\n" % sys.basename(bfile))
self.file.write("# Exported using VRML97 exporter v1.55 (2006/01/17)\n\n")
self.file.write("# Blender file %s\n" % filename)
self.file.write("# Exported using VRML97 exporter v1.50 (2005/06/03)\n\n")
def writeInline(self):
inlines = Blender.Scene.Get()
@ -199,8 +205,9 @@ class VRML2Export:
def writeViewpoint(self, thisObj):
context = scene.getRenderingContext()
ratio = float(context.imageSizeY())/float(context.imageSizeX())
lens = (360* (math.atan(ratio *16 / thisObj.data.getLens()) / math.pi))*(math.pi/180)
lens = min(lens, math.pi)
lens = (360* (math.atan(ratio *16 / thisObj.data.getLens()) / 3.141593))*(3.141593/180)
if lens > 3.14:
lens = 3.14
# get the camera location, subtract 90 degress from X to orient like VRML does
loc = self.rotatePointForVRML(thisObj.loc)
rot = [thisObj.RotX - 1.57, thisObj.RotY, thisObj.RotZ]
@ -264,8 +271,8 @@ class VRML2Export:
ambientIntensity = 0
# compute cutoff and beamwidth
intensity=min(lamp.energy/1.75,1.0)
beamWidth=((lamp.spotSize*math.pi)/180.0)*.37;
intensity=min(lamp.energy/1.5,1.0)
beamWidth=deg2rad(lamp.spotSize)*.37;
cutOffAngle=beamWidth*1.3
(dx,dy,dz)=self.computeDirection(object)
@ -296,7 +303,7 @@ class VRML2Export:
ambi = 0
ambientIntensity = 0
intensity=min(lamp.energy/1.75,1.0)
intensity=min(lamp.energy/1.5, 1.0)
(dx,dy,dz)=self.computeDirection(object)
self.writeIndented("DEF %s DirectionalLight {\n" % self.cleanStr(object.name),1)
self.writeIndented("ambientIntensity %s\n" % (round(ambientIntensity,self.cp)))
@ -315,7 +322,7 @@ class VRML2Export:
ambientIntensity = 0
om = object.getMatrix()
location=self.rotVertex(om, (0,0,0));
intensity=min(lamp.energy/1.75,1.0)
intensity=min(lamp.energy/1.5,1.0)
radius = lamp.dist
self.writeIndented("DEF %s PointLight {\n" % self.cleanStr(object.name),1)
self.writeIndented("ambientIntensity %s\n" % (round(ambientIntensity,self.cp)))
@ -339,10 +346,28 @@ class VRML2Export:
self.writeIndented("# location %s %s %s\n" % (round(location[0],3), round(location[1],3), round(location[2],3)))
self.writeIndented("}\n",-1)
self.writeIndented("\n")
def createDef(self, name):
name = name + str(self.nodeID)
self.nodeID=self.nodeID+1
if len(name) <= 3:
newname = "_" + str(self.nodeID)
return "%s" % (newname)
else:
for bad in [' ','"','#',"'",',','.','[','\\',']','{','}']:
name=name.replace(bad,'_')
if name in self.namesReserved:
newname = name[0:3] + "_" + str(self.nodeID)
return "%s" % (newname)
elif name[0].isdigit():
newname = "_" + name + str(self.nodeID)
return "%s" % (newname)
else:
newname = name
return "%s" % (newname)
def secureName(self, name):
name = name + str(self.nodeID)
self.nodeID += 1
self.nodeID=self.nodeID+1
if len(name) <= 3:
newname = "_" + str(self.nodeID)
return "%s" % (newname)
@ -360,14 +385,13 @@ class VRML2Export:
return "%s" % (newname)
def writeIndexedFaceSet(self, object, normals = 0):
imageMap={} # set of used images
sided={} # 'one':cnt , 'two':cnt
vColors={} # 'multi':1
meshName = self.cleanStr(object.name)
mesh=object.getData()
meshME = self.cleanStr(mesh.name)
if len(mesh.faces) == 0:
return
for face in mesh.faces:
if face.mode & Blender.NMesh.FaceModes['HALO'] and self.halonode == 0:
self.writeIndented("Billboard {\n",1)
@ -414,21 +438,22 @@ class VRML2Export:
if len(maters) > 0 or mesh.hasFaceUV():
self.writeIndented("appearance Appearance {\n", 1)
# right now this script can only handle a single material per mesh.
if len(maters) >= 1:
mat=Blender.Material.Get(maters[0].name)
matFlags = mat.getMode()
if not matFlags & Blender.Material.Modes['TEXFACE']:
self.writeMaterial(mat, self.cleanStr(maters[0].name,''))
if len(maters) > 1:
print "Warning: mesh named %s has multiple materials" % meshName
print "Warning: only one material per object handled"
else:
self.writeIndented("material NULL\n")
#-- textures
if mesh.hasFaceUV():
for face in mesh.faces:
if (hasImageTexture == 0) and (face.image):
self.writeImageTexture(face.image.name, face.image.filename)
self.writeImageTexture(face.image.name)
hasImageTexture=1 # keep track of face texture
if self.tilenode == 1:
self.writeIndented("textureTransform TextureTransform { scale %s %s }\n" % (face.image.xrep, face.image.yrep))
@ -476,7 +501,7 @@ class VRML2Export:
if face.smooth:
issmooth=1
if issmooth==1 and self.wire == 0:
creaseAngle=(mesh.getMaxSmoothAngle())*(math.pi/180.0)
creaseAngle=(mesh.getMaxSmoothAngle())*radD
self.writeIndented("creaseAngle %s\n" % (round(creaseAngle,self.cp)))
#--- output vertexColors
@ -611,27 +636,22 @@ class VRML2Export:
self.matNames[matName]=1
ambient = mat.amb/3
ambient = mat.amb/2
diffuseR, diffuseG, diffuseB = mat.rgbCol[0], mat.rgbCol[1],mat.rgbCol[2]
if len(world) > 0:
ambi = world[0].getAmb()
ambi0, ambi1, ambi2 = (ambi[0]*mat.amb)*2, (ambi[1]*mat.amb)*2, (ambi[2]*mat.amb)*2
ambi0, ambi1, ambi2 = ambi[0], ambi[1], ambi[2]
else:
ambi = 0
ambi0, ambi1, ambi2 = 0, 0, 0
emisR, emisG, emisB = (diffuseR*mat.emit+ambi0)/2, (diffuseG*mat.emit+ambi1)/2, (diffuseB*mat.emit+ambi2)/2
emisR, emisG, emisB = (diffuseR*mat.emit+ambi0)/4, (diffuseG*mat.emit+ambi1)/4, (diffuseB*mat.emit+ambi2)/4
shininess = mat.hard/512.0
specR = (mat.specCol[0]+0.001)/(1.25/(mat.getSpec()+0.001))
specG = (mat.specCol[1]+0.001)/(1.25/(mat.getSpec()+0.001))
specB = (mat.specCol[2]+0.001)/(1.25/(mat.getSpec()+0.001))
shininess = mat.hard/255.0
specR = (mat.specCol[0]+0.001)/(1.05/(mat.getSpec()+0.001))
specG = (mat.specCol[1]+0.001)/(1.05/(mat.getSpec()+0.001))
specB = (mat.specCol[2]+0.001)/(1.05/(mat.getSpec()+0.001))
transp = 1-mat.alpha
matFlags = mat.getMode()
if matFlags & Blender.Material.Modes['SHADELESS']:
ambient = 1
shine = 1
specR = emitR = diffuseR
specG = emitG = diffuseG
specB = emitB = diffuseB
self.writeIndented("material DEF MA_%s Material {\n" % matName, 1)
self.writeIndented("diffuseColor %s %s %s\n" % (round(diffuseR,self.cp), round(diffuseG,self.cp), round(diffuseB,self.cp)))
self.writeIndented("ambientIntensity %s\n" % (round(ambient,self.cp)))
@ -641,14 +661,14 @@ class VRML2Export:
self.writeIndented("transparency %s\n" % (round(transp,self.cp)))
self.writeIndented("}\n",-1)
def writeImageTexture(self, name, filename):
def writeImageTexture(self, name):
if self.texNames.has_key(name):
self.writeIndented("texture USE %s\n" % self.cleanStr(name))
self.texNames[name] += 1
return
else:
self.writeIndented("texture DEF %s ImageTexture {\n" % self.cleanStr(name), 1)
self.writeIndented("url \"%s\"\n" % name.split("\\")[-1].split("/")[-1])
self.writeIndented("url \"%s\"\n" % name)
self.writeIndented("}\n",-1)
self.texNames[name] = 1
@ -667,7 +687,7 @@ class VRML2Export:
if worldname in self.namesStandard:
self.writeIndented("Background {\n",1)
else:
self.writeIndented("DEF %s Background {\n" % self.secureName(worldname),1)
self.writeIndented("DEF %s Background {\n" % self.createDef(worldname),1)
# No Skytype - just Hor color
if blending == 0:
self.writeIndented("groundColor %s %s %s\n" % (round(grd0,self.cp), round(grd1,self.cp), round(grd2,self.cp)))
@ -937,7 +957,10 @@ class VRML2Export:
if inc < 1:
self.indentLevel = self.indentLevel + inc
self.file.write( self.indentLevel*"\t" + s)
spaces=""
for x in xrange(self.indentLevel):
spaces = spaces + "\t"
self.file.write(spaces + s)
if inc > 0:
self.indentLevel = self.indentLevel + inc
@ -993,9 +1016,7 @@ def select_file(filename):
if(result != 1):
return
if not filename.endswith(extension):
filename += extension
if filename.find('.wrl', -4) < 0: filename += '.wrl'
wrlexport=VRML2Export(filename)
wrlexport.export(scene, world, worldmat)
@ -1005,7 +1026,7 @@ def createWRLPath():
if filename.find('.') != -1:
filename = filename.split('.')[0]
filename += extension
filename += ".wrl"
print filename
return filename
@ -1024,10 +1045,4 @@ if Blender.Get('version') < 235:
print " You aren't running blender version 2.35 or greater"
print " download a newer version from http://blender3d.org/"
else:
if ARG == 'comp':
extension=".wrz"
from gzip import *
else:
extension=".wrl"
Blender.Window.FileSelector(select_file,"Export VRML97",createWRLPath())

@ -50,27 +50,12 @@ Notes:<br>
# | http://www.redrival.com/scorpius |
# | scorpius@netzero.com |
# | Feb 19, 2002 |
# | Released under the Blender Artistic Licence (BAL) |
# | Import Export Suite v0.5 |
# +---------------------------------------------------------+
# | Read and write Wings3D File Format (*.wings) |
# +---------------------------------------------------------+
# ***** 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.
#
# ***** END GPL LICENCE BLOCK *****
import Blender, meshtools
import struct, time, sys, os, zlib, cStringIO

@ -11,7 +11,7 @@ __author__ = "Anthony D'Agostino (Scorpius)"
__url__ = ("blender", "elysiun",
"Author's homepage, http://www.redrival.com/scorpius",
"Wings 3D, http://www.wings3d.com")
__version__ = "Update on version from IOSuite 0.5"
__version__ = "Part of IOSuite 0.5"
__bpydoc__ = """\
This script imports Wings3D files to Blender.
@ -37,8 +37,7 @@ fanning algorithm. Convex polygons (i.e., shaped like the letter "U")
require a different algorithm, and will be triagulated incorrectly.
Notes:<br>
Last tested with Wings 3D 0.98.25 & Blender 2.35a.<br>
This version has improvements made by Adam Saltsman (AdamAtomic) and Toastie.
Last tested with Wings 3D 0.98.25 & Blender 2.35a.
"""
# $Id$
@ -48,25 +47,11 @@ Notes:<br>
# | http://www.redrival.com/scorpius |
# | scorpius@netzero.com |
# | Feb 19, 2002 |
# ***** 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.
#
# ***** END GPL LICENCE BLOCK *****
# | Released under the Blender Artistic Licence (BAL) |
# | Import Export Suite v0.5 |
# +---------------------------------------------------------+
# | Read and write Wings3D File Format (*.wings) |
# +---------------------------------------------------------+
import Blender, meshtools
import struct, time, sys, os, zlib, cStringIO
@ -94,28 +79,26 @@ def read_mode(data):
# === Read Hard Edges ===
# =======================
def read_hardedges(data):
hardedge_table = {} # hard edges table
tag = data.read(1)
if tag == '\x6A':
return hardedge_table # There are no hard edges
return # There are no hard edges
elif tag == '\x6B':
numhardedges, = struct.unpack(">H", data.read(2))
#print "numhardedges:", numhardedges
print "numhardedges:", numhardedges
for i in range(numhardedges):
hardedge_table[i] = struct.unpack(">B", data.read(1))[0]
data.read(1)
elif tag == '\x6C':
numhardedges, = struct.unpack(">L", data.read(4))
#print "numhardedges:", numhardedges
print "numhardedges:", numhardedges
for i in range(numhardedges):
misc = data.read(1)
if misc == '\x61': # next value is stored as a byte
hardedge_table[i] = struct.unpack(">B", data.read(1))[0]
data.read(1)
elif misc == '\x62': # next value is stored as a long
hardedge_table[i] = struct.unpack(">L", data.read(4))[0]
data.read(4)
data.read(1) # 6A
else:
print tag
return hardedge_table
# ==================
# === Read Edges ===
@ -151,7 +134,6 @@ def read_edges(data):
# === Read Faces ===
# ==================
def read_faces(data):
mat_table = {} #list of faces and material names
misc, numfaces = struct.unpack(">BL", data.read(5))
for i in range(numfaces):
if not i%100 and meshtools.show_progress: Blender.Window.DrawProgressBar(float(i)/numfaces, "Reading Faces")
@ -159,10 +141,10 @@ def read_faces(data):
data.read(4)
read_chunkheader(data)
misc, namelen = struct.unpack(">BH", data.read(3))
mat_table[i] = data.read(namelen)
data.read(1) # 6A?
materialname = data.read(namelen)
data.read(1)
data.read(1) # 6A
return mat_table
return numfaces
# ==================
# === Read Verts ===
@ -187,9 +169,7 @@ def make_face_table(edge_table): # For Wings
for i in range(len(edge_table)):
Lf = edge_table[i][2]
Rf = edge_table[i][3]
if Lf >= 0:
face_table[Lf] = i
if Rf >= 0:
face_table[Rf] = i
return face_table
@ -218,15 +198,12 @@ def make_faces(edge_table): # For Wings
if i == edge_table[current_edge][3]:
next_edge = edge_table[current_edge][7] # Right successor edge
next_vert = edge_table[current_edge][0]
elif i == edge_table[current_edge][2]:
else:
next_edge = edge_table[current_edge][5] # Left successor edge
next_vert = edge_table[current_edge][1]
else:
break
face_verts.append(next_vert)
current_edge = next_edge
if current_edge == face_table[i]: break
if len(face_verts) > 0:
face_verts.reverse()
faces.append(face_verts)
return faces
@ -259,10 +236,9 @@ def dump_wings(filename):
objname = data.read(namelen)
print read_chunkheader(data) # === winged chunk ===
edge_table = read_edges(data)
mat_table = read_faces(data)
numfaces = len(mat_table)
numfaces = read_faces(data)
verts = read_verts(data)
hardedge_table = read_hardedges(data)
read_hardedges(data)
face_table = {} # contains an incident edge
vert_table = {} # contains an incident edge
@ -279,26 +255,25 @@ def dump_wings(filename):
print
print "Ä"*79
print "edge_table:"
#pprint.pprint(edge_table)
pprint.pprint(edge_table)
#for i in range(len(edge_table)): print "%2d" % (i), edge_table[i]
print
print "face_table:"
#pprint.pprint(face_table)
pprint.pprint(face_table)
#for i in range(len(face_table)): print "%2d %2d" % (i, face_table[i])
print
print "vert_table:"
#pprint.pprint(vert_table)
pprint.pprint(vert_table)
#for i in range(len(vert_table)): print "%2d %2d" % (i, vert_table[i])
file.close()
end = time.clock()
print '\a\r',
sys.stderr.write("\nDone in %.2f %s\a\r" % (end-start, "seconds"))
sys.stderr.write("\nDone in %.2f %s" % (end-start, "seconds"))
# =========================
# === Read Wings Format ===
# =========================
def read(filename):
start = time.clock()
file = open(filename, "rb")
header = file.read(15)
@ -324,113 +299,9 @@ def read(filename):
objname = data.read(namelen)
read_chunkheader(data) # winged chunk
edge_table = read_edges(data)
mat_table = read_faces(data)
numfaces = len(mat_table)
numfaces = read_faces(data)
verts = read_verts(data)
hardedge_table = read_hardedges(data)
# Manually split hard edges
# TODO: Handle the case where there are 2+ edges on a face
duped = {}
processed = []
cleanup = []
oldedgecount = len(edge_table)
for i in range(len(verts)):
duped[i] = -1
for j in range(len(hardedge_table)):
hardedge = hardedge_table[j]
oldedge = edge_table[hardedge]
newedge = [] # Copy old edge into a new list
for k in range(len(oldedge)):
newedge.append(oldedge[k])
# Duplicate start vert if not duped already
sv = newedge[0]
if duped[sv] == -1:
verts.append(verts[sv])
duped[sv] = len(verts)-1
newedge[0] = duped[sv]
# Duplicate end vert if not duped already
ev = newedge[1]
if duped[ev] == -1:
verts.append(verts[ev])
duped[ev] = len(verts)-1
newedge[1] = duped[ev]
# Decide which way to cut the edge
flip = 0
for v in range(len(processed)):
if processed[v][0] == oldedge[0]:
flip = 1
elif processed[v][1] == oldedge[1]:
flip = 1
if flip == 0:
of = 3
oe1 = 6
oe2 = 7
nf = 2
ne1 = 4
ne2 = 5
else:
of = 2
oe1 = 4
oe2 = 5
nf = 3
ne1 = 6
ne2 = 7
# Fix up side-specific edge fields
oldedge[of] = -1
oldedge[oe1] = -1
oldedge[oe2] = -1
newedge[nf] = -1
newedge[ne1] = -1
newedge[ne2] = -1
# Store new edge's neighbors for cleanup later
cleanup.append(edge_table[newedge[oe1]])
cleanup.append(edge_table[newedge[oe2]])
#DEBUG
# Sv Ev | Lf Rf | Lp Ls | Rp Rs
#print "Old Edge:",hardedge,oldedge
#print "New Edge:",len(edge_table),newedge
# Add this new edge to the edge table
edge_table[len(edge_table)] = newedge
if flip == 0:
processed.append(oldedge) # mark it off as processed
# Cycle through cleanup list and fix it up
for c in range(len(cleanup)):
cleanupedge = cleanup[c]
# Fix up their verts in case they were duped
sv = cleanupedge[0]
if sv < len(duped):
if duped[sv] >= 0:
cleanupedge[0] = duped[sv]
ev = cleanupedge[1]
if ev < len(duped):
if duped[ev] >= 0:
cleanupedge[1] = duped[ev]
# Fix up edge info (in case a hard edge was replaced with a new one)
edgecount = c/2
hardedge = hardedge_table[edgecount] # look up what edge we were replacing
newedgenum = oldedgecount+edgecount # calculate new edge's index
if cleanupedge[4] == hardedge:
cleanupedge[4] = newedgenum
if cleanupedge[5] == hardedge:
cleanupedge[5] = newedgenum
if cleanupedge[6] == hardedge:
cleanupedge[6] = newedgenum
if cleanupedge[7] == hardedge:
cleanupedge[7] = newedgenum
#for i in range(len(edge_table)): print "%2d" % (i), edge_table[i]
read_hardedges(data)
read_mode(data)
faces = make_faces(edge_table)
message += "%s %8s %8s %8s\n" % (objname.ljust(15), len(faces), len(edge_table), len(verts))

@ -4,15 +4,16 @@ Name: 'X3D Extensible 3D (.x3d)...'
Blender: 235
Group: 'Export'
Submenu: 'All Objects...' all
Submenu: 'All Objects compressed...' comp
Submenu: 'Selected Objects...' selected
Tooltip: 'Export to Extensible 3D file (.x3d)'
"""
__author__ = ("Bart")
__email__ = ["Bart, bart:neeneenee*de"]
__url__ = ["Author's (Bart) homepage, http://www.neeneenee.de/vrml"]
__version__ = "2006/01/17"
__version__ = "2005/06/06"
__bpydoc__ = """\
This script exports to X3D format.
@ -36,6 +37,8 @@ for each texture);<br>
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
# Copyright (C) 2003,2004: Bart bart@neeneenee.de
#
# 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
@ -58,7 +61,7 @@ for each texture);<br>
####################################
import Blender
from Blender import Object, NMesh, Lamp, Draw, BGL, Image, Text, sys, Mathutils
from Blender import Object, NMesh, Lamp, Draw, BGL, Image, Text
from Blender.Scene import Render
try:
from os.path import exists, join
@ -77,8 +80,14 @@ world = Blender.World.Get()
worldmat = Blender.Texture.Get()
filename = Blender.Get('filename')
_safeOverwrite = True
radD=math.pi/180.0
ARG=''
extension = ''
def rad2deg(v):
return round(v*180.0/math.pi,4)
def deg2rad(v):
return (v*math.pi)/180.0;
class DrawTypes:
"""Object DrawTypes enum values
@ -168,14 +177,13 @@ class VRML2Export:
##########################################################
def writeHeader(self):
bfile = sys.expandpath(Blender.Get('filename'))
self.file.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
self.file.write("<!DOCTYPE X3D PUBLIC \"ISO//Web3D//DTD X3D 3.0//EN\" \"http://www.web3d.org/specifications/x3d-3.0.dtd\">\n")
self.file.write("<X3D version=\"3.0\" profile=\"Immersive\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema-instance\" xsd:noNamespaceSchemaLocation=\"http://www.web3d.org/specifications/x3d-3.0.xsd\">\n")
self.file.write("<head>\n")
self.file.write("\t<meta name=\"filename\" content=\"%s\" />\n" % sys.basename(bfile))
self.file.write("\t<meta name=\"filename\" content=\"%s\" />\n" % filename)
self.file.write("\t<meta name=\"generator\" content=\"Blender %s\" />\n" % Blender.Get('version'))
self.file.write("\t<meta name=\"translator\" content=\"X3D exporter v1.55 (2006/01/17)\" />\n")
self.file.write("\t<meta name=\"translator\" content=\"X3D exporter v1.50 (2005/06/06)\" />\n")
self.file.write("</head>\n")
self.file.write("<Scene>\n")
@ -216,8 +224,9 @@ class VRML2Export:
def writeViewpoint(self, thisObj):
context = scene.getRenderingContext()
ratio = float(context.imageSizeY())/float(context.imageSizeX())
lens = (360* (math.atan(ratio *16 / thisObj.data.getLens()) / math.pi))*(math.pi/180)
lens = min(lens, math.pi)
lens = (360* (math.atan(ratio *16 / thisObj.data.getLens()) / 3.141593))*(3.141593/180)
if lens > 3.14:
lens = 3.14
# get the camera location, subtract 90 degress from X to orient like X3D does
loc = self.rotatePointForVRML(thisObj.loc)
rot = [thisObj.RotX - 1.57, thisObj.RotY, thisObj.RotZ]
@ -274,8 +283,8 @@ class VRML2Export:
ambientIntensity = 0
# compute cutoff and beamwidth
intensity=min(lamp.energy/1.75,1.0)
beamWidth=((lamp.spotSize*math.pi)/180.0)*.37;
intensity=min(lamp.energy/1.5,1.0)
beamWidth=deg2rad(lamp.spotSize)*.37;
cutOffAngle=beamWidth*1.3
(dx,dy,dz)=self.computeDirection(object)
@ -305,7 +314,7 @@ class VRML2Export:
ambi = 0
ambientIntensity = 0
intensity=min(lamp.energy/1.75,1.0)
intensity=min(lamp.energy/1.5, 1.0)
(dx,dy,dz)=self.computeDirection(object)
self.file.write("<DirectionalLight DEF=\"%s\" " % safeName)
self.file.write("ambientIntensity=\"%s\" " % (round(ambientIntensity,self.cp)))
@ -323,7 +332,7 @@ class VRML2Export:
ambientIntensity = 0
om = object.getMatrix()
location=self.rotVertex(om, (0,0,0));
intensity=min(lamp.energy/1.75,1.0)
intensity=min(lamp.energy/1.5,1.0)
radius = lamp.dist
self.file.write("<PointLight DEF=\"%s\" " % safeName)
self.file.write("ambientIntensity=\"%s\" " % (round(ambientIntensity,self.cp)))
@ -345,6 +354,24 @@ class VRML2Export:
self.writeIndented("# location %s %s %s\n" % (round(location[0],3), round(location[1],3), round(location[2],3)))
self.writeIndented("/>\n",-1)
self.writeIndented("\n")
def createDef(self, name):
name = name + str(self.nodeID)
self.nodeID=self.nodeID+1
if len(name) <= 3:
newname = "_" + str(self.nodeID)
return "%s" % (newname)
else:
for bad in [' ','"','#',"'",',','.','[','\\',']','{','}']:
name=name.replace(bad,'_')
if name in self.namesReserved:
newname = name[0:3] + "_" + str(self.nodeID)
return "%s" % (newname)
elif name[0].isdigit():
newname = "_" + name + str(self.nodeID)
return "%s" % (newname)
else:
newname = name
return "%s" % (newname)
def secureName(self, name):
name = name + str(self.nodeID)
@ -366,14 +393,13 @@ class VRML2Export:
return "%s" % (newname)
def writeIndexedFaceSet(self, object, normals = 0):
imageMap={} # set of used images
sided={} # 'one':cnt , 'two':cnt
vColors={} # 'multi':1
meshName = self.cleanStr(object.name)
mesh=object.getData()
meshME = self.cleanStr(mesh.name)
if len(mesh.faces) == 0:
return
for face in mesh.faces:
if face.mode & Blender.NMesh.FaceModes['HALO'] and self.halonode == 0:
self.writeIndented("<Billboard axisOfRotation=\"0 0 0\">\n",1)
@ -411,15 +437,16 @@ class VRML2Export:
if len(maters) > 0 or mesh.hasFaceUV():
self.writeIndented("<Appearance>\n", 1)
# right now this script can only handle a single material per mesh.
if len(maters) >= 1:
mat=Blender.Material.Get(maters[0].name)
matFlags = mat.getMode()
if not matFlags & Blender.Material.Modes['TEXFACE']:
self.writeMaterial(mat, self.cleanStr(maters[0].name,''))
if len(maters) > 1:
print "Warning: mesh named %s has multiple materials" % meshName
print "Warning: only one material per object handled"
else:
self.writeIndented("<material NULL />\n")
#-- textures
if mesh.hasFaceUV():
@ -462,7 +489,7 @@ class VRML2Export:
if face.smooth:
issmooth=1
if issmooth==1 and self.wire == 0:
creaseAngle=(mesh.getMaxSmoothAngle())*(math.pi/180.0)
creaseAngle=(mesh.getMaxSmoothAngle())*radD
self.file.write("creaseAngle=\"%s\" " % (round(creaseAngle,self.cp)))
#--- output vertexColors
@ -613,27 +640,22 @@ class VRML2Export:
self.matNames[matName]=1
ambient = mat.amb/3
ambient = mat.amb/2
diffuseR, diffuseG, diffuseB = mat.rgbCol[0], mat.rgbCol[1],mat.rgbCol[2]
if len(world) > 0:
ambi = world[0].getAmb()
ambi0, ambi1, ambi2 = (ambi[0]*mat.amb)*2, (ambi[1]*mat.amb)*2, (ambi[2]*mat.amb)*2
ambi0, ambi1, ambi2 = ambi[0], ambi[1], ambi[2]
else:
ambi = 0
ambi0, ambi1, ambi2 = 0, 0, 0
emisR, emisG, emisB = (diffuseR*mat.emit+ambi0)/2, (diffuseG*mat.emit+ambi1)/2, (diffuseB*mat.emit+ambi2)/2
emisR, emisG, emisB = (diffuseR*mat.emit+ambi0)/4, (diffuseG*mat.emit+ambi1)/4, (diffuseB*mat.emit+ambi2)/4
shininess = mat.hard/512.0
specR = (mat.specCol[0]+0.001)/(1.25/(mat.getSpec()+0.001))
specG = (mat.specCol[1]+0.001)/(1.25/(mat.getSpec()+0.001))
specB = (mat.specCol[2]+0.001)/(1.25/(mat.getSpec()+0.001))
shininess = mat.hard/255.0
specR = (mat.specCol[0]+0.001)/(1.05/(mat.getSpec()+0.001))
specG = (mat.specCol[1]+0.001)/(1.05/(mat.getSpec()+0.001))
specB = (mat.specCol[2]+0.001)/(1.05/(mat.getSpec()+0.001))
transp = 1-mat.alpha
matFlags = mat.getMode()
if matFlags & Blender.Material.Modes['SHADELESS']:
ambient = 1
shine = 1
specR = emitR = diffuseR
specG = emitG = diffuseG
specB = emitB = diffuseB
self.writeIndented("<Material DEF=\"MA_%s\" " % matName, 1)
self.file.write("diffuseColor=\"%s %s %s\" " % (round(diffuseR,self.cp), round(diffuseG,self.cp), round(diffuseB,self.cp)))
self.file.write("specularColor=\"%s %s %s\" " % (round(specR,self.cp), round(specG,self.cp), round(specB,self.cp)))
@ -668,7 +690,7 @@ class VRML2Export:
mix0, mix1, mix2 = mix0/2, mix1/2, mix2/2
self.file.write("<Background ")
if worldname not in self.namesStandard:
self.file.write("DEF=\"%s\" " % self.secureName(worldname))
self.file.write("DEF=\"%s\" " % self.createDef(worldname))
# No Skytype - just Hor color
if blending == 0:
self.file.write("groundColor=\"%s %s %s\" " % (round(grd0,self.cp), round(grd1,self.cp), round(grd2,self.cp)))
@ -994,9 +1016,7 @@ def select_file(filename):
if(result != 1):
return
if not filename.endswith(extension):
filename += extension
if filename.find('.x3d', -4) < 0: filename += '.x3d'
wrlexport=VRML2Export(filename)
wrlexport.export(scene, world, worldmat)
@ -1006,7 +1026,7 @@ def createWRLPath():
if filename.find('.') != -1:
filename = filename.split('.')[0]
filename += extension
filename += ".x3d"
print filename
return filename
@ -1025,10 +1045,4 @@ if Blender.Get('version') < 235:
print " You aren't running blender version 2.35 or greater"
print " download a newer version from http://blender3d.org/"
else:
if ARG == 'comp':
from gzip import *
extension=".x3dz"
else:
extension=".x3d"
Blender.Window.FileSelector(select_file,"Export X3D",createWRLPath())

@ -84,7 +84,6 @@ PYPLAYERLIB ?= $(PYLIB)
GRPLIB += $(NAN_GHOST)/lib/$(DEBUG_DIR)libghost.a
GRPLIB += $(NAN_STRING)/lib/$(DEBUG_DIR)libstring.a
GRPLIB += $(OCGDIR)/blender/img/$(DEBUG_DIR)libimg.a
GRPLIB += $(OCGDIR)/blender/renderconverter/$(DEBUG_DIR)librenderconverter.a
GRPLIB += $(OCGDIR)/blender/render/$(DEBUG_DIR)librender.a
GRPLIB += $(OCGDIR)/blender/radiosity/$(DEBUG_DIR)libradiosity.a
GRPLIB += $(NAN_OPENNL)/lib/$(DEBUG_DIR)libopennl.a
@ -158,6 +157,9 @@ endif
ifeq ($(WITH_QUICKTIME), true)
COMLIB += $(OCGDIR)/blender/blenderqt/$(DEBUG_DIR)libblenderqt.a
endif
ifeq ($(WITH_OPENEXR), true)
COMLIB += $(OCGDIR)/blender/imbuf/openexr/$(DEBUG_DIR)libopenexr.a
endif
ifeq ($(WITH_FREETYPE2), true)
ifeq ($(OS), windows)
ifeq ($(FREE_WINDOWS), true)
@ -214,6 +216,10 @@ ifeq ($(OS), windows)
endif
endif
ifeq ($(WITH_OPENEXR), true)
COMLIB += $(NAN_OPENEXR_LIBS)
endif
PULIB = $(NAN_IKSOLVER)/lib/libiksolver.a
PULIB += $(NAN_MOTO)/lib/libmoto.a
PULIB += $(NAN_ELBEEM)/lib/$(DEBUG_DIR)libelbeem.a

@ -35,7 +35,7 @@ include nan_definitions.mk
DIRS = blenloader readblenfile
DIRS += avi imbuf img render radiosity blenlib blenkernel blenpluginapi
DIRS += makesdna src renderconverter yafray
DIRS += makesdna src yafray
DIRS += python
ifeq ($(INTERNATIONAL), true)

@ -13,10 +13,12 @@ SConscript(['avi/SConscript',
'radiosity/SConscript',
'readblenfile/SConscript',
'render/SConscript',
'renderconverter/SConscript',
'src/SConscript',
'yafray/SConscript'])
if user_options_dict['USE_OPENEXR'] == 1:
SConscript (['imbuf/intern/openexr/SConscript'])
if user_options_dict['USE_INTERNATIONAL'] == 1:
SConscript (['ftfont/SConscript'])

@ -44,6 +44,7 @@
#include <stdio.h>
#include "AVI_avi.h"
#include "endian.h"
#include "avi_intern.h"
#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__BIG_ENDIAN__)
#define WORDS_BIGENDIAN
@ -165,7 +166,7 @@ void awrite (AviMovie *movie, void *datain, int block, int size, FILE *fp, int t
#ifdef WORDS_BIGENDIAN
void *data;
data = malloc (size);
data = MEM_mallocN (size, "avi endian");
memcpy (data, datain, size);
@ -208,7 +209,7 @@ void awrite (AviMovie *movie, void *datain, int block, int size, FILE *fp, int t
break;
}
free (data);
MEM_freeN (data);
#else /* WORDS_BIGENDIAN */
fwrite (datain, block, size, fp);
#endif /* WORDS_BIGENDIAN */

@ -47,6 +47,7 @@
struct MVert;
struct Object;
struct TFace;
struct EditMesh;
struct DispListMesh;
struct ModifierData;
@ -143,7 +144,7 @@ struct DerivedMesh {
/* Draw all faces uses TFace
* o Drawing options too complicated to enumerate, look at code.
*/
void (*drawFacesTex)(DerivedMesh *dm, int (*setDrawOptions)(TFace *tf, int matnr));
void (*drawFacesTex)(DerivedMesh *dm, int (*setDrawOptions)(struct TFace *tf, int matnr));
/* Draw mapped faces (no color, or texture)
* o Only if !setDrawOptions or setDrawOptions(userData, mapped-face-index, drawSmooth_r) returns true

@ -111,7 +111,7 @@ struct bAction *copy_action(struct bAction *src);
/**
* Some kind of bounding box operation on the action.
*/
void calc_action_range(const struct bAction *act, float *start, float *end);
void calc_action_range(const struct bAction *act, float *start, float *end, int incl_hidden);
/**
* Set the pose channels from the given action.
@ -132,6 +132,9 @@ struct bActionChannel *get_action_channel(struct bAction *act, const char *name
*/
struct bActionChannel *verify_action_channel(struct bAction *act, const char *name);
/* baking */
struct bAction *bake_obIPO_to_action(struct Object *ob);
/* exported for game engine */
void blend_poses(struct bPose *dst, struct bPose *src, float srcweight, short mode);
void extract_pose_from_pose(struct bPose *pose, const struct bPose *src);

@ -39,15 +39,18 @@ struct Object;
struct PartEff;
struct Scene;
typedef struct DupliObject {
struct DupliObject *next, *prev;
struct Object *ob;
float mat[4][4], omat[4][4];
} DupliObject;
void free_path(struct Path *path);
void calc_curvepath(struct Object *ob);
int interval_test(int min, int max, int p1, int cycl);
int where_on_path(struct Object *ob, float ctime, float *vec, float *dir);
void frames_duplilist(struct Object *ob);
void vertex_duplilist(struct Scene *sce, struct Object *par);
void particle_duplilist(struct Scene *sce, struct Object *par, struct PartEff *paf);
void free_duplilist(void);
void make_duplilist(struct Scene *sce, struct Object *ob);
ListBase *object_duplilist(struct Scene *sce, struct Object *ob);
int count_duplilist(struct Object *ob);
#endif

@ -75,25 +75,6 @@ void error(char *str, ...);
/* anim.c */
extern struct ListBase editNurb;
/* displist.c */
#include "DNA_world_types.h" /* for render_types */
#include "render_types.h"
extern struct RE_Render R;
float Blinn_Spec(float *n, float *l, float *v, float a, float b, int);
float Phong_Spec(float *, float *, float *, int, int);
float CookTorr_Spec(float *n, float *l, float *v, int hard, int);
float Toon_Spec(float *n, float *l, float *v, float a, float b, int);
float WardIso_Spec(float *n, float *l, float *v, float a, int);
float Toon_Diff(float *n, float *l, float *v, float a, float b);
float OrenNayar_Diff(float *n, float *l, float *v, float rough);
float Minnaert_Diff(float nl, float *n, float *v, float a);
void add_to_diffuse(float *, ShadeInput *, float, float, float, float);
void ramp_diffuse_result(float *diff, ShadeInput *shi);
void do_specular_ramp(ShadeInput *shi, float is, float t, float *spec);
void ramp_spec_result(float *, float *, float *, ShadeInput *);
void mainqenter (unsigned short event, short val);
void waitcursor(int);
void allqueue(unsigned short event, short val);
@ -102,9 +83,6 @@ void allqueue(unsigned short event, short val);
struct Material;
extern struct Material defmaterial;
/* effect.c */
void RE_jitterate1(float *jit1, float *jit2, int num, float rad1);
void RE_jitterate2(float *jit1, float *jit2, int num, float rad2);
/* exotic.c */
void load_editMesh(void);
@ -118,7 +96,6 @@ int saveover(char *str);
/* image.c */
#include "DNA_image_types.h"
void free_realtime_image(Image *ima); // has to become a callback, opengl stuff
void RE_make_existing_file(char *name); // from render, but these funcs should be moved anyway
/* ipo.c */
void copy_view3d_lock(short val); // was a hack, to make scene layer ipo's possible
@ -128,11 +105,12 @@ void allspace(unsigned short event, short val) ;
#define OOPS_TEST 2
/* mball.c */
extern ListBase editelems;
extern struct ListBase editelems;
/* object.c */
void BPY_free_scriptlink(ScriptLink *slink);
void BPY_copy_scriptlink(ScriptLink *scriptlink);
struct ScriptLink;
void BPY_free_scriptlink(struct ScriptLink *slink);
void BPY_copy_scriptlink(struct ScriptLink *scriptlink);
float *give_cursor(void); // become a callback or argument
void exit_posemode(int freedata);
@ -148,22 +126,7 @@ void free_editing(struct Editing *ed); // scenes and sequences problem...
void BPY_do_all_scripts (short int event);
int BPY_call_importloader(char *name);
/* texture.c */
#define FLO 128
#define INT 96
struct EnvMap;
struct Tex;
void do_material_tex(ShadeInput *shi);
void externtex(struct MTex *mtex, float *vec, float *tin, float *tr,
float *tg, float *tb, float *ta);
void init_render_textures(void);
void end_render_textures(void);
void RE_free_envmap(struct EnvMap *env);
void RE_free_envmapdata(struct EnvMap *env);
struct EnvMap *RE_copy_envmap(struct EnvMap *env);
int RE_envmaptex(struct Tex *tex, float *texvec, float *dxt, float *dyt);
extern char texstr[20][12]; /* buttons.c */

@ -0,0 +1,60 @@
/**
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2006 Blender Foundation.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef BKE_COLORTOOLS_H
#define BKE_COLORTOOLS_H
struct CurveMapping;
struct CurveMap;
struct Image;
struct rctf;
struct CurveMapping *curvemapping_add(int tot, float minx, float miny, float maxx, float maxy);
void curvemapping_free(struct CurveMapping *cumap);
struct CurveMapping *curvemapping_copy(struct CurveMapping *cumap);
void curvemapping_set_black_white(struct CurveMapping *cumap, float *black, float *white);
void curvemap_remove(struct CurveMap *cuma, int flag);
void curvemap_insert(struct CurveMap *cuma, float x, float y);
void curvemap_reset(struct CurveMap *cuma, struct rctf *clipr);
void curvemap_sethandle(struct CurveMap *cuma, int type);
void curvemapping_changed(struct CurveMapping *cumap, int rem_doubles);
/* single curve, no table check */
float curvemap_evaluateF(struct CurveMap *cuma, float value);
/* single curve, with table check */
float curvemapping_evaluateF(struct CurveMapping *cumap, int cur, float value);
void curvemapping_evaluate3F(struct CurveMapping *cumap, float *vecout, const float *vecin);
void curvemapping_evaluateRGBF(struct CurveMapping *cumap, float *vecout, const float *vecin);
void curvemapping_evaluate_premulRGBF(struct CurveMapping *cumap, float *vecout, const float *vecin);
void curvemapping_do_image(struct CurveMapping *cumap, struct Image *ima);
void curvemapping_premultiply(struct CurveMapping *cumap, int restore);
int curvemapping_RGBA_does_something(struct CurveMapping *cumap);
#endif

@ -75,6 +75,7 @@ if( (cyclv) && a==sizev-1) { \
/* prototypes */
struct Base;
struct Object;
struct Curve;
struct ListBase;
@ -144,7 +145,7 @@ extern void makeDispListMesh(struct Object *ob);
extern void makeDispListSurf(struct Object *ob, struct ListBase *dispbase, int forRender);
extern void makeDispListCurveTypes(struct Object *ob, int forOrco);
extern void makeDispListMBall(struct Object *ob);
extern void shadeDispList(struct Object *ob);
extern void shadeDispList(struct Base *base);
void freefastshade(void);
void imagestodisplist(void);
void reshadeall_displist(void);

@ -34,14 +34,26 @@
#ifndef BKE_EFFECT_H
#define BKE_EFFECT_H
#include "DNA_object_types.h"
struct Effect;
struct ListBase;
struct Object;
struct PartEff;
struct MTex;
struct Mesh;
struct WaveEff;
struct Particle;
struct Group;
typedef struct pEffectorCache {
struct pEffectorCache *next, *prev;
Object *ob;
/* precalculated variables */
float oldloc[3], oldspeed[3];
float scale, time_scale;
float guide_dist;
Object obcopy; /* for restoring transformation data */
} pEffectorCache;
struct Effect *add_effect(int type);
void free_effect(struct Effect *eff);
@ -57,7 +69,7 @@ void build_particle_system(struct Object *ob);
/* particle deflector */
#define PE_WIND_AS_SPEED 0x00000001
struct ListBase *pdInitEffectors(struct Object *ob);
struct ListBase *pdInitEffectors(struct Object *obsrc, struct Group *group);
void pdEndEffectors(struct ListBase *lb);
void pdDoEffectors(struct ListBase *lb, float *opco, float *force, float *speed, float cur_time, float loc_time, unsigned int flags);

@ -41,6 +41,13 @@ struct Object;
struct Curve;
struct objfnt;
struct chartrans {
float xof, yof;
float rot;
short linenr,charnr;
char dobreak;
};
typedef struct SelBox {
float x, y, w, h;
} SelBox;
@ -55,7 +62,7 @@ struct VFont *load_vfont(char *name);
struct chartrans *text_to_curve(struct Object *ob, int mode);
int style_to_sel(int style, int toggle);
int mat_to_sel(void);
void font_duplilist(struct Object *par);
int getselection(int *start, int *end);
void chtoutf8(unsigned long c, char *o);

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