Final merge of HEAD (bf-blender) into the orange branch.
Here are my notes on things to look out for as potential problem spots: source/blender/blenkernel/intern/displist.c: + is initfastshade(void) supposed to be empty? I had to make it empty to get the merged tree to compile. source/blender/python/api2_2x/Armature.c: + went with the version that had Armature_getLayers() source/blender/python/api2_2x/Object.c + went with the version of Object_getPose() from bf-blender. (#ifdef 0-ed the other version) source/blender/python/api2_2x/Pose.[ch] + had problems linking due to no Pose_Init() ... copied these two files straight from bf-blender. source/blender/src/drawview.c: + view3d_panel_properties() had things shifted a few things shifted a few pixels, otherwise, things were painless source/blender/src/splash.jpg.c: + went with bf-blender version (orange is dead) source/gameengine: + went with bf-blender version -- does not compile due to IMB_rect* stuff, Ton should look into this.
This commit is contained in:
@@ -79,7 +79,7 @@ PYPLAYERLIB ?= $(PYLIB)
|
|||||||
GRPLIB = $(OCGDIR)/creator/$(DEBUG_DIR)libcreator.a
|
GRPLIB = $(OCGDIR)/creator/$(DEBUG_DIR)libcreator.a
|
||||||
GRPLIB += $(OCGDIR)/blender/src/$(DEBUG_DIR)libsrcpublisher.a
|
GRPLIB += $(OCGDIR)/blender/src/$(DEBUG_DIR)libsrcpublisher.a
|
||||||
GRPLIB += $(NAN_BSP)/lib/$(DEBUG_DIR)libbsp.a
|
GRPLIB += $(NAN_BSP)/lib/$(DEBUG_DIR)libbsp.a
|
||||||
GRPLIB += $(NAN_BOOLOP)/lib/$(DEBUG_DIR)libboolop.a
|
GRPLIB += $(NAN_BOOLOP)/lib/$(DEBUG_DIR)libboolop.a
|
||||||
GRPLIB += $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR)libSoundSystem.a
|
GRPLIB += $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR)libSoundSystem.a
|
||||||
GRPLIB += $(NAN_GHOST)/lib/$(DEBUG_DIR)libghost.a
|
GRPLIB += $(NAN_GHOST)/lib/$(DEBUG_DIR)libghost.a
|
||||||
GRPLIB += $(NAN_STRING)/lib/$(DEBUG_DIR)libstring.a
|
GRPLIB += $(NAN_STRING)/lib/$(DEBUG_DIR)libstring.a
|
||||||
@@ -90,7 +90,6 @@ PYPLAYERLIB ?= $(PYLIB)
|
|||||||
GRPLIB += $(NAN_SUPERLU)/lib/$(DEBUG_DIR)libsuperlu.a
|
GRPLIB += $(NAN_SUPERLU)/lib/$(DEBUG_DIR)libsuperlu.a
|
||||||
GRPLIB += $(OCGDIR)/blender/python/$(DEBUG_DIR)libpython.a
|
GRPLIB += $(OCGDIR)/blender/python/$(DEBUG_DIR)libpython.a
|
||||||
|
|
||||||
|
|
||||||
# nlin: the reason that some libraries appear more than once below is
|
# nlin: the reason that some libraries appear more than once below is
|
||||||
# to handle circular dependencies in linking among libraries... some
|
# to handle circular dependencies in linking among libraries... some
|
||||||
# linkers (e.g. under Linux) need libs to be specified multiple times
|
# linkers (e.g. under Linux) need libs to be specified multiple times
|
||||||
@@ -118,7 +117,7 @@ ifneq ($(NAN_NO_KETSJI),true)
|
|||||||
COMLIB += $(OCGDIR)/gameengine/blphys/sumo/$(DEBUG_DIR)libsumo.a
|
COMLIB += $(OCGDIR)/gameengine/blphys/sumo/$(DEBUG_DIR)libsumo.a
|
||||||
COMLIB += $(OCGDIR)/gameengine/blphys/fuzzics/$(DEBUG_DIR)libfuzzics.a
|
COMLIB += $(OCGDIR)/gameengine/blphys/fuzzics/$(DEBUG_DIR)libfuzzics.a
|
||||||
COMLIB += $(NAN_QHULL)/lib/libqhull.a
|
COMLIB += $(NAN_QHULL)/lib/libqhull.a
|
||||||
COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a
|
COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a
|
||||||
COMLIB += $(OCGDIR)/gameengine/blphys/common/$(DEBUG_DIR)libcommon.a
|
COMLIB += $(OCGDIR)/gameengine/blphys/common/$(DEBUG_DIR)libcommon.a
|
||||||
# COMLIB += $(OCGDIR)/gameengine/blphys/sumo/$(DEBUG_DIR)libsumo.a
|
# COMLIB += $(OCGDIR)/gameengine/blphys/sumo/$(DEBUG_DIR)libsumo.a
|
||||||
COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a
|
COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a
|
||||||
@@ -163,11 +162,11 @@ endif
|
|||||||
endif
|
endif
|
||||||
ifeq ($(WITH_FREETYPE2), true)
|
ifeq ($(WITH_FREETYPE2), true)
|
||||||
ifeq ($(OS), windows)
|
ifeq ($(OS), windows)
|
||||||
ifeq ($(FREE_WINDOWS), true)
|
ifeq ($(FREE_WINDOWS), true)
|
||||||
COMLIB += $(NAN_FREETYPE)/lib/libfreetype.a
|
COMLIB += $(NAN_FREETYPE)/lib/libfreetype.a
|
||||||
else
|
else
|
||||||
COMLIB += $(NAN_FREETYPE)/lib/freetype2ST.lib
|
COMLIB += $(NAN_FREETYPE)/lib/freetype2ST.lib
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
ifeq ($(OS), irix)
|
ifeq ($(OS), irix)
|
||||||
COMLIB += $(NAN_FREETYPE)/lib32/libfreetype.a
|
COMLIB += $(NAN_FREETYPE)/lib32/libfreetype.a
|
||||||
@@ -198,22 +197,22 @@ ifeq ($(INTERNATIONAL), true)
|
|||||||
COMLIB += $(NAN_FREETYPE)/lib/libfreetype.a
|
COMLIB += $(NAN_FREETYPE)/lib/libfreetype.a
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(OS), darwin)
|
ifeq ($(OS), darwin)
|
||||||
COMLIB += $(NAN_GETTEXT)/lib/libintl.a
|
COMLIB += $(NAN_GETTEXT)/lib/libintl.a
|
||||||
endif
|
endif
|
||||||
ifeq ($(OS), solaris)
|
ifeq ($(OS), solaris)
|
||||||
COMLIB += $(NAN_GETTEXT)/lib/libintl.a
|
COMLIB += $(NAN_GETTEXT)/lib/libintl.a
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OS), irix)
|
ifeq ($(OS), irix)
|
||||||
COMLIB += $(NAN_SDL)/lib/libSDL.a
|
COMLIB += $(NAN_SDL)/lib/libSDL.a
|
||||||
endif
|
endif
|
||||||
ifeq ($(OS), windows)
|
ifeq ($(OS), windows)
|
||||||
ifeq ($(FREE_WINDOWS), true)
|
ifeq ($(FREE_WINDOWS), true)
|
||||||
COMLIB += $(NAN_SDL)/lib/libSDL.a
|
COMLIB += $(NAN_SDL)/lib/libSDL.a
|
||||||
else
|
else
|
||||||
COMLIB += $(NAN_SDL)/lib/SDL.lib
|
COMLIB += $(NAN_SDL)/lib/SDL.lib
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -279,7 +278,6 @@ ifeq ($(OS),$(findstring $(OS), "windows"))
|
|||||||
endif
|
endif
|
||||||
PLUGAPPLIB += $(OCGDIR)/gameengine/GamePlayer/common/$(DEBUG_DIR)libcommon.a
|
PLUGAPPLIB += $(OCGDIR)/gameengine/GamePlayer/common/$(DEBUG_DIR)libcommon.a
|
||||||
|
|
||||||
|
|
||||||
ifeq ($(OS),$(findstring $(OS), "linux"))
|
ifeq ($(OS),$(findstring $(OS), "linux"))
|
||||||
ifeq ($(CPU),i386)
|
ifeq ($(CPU),i386)
|
||||||
PLUGAPPLIB_XPLINK = $(OCGDIR)/gameengine/GamePlayer/netscape/src/$(DEBUG_DIR)_Blender3DPlugin_implementation_.o
|
PLUGAPPLIB_XPLINK = $(OCGDIR)/gameengine/GamePlayer/netscape/src/$(DEBUG_DIR)_Blender3DPlugin_implementation_.o
|
||||||
@@ -300,7 +298,6 @@ endif
|
|||||||
ifeq ($(OS),darwin)
|
ifeq ($(OS),darwin)
|
||||||
BINTARGETS = blenderdynamic.app
|
BINTARGETS = blenderdynamic.app
|
||||||
BINTARGETS += blenderplayer.app
|
BINTARGETS += blenderplayer.app
|
||||||
|
|
||||||
ifdef PY_FRAMEWORK
|
ifdef PY_FRAMEWORK
|
||||||
PYLIB = -framework Python
|
PYLIB = -framework Python
|
||||||
else
|
else
|
||||||
@@ -340,7 +337,7 @@ ifeq ($(OS),linux)
|
|||||||
BINTARGETS += blenderplayer
|
BINTARGETS += blenderplayer
|
||||||
BINTARGETS += blenderstatic
|
BINTARGETS += blenderstatic
|
||||||
ifneq ($(NAN_NO_PLUGIN),true)
|
ifneq ($(NAN_NO_PLUGIN),true)
|
||||||
BINTARGETS += plugin xplink
|
BINTARGETS += plugin xplink
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(CPU),powerpc)
|
ifeq ($(CPU),powerpc)
|
||||||
@@ -366,14 +363,12 @@ ifeq ($(OS),solaris)
|
|||||||
PYLIB = $(NAN_PYTHON)/lib/python$(NAN_PYTHON_VERSION)/config/libpython$(NAN_PYTHON_VERSION).a
|
PYLIB = $(NAN_PYTHON)/lib/python$(NAN_PYTHON_VERSION)/config/libpython$(NAN_PYTHON_VERSION).a
|
||||||
PYLIB += $(NAN_MXTEXTTOOLS)
|
PYLIB += $(NAN_MXTEXTTOOLS)
|
||||||
PYLIB += $(NAN_ZLIB)/lib/libz.a
|
PYLIB += $(NAN_ZLIB)/lib/libz.a
|
||||||
|
|
||||||
PULIB += $(NAN_ZLIB)/lib/libz.a
|
PULIB += $(NAN_ZLIB)/lib/libz.a
|
||||||
SPLIB += $(NAN_ZLIB)/lib/libz.a
|
SPLIB += $(NAN_ZLIB)/lib/libz.a
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# OpenAL libs are already compiled as shared code! Check FMod if we switch to that. (nzc)
|
# OpenAL libs are already compiled as shared code! Check FMod if we switch to that. (nzc)
|
||||||
|
|
||||||
|
|
||||||
# Some vars to keep the rest of this section mostly readable
|
# Some vars to keep the rest of this section mostly readable
|
||||||
# in an 80 char term
|
# in an 80 char term
|
||||||
SOUNDSYSTEM = $(OCGDIR)/intern/SoundSystem/$(DEBUG_DIR)libSoundSystem.a
|
SOUNDSYSTEM = $(OCGDIR)/intern/SoundSystem/$(DEBUG_DIR)libSoundSystem.a
|
||||||
@@ -434,12 +429,12 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OS),windows)
|
ifeq ($(OS),windows)
|
||||||
ifeq ($(FREE_WINDOWS),true)
|
ifeq ($(FREE_WINDOWS),true)
|
||||||
PYLIB = $(NAN_PYTHON)/lib/freepy.a
|
PYLIB = $(NAN_PYTHON)/lib/freepy.a
|
||||||
else
|
else
|
||||||
PYLIB = $(NAN_PYTHON)/lib/python23.lib
|
PYLIB = $(NAN_PYTHON)/lib/python23.lib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
PYPLAYERLIB = $(NAN_PYTHON)/static/*.obj
|
PYPLAYERLIB = $(NAN_PYTHON)/static/*.obj
|
||||||
PYPLAYERLIB = $(PYLIB)
|
PYPLAYERLIB = $(PYLIB)
|
||||||
|
|
||||||
@@ -692,3 +687,4 @@ $(DIR)/$(DEBUG_DIR)bin/npTestPlugin$(SOEXT): $(NSPLUGLIB)
|
|||||||
/bin/rm $(BUILDINFO_O)
|
/bin/rm $(BUILDINFO_O)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ extern "C" {
|
|||||||
struct ListBase;
|
struct ListBase;
|
||||||
struct MemFile;
|
struct MemFile;
|
||||||
|
|
||||||
#define BLENDER_VERSION 240
|
#define BLENDER_VERSION 241
|
||||||
|
|
||||||
int BKE_read_file(char *dir, void *type_r);
|
int BKE_read_file(char *dir, void *type_r);
|
||||||
int BKE_read_file_from_memory(char* filebuf, int filelength, void *type_r);
|
int BKE_read_file_from_memory(char* filebuf, int filelength, void *type_r);
|
||||||
|
|||||||
@@ -809,7 +809,22 @@ void get_objectspace_bone_matrix (struct Bone* bone, float M_accumulatedMatrix[]
|
|||||||
pose_mat(b)= arm_mat(b) * chan_mat(b)
|
pose_mat(b)= arm_mat(b) * chan_mat(b)
|
||||||
|
|
||||||
*************************************************************************** */
|
*************************************************************************** */
|
||||||
|
/* Computes vector and roll based on a rotation. "mat" must
|
||||||
|
contain only a rotation, and no scaling. */
|
||||||
|
void mat3_to_vec_roll(float mat[][3], float *vec, float *roll) {
|
||||||
|
if (vec)
|
||||||
|
VecCopyf(vec, mat[1]);
|
||||||
|
|
||||||
|
if (roll) {
|
||||||
|
float vecmat[3][3], vecmatinv[3][3], rollmat[3][3];
|
||||||
|
|
||||||
|
vec_roll_to_mat3(mat[1], 0.0f, vecmat);
|
||||||
|
Mat3Inv(vecmatinv, vecmat);
|
||||||
|
Mat3MulMat3(rollmat, vecmatinv, mat);
|
||||||
|
|
||||||
|
*roll= atan2(rollmat[2][0], rollmat[2][2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Calculates the rest matrix of a bone based
|
/* Calculates the rest matrix of a bone based
|
||||||
On its vector and a roll around that vector */
|
On its vector and a roll around that vector */
|
||||||
|
|||||||
@@ -383,6 +383,9 @@ Object *get_constraint_target(bConstraint *con, char **subtarget)
|
|||||||
return (data->tar);
|
return (data->tar);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
*subtarget= NULL;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, Mesh *me, DispLis
|
|||||||
vmap= make_uv_vert_map(mface, tface, totface, totvert, 0, limit);
|
vmap= make_uv_vert_map(mface, tface, totface, totvert, 0, limit);
|
||||||
if (!vmap)
|
if (!vmap)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ccgSubSurf_initFullSync(ss);
|
ccgSubSurf_initFullSync(ss);
|
||||||
|
|
||||||
/* use this to get consistent vert handles with different heap addresses */
|
/* use this to get consistent vert handles with different heap addresses */
|
||||||
@@ -283,6 +283,9 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, Mesh *me, DispLis
|
|||||||
|
|
||||||
/* create vertices */
|
/* create vertices */
|
||||||
for (i=0; i<totvert; i++) {
|
for (i=0; i<totvert; i++) {
|
||||||
|
if (!get_uv_map_vert(vmap, i))
|
||||||
|
continue;
|
||||||
|
|
||||||
for (v=get_uv_map_vert(vmap, i)->next; v; v=v->next)
|
for (v=get_uv_map_vert(vmap, i)->next; v; v=v->next)
|
||||||
if (v->separate)
|
if (v->separate)
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1706,8 +1706,9 @@ static PyObject *reimportText( PyObject *module )
|
|||||||
|
|
||||||
/* if previously compiled, free the object */
|
/* if previously compiled, free the object */
|
||||||
/* (can't see how could be NULL, but check just in case) */
|
/* (can't see how could be NULL, but check just in case) */
|
||||||
if( text->compiled )
|
if( text->compiled ){
|
||||||
Py_DECREF( (PyObject *)text->compiled );
|
Py_DECREF( (PyObject *)text->compiled );
|
||||||
|
}
|
||||||
|
|
||||||
/* compile the buffer */
|
/* compile the buffer */
|
||||||
buf = txt_to_buf( text );
|
buf = txt_to_buf( text );
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ source_files = ['BPY_interface.c',
|
|||||||
'api2_2x/Types.c',
|
'api2_2x/Types.c',
|
||||||
'api2_2x/Window.c',
|
'api2_2x/Window.c',
|
||||||
'api2_2x/World.c',
|
'api2_2x/World.c',
|
||||||
|
'api2_2x/Pose.c',
|
||||||
'api2_2x/Image.c',
|
'api2_2x/Image.c',
|
||||||
'api2_2x/Text.c',
|
'api2_2x/Text.c',
|
||||||
'api2_2x/Text3d.c',
|
'api2_2x/Text3d.c',
|
||||||
|
|||||||
@@ -44,8 +44,7 @@
|
|||||||
#include "DNA_object_types.h" //This must come before BIF_editarmature.h...
|
#include "DNA_object_types.h" //This must come before BIF_editarmature.h...
|
||||||
#include "BIF_editarmature.h"
|
#include "BIF_editarmature.h"
|
||||||
|
|
||||||
//------------------UNDECLARED EXTERNAL PROTOTYPES--------------------
|
//------------------EXTERNAL PROTOTYPES--------------------
|
||||||
//These are evil 'extern' declarations for functions with no anywhere
|
|
||||||
extern void free_editArmature(void);
|
extern void free_editArmature(void);
|
||||||
extern void make_boneList(ListBase* list, ListBase *bones, EditBone *parent);
|
extern void make_boneList(ListBase* list, ListBase *bones, EditBone *parent);
|
||||||
extern void editbones_to_armature (ListBase *list, Object *ob);
|
extern void editbones_to_armature (ListBase *list, Object *ob);
|
||||||
@@ -112,7 +111,7 @@ static PyMethodDef BPy_BonesDict_methods[] = {
|
|||||||
"() - Returns the keys the dictionary"},
|
"() - Returns the keys the dictionary"},
|
||||||
{"values", (PyCFunction) BonesDict_values, METH_NOARGS,
|
{"values", (PyCFunction) BonesDict_values, METH_NOARGS,
|
||||||
"() - Returns the values from the dictionary"},
|
"() - Returns the values from the dictionary"},
|
||||||
{NULL}
|
{NULL, NULL, 0, NULL}
|
||||||
};
|
};
|
||||||
//-----------------(internal)
|
//-----------------(internal)
|
||||||
static int BoneMapping_Init(PyObject *dictionary, ListBase *bones){
|
static int BoneMapping_Init(PyObject *dictionary, ListBase *bones){
|
||||||
@@ -225,8 +224,18 @@ PyObject *BonesDict_GetItem(BPy_BonesDict *self, PyObject* key)
|
|||||||
}else{
|
}else{
|
||||||
value = PyDict_GetItem(self->bonesMap, key);
|
value = PyDict_GetItem(self->bonesMap, key);
|
||||||
}
|
}
|
||||||
if(value == NULL){
|
if(value == NULL){ /* item not found in dict. throw exception */
|
||||||
return EXPP_incr_ret(Py_None);
|
char buffer[128];
|
||||||
|
char* key_str;
|
||||||
|
key_str = PyString_AsString( key );
|
||||||
|
if( !key_str ){ /* key not a py string */
|
||||||
|
key_str = ""; /* use empty string for printing */
|
||||||
|
}
|
||||||
|
|
||||||
|
PyOS_snprintf( buffer, sizeof(buffer),
|
||||||
|
"bone %s not found", key_str);
|
||||||
|
|
||||||
|
return EXPP_ReturnPyObjError(PyExc_KeyError, buffer );
|
||||||
}
|
}
|
||||||
return EXPP_incr_ret(value);
|
return EXPP_incr_ret(value);
|
||||||
}
|
}
|
||||||
@@ -335,7 +344,7 @@ AttributeError3:
|
|||||||
return EXPP_intError(PyExc_AttributeError, "%s%s",
|
return EXPP_intError(PyExc_AttributeError, "%s%s",
|
||||||
sBoneDictBadArgs, "The 'connected' flag is set but the bone has no parent!");
|
sBoneDictBadArgs, "The 'connected' flag is set but the bone has no parent!");
|
||||||
}
|
}
|
||||||
//------------------TYPE_OBECT DEFINITION--------------------------
|
//------------------TYPE_OBJECT DEFINITION--------------------------
|
||||||
//Mapping Protocol
|
//Mapping Protocol
|
||||||
static PyMappingMethods BonesDict_MapMethods = {
|
static PyMappingMethods BonesDict_MapMethods = {
|
||||||
(inquiry) BonesDict_len, //mp_length
|
(inquiry) BonesDict_len, //mp_length
|
||||||
@@ -929,7 +938,7 @@ static PyMethodDef BPy_Armature_methods[] = {
|
|||||||
"() - Unlocks the ability to modify armature bones"},
|
"() - Unlocks the ability to modify armature bones"},
|
||||||
{"update", (PyCFunction) Armature_update, METH_NOARGS,
|
{"update", (PyCFunction) Armature_update, METH_NOARGS,
|
||||||
"() - Rebuilds the armature based on changes to bones since the last call to makeEditable"},
|
"() - Rebuilds the armature based on changes to bones since the last call to makeEditable"},
|
||||||
{NULL}
|
{NULL, NULL, 0, NULL}
|
||||||
};
|
};
|
||||||
//------------------------tp_getset
|
//------------------------tp_getset
|
||||||
//This contains methods for attributes that require checking
|
//This contains methods for attributes that require checking
|
||||||
@@ -1218,7 +1227,7 @@ static char M_Armature_Get_doc[] = "(name) - return the armature with the name '
|
|||||||
|
|
||||||
struct PyMethodDef M_Armature_methods[] = {
|
struct PyMethodDef M_Armature_methods[] = {
|
||||||
{"Get", M_Armature_Get, METH_VARARGS, M_Armature_Get_doc},
|
{"Get", M_Armature_Get, METH_VARARGS, M_Armature_Get_doc},
|
||||||
{NULL}
|
{NULL, NULL, 0, NULL}
|
||||||
};
|
};
|
||||||
//------------------VISIBLE PROTOTYPE IMPLEMENTATION-----------------------
|
//------------------VISIBLE PROTOTYPE IMPLEMENTATION-----------------------
|
||||||
//-----------------(internal)
|
//-----------------(internal)
|
||||||
|
|||||||
@@ -40,8 +40,8 @@
|
|||||||
//-------------------MODULE INIT---------------------------------
|
//-------------------MODULE INIT---------------------------------
|
||||||
PyObject *Armature_Init( void );
|
PyObject *Armature_Init( void );
|
||||||
//-------------------TYPEOBJECT----------------------------------
|
//-------------------TYPEOBJECT----------------------------------
|
||||||
PyTypeObject Armature_Type;
|
extern PyTypeObject Armature_Type;
|
||||||
PyTypeObject BonesDict_Type;
|
extern PyTypeObject BonesDict_Type;
|
||||||
//-------------------STRUCT DEFINITION---------------------------
|
//-------------------STRUCT DEFINITION---------------------------
|
||||||
typedef struct {
|
typedef struct {
|
||||||
PyObject_HEAD
|
PyObject_HEAD
|
||||||
|
|||||||
@@ -256,39 +256,20 @@ static PyObject *BezTriple_getTriple( BPy_BezTriple * self )
|
|||||||
|
|
||||||
static PyObject *BezTriple_setPoints( BPy_BezTriple * self, PyObject * args )
|
static PyObject *BezTriple_setPoints( BPy_BezTriple * self, PyObject * args )
|
||||||
{
|
{
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
struct BezTriple *bezt = self->beztriple;
|
struct BezTriple *bezt = self->beztriple;
|
||||||
PyObject *popo = 0;
|
PyObject *popo = 0;
|
||||||
|
|
||||||
if( !PyArg_ParseTuple( args, "O", &popo ) )
|
if( !PyArg_ParseTuple( args, "O", &popo ) || !PySequence_Check( popo ) )
|
||||||
return ( EXPP_ReturnPyObjError
|
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||||
( PyExc_TypeError, "expected sequence argument" ) );
|
"expected sequence argument" );
|
||||||
|
|
||||||
if( PySequence_Check( popo ) == 0 ) {
|
|
||||||
puts( "error in BezTriple_setPoints - expected sequence" );
|
|
||||||
Py_INCREF( Py_None );
|
|
||||||
return Py_None;
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
some debug stuff
|
|
||||||
this will become an overloaded args check
|
|
||||||
*/
|
|
||||||
int size = PySequence_Size( popo );
|
|
||||||
printf( "\n dbg: sequence size is %d\n", size );
|
|
||||||
}
|
|
||||||
|
|
||||||
for( i = 0; i < 2; i++ ) {
|
for( i = 0; i < 2; i++ ) {
|
||||||
PyObject *o = PySequence_GetItem( popo, i );
|
PyObject *o = PySequence_ITEM( popo, i );
|
||||||
if( !o )
|
|
||||||
printf( "\n bad o. o no!\n" );
|
|
||||||
|
|
||||||
/* bezt->vec[1][i] = PyFloat_AsDouble (PyTuple_GetItem (popo, i)); */
|
|
||||||
bezt->vec[1][i] = (float)PyFloat_AsDouble( o );
|
bezt->vec[1][i] = (float)PyFloat_AsDouble( o );
|
||||||
bezt->vec[0][i] = bezt->vec[1][i] - 1;
|
bezt->vec[0][i] = bezt->vec[1][i] - 1;
|
||||||
bezt->vec[2][i] = bezt->vec[1][i] + 1;
|
bezt->vec[2][i] = bezt->vec[1][i] + 1;
|
||||||
|
Py_DECREF( o );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* experimental fussing with handles - ipo.c: calchandles_ipocurve */
|
/* experimental fussing with handles - ipo.c: calchandles_ipocurve */
|
||||||
@@ -298,8 +279,7 @@ static PyObject *BezTriple_setPoints( BPy_BezTriple * self, PyObject * args )
|
|||||||
if( bezt->vec[2][0] < bezt->vec[1][0] )
|
if( bezt->vec[2][0] < bezt->vec[1][0] )
|
||||||
bezt->vec[2][0] = bezt->vec[1][0];
|
bezt->vec[2][0] = bezt->vec[1][0];
|
||||||
|
|
||||||
Py_INCREF( Py_None );
|
Py_RETURN_NONE;
|
||||||
return Py_None;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -42,14 +42,15 @@
|
|||||||
#include "DNA_object_types.h" //1
|
#include "DNA_object_types.h" //1
|
||||||
#include "BIF_editarmature.h" //2
|
#include "BIF_editarmature.h" //2
|
||||||
|
|
||||||
|
//------------------UNDECLARED EXTERNAL PROTOTYPES--------------------
|
||||||
|
extern void mat3_to_vec_roll(float mat[][3], float *vec, float *roll);
|
||||||
|
|
||||||
//------------------------ERROR CODES---------------------------------
|
//------------------------ERROR CODES---------------------------------
|
||||||
//This is here just to make me happy and to have more consistant error strings :)
|
//This is here just to make me happy and to have more consistant error strings :)
|
||||||
static const char sEditBoneError[] = "EditBone (internal) - Error: ";
|
static const char sEditBoneError[] = "EditBone - Error: ";
|
||||||
static const char sEditBoneBadArgs[] = "EditBone (internal) - Bad Arguments: ";
|
static const char sEditBoneBadArgs[] = "EditBone - Bad Arguments: ";
|
||||||
static const char sBoneError[] = "Bone - Error: ";
|
static const char sBoneError[] = "Bone - Error: ";
|
||||||
static const char sBoneBadArgs[] = "Bone - Bad Arguments: ";
|
static const char sBoneBadArgs[] = "Bone - Bad Arguments: ";
|
||||||
static const char sConstListError[] = "ConstantList - Error: ";
|
|
||||||
static const char sConstListBadArgs[] = "ConstantList - Bad Arguments: ";
|
|
||||||
|
|
||||||
//----------------------(internal)
|
//----------------------(internal)
|
||||||
//gets the bone->roll (which is a localspace roll) and puts it in parentspace
|
//gets the bone->roll (which is a localspace roll) and puts it in parentspace
|
||||||
@@ -541,7 +542,6 @@ static int EditBone_setParent(BPy_EditBone *self, PyObject *value, void *closure
|
|||||||
AttributeError:
|
AttributeError:
|
||||||
return EXPP_intError(PyExc_AttributeError, "%s%s%s",
|
return EXPP_intError(PyExc_AttributeError, "%s%s%s",
|
||||||
sEditBoneError, ".parent: ", "expects a EditBone Object");
|
sEditBoneError, ".parent: ", "expects a EditBone Object");
|
||||||
|
|
||||||
AttributeError2:
|
AttributeError2:
|
||||||
return EXPP_intError(PyExc_AttributeError, "%s%s%s",
|
return EXPP_intError(PyExc_AttributeError, "%s%s%s",
|
||||||
sEditBoneError, ".parent: ", "This object is not in the armature's bone list!");
|
sEditBoneError, ".parent: ", "This object is not in the armature's bone list!");
|
||||||
@@ -565,8 +565,53 @@ static PyObject *EditBone_getMatrix(BPy_EditBone *self, void *closure)
|
|||||||
//------------------------EditBone.matrix (set)
|
//------------------------EditBone.matrix (set)
|
||||||
static int EditBone_setMatrix(BPy_EditBone *self, PyObject *value, void *closure)
|
static int EditBone_setMatrix(BPy_EditBone *self, PyObject *value, void *closure)
|
||||||
{
|
{
|
||||||
printf("Sorry this isn't implemented yet.... :/");
|
PyObject *matrix;
|
||||||
return 1;
|
float roll, length, vec[3], axis[3], mat3[3][3];
|
||||||
|
|
||||||
|
if (!PyArg_Parse(value, "O!", &matrix_Type, &matrix))
|
||||||
|
goto AttributeError;
|
||||||
|
|
||||||
|
//make sure we have the right sizes
|
||||||
|
if (((MatrixObject*)matrix)->rowSize != 3 && ((MatrixObject*)matrix)->colSize != 3){
|
||||||
|
if(((MatrixObject*)matrix)->rowSize != 4 && ((MatrixObject*)matrix)->colSize != 4){
|
||||||
|
goto AttributeError;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*vec will be a normalized directional vector
|
||||||
|
* together with the length of the old bone vec*length = the new vector*/
|
||||||
|
/*The default rotation is 0,1,0 on the Y axis (see mat3_to_vec_roll)*/
|
||||||
|
if (((MatrixObject*)matrix)->rowSize == 4){
|
||||||
|
Mat3CpyMat4(mat3, ((float (*)[4])*((MatrixObject*)matrix)->matrix));
|
||||||
|
}else{
|
||||||
|
Mat3CpyMat3(mat3, ((float (*)[3])*((MatrixObject*)matrix)->matrix));
|
||||||
|
}
|
||||||
|
mat3_to_vec_roll(mat3, vec, &roll);
|
||||||
|
|
||||||
|
//if a 4x4 matrix was passed we'll translate the vector otherwise not
|
||||||
|
if (self->editbone){
|
||||||
|
self->editbone->roll = roll;
|
||||||
|
VecSubf(axis, self->editbone->tail, self->editbone->head);
|
||||||
|
length = VecLength(axis);
|
||||||
|
VecMulf(vec, length);
|
||||||
|
if (((MatrixObject*)matrix)->rowSize == 4)
|
||||||
|
VecCopyf(self->editbone->head, ((MatrixObject*)matrix)->matrix[3]);
|
||||||
|
VecAddf(self->editbone->tail, self->editbone->head, vec);
|
||||||
|
return 0;
|
||||||
|
}else{
|
||||||
|
self->roll = roll;
|
||||||
|
VecSubf(axis, self->tail, self->head);
|
||||||
|
length = VecLength(axis);
|
||||||
|
VecMulf(vec, length);
|
||||||
|
if (((MatrixObject*)matrix)->rowSize == 4)
|
||||||
|
VecCopyf(self->head, ((MatrixObject*)matrix)->matrix[3]);
|
||||||
|
VecAddf(self->tail, self->head, vec);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
AttributeError:
|
||||||
|
return EXPP_intError(PyExc_AttributeError, "%s%s%s",
|
||||||
|
sEditBoneError, ".matrix: ", "expects a 3x3 or 4x4 Matrix Object");
|
||||||
}
|
}
|
||||||
//------------------------Bone.length (get)
|
//------------------------Bone.length (get)
|
||||||
static PyObject *EditBone_getLength(BPy_EditBone *self, void *closure)
|
static PyObject *EditBone_getLength(BPy_EditBone *self, void *closure)
|
||||||
@@ -603,7 +648,7 @@ static PyMethodDef BPy_EditBone_methods[] = {
|
|||||||
"() - True/False - Bone has a parent"},
|
"() - True/False - Bone has a parent"},
|
||||||
{"clearParent", (PyCFunction) EditBone_clearParent, METH_NOARGS,
|
{"clearParent", (PyCFunction) EditBone_clearParent, METH_NOARGS,
|
||||||
"() - sets the parent to None"},
|
"() - sets the parent to None"},
|
||||||
{NULL}
|
{NULL, NULL, 0, NULL}
|
||||||
};
|
};
|
||||||
///------------------------tp_getset
|
///------------------------tp_getset
|
||||||
//This contains methods for attributes that require checking
|
//This contains methods for attributes that require checking
|
||||||
@@ -630,7 +675,7 @@ static PyGetSetDef BPy_EditBone_getset[] = {
|
|||||||
"The parent bone of this bone", NULL},
|
"The parent bone of this bone", NULL},
|
||||||
{"length", (getter)EditBone_getLength, (setter)EditBone_setLength,
|
{"length", (getter)EditBone_getLength, (setter)EditBone_setLength,
|
||||||
"The length of this bone", NULL},
|
"The length of this bone", NULL},
|
||||||
{NULL}
|
{NULL, NULL, NULL, NULL,NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------tp_repr
|
//------------------------tp_repr
|
||||||
@@ -751,6 +796,28 @@ PyTypeObject EditBone_Type = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//------------------METHOD IMPLEMENTATIONS--------------------------------
|
//------------------METHOD IMPLEMENTATIONS--------------------------------
|
||||||
|
//------------------------(internal) PyBone_ChildrenAsList
|
||||||
|
static int PyBone_ChildrenAsList(PyObject *list, ListBase *bones){
|
||||||
|
Bone *bone = NULL;
|
||||||
|
PyObject *py_bone = NULL;
|
||||||
|
|
||||||
|
for (bone = bones->first; bone; bone = bone->next){
|
||||||
|
py_bone = PyBone_FromBone(bone);
|
||||||
|
if (py_bone == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if(PyList_Append(list, py_bone) == -1){
|
||||||
|
goto RuntimeError;
|
||||||
|
}
|
||||||
|
if (bone->childbase.first)
|
||||||
|
PyBone_ChildrenAsList(list, &bone->childbase);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
RuntimeError:
|
||||||
|
return EXPP_intError(PyExc_RuntimeError, "%s%s",
|
||||||
|
sBoneError, "Internal error trying to wrap blender bones!");
|
||||||
|
}
|
||||||
//-------------------------Bone.hasParent()
|
//-------------------------Bone.hasParent()
|
||||||
PyObject *Bone_hasParent(BPy_Bone *self)
|
PyObject *Bone_hasParent(BPy_Bone *self)
|
||||||
{
|
{
|
||||||
@@ -767,6 +834,20 @@ PyObject *Bone_hasChildren(BPy_Bone *self)
|
|||||||
else
|
else
|
||||||
return EXPP_incr_ret(Py_False);
|
return EXPP_incr_ret(Py_False);
|
||||||
}
|
}
|
||||||
|
//-------------------------Bone.getAllChildren()
|
||||||
|
PyObject *Bone_getAllChildren(BPy_Bone *self)
|
||||||
|
{
|
||||||
|
PyObject *list = NULL;
|
||||||
|
|
||||||
|
if (self->bone->childbase.first){
|
||||||
|
list = PyList_New(0);
|
||||||
|
if (!PyBone_ChildrenAsList(list, &self->bone->childbase))
|
||||||
|
return NULL;
|
||||||
|
return EXPP_incr_ret(list);
|
||||||
|
}else{
|
||||||
|
return EXPP_incr_ret(Py_None);
|
||||||
|
}
|
||||||
|
}
|
||||||
//------------------ATTRIBUTE IMPLEMENTATIONS-----------------------------
|
//------------------ATTRIBUTE IMPLEMENTATIONS-----------------------------
|
||||||
//------------------------Bone.name (get)
|
//------------------------Bone.name (get)
|
||||||
static PyObject *Bone_getName(BPy_Bone *self, void *closure)
|
static PyObject *Bone_getName(BPy_Bone *self, void *closure)
|
||||||
@@ -920,42 +1001,31 @@ static int Bone_setParent(BPy_Bone *self, PyObject *value, void *closure)
|
|||||||
return EXPP_intError(PyExc_ValueError, "%s%s",
|
return EXPP_intError(PyExc_ValueError, "%s%s",
|
||||||
sBoneError, "You must first call .makeEditable() to edit the armature");
|
sBoneError, "You must first call .makeEditable() to edit the armature");
|
||||||
}
|
}
|
||||||
//------------------------(internal) PyBone_ChildrenAsList
|
|
||||||
static int PyBone_ChildrenAsList(PyObject *list, ListBase *bones){
|
|
||||||
Bone *bone = NULL;
|
|
||||||
PyObject *py_bone = NULL;
|
|
||||||
|
|
||||||
for (bone = bones->first; bone; bone = bone->next){
|
|
||||||
py_bone = PyBone_FromBone(bone);
|
|
||||||
if (py_bone == NULL)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if(PyList_Append(list, py_bone) == -1){
|
|
||||||
goto RuntimeError;
|
|
||||||
}
|
|
||||||
if (bone->childbase.first)
|
|
||||||
PyBone_ChildrenAsList(list, &bone->childbase);
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
RuntimeError:
|
|
||||||
return EXPP_intError(PyExc_RuntimeError, "%s%s",
|
|
||||||
sBoneError, "Internal error trying to wrap blender bones!");
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------Bone.children (get)
|
//------------------------Bone.children (get)
|
||||||
static PyObject *Bone_getChildren(BPy_Bone *self, void *closure)
|
static PyObject *Bone_getChildren(BPy_Bone *self, void *closure)
|
||||||
{
|
{
|
||||||
PyObject *list = NULL;
|
PyObject *list = NULL;
|
||||||
|
Bone *bone = NULL;
|
||||||
|
PyObject *py_bone = NULL;
|
||||||
|
|
||||||
if (self->bone->childbase.first){
|
if (self->bone->childbase.first){
|
||||||
list = PyList_New(0);
|
list = PyList_New(0);
|
||||||
if (!PyBone_ChildrenAsList(list, &self->bone->childbase))
|
for (bone = self->bone->childbase.first; bone; bone = bone->next){
|
||||||
return NULL;
|
py_bone = PyBone_FromBone(bone);
|
||||||
|
if (py_bone == NULL)
|
||||||
|
return 0;
|
||||||
|
if(PyList_Append(list, py_bone) == -1){
|
||||||
|
goto RuntimeError;
|
||||||
|
}
|
||||||
|
}
|
||||||
return EXPP_incr_ret(list);
|
return EXPP_incr_ret(list);
|
||||||
}else{
|
}else{
|
||||||
return EXPP_incr_ret(Py_None);
|
return EXPP_incr_ret(Py_None);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RuntimeError:
|
||||||
|
return EXPP_objError(PyExc_RuntimeError, "%s%s",
|
||||||
|
sBoneError, "Internal error trying to wrap blender bones!");
|
||||||
}
|
}
|
||||||
//------------------------Bone.children (set)
|
//------------------------Bone.children (set)
|
||||||
static int Bone_setChildren(BPy_Bone *self, PyObject *value, void *closure)
|
static int Bone_setChildren(BPy_Bone *self, PyObject *value, void *closure)
|
||||||
@@ -995,7 +1065,9 @@ static PyMethodDef BPy_Bone_methods[] = {
|
|||||||
"() - True/False - Bone has a parent"},
|
"() - True/False - Bone has a parent"},
|
||||||
{"hasChildren", (PyCFunction) Bone_hasChildren, METH_NOARGS,
|
{"hasChildren", (PyCFunction) Bone_hasChildren, METH_NOARGS,
|
||||||
"() - True/False - Bone has 1 or more children"},
|
"() - True/False - Bone has 1 or more children"},
|
||||||
{NULL}
|
{"getAllChildren", (PyCFunction) Bone_getAllChildren, METH_NOARGS,
|
||||||
|
"() - All the children for this bone - including children's children"},
|
||||||
|
{NULL, NULL, 0, NULL}
|
||||||
};
|
};
|
||||||
//------------------------tp_getset
|
//------------------------tp_getset
|
||||||
//This contains methods for attributes that require checking
|
//This contains methods for attributes that require checking
|
||||||
@@ -1024,7 +1096,7 @@ static PyGetSetDef BPy_Bone_getset[] = {
|
|||||||
"The child bones of this bone", NULL},
|
"The child bones of this bone", NULL},
|
||||||
{"length", (getter)Bone_getLength, (setter)Bone_setLength,
|
{"length", (getter)Bone_getLength, (setter)Bone_setLength,
|
||||||
"The length of this bone", NULL},
|
"The length of this bone", NULL},
|
||||||
{NULL}
|
{NULL, NULL, NULL, NULL,NULL}
|
||||||
};
|
};
|
||||||
//------------------------tp_repr
|
//------------------------tp_repr
|
||||||
//This is the string representation of the object
|
//This is the string representation of the object
|
||||||
|
|||||||
@@ -38,8 +38,8 @@
|
|||||||
#define BoneObject_Check(v) ((v)->ob_type == &Bone_Type)
|
#define BoneObject_Check(v) ((v)->ob_type == &Bone_Type)
|
||||||
#define EditBoneObject_Check(v) ((v)->ob_type == &EditBone_Type)
|
#define EditBoneObject_Check(v) ((v)->ob_type == &EditBone_Type)
|
||||||
//-------------------TYPEOBJECT----------------------------------
|
//-------------------TYPEOBJECT----------------------------------
|
||||||
PyTypeObject EditBone_Type;
|
extern PyTypeObject EditBone_Type;
|
||||||
PyTypeObject Bone_Type;
|
extern PyTypeObject Bone_Type;
|
||||||
//-------------------STRUCT DEFINITION----------------------------
|
//-------------------STRUCT DEFINITION----------------------------
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
@@ -25,7 +25,8 @@
|
|||||||
*
|
*
|
||||||
* This is a new part of Blender.
|
* This is a new part of Blender.
|
||||||
*
|
*
|
||||||
* Contributor(s): Pontus Lidman, Johnny Matthews, Ken Hughes
|
* Contributor(s): Pontus Lidman, Johnny Matthews, Ken Hughes,
|
||||||
|
* Michael Reimpell
|
||||||
*
|
*
|
||||||
* ***** END GPL/BL DUAL LICENSE BLOCK *****
|
* ***** END GPL/BL DUAL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
@@ -36,6 +37,7 @@
|
|||||||
#include <BKE_global.h>
|
#include <BKE_global.h>
|
||||||
#include <BKE_main.h>
|
#include <BKE_main.h>
|
||||||
#include <BKE_curve.h>
|
#include <BKE_curve.h>
|
||||||
|
#include "BIF_space.h"
|
||||||
|
|
||||||
#include "Ipocurve.h"
|
#include "Ipocurve.h"
|
||||||
#include "Key.h"
|
#include "Key.h"
|
||||||
@@ -62,10 +64,12 @@ static void KeyBlock_dealloc( PyObject * self );
|
|||||||
static PyObject *Key_repr( BPy_Key * self );
|
static PyObject *Key_repr( BPy_Key * self );
|
||||||
|
|
||||||
static PyObject *Key_getBlocks( PyObject * self );
|
static PyObject *Key_getBlocks( PyObject * self );
|
||||||
static PyObject *Key_getType( PyObject * self );
|
static PyObject *Key_getType( BPy_Key * self );
|
||||||
|
static PyObject *Key_getRelative( BPy_Key * self );
|
||||||
static PyObject *Key_getIpo( PyObject * self );
|
static PyObject *Key_getIpo( PyObject * self );
|
||||||
static int Key_setIpo( PyObject * self, PyObject * args );
|
static int Key_setIpo( PyObject * self, PyObject * args );
|
||||||
static PyObject *Key_getValue( PyObject * self );
|
static PyObject *Key_getValue( PyObject * self );
|
||||||
|
static int Key_setRelative( BPy_Key * self, PyObject * value );
|
||||||
|
|
||||||
static struct PyMethodDef Key_methods[] = {
|
static struct PyMethodDef Key_methods[] = {
|
||||||
{ "getBlocks", (PyCFunction) Key_getBlocks, METH_NOARGS, "Get key blocks" },
|
{ "getBlocks", (PyCFunction) Key_getBlocks, METH_NOARGS, "Get key blocks" },
|
||||||
@@ -74,21 +78,21 @@ static struct PyMethodDef Key_methods[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static PyGetSetDef BPy_Key_getsetters[] = {
|
static PyGetSetDef BPy_Key_getsetters[] = {
|
||||||
{"type",(getter)Key_getType, (setter)NULL,
|
{"type",(getter)Key_getType, (setter)NULL,
|
||||||
"Key Type",NULL},
|
"Key Type",NULL},
|
||||||
{"value",(getter)Key_getValue, (setter)NULL,
|
{"value",(getter)Key_getValue, (setter)NULL,
|
||||||
"Key value",NULL},
|
"Key value",NULL},
|
||||||
{"ipo",(getter)Key_getIpo, (setter)Key_setIpo,
|
{"ipo",(getter)Key_getIpo, (setter)Key_setIpo,
|
||||||
"ipo linked to key",NULL},
|
"Ipo linked to key",NULL},
|
||||||
{"blocks",(getter)Key_getBlocks, (setter)NULL,
|
{"blocks",(getter)Key_getBlocks, (setter)NULL,
|
||||||
"blocks linked to the key",NULL},
|
"Blocks linked to the key",NULL},
|
||||||
{NULL,NULL,NULL,NULL,NULL} /* Sentinel */
|
{"relative",(getter)Key_getRelative, (setter)Key_setRelative,
|
||||||
};
|
"Non-zero is key is relative",NULL},
|
||||||
|
{NULL,NULL,NULL,NULL,NULL} /* Sentinel */
|
||||||
|
};
|
||||||
|
|
||||||
static PyObject *KeyBlock_getData( PyObject * self );
|
static PyObject *KeyBlock_getData( PyObject * self );
|
||||||
|
static PyObject *KeyBlock_getCurval( BPy_KeyBlock * self );
|
||||||
static PyObject *KeyBlock_getName( BPy_KeyBlock * self );
|
static PyObject *KeyBlock_getName( BPy_KeyBlock * self );
|
||||||
static PyObject *KeyBlock_getPos( BPy_KeyBlock * self );
|
static PyObject *KeyBlock_getPos( BPy_KeyBlock * self );
|
||||||
static PyObject *KeyBlock_getSlidermin( BPy_KeyBlock * self );
|
static PyObject *KeyBlock_getSlidermin( BPy_KeyBlock * self );
|
||||||
@@ -107,6 +111,8 @@ static struct PyMethodDef KeyBlock_methods[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static PyGetSetDef BPy_KeyBlock_getsetters[] = {
|
static PyGetSetDef BPy_KeyBlock_getsetters[] = {
|
||||||
|
{"curval",(getter)KeyBlock_getCurval, (setter)NULL,
|
||||||
|
"Current value of the corresponding IpoCurve",NULL},
|
||||||
{"name",(getter)KeyBlock_getName, (setter)KeyBlock_setName,
|
{"name",(getter)KeyBlock_getName, (setter)KeyBlock_setName,
|
||||||
"Keyblock Name",NULL},
|
"Keyblock Name",NULL},
|
||||||
{"pos",(getter)KeyBlock_getPos, (setter)NULL,
|
{"pos",(getter)KeyBlock_getPos, (setter)NULL,
|
||||||
@@ -362,13 +368,32 @@ static int Key_setIpo( PyObject * self, PyObject * value )
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *Key_getType( PyObject * self )
|
static PyObject *Key_getRelative( BPy_Key * self )
|
||||||
|
{
|
||||||
|
if( self->key->type == KEY_RELATIVE )
|
||||||
|
return EXPP_incr_ret(Py_True);
|
||||||
|
else
|
||||||
|
return EXPP_incr_ret(Py_False);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int Key_setRelative( BPy_Key * self, PyObject * value )
|
||||||
|
{
|
||||||
|
if( PyObject_IsTrue( value ) )
|
||||||
|
self->key->type = KEY_RELATIVE;
|
||||||
|
else
|
||||||
|
self->key->type = KEY_NORMAL;
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allspace(REMAKEIPO, 0);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject *Key_getType( BPy_Key * self )
|
||||||
{
|
{
|
||||||
BPy_Key *k = ( BPy_Key * ) self;
|
|
||||||
int idcode;
|
int idcode;
|
||||||
int type = -1;
|
int type = -1;
|
||||||
|
|
||||||
idcode = GS( k->key->from->name );
|
idcode = GS( self->key->from->name );
|
||||||
|
|
||||||
switch( idcode ) {
|
switch( idcode ) {
|
||||||
case ID_ME:
|
case ID_ME:
|
||||||
@@ -437,55 +462,51 @@ PyObject *KeyBlock_CreatePyObject( KeyBlock * kb, Key *parentKey )
|
|||||||
return ( PyObject * ) keyBlock;
|
return ( PyObject * ) keyBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PyObject *KeyBlock_getCurval( BPy_KeyBlock * self ) {
|
||||||
|
return PyFloat_FromDouble( self->keyblock->curval );
|
||||||
|
}
|
||||||
|
|
||||||
static PyObject *KeyBlock_getName( BPy_KeyBlock * self ) {
|
static PyObject *KeyBlock_getName( BPy_KeyBlock * self ) {
|
||||||
BPy_KeyBlock *kb = ( BPy_KeyBlock * ) self;
|
PyObject *name = Py_BuildValue( "s", self->keyblock->name);
|
||||||
PyObject *name = Py_BuildValue( "s", kb->keyblock->name);
|
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *KeyBlock_getPos( BPy_KeyBlock * self ){
|
static PyObject *KeyBlock_getPos( BPy_KeyBlock * self ){
|
||||||
BPy_KeyBlock *kb = ( BPy_KeyBlock * ) self;
|
return PyFloat_FromDouble( self->keyblock->pos );
|
||||||
return PyFloat_FromDouble( kb->keyblock->pos );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *KeyBlock_getSlidermin( BPy_KeyBlock * self ){
|
static PyObject *KeyBlock_getSlidermin( BPy_KeyBlock * self ){
|
||||||
BPy_KeyBlock *kb = ( BPy_KeyBlock * ) self;
|
return PyFloat_FromDouble( self->keyblock->slidermin );
|
||||||
return PyFloat_FromDouble( kb->keyblock->slidermin );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *KeyBlock_getSlidermax( BPy_KeyBlock * self ){
|
static PyObject *KeyBlock_getSlidermax( BPy_KeyBlock * self ){
|
||||||
BPy_KeyBlock *kb = ( BPy_KeyBlock * ) self;
|
return PyFloat_FromDouble( self->keyblock->slidermax );
|
||||||
return PyFloat_FromDouble( kb->keyblock->slidermax );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *KeyBlock_getVgroup( BPy_KeyBlock * self ){
|
static PyObject *KeyBlock_getVgroup( BPy_KeyBlock * self ){
|
||||||
BPy_KeyBlock *kb = ( BPy_KeyBlock * ) self;
|
return Py_BuildValue( "s", self->keyblock->vgroup);
|
||||||
PyObject *name = Py_BuildValue( "s", kb->keyblock->vgroup);
|
|
||||||
return name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int KeyBlock_setName( BPy_KeyBlock * self, PyObject * args ){
|
static int KeyBlock_setName( BPy_KeyBlock * self, PyObject * args ){
|
||||||
char* text = NULL;
|
char* text = NULL;
|
||||||
BPy_KeyBlock *kb = ( BPy_KeyBlock * ) self;
|
|
||||||
|
|
||||||
text = PyString_AsString ( args );
|
text = PyString_AsString ( args );
|
||||||
if( !text )
|
if( !text )
|
||||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||||
"expected string argument" );
|
"expected string argument" );
|
||||||
strncpy( kb->keyblock->name, text , 32);
|
strncpy( self->keyblock->name, text , 32);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int KeyBlock_setVgroup( BPy_KeyBlock * self, PyObject * args ){
|
static int KeyBlock_setVgroup( BPy_KeyBlock * self, PyObject * args ){
|
||||||
char* text = NULL;
|
char* text = NULL;
|
||||||
BPy_KeyBlock *kb = ( BPy_KeyBlock * ) self;
|
|
||||||
|
|
||||||
text = PyString_AsString ( args );
|
text = PyString_AsString ( args );
|
||||||
if( !text )
|
if( !text )
|
||||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||||
"expected string argument" );
|
"expected string argument" );
|
||||||
strncpy( kb->keyblock->vgroup, text , 32);
|
strncpy( self->keyblock->vgroup, text , 32);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -635,7 +656,8 @@ static PyObject *M_Key_Get( PyObject * self, PyObject * args )
|
|||||||
"expected string argument (or nothing)" ) );
|
"expected string argument (or nothing)" ) );
|
||||||
|
|
||||||
if ( name ) {
|
if ( name ) {
|
||||||
for (key_iter = G.main->key.first; key_iter; key_iter=key_iter->id.next) {
|
for (key_iter = G.main->key.first; key_iter;
|
||||||
|
key_iter=key_iter->id.next) {
|
||||||
if (strcmp ( key_iter->id.name + 2, name ) == 0 ) {
|
if (strcmp ( key_iter->id.name + 2, name ) == 0 ) {
|
||||||
return Key_CreatePyObject( key_iter );
|
return Key_CreatePyObject( key_iter );
|
||||||
}
|
}
|
||||||
@@ -643,17 +665,16 @@ static PyObject *M_Key_Get( PyObject * self, PyObject * args )
|
|||||||
|
|
||||||
PyOS_snprintf( error_msg, sizeof( error_msg ),
|
PyOS_snprintf( error_msg, sizeof( error_msg ),
|
||||||
"Key \"%s\" not found", name );
|
"Key \"%s\" not found", name );
|
||||||
return ( EXPP_ReturnPyObjError ( PyExc_NameError, error_msg ) );
|
return EXPP_ReturnPyObjError ( PyExc_NameError, error_msg );
|
||||||
|
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else {
|
|
||||||
|
|
||||||
PyObject *keylist;
|
PyObject *keylist;
|
||||||
|
|
||||||
keylist = PyList_New( BLI_countlist( &( G.main->key ) ) );
|
keylist = PyList_New( BLI_countlist( &( G.main->key ) ) );
|
||||||
|
|
||||||
for ( i=0, key_iter = G.main->key.first; key_iter; key_iter=key_iter->id.next, i++ ) {
|
for ( i=0, key_iter = G.main->key.first; key_iter;
|
||||||
|
key_iter=key_iter->id.next, i++ ) {
|
||||||
PyList_SetItem(keylist, i, Key_CreatePyObject(key_iter));
|
PyList_SetItem(keylist, i, Key_CreatePyObject(key_iter));
|
||||||
}
|
}
|
||||||
return keylist;
|
return keylist;
|
||||||
@@ -665,32 +686,36 @@ struct PyMethodDef M_Key_methods[] = {
|
|||||||
{NULL, NULL, 0, NULL}
|
{NULL, NULL, 0, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static PyObject *M_Key_TypesDict( void )
|
||||||
|
{
|
||||||
|
PyObject *T = PyConstant_New( );
|
||||||
|
|
||||||
|
if( T ) {
|
||||||
|
BPy_constant *d = ( BPy_constant * ) T;
|
||||||
|
|
||||||
|
PyConstant_Insert( d, "MESH", PyInt_FromLong( KEY_TYPE_MESH ) );
|
||||||
|
PyConstant_Insert( d, "CURVE", PyInt_FromLong( KEY_TYPE_CURVE ) );
|
||||||
|
PyConstant_Insert( d, "LATTICE", PyInt_FromLong( KEY_TYPE_LATTICE ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
return T;
|
||||||
|
}
|
||||||
|
|
||||||
PyObject *Key_Init( void )
|
PyObject *Key_Init( void )
|
||||||
{
|
{
|
||||||
PyObject *submodule, *KeyTypes;
|
PyObject *submodule;
|
||||||
|
PyObject *Types = NULL;
|
||||||
|
|
||||||
if( PyType_Ready( &Key_Type ) < 0)
|
if( PyType_Ready( &Key_Type ) < 0 || PyType_Ready( &KeyBlock_Type ) < 0 )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
Key_Type.ob_type = &PyType_Type;
|
|
||||||
PyType_Ready( &KeyBlock_Type );
|
|
||||||
|
|
||||||
submodule =
|
submodule =
|
||||||
Py_InitModule3( "Blender.Key", M_Key_methods, "Key module" );
|
Py_InitModule3( "Blender.Key", M_Key_methods, "Key module" );
|
||||||
|
|
||||||
KeyTypes = PyConstant_New( );
|
Types = M_Key_TypesDict( );
|
||||||
|
if( Types )
|
||||||
|
PyModule_AddObject( submodule, "Types", Types );
|
||||||
|
|
||||||
PyConstant_Insert(( BPy_constant * ) KeyTypes, "MESH", PyInt_FromLong(KEY_TYPE_MESH));
|
|
||||||
PyConstant_Insert(( BPy_constant * ) KeyTypes, "CURVE", PyInt_FromLong(KEY_TYPE_CURVE));
|
|
||||||
PyConstant_Insert(( BPy_constant * ) KeyTypes, "LATTICE", PyInt_FromLong(KEY_TYPE_LATTICE));
|
|
||||||
|
|
||||||
PyModule_AddObject( submodule, "Types", KeyTypes);
|
|
||||||
|
|
||||||
/*
|
|
||||||
PyModule_AddIntConstant( submodule, "TYPE_MESH", KEY_TYPE_MESH );
|
|
||||||
PyModule_AddIntConstant( submodule, "TYPE_CURVE", KEY_TYPE_CURVE );
|
|
||||||
PyModule_AddIntConstant( submodule, "TYPE_LATTICE", KEY_TYPE_LATTICE );
|
|
||||||
*/
|
|
||||||
return submodule;
|
return submodule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,8 +82,6 @@
|
|||||||
#include "constant.h"
|
#include "constant.h"
|
||||||
#include "gen_utils.h"
|
#include "gen_utils.h"
|
||||||
|
|
||||||
#define MESH_TOOLS /* add access to mesh tools */
|
|
||||||
|
|
||||||
/* EXPP Mesh defines */
|
/* EXPP Mesh defines */
|
||||||
|
|
||||||
#define MESH_SMOOTHRESH 30
|
#define MESH_SMOOTHRESH 30
|
||||||
@@ -126,6 +124,7 @@ typedef struct SrchEdges {
|
|||||||
|
|
||||||
typedef struct SrchFaces {
|
typedef struct SrchFaces {
|
||||||
unsigned int v[4]; /* indices for verts */
|
unsigned int v[4]; /* indices for verts */
|
||||||
|
unsigned int index; /* index in original param list of this edge */
|
||||||
unsigned char order; /* order of original verts, bitpacked */
|
unsigned char order; /* order of original verts, bitpacked */
|
||||||
} SrchFaces;
|
} SrchFaces;
|
||||||
|
|
||||||
@@ -155,6 +154,22 @@ int medge_comp( const void *va, const void *vb )
|
|||||||
else return (a[1] > b[1]);
|
else return (a[1] > b[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* compare edges by insert list indices
|
||||||
|
*/
|
||||||
|
|
||||||
|
int medge_index_comp( const void *va, const void *vb )
|
||||||
|
{
|
||||||
|
const SrchEdges *a = (SrchEdges *)va;
|
||||||
|
const SrchEdges *b = (SrchEdges *)vb;
|
||||||
|
|
||||||
|
/* compare list indices for differences */
|
||||||
|
|
||||||
|
if (a->index < b->index) return -1;
|
||||||
|
else return (a->index > b->index);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* compare faces by vertex indices
|
* compare faces by vertex indices
|
||||||
*/
|
*/
|
||||||
@@ -190,6 +205,23 @@ int mface_comp( const void *va, const void *vb )
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* compare faces by insert list indices
|
||||||
|
*/
|
||||||
|
|
||||||
|
int mface_index_comp( const void *va, const void *vb )
|
||||||
|
{
|
||||||
|
const SrchFaces *a = va;
|
||||||
|
const SrchFaces *b = vb;
|
||||||
|
|
||||||
|
/* compare indices, first to last, for differences */
|
||||||
|
if( a->index < b->index )
|
||||||
|
return -1;
|
||||||
|
if( a->index > b->index )
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* compare edges by vertex indices
|
* compare edges by vertex indices
|
||||||
*/
|
*/
|
||||||
@@ -1386,7 +1418,7 @@ static PyObject *MVertSeq_item( BPy_MVertSeq * self, int i )
|
|||||||
"array index out of range" );
|
"array index out of range" );
|
||||||
|
|
||||||
return MVert_CreatePyObject( self->mesh, i );
|
return MVert_CreatePyObject( self->mesh, i );
|
||||||
};
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* retrieve a slice of the vertex list (as a Python list)
|
* retrieve a slice of the vertex list (as a Python list)
|
||||||
@@ -1453,7 +1485,7 @@ static int MVertSeq_assign_item( BPy_MVertSeq * self, int i,
|
|||||||
memcpy( dst, src, sizeof(MVert) );
|
memcpy( dst, src, sizeof(MVert) );
|
||||||
// mesh_update( self->mesh );
|
// mesh_update( self->mesh );
|
||||||
return 0;
|
return 0;
|
||||||
};
|
}
|
||||||
|
|
||||||
static int MVertSeq_assign_slice( BPy_MVertSeq *self, int low, int high,
|
static int MVertSeq_assign_slice( BPy_MVertSeq *self, int low, int high,
|
||||||
PyObject *args )
|
PyObject *args )
|
||||||
@@ -1566,39 +1598,42 @@ static PyObject *MVertSeq_extend( BPy_MVertSeq * self, PyObject *args )
|
|||||||
Mesh *mesh = self->mesh;
|
Mesh *mesh = self->mesh;
|
||||||
/* make sure we get a sequence of tuples of something */
|
/* make sure we get a sequence of tuples of something */
|
||||||
|
|
||||||
switch( PySequence_Size ( args ) ) {
|
switch( PySequence_Size( args ) ) {
|
||||||
case 1: /* better be a list or a tuple */
|
case 1: /* better be a list or a tuple */
|
||||||
tmp = PyTuple_GET_ITEM( args, 0 );
|
tmp = PyTuple_GET_ITEM( args, 0 );
|
||||||
if( !VectorObject_Check ( tmp ) ) {
|
if( !VectorObject_Check ( tmp ) ) {
|
||||||
if( !PySequence_Check ( tmp ) )
|
if( !PySequence_Check ( tmp ) )
|
||||||
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||||
"expected a sequence of tuple triplets" );
|
"expected a sequence of sequence triplets" );
|
||||||
args = tmp;
|
args = tmp;
|
||||||
}
|
}
|
||||||
Py_INCREF( args ); /* so we can safely DECREF later */
|
Py_INCREF( args ); /* so we can safely DECREF later */
|
||||||
break;
|
break;
|
||||||
case 3: /* take any three args and put into a tuple */
|
case 3:
|
||||||
tmp = PyTuple_GET_ITEM( args, 0 );
|
tmp = PyTuple_GET_ITEM( args, 0 );
|
||||||
if( PyTuple_Check( tmp ) ) {
|
/* if first item is not a number, it's wrong */
|
||||||
Py_INCREF( args );
|
if( !PyNumber_Check( tmp ) )
|
||||||
break;
|
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||||
}
|
"expected a sequence of sequence triplets" );
|
||||||
|
|
||||||
|
/* otherwise, put into a new tuple */
|
||||||
args = Py_BuildValue( "((OOO))", tmp,
|
args = Py_BuildValue( "((OOO))", tmp,
|
||||||
PyTuple_GET_ITEM( args, 1 ), PyTuple_GET_ITEM( args, 2 ) );
|
PyTuple_GET_ITEM( args, 1 ), PyTuple_GET_ITEM( args, 2 ) );
|
||||||
if( !args )
|
if( !args )
|
||||||
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
|
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
|
||||||
"Py_BuildValue() failed" );
|
"Py_BuildValue() failed" );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: /* anything else is definitely wrong */
|
default: /* anything else is definitely wrong */
|
||||||
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||||
"expected a sequence of tuple triplets" );
|
"expected a sequence of sequence triplets" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* if no verts given, return quietly */
|
||||||
len = PySequence_Size( args );
|
len = PySequence_Size( args );
|
||||||
if( len == 0 ) {
|
if( len == 0 ) {
|
||||||
Py_DECREF ( args );
|
Py_DECREF ( args );
|
||||||
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
Py_RETURN_NONE;
|
||||||
"expected at least one tuple" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
newlen = mesh->totvert + len;
|
newlen = mesh->totvert + len;
|
||||||
@@ -1620,18 +1655,19 @@ static PyObject *MVertSeq_extend( BPy_MVertSeq * self, PyObject *args )
|
|||||||
}
|
}
|
||||||
for( j = 0; j < 3; ++j )
|
for( j = 0; j < 3; ++j )
|
||||||
co[j] = ((VectorObject *)tmp)->vec[j];
|
co[j] = ((VectorObject *)tmp)->vec[j];
|
||||||
} else if( PyTuple_Check( tmp ) ) {
|
} else if( PySequence_Check( tmp ) ) {
|
||||||
int ok=1;
|
int ok=1;
|
||||||
PyObject *flt;
|
PyObject *flt;
|
||||||
if( PyTuple_Size( tmp ) != 3 )
|
if( PySequence_Size( tmp ) != 3 )
|
||||||
ok = 0;
|
ok = 0;
|
||||||
else
|
else
|
||||||
for( j = 0; ok && j < 3; ++j ) {
|
for( j = 0; ok && j < 3; ++j ) {
|
||||||
flt = PyTuple_GET_ITEM( tmp, j );
|
flt = PySequence_ITEM( tmp, j );
|
||||||
if( !PyNumber_Check ( flt ) )
|
if( !PyNumber_Check ( flt ) )
|
||||||
ok = 0;
|
ok = 0;
|
||||||
else
|
else
|
||||||
co[j] = (float)PyFloat_AsDouble( flt );
|
co[j] = (float)PyFloat_AsDouble( flt );
|
||||||
|
Py_DECREF( flt );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !ok ) {
|
if( !ok ) {
|
||||||
@@ -1639,9 +1675,16 @@ static PyObject *MVertSeq_extend( BPy_MVertSeq * self, PyObject *args )
|
|||||||
Py_DECREF ( args );
|
Py_DECREF ( args );
|
||||||
Py_DECREF ( tmp );
|
Py_DECREF ( tmp );
|
||||||
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
||||||
"expected tuple triplet of floats" );
|
"expected sequence triplet of floats" );
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
MEM_freeN( newvert );
|
||||||
|
Py_DECREF ( args );
|
||||||
|
Py_DECREF ( tmp );
|
||||||
|
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
||||||
|
"expected sequence triplet of floats" );
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_DECREF ( tmp );
|
Py_DECREF ( tmp );
|
||||||
|
|
||||||
/* add the coordinate to the new list */
|
/* add the coordinate to the new list */
|
||||||
@@ -1714,7 +1757,7 @@ static PyObject *MVertSeq_extend( BPy_MVertSeq * self, PyObject *args )
|
|||||||
mesh_update( mesh );
|
mesh_update( mesh );
|
||||||
|
|
||||||
Py_DECREF ( args );
|
Py_DECREF ( args );
|
||||||
return EXPP_incr_ret( Py_None );
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *MVertSeq_delete( BPy_MVertSeq * self, PyObject *args )
|
static PyObject *MVertSeq_delete( BPy_MVertSeq * self, PyObject *args )
|
||||||
@@ -1725,15 +1768,20 @@ static PyObject *MVertSeq_delete( BPy_MVertSeq * self, PyObject *args )
|
|||||||
Mesh *mesh = self->mesh;
|
Mesh *mesh = self->mesh;
|
||||||
MFace *tmpface;
|
MFace *tmpface;
|
||||||
|
|
||||||
Py_INCREF( args ); /* so we can safely DECREF later */
|
/*
|
||||||
|
* if input tuple contains a single sequence, use it as input instead;
|
||||||
/* accept a sequence (lists or tuples) also */
|
* otherwise use the sequence as-is and check later that it contains
|
||||||
|
* one or more integers or MVerts
|
||||||
|
*/
|
||||||
if( PySequence_Size( args ) == 1 ) {
|
if( PySequence_Size( args ) == 1 ) {
|
||||||
PyObject *tmp = PyTuple_GET_ITEM( args, 0 );
|
PyObject *tmp = PyTuple_GET_ITEM( args, 0 );
|
||||||
if( PySequence_Check ( tmp ) ) {
|
if( PySequence_Check( tmp ) )
|
||||||
Py_DECREF( args ); /* release previous reference */
|
args = tmp;
|
||||||
args = tmp; /* PyTuple_GET_ITEM returns new ref */
|
}
|
||||||
}
|
|
||||||
|
/* if sequence is empty, do nothing */
|
||||||
|
if( PySequence_Size( args ) == 0 ) {
|
||||||
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* allocate vertex lookup table */
|
/* allocate vertex lookup table */
|
||||||
@@ -1747,18 +1795,15 @@ static PyObject *MVertSeq_delete( BPy_MVertSeq * self, PyObject *args )
|
|||||||
if( BPy_MVert_Check( tmp ) ) {
|
if( BPy_MVert_Check( tmp ) ) {
|
||||||
if( (void *)self->mesh != ((BPy_MVert*)tmp)->data ) {
|
if( (void *)self->mesh != ((BPy_MVert*)tmp)->data ) {
|
||||||
MEM_freeN( vert_table );
|
MEM_freeN( vert_table );
|
||||||
Py_DECREF( args );
|
|
||||||
Py_DECREF( tmp );
|
Py_DECREF( tmp );
|
||||||
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
||||||
"MVert belongs to a different mesh" );
|
"MVert belongs to a different mesh" );
|
||||||
}
|
}
|
||||||
index = ((BPy_MVert*)tmp)->index;
|
index = ((BPy_MVert*)tmp)->index;
|
||||||
}
|
} else if( PyInt_CheckExact( tmp ) ) {
|
||||||
else if( PyInt_CheckExact( tmp ) )
|
|
||||||
index = PyInt_AsLong ( tmp );
|
index = PyInt_AsLong ( tmp );
|
||||||
else {
|
} else {
|
||||||
MEM_freeN( vert_table );
|
MEM_freeN( vert_table );
|
||||||
Py_DECREF( args );
|
|
||||||
Py_DECREF( tmp );
|
Py_DECREF( tmp );
|
||||||
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||||
"expected a sequence of ints or MVerts" );
|
"expected a sequence of ints or MVerts" );
|
||||||
@@ -1766,8 +1811,7 @@ static PyObject *MVertSeq_delete( BPy_MVertSeq * self, PyObject *args )
|
|||||||
Py_DECREF( tmp );
|
Py_DECREF( tmp );
|
||||||
if( index < 0 || index >= mesh->totvert ) {
|
if( index < 0 || index >= mesh->totvert ) {
|
||||||
MEM_freeN( vert_table );
|
MEM_freeN( vert_table );
|
||||||
Py_DECREF( args );
|
return EXPP_ReturnPyObjError( PyExc_IndexError,
|
||||||
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
|
||||||
"array index out of range" );
|
"array index out of range" );
|
||||||
}
|
}
|
||||||
vert_table[index] = UINT_MAX;
|
vert_table[index] = UINT_MAX;
|
||||||
@@ -1802,8 +1846,7 @@ static PyObject *MVertSeq_delete( BPy_MVertSeq * self, PyObject *args )
|
|||||||
/* clean up and exit */
|
/* clean up and exit */
|
||||||
MEM_freeN( vert_table );
|
MEM_freeN( vert_table );
|
||||||
mesh_update ( mesh );
|
mesh_update ( mesh );
|
||||||
Py_DECREF( args );
|
Py_RETURN_NONE;
|
||||||
return EXPP_incr_ret( Py_None );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *MVertSeq_selected( BPy_MVertSeq * self )
|
static PyObject *MVertSeq_selected( BPy_MVertSeq * self )
|
||||||
@@ -2413,40 +2456,52 @@ static PyObject *MEdgeSeq_extend( BPy_MEdgeSeq * self, PyObject *args )
|
|||||||
MEdge *tmpedge;
|
MEdge *tmpedge;
|
||||||
Mesh *mesh = self->mesh;
|
Mesh *mesh = self->mesh;
|
||||||
|
|
||||||
/* make sure we get a sequence of tuples of something */
|
/* make sure we get a tuple of sequences of something */
|
||||||
|
switch( PySequence_Size( args ) ) {
|
||||||
switch( PySequence_Size ( args ) ) {
|
case 1:
|
||||||
case 1: /* better be a list or a tuple */
|
/* if a sequence... */
|
||||||
args = PyTuple_GET_ITEM( args, 0 );
|
tmp = PyTuple_GET_ITEM( args, 0 );
|
||||||
if( !PySequence_Check ( args ) )
|
if( PySequence_Check( tmp ) ) {
|
||||||
|
/* if another sequence, use it */
|
||||||
|
PyObject *tmp2 = PySequence_ITEM( tmp, 0 );
|
||||||
|
if( PySequence_Check( tmp2 ) )
|
||||||
|
args = tmp;
|
||||||
|
Py_INCREF( args );
|
||||||
|
Py_DECREF( tmp2 );
|
||||||
|
} else
|
||||||
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||||
"expected a sequence of tuple pairs" );
|
"expected a sequence of sequence pairs" );
|
||||||
Py_INCREF( args ); /* so we can safely DECREF later */
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
case 4: /* two to four args may be individual verts */
|
case 4: /* two to four args may be individual verts */
|
||||||
tmp = PyTuple_GET_ITEM( args, 0 );
|
tmp = PyTuple_GET_ITEM( args, 0 );
|
||||||
if( PyTuple_Check( tmp ) ) {/* maybe just tuples, so use args as-is */
|
/*
|
||||||
|
* if first item isn't a sequence, then assume it's a bunch of MVerts
|
||||||
|
* and wrap inside a tuple
|
||||||
|
*/
|
||||||
|
if( !PySequence_Check( tmp ) ) {
|
||||||
|
args = Py_BuildValue( "(O)", args );
|
||||||
|
if( !args )
|
||||||
|
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
|
||||||
|
"Py_BuildValue() failed" );
|
||||||
|
/*
|
||||||
|
* otherwise, assume it already a bunch of sequences so use as-is
|
||||||
|
*/
|
||||||
|
} else {
|
||||||
Py_INCREF( args ); /* so we can safely DECREF later */
|
Py_INCREF( args ); /* so we can safely DECREF later */
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
args = Py_BuildValue( "(O)", args );
|
|
||||||
if( !args )
|
|
||||||
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
|
|
||||||
"Py_BuildValue() failed" );
|
|
||||||
break;
|
break;
|
||||||
default: /* anything else is definitely wrong */
|
default: /* anything else is definitely wrong */
|
||||||
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||||
"expected a sequence of tuple pairs" );
|
"expected a sequence of sequence pairs" );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* make sure there is something to add */
|
/* make sure there is something to add */
|
||||||
len = PySequence_Size( args );
|
len = PySequence_Size( args );
|
||||||
if( len == 0 ) {
|
if( len == 0 ) {
|
||||||
Py_DECREF( args );
|
Py_DECREF ( args );
|
||||||
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
Py_RETURN_NONE;
|
||||||
"expected at least one tuple" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* verify the param list and get a total count of number of edges */
|
/* verify the param list and get a total count of number of edges */
|
||||||
@@ -2455,21 +2510,21 @@ static PyObject *MEdgeSeq_extend( BPy_MEdgeSeq * self, PyObject *args )
|
|||||||
tmp = PySequence_GetItem( args, i );
|
tmp = PySequence_GetItem( args, i );
|
||||||
|
|
||||||
/* not a tuple of MVerts... error */
|
/* not a tuple of MVerts... error */
|
||||||
if( !PyTuple_Check( tmp ) ||
|
if( !PySequence_Check( tmp ) ||
|
||||||
EXPP_check_sequence_consistency( tmp, &MVert_Type ) != 1 ) {
|
EXPP_check_sequence_consistency( tmp, &MVert_Type ) != 1 ) {
|
||||||
Py_DECREF( tmp );
|
Py_DECREF( tmp );
|
||||||
Py_DECREF( args );
|
Py_DECREF( args );
|
||||||
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
||||||
"expected sequence of MVert tuples" );
|
"expected sequence of MVert sequences" );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* not the right number of MVerts... error */
|
/* not the right number of MVerts... error */
|
||||||
nverts = PyTuple_Size( tmp );
|
nverts = PySequence_Size( tmp );
|
||||||
if( nverts < 2 || nverts > 4 ) {
|
if( nverts < 2 || nverts > 4 ) {
|
||||||
Py_DECREF( tmp );
|
Py_DECREF( tmp );
|
||||||
Py_DECREF( args );
|
Py_DECREF( args );
|
||||||
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
||||||
"expected 2 to 4 MVerts per tuple" );
|
"expected 2 to 4 MVerts per sequence" );
|
||||||
}
|
}
|
||||||
Py_DECREF( tmp );
|
Py_DECREF( tmp );
|
||||||
|
|
||||||
@@ -2486,14 +2541,15 @@ static PyObject *MEdgeSeq_extend( BPy_MEdgeSeq * self, PyObject *args )
|
|||||||
/* scan the input list and build the new edge pair list */
|
/* scan the input list and build the new edge pair list */
|
||||||
len = PySequence_Size( args );
|
len = PySequence_Size( args );
|
||||||
tmppair = newpair;
|
tmppair = newpair;
|
||||||
|
new_edge_count = 0;
|
||||||
for( i = 0; i < len; ++i ) {
|
for( i = 0; i < len; ++i ) {
|
||||||
int edge_count;
|
int edge_count;
|
||||||
tmp = PySequence_GetItem( args, i );
|
tmp = PySequence_GetItem( args, i );
|
||||||
nverts = PyTuple_Size( tmp );
|
nverts = PySequence_Size( tmp );
|
||||||
|
|
||||||
/* get copies of vertices */
|
/* get new references for the vertices */
|
||||||
for(j = 0; j < nverts; ++j )
|
for(j = 0; j < nverts; ++j )
|
||||||
e[j] = (BPy_MVert *)PyTuple_GET_ITEM( tmp, j );
|
e[j] = (BPy_MVert *)PySequence_GetItem( tmp, j );
|
||||||
Py_DECREF( tmp );
|
Py_DECREF( tmp );
|
||||||
|
|
||||||
if( nverts == 2 )
|
if( nverts == 2 )
|
||||||
@@ -2518,12 +2574,20 @@ static PyObject *MEdgeSeq_extend( BPy_MEdgeSeq * self, PyObject *args )
|
|||||||
tmppair->swap = 1;
|
tmppair->swap = 1;
|
||||||
} else {
|
} else {
|
||||||
MEM_freeN( newpair );
|
MEM_freeN( newpair );
|
||||||
|
for(j = 0; j < nverts; ++j )
|
||||||
|
Py_DECREF( e[j] );
|
||||||
Py_DECREF( args );
|
Py_DECREF( args );
|
||||||
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
||||||
"tuple contains duplicate vertices" );
|
"tuple contains duplicate vertices" );
|
||||||
}
|
}
|
||||||
|
tmppair->index = new_edge_count;
|
||||||
|
++new_edge_count;
|
||||||
tmppair++;
|
tmppair++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* free the new references */
|
||||||
|
for( j = 0; j < nverts; ++j )
|
||||||
|
Py_DECREF( e[j] );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sort the new edge pairs */
|
/* sort the new edge pairs */
|
||||||
@@ -2605,6 +2669,9 @@ static PyObject *MEdgeSeq_extend( BPy_MEdgeSeq * self, PyObject *args )
|
|||||||
}
|
}
|
||||||
mesh->medge = tmpedge; /* point to the new edge list */
|
mesh->medge = tmpedge; /* point to the new edge list */
|
||||||
|
|
||||||
|
/* resort edges into original order */
|
||||||
|
qsort( newpair, new_edge_count, sizeof(SrchEdges), medge_index_comp );
|
||||||
|
|
||||||
/* point to the first edge we're going to add */
|
/* point to the first edge we're going to add */
|
||||||
tmpedge = &mesh->medge[mesh->totedge];
|
tmpedge = &mesh->medge[mesh->totedge];
|
||||||
tmppair = newpair;
|
tmppair = newpair;
|
||||||
@@ -2632,7 +2699,7 @@ static PyObject *MEdgeSeq_extend( BPy_MEdgeSeq * self, PyObject *args )
|
|||||||
mesh_update( mesh );
|
mesh_update( mesh );
|
||||||
MEM_freeN( newpair );
|
MEM_freeN( newpair );
|
||||||
Py_DECREF ( args );
|
Py_DECREF ( args );
|
||||||
return EXPP_incr_ret( Py_None );
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *MEdgeSeq_delete( BPy_MEdgeSeq * self, PyObject *args )
|
static PyObject *MEdgeSeq_delete( BPy_MEdgeSeq * self, PyObject *args )
|
||||||
@@ -2644,19 +2711,23 @@ static PyObject *MEdgeSeq_delete( BPy_MEdgeSeq * self, PyObject *args )
|
|||||||
int i, len;
|
int i, len;
|
||||||
int face_count, edge_count, vert_count;
|
int face_count, edge_count, vert_count;
|
||||||
|
|
||||||
Py_INCREF( args ); /* so we can safely DECREF later */
|
/*
|
||||||
|
* if input tuple contains a single sequence, use it as input instead;
|
||||||
/* accept a sequence (lists or tuples) also */
|
* otherwise use the sequence as-is and check later that it contains
|
||||||
|
* one or more integers or MVerts
|
||||||
|
*/
|
||||||
if( PySequence_Size( args ) == 1 ) {
|
if( PySequence_Size( args ) == 1 ) {
|
||||||
PyObject *tmp = PyTuple_GET_ITEM( args, 0 );
|
PyObject *tmp = PyTuple_GET_ITEM( args, 0 );
|
||||||
if( PySequence_Check ( tmp ) ) {
|
if( PySequence_Check( tmp ) )
|
||||||
Py_DECREF( args ); /* release previous reference */
|
args = tmp;
|
||||||
args = tmp; /* PyTuple_GET_ITEM returns new ref */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* see how many args we need to parse */
|
/* if sequence is empty, do nothing */
|
||||||
len = PySequence_Size( args );
|
len = PySequence_Size( args );
|
||||||
|
if( len == 0 ) {
|
||||||
|
Py_RETURN_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
edge_table = (unsigned int *)MEM_callocN( len*sizeof( unsigned int ),
|
edge_table = (unsigned int *)MEM_callocN( len*sizeof( unsigned int ),
|
||||||
"edge_table" );
|
"edge_table" );
|
||||||
|
|
||||||
@@ -2670,7 +2741,6 @@ static PyObject *MEdgeSeq_delete( BPy_MEdgeSeq * self, PyObject *args )
|
|||||||
else {
|
else {
|
||||||
MEM_freeN( edge_table );
|
MEM_freeN( edge_table );
|
||||||
Py_DECREF( tmp );
|
Py_DECREF( tmp );
|
||||||
Py_DECREF( args );
|
|
||||||
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||||
"expected a sequence of ints or MEdges" );
|
"expected a sequence of ints or MEdges" );
|
||||||
}
|
}
|
||||||
@@ -2679,7 +2749,6 @@ static PyObject *MEdgeSeq_delete( BPy_MEdgeSeq * self, PyObject *args )
|
|||||||
/* if index out-of-range, throw exception */
|
/* if index out-of-range, throw exception */
|
||||||
if( edge_table[i] >= (unsigned int)mesh->totedge ) {
|
if( edge_table[i] >= (unsigned int)mesh->totedge ) {
|
||||||
MEM_freeN( edge_table );
|
MEM_freeN( edge_table );
|
||||||
Py_DECREF( args );
|
|
||||||
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
||||||
"array index out of range" );
|
"array index out of range" );
|
||||||
}
|
}
|
||||||
@@ -2773,9 +2842,8 @@ static PyObject *MEdgeSeq_delete( BPy_MEdgeSeq * self, PyObject *args )
|
|||||||
MEM_freeN( del_table );
|
MEM_freeN( del_table );
|
||||||
MEM_freeN( vert_table );
|
MEM_freeN( vert_table );
|
||||||
MEM_freeN( edge_table );
|
MEM_freeN( edge_table );
|
||||||
Py_DECREF( args );
|
|
||||||
mesh_update ( mesh );
|
mesh_update ( mesh );
|
||||||
return EXPP_incr_ret( Py_None );
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *MEdgeSeq_selected( BPy_MEdgeSeq * self )
|
static PyObject *MEdgeSeq_selected( BPy_MEdgeSeq * self )
|
||||||
@@ -3388,21 +3456,22 @@ static int MFace_setUV( BPy_MFace * self, PyObject * value )
|
|||||||
if( !MFace_get_pointer( self ) )
|
if( !MFace_get_pointer( self ) )
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if( !PyTuple_Check( value ) ||
|
if( !PySequence_Check( value ) ||
|
||||||
EXPP_check_sequence_consistency( value, &vector_Type ) != 1 )
|
EXPP_check_sequence_consistency( value, &vector_Type ) != 1 )
|
||||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||||
"expected tuple of vectors" );
|
"expected sequence of vectors" );
|
||||||
|
|
||||||
length = self->mesh->mface[self->index].v4 ? 4 : 3;
|
length = self->mesh->mface[self->index].v4 ? 4 : 3;
|
||||||
if( length != PyTuple_Size( value ) )
|
if( length != PySequence_Size( value ) )
|
||||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||||
"size of vertex and UV lists differ" );
|
"size of vertex and UV sequences differ" );
|
||||||
|
|
||||||
face = &self->mesh->tface[self->index];
|
face = &self->mesh->tface[self->index];
|
||||||
for( i=0; i<length; ++i ) {
|
for( i=0; i<length; ++i ) {
|
||||||
VectorObject *vector = (VectorObject *)PyTuple_GET_ITEM( value, i );
|
VectorObject *vector = (VectorObject *)PySequence_ITEM( value, i );
|
||||||
face->uv[i][0] = vector->vec[0];
|
face->uv[i][0] = vector->vec[0];
|
||||||
face->uv[i][1] = vector->vec[1];
|
face->uv[i][1] = vector->vec[1];
|
||||||
|
Py_DECREF( vector );
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -3531,6 +3600,54 @@ static PyObject *MFace_getCol( BPy_MFace * self )
|
|||||||
return attr;
|
return attr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* set a face's vertex colors
|
||||||
|
*/
|
||||||
|
|
||||||
|
static int MFace_setCol( BPy_MFace * self, PyObject *value )
|
||||||
|
{
|
||||||
|
int length, i;
|
||||||
|
MCol * mcol;
|
||||||
|
|
||||||
|
/* if there's no mesh color vectors or texture faces, nothing to do */
|
||||||
|
|
||||||
|
if( !self->mesh->mcol && !self->mesh->tface )
|
||||||
|
return EXPP_ReturnIntError( PyExc_ValueError,
|
||||||
|
"face has no vertex colors" );
|
||||||
|
|
||||||
|
if( !MFace_get_pointer( self ) )
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if( self->mesh->tface )
|
||||||
|
mcol = (MCol *) self->mesh->tface[self->index].col;
|
||||||
|
else
|
||||||
|
mcol = &self->mesh->mcol[self->index*4];
|
||||||
|
|
||||||
|
length = self->mesh->mface[self->index].v4 ? 4 : 3;
|
||||||
|
|
||||||
|
if( !PyList_Check( value ) && !PyTuple_Check( value ) )
|
||||||
|
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||||
|
"expected a sequence of MCols" );
|
||||||
|
|
||||||
|
if( EXPP_check_sequence_consistency( value, &MCol_Type ) != 1 )
|
||||||
|
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||||
|
"expected a sequence of MCols" );
|
||||||
|
|
||||||
|
if( PySequence_Size( value ) != length )
|
||||||
|
return EXPP_ReturnIntError( PyExc_ValueError,
|
||||||
|
"incorrect number of colors for this face" );
|
||||||
|
|
||||||
|
for( i=0; i<length; ++i ) {
|
||||||
|
BPy_MCol *obj = (BPy_MCol *)PySequence_ITEM( value, i );
|
||||||
|
mcol[i].r = obj->color->r;
|
||||||
|
mcol[i].g = obj->color->g;
|
||||||
|
mcol[i].b = obj->color->b;
|
||||||
|
mcol[i].a = obj->color->a;
|
||||||
|
Py_DECREF( obj );
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
*
|
*
|
||||||
* Python MFace_Type attributes get/set structure
|
* Python MFace_Type attributes get/set structure
|
||||||
@@ -3575,7 +3692,7 @@ static PyGetSetDef BPy_MFace_getseters[] = {
|
|||||||
/* attributes for texture faces (mostly, I think) */
|
/* attributes for texture faces (mostly, I think) */
|
||||||
|
|
||||||
{"col",
|
{"col",
|
||||||
(getter)MFace_getCol, (setter)NULL,
|
(getter)MFace_getCol, (setter)MFace_setCol,
|
||||||
"face's vertex colors",
|
"face's vertex colors",
|
||||||
NULL},
|
NULL},
|
||||||
{"flag",
|
{"flag",
|
||||||
@@ -3888,43 +4005,56 @@ static PyObject *MFaceSeq_extend( BPy_MEdgeSeq * self, PyObject *args )
|
|||||||
tmp = MEdgeSeq_extend( self, args );
|
tmp = MEdgeSeq_extend( self, args );
|
||||||
if( !tmp )
|
if( !tmp )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
Py_DECREF( tmp );
|
Py_DECREF( tmp );
|
||||||
|
|
||||||
/* make sure we get a sequence of tuples of something */
|
/* make sure we get a tuple of sequences of something */
|
||||||
|
|
||||||
switch( PySequence_Size ( args ) ) {
|
switch( PySequence_Size( args ) ) {
|
||||||
case 1: /* better be a list or a tuple */
|
case 1: /* better be a sequence or a tuple */
|
||||||
args = PyTuple_GET_ITEM( args, 0 );
|
/* if a sequence... */
|
||||||
if( !PySequence_Check ( args ) )
|
tmp = PyTuple_GET_ITEM( args, 0 );
|
||||||
|
if( PySequence_Check( tmp ) ) {
|
||||||
|
/* if another sequence, use it */
|
||||||
|
PyObject *tmp2 = PySequence_ITEM( tmp, 0 );
|
||||||
|
if( PySequence_Check( tmp2 ) )
|
||||||
|
args = tmp;
|
||||||
|
Py_INCREF( args );
|
||||||
|
Py_DECREF( tmp2 );
|
||||||
|
} else
|
||||||
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||||
"expected a sequence of tuple pairs" );
|
"expected a sequence of sequence pairs" );
|
||||||
Py_INCREF( args ); /* so we can safely DECREF later */
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
case 4: /* two to four args may be individual verts */
|
case 4: /* two to four args may be individual verts */
|
||||||
tmp = PyTuple_GET_ITEM( args, 0 );
|
tmp = PyTuple_GET_ITEM( args, 0 );
|
||||||
if( PyTuple_Check( tmp ) ) {/* maybe just tuples, so use args as-is */
|
/*
|
||||||
|
* if first item isn't a sequence, then assume it's a bunch of MVerts
|
||||||
|
* and wrap inside a tuple
|
||||||
|
*/
|
||||||
|
if( !PySequence_Check( tmp ) ) {
|
||||||
|
args = Py_BuildValue( "(O)", args );
|
||||||
|
if( !args )
|
||||||
|
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
|
||||||
|
"Py_BuildValue() failed" );
|
||||||
|
/*
|
||||||
|
* otherwise, assume it already a bunch of sequences so use as-is
|
||||||
|
*/
|
||||||
|
} else {
|
||||||
Py_INCREF( args ); /* so we can safely DECREF later */
|
Py_INCREF( args ); /* so we can safely DECREF later */
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
args = Py_BuildValue( "(O)", args );
|
|
||||||
if( !args )
|
|
||||||
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
|
|
||||||
"Py_BuildValue() failed" );
|
|
||||||
break;
|
break;
|
||||||
default: /* anything else is definitely wrong */
|
default: /* anything else is definitely wrong */
|
||||||
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||||
"expected a sequence of tuple pairs" );
|
"expected a sequence of sequence pairs" );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* make sure there is something to add */
|
/* if nothing to add, just exit */
|
||||||
len = PySequence_Size( args );
|
len = PySequence_Size( args );
|
||||||
if( len == 0 ) {
|
if( len == 0 ) {
|
||||||
Py_DECREF( args );
|
Py_DECREF( args );
|
||||||
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
Py_RETURN_NONE;
|
||||||
"expected at least one tuple" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* verify the param list and get a total count of number of edges */
|
/* verify the param list and get a total count of number of edges */
|
||||||
@@ -3933,19 +4063,19 @@ static PyObject *MFaceSeq_extend( BPy_MEdgeSeq * self, PyObject *args )
|
|||||||
tmp = PySequence_GetItem( args, i );
|
tmp = PySequence_GetItem( args, i );
|
||||||
|
|
||||||
/* not a tuple of MVerts... error */
|
/* not a tuple of MVerts... error */
|
||||||
if( !PyTuple_Check( tmp ) ||
|
if( !PySequence_Check( tmp ) ||
|
||||||
EXPP_check_sequence_consistency( tmp, &MVert_Type ) != 1 ) {
|
EXPP_check_sequence_consistency( tmp, &MVert_Type ) != 1 ) {
|
||||||
Py_DECREF( args );
|
Py_DECREF( args );
|
||||||
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
||||||
"expected sequence of MVert tuples" );
|
"expected sequence of MVert sequences" );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* not the right number of MVerts... error */
|
/* not the right number of MVerts... error */
|
||||||
nverts = PyTuple_Size( tmp );
|
nverts = PySequence_Size( tmp );
|
||||||
if( nverts < 2 || nverts > 4 ) {
|
if( nverts < 2 || nverts > 4 ) {
|
||||||
Py_DECREF( args );
|
Py_DECREF( args );
|
||||||
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
||||||
"expected 2 to 4 MVerts per tuple" );
|
"expected 2 to 4 MVerts per sequence" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( nverts != 2 ) /* new faces cannot have only 2 verts */
|
if( nverts != 2 ) /* new faces cannot have only 2 verts */
|
||||||
@@ -3965,7 +4095,7 @@ static PyObject *MFaceSeq_extend( BPy_MEdgeSeq * self, PyObject *args )
|
|||||||
unsigned int vert[4]={0,0,0,0};
|
unsigned int vert[4]={0,0,0,0};
|
||||||
unsigned char order[4]={0,1,2,3};
|
unsigned char order[4]={0,1,2,3};
|
||||||
tmp = PySequence_GetItem( args, i );
|
tmp = PySequence_GetItem( args, i );
|
||||||
nverts = PyTuple_Size( tmp );
|
nverts = PySequence_Size( tmp );
|
||||||
|
|
||||||
if( nverts == 2 ) /* again, ignore 2-vert tuples */
|
if( nverts == 2 ) /* again, ignore 2-vert tuples */
|
||||||
break;
|
break;
|
||||||
@@ -3975,15 +4105,19 @@ static PyObject *MFaceSeq_extend( BPy_MEdgeSeq * self, PyObject *args )
|
|||||||
* vertices are not index 0
|
* vertices are not index 0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
e = (BPy_MVert *)PyTuple_GET_ITEM( tmp, 0 );
|
e = (BPy_MVert *)PySequence_ITEM( tmp, 0 );
|
||||||
tmpface.v1 = e->index;
|
tmpface.v1 = e->index;
|
||||||
e = (BPy_MVert *)PyTuple_GET_ITEM( tmp, 1 );
|
Py_DECREF( e );
|
||||||
|
e = (BPy_MVert *)PySequence_ITEM( tmp, 1 );
|
||||||
tmpface.v2 = e->index;
|
tmpface.v2 = e->index;
|
||||||
e = (BPy_MVert *)PyTuple_GET_ITEM( tmp, 2 );
|
Py_DECREF( e );
|
||||||
|
e = (BPy_MVert *)PySequence_ITEM( tmp, 2 );
|
||||||
tmpface.v3 = e->index;
|
tmpface.v3 = e->index;
|
||||||
|
Py_DECREF( e );
|
||||||
if( nverts == 4 ) {
|
if( nverts == 4 ) {
|
||||||
e = (BPy_MVert *)PyTuple_GET_ITEM( tmp, 3 );
|
e = (BPy_MVert *)PySequence_ITEM( tmp, 3 );
|
||||||
tmpface.v4 = e->index;
|
tmpface.v4 = e->index;
|
||||||
|
Py_DECREF( e );
|
||||||
}
|
}
|
||||||
Py_DECREF( tmp );
|
Py_DECREF( tmp );
|
||||||
|
|
||||||
@@ -4016,6 +4150,7 @@ static PyObject *MFaceSeq_extend( BPy_MEdgeSeq * self, PyObject *args )
|
|||||||
}
|
}
|
||||||
tmppair->v[j] = vert[j];
|
tmppair->v[j] = vert[j];
|
||||||
}
|
}
|
||||||
|
tmppair->index = i;
|
||||||
|
|
||||||
/* pack order into a byte */
|
/* pack order into a byte */
|
||||||
tmppair->order = order[0]|(order[1]<<2)|(order[2]<<4)|(order[3]<<6);
|
tmppair->order = order[0]|(order[1]<<2)|(order[2]<<4)|(order[3]<<6);
|
||||||
@@ -4111,6 +4246,9 @@ static PyObject *MFaceSeq_extend( BPy_MEdgeSeq * self, PyObject *args )
|
|||||||
mesh->tface = tmptface;
|
mesh->tface = tmptface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* sort the faces back into their original input list order */
|
||||||
|
qsort( newpair, new_face_count, sizeof(SrchFaces), mface_index_comp );
|
||||||
|
|
||||||
/* allocate new face list */
|
/* allocate new face list */
|
||||||
tmpface = MEM_callocN(totface*sizeof(MFace), "Mesh_addFaces");
|
tmpface = MEM_callocN(totface*sizeof(MFace), "Mesh_addFaces");
|
||||||
|
|
||||||
@@ -4157,7 +4295,7 @@ static PyObject *MFaceSeq_extend( BPy_MEdgeSeq * self, PyObject *args )
|
|||||||
mesh_update( mesh );
|
mesh_update( mesh );
|
||||||
Py_DECREF ( args );
|
Py_DECREF ( args );
|
||||||
MEM_freeN( newpair );
|
MEM_freeN( newpair );
|
||||||
return EXPP_incr_ret( Py_None );
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct fourEdges
|
struct fourEdges
|
||||||
@@ -4196,7 +4334,7 @@ static PyObject *MFaceSeq_delete( BPy_MFaceSeq * self, PyObject *args )
|
|||||||
if( BPy_MFace_Check( tmp ) )
|
if( BPy_MFace_Check( tmp ) )
|
||||||
face_table[i] = ((BPy_MFace *)tmp)->index;
|
face_table[i] = ((BPy_MFace *)tmp)->index;
|
||||||
else if( PyInt_CheckExact( tmp ) )
|
else if( PyInt_CheckExact( tmp ) )
|
||||||
face_table[i] = PyInt_AsLong ( tmp );
|
face_table[i] = PyInt_AsLong( tmp );
|
||||||
else {
|
else {
|
||||||
MEM_freeN( face_table );
|
MEM_freeN( face_table );
|
||||||
Py_DECREF( tmp );
|
Py_DECREF( tmp );
|
||||||
@@ -4276,7 +4414,7 @@ static PyObject *MFaceSeq_delete( BPy_MFaceSeq * self, PyObject *args )
|
|||||||
verts[0] = tmpface->v1;
|
verts[0] = tmpface->v1;
|
||||||
verts[1] = tmpface->v2;
|
verts[1] = tmpface->v2;
|
||||||
verts[2] = tmpface->v3;
|
verts[2] = tmpface->v3;
|
||||||
if(len == 4)
|
if( len == 4 )
|
||||||
verts[3] = tmpface->v4;
|
verts[3] = tmpface->v4;
|
||||||
for( j = 0; j < len; ++j ) {
|
for( j = 0; j < len; ++j ) {
|
||||||
k = (j+1) % len;
|
k = (j+1) % len;
|
||||||
@@ -5373,7 +5511,53 @@ static PyObject *Mesh_getVertGroupNames( BPy_Mesh * self )
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MESH_TOOLS
|
static PyObject *Mesh_getVertexInfluences( BPy_Mesh * self, PyObject * args )
|
||||||
|
{
|
||||||
|
int index;
|
||||||
|
PyObject *influence_list = NULL;
|
||||||
|
Object *object = self->object;
|
||||||
|
Mesh *me = self->mesh;
|
||||||
|
|
||||||
|
/* Get a reference to the mesh object wrapped in here. */
|
||||||
|
if( !object )
|
||||||
|
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
|
||||||
|
"This mesh must be linked to an object" );
|
||||||
|
|
||||||
|
/* Parse the parameters: only on integer (vertex index) */
|
||||||
|
if( !PyArg_ParseTuple( args, "i", &index ) )
|
||||||
|
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||||
|
"expected int argument (index of the vertex)" );
|
||||||
|
|
||||||
|
/* check for valid index */
|
||||||
|
if( index < 0 || index >= me->totvert )
|
||||||
|
return EXPP_ReturnPyObjError( PyExc_IndexError,
|
||||||
|
"vertex index out of range" );
|
||||||
|
|
||||||
|
influence_list = PyList_New( 0 );
|
||||||
|
|
||||||
|
/* Proceed only if we have vertex deformation information */
|
||||||
|
if( me->dvert ) {
|
||||||
|
int i;
|
||||||
|
MDeformWeight *sweight = NULL;
|
||||||
|
|
||||||
|
/* Number of bones influencing the vertex */
|
||||||
|
int totinfluences = me->dvert[index].totweight;
|
||||||
|
|
||||||
|
/* Get the reference of the first weight structure */
|
||||||
|
sweight = me->dvert[index].dw;
|
||||||
|
|
||||||
|
/* Build the list only with weights and names of the influent bones */
|
||||||
|
for( i = 0; i < totinfluences; i++, sweight++ ) {
|
||||||
|
bDeformGroup *defgroup = BLI_findlink( &object->defbase,
|
||||||
|
sweight->def_nr );
|
||||||
|
if( defgroup )
|
||||||
|
PyList_Append( influence_list, Py_BuildValue( "[sf]",
|
||||||
|
defgroup->name, sweight->weight ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return influence_list;
|
||||||
|
}
|
||||||
|
|
||||||
static PyObject *Mesh_Tools( BPy_Mesh * self, int type, void **args )
|
static PyObject *Mesh_Tools( BPy_Mesh * self, int type, void **args )
|
||||||
{
|
{
|
||||||
@@ -5575,8 +5759,6 @@ static PyObject *Mesh_fill( BPy_Mesh * self )
|
|||||||
return Mesh_Tools( self, MESH_TOOL_FILL, NULL );
|
return Mesh_Tools( self, MESH_TOOL_FILL, NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static struct PyMethodDef BPy_Mesh_methods[] = {
|
static struct PyMethodDef BPy_Mesh_methods[] = {
|
||||||
{"calcNormals", (PyCFunction)Mesh_calcNormals, METH_NOARGS,
|
{"calcNormals", (PyCFunction)Mesh_calcNormals, METH_NOARGS,
|
||||||
"all recalculate vertex normals"},
|
"all recalculate vertex normals"},
|
||||||
@@ -5604,10 +5786,10 @@ static struct PyMethodDef BPy_Mesh_methods[] = {
|
|||||||
"Rename an existing vertex group"},
|
"Rename an existing vertex group"},
|
||||||
{"getVertGroupNames", (PyCFunction)Mesh_getVertGroupNames, METH_NOARGS,
|
{"getVertGroupNames", (PyCFunction)Mesh_getVertGroupNames, METH_NOARGS,
|
||||||
"Get names of vertex groups"},
|
"Get names of vertex groups"},
|
||||||
|
{"getVertexInfluences", (PyCFunction)Mesh_getVertexInfluences, METH_VARARGS,
|
||||||
|
"Get list of the influences of bones for a given mesh vertex"},
|
||||||
|
|
||||||
|
/* Mesh tools */
|
||||||
|
|
||||||
#ifdef MESH_TOOLS
|
|
||||||
{"smooth", (PyCFunction)Mesh_smooth, METH_NOARGS,
|
{"smooth", (PyCFunction)Mesh_smooth, METH_NOARGS,
|
||||||
"Flattens angle of selected faces (experimental)"},
|
"Flattens angle of selected faces (experimental)"},
|
||||||
{"flipNormals", (PyCFunction)Mesh_flipNormals, METH_NOARGS,
|
{"flipNormals", (PyCFunction)Mesh_flipNormals, METH_NOARGS,
|
||||||
@@ -5626,7 +5808,6 @@ static struct PyMethodDef BPy_Mesh_methods[] = {
|
|||||||
"Removes duplicates from selected vertices (experimental)"},
|
"Removes duplicates from selected vertices (experimental)"},
|
||||||
{"recalcNormals", (PyCFunction)Mesh_recalcNormals, METH_VARARGS,
|
{"recalcNormals", (PyCFunction)Mesh_recalcNormals, METH_VARARGS,
|
||||||
"Recalculates inside or outside normals (experimental)"},
|
"Recalculates inside or outside normals (experimental)"},
|
||||||
#endif
|
|
||||||
{NULL, NULL, 0, NULL}
|
{NULL, NULL, 0, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -5906,8 +6087,12 @@ static int Mesh_setFlag( BPy_Mesh * self, PyObject *value, void *type )
|
|||||||
MEM_freeN( mesh->tface );
|
MEM_freeN( mesh->tface );
|
||||||
mesh->tface = NULL;
|
mesh->tface = NULL;
|
||||||
}
|
}
|
||||||
} else if( !mesh->tface )
|
} else if( !mesh->tface ) {
|
||||||
|
if( !mesh->totface )
|
||||||
|
return EXPP_ReturnIntError( PyExc_RuntimeError,
|
||||||
|
"mesh has no faces" );
|
||||||
make_tfaces( mesh );
|
make_tfaces( mesh );
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
case MESH_HASMCOL:
|
case MESH_HASMCOL:
|
||||||
if( !param ) {
|
if( !param ) {
|
||||||
@@ -6098,8 +6283,6 @@ static PyGetSetDef BPy_Mesh_getseters[] = {
|
|||||||
(getter)Mesh_getMode, (setter)Mesh_setMode,
|
(getter)Mesh_getMode, (setter)Mesh_setMode,
|
||||||
"The mesh's mode bitfield",
|
"The mesh's mode bitfield",
|
||||||
NULL},
|
NULL},
|
||||||
|
|
||||||
|
|
||||||
{"faceUV",
|
{"faceUV",
|
||||||
(getter)Mesh_getFlag, (setter)Mesh_setFlag,
|
(getter)Mesh_getFlag, (setter)Mesh_setFlag,
|
||||||
"UV-mapped textured faces enabled",
|
"UV-mapped textured faces enabled",
|
||||||
@@ -6124,11 +6307,6 @@ static PyGetSetDef BPy_Mesh_getseters[] = {
|
|||||||
{NULL,NULL,NULL,NULL,NULL} /* Sentinel */
|
{NULL,NULL,NULL,NULL,NULL} /* Sentinel */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/* Python Mesh_Type callback function prototypes: */
|
|
||||||
/*****************************************************************************/
|
|
||||||
static void Mesh_dealloc( BPy_Mesh * object );
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* Python Mesh_Type structure definition: */
|
/* Python Mesh_Type structure definition: */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -6329,6 +6507,28 @@ static PyObject *M_Mesh_MVert( PyObject * self, PyObject * args )
|
|||||||
return PVert_CreatePyObject( &vert );
|
return PVert_CreatePyObject( &vert );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PyObject *M_Mesh_Modes( PyObject * self, PyObject * args )
|
||||||
|
{
|
||||||
|
int modes = 0;
|
||||||
|
|
||||||
|
if( !G.scene ) {
|
||||||
|
Py_RETURN_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !PyArg_ParseTuple( args, "|i", &modes ) )
|
||||||
|
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||||
|
"expected optional int as argument" );
|
||||||
|
|
||||||
|
if( modes > ( SCE_SELECT_VERTEX | SCE_SELECT_EDGE | SCE_SELECT_FACE ) )
|
||||||
|
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
||||||
|
"value out of range" );
|
||||||
|
|
||||||
|
if( modes > 0 )
|
||||||
|
G.scene->selectmode = modes;
|
||||||
|
|
||||||
|
return PyInt_FromLong( G.scene->selectmode );
|
||||||
|
}
|
||||||
|
|
||||||
static struct PyMethodDef M_Mesh_methods[] = {
|
static struct PyMethodDef M_Mesh_methods[] = {
|
||||||
{"New", (PyCFunction)M_Mesh_New, METH_VARARGS,
|
{"New", (PyCFunction)M_Mesh_New, METH_VARARGS,
|
||||||
"Create a new mesh"},
|
"Create a new mesh"},
|
||||||
@@ -6336,10 +6536,12 @@ static struct PyMethodDef M_Mesh_methods[] = {
|
|||||||
"Get a mesh by name"},
|
"Get a mesh by name"},
|
||||||
{"MVert", (PyCFunction)M_Mesh_MVert, METH_VARARGS,
|
{"MVert", (PyCFunction)M_Mesh_MVert, METH_VARARGS,
|
||||||
"Create a new MVert"},
|
"Create a new MVert"},
|
||||||
|
{"Mode", (PyCFunction)M_Mesh_Modes, METH_VARARGS,
|
||||||
|
"Get/set edit selection mode(s)"},
|
||||||
{NULL, NULL, 0, NULL},
|
{NULL, NULL, 0, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
static PyObject *M_Mesh_Modes( void )
|
static PyObject *M_Mesh_ModesDict( void )
|
||||||
{
|
{
|
||||||
PyObject *Modes = PyConstant_New( );
|
PyObject *Modes = PyConstant_New( );
|
||||||
|
|
||||||
@@ -6444,18 +6646,32 @@ static PyObject *M_Mesh_VertAssignDict( void )
|
|||||||
return Vert;
|
return Vert;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static PyObject *M_Mesh_SelectModeDict( void )
|
||||||
|
{
|
||||||
|
PyObject *Mode = PyConstant_New( );
|
||||||
|
if( Mode ) {
|
||||||
|
BPy_constant *d = ( BPy_constant * ) Mode;
|
||||||
|
PyConstant_Insert(d, "VERTEX", PyInt_FromLong(SCE_SELECT_VERTEX));
|
||||||
|
PyConstant_Insert(d, "EDGE", PyInt_FromLong(SCE_SELECT_EDGE));
|
||||||
|
PyConstant_Insert(d, "FACE", PyInt_FromLong(SCE_SELECT_FACE));
|
||||||
|
}
|
||||||
|
return Mode;
|
||||||
|
}
|
||||||
|
|
||||||
static char M_Mesh_doc[] = "The Blender.Mesh submodule";
|
static char M_Mesh_doc[] = "The Blender.Mesh submodule";
|
||||||
|
|
||||||
PyObject *Mesh_Init( void )
|
PyObject *Mesh_Init( void )
|
||||||
{
|
{
|
||||||
PyObject *submodule;
|
PyObject *submodule;
|
||||||
|
|
||||||
PyObject *Modes = M_Mesh_Modes( );
|
PyObject *Modes = M_Mesh_ModesDict( );
|
||||||
PyObject *FaceFlags = M_Mesh_FaceFlagsDict( );
|
PyObject *FaceFlags = M_Mesh_FaceFlagsDict( );
|
||||||
PyObject *FaceModes = M_Mesh_FaceModesDict( );
|
PyObject *FaceModes = M_Mesh_FaceModesDict( );
|
||||||
PyObject *FaceTranspModes = M_Mesh_FaceTranspModesDict( );
|
PyObject *FaceTranspModes = M_Mesh_FaceTranspModesDict( );
|
||||||
PyObject *EdgeFlags = M_Mesh_EdgeFlagsDict( );
|
PyObject *EdgeFlags = M_Mesh_EdgeFlagsDict( );
|
||||||
PyObject *AssignModes = M_Mesh_VertAssignDict( );
|
PyObject *AssignModes = M_Mesh_VertAssignDict( );
|
||||||
|
PyObject *SelectModes = M_Mesh_SelectModeDict( );
|
||||||
|
|
||||||
if( PyType_Ready( &MCol_Type ) < 0 )
|
if( PyType_Ready( &MCol_Type ) < 0 )
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -6491,6 +6707,8 @@ PyObject *Mesh_Init( void )
|
|||||||
PyModule_AddObject( submodule, "EdgeFlags", EdgeFlags );
|
PyModule_AddObject( submodule, "EdgeFlags", EdgeFlags );
|
||||||
if( AssignModes )
|
if( AssignModes )
|
||||||
PyModule_AddObject( submodule, "AssignModes", AssignModes );
|
PyModule_AddObject( submodule, "AssignModes", AssignModes );
|
||||||
|
if( SelectModes )
|
||||||
|
PyModule_AddObject( submodule, "SelectModes", SelectModes );
|
||||||
|
|
||||||
|
|
||||||
return submodule;
|
return submodule;
|
||||||
|
|||||||
@@ -471,11 +471,15 @@ PyObject *Action_CreatePyObject( struct bAction * act )
|
|||||||
{
|
{
|
||||||
BPy_Action *blen_action;
|
BPy_Action *blen_action;
|
||||||
|
|
||||||
|
if(!act)
|
||||||
|
return EXPP_incr_ret(Py_None);
|
||||||
|
|
||||||
blen_action =
|
blen_action =
|
||||||
( BPy_Action * ) PyObject_NEW( BPy_Action, &Action_Type );
|
( BPy_Action * ) PyObject_NEW( BPy_Action, &Action_Type );
|
||||||
|
|
||||||
if( blen_action == NULL ) {
|
if( !blen_action) {
|
||||||
return ( NULL );
|
return ( EXPP_ReturnPyObjError
|
||||||
|
( PyExc_RuntimeError, "failure to create object!" ) );
|
||||||
}
|
}
|
||||||
blen_action->action = act;
|
blen_action->action = act;
|
||||||
return ( ( PyObject * ) blen_action );
|
return ( ( PyObject * ) blen_action );
|
||||||
|
|||||||
@@ -39,6 +39,8 @@
|
|||||||
/** NLA module initialization function. */
|
/** NLA module initialization function. */
|
||||||
PyObject *NLA_Init( void );
|
PyObject *NLA_Init( void );
|
||||||
|
|
||||||
|
extern PyTypeObject Action_Type;
|
||||||
|
|
||||||
/** Python BPy_NLA structure definition. */
|
/** Python BPy_NLA structure definition. */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
PyObject_HEAD
|
PyObject_HEAD
|
||||||
|
|||||||
@@ -1466,71 +1466,55 @@ static PyObject *NMesh_update( PyObject *self, PyObject *a, PyObject *kwd )
|
|||||||
* influences that this vertex receives.
|
* influences that this vertex receives.
|
||||||
* @author Jordi Rovira i Bonet
|
* @author Jordi Rovira i Bonet
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static PyObject *NMesh_getVertexInfluences( PyObject * self, PyObject * args )
|
static PyObject *NMesh_getVertexInfluences( PyObject * self, PyObject * args )
|
||||||
{
|
{
|
||||||
int index;
|
int index;
|
||||||
PyObject *influence_list = NULL;
|
PyObject *influence_list = NULL;
|
||||||
|
Object *object = ( ( BPy_NMesh * ) self )->object;
|
||||||
/* Get a reference to the mesh object wrapped in here. */
|
|
||||||
Mesh *me = ( ( BPy_NMesh * ) self )->mesh;
|
Mesh *me = ( ( BPy_NMesh * ) self )->mesh;
|
||||||
|
|
||||||
|
/* Get a reference to the mesh object wrapped in here. */
|
||||||
if( !me )
|
if( !me )
|
||||||
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
|
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
|
||||||
"unlinked nmesh: call its .update() method first" );
|
"unlinked nmesh: call its .update() method first" );
|
||||||
|
|
||||||
|
if( !object )
|
||||||
|
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
|
||||||
|
"This mesh must be linked to an object" );
|
||||||
|
|
||||||
/* Parse the parameters: only on integer (vertex index) */
|
/* Parse the parameters: only on integer (vertex index) */
|
||||||
if( !PyArg_ParseTuple( args, "i", &index ) )
|
if( !PyArg_ParseTuple( args, "i", &index ) )
|
||||||
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||||
"expected int argument (index of the vertex)" );
|
"expected int argument (index of the vertex)" );
|
||||||
|
|
||||||
/* Proceed only if we have vertex deformation information and index is valid */
|
/* check for valid index */
|
||||||
|
if( index < 0 || index >= me->totvert )
|
||||||
|
return EXPP_ReturnPyObjError( PyExc_IndexError,
|
||||||
|
"vertex index out of range" );
|
||||||
|
|
||||||
|
influence_list = PyList_New( 0 );
|
||||||
|
|
||||||
|
/* Proceed only if we have vertex deformation information */
|
||||||
if( me->dvert ) {
|
if( me->dvert ) {
|
||||||
if( ( index >= 0 ) && ( index < me->totvert ) ) {
|
int i;
|
||||||
|
MDeformWeight *sweight = NULL;
|
||||||
|
|
||||||
int i;
|
/* Number of bones influencing the vertex */
|
||||||
MDeformWeight *sweight = NULL;
|
int totinfluences = me->dvert[index].totweight;
|
||||||
|
|
||||||
/* Number of bones influencing the vertex */
|
/* Get the reference of the first weight structure */
|
||||||
int totinfluences = me->dvert[index].totweight;
|
sweight = me->dvert[index].dw;
|
||||||
|
|
||||||
/* Build the list only with weights and names of the influent bones */
|
/* Build the list only with weights and names of the influent bones */
|
||||||
/*influence_list = PyList_New(totinfluences); */
|
for( i = 0; i < totinfluences; i++, sweight++ ) {
|
||||||
influence_list = PyList_New( 0 );
|
bDeformGroup *defgroup = (bDeformGroup *) BLI_findlink( &object->defbase,
|
||||||
|
sweight->def_nr );
|
||||||
/* Get the reference of the first weight structure */
|
if( defgroup )
|
||||||
sweight = me->dvert[index].dw;
|
PyList_Append( influence_list, Py_BuildValue( "[sf]",
|
||||||
|
defgroup->name, sweight->weight ) );
|
||||||
for( i = 0; i < totinfluences; i++ ) {
|
}
|
||||||
/*Add the weight and the name of the bone, which is used to identify it */
|
}
|
||||||
|
|
||||||
/* Disabled this code, it couldn't be correct!
|
|
||||||
* sweight->data was being set to a posechannel not a bone
|
|
||||||
* for one thing, and it is not always set for another.
|
|
||||||
* The only thing safe here is to return the defgroup number. -zr
|
|
||||||
*/
|
|
||||||
// if( sweight->data )
|
|
||||||
/* valid bone: return its name */
|
|
||||||
/* PyList_SetItem(influence_list, i,
|
|
||||||
Py_BuildValue("[sf]", sweight->data->name, sweight->weight));
|
|
||||||
else // NULL bone: return Py_None instead
|
|
||||||
PyList_SetItem(influence_list, i,
|
|
||||||
Py_BuildValue("[Of]", Py_None, sweight->weight)); */
|
|
||||||
// PyList_Append( influence_list,
|
|
||||||
// Py_BuildValue( "[sf]",
|
|
||||||
// sweight->
|
|
||||||
// data->
|
|
||||||
// name,
|
|
||||||
// sweight->
|
|
||||||
// weight ) );
|
|
||||||
|
|
||||||
/* Next weight */
|
|
||||||
sweight++;
|
|
||||||
}
|
|
||||||
} else //influence_list = PyList_New(0);
|
|
||||||
return EXPP_ReturnPyObjError( PyExc_IndexError,
|
|
||||||
"vertex index out of range" );
|
|
||||||
} else
|
|
||||||
influence_list = PyList_New( 0 );
|
|
||||||
|
|
||||||
return influence_list;
|
return influence_list;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,9 @@ struct rctf;
|
|||||||
#include "NLA.h"
|
#include "NLA.h"
|
||||||
#include "logic.h"
|
#include "logic.h"
|
||||||
#include "Effect.h"
|
#include "Effect.h"
|
||||||
|
#include "Pose.h"
|
||||||
#include "gen_utils.h"
|
#include "gen_utils.h"
|
||||||
|
#include "BIF_editkey.h"
|
||||||
|
|
||||||
/* Defines for insertIpoKey */
|
/* Defines for insertIpoKey */
|
||||||
|
|
||||||
@@ -291,6 +293,7 @@ static PyObject *Object_getSBUseEdges( BPy_Object * self );
|
|||||||
static PyObject *Object_setSBUseEdges( BPy_Object * self, PyObject * args );
|
static PyObject *Object_setSBUseEdges( BPy_Object * self, PyObject * args );
|
||||||
static PyObject *Object_getSBStiffQuads( BPy_Object * self );
|
static PyObject *Object_getSBStiffQuads( BPy_Object * self );
|
||||||
static PyObject *Object_setSBStiffQuads( BPy_Object * self, PyObject * args );
|
static PyObject *Object_setSBStiffQuads( BPy_Object * self, PyObject * args );
|
||||||
|
static PyObject *Object_insertShapeKey(BPy_Object * self);
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* Python BPy_Object methods table: */
|
/* Python BPy_Object methods table: */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -322,7 +325,7 @@ If 'name_only' is nonzero or True, only the name of the datablock is returned"},
|
|||||||
{"getAction", ( PyCFunction ) Object_getAction, METH_NOARGS,
|
{"getAction", ( PyCFunction ) Object_getAction, METH_NOARGS,
|
||||||
"Returns the active action for this object"},
|
"Returns the active action for this object"},
|
||||||
{"getPose", ( PyCFunction ) Object_getPose, METH_NOARGS,
|
{"getPose", ( PyCFunction ) Object_getPose, METH_NOARGS,
|
||||||
"Returns the pose for this object"},
|
"() - returns the pose from an object if it exists, else None"},
|
||||||
{"isSelected", ( PyCFunction ) Object_isSelected, METH_NOARGS,
|
{"isSelected", ( PyCFunction ) Object_isSelected, METH_NOARGS,
|
||||||
"Return a 1 or 0 depending on whether the object is selected"},
|
"Return a 1 or 0 depending on whether the object is selected"},
|
||||||
{"getEuler", ( PyCFunction ) Object_getEuler, METH_NOARGS,
|
{"getEuler", ( PyCFunction ) Object_getEuler, METH_NOARGS,
|
||||||
@@ -585,7 +588,8 @@ works only if self and the object specified are of the same type."},
|
|||||||
"([s1<,s2,s3...>]) - Delete specified scriptlinks from this object."},
|
"([s1<,s2,s3...>]) - Delete specified scriptlinks from this object."},
|
||||||
{"setDupliVerts", ( PyCFunction ) Object_setDupliVerts,
|
{"setDupliVerts", ( PyCFunction ) Object_setDupliVerts,
|
||||||
METH_VARARGS, "() - set or reset duplicate child objects on all vertices"},
|
METH_VARARGS, "() - set or reset duplicate child objects on all vertices"},
|
||||||
|
{"insertShapeKey", ( PyCFunction ) Object_insertShapeKey,
|
||||||
|
METH_NOARGS, "() - Insert a Shape Key in the current object"},
|
||||||
{NULL, NULL, 0, NULL}
|
{NULL, NULL, 0, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -750,9 +754,13 @@ PyObject *M_Object_Get( PyObject * self, PyObject * args )
|
|||||||
object = GetObjectByName( name );
|
object = GetObjectByName( name );
|
||||||
|
|
||||||
/* No object exists with the name specified in the argument name. */
|
/* No object exists with the name specified in the argument name. */
|
||||||
if( !object )
|
if( !object ){
|
||||||
return EXPP_ReturnPyObjError( PyExc_AttributeError,
|
char buffer[128];
|
||||||
"Unknown object specified." );
|
PyOS_snprintf( buffer, sizeof(buffer),
|
||||||
|
"object \"%s\" not found", name);
|
||||||
|
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
||||||
|
buffer );
|
||||||
|
}
|
||||||
|
|
||||||
return Object_CreatePyObject( object );
|
return Object_CreatePyObject( object );
|
||||||
} else {
|
} else {
|
||||||
@@ -883,7 +891,7 @@ static PyObject *M_Object_Duplicate( PyObject * self, PyObject * args, PyObject
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
PyObject *Object_Init( void )
|
PyObject *Object_Init( void )
|
||||||
{
|
{
|
||||||
PyObject *module;
|
PyObject *module, *dict;
|
||||||
|
|
||||||
Object_Type.ob_type = &PyType_Type;
|
Object_Type.ob_type = &PyType_Type;
|
||||||
|
|
||||||
@@ -908,6 +916,11 @@ PyObject *Object_Init( void )
|
|||||||
PyModule_AddIntConstant( module, "MAGNET",PFIELD_MAGNET );
|
PyModule_AddIntConstant( module, "MAGNET",PFIELD_MAGNET );
|
||||||
PyModule_AddIntConstant( module, "WIND",PFIELD_WIND );
|
PyModule_AddIntConstant( module, "WIND",PFIELD_WIND );
|
||||||
|
|
||||||
|
//Add SUBMODULES to the module
|
||||||
|
dict = PyModule_GetDict( module ); //borrowed
|
||||||
|
PyDict_SetItemString(dict, "Pose", Pose_Init()); //creates a *new* module
|
||||||
|
//PyDict_SetItemString(dict, "Constraint", Constraint_Init()); //creates a *new* module
|
||||||
|
|
||||||
return ( module );
|
return ( module );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1178,6 +1191,7 @@ static PyObject *Object_getAction( BPy_Object * self )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static PyObject *Object_getPose( BPy_Object * self )
|
static PyObject *Object_getPose( BPy_Object * self )
|
||||||
{
|
{
|
||||||
/*BPy_Action *py_action = NULL; */
|
/*BPy_Action *py_action = NULL; */
|
||||||
@@ -1190,6 +1204,14 @@ static PyObject *Object_getPose( BPy_Object * self )
|
|||||||
return Pose_CreatePyObject( self->object->pose );
|
return Pose_CreatePyObject( self->object->pose );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static PyObject * Object_getPose(BPy_Object *self)
|
||||||
|
{
|
||||||
|
//if there is no pose will return PyNone
|
||||||
|
return PyPose_FromPose(self->object->pose, self->object->id.name+2);
|
||||||
|
}
|
||||||
|
|
||||||
static PyObject *Object_isSelected( BPy_Object * self )
|
static PyObject *Object_isSelected( BPy_Object * self )
|
||||||
{
|
{
|
||||||
Base *base;
|
Base *base;
|
||||||
@@ -3011,6 +3033,12 @@ static PyObject *Object_getEffects( BPy_Object * self )
|
|||||||
return effect_list;
|
return effect_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PyObject *Object_insertShapeKey(BPy_Object * self)
|
||||||
|
{
|
||||||
|
insert_shapekey(self->object);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* Function: Object_CreatePyObject */
|
/* Function: Object_CreatePyObject */
|
||||||
/* Description: This function will create a new BlenObject from an existing */
|
/* Description: This function will create a new BlenObject from an existing */
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,24 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* $Id:
|
||||||
|
*
|
||||||
|
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version. The Blender
|
||||||
|
* Foundation also sells licenses for use in proprietary software under
|
||||||
|
* the Blender License. See http://www.blender.org/BL/ for information
|
||||||
|
* about this.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*
|
||||||
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Contributor(s): Joseph Gilbert
|
||||||
|
*
|
||||||
|
* ***** END GPL/BL DUAL LICENSE BLOCK *****
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef EXPP_POSE_H
|
#ifndef EXPP_POSE_H
|
||||||
#define EXPP_POSE_H
|
#define EXPP_POSE_H
|
||||||
|
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
|
#include "DNA_action_types.h"
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
//-------------------TYPE CHECKS---------------------------------
|
||||||
#include <config.h>
|
#define PoseObject_Check(v) ((v)->ob_type == &Pose_Type)
|
||||||
#endif
|
#define PoseBoneObject_Check(v) ((v)->ob_type == &PoseBone_Type)
|
||||||
|
#define PoseBonesDictObject_Check(v) ((v)->ob_type == &PoseBonesDict_Type)
|
||||||
#include <DNA_action_types.h>
|
//-------------------TYPEOBJECT----------------------------------
|
||||||
|
|
||||||
/* EXPP PyType Objects */
|
|
||||||
extern PyTypeObject Pose_Type;
|
extern PyTypeObject Pose_Type;
|
||||||
|
extern PyTypeObject PoseBone_Type;
|
||||||
struct BPy_Pose;
|
extern PyTypeObject PoseBonesDict_Type;
|
||||||
|
//-------------------STRUCT DEFINITION----------------------------
|
||||||
|
typedef struct {
|
||||||
|
PyObject_HEAD
|
||||||
|
PyObject *bonesMap;
|
||||||
|
ListBase *bones;
|
||||||
|
} BPy_PoseBonesDict;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
PyObject_HEAD /* required python macro */
|
PyObject_HEAD
|
||||||
bPose * pose;
|
bPose *pose;
|
||||||
} BPy_Pose; /* a pose */
|
char name[24]; //because poses have not names :(
|
||||||
|
BPy_PoseBonesDict *Bones;
|
||||||
|
} BPy_Pose;
|
||||||
|
|
||||||
PyObject *Pose_CreatePyObject( bPose * p );
|
typedef struct {
|
||||||
|
PyObject_HEAD
|
||||||
|
bPoseChannel *posechannel;
|
||||||
|
} BPy_PoseBone;
|
||||||
|
|
||||||
#endif /* EXPP_KEY_H */
|
//-------------------VISIBLE PROTOTYPES-------------------------
|
||||||
|
PyObject *Pose_Init(void);
|
||||||
|
PyObject *PyPose_FromPose(bPose *pose, char *name);
|
||||||
|
PyObject *PyPoseBone_FromPosechannel(bPoseChannel *pchan);
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -889,20 +889,23 @@ static PyObject *M_Window_EditMode( PyObject * self, PyObject * args )
|
|||||||
short status = -1;
|
short status = -1;
|
||||||
char *undo_str = "From script";
|
char *undo_str = "From script";
|
||||||
int undo_str_len = 11;
|
int undo_str_len = 11;
|
||||||
|
int do_undo = 1;
|
||||||
|
|
||||||
if( !PyArg_ParseTuple
|
if( !PyArg_ParseTuple( args,
|
||||||
( args, "|hs#", &status, &undo_str, &undo_str_len ) )
|
"|hs#i", &status, &undo_str, &undo_str_len, &do_undo ) )
|
||||||
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||||
"expected nothing or an int (bool) and a string as arguments" );
|
"expected optional int (bool), string and int (bool) as arguments" );
|
||||||
|
|
||||||
if( status >= 0 ) {
|
if( status >= 0 ) {
|
||||||
if( status ) {
|
if( status ) {
|
||||||
if( !G.obedit )
|
if( !G.obedit )
|
||||||
enter_editmode( );
|
enter_editmode( );
|
||||||
} else if( G.obedit ) {
|
} else if( G.obedit ) {
|
||||||
if( undo_str_len > 63 )
|
if( do_undo && U.undosteps != 0 ) {
|
||||||
undo_str[63] = '\0'; /* 64 is max */
|
if( undo_str_len > 63 )
|
||||||
undo_push_mesh( undo_str ); /* use better solution after 2.34 */
|
undo_str[63] = '\0'; /* 64 is max */
|
||||||
|
undo_push_mesh( undo_str ); /* use better solution after 2.34 */
|
||||||
|
}
|
||||||
exit_editmode( 1 );
|
exit_editmode( 1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ static PyMethodDef BPy_constant_methods[] = {
|
|||||||
"() - Returns the keys the dictionary"},
|
"() - Returns the keys the dictionary"},
|
||||||
{"values", (PyCFunction) constant_values, METH_NOARGS,
|
{"values", (PyCFunction) constant_values, METH_NOARGS,
|
||||||
"() - Returns the values from the dictionary"},
|
"() - Returns the values from the dictionary"},
|
||||||
{NULL}
|
{NULL, NULL, 0, NULL}
|
||||||
};
|
};
|
||||||
//------------------------mp_length
|
//------------------------mp_length
|
||||||
static int constantLength(BPy_constant *self)
|
static int constantLength(BPy_constant *self)
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ The Blender Python API Reference
|
|||||||
- L{NMesh} (*)
|
- L{NMesh} (*)
|
||||||
- L{Noise}
|
- L{Noise}
|
||||||
- L{Object} (*)
|
- L{Object} (*)
|
||||||
|
- L{Pose}
|
||||||
- L{Registry}
|
- L{Registry}
|
||||||
- L{Scene}
|
- L{Scene}
|
||||||
- L{Radio}
|
- L{Radio}
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ class Bone:
|
|||||||
@type matrix: Matrix Object
|
@type matrix: Matrix Object
|
||||||
@ivar parent: The parent Bone.
|
@ivar parent: The parent Bone.
|
||||||
@type parent: Bone Object
|
@type parent: Bone Object
|
||||||
@ivar children: The children bones.
|
@ivar children: The children directly attached to this bone.
|
||||||
@type children: List of Bone Objects
|
@type children: List of Bone Objects
|
||||||
@ivar weight: The bone's weight.
|
@ivar weight: The bone's weight.
|
||||||
@type weight: Float
|
@type weight: Float
|
||||||
@@ -246,6 +246,13 @@ class Bone:
|
|||||||
@rtype: Bool
|
@rtype: Bool
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
def getAllChildren():
|
||||||
|
"""
|
||||||
|
Gets all the children under this bone including the children's children.
|
||||||
|
@rtype: List of Bone object
|
||||||
|
@return: all bones under this one
|
||||||
|
"""
|
||||||
|
|
||||||
class Editbone:
|
class Editbone:
|
||||||
"""
|
"""
|
||||||
The Editbone Object
|
The Editbone Object
|
||||||
@@ -260,7 +267,7 @@ class Editbone:
|
|||||||
@type head: Vector Object
|
@type head: Vector Object
|
||||||
@ivar tail: This Bone's "tail" ending position when in rest state (armaturespace).
|
@ivar tail: This Bone's "tail" ending position when in rest state (armaturespace).
|
||||||
@type tail: Vector Object
|
@type tail: Vector Object
|
||||||
@ivar matrix: This Bone's matrix. (armaturespace) This cannot be set.
|
@ivar matrix: This Bone's matrix. (armaturespace)
|
||||||
@type matrix: Matrix Object
|
@type matrix: Matrix Object
|
||||||
@ivar parent: The parent Bone.
|
@ivar parent: The parent Bone.
|
||||||
@type parent: Editbone Object
|
@type parent: Editbone Object
|
||||||
|
|||||||
@@ -297,6 +297,16 @@ class IpoCurve:
|
|||||||
Can be Constant, Extrapolation, Cyclic or Cyclic_extrapolation.
|
Can be Constant, Extrapolation, Cyclic or Cyclic_extrapolation.
|
||||||
@rtype: None
|
@rtype: None
|
||||||
@return: None
|
@return: None
|
||||||
|
@note: Cyclic Ipo curves never reach the end value. If the first and
|
||||||
|
last bezier points do not have the same y coordinate, the value of the
|
||||||
|
curve when it "cycles" is that of the first point. If a user wants to
|
||||||
|
get the value of the final curve point, read the final point from the
|
||||||
|
curve's L{bezierPoints} attribute::
|
||||||
|
|
||||||
|
ipo = Blender.Object.Get('Cube').ipo
|
||||||
|
icu = ipo.getCurves('LocX')
|
||||||
|
endtime,endvalue = icu.bezierPoints[-1].pt
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def getExtrapolation():
|
def getExtrapolation():
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ The Blender.Key submodule.
|
|||||||
This module provides access to B{Key} objects in Blender.
|
This module provides access to B{Key} objects in Blender.
|
||||||
|
|
||||||
@type Types: readonly dictionary
|
@type Types: readonly dictionary
|
||||||
@var Types: The type of a key, indicating the type of data in the
|
@var Types: The type of a key owner, indicating the type of data in the
|
||||||
data blocks.
|
data blocks.
|
||||||
- MESH - the key is a Mesh key; data blocks contain
|
- MESH - the key is a Mesh key; data blocks contain
|
||||||
L{NMVert<NMesh.NMVert>} vertices.
|
L{NMVert<NMesh.NMVert>} vertices.
|
||||||
@@ -15,7 +15,6 @@ data blocks.
|
|||||||
3 floating point numbers).
|
3 floating point numbers).
|
||||||
- LATTICE - the key is a Lattice key; data blocks contain
|
- LATTICE - the key is a Lattice key; data blocks contain
|
||||||
BPoints, each point represented by a list of 3 floating point numbers.
|
BPoints, each point represented by a list of 3 floating point numbers.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def Get(name = None):
|
def Get(name = None):
|
||||||
@@ -38,7 +37,7 @@ class Key:
|
|||||||
keyframe data.
|
keyframe data.
|
||||||
|
|
||||||
@ivar ipo: Key Ipo. Contains the Ipo if one is assigned to the
|
@ivar ipo: Key Ipo. Contains the Ipo if one is assigned to the
|
||||||
object, B{None} otherwise. Setting to B{None} clears the current Ipo..
|
object, B{None} otherwise. Setting to B{None} clears the current Ipo.
|
||||||
@type ipo: Blender Ipo
|
@type ipo: Blender Ipo
|
||||||
@ivar value: The value of the key. Read-only.
|
@ivar value: The value of the key. Read-only.
|
||||||
@type value: float
|
@type value: float
|
||||||
@@ -47,6 +46,8 @@ class Key:
|
|||||||
@type type: int
|
@type type: int
|
||||||
@ivar blocks: A list of KeyBlocks for the key. Read-only.
|
@ivar blocks: A list of KeyBlocks for the key. Read-only.
|
||||||
@type blocks: Blender KeyBlock.
|
@type blocks: Blender KeyBlock.
|
||||||
|
@ivar relative: Indicates whether the key is relative(=True) or normal.
|
||||||
|
@type relative: bool
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def getIpo():
|
def getIpo():
|
||||||
@@ -66,6 +67,8 @@ class KeyBlock:
|
|||||||
Each Key object has a list of KeyBlocks attached, each KeyBlock
|
Each Key object has a list of KeyBlocks attached, each KeyBlock
|
||||||
representing a keyframe.
|
representing a keyframe.
|
||||||
|
|
||||||
|
@ivar curval: Current value of the corresponding IpoCurve. Read-only.
|
||||||
|
@type curval: float
|
||||||
@ivar name: The name of the Keyblock. Truncated to 32 characters.
|
@ivar name: The name of the Keyblock. Truncated to 32 characters.
|
||||||
@type name: string
|
@type name: string
|
||||||
@ivar pos: The position of the keyframe.
|
@ivar pos: The position of the keyframe.
|
||||||
|
|||||||
@@ -493,6 +493,7 @@ class Vector:
|
|||||||
def resize4D():
|
def resize4D():
|
||||||
"""
|
"""
|
||||||
Resize the vector to 4d. New axis will be 0.0.
|
Resize the vector to 4d. New axis will be 0.0.
|
||||||
|
The last component will be 1.0, to make multiplying 3d vectors by 4x4 matrices easier.
|
||||||
@return: a copy of itself
|
@return: a copy of itself
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
@@ -112,6 +112,11 @@ Example::
|
|||||||
already associated with a group, else it does nothing.\n
|
already associated with a group, else it does nothing.\n
|
||||||
- REPLACE: attempts to replace a weight with the new weight value
|
- REPLACE: attempts to replace a weight with the new weight value
|
||||||
for an already associated vertex/group, else it does nothing.
|
for an already associated vertex/group, else it does nothing.
|
||||||
|
@type SelectModes: readonly dictionary.
|
||||||
|
@var SelectModes: The available edit select modes.
|
||||||
|
- VERTEX: vertex select mode.
|
||||||
|
- EDGE: edge select mode.
|
||||||
|
- FACE: face select mode.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
AssignModes = {'REPLACE':1}
|
AssignModes = {'REPLACE':1}
|
||||||
@@ -135,6 +140,19 @@ def New(name='Mesh'):
|
|||||||
@return: a new Blender mesh.
|
@return: a new Blender mesh.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
def Mode(mode=0):
|
||||||
|
"""
|
||||||
|
Get and/or set the selection modes for mesh editing. These are the modes
|
||||||
|
visible in the 3D window when a mesh is in Edit Mode.
|
||||||
|
@type mode: int
|
||||||
|
@param mode: The name of the mesh data object. See L{SelectModes} for values.
|
||||||
|
Modes can be combined. If omitted, the selection mode is not changed.
|
||||||
|
@rtype: int
|
||||||
|
@return: the current selection mode.
|
||||||
|
@note: The selection mode is an attribute of the current scene. If the
|
||||||
|
scene is changed, the selection mode may not be the same.
|
||||||
|
"""
|
||||||
|
|
||||||
class MCol:
|
class MCol:
|
||||||
"""
|
"""
|
||||||
The MCol object
|
The MCol object
|
||||||
@@ -273,9 +291,9 @@ class MVertSeq:
|
|||||||
l=[(.1,.1,.1),Vector([2,2,.5])]
|
l=[(.1,.1,.1),Vector([2,2,.5])]
|
||||||
me.verts.extend(l) # add multiple vertices
|
me.verts.extend(l) # add multiple vertices
|
||||||
|
|
||||||
@type coords: tuple(s) of floats or vectors
|
@type coords: sequences(s) of floats or vectors
|
||||||
@param coords: coords can be
|
@param coords: coords can be
|
||||||
- a tuple of three floats,
|
- a sequence of three floats,
|
||||||
- a 3D vector, or
|
- a 3D vector, or
|
||||||
- a sequence (list or tuple) of either of the above.
|
- a sequence (list or tuple) of either of the above.
|
||||||
"""
|
"""
|
||||||
@@ -348,12 +366,12 @@ class MEdgeSeq:
|
|||||||
v = me.verts # get vertices
|
v = me.verts # get vertices
|
||||||
if len(v) >= 6: # if there are enough vertices...
|
if len(v) >= 6: # if there are enough vertices...
|
||||||
me.edges.extend(v[0],v[1]) # add a single edge
|
me.edges.extend(v[0],v[1]) # add a single edge
|
||||||
l=[(v[1],v[2],v[3]),(v[0],v[2],v[4],v[5])]
|
l=[(v[1],v[2],v[3]),[v[0],v[2],v[4],v[5]]]
|
||||||
me.edges.extend(l) # add multiple edges
|
me.edges.extend(l) # add multiple edges
|
||||||
|
|
||||||
@type vertseq: tuple(s) of MVerts
|
@type vertseq: sequence(s) of MVerts
|
||||||
@param vertseq: either two to four MVerts, or sequence (list or tuple)
|
@param vertseq: either two to four MVerts, or sequence (list or tuple)
|
||||||
of tuples each containing two to four MVerts.
|
of sequences each containing two to four MVerts.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def delete(edges):
|
def delete(edges):
|
||||||
@@ -442,7 +460,7 @@ class MFace:
|
|||||||
colors; use L{Mesh.faceUV} and L{Mesh.vertexColors} to test. B{Note}:
|
colors; use L{Mesh.faceUV} and L{Mesh.vertexColors} to test. B{Note}:
|
||||||
if a mesh has i{both} UV faces and vertex colors, the colors stored in
|
if a mesh has i{both} UV faces and vertex colors, the colors stored in
|
||||||
the UV faces will be used here.
|
the UV faces will be used here.
|
||||||
@type col: list of MCols
|
@type col: sequence of MCols
|
||||||
@ivar mat: The face's index into the mesh's materials
|
@ivar mat: The face's index into the mesh's materials
|
||||||
list. It is in the range [0,15].
|
list. It is in the range [0,15].
|
||||||
@type mat: int
|
@type mat: int
|
||||||
@@ -520,7 +538,7 @@ class MFaceSeq:
|
|||||||
def extend(vertseq):
|
def extend(vertseq):
|
||||||
"""
|
"""
|
||||||
Add one or more faces to the mesh. Faces which already exist in the
|
Add one or more faces to the mesh. Faces which already exist in the
|
||||||
mesh are ignored. Tuples of two vertices are accepted, but no face
|
mesh are ignored. Sequences of two vertices are accepted, but no face
|
||||||
will be created.
|
will be created.
|
||||||
|
|
||||||
Example::
|
Example::
|
||||||
@@ -531,12 +549,12 @@ class MFaceSeq:
|
|||||||
v = me.verts # get vertices
|
v = me.verts # get vertices
|
||||||
if len(v) >= 6: # if there are enough vertices...
|
if len(v) >= 6: # if there are enough vertices...
|
||||||
me.faces.extend(v[1],v[2],v[3]) # add a single edge
|
me.faces.extend(v[1],v[2],v[3]) # add a single edge
|
||||||
l=[(v[0],v[1]),(v[0],v[2],v[4],v[5])]
|
l=[(v[0],v[1]),[v[0],v[2],v[4],v[5]]]
|
||||||
me.faces.extend(l) # add another face
|
me.faces.extend(l) # add another face
|
||||||
|
|
||||||
@type vertseq: tuple(s) of MVerts
|
@type vertseq: sequence(s) of MVerts
|
||||||
@param vertseq: either two to four MVerts, or sequence (list or tuple)
|
@param vertseq: either two to four MVerts, or sequence (list or tuple)
|
||||||
of tuples each containing two to four MVerts.
|
of sequences each containing two to four MVerts.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def delete(deledges, faces):
|
def delete(deledges, faces):
|
||||||
@@ -608,6 +626,9 @@ class Mesh:
|
|||||||
be set. Furthermore, if vertexColors is already set when faceUV is set,
|
be set. Furthermore, if vertexColors is already set when faceUV is set,
|
||||||
vertexColors is cleared. This is because the vertex color information
|
vertexColors is cleared. This is because the vertex color information
|
||||||
is stored with UV faces, so enabling faceUV implies enabling vertexColors.
|
is stored with UV faces, so enabling faceUV implies enabling vertexColors.
|
||||||
|
In addition, faceUV cannot be set when the mesh has no faces defined
|
||||||
|
(this is the same behavior as the UI). Attempting to do so will throw
|
||||||
|
a RuntimeError exception.
|
||||||
@type faceUV: bool
|
@type faceUV: bool
|
||||||
@ivar vertexColors: The mesh contains vertex colors. See L{faceUV} for the
|
@ivar vertexColors: The mesh contains vertex colors. See L{faceUV} for the
|
||||||
use of vertex colors when UV-mapped texture faces are enabled.
|
use of vertex colors when UV-mapped texture faces are enabled.
|
||||||
@@ -706,11 +727,11 @@ class Mesh:
|
|||||||
|
|
||||||
def findEdges(edges):
|
def findEdges(edges):
|
||||||
"""
|
"""
|
||||||
Quickly search for the location of an edge.
|
Quickly search for the location of an edges.
|
||||||
@type edges: tuple(s) of ints or MVerts
|
@type edges: sequence(s) of ints or MVerts
|
||||||
@param edges: can be tuples of MVerts or integer indexes (B{note:} will
|
@param edges: can be tuples of MVerts or integer indexes (B{note:} will
|
||||||
not work with PVerts) or a sequence (list or tuple) containing two or
|
not work with PVerts) or a sequence (list or tuple) containing two or
|
||||||
more tuples.
|
more sequences.
|
||||||
@rtype: int, None or list
|
@rtype: int, None or list
|
||||||
@return: if an edge is found, its index is returned; otherwise None is
|
@return: if an edge is found, its index is returned; otherwise None is
|
||||||
returned. If a sequence of edges is passed, a list is returned.
|
returned. If a sequence of edges is passed, a list is returned.
|
||||||
@@ -825,6 +846,16 @@ class Mesh:
|
|||||||
associated with the mesh's object
|
associated with the mesh's object
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
def getVertexInfluences(index):
|
||||||
|
"""
|
||||||
|
Get the bone influences for a specific vertex.
|
||||||
|
@type index: int
|
||||||
|
@param index: The index of a vertex.
|
||||||
|
@rtype: list of lists
|
||||||
|
@return: List of pairs [name, weight], where name is the bone name (string)
|
||||||
|
and weight is a float value.
|
||||||
|
"""
|
||||||
|
|
||||||
def smooth():
|
def smooth():
|
||||||
"""
|
"""
|
||||||
Flattens angle of selected faces. Experimental mesh tool.
|
Flattens angle of selected faces. Experimental mesh tool.
|
||||||
|
|||||||
@@ -269,6 +269,19 @@ class Object:
|
|||||||
the type Effect.
|
the type Effect.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
def insertShapeKey():
|
||||||
|
"""
|
||||||
|
Insert a Shape Key in the current object. It applies to Objects of
|
||||||
|
the type Mesh, Lattice, or Curve.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def getPose():
|
||||||
|
"""
|
||||||
|
Gets the current Pose of the object.
|
||||||
|
@rtype: Pose object
|
||||||
|
@return: the current pose object
|
||||||
|
"""
|
||||||
|
|
||||||
def clearIpo():
|
def clearIpo():
|
||||||
"""
|
"""
|
||||||
Unlinks the ipo from this object.
|
Unlinks the ipo from this object.
|
||||||
|
|||||||
@@ -184,6 +184,10 @@ class ThemeSpace:
|
|||||||
@ivar face_select: theme rgba var.
|
@ivar face_select: theme rgba var.
|
||||||
@ivar face_dot: theme rgba var.
|
@ivar face_dot: theme rgba var.
|
||||||
@ivar normal: theme rgba var.
|
@ivar normal: theme rgba var.
|
||||||
|
@ivar bone_solid: theme rgba var.
|
||||||
|
@ivar bon_pose: theme rgba var.
|
||||||
|
@ivar strip: theme rgba var.
|
||||||
|
@ivar strip_select: theme rgba var.
|
||||||
@ivar syntaxl: theme rgba var.
|
@ivar syntaxl: theme rgba var.
|
||||||
@ivar syntaxn: theme rgba var.
|
@ivar syntaxn: theme rgba var.
|
||||||
@ivar syntaxb: theme rgba var.
|
@ivar syntaxb: theme rgba var.
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ def GetPerspMatrix ():
|
|||||||
@return: the current matrix.
|
@return: the current matrix.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def EditMode(enable = -1, undo_msg = 'From script'):
|
def EditMode(enable = -1, undo_msg = 'From script', undo = 1):
|
||||||
"""
|
"""
|
||||||
Get and optionally set the current edit mode status: in or out.
|
Get and optionally set the current edit mode status: in or out.
|
||||||
|
|
||||||
@@ -258,6 +258,9 @@ def EditMode(enable = -1, undo_msg = 'From script'):
|
|||||||
string is used as the undo message in the Mesh->Undo History submenu in
|
string is used as the undo message in the Mesh->Undo History submenu in
|
||||||
the 3d view header. Max length is 63, strings longer than that get
|
the 3d view header. Max length is 63, strings longer than that get
|
||||||
clamped.
|
clamped.
|
||||||
|
@param undo: don't save Undo information (only needed when exiting edit
|
||||||
|
mode).
|
||||||
|
@type undo: int
|
||||||
@rtype: int (bool)
|
@rtype: int (bool)
|
||||||
@return: 0 if Blender is not in edit mode right now, 1 otherwise.
|
@return: 0 if Blender is not in edit mode right now, 1 otherwise.
|
||||||
@warn: this is an important function. NMesh operates on normal Blender
|
@warn: this is an important function. NMesh operates on normal Blender
|
||||||
|
|||||||
@@ -458,7 +458,7 @@ static int Matrix_ass_item(MatrixObject * self, int i, PyObject * ob)
|
|||||||
float vec[4];
|
float vec[4];
|
||||||
PyObject *m, *f;
|
PyObject *m, *f;
|
||||||
|
|
||||||
if(i > self->rowSize || i < 0){
|
if(i >= self->rowSize || i < 0){
|
||||||
return EXPP_ReturnIntError(PyExc_TypeError,
|
return EXPP_ReturnIntError(PyExc_TypeError,
|
||||||
"matrix[attribute] = x: bad row\n");
|
"matrix[attribute] = x: bad row\n");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,9 +160,9 @@ PyObject *Vector_Resize4D(VectorObject * self)
|
|||||||
self->vec = self->data.py_data; //force
|
self->vec = self->data.py_data; //force
|
||||||
if(self->size == 2){
|
if(self->size == 2){
|
||||||
self->data.py_data[2] = 0.0f;
|
self->data.py_data[2] = 0.0f;
|
||||||
self->data.py_data[3] = 0.0f;
|
self->data.py_data[3] = 1.0f;
|
||||||
}else if(self->size == 3){
|
}else if(self->size == 3){
|
||||||
self->data.py_data[3] = 0.0f;
|
self->data.py_data[3] = 1.0f;
|
||||||
}
|
}
|
||||||
self->size = 4;
|
self->size = 4;
|
||||||
return EXPP_incr_ret((PyObject*)self);
|
return EXPP_incr_ret((PyObject*)self);
|
||||||
|
|||||||
@@ -170,6 +170,10 @@ static PyObject *ThemeSpace_getAttr( BPy_ThemeSpace * self, char *name )
|
|||||||
ELSEIF_TSP_RGBA( face_select )
|
ELSEIF_TSP_RGBA( face_select )
|
||||||
ELSEIF_TSP_RGBA( face_dot )
|
ELSEIF_TSP_RGBA( face_dot )
|
||||||
ELSEIF_TSP_RGBA( normal )
|
ELSEIF_TSP_RGBA( normal )
|
||||||
|
ELSEIF_TSP_RGBA( bone_solid )
|
||||||
|
ELSEIF_TSP_RGBA( bone_pose )
|
||||||
|
ELSEIF_TSP_RGBA( strip )
|
||||||
|
ELSEIF_TSP_RGBA( strip_select )
|
||||||
ELSEIF_TSP_RGBA( syntaxl )
|
ELSEIF_TSP_RGBA( syntaxl )
|
||||||
ELSEIF_TSP_RGBA( syntaxn )
|
ELSEIF_TSP_RGBA( syntaxn )
|
||||||
ELSEIF_TSP_RGBA( syntaxb )
|
ELSEIF_TSP_RGBA( syntaxb )
|
||||||
@@ -180,14 +184,15 @@ static PyObject *ThemeSpace_getAttr( BPy_ThemeSpace * self, char *name )
|
|||||||
else if( !strcmp( name, "facedot_size" ) )
|
else if( !strcmp( name, "facedot_size" ) )
|
||||||
attrib = Py_BuildValue( "i", tsp->facedot_size );
|
attrib = Py_BuildValue( "i", tsp->facedot_size );
|
||||||
else if( !strcmp( name, "__members__" ) )
|
else if( !strcmp( name, "__members__" ) )
|
||||||
attrib = Py_BuildValue( "[sssssssssssssssssssssssssssssss]", "theme",
|
attrib = Py_BuildValue("[sssssssssssssssssssssssssssssssssss]", "theme",
|
||||||
"back", "text", "text_hi", "header",
|
"back", "text", "text_hi", "header",
|
||||||
"panel", "shade1", "shade2", "hilite",
|
"panel", "shade1", "shade2", "hilite",
|
||||||
"grid", "wire", "lamp", "select", "active",
|
"grid", "wire", "lamp", "select", "active",
|
||||||
"transform", "vertex", "vertex_select",
|
"transform", "vertex", "vertex_select",
|
||||||
"edge", "edge_select", "edge_seam",
|
"edge", "edge_select", "edge_seam",
|
||||||
"edge_facesel", "face", "face_select",
|
"edge_facesel", "face", "face_select",
|
||||||
"face_dot", "normal",
|
"face_dot", "normal", "bone_solid", "bone_pose",
|
||||||
|
"strip", "strip_select",
|
||||||
"syntaxl", "syntaxn", "syntaxb", "syntaxv", "syntaxc",
|
"syntaxl", "syntaxn", "syntaxb", "syntaxv", "syntaxc",
|
||||||
"vertex_size", "facedot_size" );
|
"vertex_size", "facedot_size" );
|
||||||
|
|
||||||
@@ -230,6 +235,10 @@ static int ThemeSpace_setAttr( BPy_ThemeSpace * self, char *name,
|
|||||||
ELSEIF_TSP_RGBA( face_select )
|
ELSEIF_TSP_RGBA( face_select )
|
||||||
ELSEIF_TSP_RGBA( face_dot )
|
ELSEIF_TSP_RGBA( face_dot )
|
||||||
ELSEIF_TSP_RGBA( normal )
|
ELSEIF_TSP_RGBA( normal )
|
||||||
|
ELSEIF_TSP_RGBA( bone_solid )
|
||||||
|
ELSEIF_TSP_RGBA( bone_pose )
|
||||||
|
ELSEIF_TSP_RGBA( strip )
|
||||||
|
ELSEIF_TSP_RGBA( strip_select )
|
||||||
ELSEIF_TSP_RGBA( syntaxl )
|
ELSEIF_TSP_RGBA( syntaxl )
|
||||||
ELSEIF_TSP_RGBA( syntaxn )
|
ELSEIF_TSP_RGBA( syntaxn )
|
||||||
ELSEIF_TSP_RGBA( syntaxb )
|
ELSEIF_TSP_RGBA( syntaxb )
|
||||||
|
|||||||
@@ -1300,7 +1300,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco
|
|||||||
uiDefButBitS(block, TOG, MOD_MIR_CLIPPING, B_MODIFIER_RECALC, "Do Clipping", lx+60, cy, buttonWidth-60,19, &mmd->flag, 1, 2, 0, 0, "Prevents during Transform vertices to go through Mirror");
|
uiDefButBitS(block, TOG, MOD_MIR_CLIPPING, B_MODIFIER_RECALC, "Do Clipping", lx+60, cy, buttonWidth-60,19, &mmd->flag, 1, 2, 0, 0, "Prevents during Transform vertices to go through Mirror");
|
||||||
} else if (md->type==eModifierType_Decimate) {
|
} else if (md->type==eModifierType_Decimate) {
|
||||||
DecimateModifierData *dmd = (DecimateModifierData*) md;
|
DecimateModifierData *dmd = (DecimateModifierData*) md;
|
||||||
uiDefButF(block, NUM, B_MODIFIER_RECALC, "Percent:", lx,(cy-=19),buttonWidth,19, &dmd->percent, 0.0, 1.0, 10, 0, "Defines the percentage of triangles to reduce to");
|
uiDefButF(block, NUM, B_MODIFIER_RECALC, "Ratio:", lx,(cy-=19),buttonWidth,19, &dmd->percent, 0.0, 1.0, 10, 0, "Defines the percentage of triangles to reduce to");
|
||||||
sprintf(str, "Face Count: %d", dmd->faceCount);
|
sprintf(str, "Face Count: %d", dmd->faceCount);
|
||||||
uiDefBut(block, LABEL, 1, str, lx, (cy-=19), 160,19, NULL, 0.0, 0.0, 0, 0, "Displays the current number of faces in the decimated mesh");
|
uiDefBut(block, LABEL, 1, str, lx, (cy-=19), 160,19, NULL, 0.0, 0.0, 0, 0, "Displays the current number of faces in the decimated mesh");
|
||||||
} else if (md->type==eModifierType_Wave) {
|
} else if (md->type==eModifierType_Wave) {
|
||||||
|
|||||||
@@ -2438,7 +2438,7 @@ void buttons_ketsji(uiBlock *block, Object *ob)
|
|||||||
&ob->gameflag, 0, 0,0, 0,
|
&ob->gameflag, 0, 0,0, 0,
|
||||||
"Specify a bounds object for physics");
|
"Specify a bounds object for physics");
|
||||||
if (ob->gameflag & OB_BOUNDS) {
|
if (ob->gameflag & OB_BOUNDS) {
|
||||||
uiDefButS(block, MENU, REDRAWVIEW3D, "Boundary Display%t|Box%x0|Sphere%x1|Cylinder%x2|Cone%x3|Concave Mesh %x4|Convex Polytope%x5",
|
uiDefButS(block, MENU, REDRAWVIEW3D, "Boundary Display%t|Box%x0|Sphere%x1|Cylinder%x2|Cone%x3|Convex Hull Polytope%x5|Static TriangleMesh %x4|",
|
||||||
85, 125, 140, 19, &ob->boundtype, 0, 0, 0, 0, "Selects the collision type");
|
85, 125, 140, 19, &ob->boundtype, 0, 0, 0, 0, "Selects the collision type");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -825,16 +825,34 @@ void drawseqspace(ScrArea *sa, void *spacedata)
|
|||||||
|
|
||||||
if(ed) {
|
if(ed) {
|
||||||
seq= ed->seqbasep->first;
|
seq= ed->seqbasep->first;
|
||||||
while(seq) {
|
while(seq) { /* bound box test, dont draw outside the view */
|
||||||
if(seq->flag & SELECT); else drawseq(seq);
|
if (seq->flag & SELECT ||
|
||||||
|
seq->start > G.v2d->cur.xmax ||
|
||||||
|
seq->start+seq->len < G.v2d->cur.xmin ||
|
||||||
|
seq->machine+1.0 < G.v2d->cur.ymin ||
|
||||||
|
seq->machine > G.v2d->cur.ymax)
|
||||||
|
{
|
||||||
|
/* dont draw */
|
||||||
|
} else {
|
||||||
|
drawseq(seq);
|
||||||
|
}
|
||||||
seq= seq->next;
|
seq= seq->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ed= G.scene->ed;
|
ed= G.scene->ed;
|
||||||
if(ed) {
|
if(ed) {
|
||||||
seq= ed->seqbasep->first;
|
seq= ed->seqbasep->first;
|
||||||
while(seq) {
|
while(seq) { /* bound box test, dont draw outside the view */
|
||||||
if(seq->flag & SELECT) drawseq(seq);
|
if (!(seq->flag & SELECT) ||
|
||||||
|
seq->start > G.v2d->cur.xmax ||
|
||||||
|
seq->start+seq->len < G.v2d->cur.xmin ||
|
||||||
|
seq->machine+1.0 < G.v2d->cur.ymin ||
|
||||||
|
seq->machine > G.v2d->cur.ymax)
|
||||||
|
{
|
||||||
|
/* dont draw */
|
||||||
|
} else {
|
||||||
|
drawseq(seq);
|
||||||
|
}
|
||||||
seq= seq->next;
|
seq= seq->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,8 +64,7 @@ void drawsoundspace(ScrArea *sa, void *spacedata);
|
|||||||
static void draw_wave(int startsamp, int endsamp, short sampdx, short offset, short *sp, float sampfac, float y)
|
static void draw_wave(int startsamp, int endsamp, short sampdx, short offset, short *sp, float sampfac, float y)
|
||||||
{
|
{
|
||||||
float min, max, v1[2], v2[3];
|
float min, max, v1[2], v2[3];
|
||||||
int i, j;
|
int i, j, deltasp, value; /*deltasp, value: were both shorts but for music files 5min, zooming out cased a crash */
|
||||||
short value, deltasp;
|
|
||||||
|
|
||||||
sp+= offset*startsamp;
|
sp+= offset*startsamp;
|
||||||
|
|
||||||
|
|||||||
@@ -335,6 +335,7 @@ void transform_oops(int mode, int context)
|
|||||||
if(val) {
|
if(val) {
|
||||||
switch(event) {
|
switch(event) {
|
||||||
case ESCKEY:
|
case ESCKEY:
|
||||||
|
case RIGHTMOUSE:
|
||||||
case LEFTMOUSE:
|
case LEFTMOUSE:
|
||||||
case SPACEKEY:
|
case SPACEKEY:
|
||||||
case RETKEY:
|
case RETKEY:
|
||||||
@@ -358,7 +359,7 @@ void transform_oops(int mode, int context)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(event==ESCKEY) {
|
if(event==ESCKEY || event==RIGHTMOUSE) {
|
||||||
tv= transmain;
|
tv= transmain;
|
||||||
for(a=0; a<tot; a++, tv++) {
|
for(a=0; a<tot; a++, tv++) {
|
||||||
tv->loc[0]= tv->oldloc[0];
|
tv->loc[0]= tv->oldloc[0];
|
||||||
|
|||||||
@@ -1111,15 +1111,22 @@ void drawfilespace(ScrArea *sa, void *spacedata)
|
|||||||
}
|
}
|
||||||
else loadbutton= 0;
|
else loadbutton= 0;
|
||||||
|
|
||||||
uiDefBut(block, TEX,1,"", textrct.xmin, filebuty1, textrct.xmax-textrct.xmin-loadbutton, 21, sfile->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, "");
|
uiBlockBeginAlign(block);
|
||||||
uiDefBut(block, TEX,2,"", textrct.xmin, filebuty2, textrct.xmax-textrct.xmin-loadbutton, 21, sfile->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, "");
|
uiDefBut(block, TEX,2,"", textrct.xmin, filebuty2, textrct.xmax-textrct.xmin-loadbutton, 21, sfile->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, "Directory, enter a directory and press enter to create it"); /* Directory input */
|
||||||
|
|
||||||
if(loadbutton) {
|
if(loadbutton) {
|
||||||
uiSetCurFont(block, UI_HELV);
|
uiSetCurFont(block, UI_HELV);
|
||||||
uiDefBut(block, BUT, 5, sfile->title, textrct.xmax-loadbutton, filebuty2, loadbutton, 21, sfile->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, "");
|
uiDefBut(block, BUT, 5, sfile->title, textrct.xmax-loadbutton, filebuty2, loadbutton, 21, sfile->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, "");
|
||||||
|
}
|
||||||
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
|
uiBlockBeginAlign(block);
|
||||||
|
uiDefBut(block, TEX,1,"", textrct.xmin, filebuty1, textrct.xmax-textrct.xmin-loadbutton, 21, sfile->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, "File, increment version number with (+/-)"); /* File input */
|
||||||
|
if(loadbutton) {
|
||||||
|
uiSetCurFont(block, UI_HELV);
|
||||||
uiDefBut(block, BUT, 6, "Cancel", textrct.xmax-loadbutton, filebuty1, loadbutton, 21, sfile->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, "");
|
uiDefBut(block, BUT, 6, "Cancel", textrct.xmax-loadbutton, filebuty1, loadbutton, 21, sfile->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, "");
|
||||||
}
|
}
|
||||||
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
menu= fsmenu_build_menu();
|
menu= fsmenu_build_menu();
|
||||||
if(menu[0]) // happens when no .Bfs is there, and first time browse
|
if(menu[0]) // happens when no .Bfs is there, and first time browse
|
||||||
uiDefButS(block, MENU, 3, menu, scrollrct.xmin, filebuty1, scrollrct.xmax-scrollrct.xmin, 21, &sfile->menu, 0, 0, 0, 0, "");
|
uiDefButS(block, MENU, 3, menu, scrollrct.xmin, filebuty1, scrollrct.xmax-scrollrct.xmin, 21, &sfile->menu, 0, 0, 0, 0, "");
|
||||||
|
|||||||
@@ -128,9 +128,11 @@ void file_buttons(void)
|
|||||||
BIF_DrawString(uiBlockGetCurFont(block), sfile->title, (U.transopts & USER_TR_BUTTONS));
|
BIF_DrawString(uiBlockGetCurFont(block), sfile->title, (U.transopts & USER_TR_BUTTONS));
|
||||||
xco+= BIF_GetStringWidth(G.font, sfile->title, (U.transopts & USER_TR_BUTTONS));
|
xco+= BIF_GetStringWidth(G.font, sfile->title, (U.transopts & USER_TR_BUTTONS));
|
||||||
|
|
||||||
|
uiBlockBeginAlign(block);
|
||||||
uiDefIconButBitS(block, ICONTOG, FILE_SHOWSHORT, B_SORTFILELIST, ICON_LONGDISPLAY,xco+=XIC,0,XIC,YIC, &sfile->flag, 0, 0, 0, 0, "Toggles long info");
|
uiDefIconButBitS(block, ICONTOG, FILE_SHOWSHORT, B_SORTFILELIST, ICON_LONGDISPLAY,xco+=XIC,0,XIC,YIC, &sfile->flag, 0, 0, 0, 0, "Toggles long info");
|
||||||
uiDefIconButBitS(block, TOG, FILE_HIDE_DOT, B_RELOADDIR, ICON_GHOST,xco+=XIC,0,XIC,YIC, &sfile->flag, 0, 0, 0, 0, "Hides dot files");
|
uiDefIconButBitS(block, TOG, FILE_HIDE_DOT, B_RELOADDIR, ICON_GHOST,xco+=XIC,0,XIC,YIC, &sfile->flag, 0, 0, 0, 0, "Hides dot files");
|
||||||
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
uiDefButBitS(block, TOG, FILE_STRINGCODE, 0, "Relative Paths", xco+=XIC+20,0,100,YIC, &sfile->flag, 0, 0, 0, 0, "Makes sure returned paths are relative to the current .blend file");
|
uiDefButBitS(block, TOG, FILE_STRINGCODE, 0, "Relative Paths", xco+=XIC+20,0,100,YIC, &sfile->flag, 0, 0, 0, 0, "Makes sure returned paths are relative to the current .blend file");
|
||||||
|
|
||||||
xco+=90;
|
xco+=90;
|
||||||
|
|||||||
@@ -125,12 +125,15 @@ void imasel_buttons(void)
|
|||||||
xco+=BMF_GetStringWidth(G.fonts, simasel->title);
|
xco+=BMF_GetStringWidth(G.fonts, simasel->title);
|
||||||
xco+=25;
|
xco+=25;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uiBlockBeginAlign(block);
|
||||||
uiDefIconBut(block, BUT, B_IMASELREMOVEBIP, ICON_BPIBFOLDER_X, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "");/* remove */
|
uiDefIconBut(block, BUT, B_IMASELREMOVEBIP, ICON_BPIBFOLDER_X, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "");/* remove */
|
||||||
|
|
||||||
uiDefIconButS(block, TOG|BIT|0, B_REDR, ICON_BPIBFOLDERGREY, xco+=XIC,0,XIC,YIC, &simasel->mode, 0, 0, 0, 0, "Toggles display of directory information");/* dir */
|
uiDefIconButS(block, TOG|BIT|0, B_REDR, ICON_BPIBFOLDERGREY, xco+=XIC,0,XIC,YIC, &simasel->mode, 0, 0, 0, 0, "Toggles display of directory information");/* dir */
|
||||||
uiDefIconButS(block, TOG|BIT|1, B_REDR, ICON_INFO, xco+=XIC,0,XIC,YIC, &simasel->mode, 0, 0, 0, 0, "Toggles display of selected image information");/* info */
|
uiDefIconButS(block, TOG|BIT|1, B_REDR, ICON_INFO, xco+=XIC,0,XIC,YIC, &simasel->mode, 0, 0, 0, 0, "Toggles display of selected image information");/* info */
|
||||||
uiDefIconButS(block, TOG|BIT|2, B_REDR, ICON_IMAGE_COL, xco+=XIC,0,XIC,YIC, &simasel->mode, 0, 0, 0, 0, "");/* image */
|
uiDefIconButS(block, TOG|BIT|2, B_REDR, ICON_IMAGE_COL, xco+=XIC,0,XIC,YIC, &simasel->mode, 0, 0, 0, 0, "");/* image */
|
||||||
uiDefIconButS(block, TOG|BIT|3, B_REDR, ICON_MAGNIFY, xco+=XIC,0,XIC,YIC, &simasel->mode, 0, 0, 0, 0, "Toggles magnified view of thumbnail of images under mouse pointer");/* magnify */
|
uiDefIconButS(block, TOG|BIT|3, B_REDR, ICON_MAGNIFY, xco+=XIC,0,XIC,YIC, &simasel->mode, 0, 0, 0, 0, "Toggles magnified view of thumbnail of images under mouse pointer");/* magnify */
|
||||||
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
/* always do as last */
|
/* always do as last */
|
||||||
curarea->headbutlen= xco+2*XIC;
|
curarea->headbutlen= xco+2*XIC;
|
||||||
|
|||||||
@@ -1183,6 +1183,7 @@ void ipo_buttons(void)
|
|||||||
|
|
||||||
/* COPY PASTE */
|
/* COPY PASTE */
|
||||||
xco-= XIC/2;
|
xco-= XIC/2;
|
||||||
|
uiBlockBeginAlign(block);
|
||||||
if(curarea->headertype==HEADERTOP) {
|
if(curarea->headertype==HEADERTOP) {
|
||||||
uiDefIconBut(block, BUT, B_IPOCOPY, ICON_COPYUP, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Copies the selected curves to the buffer");
|
uiDefIconBut(block, BUT, B_IPOCOPY, ICON_COPYUP, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Copies the selected curves to the buffer");
|
||||||
uiSetButLock(G.sipo->ipo && G.sipo->ipo->id.lib, "Can't edit library data");
|
uiSetButLock(G.sipo->ipo && G.sipo->ipo->id.lib, "Can't edit library data");
|
||||||
@@ -1193,15 +1194,19 @@ void ipo_buttons(void)
|
|||||||
uiSetButLock(G.sipo->ipo && G.sipo->ipo->id.lib, "Can't edit library data");
|
uiSetButLock(G.sipo->ipo && G.sipo->ipo->id.lib, "Can't edit library data");
|
||||||
uiDefIconBut(block, BUT, B_IPOPASTE, ICON_PASTEDOWN, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the curves from the buffer");
|
uiDefIconBut(block, BUT, B_IPOPASTE, ICON_PASTEDOWN, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the curves from the buffer");
|
||||||
}
|
}
|
||||||
|
uiBlockEndAlign(block);
|
||||||
xco+=XIC/2;
|
xco+=XIC/2;
|
||||||
|
|
||||||
uiClearButLock();
|
uiClearButLock();
|
||||||
|
|
||||||
/* ZOOMBORDER */
|
/* ZOOMBORDER */
|
||||||
uiDefIconBut(block, BUT, B_IPOBORDER, ICON_BORDERMOVE, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Zooms view to area");
|
uiDefIconBut(block, BUT, B_IPOBORDER, ICON_BORDERMOVE, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Zooms view to area");
|
||||||
|
|
||||||
|
xco+=XIC/2;
|
||||||
|
|
||||||
/* draw LOCK */
|
/* draw LOCK */
|
||||||
uiDefIconButS(block, ICONTOG, 1, ICON_UNLOCKED, xco+=XIC,0,XIC,YIC, &(G.sipo->lock), 0, 0, 0, 0, "Toggles forced redraw of other windows to reflect changes in real time");
|
uiDefIconButS(block, ICONTOG, 1, ICON_UNLOCKED, xco+=XIC,0,XIC,YIC, &(G.sipo->lock), 0, 0, 0, 0, "Toggles forced redraw of other windows to reflect changes in real time");
|
||||||
|
|
||||||
/* always do as last */
|
/* always do as last */
|
||||||
curarea->headbutlen= xco+2*XIC;
|
curarea->headbutlen= xco+2*XIC;
|
||||||
|
|
||||||
|
|||||||
@@ -72,42 +72,64 @@ void do_oops_buttons(short event)
|
|||||||
{
|
{
|
||||||
float dx, dy;
|
float dx, dy;
|
||||||
|
|
||||||
|
/* used for maximize hack */
|
||||||
|
int win_width, win_height;
|
||||||
|
float aspect_win, aspect_oops, oops_width, oops_height, oops_x_mid, oops_y_mid;
|
||||||
|
|
||||||
|
|
||||||
if(curarea->win==0) return;
|
if(curarea->win==0) return;
|
||||||
|
|
||||||
switch(event) {
|
|
||||||
case B_OOPSHOME:
|
|
||||||
init_v2d_oops(curarea, curarea->spacedata.first); // forces min/max to be reset
|
|
||||||
boundbox_oops(0);
|
|
||||||
G.v2d->cur= G.v2d->tot;
|
|
||||||
dx= 0.15*(G.v2d->cur.xmax-G.v2d->cur.xmin);
|
|
||||||
dy= 0.15*(G.v2d->cur.ymax-G.v2d->cur.ymin);
|
|
||||||
G.v2d->cur.xmin-= dx;
|
|
||||||
G.v2d->cur.xmax+= dx;
|
|
||||||
G.v2d->cur.ymin-= dy;
|
|
||||||
G.v2d->cur.ymax+= dy;
|
|
||||||
test_view2d(G.v2d, curarea->winx, curarea->winy);
|
|
||||||
scrarea_queue_winredraw(curarea);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case B_OOPSVIEWSEL:
|
if (event == B_NEWOOPS) {
|
||||||
init_v2d_oops(curarea, curarea->spacedata.first); // forces min/max to be reset
|
|
||||||
boundbox_oops(1);
|
|
||||||
G.v2d->cur= G.v2d->tot;
|
|
||||||
dx= 0.15*(G.v2d->cur.xmax-G.v2d->cur.xmin);
|
|
||||||
dy= 0.15*(G.v2d->cur.ymax-G.v2d->cur.ymin);
|
|
||||||
G.v2d->cur.xmin-= dx;
|
|
||||||
G.v2d->cur.xmax+= dx;
|
|
||||||
G.v2d->cur.ymin-= dy;
|
|
||||||
G.v2d->cur.ymax+= dy;
|
|
||||||
test_view2d(G.v2d, curarea->winx, curarea->winy);
|
|
||||||
scrarea_queue_winredraw(curarea);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case B_NEWOOPS:
|
|
||||||
scrarea_queue_winredraw(curarea);
|
scrarea_queue_winredraw(curarea);
|
||||||
scrarea_queue_headredraw(curarea);
|
scrarea_queue_headredraw(curarea);
|
||||||
G.soops->lockpoin= 0;
|
G.soops->lockpoin= 0;
|
||||||
break;
|
} else { /* must be either B_OOPSHOME or B_OOPSVIEWSEL */
|
||||||
|
init_v2d_oops(curarea, curarea->spacedata.first); // forces min/max to be reset
|
||||||
|
if (event == B_OOPSHOME) {
|
||||||
|
boundbox_oops(0); /* Test all oops blocks */
|
||||||
|
} else {
|
||||||
|
boundbox_oops(1); /* Test only selected oops blocks */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Hack to work with test_view2d in drawipo.c
|
||||||
|
Modify the bounding box so it is maximized to the window aspect
|
||||||
|
so viewing all oops blocks isnt limited to hoz/vert only.
|
||||||
|
Cant modify drawipo.c because many other functions use this hos/vert operation - Campbell*/
|
||||||
|
|
||||||
|
win_width= curarea->winrct.xmax - curarea->winrct.xmin;
|
||||||
|
win_height= curarea->winrct.ymax - curarea->winrct.ymin;
|
||||||
|
|
||||||
|
oops_width = G.v2d->tot.xmax - G.v2d->tot.xmin;
|
||||||
|
oops_height = G.v2d->tot.ymax - G.v2d->tot.ymin;
|
||||||
|
|
||||||
|
oops_x_mid = (G.v2d->tot.xmax + G.v2d->tot.xmin)*0.5;
|
||||||
|
oops_y_mid = (G.v2d->tot.ymax + G.v2d->tot.ymin)*0.5;
|
||||||
|
/* wide windows will be above 1, skinny below 1 */
|
||||||
|
aspect_win= (float)win_width / (float)win_height;
|
||||||
|
aspect_oops = (float)oops_width / (float)oops_height;
|
||||||
|
if (aspect_win>aspect_oops) {/* the window is wider then the oops bounds, increase the oops width */
|
||||||
|
G.v2d->tot.xmin = oops_x_mid - ((oops_x_mid-G.v2d->tot.xmin) * (aspect_win/aspect_oops) ); /* scale the min */
|
||||||
|
G.v2d->tot.xmax = oops_x_mid + ((G.v2d->tot.xmax-oops_x_mid) * (aspect_win/aspect_oops) );/* scale the max */
|
||||||
|
} else { /* the window is skinnier then the oops bounds, increase the oops height */
|
||||||
|
G.v2d->tot.ymin = oops_y_mid - ((oops_y_mid-G.v2d->tot.ymin) * (aspect_oops/aspect_win) ); /* scale the min */
|
||||||
|
G.v2d->tot.ymax = oops_y_mid + ((G.v2d->tot.ymax-oops_y_mid) * (aspect_oops/aspect_win) );/* scale the max */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* maybe we should restore the correct values? - do next of its needed */
|
||||||
|
/* end hack */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
G.v2d->cur= G.v2d->tot;
|
||||||
|
dx= 0.15*(G.v2d->cur.xmax-G.v2d->cur.xmin);
|
||||||
|
dy= 0.15*(G.v2d->cur.ymax-G.v2d->cur.ymin);
|
||||||
|
G.v2d->cur.xmin-= dx;
|
||||||
|
G.v2d->cur.xmax+= dx;
|
||||||
|
G.v2d->cur.ymin-= dy;
|
||||||
|
G.v2d->cur.ymax+= dy;
|
||||||
|
test_view2d(G.v2d, curarea->winx, curarea->winy);
|
||||||
|
scrarea_queue_winredraw(curarea);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -251,7 +251,8 @@ void script_buttons(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
uiBlockSetEmboss(block, UI_EMBOSS);
|
uiBlockSetEmboss(block, UI_EMBOSS);
|
||||||
|
|
||||||
|
uiBlockBeginAlign(block);
|
||||||
uiDefIconBut(block, BUT, B_SCRIPT2PREV, ICON_GO_LEFT, xco+=XIC, 0, XIC, YIC,
|
uiDefIconBut(block, BUT, B_SCRIPT2PREV, ICON_GO_LEFT, xco+=XIC, 0, XIC, YIC,
|
||||||
0, 0, 0, 0, 0, "Returns to previous window");
|
0, 0, 0, 0, 0, "Returns to previous window");
|
||||||
|
|
||||||
@@ -262,7 +263,8 @@ void script_buttons(void)
|
|||||||
else
|
else
|
||||||
uiDefIconBut(block, BUT,B_FULL, ICON_FULLSCREEN, xco+=XIC,0,XIC,YIC, 0, 0,
|
uiDefIconBut(block, BUT,B_FULL, ICON_FULLSCREEN, xco+=XIC,0,XIC,YIC, 0, 0,
|
||||||
0, 0, 0, "Makes current window full screen (CTRL+Down arrow)");
|
0, 0, 0, "Makes current window full screen (CTRL+Down arrow)");
|
||||||
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
/* STD SCRIPT BUTTONS */
|
/* STD SCRIPT BUTTONS */
|
||||||
xco += 2*XIC;
|
xco += 2*XIC;
|
||||||
xco= std_libbuttons(block, xco, 0, 0, NULL, B_SCRIPTBROWSE, ID_SCRIPT, 0, (ID*)sc->script, 0, &(sc->menunr), 0, 0, 0, 0, 0);
|
xco= std_libbuttons(block, xco, 0, 0, NULL, B_SCRIPTBROWSE, ID_SCRIPT, 0, (ID*)sc->script, 0, &(sc->menunr), 0, 0, 0, 0, 0);
|
||||||
|
|||||||
@@ -484,8 +484,10 @@ void seq_buttons()
|
|||||||
|
|
||||||
/* ZOOM and BORDER */
|
/* ZOOM and BORDER */
|
||||||
xco+= 8;
|
xco+= 8;
|
||||||
|
uiBlockBeginAlign(block);
|
||||||
uiDefIconButI(block, TOG, B_VIEW2DZOOM, ICON_VIEWZOOM, xco+=XIC,0,XIC,YIC, &viewmovetemp, 0, 0, 0, 0, "Zooms view in and out (Ctrl MiddleMouse)");
|
uiDefIconButI(block, TOG, B_VIEW2DZOOM, ICON_VIEWZOOM, xco+=XIC,0,XIC,YIC, &viewmovetemp, 0, 0, 0, 0, "Zooms view in and out (Ctrl MiddleMouse)");
|
||||||
uiDefIconBut(block, BUT, B_IPOBORDER, ICON_BORDERMOVE, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Zooms view to fit area");
|
uiDefIconBut(block, BUT, B_IPOBORDER, ICON_BORDERMOVE, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Zooms view to fit area");
|
||||||
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
/* CLEAR MEM */
|
/* CLEAR MEM */
|
||||||
xco+= 8;
|
xco+= 8;
|
||||||
|
|||||||
@@ -613,13 +613,15 @@ void text_buttons(void)
|
|||||||
xco += 10;
|
xco += 10;
|
||||||
|
|
||||||
/* FULL WINDOW */
|
/* FULL WINDOW */
|
||||||
|
uiBlockBeginAlign(block);
|
||||||
if(curarea->full) uiDefIconBut(block, BUT,B_FULL, ICON_SPLITSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Returns to multiple views window (CTRL+Up arrow)");
|
if(curarea->full) uiDefIconBut(block, BUT,B_FULL, ICON_SPLITSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Returns to multiple views window (CTRL+Up arrow)");
|
||||||
else uiDefIconBut(block, BUT,B_FULL, ICON_FULLSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Makes current window full screen (CTRL+Down arrow)");
|
else uiDefIconBut(block, BUT,B_FULL, ICON_FULLSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Makes current window full screen (CTRL+Down arrow)");
|
||||||
|
|
||||||
uiDefIconButI(block, ICONTOG, B_TEXTLINENUM, ICON_LONGDISPLAY, xco+=XIC,0,XIC,YIC, &st->showlinenrs, 0, 0, 0, 0, "Displays line numbers");
|
uiDefIconButI(block, ICONTOG, B_TEXTLINENUM, ICON_LONGDISPLAY, xco+=XIC,0,XIC,YIC, &st->showlinenrs, 0, 0, 0, 0, "Displays line numbers");
|
||||||
|
|
||||||
uiDefIconButI(block, ICONTOG, B_SYNTAX, ICON_SYNTAX, xco+=XIC,0,XIC,YIC, &st->showsyntax, 0, 0, 0, 0, "Enables Syntax Highlighting");
|
uiDefIconButI(block, ICONTOG, B_SYNTAX, ICON_SYNTAX, xco+=XIC,0,XIC,YIC, &st->showsyntax, 0, 0, 0, 0, "Enables Syntax Highlighting");
|
||||||
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
/* STD TEXT BUTTONS */
|
/* STD TEXT BUTTONS */
|
||||||
xco+= 2*XIC;
|
xco+= 2*XIC;
|
||||||
xco= std_libbuttons(block, xco, 0, 0, NULL, B_TEXTBROWSE, ID_TXT, 0, (ID*)st->text, 0, &(st->menunr), 0, 0, B_TEXTDELETE, 0, 0);
|
xco= std_libbuttons(block, xco, 0, 0, NULL, B_TEXTBROWSE, ID_TXT, 0, (ID*)st->text, 0, &(st->menunr), 0, 0, B_TEXTDELETE, 0, 0);
|
||||||
|
|||||||
@@ -4432,6 +4432,7 @@ void view3d_buttons(void)
|
|||||||
|
|
||||||
if (ob && (ob->flag & OB_POSEMODE)) {
|
if (ob && (ob->flag & OB_POSEMODE)) {
|
||||||
xco+= XIC/2;
|
xco+= XIC/2;
|
||||||
|
uiBlockBeginAlign(block);
|
||||||
if(curarea->headertype==HEADERTOP) {
|
if(curarea->headertype==HEADERTOP) {
|
||||||
uiDefIconBut(block, BUT, B_ACTCOPY, ICON_COPYUP,
|
uiDefIconBut(block, BUT, B_ACTCOPY, ICON_COPYUP,
|
||||||
xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0,
|
xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0,
|
||||||
@@ -4456,6 +4457,7 @@ void view3d_buttons(void)
|
|||||||
xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0,
|
xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0,
|
||||||
"Pastes the mirrored pose from the buffer");
|
"Pastes the mirrored pose from the buffer");
|
||||||
}
|
}
|
||||||
|
uiBlockEndAlign(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Always do this last */
|
/* Always do this last */
|
||||||
|
|||||||
@@ -5364,7 +5364,7 @@ void uiBlockEndAlign(uiBlock *block)
|
|||||||
uiBut *prev, *but=NULL, *next;
|
uiBut *prev, *but=NULL, *next;
|
||||||
int flag= 0, cols=0, rows=0;
|
int flag= 0, cols=0, rows=0;
|
||||||
|
|
||||||
if ( !((BIF_GetThemeValue(TH_BUT_DRAWTYPE) == 1) || (BIF_GetThemeValue(TH_BUT_DRAWTYPE) == 2))) {
|
if ( !((BIF_GetThemeValue(TH_BUT_DRAWTYPE) == 0) || (BIF_GetThemeValue(TH_BUT_DRAWTYPE) == 1) || (BIF_GetThemeValue(TH_BUT_DRAWTYPE) == 2))) {
|
||||||
block->flag &= ~UI_BUT_ALIGN; // all 4 flags
|
block->flag &= ~UI_BUT_ALIGN; // all 4 flags
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1207,12 +1207,18 @@ static void ui_draw_round(int type, int colorid, float asp, float x1, float y1,
|
|||||||
/* super minimal button as used in logic menu */
|
/* super minimal button as used in logic menu */
|
||||||
static void ui_draw_minimal(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag)
|
static void ui_draw_minimal(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag)
|
||||||
{
|
{
|
||||||
|
/* too much space between buttons */
|
||||||
|
/*
|
||||||
x1+= asp;
|
x1+= asp;
|
||||||
x2-= asp;
|
x2-= asp;
|
||||||
y1+= asp;
|
y1+= asp;
|
||||||
y2-= asp;
|
y2-= asp;
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Less space between buttons looks nicer */
|
||||||
|
y2-= asp;
|
||||||
|
x2-= asp;
|
||||||
|
|
||||||
/* paper */
|
/* paper */
|
||||||
if(flag & UI_SELECT) {
|
if(flag & UI_SELECT) {
|
||||||
if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, -40);
|
if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, -40);
|
||||||
@@ -1744,6 +1750,15 @@ static void ui_draw_but_CHARTAB(uiBut *but)
|
|||||||
unsigned char ustr[16];
|
unsigned char ustr[16];
|
||||||
PackedFile *pf;
|
PackedFile *pf;
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
int charmax = G.charmax;
|
||||||
|
|
||||||
|
/* <builtin> font in use */
|
||||||
|
if(!strcmp(G.selfont->name, "<builtin>"))
|
||||||
|
charmax = 0xff;
|
||||||
|
|
||||||
|
/* Category list exited without selecting the area */
|
||||||
|
if(G.charmax == 0)
|
||||||
|
charmax = G.charmax = 0xffff;
|
||||||
|
|
||||||
/* Calculate the size of the button */
|
/* Calculate the size of the button */
|
||||||
width = abs(but->x2 - but->x1);
|
width = abs(but->x2 - but->x1);
|
||||||
@@ -1777,7 +1792,7 @@ static void ui_draw_but_CHARTAB(uiBut *but)
|
|||||||
|
|
||||||
strcpy(tmpStr, G.selfont->name);
|
strcpy(tmpStr, G.selfont->name);
|
||||||
BLI_convertstringcode(tmpStr, G.sce, 0);
|
BLI_convertstringcode(tmpStr, G.sce, 0);
|
||||||
err = FTF_SetFont(tmpStr, 0, 14.0);
|
err = FTF_SetFont((unsigned char *)tmpStr, 0, 14.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1791,12 +1806,12 @@ static void ui_draw_but_CHARTAB(uiBut *but)
|
|||||||
for(y = 0; y < 6; y++)
|
for(y = 0; y < 6; y++)
|
||||||
{
|
{
|
||||||
// Do not draw more than the category allows
|
// Do not draw more than the category allows
|
||||||
if(cs > G.charmax) break;
|
if(cs > charmax) break;
|
||||||
|
|
||||||
for(x = 0; x < 12; x++)
|
for(x = 0; x < 12; x++)
|
||||||
{
|
{
|
||||||
// Do not draw more than the category allows
|
// Do not draw more than the category allows
|
||||||
if(cs > G.charmax) break;
|
if(cs > charmax) break;
|
||||||
|
|
||||||
// Draw one grid cell
|
// Draw one grid cell
|
||||||
glBegin(GL_LINE_LOOP);
|
glBegin(GL_LINE_LOOP);
|
||||||
@@ -1809,9 +1824,18 @@ static void ui_draw_but_CHARTAB(uiBut *but)
|
|||||||
// Draw character inside the cell
|
// Draw character inside the cell
|
||||||
memset(wstr, 0, sizeof(wchar_t)*2);
|
memset(wstr, 0, sizeof(wchar_t)*2);
|
||||||
memset(ustr, 0, 16);
|
memset(ustr, 0, 16);
|
||||||
|
|
||||||
|
// Set the font to be either unicode or <builtin>
|
||||||
wstr[0] = cs;
|
wstr[0] = cs;
|
||||||
wcs2utf8s(ustr, wstr);
|
if(strcmp(G.selfont->name, "<builtin>"))
|
||||||
|
{
|
||||||
|
wcs2utf8s((char *)ustr, (wchar_t *)wstr);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ustr[0] = cs;
|
||||||
|
ustr[1] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if(G.selfont && strcmp(G.selfont->name, "<builtin>"))
|
if(G.selfont && strcmp(G.selfont->name, "<builtin>"))
|
||||||
{
|
{
|
||||||
@@ -1821,8 +1845,8 @@ static void ui_draw_but_CHARTAB(uiBut *but)
|
|||||||
float px, py;
|
float px, py;
|
||||||
|
|
||||||
// Calculate the position
|
// Calculate the position
|
||||||
wid = FTF_GetStringWidth(ustr, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
|
wid = FTF_GetStringWidth((char *) ustr, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
|
||||||
FTF_GetBoundingBox(ustr, &llx,&lly,&llz,&urx,&ury,&urz, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
|
FTF_GetBoundingBox((char *) ustr, &llx,&lly,&llz,&urx,&ury,&urz, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
|
||||||
dx = urx-llx;
|
dx = urx-llx;
|
||||||
dy = ury-lly;
|
dy = ury-lly;
|
||||||
|
|
||||||
@@ -1832,12 +1856,12 @@ static void ui_draw_but_CHARTAB(uiBut *but)
|
|||||||
|
|
||||||
// Set the position and draw the character
|
// Set the position and draw the character
|
||||||
ui_rasterpos_safe(px, py, but->aspect);
|
ui_rasterpos_safe(px, py, but->aspect);
|
||||||
FTF_DrawString(ustr, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
|
FTF_DrawString((char *) ustr, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui_rasterpos_safe(sx + butw/2, sy + buth/2, but->aspect);
|
ui_rasterpos_safe(sx + butw/2, sy + buth/2, but->aspect);
|
||||||
BIF_DrawString(but->font, ustr, 0);
|
BIF_DrawString(but->font, (char *) ustr, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate the next position and character
|
// Calculate the next position and character
|
||||||
@@ -1855,16 +1879,16 @@ static void ui_draw_but_CHARTAB(uiBut *but)
|
|||||||
/* Return Font Settings to original */
|
/* Return Font Settings to original */
|
||||||
if(U.fontsize && U.fontname[0])
|
if(U.fontsize && U.fontname[0])
|
||||||
{
|
{
|
||||||
result = FTF_SetFont(U.fontname, 0, U.fontsize);
|
result = FTF_SetFont((unsigned char *)U.fontname, 0, U.fontsize);
|
||||||
}
|
}
|
||||||
else if (U.fontsize)
|
else if (U.fontsize)
|
||||||
{
|
{
|
||||||
result = FTF_SetFont(datatoc_bfont_ttf, datatoc_bfont_ttf_size, U.fontsize);
|
result = FTF_SetFont((unsigned char *) datatoc_bfont_ttf, datatoc_bfont_ttf_size, U.fontsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result == 0)
|
if (result == 0)
|
||||||
{
|
{
|
||||||
result = FTF_SetFont(datatoc_bfont_ttf, datatoc_bfont_ttf_size, 11);
|
result = FTF_SetFont((unsigned char *) datatoc_bfont_ttf, datatoc_bfont_ttf_size, 11);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1012,9 +1012,16 @@ void BIF_do_render(int anim)
|
|||||||
/* if start render in 3d win, use layer from window (e.g also local view) */
|
/* if start render in 3d win, use layer from window (e.g also local view) */
|
||||||
if(curarea && curarea->spacetype==SPACE_VIEW3D) {
|
if(curarea && curarea->spacetype==SPACE_VIEW3D) {
|
||||||
int lay= G.scene->lay;
|
int lay= G.scene->lay;
|
||||||
if(G.vd->lay & 0xFF000000) // localview
|
/*
|
||||||
G.scene->lay |= G.vd->lay;
|
* if view is defined (might not be if called form script), check
|
||||||
else G.scene->lay= G.vd->lay;
|
* and set layers
|
||||||
|
*/
|
||||||
|
if(G.vd) {
|
||||||
|
if(G.vd->lay & 0xFF000000) // localview
|
||||||
|
G.scene->lay |= G.vd->lay;
|
||||||
|
else
|
||||||
|
G.scene->lay= G.vd->lay;
|
||||||
|
}
|
||||||
|
|
||||||
do_render(anim);
|
do_render(anim);
|
||||||
|
|
||||||
|
|||||||
@@ -3018,6 +3018,7 @@ void drawinfospace(ScrArea *sa, void *spacedata)
|
|||||||
} else if(U.userpref == 5) { /* file paths */
|
} else if(U.userpref == 5) { /* file paths */
|
||||||
|
|
||||||
/* yafray: (temporary) path button for yafray xml export, now with fileselect */
|
/* yafray: (temporary) path button for yafray xml export, now with fileselect */
|
||||||
|
uiBlockBeginAlign(block);
|
||||||
uiDefBut(block, TEX, 0, "YFexport: ",
|
uiDefBut(block, TEX, 0, "YFexport: ",
|
||||||
(xpos+edgsp), y2+buth+rspace, lpref-smfileselbut, buth,
|
(xpos+edgsp), y2+buth+rspace, lpref-smfileselbut, buth,
|
||||||
U.yfexportdir, 1.0, 63.0, 0, 0,
|
U.yfexportdir, 1.0, 63.0, 0, 0,
|
||||||
@@ -3025,7 +3026,9 @@ void drawinfospace(ScrArea *sa, void *spacedata)
|
|||||||
uiDefIconBut(block, BUT, B_YAFRAYDIRFILESEL, ICON_FILESEL,
|
uiDefIconBut(block, BUT, B_YAFRAYDIRFILESEL, ICON_FILESEL,
|
||||||
(xpos+edgsp+lpref-smfileselbut), y2+buth+rspace, smfileselbut, buth,
|
(xpos+edgsp+lpref-smfileselbut), y2+buth+rspace, smfileselbut, buth,
|
||||||
0, 0, 0, 0, 0, "Select the default yafray export directory");
|
0, 0, 0, 0, 0, "Select the default yafray export directory");
|
||||||
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
|
uiBlockBeginAlign(block);
|
||||||
uiDefBut(block, TEX, 0, "Fonts: ",
|
uiDefBut(block, TEX, 0, "Fonts: ",
|
||||||
(xpos+edgsp),y2,(lpref-smfileselbut),buth,
|
(xpos+edgsp),y2,(lpref-smfileselbut),buth,
|
||||||
U.fontdir, 1.0, 63.0, 0, 0,
|
U.fontdir, 1.0, 63.0, 0, 0,
|
||||||
@@ -3033,37 +3036,47 @@ void drawinfospace(ScrArea *sa, void *spacedata)
|
|||||||
uiDefIconBut(block, BUT, B_FONTDIRFILESEL, ICON_FILESEL,
|
uiDefIconBut(block, BUT, B_FONTDIRFILESEL, ICON_FILESEL,
|
||||||
(xpos+edgsp+lpref-smfileselbut),y2,smfileselbut,buth,
|
(xpos+edgsp+lpref-smfileselbut),y2,smfileselbut,buth,
|
||||||
0, 0, 0, 0, 0, "Select the default font directory");
|
0, 0, 0, 0, 0, "Select the default font directory");
|
||||||
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
|
uiBlockBeginAlign(block);
|
||||||
uiDefBut(block, TEX, 0, "Textures: ",
|
uiDefBut(block, TEX, 0, "Textures: ",
|
||||||
(xpos+edgsp+lpref+midsp),y2,(lpref-smfileselbut),buth,
|
(xpos+edgsp+lpref+midsp),y2,(lpref-smfileselbut),buth,
|
||||||
U.textudir, 1.0, 63.0, 0, 0, "The default directory to search for textures");
|
U.textudir, 1.0, 63.0, 0, 0, "The default directory to search for textures");
|
||||||
uiDefIconBut(block, BUT, B_TEXTUDIRFILESEL, ICON_FILESEL,
|
uiDefIconBut(block, BUT, B_TEXTUDIRFILESEL, ICON_FILESEL,
|
||||||
(xpos+edgsp+(2*lpref)+midsp-smfileselbut),y2,smfileselbut,buth,
|
(xpos+edgsp+(2*lpref)+midsp-smfileselbut),y2,smfileselbut,buth,
|
||||||
0, 0, 0, 0, 0, "Select the default texture location");
|
0, 0, 0, 0, 0, "Select the default texture location");
|
||||||
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
|
|
||||||
|
uiBlockBeginAlign(block);
|
||||||
uiDefBut(block, TEX, 0, "Tex Plugins: ",
|
uiDefBut(block, TEX, 0, "Tex Plugins: ",
|
||||||
(xpos+edgsp+(2*lpref)+(2*midsp)),y2,(lpref-smfileselbut),buth,
|
(xpos+edgsp+(2*lpref)+(2*midsp)),y2,(lpref-smfileselbut),buth,
|
||||||
U.plugtexdir, 1.0, 63.0, 0, 0, "The default directory to search for texture plugins");
|
U.plugtexdir, 1.0, 63.0, 0, 0, "The default directory to search for texture plugins");
|
||||||
uiDefIconBut(block, BUT, B_PLUGTEXDIRFILESEL, ICON_FILESEL,
|
uiDefIconBut(block, BUT, B_PLUGTEXDIRFILESEL, ICON_FILESEL,
|
||||||
(xpos+edgsp+(3*lpref)+(2*midsp)-smfileselbut),y2,smfileselbut,buth,
|
(xpos+edgsp+(3*lpref)+(2*midsp)-smfileselbut),y2,smfileselbut,buth,
|
||||||
0, 0, 0, 0, 0, "Select the default texture plugin location");
|
0, 0, 0, 0, 0, "Select the default texture plugin location");
|
||||||
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
|
uiBlockBeginAlign(block);
|
||||||
uiDefBut(block, TEX, 0, "Seq Plugins: ",
|
uiDefBut(block, TEX, 0, "Seq Plugins: ",
|
||||||
(xpos+edgsp+(3*lpref)+(3*midsp)),y2,(lpref-smfileselbut),buth,
|
(xpos+edgsp+(3*lpref)+(3*midsp)),y2,(lpref-smfileselbut),buth,
|
||||||
U.plugseqdir, 1.0, 63.0, 0, 0, "The default directory to search for sequence plugins");
|
U.plugseqdir, 1.0, 63.0, 0, 0, "The default directory to search for sequence plugins");
|
||||||
uiDefIconBut(block, BUT, B_PLUGSEQDIRFILESEL, ICON_FILESEL,
|
uiDefIconBut(block, BUT, B_PLUGSEQDIRFILESEL, ICON_FILESEL,
|
||||||
(xpos+edgsp+(4*lpref)+(3*midsp)-smfileselbut),y2,smfileselbut,buth,
|
(xpos+edgsp+(4*lpref)+(3*midsp)-smfileselbut),y2,smfileselbut,buth,
|
||||||
0, 0, 0, 0, 0, "Select the default sequence plugin location");
|
0, 0, 0, 0, 0, "Select the default sequence plugin location");
|
||||||
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
|
|
||||||
|
uiBlockBeginAlign(block);
|
||||||
uiDefBut(block, TEX, 0, "Render: ",
|
uiDefBut(block, TEX, 0, "Render: ",
|
||||||
(xpos+edgsp),y1,(lpref-smfileselbut),buth,
|
(xpos+edgsp),y1,(lpref-smfileselbut),buth,
|
||||||
U.renderdir, 1.0, 63.0, 0, 0, "The default directory for rendering output");
|
U.renderdir, 1.0, 63.0, 0, 0, "The default directory for rendering output");
|
||||||
uiDefIconBut(block, BUT, B_RENDERDIRFILESEL, ICON_FILESEL,
|
uiDefIconBut(block, BUT, B_RENDERDIRFILESEL, ICON_FILESEL,
|
||||||
(xpos+edgsp+lpref-smfileselbut),y1,smfileselbut,buth,
|
(xpos+edgsp+lpref-smfileselbut),y1,smfileselbut,buth,
|
||||||
0, 0, 0, 0, 0, "Select the default render output location");
|
0, 0, 0, 0, 0, "Select the default render output location");
|
||||||
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
|
uiBlockBeginAlign(block);
|
||||||
uiDefBut(block, TEX, 0, "Python: ",
|
uiDefBut(block, TEX, 0, "Python: ",
|
||||||
(xpos+edgsp+lpref+midsp),y1,(lpref-2*smfileselbut),buth,
|
(xpos+edgsp+lpref+midsp),y1,(lpref-2*smfileselbut),buth,
|
||||||
U.pythondir, 1.0, 63.0, 0, 0, "The default directory to search for Python scripts");
|
U.pythondir, 1.0, 63.0, 0, 0, "The default directory to search for Python scripts");
|
||||||
@@ -3073,21 +3086,26 @@ void drawinfospace(ScrArea *sa, void *spacedata)
|
|||||||
uiDefIconBut(block, BUT, B_PYTHONDIRFILESEL, ICON_FILESEL,
|
uiDefIconBut(block, BUT, B_PYTHONDIRFILESEL, ICON_FILESEL,
|
||||||
(xpos+edgsp+(2*lpref)+midsp-smfileselbut),y1,smfileselbut,buth,
|
(xpos+edgsp+(2*lpref)+midsp-smfileselbut),y1,smfileselbut,buth,
|
||||||
0, 0, 0, 0, 0, "Select the default Python script location");
|
0, 0, 0, 0, 0, "Select the default Python script location");
|
||||||
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
|
|
||||||
|
uiBlockBeginAlign(block);
|
||||||
uiDefBut(block, TEX, 0, "Sounds: ",
|
uiDefBut(block, TEX, 0, "Sounds: ",
|
||||||
(xpos+edgsp+(2*lpref)+(2*midsp)),y1,(lpref-smfileselbut),buth,
|
(xpos+edgsp+(2*lpref)+(2*midsp)),y1,(lpref-smfileselbut),buth,
|
||||||
U.sounddir, 1.0, 63.0, 0, 0, "The default directory to search for sounds");
|
U.sounddir, 1.0, 63.0, 0, 0, "The default directory to search for sounds");
|
||||||
uiDefIconBut(block, BUT, B_SOUNDDIRFILESEL, ICON_FILESEL,
|
uiDefIconBut(block, BUT, B_SOUNDDIRFILESEL, ICON_FILESEL,
|
||||||
(xpos+edgsp+(3*lpref)+(2*midsp)-smfileselbut),y1,smfileselbut,buth,
|
(xpos+edgsp+(3*lpref)+(2*midsp)-smfileselbut),y1,smfileselbut,buth,
|
||||||
0, 0, 0, 0, 0, "Select the default sound location");
|
0, 0, 0, 0, 0, "Selet the default sound location");
|
||||||
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
|
uiBlockBeginAlign(block);
|
||||||
uiDefBut(block, TEX, 0, "Temp: ",
|
uiDefBut(block, TEX, 0, "Temp: ",
|
||||||
(xpos+edgsp+(3*lpref)+(3*midsp)),y1,(lpref-smfileselbut),buth,
|
(xpos+edgsp+(3*lpref)+(3*midsp)),y1,(lpref-smfileselbut),buth,
|
||||||
U.tempdir, 1.0, 63.0, 0, 0, "The directory for storing temporary save files");
|
U.tempdir, 1.0, 63.0, 0, 0, "The directory for storing temporary save files");
|
||||||
uiDefIconBut(block, BUT, B_TEMPDIRFILESEL, ICON_FILESEL,
|
uiDefIconBut(block, BUT, B_TEMPDIRFILESEL, ICON_FILESEL,
|
||||||
(xpos+edgsp+(4*lpref)+(3*midsp)-smfileselbut),y1,smfileselbut,buth,
|
(xpos+edgsp+(4*lpref)+(3*midsp)-smfileselbut),y1,smfileselbut,buth,
|
||||||
0, 0, 0, 0, 0, "Select the default temporary save file location");
|
0, 0, 0, 0, 0, "Select the default temporary save file location");
|
||||||
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1359,6 +1359,19 @@ int do_clever_numbuts(char *name, int tot, int winevent)
|
|||||||
int a, sizex, sizey, x1, y2;
|
int a, sizex, sizey, x1, y2;
|
||||||
short mval[2], event;
|
short mval[2], event;
|
||||||
|
|
||||||
|
/* Clear all events so tooltips work, this is not ideal and
|
||||||
|
only needed because calls from the menu still have some events
|
||||||
|
left over when do_clever_numbuts is called.
|
||||||
|
Calls from keyshortcuts do not have this problem.*/
|
||||||
|
ScrArea *sa;
|
||||||
|
BWinEvent temp_bevt;
|
||||||
|
for (sa= G.curscreen->areabase.first; sa; sa= sa->next) {
|
||||||
|
while( bwin_qread( sa->win, &temp_bevt ) ) {}
|
||||||
|
while( bwin_qread( sa->headwin, &temp_bevt ) ) {}
|
||||||
|
}
|
||||||
|
/* Done clearing events */
|
||||||
|
|
||||||
|
|
||||||
if(tot<=0 || tot>MAXNUMBUTS) return 0;
|
if(tot<=0 || tot>MAXNUMBUTS) return 0;
|
||||||
|
|
||||||
getmouseco_sc(mval);
|
getmouseco_sc(mval);
|
||||||
@@ -1383,6 +1396,9 @@ int do_clever_numbuts(char *name, int tot, int winevent)
|
|||||||
|
|
||||||
/* WATCH IT: TEX BUTTON EXCEPTION */
|
/* WATCH IT: TEX BUTTON EXCEPTION */
|
||||||
/* WARNING: ONLY A SINGLE BIT-BUTTON POSSIBLE: WE WORK AT COPIED DATA! */
|
/* WARNING: ONLY A SINGLE BIT-BUTTON POSSIBLE: WE WORK AT COPIED DATA! */
|
||||||
|
|
||||||
|
BIF_ThemeColor(TH_MENU_TEXT); /* makes text readable on dark theme */
|
||||||
|
|
||||||
uiDefBut(block, LABEL, 0, name, (short)(x1+15), (short)(y2-35), (short)(sizex-60), 19, 0, 1.0, 0.0, 0, 0, "");
|
uiDefBut(block, LABEL, 0, name, (short)(x1+15), (short)(y2-35), (short)(sizex-60), 19, 0, 1.0, 0.0, 0, 0, "");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1394,12 +1410,22 @@ int do_clever_numbuts(char *name, int tot, int winevent)
|
|||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
varstr= &numbuts[0];
|
varstr= &numbuts[0];
|
||||||
for(a=0; a<tot; a++, varstr++) {
|
for(a=0; a<tot; a++, varstr++) {
|
||||||
|
|
||||||
if(varstr->type==TEX) {
|
if(varstr->type==TEX) {
|
||||||
uiDefBut(block, TEX, 0, varstr->name,(short)(x1+15),(short)(y2-55-20*a),(short)(sizex-60), 19, numbpoin[a], varstr->min, varstr->max, 0, 0, varstr->tip);
|
uiDefBut(block, TEX, 0, varstr->name,(short)(x1+15),(short)(y2-55-20*a),(short)(sizex-60), 19, numbpoin[a], varstr->min, varstr->max, 0, 0, varstr->tip);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
|
if(varstr->type==LABEL) /* dont include the label when rounding the buttons */
|
||||||
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
uiDefBut(block, varstr->type, 0, varstr->name,(short)(x1+15),(short)(y2-55-20*a), (short)(sizex-60), 19, &(numbdata[a]), varstr->min, varstr->max, 100, 0, varstr->tip);
|
uiDefBut(block, varstr->type, 0, varstr->name,(short)(x1+15),(short)(y2-55-20*a), (short)(sizex-60), 19, &(numbdata[a]), varstr->min, varstr->max, 100, 0, varstr->tip);
|
||||||
|
|
||||||
|
if(varstr->type==LABEL)
|
||||||
|
uiBlockBeginAlign(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
uiBlockEndAlign(block);
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
|
|||||||
@@ -761,7 +761,10 @@ void calculateCenter(TransInfo *t)
|
|||||||
projectIntView(t, axis, t->center2d);
|
projectIntView(t, axis, t->center2d);
|
||||||
|
|
||||||
/* rotate only needs correct 2d center, grab needs initgrabz() value */
|
/* rotate only needs correct 2d center, grab needs initgrabz() value */
|
||||||
if(t->mode==TFM_TRANSLATION) VECCOPY(t->center, axis);
|
if(t->mode==TFM_TRANSLATION) {
|
||||||
|
VECCOPY(t->center, axis);
|
||||||
|
VECCOPY(t->con.center, t->center);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -536,7 +536,14 @@ void viewmove(int mode)
|
|||||||
short use_sel = 0;
|
short use_sel = 0;
|
||||||
short preview3d_event= 1;
|
short preview3d_event= 1;
|
||||||
|
|
||||||
|
/* 3D window may not be defined */
|
||||||
|
if( !G.vd ) {
|
||||||
|
fprintf( stderr, "G.vd == NULL in viewmove()\n" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* sometimes this routine is called from headerbuttons */
|
/* sometimes this routine is called from headerbuttons */
|
||||||
|
|
||||||
areawinset(curarea->win);
|
areawinset(curarea->win);
|
||||||
|
|
||||||
initgrabz(-G.vd->ofs[0], -G.vd->ofs[1], -G.vd->ofs[2]);
|
initgrabz(-G.vd->ofs[0], -G.vd->ofs[1], -G.vd->ofs[2]);
|
||||||
|
|||||||
@@ -42,6 +42,10 @@
|
|||||||
#pragma warning (disable:4786)
|
#pragma warning (disable:4786)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#define GL_GLEXT_LEGACY 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "KX_BlenderGL.h"
|
#include "KX_BlenderGL.h"
|
||||||
#include "KX_BlenderCanvas.h"
|
#include "KX_BlenderCanvas.h"
|
||||||
#include "KX_BlenderKeyboardDevice.h"
|
#include "KX_BlenderKeyboardDevice.h"
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif //WIN32
|
#endif //WIN32
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
#define GL_GLEXT_LEGACY 1
|
||||||
#include <OpenGL/gl.h>
|
#include <OpenGL/gl.h>
|
||||||
#else
|
#else
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
|
|||||||
@@ -168,16 +168,16 @@ bool BL_ActionActuator::Update(double curtime, bool frame)
|
|||||||
// maybe there are events for us in the queue !
|
// maybe there are events for us in the queue !
|
||||||
if (frame)
|
if (frame)
|
||||||
{
|
{
|
||||||
for (vector<CValue*>::iterator i=m_events.end(); !(i==m_events.begin());)
|
for (vector<CValue*>::iterator i=m_events.begin(); !(i==m_events.end());i++)
|
||||||
{
|
{
|
||||||
i--;
|
|
||||||
if ((*i)->GetNumber() == 0.0f)
|
if ((*i)->GetNumber() == 0.0f)
|
||||||
bNegativeEvent = true;
|
bNegativeEvent = true;
|
||||||
else
|
else
|
||||||
bPositiveEvent= true;
|
bPositiveEvent= true;
|
||||||
(*i)->Release();
|
(*i)->Release();
|
||||||
m_events.pop_back();
|
|
||||||
}
|
}
|
||||||
|
m_events.clear();
|
||||||
|
|
||||||
if (bPositiveEvent)
|
if (bPositiveEvent)
|
||||||
m_flag |= ACT_FLAG_ACTIVE;
|
m_flag |= ACT_FLAG_ACTIVE;
|
||||||
|
|||||||
@@ -352,7 +352,7 @@ BL_Material* ConvertMaterial( Mesh* mesh, Material *mat, TFace* tface, MFace*
|
|||||||
material->flag[i] |= ( tface->transp &TF_ADD )?CALCALPHA:0;
|
material->flag[i] |= ( tface->transp &TF_ADD )?CALCALPHA:0;
|
||||||
material->ras_mode|= ( tface->transp &(TF_ADD | TF_ALPHA))?TRANSP:0;
|
material->ras_mode|= ( tface->transp &(TF_ADD | TF_ALPHA))?TRANSP:0;
|
||||||
material->mapping[i].mapping |= ( (material->img[i]->flag & IMA_REFLECT)!=0 )?USEREFL:0;
|
material->mapping[i].mapping |= ( (material->img[i]->flag & IMA_REFLECT)!=0 )?USEREFL:0;
|
||||||
material->blend_mode[i] = BLEND_MUL;
|
//material->blend_mode[i] = BLEND_MUL;
|
||||||
i++;// skip to the next image
|
i++;// skip to the next image
|
||||||
valid_index++;
|
valid_index++;
|
||||||
}
|
}
|
||||||
@@ -371,12 +371,13 @@ BL_Material* ConvertMaterial( Mesh* mesh, Material *mat, TFace* tface, MFace*
|
|||||||
// -----------------------
|
// -----------------------
|
||||||
if( mttmp->tex->imaflag &TEX_USEALPHA ) {
|
if( mttmp->tex->imaflag &TEX_USEALPHA ) {
|
||||||
material->flag[i] |= USEALPHA;
|
material->flag[i] |= USEALPHA;
|
||||||
material->ras_mode |= TRANSP;
|
|
||||||
}
|
}
|
||||||
// -----------------------
|
// -----------------------
|
||||||
else if( mttmp->tex->imaflag &TEX_CALCALPHA ) {
|
else if( mttmp->tex->imaflag &TEX_CALCALPHA ) {
|
||||||
material->flag[i] |= CALCALPHA;
|
material->flag[i] |= CALCALPHA;
|
||||||
material->ras_mode |= TRANSP;
|
}
|
||||||
|
else if(mttmp->tex->flag &TEX_NEGALPHA) {
|
||||||
|
material->flag[i] |= USENEGALPHA;
|
||||||
}
|
}
|
||||||
|
|
||||||
material->color_blend[i] = mttmp->colfac;
|
material->color_blend[i] = mttmp->colfac;
|
||||||
@@ -845,8 +846,10 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools*
|
|||||||
|
|
||||||
// -----------------------------------
|
// -----------------------------------
|
||||||
// pre calculate texture generation
|
// pre calculate texture generation
|
||||||
for(int matid=0; matid<meshobj->NumMaterials(); matid++)
|
for(RAS_MaterialBucket::Set::iterator mit = meshobj->GetFirstMaterial();
|
||||||
meshobj->GetMaterialBucket(matid)->GetPolyMaterial()->OnConstruction();
|
mit != meshobj->GetLastMaterial(); ++ mit) {
|
||||||
|
(*mit)->GetPolyMaterial()->OnConstruction();
|
||||||
|
}
|
||||||
// -----------------------------------
|
// -----------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
#define GL_GLEXT_LEGACY 1
|
||||||
#include <OpenGL/gl.h>
|
#include <OpenGL/gl.h>
|
||||||
#include <OpenGL/glu.h>
|
#include <OpenGL/glu.h>
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
#define GL_GLEXT_LEGACY 1
|
||||||
#include <OpenGL/gl.h>
|
#include <OpenGL/gl.h>
|
||||||
#else
|
#else
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
#define GL_GLEXT_LEGACY 1
|
||||||
#include <OpenGL/gl.h>
|
#include <OpenGL/gl.h>
|
||||||
#include <OpenGL/glu.h>
|
#include <OpenGL/glu.h>
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -112,7 +112,8 @@ enum BL_flag
|
|||||||
USEALPHA=4, // use actual alpha channel
|
USEALPHA=4, // use actual alpha channel
|
||||||
TEXALPHA=8, // use alpha combiner functions
|
TEXALPHA=8, // use alpha combiner functions
|
||||||
TEXNEG=16, // negate blending
|
TEXNEG=16, // negate blending
|
||||||
HASIPO=32
|
HASIPO=32,
|
||||||
|
USENEGALPHA=64
|
||||||
};
|
};
|
||||||
|
|
||||||
// BL_Material::ras_mode
|
// BL_Material::ras_mode
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
#define GL_GLEXT_LEGACY 1
|
||||||
#include <OpenGL/gl.h>
|
#include <OpenGL/gl.h>
|
||||||
#include <OpenGL/glu.h>
|
#include <OpenGL/glu.h>
|
||||||
#else
|
#else
|
||||||
@@ -31,7 +32,7 @@ const bool BL_Shader::Ok()const
|
|||||||
return (mShader !=0 && mOk && mUse);
|
return (mShader !=0 && mOk && mUse);
|
||||||
}
|
}
|
||||||
|
|
||||||
BL_Shader::BL_Shader(int n, PyTypeObject *T)
|
BL_Shader::BL_Shader(PyTypeObject *T)
|
||||||
: PyObjectPlus(T),
|
: PyObjectPlus(T),
|
||||||
mShader(0),
|
mShader(0),
|
||||||
mVert(0),
|
mVert(0),
|
||||||
@@ -40,19 +41,14 @@ BL_Shader::BL_Shader(int n, PyTypeObject *T)
|
|||||||
mOk(0),
|
mOk(0),
|
||||||
mUse(0),
|
mUse(0),
|
||||||
vertProg(""),
|
vertProg(""),
|
||||||
fragProg("")
|
fragProg(""),
|
||||||
|
mError(0),
|
||||||
|
mLog(0)
|
||||||
|
|
||||||
{
|
{
|
||||||
// if !RAS_EXT_support._ARB_shader_objects this class will not be used
|
// if !RAS_EXT_support._ARB_shader_objects this class will not be used
|
||||||
|
|
||||||
mBlending.src = -1;
|
for (int i=0; i<MAXTEX; i++) {
|
||||||
mBlending.dest = -1;
|
|
||||||
mBlending.const_color[0] = 0.0;
|
|
||||||
mBlending.const_color[1] = 0.0;
|
|
||||||
mBlending.const_color[2] = 0.0;
|
|
||||||
mBlending.const_color[3] = 1.0;
|
|
||||||
|
|
||||||
for (int i=0; i<MAXTEX; i++)
|
|
||||||
{
|
|
||||||
mSampler[i].type = 0;
|
mSampler[i].type = 0;
|
||||||
mSampler[i].pass = 0;
|
mSampler[i].pass = 0;
|
||||||
mSampler[i].unit = -1;
|
mSampler[i].unit = -1;
|
||||||
@@ -66,16 +62,20 @@ using namespace bgl;
|
|||||||
BL_Shader::~BL_Shader()
|
BL_Shader::~BL_Shader()
|
||||||
{
|
{
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
|
if(mLog) {
|
||||||
|
MEM_freeN(mLog);
|
||||||
|
mLog=0;
|
||||||
|
}
|
||||||
if( mShader ) {
|
if( mShader ) {
|
||||||
glDeleteObjectARB(mShader);
|
bgl::blDeleteObjectARB(mShader);
|
||||||
mShader = 0;
|
mShader = 0;
|
||||||
}
|
}
|
||||||
if( mFrag ) {
|
if( mFrag ) {
|
||||||
glDeleteObjectARB(mFrag);
|
bgl::blDeleteObjectARB(mFrag);
|
||||||
mFrag = 0;
|
mFrag = 0;
|
||||||
}
|
}
|
||||||
if( mVert ) {
|
if( mVert ) {
|
||||||
glDeleteObjectARB(mVert);
|
bgl::blDeleteObjectARB(mVert);
|
||||||
mVert = 0;
|
mVert = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ BL_Shader::~BL_Shader()
|
|||||||
fragProg = 0;
|
fragProg = 0;
|
||||||
mOk = 0;
|
mOk = 0;
|
||||||
|
|
||||||
glUseProgramObjectARB(0);
|
bgl::blUseProgramObjectARB(0);
|
||||||
#endif//GL_ARB_shader_objects
|
#endif//GL_ARB_shader_objects
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,68 +91,74 @@ BL_Shader::~BL_Shader()
|
|||||||
bool BL_Shader::LinkProgram()
|
bool BL_Shader::LinkProgram()
|
||||||
{
|
{
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
int numchars=0;
|
|
||||||
char* log=0;
|
|
||||||
int vertlen = 0, fraglen=0, proglen=0;
|
int vertlen = 0, fraglen=0, proglen=0;
|
||||||
|
int vertstatus=0, fragstatus=0, progstatus=0;
|
||||||
|
unsigned int tmpVert=0, tmpFrag=0, tmpProg=0;
|
||||||
|
int char_len=0;
|
||||||
|
|
||||||
|
if(mError)
|
||||||
|
goto programError;
|
||||||
|
|
||||||
if(!vertProg || !fragProg){
|
if(!vertProg || !fragProg){
|
||||||
spit("Invalid GLSL sources");
|
spit("Invalid GLSL sources");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if( !RAS_EXT_support._ARB_fragment_shader) {
|
||||||
|
spit("Fragment shaders not supported");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if( !RAS_EXT_support._ARB_vertex_shader) {
|
||||||
|
spit("Vertex shaders not supported");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// create our objects
|
// -- vertex shader ------------------
|
||||||
unsigned int tmpVert = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
|
tmpVert = bgl::blCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
|
||||||
unsigned int tmpFrag = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);
|
bgl::blShaderSourceARB(tmpVert, 1, (const char**)&vertProg, 0);
|
||||||
unsigned int tmpProg = glCreateProgramObjectARB();
|
bgl::blCompileShaderARB(tmpVert);
|
||||||
|
bgl::blGetObjectParameterivARB(tmpVert, GL_OBJECT_INFO_LOG_LENGTH_ARB, &vertlen);
|
||||||
if(!tmpVert || !tmpFrag || !tmpProg){
|
// print info if any
|
||||||
glDeleteObjectARB(tmpVert);
|
if( vertlen > 1){
|
||||||
glDeleteObjectARB(tmpFrag);
|
PrintInfo(vertlen,tmpVert, &char_len);
|
||||||
glDeleteObjectARB(tmpProg);
|
goto programError;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
// set/compile vertex shader
|
// check for compile errors
|
||||||
glShaderSourceARB(tmpVert, 1, (const char**)&vertProg, 0);
|
bgl::blGetObjectParameterivARB(tmpVert, GL_OBJECT_COMPILE_STATUS_ARB, &vertstatus);
|
||||||
glCompileShaderARB(tmpVert);
|
if(!vertstatus)
|
||||||
glGetObjectParameterivARB(tmpVert, GL_OBJECT_INFO_LOG_LENGTH_ARB, &vertlen);
|
goto programError;
|
||||||
|
|
||||||
if( vertlen > 0 && !PrintInfo(vertlen,tmpVert, "Vertex Shader") ){
|
// -- fragment shader ----------------
|
||||||
spit("Vertex shader failed");
|
tmpFrag = bgl::blCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);
|
||||||
glDeleteObjectARB(tmpVert);
|
bgl::blShaderSourceARB(tmpFrag, 1,(const char**)&fragProg, 0);
|
||||||
glDeleteObjectARB(tmpFrag);
|
bgl::blCompileShaderARB(tmpFrag);
|
||||||
glDeleteObjectARB(tmpProg);
|
bgl::blGetObjectParameterivARB(tmpFrag, GL_OBJECT_INFO_LOG_LENGTH_ARB, &fraglen);
|
||||||
mOk = 0;
|
if(fraglen >1 ){
|
||||||
return false;
|
PrintInfo(fraglen,tmpFrag, &char_len);
|
||||||
}
|
goto programError;
|
||||||
// set/compile fragment shader
|
|
||||||
glShaderSourceARB(tmpFrag, 1,(const char**)&fragProg, 0);
|
|
||||||
glCompileShaderARB(tmpFrag);
|
|
||||||
glGetObjectParameterivARB(tmpFrag, GL_OBJECT_INFO_LOG_LENGTH_ARB, &fraglen);
|
|
||||||
if(fraglen >0 && !PrintInfo(fraglen,tmpFrag, "Fragment Shader") ){
|
|
||||||
spit("Fragment shader failed");
|
|
||||||
glDeleteObjectARB(tmpVert);
|
|
||||||
glDeleteObjectARB(tmpFrag);
|
|
||||||
glDeleteObjectARB(tmpProg);
|
|
||||||
mOk = 0;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
bgl::blGetObjectParameterivARB(tmpFrag, GL_OBJECT_COMPILE_STATUS_ARB, &fragstatus);
|
||||||
|
if(!fragstatus)
|
||||||
|
goto programError;
|
||||||
|
|
||||||
// set compiled vert/frag shader & link
|
|
||||||
glAttachObjectARB(tmpProg, tmpVert);
|
// -- program ------------------------
|
||||||
glAttachObjectARB(tmpProg, tmpFrag);
|
// set compiled vert/frag shader & link
|
||||||
glLinkProgramARB(tmpProg);
|
tmpProg = bgl::blCreateProgramObjectARB();
|
||||||
|
bgl::blAttachObjectARB(tmpProg, tmpVert);
|
||||||
|
bgl::blAttachObjectARB(tmpProg, tmpFrag);
|
||||||
|
bgl::blLinkProgramARB(tmpProg);
|
||||||
|
bgl::blGetObjectParameterivARB(tmpProg, GL_OBJECT_INFO_LOG_LENGTH_ARB, &proglen);
|
||||||
|
bgl::blGetObjectParameterivARB(tmpProg, GL_OBJECT_LINK_STATUS_ARB, &progstatus);
|
||||||
|
if(!progstatus)
|
||||||
|
goto programError;
|
||||||
|
|
||||||
glGetObjectParameterivARB(tmpProg, GL_OBJECT_INFO_LOG_LENGTH_ARB, &proglen);
|
if(proglen > 0) {
|
||||||
if(proglen > 0){
|
// print success
|
||||||
PrintInfo(proglen,tmpProg, "GLSL Shader");
|
PrintInfo(proglen,tmpProg, &char_len);
|
||||||
}
|
if(char_len >0)
|
||||||
else{
|
spit(mLog);
|
||||||
spit("Program failed");
|
mError = 0;
|
||||||
glDeleteObjectARB(tmpVert);
|
|
||||||
glDeleteObjectARB(tmpFrag);
|
|
||||||
glDeleteObjectARB(tmpProg);
|
|
||||||
mOk = 0;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// set
|
// set
|
||||||
@@ -161,34 +167,42 @@ bool BL_Shader::LinkProgram()
|
|||||||
mFrag = tmpFrag;
|
mFrag = tmpFrag;
|
||||||
mOk = 1;
|
mOk = 1;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
programError:
|
||||||
|
if(tmpVert) {
|
||||||
|
bgl::blDeleteObjectARB(tmpVert);
|
||||||
|
tmpVert=0;
|
||||||
|
}
|
||||||
|
if(tmpFrag) {
|
||||||
|
bgl::blDeleteObjectARB(tmpFrag);
|
||||||
|
tmpFrag=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(tmpProg) {
|
||||||
|
bgl::blDeleteObjectARB(tmpProg);
|
||||||
|
tmpProg=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
mOk = 0;
|
||||||
|
mUse=0;
|
||||||
|
mError = 1;
|
||||||
|
spit("----------");
|
||||||
|
spit("GLSL Error ");
|
||||||
|
if(mLog)
|
||||||
|
spit(mLog);
|
||||||
|
spit("--------------------");
|
||||||
|
return false;
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif//GL_ARB_shader_objects
|
#endif//GL_ARB_shader_objects
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BL_Shader::PrintInfo(int len, unsigned int handle, const char *type)
|
void BL_Shader::PrintInfo(int len, unsigned int handle, int* num)
|
||||||
{
|
{
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
int numchars=0;
|
mLog = (char*)MEM_mallocN(sizeof(char)*len, "print_log");
|
||||||
char *log = (char*)MEM_mallocN(sizeof(char)*len, "print_log");
|
//MT_assert(mLog, "Failed to create memory");
|
||||||
if(!log) {
|
bgl::blGetInfoLogARB(handle, len, num, mLog);
|
||||||
spit("BL_Shader::PrintInfo() MEM_mallocN failed");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
glGetInfoLogARB(handle, len, &numchars, log);
|
|
||||||
|
|
||||||
if(numchars >0){
|
|
||||||
spit(type);
|
|
||||||
spit(log);
|
|
||||||
MEM_freeN(log);
|
|
||||||
log=0;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
MEM_freeN(log);
|
|
||||||
log=0;
|
|
||||||
return true;
|
|
||||||
#else
|
|
||||||
return false
|
|
||||||
#endif//GL_ARB_shader_objects
|
#endif//GL_ARB_shader_objects
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,13 +248,6 @@ const uSampler* BL_Shader::getSampler(int i)
|
|||||||
return &mSampler[i];
|
return &mSampler[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
const uBlending *BL_Shader::getBlending( int pass )
|
|
||||||
{
|
|
||||||
return &mBlending;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void BL_Shader::InitializeSampler(
|
void BL_Shader::InitializeSampler(
|
||||||
int type,
|
int type,
|
||||||
int unit,
|
int unit,
|
||||||
@@ -287,7 +294,6 @@ PyMethodDef BL_Shader::Methods[] =
|
|||||||
KX_PYMETHODTABLE( BL_Shader, setSampler ),
|
KX_PYMETHODTABLE( BL_Shader, setSampler ),
|
||||||
KX_PYMETHODTABLE( BL_Shader, setUniformMatrix4 ),
|
KX_PYMETHODTABLE( BL_Shader, setUniformMatrix4 ),
|
||||||
KX_PYMETHODTABLE( BL_Shader, setUniformMatrix3 ),
|
KX_PYMETHODTABLE( BL_Shader, setUniformMatrix3 ),
|
||||||
// KX_PYMETHODTABLE( BL_Shader, setBlending ),
|
|
||||||
|
|
||||||
{NULL,NULL} //Sentinel
|
{NULL,NULL} //Sentinel
|
||||||
};
|
};
|
||||||
@@ -332,15 +338,14 @@ KX_PYMETHODDEF_DOC( BL_Shader, setSource," setSource(vertexProgram, fragmentProg
|
|||||||
vertProg = v;
|
vertProg = v;
|
||||||
fragProg = f;
|
fragProg = f;
|
||||||
if( LinkProgram() ) {
|
if( LinkProgram() ) {
|
||||||
glUseProgramObjectARB( mShader );
|
bgl::blUseProgramObjectARB( mShader );
|
||||||
mUse = apply!=0;
|
mUse = apply!=0;
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}
|
}
|
||||||
vertProg = 0;
|
vertProg = 0;
|
||||||
fragProg = 0;
|
fragProg = 0;
|
||||||
mUse = 0;
|
mUse = 0;
|
||||||
glUseProgramObjectARB( 0 );
|
Py_Return;
|
||||||
PyErr_Format(PyExc_ValueError, "GLSL Error");
|
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
#else
|
#else
|
||||||
@@ -352,9 +357,9 @@ KX_PYMETHODDEF_DOC( BL_Shader, setSource," setSource(vertexProgram, fragmentProg
|
|||||||
KX_PYMETHODDEF_DOC( BL_Shader, delSource, "delSource( )" )
|
KX_PYMETHODDEF_DOC( BL_Shader, delSource, "delSource( )" )
|
||||||
{
|
{
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
glDeleteObjectARB(mShader);
|
bgl::blDeleteObjectARB(mShader);
|
||||||
glDeleteObjectARB(mFrag);
|
bgl::blDeleteObjectARB(mFrag);
|
||||||
glDeleteObjectARB(mVert);
|
bgl::blDeleteObjectARB(mVert);
|
||||||
mShader = 0;
|
mShader = 0;
|
||||||
mFrag = 0;
|
mFrag = 0;
|
||||||
mVert = 0;
|
mVert = 0;
|
||||||
@@ -362,13 +367,12 @@ KX_PYMETHODDEF_DOC( BL_Shader, delSource, "delSource( )" )
|
|||||||
fragProg = 0;
|
fragProg = 0;
|
||||||
mOk = 0;
|
mOk = 0;
|
||||||
mUse = 0;
|
mUse = 0;
|
||||||
glUseProgramObjectARB(0);
|
bgl::blUseProgramObjectARB(0);
|
||||||
#endif
|
#endif
|
||||||
Py_Return;
|
Py_Return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
KX_PYMETHODDEF_DOC( BL_Shader, isValid, "isValid()" )
|
KX_PYMETHODDEF_DOC( BL_Shader, isValid, "isValid()" )
|
||||||
{
|
{
|
||||||
return PyInt_FromLong( ( mShader !=0 && mOk ) );
|
return PyInt_FromLong( ( mShader !=0 && mOk ) );
|
||||||
@@ -384,21 +388,22 @@ KX_PYMETHODDEF_DOC( BL_Shader, getFragmentProg ,"getFragmentProg( )" )
|
|||||||
return PyString_FromString(fragProg?fragProg:"");
|
return PyString_FromString(fragProg?fragProg:"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
KX_PYMETHODDEF_DOC( BL_Shader, validate, "validate()")
|
KX_PYMETHODDEF_DOC( BL_Shader, validate, "validate()")
|
||||||
{
|
{
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
if(mShader==0)
|
if(mError) {
|
||||||
{
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mShader==0) {
|
||||||
PyErr_Format(PyExc_TypeError, "invalid shader object");
|
PyErr_Format(PyExc_TypeError, "invalid shader object");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int stat = 0;
|
int stat = 0;
|
||||||
glValidateProgramARB(mShader);
|
bgl::blValidateProgramARB(mShader);
|
||||||
glGetObjectParameterivARB(mShader, GL_OBJECT_VALIDATE_STATUS_ARB, &stat);
|
bgl::blGetObjectParameterivARB(mShader, GL_OBJECT_VALIDATE_STATUS_ARB, &stat);
|
||||||
|
return PyInt_FromLong(0);
|
||||||
return PyInt_FromLong((stat!=0));
|
|
||||||
#else
|
#else
|
||||||
Py_Return;
|
Py_Return;
|
||||||
#endif//GL_ARB_shader_objects
|
#endif//GL_ARB_shader_objects
|
||||||
@@ -408,6 +413,11 @@ KX_PYMETHODDEF_DOC( BL_Shader, validate, "validate()")
|
|||||||
KX_PYMETHODDEF_DOC( BL_Shader, setSampler, "setSampler(name, index)" )
|
KX_PYMETHODDEF_DOC( BL_Shader, setSampler, "setSampler(name, index)" )
|
||||||
{
|
{
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
|
if(mError) {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
|
|
||||||
char *uniform="";
|
char *uniform="";
|
||||||
int index=-1;
|
int index=-1;
|
||||||
if(PyArg_ParseTuple(args, "si", &uniform, &index))
|
if(PyArg_ParseTuple(args, "si", &uniform, &index))
|
||||||
@@ -417,7 +427,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setSampler, "setSampler(name, index)" )
|
|||||||
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
int loc= glGetUniformLocationARB(mShader, uniform);
|
int loc= bgl::blGetUniformLocationARB(mShader, uniform);
|
||||||
if( loc==-1 )
|
if( loc==-1 )
|
||||||
{
|
{
|
||||||
spit("Invalid uniform value: " << uniform << ".");
|
spit("Invalid uniform value: " << uniform << ".");
|
||||||
@@ -446,7 +456,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setNumberOfPasses, "setNumberOfPasses( max-pass )
|
|||||||
if(!PyArg_ParseTuple(args, "i", &pass))
|
if(!PyArg_ParseTuple(args, "i", &pass))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
mPass = pass;
|
mPass = 1;
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -454,6 +464,11 @@ KX_PYMETHODDEF_DOC( BL_Shader, setNumberOfPasses, "setNumberOfPasses( max-pass )
|
|||||||
KX_PYMETHODDEF_DOC( BL_Shader, setUniform1f, "setUniform1f(name, fx)" )
|
KX_PYMETHODDEF_DOC( BL_Shader, setUniform1f, "setUniform1f(name, fx)" )
|
||||||
{
|
{
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
|
if(mError) {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
|
|
||||||
char *uniform="";
|
char *uniform="";
|
||||||
float value=0;
|
float value=0;
|
||||||
if(PyArg_ParseTuple(args, "sf", &uniform, &value ))
|
if(PyArg_ParseTuple(args, "sf", &uniform, &value ))
|
||||||
@@ -463,15 +478,15 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform1f, "setUniform1f(name, fx)" )
|
|||||||
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
int loc= glGetUniformLocationARB(mShader, uniform);
|
int loc= bgl::blGetUniformLocationARB(mShader, uniform);
|
||||||
if( loc==-1 )
|
if( loc==-1 )
|
||||||
{
|
{
|
||||||
spit("Invalid uniform value: " << uniform << ".");
|
spit("Invalid uniform value: " << uniform << ".");
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
glUseProgramObjectARB( mShader );
|
bgl::blUseProgramObjectARB( mShader );
|
||||||
glUniform1fARB( loc, value );
|
bgl::blUniform1fARB( loc, value );
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -486,6 +501,10 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform1f, "setUniform1f(name, fx)" )
|
|||||||
KX_PYMETHODDEF_DOC( BL_Shader, setUniform2f , "setUniform2f(name, fx, fy)")
|
KX_PYMETHODDEF_DOC( BL_Shader, setUniform2f , "setUniform2f(name, fx, fy)")
|
||||||
{
|
{
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
|
if(mError) {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
char *uniform="";
|
char *uniform="";
|
||||||
float array[2]={ 0,0 };
|
float array[2]={ 0,0 };
|
||||||
if(PyArg_ParseTuple(args, "sff", &uniform, &array[0],&array[1] ))
|
if(PyArg_ParseTuple(args, "sff", &uniform, &array[0],&array[1] ))
|
||||||
@@ -495,15 +514,15 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform2f , "setUniform2f(name, fx, fy)")
|
|||||||
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
int loc= glGetUniformLocationARB(mShader , uniform);
|
int loc= bgl::blGetUniformLocationARB(mShader , uniform);
|
||||||
if( loc==-1 )
|
if( loc==-1 )
|
||||||
{
|
{
|
||||||
spit("Invalid uniform value: " << uniform << ".");
|
spit("Invalid uniform value: " << uniform << ".");
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
glUseProgramObjectARB( mShader );
|
bgl::blUseProgramObjectARB( mShader );
|
||||||
glUniform2fARB(loc, array[0],array[1] );
|
bgl::blUniform2fARB(loc, array[0],array[1] );
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -518,6 +537,10 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform2f , "setUniform2f(name, fx, fy)")
|
|||||||
KX_PYMETHODDEF_DOC( BL_Shader, setUniform3f, "setUniform3f(name, fx,fy,fz) ")
|
KX_PYMETHODDEF_DOC( BL_Shader, setUniform3f, "setUniform3f(name, fx,fy,fz) ")
|
||||||
{
|
{
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
|
if(mError) {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
char *uniform="";
|
char *uniform="";
|
||||||
float array[3]={0,0,0};
|
float array[3]={0,0,0};
|
||||||
if(PyArg_ParseTuple(args, "sfff", &uniform, &array[0],&array[1],&array[2]))
|
if(PyArg_ParseTuple(args, "sfff", &uniform, &array[0],&array[1],&array[2]))
|
||||||
@@ -527,15 +550,15 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform3f, "setUniform3f(name, fx,fy,fz) ")
|
|||||||
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
int loc= glGetUniformLocationARB(mShader , uniform);
|
int loc= bgl::blGetUniformLocationARB(mShader , uniform);
|
||||||
if( loc==-1 )
|
if( loc==-1 )
|
||||||
{
|
{
|
||||||
spit("Invalid uniform value: " << uniform << ".");
|
spit("Invalid uniform value: " << uniform << ".");
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
glUseProgramObjectARB(mShader);
|
bgl::blUseProgramObjectARB(mShader);
|
||||||
glUniform3fARB(loc, array[0],array[1],array[2]);
|
bgl::blUniform3fARB(loc, array[0],array[1],array[2]);
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -550,6 +573,10 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform3f, "setUniform3f(name, fx,fy,fz) ")
|
|||||||
KX_PYMETHODDEF_DOC( BL_Shader, setUniform4f, "setUniform4f(name, fx,fy,fz, fw) ")
|
KX_PYMETHODDEF_DOC( BL_Shader, setUniform4f, "setUniform4f(name, fx,fy,fz, fw) ")
|
||||||
{
|
{
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
|
if(mError) {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
char *uniform="";
|
char *uniform="";
|
||||||
float array[4]={0,0,0,0};
|
float array[4]={0,0,0,0};
|
||||||
if(PyArg_ParseTuple(args, "sffff", &uniform, &array[0],&array[1],&array[2], &array[3]))
|
if(PyArg_ParseTuple(args, "sffff", &uniform, &array[0],&array[1],&array[2], &array[3]))
|
||||||
@@ -559,15 +586,15 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform4f, "setUniform4f(name, fx,fy,fz, fw) "
|
|||||||
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
int loc= glGetUniformLocationARB(mShader , uniform);
|
int loc= bgl::blGetUniformLocationARB(mShader , uniform);
|
||||||
if( loc==-1 )
|
if( loc==-1 )
|
||||||
{
|
{
|
||||||
spit("Invalid uniform value: " << uniform << ".");
|
spit("Invalid uniform value: " << uniform << ".");
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
glUseProgramObjectARB(mShader);
|
bgl::blUseProgramObjectARB(mShader);
|
||||||
glUniform4fARB(loc, array[0],array[1],array[2], array[3]);
|
bgl::blUniform4fARB(loc, array[0],array[1],array[2], array[3]);
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -581,6 +608,10 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform4f, "setUniform4f(name, fx,fy,fz, fw) "
|
|||||||
KX_PYMETHODDEF_DOC( BL_Shader, setUniform1i, "setUniform1i(name, ix)" )
|
KX_PYMETHODDEF_DOC( BL_Shader, setUniform1i, "setUniform1i(name, ix)" )
|
||||||
{
|
{
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
|
if(mError) {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
char *uniform="";
|
char *uniform="";
|
||||||
int value=0;
|
int value=0;
|
||||||
if(PyArg_ParseTuple(args, "si", &uniform, &value ))
|
if(PyArg_ParseTuple(args, "si", &uniform, &value ))
|
||||||
@@ -590,15 +621,15 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform1i, "setUniform1i(name, ix)" )
|
|||||||
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
int loc= glGetUniformLocationARB(mShader, uniform);
|
int loc= bgl::blGetUniformLocationARB(mShader, uniform);
|
||||||
if( loc==-1 )
|
if( loc==-1 )
|
||||||
{
|
{
|
||||||
spit("Invalid uniform value: " << uniform << ".");
|
spit("Invalid uniform value: " << uniform << ".");
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
glUseProgramObjectARB( mShader );
|
bgl::blUseProgramObjectARB( mShader );
|
||||||
glUniform1iARB( loc, value );
|
bgl::blUniform1iARB( loc, value );
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -612,6 +643,10 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform1i, "setUniform1i(name, ix)" )
|
|||||||
KX_PYMETHODDEF_DOC( BL_Shader, setUniform2i , "setUniform2i(name, ix, iy)")
|
KX_PYMETHODDEF_DOC( BL_Shader, setUniform2i , "setUniform2i(name, ix, iy)")
|
||||||
{
|
{
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
|
if(mError) {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
char *uniform="";
|
char *uniform="";
|
||||||
int array[2]={ 0,0 };
|
int array[2]={ 0,0 };
|
||||||
if(PyArg_ParseTuple(args, "sii", &uniform, &array[0],&array[1] ))
|
if(PyArg_ParseTuple(args, "sii", &uniform, &array[0],&array[1] ))
|
||||||
@@ -621,15 +656,15 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform2i , "setUniform2i(name, ix, iy)")
|
|||||||
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
int loc= glGetUniformLocationARB(mShader , uniform);
|
int loc= bgl::blGetUniformLocationARB(mShader , uniform);
|
||||||
if( loc==-1 )
|
if( loc==-1 )
|
||||||
{
|
{
|
||||||
spit("Invalid uniform value: " << uniform << ".");
|
spit("Invalid uniform value: " << uniform << ".");
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
glUseProgramObjectARB( mShader );
|
bgl::blUseProgramObjectARB( mShader );
|
||||||
glUniform2iARB(loc, array[0],array[1] );
|
bgl::blUniform2iARB(loc, array[0],array[1] );
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -643,6 +678,10 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform2i , "setUniform2i(name, ix, iy)")
|
|||||||
KX_PYMETHODDEF_DOC( BL_Shader, setUniform3i, "setUniform3i(name, ix,iy,iz) ")
|
KX_PYMETHODDEF_DOC( BL_Shader, setUniform3i, "setUniform3i(name, ix,iy,iz) ")
|
||||||
{
|
{
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
|
if(mError) {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
char *uniform="";
|
char *uniform="";
|
||||||
int array[3]={0,0,0};
|
int array[3]={0,0,0};
|
||||||
if(PyArg_ParseTuple(args, "siii", &uniform, &array[0],&array[1],&array[2]))
|
if(PyArg_ParseTuple(args, "siii", &uniform, &array[0],&array[1],&array[2]))
|
||||||
@@ -652,15 +691,15 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform3i, "setUniform3i(name, ix,iy,iz) ")
|
|||||||
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
int loc= glGetUniformLocationARB(mShader , uniform);
|
int loc= bgl::blGetUniformLocationARB(mShader , uniform);
|
||||||
if( loc==-1 )
|
if( loc==-1 )
|
||||||
{
|
{
|
||||||
spit("Invalid uniform value: " << uniform << ".");
|
spit("Invalid uniform value: " << uniform << ".");
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
glUseProgramObjectARB(mShader);
|
bgl::blUseProgramObjectARB(mShader);
|
||||||
glUniform3iARB(loc, array[0],array[1],array[2]);
|
bgl::blUniform3iARB(loc, array[0],array[1],array[2]);
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -673,6 +712,10 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform3i, "setUniform3i(name, ix,iy,iz) ")
|
|||||||
KX_PYMETHODDEF_DOC( BL_Shader, setUniform4i, "setUniform4i(name, ix,iy,iz, iw) ")
|
KX_PYMETHODDEF_DOC( BL_Shader, setUniform4i, "setUniform4i(name, ix,iy,iz, iw) ")
|
||||||
{
|
{
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
|
if(mError) {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
char *uniform="";
|
char *uniform="";
|
||||||
int array[4]={0,0,0, 0};
|
int array[4]={0,0,0, 0};
|
||||||
if(PyArg_ParseTuple(args, "siiii", &uniform, &array[0],&array[1],&array[2], &array[3] ))
|
if(PyArg_ParseTuple(args, "siiii", &uniform, &array[0],&array[1],&array[2], &array[3] ))
|
||||||
@@ -682,15 +725,15 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform4i, "setUniform4i(name, ix,iy,iz, iw) "
|
|||||||
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
int loc= glGetUniformLocationARB(mShader , uniform);
|
int loc= bgl::blGetUniformLocationARB(mShader , uniform);
|
||||||
if( loc==-1 )
|
if( loc==-1 )
|
||||||
{
|
{
|
||||||
spit("Invalid uniform value: " << uniform << ".");
|
spit("Invalid uniform value: " << uniform << ".");
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
glUseProgramObjectARB(mShader);
|
bgl::blUseProgramObjectARB(mShader);
|
||||||
glUniform4iARB(loc, array[0],array[1],array[2], array[3]);
|
bgl::blUniform4iARB(loc, array[0],array[1],array[2], array[3]);
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -703,6 +746,10 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform4i, "setUniform4i(name, ix,iy,iz, iw) "
|
|||||||
KX_PYMETHODDEF_DOC( BL_Shader, setUniformfv , "setUniformfv( float (list2 or list3 or list4) )")
|
KX_PYMETHODDEF_DOC( BL_Shader, setUniformfv , "setUniformfv( float (list2 or list3 or list4) )")
|
||||||
{
|
{
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
|
if(mError) {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
char*uniform = "";
|
char*uniform = "";
|
||||||
PyObject *listPtr =0;
|
PyObject *listPtr =0;
|
||||||
float array_data[4] = {0.f,0.f,0.f,0.f};
|
float array_data[4] = {0.f,0.f,0.f,0.f};
|
||||||
@@ -714,7 +761,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformfv , "setUniformfv( float (list2 or lis
|
|||||||
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
int loc= glGetUniformLocationARB(mShader , uniform);
|
int loc= bgl::blGetUniformLocationARB(mShader , uniform);
|
||||||
if( loc==-1 )
|
if( loc==-1 )
|
||||||
{
|
{
|
||||||
spit("Invalid uniform value: " << uniform << ".");
|
spit("Invalid uniform value: " << uniform << ".");
|
||||||
@@ -735,20 +782,20 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformfv , "setUniformfv( float (list2 or lis
|
|||||||
{
|
{
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
glUseProgramObjectARB(mShader);
|
bgl::blUseProgramObjectARB(mShader);
|
||||||
glUniform2fARB(loc, array_data[0],array_data[1]);
|
bgl::blUniform2fARB(loc, array_data[0],array_data[1]);
|
||||||
Py_Return;
|
Py_Return;
|
||||||
} break;
|
} break;
|
||||||
case 3:
|
case 3:
|
||||||
{
|
{
|
||||||
glUseProgramObjectARB(mShader);
|
bgl::blUseProgramObjectARB(mShader);
|
||||||
glUniform3fARB(loc, array_data[0],array_data[1], array_data[2]);
|
bgl::blUniform3fARB(loc, array_data[0],array_data[1], array_data[2]);
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}break;
|
}break;
|
||||||
case 4:
|
case 4:
|
||||||
{
|
{
|
||||||
glUseProgramObjectARB(mShader);
|
bgl::blUseProgramObjectARB(mShader);
|
||||||
glUniform4fARB(loc, array_data[0],array_data[1], array_data[2], array_data[3]);
|
bgl::blUniform4fARB(loc, array_data[0],array_data[1], array_data[2], array_data[3]);
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}break;
|
}break;
|
||||||
default:
|
default:
|
||||||
@@ -770,6 +817,10 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformfv , "setUniformfv( float (list2 or lis
|
|||||||
KX_PYMETHODDEF_DOC( BL_Shader, setUniformiv, "setUniformiv( int (list2 or list3 or list4) )")
|
KX_PYMETHODDEF_DOC( BL_Shader, setUniformiv, "setUniformiv( int (list2 or list3 or list4) )")
|
||||||
{
|
{
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
|
if(mError) {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
char*uniform = "";
|
char*uniform = "";
|
||||||
PyObject *listPtr =0;
|
PyObject *listPtr =0;
|
||||||
int array_data[4] = {0,0,0,0};
|
int array_data[4] = {0,0,0,0};
|
||||||
@@ -781,7 +832,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformiv, "setUniformiv( int (list2 or list3
|
|||||||
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
int loc= glGetUniformLocationARB(mShader , uniform);
|
int loc= bgl::blGetUniformLocationARB(mShader , uniform);
|
||||||
if( loc==-1 )
|
if( loc==-1 )
|
||||||
{
|
{
|
||||||
spit("Invalid uniform value: " << uniform << ".");
|
spit("Invalid uniform value: " << uniform << ".");
|
||||||
@@ -802,20 +853,20 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformiv, "setUniformiv( int (list2 or list3
|
|||||||
{
|
{
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
glUseProgramObjectARB(mShader);
|
bgl::blUseProgramObjectARB(mShader);
|
||||||
glUniform2iARB(loc, array_data[0],array_data[1]);
|
bgl::blUniform2iARB(loc, array_data[0],array_data[1]);
|
||||||
Py_Return;
|
Py_Return;
|
||||||
} break;
|
} break;
|
||||||
case 3:
|
case 3:
|
||||||
{
|
{
|
||||||
glUseProgramObjectARB(mShader);
|
bgl::blUseProgramObjectARB(mShader);
|
||||||
glUniform3iARB(loc, array_data[0],array_data[1], array_data[2]);
|
bgl::blUniform3iARB(loc, array_data[0],array_data[1], array_data[2]);
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}break;
|
}break;
|
||||||
case 4:
|
case 4:
|
||||||
{
|
{
|
||||||
glUseProgramObjectARB(mShader);
|
bgl::blUseProgramObjectARB(mShader);
|
||||||
glUniform4iARB(loc, array_data[0],array_data[1], array_data[2], array_data[3]);
|
bgl::blUniform4iARB(loc, array_data[0],array_data[1], array_data[2], array_data[3]);
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}break;
|
}break;
|
||||||
default:
|
default:
|
||||||
@@ -838,6 +889,11 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix4,
|
|||||||
"setUniformMatrix4(uniform-name, mat-4x4, transpose(row-major=true, col-major=false)" )
|
"setUniformMatrix4(uniform-name, mat-4x4, transpose(row-major=true, col-major=false)" )
|
||||||
{
|
{
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
|
if(mError) {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
|
|
||||||
float matr[16] = {
|
float matr[16] = {
|
||||||
1,0,0,0,
|
1,0,0,0,
|
||||||
0,1,0,0,
|
0,1,0,0,
|
||||||
@@ -855,7 +911,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix4,
|
|||||||
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
int loc= glGetUniformLocationARB(mShader , uniform);
|
int loc= bgl::blGetUniformLocationARB(mShader , uniform);
|
||||||
if( loc==-1 )
|
if( loc==-1 )
|
||||||
{
|
{
|
||||||
spit("Invalid uniform value: " << uniform << ".");
|
spit("Invalid uniform value: " << uniform << ".");
|
||||||
@@ -868,8 +924,8 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix4,
|
|||||||
if (PyMatTo(matrix, mat))
|
if (PyMatTo(matrix, mat))
|
||||||
{
|
{
|
||||||
mat.getValue(matr);
|
mat.getValue(matr);
|
||||||
glUseProgramObjectARB(mShader);
|
bgl::blUseProgramObjectARB(mShader);
|
||||||
glUniformMatrix4fvARB(loc, 1, (transp!=0)?GL_TRUE:GL_FALSE, matr);
|
bgl::blUniformMatrix4fvARB(loc, 1, (transp!=0)?GL_TRUE:GL_FALSE, matr);
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -886,6 +942,11 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix3,
|
|||||||
"setUniformMatrix3(uniform-name, list[3x3], transpose(row-major=true, col-major=false)" )
|
"setUniformMatrix3(uniform-name, list[3x3], transpose(row-major=true, col-major=false)" )
|
||||||
{
|
{
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
|
if(mError) {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
|
|
||||||
float matr[9] = {
|
float matr[9] = {
|
||||||
1,0,0,
|
1,0,0,
|
||||||
0,1,0,
|
0,1,0,
|
||||||
@@ -902,7 +963,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix3,
|
|||||||
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
PyErr_Format(PyExc_ValueError, "invalid shader object");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
int loc= glGetUniformLocationARB(mShader , uniform);
|
int loc= bgl::blGetUniformLocationARB(mShader , uniform);
|
||||||
if( loc==-1 )
|
if( loc==-1 )
|
||||||
{
|
{
|
||||||
spit("Invalid uniform value: " << uniform << ".");
|
spit("Invalid uniform value: " << uniform << ".");
|
||||||
@@ -915,8 +976,8 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix3,
|
|||||||
if (PyMatTo(matrix, mat))
|
if (PyMatTo(matrix, mat))
|
||||||
{
|
{
|
||||||
mat.getValue(matr);
|
mat.getValue(matr);
|
||||||
glUseProgramObjectARB(mShader);
|
bgl::blUseProgramObjectARB(mShader);
|
||||||
glUniformMatrix3fvARB(loc, 1, (transp!=0)?GL_TRUE:GL_FALSE, matr);
|
bgl::blUniformMatrix3fvARB(loc, 1, (transp!=0)?GL_TRUE:GL_FALSE, matr);
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -927,16 +988,3 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix3,
|
|||||||
Py_Return;
|
Py_Return;
|
||||||
#endif//GL_ARB_shader_objects
|
#endif//GL_ARB_shader_objects
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
KX_PYMETHODDEF_DOC( BL_Shader, setBlending, "setBlending(src, dest)" )
|
|
||||||
{
|
|
||||||
int src, dest;
|
|
||||||
if(PyArg_ParseTuple(args, "ii", &src, &dest))
|
|
||||||
{
|
|
||||||
mBlending.src = src;
|
|
||||||
mBlending.dest = dest;
|
|
||||||
Py_Return;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -18,17 +18,6 @@ typedef struct uSampler
|
|||||||
#define SAMP_2D 1
|
#define SAMP_2D 1
|
||||||
#define SAMP_CUBE 2
|
#define SAMP_CUBE 2
|
||||||
|
|
||||||
|
|
||||||
// -----------------------------------
|
|
||||||
typedef struct uBlending
|
|
||||||
{
|
|
||||||
unsigned int pass;
|
|
||||||
int src; // GL_ blend func values
|
|
||||||
int dest;
|
|
||||||
float const_color[4];
|
|
||||||
}uBlending;
|
|
||||||
// -----------------------------------
|
|
||||||
|
|
||||||
// ----------------
|
// ----------------
|
||||||
class BL_Shader : public PyObjectPlus
|
class BL_Shader : public PyObjectPlus
|
||||||
{
|
{
|
||||||
@@ -41,14 +30,15 @@ private:
|
|||||||
bool mOk;
|
bool mOk;
|
||||||
bool mUse;
|
bool mUse;
|
||||||
uSampler mSampler[MAXTEX];
|
uSampler mSampler[MAXTEX];
|
||||||
uBlending mBlending;
|
|
||||||
char* vertProg;
|
char* vertProg;
|
||||||
char* fragProg;
|
char* fragProg;
|
||||||
bool LinkProgram();
|
bool mError;
|
||||||
bool PrintInfo(int len, unsigned int handle, const char *type);
|
char* mLog;
|
||||||
|
|
||||||
|
bool LinkProgram();
|
||||||
|
void PrintInfo( int len, unsigned int handle,int *num);
|
||||||
public:
|
public:
|
||||||
BL_Shader(int n, PyTypeObject *T=&Type);
|
BL_Shader(PyTypeObject *T=&Type);
|
||||||
virtual ~BL_Shader();
|
virtual ~BL_Shader();
|
||||||
|
|
||||||
char* GetVertPtr();
|
char* GetVertPtr();
|
||||||
@@ -59,11 +49,10 @@ public:
|
|||||||
// ---
|
// ---
|
||||||
int getNumPass() {return mPass;}
|
int getNumPass() {return mPass;}
|
||||||
bool use() {return mUse;}
|
bool use() {return mUse;}
|
||||||
|
bool GetError() {return mError;}
|
||||||
// ---
|
// ---
|
||||||
// access
|
// access
|
||||||
const uSampler* getSampler(int i);
|
const uSampler* getSampler(int i);
|
||||||
const uBlending* getBlending( int pass );
|
|
||||||
const bool Ok()const;
|
const bool Ok()const;
|
||||||
|
|
||||||
unsigned int GetProg();
|
unsigned int GetProg();
|
||||||
@@ -108,8 +97,6 @@ public:
|
|||||||
// these come from within the material buttons
|
// these come from within the material buttons
|
||||||
// sampler2d/samplerCube work
|
// sampler2d/samplerCube work
|
||||||
KX_PYMETHOD_DOC( BL_Shader, setSampler);
|
KX_PYMETHOD_DOC( BL_Shader, setSampler);
|
||||||
// user blending funcs
|
|
||||||
KX_PYMETHOD_DOC( BL_Shader, setBlending );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
#define GL_GLEXT_LEGACY 1
|
||||||
#include <OpenGL/gl.h>
|
#include <OpenGL/gl.h>
|
||||||
#include <OpenGL/glu.h>
|
#include <OpenGL/glu.h>
|
||||||
#else
|
#else
|
||||||
@@ -20,7 +21,6 @@
|
|||||||
#include "DNA_image_types.h"
|
#include "DNA_image_types.h"
|
||||||
#include "IMB_imbuf_types.h"
|
#include "IMB_imbuf_types.h"
|
||||||
#include "BKE_image.h"
|
#include "BKE_image.h"
|
||||||
//#include "IMB_imbuf.h"
|
|
||||||
#include "BLI_blenlib.h"
|
#include "BLI_blenlib.h"
|
||||||
|
|
||||||
#include "RAS_GLExtensionManager.h"
|
#include "RAS_GLExtensionManager.h"
|
||||||
@@ -35,6 +35,7 @@ using namespace bgl;
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
// envmaps
|
// envmaps
|
||||||
#include "IMB_imbuf.h"
|
#include "IMB_imbuf.h"
|
||||||
|
|
||||||
void my_envmap_split_ima(EnvMap *env);
|
void my_envmap_split_ima(EnvMap *env);
|
||||||
void my_free_envmapdata(EnvMap *env);
|
void my_free_envmapdata(EnvMap *env);
|
||||||
}
|
}
|
||||||
@@ -345,18 +346,18 @@ void my_envmap_split_ima(EnvMap *env)
|
|||||||
ima->ok= 1;
|
ima->ok= 1;
|
||||||
env->cube[part]= ima;
|
env->cube[part]= ima;
|
||||||
}
|
}
|
||||||
IMB_rectcpy(env->cube[0]->ibuf, env->ima->ibuf,
|
IMB_rectop(env->cube[0]->ibuf, env->ima->ibuf,
|
||||||
0, 0, 0, 0, dx, dx);
|
0, 0, 0, 0, dx, dx, IMB_rectcpy, 0);
|
||||||
IMB_rectcpy(env->cube[1]->ibuf, env->ima->ibuf,
|
IMB_rectop(env->cube[1]->ibuf, env->ima->ibuf,
|
||||||
0, 0, dx, 0, dx, dx);
|
0, 0, dx, 0, dx, dx, IMB_rectcpy, 0);
|
||||||
IMB_rectcpy(env->cube[2]->ibuf, env->ima->ibuf,
|
IMB_rectop(env->cube[2]->ibuf, env->ima->ibuf,
|
||||||
0, 0, 2*dx, 0, dx, dx);
|
0, 0, 2*dx, 0, dx, dx, IMB_rectcpy, 0);
|
||||||
IMB_rectcpy(env->cube[3]->ibuf, env->ima->ibuf,
|
IMB_rectop(env->cube[3]->ibuf, env->ima->ibuf,
|
||||||
0, 0, 0, dx, dx, dx);
|
0, 0, 0, dx, dx, dx, IMB_rectcpy, 0);
|
||||||
IMB_rectcpy(env->cube[4]->ibuf, env->ima->ibuf,
|
IMB_rectop(env->cube[4]->ibuf, env->ima->ibuf,
|
||||||
0, 0, dx, dx, dx, dx);
|
0, 0, dx, dx, dx, dx, IMB_rectcpy, 0);
|
||||||
IMB_rectcpy(env->cube[5]->ibuf, env->ima->ibuf,
|
IMB_rectop(env->cube[5]->ibuf, env->ima->ibuf,
|
||||||
0, 0, 2*dx, dx, dx, dx);
|
0, 0, 2*dx, dx, dx, dx, IMB_rectcpy, 0);
|
||||||
env->ok= 2;
|
env->ok= 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
#define GL_GLEXT_LEGACY 1
|
||||||
#include <OpenGL/gl.h>
|
#include <OpenGL/gl.h>
|
||||||
#include <OpenGL/glu.h>
|
#include <OpenGL/glu.h>
|
||||||
#else
|
#else
|
||||||
@@ -22,6 +23,7 @@
|
|||||||
#include "KX_Scene.h"
|
#include "KX_Scene.h"
|
||||||
#include "KX_Light.h"
|
#include "KX_Light.h"
|
||||||
#include "KX_GameObject.h"
|
#include "KX_GameObject.h"
|
||||||
|
#include "KX_MeshProxy.h"
|
||||||
|
|
||||||
#include "MT_Vector3.h"
|
#include "MT_Vector3.h"
|
||||||
#include "MT_Vector4.h"
|
#include "MT_Vector4.h"
|
||||||
@@ -75,7 +77,10 @@ KX_BlenderMaterial::KX_BlenderMaterial(
|
|||||||
mMaterial(data),
|
mMaterial(data),
|
||||||
mShader(0),
|
mShader(0),
|
||||||
mScene(scene),
|
mScene(scene),
|
||||||
|
mUserDefBlend(0),
|
||||||
|
mModified(0),
|
||||||
mPass(0)
|
mPass(0)
|
||||||
|
|
||||||
{
|
{
|
||||||
///RAS_EXT_support._ARB_multitexture == true if were here
|
///RAS_EXT_support._ARB_multitexture == true if were here
|
||||||
|
|
||||||
@@ -101,8 +106,8 @@ KX_BlenderMaterial::KX_BlenderMaterial(
|
|||||||
// prevent material bleeding
|
// prevent material bleeding
|
||||||
for(int i=0; i<mMaterial->num_enabled; i++) {
|
for(int i=0; i<mMaterial->num_enabled; i++) {
|
||||||
m_multimode +=
|
m_multimode +=
|
||||||
(mMaterial->flag[i] +
|
( mMaterial->flag[i] +
|
||||||
mMaterial->blend_mode[i]
|
mMaterial->blend_mode[i]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
m_multimode += mMaterial->IdMode+mMaterial->ras_mode;
|
m_multimode += mMaterial->IdMode+mMaterial->ras_mode;
|
||||||
@@ -132,14 +137,9 @@ void KX_BlenderMaterial::OnConstruction()
|
|||||||
if(!gTextureDict)
|
if(!gTextureDict)
|
||||||
gTextureDict = PyDict_New();
|
gTextureDict = PyDict_New();
|
||||||
*/
|
*/
|
||||||
#ifdef GL_ARB_shader_objects
|
|
||||||
if( RAS_EXT_support._ARB_shader_objects )
|
|
||||||
mShader = new BL_Shader( mMaterial->num_enabled );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for(i=0; i<mMaterial->num_enabled; i++) {
|
for(i=0; i<mMaterial->num_enabled; i++) {
|
||||||
glActiveTextureARB(GL_TEXTURE0_ARB+i);
|
bgl::blActiveTextureARB(GL_TEXTURE0_ARB+i);
|
||||||
#ifdef GL_ARB_texture_cube_map
|
#ifdef GL_ARB_texture_cube_map
|
||||||
if( mMaterial->mapping[i].mapping & USEENV ) {
|
if( mMaterial->mapping[i].mapping & USEENV ) {
|
||||||
if(!RAS_EXT_support._ARB_texture_cube_map) {
|
if(!RAS_EXT_support._ARB_texture_cube_map) {
|
||||||
@@ -149,9 +149,6 @@ void KX_BlenderMaterial::OnConstruction()
|
|||||||
if(!mTextures[i].InitCubeMap( mMaterial->cubemap[i] ) )
|
if(!mTextures[i].InitCubeMap( mMaterial->cubemap[i] ) )
|
||||||
spit("unable to initialize image("<<i<<") in "<<
|
spit("unable to initialize image("<<i<<") in "<<
|
||||||
mMaterial->matname<< ", image will not be available");
|
mMaterial->matname<< ", image will not be available");
|
||||||
|
|
||||||
if( RAS_EXT_support._ARB_shader_objects )
|
|
||||||
mShader->InitializeSampler(SAMP_CUBE, i, 0, mTextures[i]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
@@ -160,9 +157,6 @@ void KX_BlenderMaterial::OnConstruction()
|
|||||||
if( ! mTextures[i].InitFromImage(mMaterial->img[i], (mMaterial->flag[i] &MIPMAP)!=0 ))
|
if( ! mTextures[i].InitFromImage(mMaterial->img[i], (mMaterial->flag[i] &MIPMAP)!=0 ))
|
||||||
spit("unable to initialize image("<<i<<") in "<<
|
spit("unable to initialize image("<<i<<") in "<<
|
||||||
mMaterial->matname<< ", image will not be available");
|
mMaterial->matname<< ", image will not be available");
|
||||||
|
|
||||||
if( RAS_EXT_support._ARB_shader_objects )
|
|
||||||
mShader->InitializeSampler(SAMP_2D, i, 0, mTextures[i]);
|
|
||||||
}
|
}
|
||||||
#ifdef GL_ARB_texture_cube_map
|
#ifdef GL_ARB_texture_cube_map
|
||||||
}
|
}
|
||||||
@@ -170,24 +164,27 @@ void KX_BlenderMaterial::OnConstruction()
|
|||||||
/*PyDict_SetItemString(gTextureDict, mTextures[i].GetName().Ptr(), PyInt_FromLong(mTextures[i]));*/
|
/*PyDict_SetItemString(gTextureDict, mTextures[i].GetName().Ptr(), PyInt_FromLong(mTextures[i]));*/
|
||||||
}
|
}
|
||||||
#endif//GL_ARB_multitexture
|
#endif//GL_ARB_multitexture
|
||||||
|
|
||||||
|
mBlendFunc[0] =0;
|
||||||
|
mBlendFunc[1] =0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void KX_BlenderMaterial::OnExit()
|
void KX_BlenderMaterial::OnExit()
|
||||||
{
|
{
|
||||||
#ifdef GL_ARB_multitexture
|
#ifdef GL_ARB_multitexture
|
||||||
|
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
if( RAS_EXT_support._ARB_shader_objects && mShader ) {
|
if( RAS_EXT_support._ARB_shader_objects && mShader ) {
|
||||||
//note, the shader here is allocated, per unique material
|
//note, the shader here is allocated, per unique material
|
||||||
//and this function is called per face
|
//and this function is called per face
|
||||||
glUseProgramObjectARB(0);
|
bgl::blUseProgramObjectARB(0);
|
||||||
delete mShader;
|
delete mShader;
|
||||||
mShader = 0;
|
mShader = 0;
|
||||||
}
|
}
|
||||||
#endif //GL_ARB_shader_objects
|
#endif //GL_ARB_shader_objects
|
||||||
|
|
||||||
for(int i=0; i<mMaterial->num_enabled; i++) {
|
for(int i=0; i<mMaterial->num_enabled; i++) {
|
||||||
glActiveTextureARB(GL_TEXTURE0_ARB+i);
|
bgl::blActiveTextureARB(GL_TEXTURE0_ARB+i);
|
||||||
|
|
||||||
mTextures[i].DeleteTex();
|
mTextures[i].DeleteTex();
|
||||||
|
|
||||||
@@ -213,7 +210,7 @@ void KX_BlenderMaterial::OnExit()
|
|||||||
gTextureDict = 0;
|
gTextureDict = 0;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
glActiveTextureARB(GL_TEXTURE0_ARB);
|
bgl::blActiveTextureARB(GL_TEXTURE0_ARB);
|
||||||
|
|
||||||
#ifdef GL_ARB_texture_cube_map
|
#ifdef GL_ARB_texture_cube_map
|
||||||
if(RAS_EXT_support._ARB_texture_cube_map)
|
if(RAS_EXT_support._ARB_texture_cube_map)
|
||||||
@@ -238,7 +235,7 @@ void KX_BlenderMaterial::DisableTexData()
|
|||||||
#ifdef GL_ARB_multitexture
|
#ifdef GL_ARB_multitexture
|
||||||
int i=(MAXTEX>=bgl::max_texture_units?bgl::max_texture_units:MAXTEX)-1;
|
int i=(MAXTEX>=bgl::max_texture_units?bgl::max_texture_units:MAXTEX)-1;
|
||||||
for(; i>=0; i--) {
|
for(; i>=0; i--) {
|
||||||
glActiveTextureARB(GL_TEXTURE0_ARB+i);
|
bgl::blActiveTextureARB(GL_TEXTURE0_ARB+i);
|
||||||
glMatrixMode(GL_TEXTURE);
|
glMatrixMode(GL_TEXTURE);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
@@ -268,13 +265,13 @@ void KX_BlenderMaterial::setShaderData( bool enable )
|
|||||||
int i;
|
int i;
|
||||||
if( !enable || !mShader->Ok() ) {
|
if( !enable || !mShader->Ok() ) {
|
||||||
// frame cleanup.
|
// frame cleanup.
|
||||||
glUseProgramObjectARB( 0 );
|
bgl::blUseProgramObjectARB( 0 );
|
||||||
DisableTexData();
|
DisableTexData();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DisableTexData();
|
DisableTexData();
|
||||||
glUseProgramObjectARB( mShader->GetProg() );
|
bgl::blUseProgramObjectARB( mShader->GetProg() );
|
||||||
|
|
||||||
// for each enabled unit
|
// for each enabled unit
|
||||||
for(i=0; i<mMaterial->num_enabled; i++) {
|
for(i=0; i<mMaterial->num_enabled; i++) {
|
||||||
@@ -282,7 +279,7 @@ void KX_BlenderMaterial::setShaderData( bool enable )
|
|||||||
const uSampler *samp = mShader->getSampler(i);
|
const uSampler *samp = mShader->getSampler(i);
|
||||||
if( samp->loc == -1 || samp->glTexture == 0 ) continue;
|
if( samp->loc == -1 || samp->glTexture == 0 ) continue;
|
||||||
|
|
||||||
glActiveTextureARB(GL_TEXTURE0_ARB+i);
|
bgl::blActiveTextureARB(GL_TEXTURE0_ARB+i);
|
||||||
|
|
||||||
#ifdef GL_ARB_texture_cube_map
|
#ifdef GL_ARB_texture_cube_map
|
||||||
if( mMaterial->mapping[i].mapping &USEENV ) {
|
if( mMaterial->mapping[i].mapping &USEENV ) {
|
||||||
@@ -297,9 +294,17 @@ void KX_BlenderMaterial::setShaderData( bool enable )
|
|||||||
}
|
}
|
||||||
#endif//GL_ARB_texture_cube_map
|
#endif//GL_ARB_texture_cube_map
|
||||||
// use a sampler
|
// use a sampler
|
||||||
glUniform1iARB(samp->loc, i );
|
bgl::blUniform1iARB(samp->loc, i );
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!mUserDefBlend) {
|
||||||
|
setDefaultBlending();
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
glEnable(GL_BLEND);
|
||||||
|
// tested to be valid enums
|
||||||
|
glBlendFunc(mBlendFunc[0], mBlendFunc[1]);
|
||||||
}
|
}
|
||||||
glDisable(GL_BLEND);
|
|
||||||
|
|
||||||
#endif//GL_ARB_shader_objects
|
#endif//GL_ARB_shader_objects
|
||||||
#endif//GL_ARB_multitexture
|
#endif//GL_ARB_multitexture
|
||||||
@@ -314,7 +319,7 @@ void KX_BlenderMaterial::setTexData( bool enable )
|
|||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
if(RAS_EXT_support._ARB_shader_objects) {
|
if(RAS_EXT_support._ARB_shader_objects) {
|
||||||
// switch back to fixed func
|
// switch back to fixed func
|
||||||
glUseProgramObjectARB( 0 );
|
bgl::blUseProgramObjectARB( 0 );
|
||||||
}
|
}
|
||||||
#endif//GL_ARB_shader_objects
|
#endif//GL_ARB_shader_objects
|
||||||
|
|
||||||
@@ -336,7 +341,7 @@ void KX_BlenderMaterial::setTexData( bool enable )
|
|||||||
// no material connected to the object
|
// no material connected to the object
|
||||||
if( mTextures[0] ) {
|
if( mTextures[0] ) {
|
||||||
if( !mTextures[0].Ok() ) return;
|
if( !mTextures[0].Ok() ) return;
|
||||||
glActiveTextureARB(GL_TEXTURE0_ARB);
|
bgl::blActiveTextureARB(GL_TEXTURE0_ARB);
|
||||||
glBindTexture( GL_TEXTURE_2D, mTextures[0] );
|
glBindTexture( GL_TEXTURE_2D, mTextures[0] );
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
setTextureEnvironment( -1 ); // modulate
|
setTextureEnvironment( -1 ); // modulate
|
||||||
@@ -352,7 +357,7 @@ void KX_BlenderMaterial::setTexData( bool enable )
|
|||||||
for(i=0; (i<mMaterial->num_enabled); i++) {
|
for(i=0; (i<mMaterial->num_enabled); i++) {
|
||||||
if( !mTextures[i].Ok() ) continue;
|
if( !mTextures[i].Ok() ) continue;
|
||||||
|
|
||||||
glActiveTextureARB(GL_TEXTURE0_ARB+i);
|
bgl::blActiveTextureARB(GL_TEXTURE0_ARB+i);
|
||||||
|
|
||||||
#ifdef GL_ARB_texture_cube_map
|
#ifdef GL_ARB_texture_cube_map
|
||||||
// use environment maps
|
// use environment maps
|
||||||
@@ -388,15 +393,16 @@ void KX_BlenderMaterial::setTexData( bool enable )
|
|||||||
#ifdef GL_ARB_texture_cube_map
|
#ifdef GL_ARB_texture_cube_map
|
||||||
}
|
}
|
||||||
#endif//GL_ARB_texture_cube_map
|
#endif//GL_ARB_texture_cube_map
|
||||||
|
|
||||||
// if either unit has set blending
|
|
||||||
// and its the last pass
|
|
||||||
lastblend += setBlending( i ); // dry run
|
|
||||||
if(lastblend >0 && i==mMaterial->num_enabled-1)
|
|
||||||
setBlending( i, true );
|
|
||||||
else if(lastblend == 0 && i==mMaterial->num_enabled-1)
|
|
||||||
glDisable(GL_BLEND);
|
|
||||||
}
|
}
|
||||||
|
if(!mUserDefBlend) {
|
||||||
|
setDefaultBlending();
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
glEnable(GL_BLEND);
|
||||||
|
// tested to be valid enums
|
||||||
|
glBlendFunc(mBlendFunc[0], mBlendFunc[1]);
|
||||||
|
}
|
||||||
|
|
||||||
#endif//GL_ARB_multitexture
|
#endif//GL_ARB_multitexture
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -548,7 +554,7 @@ KX_BlenderMaterial::Activate(
|
|||||||
return dopass;
|
return dopass;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
glUseProgramObjectARB( 0 );
|
bgl::blUseProgramObjectARB( 0 );
|
||||||
mPass = 0;
|
mPass = 0;
|
||||||
dopass = false;
|
dopass = false;
|
||||||
return dopass;
|
return dopass;
|
||||||
@@ -587,9 +593,8 @@ void KX_BlenderMaterial::setTextureEnvironment( int textureIndex )
|
|||||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB );
|
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB );
|
||||||
|
|
||||||
GLfloat blend_operand = GL_SRC_COLOR;
|
GLfloat blend_operand = GL_SRC_COLOR;
|
||||||
GLfloat blend_operand_prev = GL_SRC_COLOR;
|
GLfloat blend_operand_prev = GL_SRC_COLOR;
|
||||||
|
|
||||||
// all sources here are RGB by default
|
|
||||||
GLenum combiner = GL_COMBINE_RGB_ARB;
|
GLenum combiner = GL_COMBINE_RGB_ARB;
|
||||||
GLenum source0 = GL_SOURCE0_RGB_ARB;
|
GLenum source0 = GL_SOURCE0_RGB_ARB;
|
||||||
GLenum source1 = GL_SOURCE1_RGB_ARB;
|
GLenum source1 = GL_SOURCE1_RGB_ARB;
|
||||||
@@ -597,6 +602,7 @@ void KX_BlenderMaterial::setTextureEnvironment( int textureIndex )
|
|||||||
GLenum op0 = GL_OPERAND0_RGB_ARB;
|
GLenum op0 = GL_OPERAND0_RGB_ARB;
|
||||||
GLenum op1 = GL_OPERAND1_RGB_ARB;
|
GLenum op1 = GL_OPERAND1_RGB_ARB;
|
||||||
GLenum op2 = GL_OPERAND2_RGB_ARB;
|
GLenum op2 = GL_OPERAND2_RGB_ARB;
|
||||||
|
GLfloat alphaOp = GL_SRC_ALPHA;
|
||||||
|
|
||||||
// switch to alpha combiners
|
// switch to alpha combiners
|
||||||
if( (mMaterial->flag[textureIndex] &TEXALPHA) ) {
|
if( (mMaterial->flag[textureIndex] &TEXALPHA) ) {
|
||||||
@@ -608,7 +614,6 @@ void KX_BlenderMaterial::setTextureEnvironment( int textureIndex )
|
|||||||
op1 = GL_OPERAND1_ALPHA_ARB;
|
op1 = GL_OPERAND1_ALPHA_ARB;
|
||||||
op2 = GL_OPERAND2_ALPHA_ARB;
|
op2 = GL_OPERAND2_ALPHA_ARB;
|
||||||
blend_operand = GL_SRC_ALPHA;
|
blend_operand = GL_SRC_ALPHA;
|
||||||
blend_operand_prev = GL_SRC_ALPHA;
|
|
||||||
|
|
||||||
// invert
|
// invert
|
||||||
if(mMaterial->flag[textureIndex] &TEXNEG) {
|
if(mMaterial->flag[textureIndex] &TEXNEG) {
|
||||||
@@ -618,27 +623,42 @@ void KX_BlenderMaterial::setTextureEnvironment( int textureIndex )
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(mMaterial->flag[textureIndex] &TEXNEG) {
|
if(mMaterial->flag[textureIndex] &TEXNEG) {
|
||||||
blend_operand_prev = GL_ONE_MINUS_SRC_COLOR;
|
blend_operand_prev=GL_ONE_MINUS_SRC_COLOR;
|
||||||
blend_operand = GL_ONE_MINUS_SRC_COLOR;
|
blend_operand = GL_ONE_MINUS_SRC_COLOR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// on Texture0 GL_PREVIOUS_ARB is the primary color
|
bool using_alpha = false;
|
||||||
// on Texture1 GL_PREVIOUS_ARB is Texture0 env
|
|
||||||
|
if(mMaterial->flag[textureIndex] &USEALPHA){
|
||||||
|
alphaOp = GL_ONE_MINUS_SRC_ALPHA;
|
||||||
|
using_alpha=true;
|
||||||
|
}
|
||||||
|
else if(mMaterial->flag[textureIndex] &USENEGALPHA){
|
||||||
|
alphaOp = GL_SRC_ALPHA;
|
||||||
|
using_alpha = true;
|
||||||
|
}
|
||||||
|
|
||||||
switch( mMaterial->blend_mode[textureIndex] ) {
|
switch( mMaterial->blend_mode[textureIndex] ) {
|
||||||
case BLEND_MIX:
|
case BLEND_MIX:
|
||||||
{
|
{
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
GLfloat base_col[4];
|
if(!using_alpha) {
|
||||||
base_col[0] = base_col[1] = base_col[2] = 0.f;
|
GLfloat base_col[4];
|
||||||
base_col[3] = 1.f-mMaterial->color_blend[textureIndex];
|
base_col[0] = base_col[1] = base_col[2] = 0.f;
|
||||||
glTexEnvfv( GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR,base_col );
|
base_col[3] = 1.f-mMaterial->color_blend[textureIndex];
|
||||||
|
glTexEnvfv( GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR,base_col );
|
||||||
|
}
|
||||||
glTexEnvf( GL_TEXTURE_ENV, combiner, GL_INTERPOLATE_ARB);
|
glTexEnvf( GL_TEXTURE_ENV, combiner, GL_INTERPOLATE_ARB);
|
||||||
glTexEnvf( GL_TEXTURE_ENV, source0, GL_PREVIOUS_ARB);
|
glTexEnvf( GL_TEXTURE_ENV, source0, GL_PREVIOUS_ARB);
|
||||||
glTexEnvf( GL_TEXTURE_ENV, op0, blend_operand_prev );
|
glTexEnvf( GL_TEXTURE_ENV, op0, blend_operand_prev );
|
||||||
glTexEnvf( GL_TEXTURE_ENV, source1, GL_TEXTURE );
|
glTexEnvf( GL_TEXTURE_ENV, source1, GL_TEXTURE );
|
||||||
glTexEnvf( GL_TEXTURE_ENV, op1, blend_operand);
|
glTexEnvf( GL_TEXTURE_ENV, op1, blend_operand);
|
||||||
glTexEnvf( GL_TEXTURE_ENV, source2, GL_CONSTANT_ARB );
|
if(!using_alpha)
|
||||||
glTexEnvf( GL_TEXTURE_ENV, op2, GL_SRC_ALPHA);
|
glTexEnvf( GL_TEXTURE_ENV, source2, GL_CONSTANT_ARB );
|
||||||
|
else
|
||||||
|
glTexEnvf( GL_TEXTURE_ENV, source2, GL_TEXTURE );
|
||||||
|
|
||||||
|
glTexEnvf( GL_TEXTURE_ENV, op2, alphaOp);
|
||||||
}break;
|
}break;
|
||||||
case BLEND_MUL:
|
case BLEND_MUL:
|
||||||
{
|
{
|
||||||
@@ -647,7 +667,10 @@ void KX_BlenderMaterial::setTextureEnvironment( int textureIndex )
|
|||||||
glTexEnvf( GL_TEXTURE_ENV, source0, GL_PREVIOUS_ARB);
|
glTexEnvf( GL_TEXTURE_ENV, source0, GL_PREVIOUS_ARB);
|
||||||
glTexEnvf( GL_TEXTURE_ENV, op0, blend_operand_prev);
|
glTexEnvf( GL_TEXTURE_ENV, op0, blend_operand_prev);
|
||||||
glTexEnvf( GL_TEXTURE_ENV, source1, GL_TEXTURE );
|
glTexEnvf( GL_TEXTURE_ENV, source1, GL_TEXTURE );
|
||||||
glTexEnvf( GL_TEXTURE_ENV, op1, blend_operand);
|
if(using_alpha)
|
||||||
|
glTexEnvf( GL_TEXTURE_ENV, op1, alphaOp);
|
||||||
|
else
|
||||||
|
glTexEnvf( GL_TEXTURE_ENV, op1, blend_operand);
|
||||||
}break;
|
}break;
|
||||||
case BLEND_ADD:
|
case BLEND_ADD:
|
||||||
{
|
{
|
||||||
@@ -656,7 +679,10 @@ void KX_BlenderMaterial::setTextureEnvironment( int textureIndex )
|
|||||||
glTexEnvf( GL_TEXTURE_ENV, source0, GL_PREVIOUS_ARB );
|
glTexEnvf( GL_TEXTURE_ENV, source0, GL_PREVIOUS_ARB );
|
||||||
glTexEnvf( GL_TEXTURE_ENV, op0, blend_operand_prev );
|
glTexEnvf( GL_TEXTURE_ENV, op0, blend_operand_prev );
|
||||||
glTexEnvf( GL_TEXTURE_ENV, source1, GL_TEXTURE );
|
glTexEnvf( GL_TEXTURE_ENV, source1, GL_TEXTURE );
|
||||||
glTexEnvf( GL_TEXTURE_ENV, op1, blend_operand );
|
if(using_alpha)
|
||||||
|
glTexEnvf( GL_TEXTURE_ENV, op1, alphaOp);
|
||||||
|
else
|
||||||
|
glTexEnvf( GL_TEXTURE_ENV, op1, blend_operand);
|
||||||
}break;
|
}break;
|
||||||
case BLEND_SUB:
|
case BLEND_SUB:
|
||||||
{
|
{
|
||||||
@@ -674,37 +700,16 @@ void KX_BlenderMaterial::setTextureEnvironment( int textureIndex )
|
|||||||
glTexEnvf( GL_TEXTURE_ENV, source0, GL_PREVIOUS_ARB );
|
glTexEnvf( GL_TEXTURE_ENV, source0, GL_PREVIOUS_ARB );
|
||||||
glTexEnvf( GL_TEXTURE_ENV, op0, blend_operand_prev );
|
glTexEnvf( GL_TEXTURE_ENV, op0, blend_operand_prev );
|
||||||
glTexEnvf( GL_TEXTURE_ENV, source1, GL_TEXTURE );
|
glTexEnvf( GL_TEXTURE_ENV, source1, GL_TEXTURE );
|
||||||
glTexEnvf( GL_TEXTURE_ENV, op1, blend_operand);
|
if(using_alpha)
|
||||||
|
glTexEnvf( GL_TEXTURE_ENV, op1, alphaOp);
|
||||||
|
else
|
||||||
|
glTexEnvf( GL_TEXTURE_ENV, op1, blend_operand);
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
glTexEnvf( GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, 1.0);
|
||||||
#endif //!GL_ARB_texture_env_combine
|
#endif //!GL_ARB_texture_env_combine
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KX_BlenderMaterial::setBlending( int ind, bool enable)
|
|
||||||
{
|
|
||||||
if(!enable) {
|
|
||||||
if(mMaterial->flag[ind] &CALCALPHA ) return true;
|
|
||||||
else if(mMaterial->flag[ind] &USEALPHA ) return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// additive
|
|
||||||
if(mMaterial->flag[ind] &CALCALPHA ) {
|
|
||||||
glEnable(GL_BLEND);
|
|
||||||
glBlendFunc(GL_ONE, GL_ONE);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// use alpha channel
|
|
||||||
else if(mMaterial->flag[ind] &USEALPHA ) {
|
|
||||||
glEnable(GL_BLEND);
|
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool KX_BlenderMaterial::setDefaultBlending()
|
bool KX_BlenderMaterial::setDefaultBlending()
|
||||||
{
|
{
|
||||||
if( mMaterial->transp &TF_ADD) {
|
if( mMaterial->transp &TF_ADD) {
|
||||||
@@ -873,6 +878,7 @@ PyMethodDef KX_BlenderMaterial::Methods[] =
|
|||||||
{
|
{
|
||||||
KX_PYMETHODTABLE( KX_BlenderMaterial, getShader ),
|
KX_PYMETHODTABLE( KX_BlenderMaterial, getShader ),
|
||||||
KX_PYMETHODTABLE( KX_BlenderMaterial, getMaterialIndex ),
|
KX_PYMETHODTABLE( KX_BlenderMaterial, getMaterialIndex ),
|
||||||
|
KX_PYMETHODTABLE( KX_BlenderMaterial, setBlending ),
|
||||||
// KX_PYMETHODTABLE( KX_BlenderMaterial, getTexture ),
|
// KX_PYMETHODTABLE( KX_BlenderMaterial, getTexture ),
|
||||||
// KX_PYMETHODTABLE( KX_BlenderMaterial, setTexture ),
|
// KX_PYMETHODTABLE( KX_BlenderMaterial, setTexture ),
|
||||||
|
|
||||||
@@ -914,20 +920,78 @@ int KX_BlenderMaterial::_setattr(const STR_String& attr, PyObject *pyvalue)
|
|||||||
return PyObjectPlus::_setattr(attr, pyvalue);
|
return PyObjectPlus::_setattr(attr, pyvalue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getShader , "getShader()")
|
KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getShader , "getShader()")
|
||||||
{
|
{
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_fragment_shader
|
||||||
if(!RAS_EXT_support._ARB_shader_objects) {
|
if( !RAS_EXT_support._ARB_fragment_shader) {
|
||||||
PyErr_Format(PyExc_SystemError, "GLSL not supported");
|
if(!mModified)
|
||||||
return NULL;
|
spit("Fragment shaders not supported");
|
||||||
|
|
||||||
|
mModified = true;
|
||||||
|
Py_Return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef GL_ARB_vertex_shader
|
||||||
|
if( !RAS_EXT_support._ARB_vertex_shader) {
|
||||||
|
if(!mModified)
|
||||||
|
spit("Vertex shaders not supported");
|
||||||
|
|
||||||
|
mModified = true;
|
||||||
|
Py_Return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef GL_ARB_shader_objects
|
||||||
|
if(!RAS_EXT_support._ARB_shader_objects) {
|
||||||
|
if(!mModified)
|
||||||
|
spit("GLSL not supported");
|
||||||
|
mModified = true;
|
||||||
|
Py_Return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Py_INCREF(mShader);
|
// returns Py_None on error
|
||||||
return mShader;
|
// the calling script will need to check
|
||||||
|
|
||||||
|
if(!mShader && !mModified) {
|
||||||
|
mShader = new BL_Shader();
|
||||||
|
for(int i= 0; i<mMaterial->num_enabled; i++) {
|
||||||
|
if(mMaterial->mapping[i].mapping & USEENV )
|
||||||
|
mShader->InitializeSampler(SAMP_CUBE, i, 0, mTextures[i]);
|
||||||
|
else
|
||||||
|
mShader->InitializeSampler(SAMP_2D, i, 0, mTextures[i]);
|
||||||
|
}
|
||||||
|
mModified = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mShader && !mShader->GetError()) {
|
||||||
|
Py_INCREF(mShader);
|
||||||
|
return mShader;
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
// decref all references to the object
|
||||||
|
// then delete it!
|
||||||
|
// We will then go back to fixed functionality
|
||||||
|
// for this material
|
||||||
|
if(mShader) {
|
||||||
|
if(mShader->ob_refcnt > 1) {
|
||||||
|
Py_DECREF(mShader);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
delete mShader;
|
||||||
|
mShader=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Py_Return;
|
||||||
}
|
}
|
||||||
#else
|
PyErr_Format(PyExc_ValueError, "GLSL Error");
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
#else
|
||||||
Py_Return;
|
Py_Return;
|
||||||
#endif//GL_ARB_shader_objects
|
#endif//GL_ARB_shader_objects
|
||||||
}
|
}
|
||||||
|
|
||||||
KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getMaterialIndex, "getMaterialIndex()")
|
KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getMaterialIndex, "getMaterialIndex()")
|
||||||
@@ -947,3 +1011,45 @@ KX_PYMETHODDEF_DOC( KX_BlenderMaterial, setTexture , "setTexture( index, tex)")
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static unsigned int GL_array[11] = {
|
||||||
|
GL_ZERO,
|
||||||
|
GL_ONE,
|
||||||
|
GL_SRC_COLOR,
|
||||||
|
GL_ONE_MINUS_SRC_COLOR,
|
||||||
|
GL_DST_COLOR,
|
||||||
|
GL_ONE_MINUS_DST_COLOR,
|
||||||
|
GL_SRC_ALPHA,
|
||||||
|
GL_ONE_MINUS_SRC_ALPHA,
|
||||||
|
GL_DST_ALPHA,
|
||||||
|
GL_ONE_MINUS_DST_ALPHA,
|
||||||
|
GL_SRC_ALPHA_SATURATE
|
||||||
|
};
|
||||||
|
|
||||||
|
KX_PYMETHODDEF_DOC( KX_BlenderMaterial, setBlending , "setBlending( GameLogic.src, GameLogic.dest)")
|
||||||
|
{
|
||||||
|
unsigned int b[2];
|
||||||
|
if(PyArg_ParseTuple(args, "ii", &b[0], &b[1]))
|
||||||
|
{
|
||||||
|
bool value_found[2] = {false, false};
|
||||||
|
for(int i=0; i<11; i++)
|
||||||
|
{
|
||||||
|
if(b[0] == GL_array[i]) {
|
||||||
|
value_found[0] = true;
|
||||||
|
mBlendFunc[0] = b[0];
|
||||||
|
}
|
||||||
|
if(b[1] == GL_array[i]) {
|
||||||
|
value_found[1] = true;
|
||||||
|
mBlendFunc[1] = b[1];
|
||||||
|
}
|
||||||
|
if(value_found[0] && value_found[1]) break;
|
||||||
|
}
|
||||||
|
if(!value_found[0] || !value_found[1]) {
|
||||||
|
PyErr_Format(PyExc_ValueError, "invalid enum.");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
mUserDefBlend = true;
|
||||||
|
Py_Return;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ public:
|
|||||||
KX_PYMETHOD_DOC( KX_BlenderMaterial, getTexture );
|
KX_PYMETHOD_DOC( KX_BlenderMaterial, getTexture );
|
||||||
KX_PYMETHOD_DOC( KX_BlenderMaterial, setTexture );
|
KX_PYMETHOD_DOC( KX_BlenderMaterial, setTexture );
|
||||||
|
|
||||||
|
KX_PYMETHOD_DOC( KX_BlenderMaterial, setBlending );
|
||||||
// --------------------------------
|
// --------------------------------
|
||||||
// pre calculate to avoid pops/lag at startup
|
// pre calculate to avoid pops/lag at startup
|
||||||
virtual void OnConstruction( );
|
virtual void OnConstruction( );
|
||||||
@@ -82,6 +83,10 @@ private:
|
|||||||
KX_Scene* mScene;
|
KX_Scene* mScene;
|
||||||
BL_Texture mTextures[MAXTEX]; // texture array
|
BL_Texture mTextures[MAXTEX]; // texture array
|
||||||
|
|
||||||
|
bool mUserDefBlend;
|
||||||
|
unsigned int mBlendFunc[2];
|
||||||
|
bool mModified;
|
||||||
|
|
||||||
// message centers
|
// message centers
|
||||||
void setTexData( bool enable );
|
void setTexData( bool enable );
|
||||||
void setShaderData( bool enable );
|
void setShaderData( bool enable );
|
||||||
@@ -90,7 +95,6 @@ private:
|
|||||||
void setEnvMap( bool val, bool cube=false);
|
void setEnvMap( bool val, bool cube=false);
|
||||||
void setTexMatrixData(int i);
|
void setTexMatrixData(int i);
|
||||||
bool setDefaultBlending();
|
bool setDefaultBlending();
|
||||||
bool setBlending( int ind, bool enable=false );
|
|
||||||
void setObjectMatrixData(int i);
|
void setObjectMatrixData(int i);
|
||||||
|
|
||||||
// cleanup stuff
|
// cleanup stuff
|
||||||
|
|||||||
@@ -127,8 +127,10 @@ KX_KetsjiEngine::KX_KetsjiEngine(KX_ISystem* system)
|
|||||||
|
|
||||||
m_firstframe(true),
|
m_firstframe(true),
|
||||||
|
|
||||||
m_previoustime(0.0),
|
m_frameTime(0.f),
|
||||||
m_deltatime(0.0),
|
m_clockTime(0.f),
|
||||||
|
m_previousClockTime(0.f),
|
||||||
|
|
||||||
|
|
||||||
m_exitcode(KX_EXIT_REQUEST_NO_REQUEST),
|
m_exitcode(KX_EXIT_REQUEST_NO_REQUEST),
|
||||||
m_exitstring(""),
|
m_exitstring(""),
|
||||||
@@ -258,13 +260,19 @@ void KX_KetsjiEngine::SetSceneConverter(KX_ISceneConverter* sceneconverter)
|
|||||||
*/
|
*/
|
||||||
void KX_KetsjiEngine::StartEngine()
|
void KX_KetsjiEngine::StartEngine()
|
||||||
{
|
{
|
||||||
m_previoustime = m_kxsystem->GetTimeInSeconds();
|
m_clockTime = m_kxsystem->GetTimeInSeconds();
|
||||||
|
m_frameTime = m_kxsystem->GetTimeInSeconds();
|
||||||
|
m_previousClockTime = m_kxsystem->GetTimeInSeconds();
|
||||||
|
|
||||||
m_firstframe = true;
|
m_firstframe = true;
|
||||||
m_bInitialized = true;
|
m_bInitialized = true;
|
||||||
m_ticrate = DEFAULT_LOGIC_TIC_RATE;
|
m_ticrate = DEFAULT_LOGIC_TIC_RATE;
|
||||||
m_currentFrame = 0;
|
m_currentFrame = 0;
|
||||||
|
|
||||||
m_sceneconverter->ResetPhysicsObjectsAnimationIpo();
|
if (m_game2ipo)
|
||||||
|
{
|
||||||
|
m_sceneconverter->ResetPhysicsObjectsAnimationIpo();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -317,33 +325,32 @@ void KX_KetsjiEngine::EndFrame()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include "PIL_time.h"
|
||||||
|
|
||||||
void KX_KetsjiEngine::NextFrame()
|
void KX_KetsjiEngine::NextFrame()
|
||||||
{
|
{
|
||||||
m_logger->StartLog(tc_services, m_kxsystem->GetTimeInSeconds(), true);
|
m_logger->StartLog(tc_services, m_kxsystem->GetTimeInSeconds(), true);
|
||||||
|
|
||||||
double curtime;
|
|
||||||
if (m_bFixedTime)
|
|
||||||
curtime = m_previoustime + 1.0/m_ticrate;
|
|
||||||
else
|
|
||||||
curtime = m_kxsystem->GetTimeInSeconds();
|
|
||||||
m_deltatime += curtime - m_previoustime;
|
|
||||||
float realDeltaTime = curtime - m_previoustime;
|
|
||||||
|
|
||||||
|
|
||||||
double localtime = curtime - m_deltatime;
|
if (m_bFixedTime)
|
||||||
|
m_clockTime += 1.0/m_ticrate;
|
||||||
|
else
|
||||||
|
m_clockTime = m_kxsystem->GetTimeInSeconds();
|
||||||
|
|
||||||
|
double deltatime = m_clockTime - m_frameTime;
|
||||||
|
|
||||||
// Compute the number of logic frames to do each update (fixed tic bricks)
|
// Compute the number of logic frames to do each update (fixed tic bricks)
|
||||||
int frames = (int) (m_deltatime*m_ticrate);
|
int frames =int(deltatime*m_ticrate);
|
||||||
m_deltatime -= double(frames)/m_ticrate;
|
|
||||||
|
// if (!frames)
|
||||||
|
// PIL_sleep_ms(4);
|
||||||
|
|
||||||
KX_SceneList::iterator sceneit;
|
KX_SceneList::iterator sceneit;
|
||||||
|
|
||||||
while (frames)
|
while (frames)
|
||||||
{
|
{
|
||||||
|
|
||||||
localtime += 1.0/m_ticrate;
|
m_frameTime += 1.0/m_ticrate;
|
||||||
|
|
||||||
for (sceneit = m_scenes.begin();sceneit != m_scenes.end(); ++sceneit)
|
for (sceneit = m_scenes.begin();sceneit != m_scenes.end(); ++sceneit)
|
||||||
// for each scene, call the proceed functions
|
// for each scene, call the proceed functions
|
||||||
{
|
{
|
||||||
@@ -361,15 +368,15 @@ void KX_KetsjiEngine::NextFrame()
|
|||||||
// if the scene was suspended recalcutlate the delta tu "curtime"
|
// if the scene was suspended recalcutlate the delta tu "curtime"
|
||||||
m_suspendedtime = scene->getSuspendedTime();
|
m_suspendedtime = scene->getSuspendedTime();
|
||||||
if (scene->getSuspendedTime()!=0.0)
|
if (scene->getSuspendedTime()!=0.0)
|
||||||
scene->setSuspendedDelta(scene->getSuspendedDelta()+curtime-scene->getSuspendedTime());
|
scene->setSuspendedDelta(scene->getSuspendedDelta()+m_clockTime-scene->getSuspendedTime());
|
||||||
m_suspendeddelta = scene->getSuspendedDelta();
|
m_suspendeddelta = scene->getSuspendedDelta();
|
||||||
|
|
||||||
|
|
||||||
m_logger->StartLog(tc_network, m_kxsystem->GetTimeInSeconds(), true);
|
m_logger->StartLog(tc_network, m_kxsystem->GetTimeInSeconds(), true);
|
||||||
scene->GetNetworkScene()->proceed(localtime);
|
scene->GetNetworkScene()->proceed(m_frameTime);
|
||||||
|
|
||||||
m_logger->StartLog(tc_scenegraph, m_kxsystem->GetTimeInSeconds(), true);
|
m_logger->StartLog(tc_scenegraph, m_kxsystem->GetTimeInSeconds(), true);
|
||||||
scene->UpdateParents(localtime);
|
scene->UpdateParents(m_frameTime);
|
||||||
|
|
||||||
m_logger->StartLog(tc_physics, m_kxsystem->GetTimeInSeconds(), true);
|
m_logger->StartLog(tc_physics, m_kxsystem->GetTimeInSeconds(), true);
|
||||||
// set Python hooks for each scene
|
// set Python hooks for each scene
|
||||||
@@ -381,36 +388,39 @@ void KX_KetsjiEngine::NextFrame()
|
|||||||
// Update scenegraph after physics step. This maps physics calculations
|
// Update scenegraph after physics step. This maps physics calculations
|
||||||
// into node positions.
|
// into node positions.
|
||||||
m_logger->StartLog(tc_scenegraph, m_kxsystem->GetTimeInSeconds(), true);
|
m_logger->StartLog(tc_scenegraph, m_kxsystem->GetTimeInSeconds(), true);
|
||||||
scene->UpdateParents(localtime);
|
scene->UpdateParents(m_frameTime);
|
||||||
|
|
||||||
// Process sensors, and controllers
|
// Process sensors, and controllers
|
||||||
m_logger->StartLog(tc_logic, m_kxsystem->GetTimeInSeconds(), true);
|
m_logger->StartLog(tc_logic, m_kxsystem->GetTimeInSeconds(), true);
|
||||||
scene->LogicBeginFrame(localtime);
|
scene->LogicBeginFrame(m_frameTime);
|
||||||
|
|
||||||
// Scenegraph needs to be updated again, because Logic Controllers
|
// Scenegraph needs to be updated again, because Logic Controllers
|
||||||
// can affect the local matrices.
|
// can affect the local matrices.
|
||||||
m_logger->StartLog(tc_scenegraph, m_kxsystem->GetTimeInSeconds(), true);
|
m_logger->StartLog(tc_scenegraph, m_kxsystem->GetTimeInSeconds(), true);
|
||||||
scene->UpdateParents(localtime);
|
scene->UpdateParents(m_frameTime);
|
||||||
|
|
||||||
// Process actuators
|
// Process actuators
|
||||||
|
|
||||||
// Do some cleanup work for this logic frame
|
// Do some cleanup work for this logic frame
|
||||||
m_logger->StartLog(tc_logic, m_kxsystem->GetTimeInSeconds(), true);
|
m_logger->StartLog(tc_logic, m_kxsystem->GetTimeInSeconds(), true);
|
||||||
scene->LogicUpdateFrame(localtime, true);
|
scene->LogicUpdateFrame(m_frameTime, true);
|
||||||
scene->LogicEndFrame();
|
scene->LogicEndFrame();
|
||||||
|
|
||||||
// Actuators can affect the scenegraph
|
// Actuators can affect the scenegraph
|
||||||
m_logger->StartLog(tc_scenegraph, m_kxsystem->GetTimeInSeconds(), true);
|
m_logger->StartLog(tc_scenegraph, m_kxsystem->GetTimeInSeconds(), true);
|
||||||
scene->UpdateParents(localtime);
|
scene->UpdateParents(m_frameTime);
|
||||||
|
|
||||||
m_logger->StartLog(tc_physics, m_kxsystem->GetTimeInSeconds(), true);
|
m_logger->StartLog(tc_physics, m_kxsystem->GetTimeInSeconds(), true);
|
||||||
scene->GetPhysicsEnvironment()->beginFrame();
|
scene->GetPhysicsEnvironment()->beginFrame();
|
||||||
|
|
||||||
// Perform physics calculations on the scene. This can involve
|
// Perform physics calculations on the scene. This can involve
|
||||||
// many iterations of the physics solver.
|
// many iterations of the physics solver.
|
||||||
scene->GetPhysicsEnvironment()->proceedDeltaTime(localtime,realDeltaTime);
|
scene->GetPhysicsEnvironment()->proceedDeltaTime(m_frameTime,1.0/m_ticrate);//m_deltatimerealDeltaTime);
|
||||||
m_previoustime = curtime;
|
|
||||||
|
|
||||||
|
m_logger->StartLog(tc_scenegraph, m_kxsystem->GetTimeInSeconds(), true);
|
||||||
|
scene->UpdateParents(m_frameTime);
|
||||||
|
|
||||||
|
|
||||||
if (m_game2ipo)
|
if (m_game2ipo)
|
||||||
{
|
{
|
||||||
m_sceneconverter->WritePhysicsObjectToAnimationIpo(m_currentFrame++);
|
m_sceneconverter->WritePhysicsObjectToAnimationIpo(m_currentFrame++);
|
||||||
@@ -420,7 +430,7 @@ void KX_KetsjiEngine::NextFrame()
|
|||||||
} // suspended
|
} // suspended
|
||||||
else
|
else
|
||||||
if(scene->getSuspendedTime()==0.0)
|
if(scene->getSuspendedTime()==0.0)
|
||||||
scene->setSuspendedTime(curtime);
|
scene->setSuspendedTime(m_clockTime);
|
||||||
|
|
||||||
DoSound(scene);
|
DoSound(scene);
|
||||||
|
|
||||||
@@ -447,55 +457,63 @@ void KX_KetsjiEngine::NextFrame()
|
|||||||
frames--;
|
frames--;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logic update sub frame: this will let some logic bricks run at the
|
bool bUseAsyncLogicBricks= false;
|
||||||
// full frame rate.
|
|
||||||
for (sceneit = m_scenes.begin();sceneit != m_scenes.end(); ++sceneit)
|
|
||||||
// for each scene, call the proceed functions
|
|
||||||
{
|
|
||||||
KX_Scene* scene = *sceneit;
|
|
||||||
|
|
||||||
if (!scene->IsSuspended())
|
if (bUseAsyncLogicBricks)
|
||||||
|
{
|
||||||
|
// Logic update sub frame: this will let some logic bricks run at the
|
||||||
|
// full frame rate.
|
||||||
|
for (sceneit = m_scenes.begin();sceneit != m_scenes.end(); ++sceneit)
|
||||||
|
// for each scene, call the proceed functions
|
||||||
{
|
{
|
||||||
// if the scene was suspended recalcutlate the delta tu "curtime"
|
KX_Scene* scene = *sceneit;
|
||||||
m_suspendedtime = scene->getSuspendedTime();
|
|
||||||
if (scene->getSuspendedTime()!=0.0)
|
|
||||||
scene->setSuspendedDelta(scene->getSuspendedDelta()+curtime-scene->getSuspendedTime());
|
|
||||||
m_suspendeddelta = scene->getSuspendedDelta();
|
|
||||||
|
|
||||||
// set Python hooks for each scene
|
|
||||||
PHY_SetActiveEnvironment(scene->GetPhysicsEnvironment());
|
|
||||||
PHY_SetActiveScene(scene);
|
|
||||||
|
|
||||||
m_logger->StartLog(tc_scenegraph, m_kxsystem->GetTimeInSeconds(), true);
|
|
||||||
scene->UpdateParents(curtime);
|
|
||||||
|
|
||||||
// Perform physics calculations on the scene. This can involve
|
if (!scene->IsSuspended())
|
||||||
// many iterations of the physics solver.
|
{
|
||||||
m_logger->StartLog(tc_physics, m_kxsystem->GetTimeInSeconds(), true);
|
// if the scene was suspended recalcutlate the delta tu "curtime"
|
||||||
scene->GetPhysicsEnvironment()->proceedDeltaTime(curtime,0.f);
|
m_suspendedtime = scene->getSuspendedTime();
|
||||||
// Update scenegraph after physics step. This maps physics calculations
|
if (scene->getSuspendedTime()!=0.0)
|
||||||
// into node positions.
|
scene->setSuspendedDelta(scene->getSuspendedDelta()+m_clockTime-scene->getSuspendedTime());
|
||||||
m_logger->StartLog(tc_scenegraph, m_kxsystem->GetTimeInSeconds(), true);
|
m_suspendeddelta = scene->getSuspendedDelta();
|
||||||
scene->UpdateParents(curtime);
|
|
||||||
|
// set Python hooks for each scene
|
||||||
// Do some cleanup work for this logic frame
|
PHY_SetActiveEnvironment(scene->GetPhysicsEnvironment());
|
||||||
m_logger->StartLog(tc_logic, m_kxsystem->GetTimeInSeconds(), true);
|
PHY_SetActiveScene(scene);
|
||||||
scene->LogicUpdateFrame(curtime, false);
|
|
||||||
|
m_logger->StartLog(tc_scenegraph, m_kxsystem->GetTimeInSeconds(), true);
|
||||||
|
scene->UpdateParents(m_clockTime);
|
||||||
|
|
||||||
// Actuators can affect the scenegraph
|
// Perform physics calculations on the scene. This can involve
|
||||||
m_logger->StartLog(tc_scenegraph, m_kxsystem->GetTimeInSeconds(), true);
|
// many iterations of the physics solver.
|
||||||
scene->UpdateParents(curtime);
|
m_logger->StartLog(tc_physics, m_kxsystem->GetTimeInSeconds(), true);
|
||||||
|
scene->GetPhysicsEnvironment()->proceedDeltaTime(m_clockTime,0.f);
|
||||||
scene->setSuspendedTime(0.0);
|
// Update scenegraph after physics step. This maps physics calculations
|
||||||
} // suspended
|
// into node positions.
|
||||||
else
|
m_logger->StartLog(tc_scenegraph, m_kxsystem->GetTimeInSeconds(), true);
|
||||||
if(scene->getSuspendedTime()==0.0)
|
scene->UpdateParents(m_clockTime);
|
||||||
scene->setSuspendedTime(curtime);
|
|
||||||
|
// Do some cleanup work for this logic frame
|
||||||
|
m_logger->StartLog(tc_logic, m_kxsystem->GetTimeInSeconds(), true);
|
||||||
|
scene->LogicUpdateFrame(m_clockTime, false);
|
||||||
|
|
||||||
DoSound(scene);
|
// Actuators can affect the scenegraph
|
||||||
|
m_logger->StartLog(tc_scenegraph, m_kxsystem->GetTimeInSeconds(), true);
|
||||||
|
scene->UpdateParents(m_clockTime);
|
||||||
|
|
||||||
|
scene->setSuspendedTime(0.0);
|
||||||
|
} // suspended
|
||||||
|
else
|
||||||
|
if(scene->getSuspendedTime()==0.0)
|
||||||
|
scene->setSuspendedTime(m_clockTime);
|
||||||
|
|
||||||
m_logger->StartLog(tc_services, m_kxsystem->GetTimeInSeconds(), true);
|
DoSound(scene);
|
||||||
|
|
||||||
|
m_logger->StartLog(tc_services, m_kxsystem->GetTimeInSeconds(), true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
m_previousClockTime = m_clockTime;
|
||||||
|
|
||||||
// Start logging time spend outside main loop
|
// Start logging time spend outside main loop
|
||||||
m_logger->StartLog(tc_outside, m_kxsystem->GetTimeInSeconds(), true);
|
m_logger->StartLog(tc_outside, m_kxsystem->GetTimeInSeconds(), true);
|
||||||
|
|||||||
@@ -99,8 +99,10 @@ private:
|
|||||||
bool m_firstframe;
|
bool m_firstframe;
|
||||||
int m_currentFrame;
|
int m_currentFrame;
|
||||||
|
|
||||||
double m_previoustime;
|
double m_frameTime;//discrete timestamp of the 'game logic frame'
|
||||||
double m_deltatime;
|
double m_clockTime;//current time
|
||||||
|
double m_previousClockTime;//previous clock time
|
||||||
|
|
||||||
static double m_ticrate;
|
static double m_ticrate;
|
||||||
|
|
||||||
static double m_suspendedtime;
|
static double m_suspendedtime;
|
||||||
|
|||||||
@@ -362,7 +362,7 @@ static PyObject* gPyRemoveConstraint(PyObject* self,
|
|||||||
{
|
{
|
||||||
if (PHY_GetActiveEnvironment())
|
if (PHY_GetActiveEnvironment())
|
||||||
{
|
{
|
||||||
PHY_GetActiveEnvironment()->removeConstraint((void *)constraintid);
|
PHY_GetActiveEnvironment()->removeConstraint(constraintid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Py_INCREF(Py_None); return Py_None;
|
Py_INCREF(Py_None); return Py_None;
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
#define GL_GLEXT_LEGACY 1
|
||||||
#include <OpenGL/gl.h>
|
#include <OpenGL/gl.h>
|
||||||
#include <OpenGL/glu.h>
|
#include <OpenGL/glu.h>
|
||||||
#else
|
#else
|
||||||
@@ -277,39 +278,74 @@ static PyObject *pyPrintExt(PyObject *,PyObject *,PyObject *)
|
|||||||
#define pprint(x) std::cout << x << std::endl;
|
#define pprint(x) std::cout << x << std::endl;
|
||||||
bgl::BL_EXTInfo ext = bgl::RAS_EXT_support;
|
bgl::BL_EXTInfo ext = bgl::RAS_EXT_support;
|
||||||
bool count=0;
|
bool count=0;
|
||||||
|
bool support=0;
|
||||||
pprint("Supported Extensions...");
|
pprint("Supported Extensions...");
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
pprint(" GL_ARB_shader_objects supported? "<< (ext._ARB_shader_objects? "yes.":"no."));
|
pprint(" GL_ARB_shader_objects supported? "<< (ext._ARB_shader_objects?"yes.":"no."));
|
||||||
count = 1;
|
count = 1;
|
||||||
#endif
|
#endif
|
||||||
#ifdef GL_ARB_vertex_shader
|
|
||||||
pprint(" GL_ARB_vertex_shader supported? "<< (ext._ARB_vertex_shader? "yes.":"no."));
|
#ifdef GL_ARB_vertex_shader
|
||||||
|
support= ext._ARB_vertex_shader;
|
||||||
|
pprint(" GL_ARB_vertex_shader supported? "<< (support?"yes.":"no."));
|
||||||
count = 1;
|
count = 1;
|
||||||
#endif
|
if(support){
|
||||||
#ifdef GL_ARB_fragment_shader
|
pprint(" ----------Details----------");
|
||||||
pprint(" GL_ARB_fragment_shader supported? "<< (ext._ARB_fragment_shader? "yes.":"no."));
|
int max=0;
|
||||||
|
glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB, (GLint*)&max);
|
||||||
|
pprint(" Max uniform components." << max);
|
||||||
|
|
||||||
|
glGetIntegerv(GL_MAX_VARYING_FLOATS_ARB, (GLint*)&max);
|
||||||
|
pprint(" Max varying floats." << max);
|
||||||
|
|
||||||
|
glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB, (GLint*)&max);
|
||||||
|
pprint(" Max vertex texture units." << max);
|
||||||
|
|
||||||
|
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB, (GLint*)&max);
|
||||||
|
pprint(" Max combined texture units." << max);
|
||||||
|
pprint("");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef GL_ARB_fragment_shader
|
||||||
|
support=ext._ARB_fragment_shader;
|
||||||
|
pprint(" GL_ARB_fragment_shader supported? "<< (support?"yes.":"no."));
|
||||||
count = 1;
|
count = 1;
|
||||||
#endif
|
if(support){
|
||||||
#ifdef GL_ARB_texture_cube_map
|
pprint(" ----------Details----------");
|
||||||
pprint(" GL_ARB_texture_cube_map supported? "<< (ext._ARB_texture_cube_map? "yes.":"no."));
|
int max=0;
|
||||||
|
glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB, (GLint*)&max);
|
||||||
|
pprint(" Max uniform components." << max);
|
||||||
|
pprint("");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef GL_ARB_texture_cube_map
|
||||||
|
support = ext._ARB_texture_cube_map;
|
||||||
|
pprint(" GL_ARB_texture_cube_map supported? "<< (support?"yes.":"no."));
|
||||||
count = 1;
|
count = 1;
|
||||||
#endif
|
if(support){
|
||||||
#ifdef GL_EXT_texture3D
|
pprint(" ----------Details----------");
|
||||||
pprint(" GL_EXT_texture3D supported? "<< (ext._EXT_texture3D? "yes.":"no."));
|
int size=0;
|
||||||
|
glGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB, (GLint*)&size);
|
||||||
|
pprint(" Max cubemap size." << size);
|
||||||
|
pprint("");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef GL_ARB_multitexture
|
||||||
|
support = ext._ARB_multitexture;
|
||||||
count = 1;
|
count = 1;
|
||||||
#endif
|
pprint(" GL_ARB_multitexture supported? "<< (support?"yes.":"no."));
|
||||||
#ifdef GL_EXT_blend_color
|
if(support){
|
||||||
pprint(" GL_EXT_blend_color supported? "<< (ext._EXT_blend_color? "yes.":"no."));
|
pprint(" ----------Details----------");
|
||||||
|
int units=0;
|
||||||
|
glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, (GLint*)&units);
|
||||||
|
pprint(" Max texture units available. " << units);
|
||||||
|
pprint("");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef GL_ARB_texture_env_combine
|
||||||
|
pprint(" GL_ARB_texture_env_combine supported? "<< (ext._ARB_texture_env_combine?"yes.":"no."));
|
||||||
count = 1;
|
count = 1;
|
||||||
#endif
|
#endif
|
||||||
#ifdef GL_ARB_multitexture
|
|
||||||
pprint(" GL_ARB_multitexture supported? "<< (ext._ARB_multitexture? "yes.":"no."));
|
|
||||||
count = 1;
|
|
||||||
#endif
|
|
||||||
#ifdef GL_ARB_texture_env_combine
|
|
||||||
pprint(" GL_ARB_texture_env_combine supported? "<< (ext._ARB_texture_env_combine? "yes.":"no."));
|
|
||||||
count = 1;
|
|
||||||
#endif
|
|
||||||
if(!count)
|
if(!count)
|
||||||
pprint("No extenstions are used in this build");
|
pprint("No extenstions are used in this build");
|
||||||
|
|
||||||
@@ -707,6 +743,19 @@ PyObject* initGameLogic(KX_Scene* scene) // quick hack to get gravity hook
|
|||||||
KX_MACRO_addTypesToDict(d, KX_ACTIONACT_LOOPEND, BL_ActionActuator::KX_ACT_ACTION_LOOPEND);
|
KX_MACRO_addTypesToDict(d, KX_ACTIONACT_LOOPEND, BL_ActionActuator::KX_ACT_ACTION_LOOPEND);
|
||||||
KX_MACRO_addTypesToDict(d, KX_ACTIONACT_PROPERTY, BL_ActionActuator::KX_ACT_ACTION_PROPERTY);
|
KX_MACRO_addTypesToDict(d, KX_ACTIONACT_PROPERTY, BL_ActionActuator::KX_ACT_ACTION_PROPERTY);
|
||||||
|
|
||||||
|
/*8. GL_BlendFunc */
|
||||||
|
KX_MACRO_addTypesToDict(d, BL_ZERO, GL_ZERO);
|
||||||
|
KX_MACRO_addTypesToDict(d, BL_ONE, GL_ONE);
|
||||||
|
KX_MACRO_addTypesToDict(d, BL_SRC_COLOR, GL_SRC_COLOR);
|
||||||
|
KX_MACRO_addTypesToDict(d, BL_ONE_MINUS_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
|
||||||
|
KX_MACRO_addTypesToDict(d, BL_DST_COLOR, GL_DST_COLOR);
|
||||||
|
KX_MACRO_addTypesToDict(d, BL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_DST_COLOR);
|
||||||
|
KX_MACRO_addTypesToDict(d, BL_SRC_ALPHA, GL_SRC_ALPHA);
|
||||||
|
KX_MACRO_addTypesToDict(d, BL_ONE_MINUS_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
KX_MACRO_addTypesToDict(d, BL_DST_ALPHA, GL_DST_ALPHA);
|
||||||
|
KX_MACRO_addTypesToDict(d, BL_ONE_MINUS_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA);
|
||||||
|
KX_MACRO_addTypesToDict(d, BL_SRC_ALPHA_SATURATE, GL_SRC_ALPHA_SATURATE);
|
||||||
|
|
||||||
// Check for errors
|
// Check for errors
|
||||||
if (PyErr_Occurred())
|
if (PyErr_Occurred())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ include nan_compile.mk
|
|||||||
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
|
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
|
||||||
|
|
||||||
CPPFLAGS += $(OGL_CPPFLAGS)
|
CPPFLAGS += $(OGL_CPPFLAGS)
|
||||||
|
CPPFLAGS += -I$(OPENGL_HEADERS)
|
||||||
CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) -I../../blender/python
|
CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) -I../../blender/python
|
||||||
CPPFLAGS += -I$(NAN_STRING)/include
|
CPPFLAGS += -I$(NAN_STRING)/include
|
||||||
CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include
|
CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ void CcdPhysicsEnvironment::removeCcdPhysicsController(CcdPhysicsController* ctr
|
|||||||
if ((&p2p->GetRigidBodyA() == ctrl->GetRigidBody() ||
|
if ((&p2p->GetRigidBodyA() == ctrl->GetRigidBody() ||
|
||||||
(&p2p->GetRigidBodyB() == ctrl->GetRigidBody())))
|
(&p2p->GetRigidBodyB() == ctrl->GetRigidBody())))
|
||||||
{
|
{
|
||||||
removeConstraint(p2p);
|
removeConstraint(p2p->GetConstraintId());
|
||||||
//only 1 constraint per constroller
|
//only 1 constraint per constroller
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -209,7 +209,7 @@ void CcdPhysicsEnvironment::removeCcdPhysicsController(CcdPhysicsController* ctr
|
|||||||
if ((&p2p->GetRigidBodyA() == ctrl->GetRigidBody() ||
|
if ((&p2p->GetRigidBodyA() == ctrl->GetRigidBody() ||
|
||||||
(&p2p->GetRigidBodyB() == ctrl->GetRigidBody())))
|
(&p2p->GetRigidBodyB() == ctrl->GetRigidBody())))
|
||||||
{
|
{
|
||||||
removeConstraint(p2p);
|
removeConstraint(p2p->GetConstraintId());
|
||||||
//only 1 constraint per constroller
|
//only 1 constraint per constroller
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -301,14 +301,28 @@ void CcdPhysicsEnvironment::beginFrame()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Perform an integration step of duration 'timeStep'.
|
|
||||||
bool CcdPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep)
|
bool CcdPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (!SimdFuzzyZero(timeStep))
|
||||||
|
{
|
||||||
|
//Blender runs 30hertz, so subdivide so we get 60 hertz
|
||||||
|
proceedDeltaTimeOneStep(0.5f*timeStep);
|
||||||
|
proceedDeltaTimeOneStep(0.5f*timeStep);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
//todo: interpolate
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
/// Perform an integration step of duration 'timeStep'.
|
||||||
|
bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
// printf("CcdPhysicsEnvironment::proceedDeltaTime\n");
|
// printf("CcdPhysicsEnvironment::proceedDeltaTime\n");
|
||||||
|
|
||||||
if (timeStep == 0.f)
|
if (SimdFuzzyZero(timeStep))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (m_debugDrawer)
|
if (m_debugDrawer)
|
||||||
@@ -318,9 +332,6 @@ bool CcdPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//clamp hardcoded for now
|
|
||||||
if (timeStep > 0.02)
|
|
||||||
timeStep = 0.02;
|
|
||||||
|
|
||||||
//this is needed because scaling is not known in advance, and scaling has to propagate to the shape
|
//this is needed because scaling is not known in advance, and scaling has to propagate to the shape
|
||||||
if (!m_scalingPropagated)
|
if (!m_scalingPropagated)
|
||||||
@@ -758,7 +769,9 @@ int CcdPhysicsEnvironment::createConstraint(class PHY_IPhysicsController* ctrl
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_p2pConstraints.push_back(p2p);
|
m_p2pConstraints.push_back(p2p);
|
||||||
return 0;
|
|
||||||
|
//64 bit systems can't cast pointer to int. could use size_t instead.
|
||||||
|
return p2p->GetConstraintId();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -773,17 +786,24 @@ int CcdPhysicsEnvironment::createConstraint(class PHY_IPhysicsController* ctrl
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CcdPhysicsEnvironment::removeConstraint(void* p2p)
|
void CcdPhysicsEnvironment::removeConstraint(int constraintId)
|
||||||
{
|
{
|
||||||
std::vector<Point2PointConstraint*>::iterator i =
|
std::vector<Point2PointConstraint*>::iterator i;
|
||||||
std::find(m_p2pConstraints.begin(), m_p2pConstraints.end(),
|
|
||||||
(Point2PointConstraint *)p2p);
|
//std::find(m_p2pConstraints.begin(), m_p2pConstraints.end(),
|
||||||
|
// (Point2PointConstraint *)p2p);
|
||||||
|
|
||||||
if (!(i == m_p2pConstraints.end()) )
|
for (i=m_p2pConstraints.begin();
|
||||||
{
|
!(i==m_p2pConstraints.end()); i++)
|
||||||
std::swap(*i, m_p2pConstraints.back());
|
{
|
||||||
m_p2pConstraints.pop_back();
|
Point2PointConstraint* p2p = (*i);
|
||||||
}
|
if (p2p->GetConstraintId() == constraintId)
|
||||||
|
{
|
||||||
|
std::swap(*i, m_p2pConstraints.back());
|
||||||
|
m_p2pConstraints.pop_back();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
PHY_IPhysicsController* CcdPhysicsEnvironment::rayTest(PHY_IPhysicsController* ignoreClient, float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
|
PHY_IPhysicsController* CcdPhysicsEnvironment::rayTest(PHY_IPhysicsController* ignoreClient, float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ class CcdPhysicsEnvironment : public PHY_IPhysicsEnvironment
|
|||||||
virtual void endFrame() {};
|
virtual void endFrame() {};
|
||||||
/// Perform an integration step of duration 'timeStep'.
|
/// Perform an integration step of duration 'timeStep'.
|
||||||
virtual bool proceedDeltaTime(double curTime,float timeStep);
|
virtual bool proceedDeltaTime(double curTime,float timeStep);
|
||||||
|
bool proceedDeltaTimeOneStep(float timeStep);
|
||||||
|
|
||||||
virtual void setFixedTimeStep(bool useFixedTimeStep,float fixedTimeStep){};
|
virtual void setFixedTimeStep(bool useFixedTimeStep,float fixedTimeStep){};
|
||||||
//returns 0.f if no fixed timestep is used
|
//returns 0.f if no fixed timestep is used
|
||||||
|
|
||||||
@@ -75,7 +77,7 @@ class CcdPhysicsEnvironment : public PHY_IPhysicsEnvironment
|
|||||||
virtual int createConstraint(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsController* ctrl2,PHY_ConstraintType type,
|
virtual int createConstraint(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsController* ctrl2,PHY_ConstraintType type,
|
||||||
float pivotX,float pivotY,float pivotZ,
|
float pivotX,float pivotY,float pivotZ,
|
||||||
float axisX,float axisY,float axisZ);
|
float axisX,float axisY,float axisZ);
|
||||||
virtual void removeConstraint(void* constraintid);
|
virtual void removeConstraint(int constraintid);
|
||||||
|
|
||||||
|
|
||||||
virtual PHY_IPhysicsController* rayTest(PHY_IPhysicsController* ignoreClient, float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
|
virtual PHY_IPhysicsController* rayTest(PHY_IPhysicsController* ignoreClient, float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ int DummyPhysicsEnvironment::createConstraint(class PHY_IPhysicsController* ct
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DummyPhysicsEnvironment::removeConstraint(void * constraintid)
|
void DummyPhysicsEnvironment::removeConstraint(int constraintid)
|
||||||
{
|
{
|
||||||
if (constraintid)
|
if (constraintid)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public:
|
|||||||
float pivotX,float pivotY,float pivotZ,
|
float pivotX,float pivotY,float pivotZ,
|
||||||
float axisX,float axisY,float axisZ);
|
float axisX,float axisY,float axisZ);
|
||||||
|
|
||||||
virtual void removeConstraint(void * constraintid);
|
virtual void removeConstraint(int constraintid);
|
||||||
virtual PHY_IPhysicsController* rayTest(PHY_IPhysicsController* ignoreClient, float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
|
virtual PHY_IPhysicsController* rayTest(PHY_IPhysicsController* ignoreClient, float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
|
||||||
float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ);
|
float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ);
|
||||||
|
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ bool SM_Scene::proceed(MT_Scalar curtime, MT_Scalar ticrate)
|
|||||||
if (!m_frames)
|
if (!m_frames)
|
||||||
{
|
{
|
||||||
if (ticrate > 0.)
|
if (ticrate > 0.)
|
||||||
m_frames = (unsigned int)(curtime*ticrate + 1.0);
|
m_frames = (unsigned int)(curtime*ticrate) + 1.0;
|
||||||
else
|
else
|
||||||
m_frames = (unsigned int)(curtime*65536.0);
|
m_frames = (unsigned int)(curtime*65536.0);
|
||||||
}
|
}
|
||||||
@@ -275,7 +275,11 @@ bool SM_Scene::proceed(MT_Scalar curtime, MT_Scalar ticrate)
|
|||||||
for (i = m_objectList.begin(); i != m_objectList.end(); ++i)
|
for (i = m_objectList.begin(); i != m_objectList.end(); ++i)
|
||||||
(*i)->interpolate(curtime);
|
(*i)->interpolate(curtime);
|
||||||
|
|
||||||
m_frames = (unsigned int)(curtime*ticrate + 1.0);
|
//only update the m_frames after an actual physics timestep
|
||||||
|
if (num_samples)
|
||||||
|
{
|
||||||
|
m_frames = (unsigned int)(curtime*ticrate) + 1.0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ int SumoPhysicsEnvironment::createConstraint(
|
|||||||
return constraintid;
|
return constraintid;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SumoPhysicsEnvironment::removeConstraint(void * constraintid)
|
void SumoPhysicsEnvironment::removeConstraint(int constraintid)
|
||||||
{
|
{
|
||||||
if (constraintid)
|
if (constraintid)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public:
|
|||||||
float pivotX,float pivotY,float pivotZ,
|
float pivotX,float pivotY,float pivotZ,
|
||||||
float axisX,float axisY,float axisZ);
|
float axisX,float axisY,float axisZ);
|
||||||
|
|
||||||
virtual void removeConstraint(void * constraintid);
|
virtual void removeConstraint(int constraintid);
|
||||||
virtual PHY_IPhysicsController* rayTest(PHY_IPhysicsController* ignoreClient,float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
|
virtual PHY_IPhysicsController* rayTest(PHY_IPhysicsController* ignoreClient,float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
|
||||||
float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ);
|
float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ);
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ class PHY_IPhysicsEnvironment
|
|||||||
virtual int createConstraint(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsController* ctrl2,PHY_ConstraintType type,
|
virtual int createConstraint(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsController* ctrl2,PHY_ConstraintType type,
|
||||||
float pivotX,float pivotY,float pivotZ,
|
float pivotX,float pivotY,float pivotZ,
|
||||||
float axisX,float axisY,float axisZ)=0;
|
float axisX,float axisY,float axisZ)=0;
|
||||||
virtual void removeConstraint(void * constraintid)=0;
|
virtual void removeConstraint(int constraintid)=0;
|
||||||
|
|
||||||
virtual PHY_IPhysicsController* rayTest(PHY_IPhysicsController* ignoreClient, float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
|
virtual PHY_IPhysicsController* rayTest(PHY_IPhysicsController* ignoreClient, float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
|
||||||
float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ)=0;
|
float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ)=0;
|
||||||
|
|||||||
@@ -42,7 +42,9 @@ CPPFLAGS += -I$(OPENGL_HEADERS)
|
|||||||
CPPFLAGS += -I$(NAN_STRING)/include
|
CPPFLAGS += -I$(NAN_STRING)/include
|
||||||
CPPFLAGS += -I$(NAN_MOTO)/include
|
CPPFLAGS += -I$(NAN_MOTO)/include
|
||||||
CPPFLAGS += -I../../kernel/gen_system
|
CPPFLAGS += -I../../kernel/gen_system
|
||||||
|
ifeq ($(OS),darwin)
|
||||||
|
CPPFLAGS += -fpascal-strings
|
||||||
|
endif
|
||||||
###############
|
###############
|
||||||
|
|
||||||
SOURCEDIR = source/gameengine/Rasterizer
|
SOURCEDIR = source/gameengine/Rasterizer
|
||||||
|
|||||||
@@ -44,4 +44,6 @@ CPPFLAGS += -I$(NAN_STRING)/include
|
|||||||
CPPFLAGS += -I$(NAN_MOTO)/include
|
CPPFLAGS += -I$(NAN_MOTO)/include
|
||||||
CPPFLAGS += -I../../../kernel/gen_system
|
CPPFLAGS += -I../../../kernel/gen_system
|
||||||
CPPFLAGS += -I..
|
CPPFLAGS += -I..
|
||||||
|
ifeq ($(OS),darwin)
|
||||||
|
CPPFLAGS += -fpascal-strings
|
||||||
|
endif
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
# include <Carbon/Carbon.h>
|
# include <Carbon/Carbon.h>
|
||||||
|
# define GL_GLEXT_LEGACY 1
|
||||||
# include <OpenGL/gl.h>
|
# include <OpenGL/gl.h>
|
||||||
|
|
||||||
#else /* UNIX */
|
#else /* UNIX */
|
||||||
@@ -322,88 +322,88 @@ BL_EXTInfo RAS_EXT_support;
|
|||||||
|
|
||||||
#ifdef GL_ARB_multitexture
|
#ifdef GL_ARB_multitexture
|
||||||
int max_texture_units = 2;
|
int max_texture_units = 2;
|
||||||
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB;
|
PFNGLACTIVETEXTUREARBPROC blActiveTextureARB;
|
||||||
PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB;
|
PFNGLCLIENTACTIVETEXTUREARBPROC blClientActiveTextureARB;
|
||||||
PFNGLMULTITEXCOORD1DARBPROC glMultiTexCoord1dARB;
|
PFNGLMULTITEXCOORD1DARBPROC blMultiTexCoord1dARB;
|
||||||
PFNGLMULTITEXCOORD1DVARBPROC glMultiTexCoord1dvARB;
|
PFNGLMULTITEXCOORD1DVARBPROC blMultiTexCoord1dvARB;
|
||||||
PFNGLMULTITEXCOORD1FARBPROC glMultiTexCoord1fARB;
|
PFNGLMULTITEXCOORD1FARBPROC blMultiTexCoord1fARB;
|
||||||
PFNGLMULTITEXCOORD1FVARBPROC glMultiTexCoord1fvARB;
|
PFNGLMULTITEXCOORD1FVARBPROC blMultiTexCoord1fvARB;
|
||||||
PFNGLMULTITEXCOORD1IARBPROC glMultiTexCoord1iARB;
|
PFNGLMULTITEXCOORD1IARBPROC blMultiTexCoord1iARB;
|
||||||
PFNGLMULTITEXCOORD1IVARBPROC glMultiTexCoord1ivARB;
|
PFNGLMULTITEXCOORD1IVARBPROC blMultiTexCoord1ivARB;
|
||||||
PFNGLMULTITEXCOORD1SARBPROC glMultiTexCoord1sARB;
|
PFNGLMULTITEXCOORD1SARBPROC blMultiTexCoord1sARB;
|
||||||
PFNGLMULTITEXCOORD1SVARBPROC glMultiTexCoord1svARB;
|
PFNGLMULTITEXCOORD1SVARBPROC blMultiTexCoord1svARB;
|
||||||
PFNGLMULTITEXCOORD2DARBPROC glMultiTexCoord2dARB;
|
PFNGLMULTITEXCOORD2DARBPROC blMultiTexCoord2dARB;
|
||||||
PFNGLMULTITEXCOORD2DVARBPROC glMultiTexCoord2dvARB;
|
PFNGLMULTITEXCOORD2DVARBPROC blMultiTexCoord2dvARB;
|
||||||
PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB;
|
PFNGLMULTITEXCOORD2FARBPROC blMultiTexCoord2fARB;
|
||||||
PFNGLMULTITEXCOORD2FVARBPROC glMultiTexCoord2fvARB;
|
PFNGLMULTITEXCOORD2FVARBPROC blMultiTexCoord2fvARB;
|
||||||
PFNGLMULTITEXCOORD2IARBPROC glMultiTexCoord2iARB;
|
PFNGLMULTITEXCOORD2IARBPROC blMultiTexCoord2iARB;
|
||||||
PFNGLMULTITEXCOORD2IVARBPROC glMultiTexCoord2ivARB;
|
PFNGLMULTITEXCOORD2IVARBPROC blMultiTexCoord2ivARB;
|
||||||
PFNGLMULTITEXCOORD2SARBPROC glMultiTexCoord2sARB;
|
PFNGLMULTITEXCOORD2SARBPROC blMultiTexCoord2sARB;
|
||||||
PFNGLMULTITEXCOORD2SVARBPROC glMultiTexCoord2svARB;
|
PFNGLMULTITEXCOORD2SVARBPROC blMultiTexCoord2svARB;
|
||||||
PFNGLMULTITEXCOORD3DARBPROC glMultiTexCoord3dARB;
|
PFNGLMULTITEXCOORD3DARBPROC blMultiTexCoord3dARB;
|
||||||
PFNGLMULTITEXCOORD3DVARBPROC glMultiTexCoord3dvARB;
|
PFNGLMULTITEXCOORD3DVARBPROC blMultiTexCoord3dvARB;
|
||||||
PFNGLMULTITEXCOORD3FARBPROC glMultiTexCoord3fARB;
|
PFNGLMULTITEXCOORD3FARBPROC blMultiTexCoord3fARB;
|
||||||
PFNGLMULTITEXCOORD3FVARBPROC glMultiTexCoord3fvARB;
|
PFNGLMULTITEXCOORD3FVARBPROC blMultiTexCoord3fvARB;
|
||||||
PFNGLMULTITEXCOORD3IARBPROC glMultiTexCoord3iARB;
|
PFNGLMULTITEXCOORD3IARBPROC blMultiTexCoord3iARB;
|
||||||
PFNGLMULTITEXCOORD3IVARBPROC glMultiTexCoord3ivARB;
|
PFNGLMULTITEXCOORD3IVARBPROC blMultiTexCoord3ivARB;
|
||||||
PFNGLMULTITEXCOORD3SARBPROC glMultiTexCoord3sARB;
|
PFNGLMULTITEXCOORD3SARBPROC blMultiTexCoord3sARB;
|
||||||
PFNGLMULTITEXCOORD3SVARBPROC glMultiTexCoord3svARB;
|
PFNGLMULTITEXCOORD3SVARBPROC blMultiTexCoord3svARB;
|
||||||
PFNGLMULTITEXCOORD4DARBPROC glMultiTexCoord4dARB;
|
PFNGLMULTITEXCOORD4DARBPROC blMultiTexCoord4dARB;
|
||||||
PFNGLMULTITEXCOORD4DVARBPROC glMultiTexCoord4dvARB;
|
PFNGLMULTITEXCOORD4DVARBPROC blMultiTexCoord4dvARB;
|
||||||
PFNGLMULTITEXCOORD4FARBPROC glMultiTexCoord4fARB;
|
PFNGLMULTITEXCOORD4FARBPROC blMultiTexCoord4fARB;
|
||||||
PFNGLMULTITEXCOORD4FVARBPROC glMultiTexCoord4fvARB;
|
PFNGLMULTITEXCOORD4FVARBPROC blMultiTexCoord4fvARB;
|
||||||
PFNGLMULTITEXCOORD4IARBPROC glMultiTexCoord4iARB;
|
PFNGLMULTITEXCOORD4IARBPROC blMultiTexCoord4iARB;
|
||||||
PFNGLMULTITEXCOORD4IVARBPROC glMultiTexCoord4ivARB;
|
PFNGLMULTITEXCOORD4IVARBPROC blMultiTexCoord4ivARB;
|
||||||
PFNGLMULTITEXCOORD4SARBPROC glMultiTexCoord4sARB;
|
PFNGLMULTITEXCOORD4SARBPROC blMultiTexCoord4sARB;
|
||||||
PFNGLMULTITEXCOORD4SVARBPROC glMultiTexCoord4svARB;
|
PFNGLMULTITEXCOORD4SVARBPROC blMultiTexCoord4svARB;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
PFNGLDELETEOBJECTARBPROC glDeleteObjectARB;
|
PFNGLDELETEOBJECTARBPROC blDeleteObjectARB;
|
||||||
PFNGLGETHANDLEARBPROC glGetHandleARB;
|
PFNGLGETHANDLEARBPROC blGetHandleARB;
|
||||||
PFNGLDETACHOBJECTARBPROC glDetachObjectARB;
|
PFNGLDETACHOBJECTARBPROC blDetachObjectARB;
|
||||||
PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB;
|
PFNGLCREATESHADEROBJECTARBPROC blCreateShaderObjectARB;
|
||||||
PFNGLSHADERSOURCEARBPROC glShaderSourceARB;
|
PFNGLSHADERSOURCEARBPROC blShaderSourceARB;
|
||||||
PFNGLCOMPILESHADERARBPROC glCompileShaderARB;
|
PFNGLCOMPILESHADERARBPROC blCompileShaderARB;
|
||||||
PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB;
|
PFNGLCREATEPROGRAMOBJECTARBPROC blCreateProgramObjectARB;
|
||||||
PFNGLATTACHOBJECTARBPROC glAttachObjectARB;
|
PFNGLATTACHOBJECTARBPROC blAttachObjectARB;
|
||||||
PFNGLLINKPROGRAMARBPROC glLinkProgramARB;
|
PFNGLLINKPROGRAMARBPROC blLinkProgramARB;
|
||||||
PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB;
|
PFNGLUSEPROGRAMOBJECTARBPROC blUseProgramObjectARB;
|
||||||
PFNGLVALIDATEPROGRAMARBPROC glValidateProgramARB;
|
PFNGLVALIDATEPROGRAMARBPROC blValidateProgramARB;
|
||||||
PFNGLUNIFORM1FARBPROC glUniform1fARB;
|
PFNGLUNIFORM1FARBPROC blUniform1fARB;
|
||||||
PFNGLUNIFORM2FARBPROC glUniform2fARB;
|
PFNGLUNIFORM2FARBPROC blUniform2fARB;
|
||||||
PFNGLUNIFORM3FARBPROC glUniform3fARB;
|
PFNGLUNIFORM3FARBPROC blUniform3fARB;
|
||||||
PFNGLUNIFORM4FARBPROC glUniform4fARB;
|
PFNGLUNIFORM4FARBPROC blUniform4fARB;
|
||||||
PFNGLUNIFORM1IARBPROC glUniform1iARB;
|
PFNGLUNIFORM1IARBPROC blUniform1iARB;
|
||||||
PFNGLUNIFORM2IARBPROC glUniform2iARB;
|
PFNGLUNIFORM2IARBPROC blUniform2iARB;
|
||||||
PFNGLUNIFORM3IARBPROC glUniform3iARB;
|
PFNGLUNIFORM3IARBPROC blUniform3iARB;
|
||||||
PFNGLUNIFORM4IARBPROC glUniform4iARB;
|
PFNGLUNIFORM4IARBPROC blUniform4iARB;
|
||||||
PFNGLUNIFORM1FVARBPROC glUniform1fvARB;
|
PFNGLUNIFORM1FVARBPROC blUniform1fvARB;
|
||||||
PFNGLUNIFORM2FVARBPROC glUniform2fvARB;
|
PFNGLUNIFORM2FVARBPROC blUniform2fvARB;
|
||||||
PFNGLUNIFORM3FVARBPROC glUniform3fvARB;
|
PFNGLUNIFORM3FVARBPROC blUniform3fvARB;
|
||||||
PFNGLUNIFORM4FVARBPROC glUniform4fvARB;
|
PFNGLUNIFORM4FVARBPROC blUniform4fvARB;
|
||||||
PFNGLUNIFORM1IVARBPROC glUniform1ivARB;
|
PFNGLUNIFORM1IVARBPROC blUniform1ivARB;
|
||||||
PFNGLUNIFORM2IVARBPROC glUniform2ivARB;
|
PFNGLUNIFORM2IVARBPROC blUniform2ivARB;
|
||||||
PFNGLUNIFORM3IVARBPROC glUniform3ivARB;
|
PFNGLUNIFORM3IVARBPROC blUniform3ivARB;
|
||||||
PFNGLUNIFORM4IVARBPROC glUniform4ivARB;
|
PFNGLUNIFORM4IVARBPROC blUniform4ivARB;
|
||||||
PFNGLUNIFORMMATRIX2FVARBPROC glUniformMatrix2fvARB;
|
PFNGLUNIFORMMATRIX2FVARBPROC blUniformMatrix2fvARB;
|
||||||
PFNGLUNIFORMMATRIX3FVARBPROC glUniformMatrix3fvARB;
|
PFNGLUNIFORMMATRIX3FVARBPROC blUniformMatrix3fvARB;
|
||||||
PFNGLUNIFORMMATRIX4FVARBPROC glUniformMatrix4fvARB;
|
PFNGLUNIFORMMATRIX4FVARBPROC blUniformMatrix4fvARB;
|
||||||
PFNGLGETOBJECTPARAMETERFVARBPROC glGetObjectParameterfvARB;
|
PFNGLGETOBJECTPARAMETERFVARBPROC blGetObjectParameterfvARB;
|
||||||
PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB;
|
PFNGLGETOBJECTPARAMETERIVARBPROC blGetObjectParameterivARB;
|
||||||
PFNGLGETINFOLOGARBPROC glGetInfoLogARB;
|
PFNGLGETINFOLOGARBPROC blGetInfoLogARB;
|
||||||
PFNGLGETATTACHEDOBJECTSARBPROC glGetAttachedObjectsARB;
|
PFNGLGETATTACHEDOBJECTSARBPROC blGetAttachedObjectsARB;
|
||||||
PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB;
|
PFNGLGETUNIFORMLOCATIONARBPROC blGetUniformLocationARB;
|
||||||
PFNGLGETACTIVEUNIFORMARBPROC glGetActiveUniformARB;
|
PFNGLGETACTIVEUNIFORMARBPROC blGetActiveUniformARB;
|
||||||
PFNGLGETUNIFORMFVARBPROC glGetUniformfvARB;
|
PFNGLGETUNIFORMFVARBPROC blGetUniformfvARB;
|
||||||
PFNGLGETUNIFORMIVARBPROC glGetUniformivARB;
|
PFNGLGETUNIFORMIVARBPROC blGetUniformivARB;
|
||||||
PFNGLGETSHADERSOURCEARBPROC glGetShaderSourceARB;
|
PFNGLGETSHADERSOURCEARBPROC blGetShaderSourceARB;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GL_ARB_vertex_shader
|
#ifdef GL_ARB_vertex_shader
|
||||||
PFNGLBINDATTRIBLOCATIONARBPROC glBindAttribLocationARB;
|
PFNGLBINDATTRIBLOCATIONARBPROC blBindAttribLocationARB;
|
||||||
PFNGLGETACTIVEATTRIBARBPROC glGetActiveAttribARB;
|
PFNGLGETACTIVEATTRIBARBPROC blGetActiveAttribARB;
|
||||||
PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB;
|
PFNGLGETATTRIBLOCATIONARBPROC blGetAttribLocationARB;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace bgl
|
} // namespace bgl
|
||||||
@@ -464,41 +464,41 @@ static void LinkExtensions()
|
|||||||
#ifdef GL_ARB_multitexture
|
#ifdef GL_ARB_multitexture
|
||||||
if (QueryExtension("GL_ARB_multitexture"))
|
if (QueryExtension("GL_ARB_multitexture"))
|
||||||
{
|
{
|
||||||
bgl::glActiveTextureARB = reinterpret_cast<PFNGLACTIVETEXTUREARBPROC>(bglGetProcAddress((const GLubyte *) "glActiveTextureARB"));
|
bgl::blActiveTextureARB = reinterpret_cast<PFNGLACTIVETEXTUREARBPROC>(bglGetProcAddress((const GLubyte *) "glActiveTextureARB"));
|
||||||
bgl::glClientActiveTextureARB = reinterpret_cast<PFNGLCLIENTACTIVETEXTUREARBPROC>(bglGetProcAddress((const GLubyte *) "glClientActiveTextureARB"));
|
bgl::blClientActiveTextureARB = reinterpret_cast<PFNGLCLIENTACTIVETEXTUREARBPROC>(bglGetProcAddress((const GLubyte *) "glClientActiveTextureARB"));
|
||||||
bgl::glMultiTexCoord1dARB = reinterpret_cast<PFNGLMULTITEXCOORD1DARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1dARB"));
|
bgl::blMultiTexCoord1dARB = reinterpret_cast<PFNGLMULTITEXCOORD1DARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1dARB"));
|
||||||
bgl::glMultiTexCoord1dvARB = reinterpret_cast<PFNGLMULTITEXCOORD1DVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1dvARB"));
|
bgl::blMultiTexCoord1dvARB = reinterpret_cast<PFNGLMULTITEXCOORD1DVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1dvARB"));
|
||||||
bgl::glMultiTexCoord1fARB = reinterpret_cast<PFNGLMULTITEXCOORD1FARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1fARB"));
|
bgl::blMultiTexCoord1fARB = reinterpret_cast<PFNGLMULTITEXCOORD1FARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1fARB"));
|
||||||
bgl::glMultiTexCoord1fvARB = reinterpret_cast<PFNGLMULTITEXCOORD1FVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1fvARB"));
|
bgl::blMultiTexCoord1fvARB = reinterpret_cast<PFNGLMULTITEXCOORD1FVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1fvARB"));
|
||||||
bgl::glMultiTexCoord1iARB = reinterpret_cast<PFNGLMULTITEXCOORD1IARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1iARB"));
|
bgl::blMultiTexCoord1iARB = reinterpret_cast<PFNGLMULTITEXCOORD1IARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1iARB"));
|
||||||
bgl::glMultiTexCoord1ivARB = reinterpret_cast<PFNGLMULTITEXCOORD1IVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1ivARB"));
|
bgl::blMultiTexCoord1ivARB = reinterpret_cast<PFNGLMULTITEXCOORD1IVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1ivARB"));
|
||||||
bgl::glMultiTexCoord1sARB = reinterpret_cast<PFNGLMULTITEXCOORD1SARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1sARB"));
|
bgl::blMultiTexCoord1sARB = reinterpret_cast<PFNGLMULTITEXCOORD1SARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1sARB"));
|
||||||
bgl::glMultiTexCoord1svARB = reinterpret_cast<PFNGLMULTITEXCOORD1SVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1svARB"));
|
bgl::blMultiTexCoord1svARB = reinterpret_cast<PFNGLMULTITEXCOORD1SVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1svARB"));
|
||||||
bgl::glMultiTexCoord2dARB = reinterpret_cast<PFNGLMULTITEXCOORD2DARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2dARB"));
|
bgl::blMultiTexCoord2dARB = reinterpret_cast<PFNGLMULTITEXCOORD2DARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2dARB"));
|
||||||
bgl::glMultiTexCoord2dvARB = reinterpret_cast<PFNGLMULTITEXCOORD2DVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2dvARB"));
|
bgl::blMultiTexCoord2dvARB = reinterpret_cast<PFNGLMULTITEXCOORD2DVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2dvARB"));
|
||||||
bgl::glMultiTexCoord2fARB = reinterpret_cast<PFNGLMULTITEXCOORD2FARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2fARB"));
|
bgl::blMultiTexCoord2fARB = reinterpret_cast<PFNGLMULTITEXCOORD2FARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2fARB"));
|
||||||
bgl::glMultiTexCoord2fvARB = reinterpret_cast<PFNGLMULTITEXCOORD2FVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2fvARB"));
|
bgl::blMultiTexCoord2fvARB = reinterpret_cast<PFNGLMULTITEXCOORD2FVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2fvARB"));
|
||||||
bgl::glMultiTexCoord2iARB = reinterpret_cast<PFNGLMULTITEXCOORD2IARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2iARB"));
|
bgl::blMultiTexCoord2iARB = reinterpret_cast<PFNGLMULTITEXCOORD2IARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2iARB"));
|
||||||
bgl::glMultiTexCoord2ivARB = reinterpret_cast<PFNGLMULTITEXCOORD2IVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2ivARB"));
|
bgl::blMultiTexCoord2ivARB = reinterpret_cast<PFNGLMULTITEXCOORD2IVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2ivARB"));
|
||||||
bgl::glMultiTexCoord2sARB = reinterpret_cast<PFNGLMULTITEXCOORD2SARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2sARB"));
|
bgl::blMultiTexCoord2sARB = reinterpret_cast<PFNGLMULTITEXCOORD2SARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2sARB"));
|
||||||
bgl::glMultiTexCoord2svARB = reinterpret_cast<PFNGLMULTITEXCOORD2SVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2svARB"));
|
bgl::blMultiTexCoord2svARB = reinterpret_cast<PFNGLMULTITEXCOORD2SVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2svARB"));
|
||||||
bgl::glMultiTexCoord3dARB = reinterpret_cast<PFNGLMULTITEXCOORD3DARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3dARB"));
|
bgl::blMultiTexCoord3dARB = reinterpret_cast<PFNGLMULTITEXCOORD3DARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3dARB"));
|
||||||
bgl::glMultiTexCoord3dvARB = reinterpret_cast<PFNGLMULTITEXCOORD3DVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3dvARB"));
|
bgl::blMultiTexCoord3dvARB = reinterpret_cast<PFNGLMULTITEXCOORD3DVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3dvARB"));
|
||||||
bgl::glMultiTexCoord3fARB = reinterpret_cast<PFNGLMULTITEXCOORD3FARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3fARB"));
|
bgl::blMultiTexCoord3fARB = reinterpret_cast<PFNGLMULTITEXCOORD3FARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3fARB"));
|
||||||
bgl::glMultiTexCoord3fvARB = reinterpret_cast<PFNGLMULTITEXCOORD3FVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3fvARB"));
|
bgl::blMultiTexCoord3fvARB = reinterpret_cast<PFNGLMULTITEXCOORD3FVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3fvARB"));
|
||||||
bgl::glMultiTexCoord3iARB = reinterpret_cast<PFNGLMULTITEXCOORD3IARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3iARB"));
|
bgl::blMultiTexCoord3iARB = reinterpret_cast<PFNGLMULTITEXCOORD3IARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3iARB"));
|
||||||
bgl::glMultiTexCoord3ivARB = reinterpret_cast<PFNGLMULTITEXCOORD3IVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3ivARB"));
|
bgl::blMultiTexCoord3ivARB = reinterpret_cast<PFNGLMULTITEXCOORD3IVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3ivARB"));
|
||||||
bgl::glMultiTexCoord3sARB = reinterpret_cast<PFNGLMULTITEXCOORD3SARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3sARB"));
|
bgl::blMultiTexCoord3sARB = reinterpret_cast<PFNGLMULTITEXCOORD3SARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3sARB"));
|
||||||
bgl::glMultiTexCoord3svARB = reinterpret_cast<PFNGLMULTITEXCOORD3SVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3svARB"));
|
bgl::blMultiTexCoord3svARB = reinterpret_cast<PFNGLMULTITEXCOORD3SVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3svARB"));
|
||||||
bgl::glMultiTexCoord4dARB = reinterpret_cast<PFNGLMULTITEXCOORD4DARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4dARB"));
|
bgl::blMultiTexCoord4dARB = reinterpret_cast<PFNGLMULTITEXCOORD4DARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4dARB"));
|
||||||
bgl::glMultiTexCoord4dvARB = reinterpret_cast<PFNGLMULTITEXCOORD4DVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4dvARB"));
|
bgl::blMultiTexCoord4dvARB = reinterpret_cast<PFNGLMULTITEXCOORD4DVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4dvARB"));
|
||||||
bgl::glMultiTexCoord4fARB = reinterpret_cast<PFNGLMULTITEXCOORD4FARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4fARB"));
|
bgl::blMultiTexCoord4fARB = reinterpret_cast<PFNGLMULTITEXCOORD4FARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4fARB"));
|
||||||
bgl::glMultiTexCoord4fvARB = reinterpret_cast<PFNGLMULTITEXCOORD4FVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4fvARB"));
|
bgl::blMultiTexCoord4fvARB = reinterpret_cast<PFNGLMULTITEXCOORD4FVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4fvARB"));
|
||||||
bgl::glMultiTexCoord4iARB = reinterpret_cast<PFNGLMULTITEXCOORD4IARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4iARB"));
|
bgl::blMultiTexCoord4iARB = reinterpret_cast<PFNGLMULTITEXCOORD4IARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4iARB"));
|
||||||
bgl::glMultiTexCoord4ivARB = reinterpret_cast<PFNGLMULTITEXCOORD4IVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4ivARB"));
|
bgl::blMultiTexCoord4ivARB = reinterpret_cast<PFNGLMULTITEXCOORD4IVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4ivARB"));
|
||||||
bgl::glMultiTexCoord4sARB = reinterpret_cast<PFNGLMULTITEXCOORD4SARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4sARB"));
|
bgl::blMultiTexCoord4sARB = reinterpret_cast<PFNGLMULTITEXCOORD4SARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4sARB"));
|
||||||
bgl::glMultiTexCoord4svARB = reinterpret_cast<PFNGLMULTITEXCOORD4SVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4svARB"));
|
bgl::blMultiTexCoord4svARB = reinterpret_cast<PFNGLMULTITEXCOORD4SVARBPROC>(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4svARB"));
|
||||||
if (bgl::glActiveTextureARB && bgl::glClientActiveTextureARB && bgl::glMultiTexCoord1dARB && bgl::glMultiTexCoord1dvARB && bgl::glMultiTexCoord1fARB && bgl::glMultiTexCoord1fvARB && bgl::glMultiTexCoord1iARB && bgl::glMultiTexCoord1ivARB && bgl::glMultiTexCoord1sARB && bgl::glMultiTexCoord1svARB && bgl::glMultiTexCoord2dARB && bgl::glMultiTexCoord2dvARB && bgl::glMultiTexCoord2fARB && bgl::glMultiTexCoord2fvARB && bgl::glMultiTexCoord2iARB && bgl::glMultiTexCoord2ivARB && bgl::glMultiTexCoord2sARB && bgl::glMultiTexCoord2svARB && bgl::glMultiTexCoord3dARB && bgl::glMultiTexCoord3dvARB && bgl::glMultiTexCoord3fARB && bgl::glMultiTexCoord3fvARB && bgl::glMultiTexCoord3iARB && bgl::glMultiTexCoord3ivARB && bgl::glMultiTexCoord3sARB && bgl::glMultiTexCoord3svARB && bgl::glMultiTexCoord4dARB && bgl::glMultiTexCoord4dvARB && bgl::glMultiTexCoord4fARB && bgl::glMultiTexCoord4fvARB && bgl::glMultiTexCoord4iARB && bgl::glMultiTexCoord4ivARB && bgl::glMultiTexCoord4sARB && bgl::glMultiTexCoord4svARB) {
|
if (bgl::blActiveTextureARB && bgl::blClientActiveTextureARB && bgl::blMultiTexCoord1dARB && bgl::blMultiTexCoord1dvARB && bgl::blMultiTexCoord1fARB && bgl::blMultiTexCoord1fvARB && bgl::blMultiTexCoord1iARB && bgl::blMultiTexCoord1ivARB && bgl::blMultiTexCoord1sARB && bgl::blMultiTexCoord1svARB && bgl::blMultiTexCoord2dARB && bgl::blMultiTexCoord2dvARB && bgl::blMultiTexCoord2fARB && bgl::blMultiTexCoord2fvARB && bgl::blMultiTexCoord2iARB && bgl::blMultiTexCoord2ivARB && bgl::blMultiTexCoord2sARB && bgl::blMultiTexCoord2svARB && bgl::blMultiTexCoord3dARB && bgl::blMultiTexCoord3dvARB && bgl::blMultiTexCoord3fARB && bgl::blMultiTexCoord3fvARB && bgl::blMultiTexCoord3iARB && bgl::blMultiTexCoord3ivARB && bgl::blMultiTexCoord3sARB && bgl::blMultiTexCoord3svARB && bgl::blMultiTexCoord4dARB && bgl::blMultiTexCoord4dvARB && bgl::blMultiTexCoord4fARB && bgl::blMultiTexCoord4fvARB && bgl::blMultiTexCoord4iARB && bgl::blMultiTexCoord4ivARB && bgl::blMultiTexCoord4sARB && bgl::blMultiTexCoord4svARB) {
|
||||||
EnableExtension(_GL_ARB_multitexture);
|
EnableExtension(_GL_ARB_multitexture);
|
||||||
RAS_EXT_support._ARB_multitexture = 1;
|
RAS_EXT_support._ARB_multitexture = 1;
|
||||||
if (doDebugMessages)
|
if (doDebugMessages)
|
||||||
@@ -509,49 +509,49 @@ static void LinkExtensions()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GL_ARB_shader_objects
|
#if GL_ARB_shader_objects
|
||||||
if (QueryExtension("GL_ARB_shader_objects"))
|
if (QueryExtension("GL_ARB_shader_objects"))
|
||||||
{
|
{
|
||||||
glDeleteObjectARB = reinterpret_cast<PFNGLDELETEOBJECTARBPROC>(bglGetProcAddress((const GLubyte *) "glDeleteObjectARB"));
|
bgl::blDeleteObjectARB = reinterpret_cast<PFNGLDELETEOBJECTARBPROC>(bglGetProcAddress((const GLubyte *) "glDeleteObjectARB"));
|
||||||
glGetHandleARB = reinterpret_cast<PFNGLGETHANDLEARBPROC>(bglGetProcAddress((const GLubyte *) "glGetHandleARB"));
|
bgl::blGetHandleARB = reinterpret_cast<PFNGLGETHANDLEARBPROC>(bglGetProcAddress((const GLubyte *) "glGetHandleARB"));
|
||||||
glDetachObjectARB = reinterpret_cast<PFNGLDETACHOBJECTARBPROC>(bglGetProcAddress((const GLubyte *) "glDetachObjectARB"));
|
bgl::blDetachObjectARB = reinterpret_cast<PFNGLDETACHOBJECTARBPROC>(bglGetProcAddress((const GLubyte *) "glDetachObjectARB"));
|
||||||
glCreateShaderObjectARB = reinterpret_cast<PFNGLCREATESHADEROBJECTARBPROC>(bglGetProcAddress((const GLubyte *) "glCreateShaderObjectARB"));
|
bgl::blCreateShaderObjectARB = reinterpret_cast<PFNGLCREATESHADEROBJECTARBPROC>(bglGetProcAddress((const GLubyte *) "glCreateShaderObjectARB"));
|
||||||
glShaderSourceARB = reinterpret_cast<PFNGLSHADERSOURCEARBPROC>(bglGetProcAddress((const GLubyte *) "glShaderSourceARB"));
|
bgl::blShaderSourceARB = reinterpret_cast<PFNGLSHADERSOURCEARBPROC>(bglGetProcAddress((const GLubyte *) "glShaderSourceARB"));
|
||||||
glCompileShaderARB = reinterpret_cast<PFNGLCOMPILESHADERARBPROC>(bglGetProcAddress((const GLubyte *) "glCompileShaderARB"));
|
bgl::blCompileShaderARB = reinterpret_cast<PFNGLCOMPILESHADERARBPROC>(bglGetProcAddress((const GLubyte *) "glCompileShaderARB"));
|
||||||
glCreateProgramObjectARB = reinterpret_cast<PFNGLCREATEPROGRAMOBJECTARBPROC>(bglGetProcAddress((const GLubyte *) "glCreateProgramObjectARB"));
|
bgl::blCreateProgramObjectARB = reinterpret_cast<PFNGLCREATEPROGRAMOBJECTARBPROC>(bglGetProcAddress((const GLubyte *) "glCreateProgramObjectARB"));
|
||||||
glAttachObjectARB = reinterpret_cast<PFNGLATTACHOBJECTARBPROC>(bglGetProcAddress((const GLubyte *) "glAttachObjectARB"));
|
bgl::blAttachObjectARB = reinterpret_cast<PFNGLATTACHOBJECTARBPROC>(bglGetProcAddress((const GLubyte *) "glAttachObjectARB"));
|
||||||
glLinkProgramARB = reinterpret_cast<PFNGLLINKPROGRAMARBPROC>(bglGetProcAddress((const GLubyte *) "glLinkProgramARB"));
|
bgl::blLinkProgramARB = reinterpret_cast<PFNGLLINKPROGRAMARBPROC>(bglGetProcAddress((const GLubyte *) "glLinkProgramARB"));
|
||||||
glUseProgramObjectARB = reinterpret_cast<PFNGLUSEPROGRAMOBJECTARBPROC>(bglGetProcAddress((const GLubyte *) "glUseProgramObjectARB"));
|
bgl::blUseProgramObjectARB = reinterpret_cast<PFNGLUSEPROGRAMOBJECTARBPROC>(bglGetProcAddress((const GLubyte *) "glUseProgramObjectARB"));
|
||||||
glValidateProgramARB = reinterpret_cast<PFNGLVALIDATEPROGRAMARBPROC>(bglGetProcAddress((const GLubyte *) "glValidateProgramARB"));
|
bgl::blValidateProgramARB = reinterpret_cast<PFNGLVALIDATEPROGRAMARBPROC>(bglGetProcAddress((const GLubyte *) "glValidateProgramARB"));
|
||||||
glUniform1fARB = reinterpret_cast<PFNGLUNIFORM1FARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform1fARB"));
|
bgl::blUniform1fARB = reinterpret_cast<PFNGLUNIFORM1FARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform1fARB"));
|
||||||
glUniform2fARB = reinterpret_cast<PFNGLUNIFORM2FARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform2fARB"));
|
bgl::blUniform2fARB = reinterpret_cast<PFNGLUNIFORM2FARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform2fARB"));
|
||||||
glUniform3fARB = reinterpret_cast<PFNGLUNIFORM3FARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform3fARB"));
|
bgl::blUniform3fARB = reinterpret_cast<PFNGLUNIFORM3FARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform3fARB"));
|
||||||
glUniform4fARB = reinterpret_cast<PFNGLUNIFORM4FARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform4fARB"));
|
bgl::blUniform4fARB = reinterpret_cast<PFNGLUNIFORM4FARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform4fARB"));
|
||||||
glUniform1iARB = reinterpret_cast<PFNGLUNIFORM1IARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform1iARB"));
|
bgl::blUniform1iARB = reinterpret_cast<PFNGLUNIFORM1IARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform1iARB"));
|
||||||
glUniform2iARB = reinterpret_cast<PFNGLUNIFORM2IARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform2iARB"));
|
bgl::blUniform2iARB = reinterpret_cast<PFNGLUNIFORM2IARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform2iARB"));
|
||||||
glUniform3iARB = reinterpret_cast<PFNGLUNIFORM3IARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform3iARB"));
|
bgl::blUniform3iARB = reinterpret_cast<PFNGLUNIFORM3IARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform3iARB"));
|
||||||
glUniform4iARB = reinterpret_cast<PFNGLUNIFORM4IARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform4iARB"));
|
bgl::blUniform4iARB = reinterpret_cast<PFNGLUNIFORM4IARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform4iARB"));
|
||||||
glUniform1fvARB = reinterpret_cast<PFNGLUNIFORM1FVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform1fvARB"));
|
bgl::blUniform1fvARB = reinterpret_cast<PFNGLUNIFORM1FVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform1fvARB"));
|
||||||
glUniform2fvARB = reinterpret_cast<PFNGLUNIFORM2FVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform2fvARB"));
|
bgl::blUniform2fvARB = reinterpret_cast<PFNGLUNIFORM2FVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform2fvARB"));
|
||||||
glUniform3fvARB = reinterpret_cast<PFNGLUNIFORM3FVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform3fvARB"));
|
bgl::blUniform3fvARB = reinterpret_cast<PFNGLUNIFORM3FVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform3fvARB"));
|
||||||
glUniform4fvARB = reinterpret_cast<PFNGLUNIFORM4FVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform4fvARB"));
|
bgl::blUniform4fvARB = reinterpret_cast<PFNGLUNIFORM4FVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform4fvARB"));
|
||||||
glUniform1ivARB = reinterpret_cast<PFNGLUNIFORM1IVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform1ivARB"));
|
bgl::blUniform1ivARB = reinterpret_cast<PFNGLUNIFORM1IVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform1ivARB"));
|
||||||
glUniform2ivARB = reinterpret_cast<PFNGLUNIFORM2IVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform2ivARB"));
|
bgl::blUniform2ivARB = reinterpret_cast<PFNGLUNIFORM2IVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform2ivARB"));
|
||||||
glUniform3ivARB = reinterpret_cast<PFNGLUNIFORM3IVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform3ivARB"));
|
bgl::blUniform3ivARB = reinterpret_cast<PFNGLUNIFORM3IVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform3ivARB"));
|
||||||
glUniform4ivARB = reinterpret_cast<PFNGLUNIFORM4IVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform4ivARB"));
|
bgl::blUniform4ivARB = reinterpret_cast<PFNGLUNIFORM4IVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniform4ivARB"));
|
||||||
glUniformMatrix2fvARB = reinterpret_cast<PFNGLUNIFORMMATRIX2FVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniformMatrix2fvARB"));
|
bgl::blUniformMatrix2fvARB = reinterpret_cast<PFNGLUNIFORMMATRIX2FVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniformMatrix2fvARB"));
|
||||||
glUniformMatrix3fvARB = reinterpret_cast<PFNGLUNIFORMMATRIX3FVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniformMatrix3fvARB"));
|
bgl::blUniformMatrix3fvARB = reinterpret_cast<PFNGLUNIFORMMATRIX3FVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniformMatrix3fvARB"));
|
||||||
glUniformMatrix4fvARB = reinterpret_cast<PFNGLUNIFORMMATRIX4FVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniformMatrix4fvARB"));
|
bgl::blUniformMatrix4fvARB = reinterpret_cast<PFNGLUNIFORMMATRIX4FVARBPROC>(bglGetProcAddress((const GLubyte *) "glUniformMatrix4fvARB"));
|
||||||
glGetObjectParameterfvARB = reinterpret_cast<PFNGLGETOBJECTPARAMETERFVARBPROC>(bglGetProcAddress((const GLubyte *) "glGetObjectParameterfvARB"));
|
bgl::blGetObjectParameterfvARB = reinterpret_cast<PFNGLGETOBJECTPARAMETERFVARBPROC>(bglGetProcAddress((const GLubyte *) "glGetObjectParameterfvARB"));
|
||||||
glGetObjectParameterivARB = reinterpret_cast<PFNGLGETOBJECTPARAMETERIVARBPROC>(bglGetProcAddress((const GLubyte *) "glGetObjectParameterivARB"));
|
bgl::blGetObjectParameterivARB = reinterpret_cast<PFNGLGETOBJECTPARAMETERIVARBPROC>(bglGetProcAddress((const GLubyte *) "glGetObjectParameterivARB"));
|
||||||
glGetInfoLogARB = reinterpret_cast<PFNGLGETINFOLOGARBPROC>(bglGetProcAddress((const GLubyte *) "glGetInfoLogARB"));
|
bgl::blGetInfoLogARB = reinterpret_cast<PFNGLGETINFOLOGARBPROC>(bglGetProcAddress((const GLubyte *) "glGetInfoLogARB"));
|
||||||
glGetAttachedObjectsARB = reinterpret_cast<PFNGLGETATTACHEDOBJECTSARBPROC>(bglGetProcAddress((const GLubyte *) "glGetAttachedObjectsARB"));
|
bgl::blGetAttachedObjectsARB = reinterpret_cast<PFNGLGETATTACHEDOBJECTSARBPROC>(bglGetProcAddress((const GLubyte *) "glGetAttachedObjectsARB"));
|
||||||
glGetUniformLocationARB = reinterpret_cast<PFNGLGETUNIFORMLOCATIONARBPROC>(bglGetProcAddress((const GLubyte *) "glGetUniformLocationARB"));
|
bgl::blGetUniformLocationARB = reinterpret_cast<PFNGLGETUNIFORMLOCATIONARBPROC>(bglGetProcAddress((const GLubyte *) "glGetUniformLocationARB"));
|
||||||
glGetActiveUniformARB = reinterpret_cast<PFNGLGETACTIVEUNIFORMARBPROC>(bglGetProcAddress((const GLubyte *) "glGetActiveUniformARB"));
|
bgl::blGetActiveUniformARB = reinterpret_cast<PFNGLGETACTIVEUNIFORMARBPROC>(bglGetProcAddress((const GLubyte *) "glGetActiveUniformARB"));
|
||||||
glGetUniformfvARB = reinterpret_cast<PFNGLGETUNIFORMFVARBPROC>(bglGetProcAddress((const GLubyte *) "glGetUniformfvARB"));
|
bgl::blGetUniformfvARB = reinterpret_cast<PFNGLGETUNIFORMFVARBPROC>(bglGetProcAddress((const GLubyte *) "glGetUniformfvARB"));
|
||||||
glGetUniformivARB = reinterpret_cast<PFNGLGETUNIFORMIVARBPROC>(bglGetProcAddress((const GLubyte *) "glGetUniformivARB"));
|
bgl::blGetUniformivARB = reinterpret_cast<PFNGLGETUNIFORMIVARBPROC>(bglGetProcAddress((const GLubyte *) "glGetUniformivARB"));
|
||||||
glGetShaderSourceARB = reinterpret_cast<PFNGLGETSHADERSOURCEARBPROC>(bglGetProcAddress((const GLubyte *) "glGetShaderSourceARB"));
|
bgl::blGetShaderSourceARB = reinterpret_cast<PFNGLGETSHADERSOURCEARBPROC>(bglGetProcAddress((const GLubyte *) "glGetShaderSourceARB"));
|
||||||
if (glDeleteObjectARB && glGetHandleARB && glDetachObjectARB && glCreateShaderObjectARB && glShaderSourceARB && glCompileShaderARB && glCreateProgramObjectARB && glAttachObjectARB && glLinkProgramARB && glUseProgramObjectARB && glValidateProgramARB && glUniform1fARB && glUniform2fARB && glUniform3fARB && glUniform4fARB && glUniform1iARB && glUniform2iARB && glUniform3iARB && glUniform4iARB && glUniform1fvARB && glUniform2fvARB && glUniform3fvARB && glUniform4fvARB && glUniform1ivARB && glUniform2ivARB && glUniform3ivARB && glUniform4ivARB && glUniformMatrix2fvARB && glUniformMatrix3fvARB && glUniformMatrix4fvARB && glGetObjectParameterfvARB && glGetObjectParameterivARB && glGetInfoLogARB && glGetAttachedObjectsARB && glGetUniformLocationARB && glGetActiveUniformARB && glGetUniformfvARB && glGetUniformivARB && glGetShaderSourceARB) {
|
if (bgl::blDeleteObjectARB && bgl::blGetHandleARB && bgl::blDetachObjectARB && bgl::blCreateShaderObjectARB && bgl::blShaderSourceARB && bgl::blCompileShaderARB && bgl::blCreateProgramObjectARB && bgl::blAttachObjectARB && bgl::blLinkProgramARB && bgl::blUseProgramObjectARB && bgl::blValidateProgramARB && bgl::blUniform1fARB && bgl::blUniform2fARB && bgl::blUniform3fARB && bgl::blUniform4fARB && bgl::blUniform1iARB && bgl::blUniform2iARB && bgl::blUniform3iARB && bgl::blUniform4iARB && bgl::blUniform1fvARB && bgl::blUniform2fvARB && bgl::blUniform3fvARB && bgl::blUniform4fvARB && bgl::blUniform1ivARB && bgl::blUniform2ivARB && bgl::blUniform3ivARB && bgl::blUniform4ivARB && bgl::blUniformMatrix2fvARB && bgl::blUniformMatrix3fvARB && bgl::blUniformMatrix4fvARB && bgl::blGetObjectParameterfvARB && bgl::blGetObjectParameterivARB && bgl::blGetInfoLogARB && bgl::blGetAttachedObjectsARB && bgl::blGetUniformLocationARB && bgl::blGetActiveUniformARB && bgl::blGetUniformfvARB && bgl::blGetUniformivARB && bgl::blGetShaderSourceARB) {
|
||||||
EnableExtension(_GL_ARB_shader_objects);
|
EnableExtension(_GL_ARB_shader_objects);
|
||||||
RAS_EXT_support._ARB_shader_objects =1;
|
RAS_EXT_support._ARB_shader_objects =1;
|
||||||
if (doDebugMessages)
|
if (doDebugMessages)
|
||||||
@@ -562,13 +562,13 @@ static void LinkExtensions()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GL_ARB_vertex_shader
|
#if GL_ARB_vertex_shader
|
||||||
if (QueryExtension("GL_ARB_vertex_shader"))
|
if (QueryExtension("GL_ARB_vertex_shader"))
|
||||||
{
|
{
|
||||||
glBindAttribLocationARB = reinterpret_cast<PFNGLBINDATTRIBLOCATIONARBPROC>(bglGetProcAddress((const GLubyte *) "glBindAttribLocationARB"));
|
bgl::blBindAttribLocationARB = reinterpret_cast<PFNGLBINDATTRIBLOCATIONARBPROC>(bglGetProcAddress((const GLubyte *) "glBindAttribLocationARB"));
|
||||||
glGetActiveAttribARB = reinterpret_cast<PFNGLGETACTIVEATTRIBARBPROC>(bglGetProcAddress((const GLubyte *) "glGetActiveAttribARB"));
|
bgl::blGetActiveAttribARB = reinterpret_cast<PFNGLGETACTIVEATTRIBARBPROC>(bglGetProcAddress((const GLubyte *) "glGetActiveAttribARB"));
|
||||||
glGetAttribLocationARB = reinterpret_cast<PFNGLGETATTRIBLOCATIONARBPROC>(bglGetProcAddress((const GLubyte *) "glGetAttribLocationARB"));
|
bgl::blGetAttribLocationARB = reinterpret_cast<PFNGLGETATTRIBLOCATIONARBPROC>(bglGetProcAddress((const GLubyte *) "glGetAttribLocationARB"));
|
||||||
if (glBindAttribLocationARB && glGetActiveAttribARB && glGetAttribLocationARB) {
|
if (bgl::blBindAttribLocationARB && bgl::blGetActiveAttribARB && bgl::blGetAttribLocationARB) {
|
||||||
EnableExtension(_GL_ARB_vertex_shader);
|
EnableExtension(_GL_ARB_vertex_shader);
|
||||||
RAS_EXT_support._ARB_vertex_shader = 1;
|
RAS_EXT_support._ARB_vertex_shader = 1;
|
||||||
if (doDebugMessages)
|
if (doDebugMessages)
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
# define __glext_h_
|
# define __glext_h_
|
||||||
|
# define GL_GLEXT_LEGACY 1
|
||||||
# include <OpenGL/gl.h>
|
# include <OpenGL/gl.h>
|
||||||
# include <OpenGL/glu.h>
|
# include <OpenGL/glu.h>
|
||||||
# undef __glext_h_
|
# undef __glext_h_
|
||||||
@@ -52,6 +53,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "glext.h"
|
#include "glext.h"
|
||||||
|
|
||||||
#include "EXT_separate_specular_color.h"
|
#include "EXT_separate_specular_color.h"
|
||||||
#include "ARB_multitexture.h"
|
#include "ARB_multitexture.h"
|
||||||
namespace bgl
|
namespace bgl
|
||||||
@@ -379,8 +381,8 @@ namespace bgl
|
|||||||
void InitExtensions(int debug);
|
void InitExtensions(int debug);
|
||||||
|
|
||||||
#if defined(PFNGLPNTRIANGLESIATIPROC)
|
#if defined(PFNGLPNTRIANGLESIATIPROC)
|
||||||
extern PFNGLPNTRIANGLESIATIPROC glPNTrianglesiATI;
|
extern PFNGLPNTRIANGLESIATIPROC blPNTrianglesiATI;
|
||||||
extern PFNGLPNTRIANGLESFATIPROC glPNTrianglesfATI;
|
extern PFNGLPNTRIANGLESFATIPROC blPNTrianglesfATI;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -413,89 +415,89 @@ extern BL_EXTInfo RAS_EXT_support;
|
|||||||
|
|
||||||
#ifdef GL_ARB_multitexture // defined in glext.h now...
|
#ifdef GL_ARB_multitexture // defined in glext.h now...
|
||||||
extern int max_texture_units;
|
extern int max_texture_units;
|
||||||
extern PFNGLACTIVETEXTUREARBPROC glActiveTextureARB;
|
extern PFNGLACTIVETEXTUREARBPROC blActiveTextureARB;
|
||||||
extern PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB;
|
extern PFNGLCLIENTACTIVETEXTUREARBPROC blClientActiveTextureARB;
|
||||||
extern PFNGLMULTITEXCOORD1DARBPROC glMultiTexCoord1dARB;
|
extern PFNGLMULTITEXCOORD1DARBPROC blMultiTexCoord1dARB;
|
||||||
extern PFNGLMULTITEXCOORD1DVARBPROC glMultiTexCoord1dvARB;
|
extern PFNGLMULTITEXCOORD1DVARBPROC blMultiTexCoord1dvARB;
|
||||||
extern PFNGLMULTITEXCOORD1FARBPROC glMultiTexCoord1fARB;
|
extern PFNGLMULTITEXCOORD1FARBPROC blMultiTexCoord1fARB;
|
||||||
extern PFNGLMULTITEXCOORD1FVARBPROC glMultiTexCoord1fvARB;
|
extern PFNGLMULTITEXCOORD1FVARBPROC blMultiTexCoord1fvARB;
|
||||||
extern PFNGLMULTITEXCOORD1IARBPROC glMultiTexCoord1iARB;
|
extern PFNGLMULTITEXCOORD1IARBPROC blMultiTexCoord1iARB;
|
||||||
extern PFNGLMULTITEXCOORD1IVARBPROC glMultiTexCoord1ivARB;
|
extern PFNGLMULTITEXCOORD1IVARBPROC blMultiTexCoord1ivARB;
|
||||||
extern PFNGLMULTITEXCOORD1SARBPROC glMultiTexCoord1sARB;
|
extern PFNGLMULTITEXCOORD1SARBPROC blMultiTexCoord1sARB;
|
||||||
extern PFNGLMULTITEXCOORD1SVARBPROC glMultiTexCoord1svARB;
|
extern PFNGLMULTITEXCOORD1SVARBPROC blMultiTexCoord1svARB;
|
||||||
extern PFNGLMULTITEXCOORD2DARBPROC glMultiTexCoord2dARB;
|
extern PFNGLMULTITEXCOORD2DARBPROC blMultiTexCoord2dARB;
|
||||||
extern PFNGLMULTITEXCOORD2DVARBPROC glMultiTexCoord2dvARB;
|
extern PFNGLMULTITEXCOORD2DVARBPROC blMultiTexCoord2dvARB;
|
||||||
extern PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB;
|
extern PFNGLMULTITEXCOORD2FARBPROC blMultiTexCoord2fARB;
|
||||||
extern PFNGLMULTITEXCOORD2FVARBPROC glMultiTexCoord2fvARB;
|
extern PFNGLMULTITEXCOORD2FVARBPROC blMultiTexCoord2fvARB;
|
||||||
extern PFNGLMULTITEXCOORD2IARBPROC glMultiTexCoord2iARB;
|
extern PFNGLMULTITEXCOORD2IARBPROC blMultiTexCoord2iARB;
|
||||||
extern PFNGLMULTITEXCOORD2IVARBPROC glMultiTexCoord2ivARB;
|
extern PFNGLMULTITEXCOORD2IVARBPROC blMultiTexCoord2ivARB;
|
||||||
extern PFNGLMULTITEXCOORD2SARBPROC glMultiTexCoord2sARB;
|
extern PFNGLMULTITEXCOORD2SARBPROC blMultiTexCoord2sARB;
|
||||||
extern PFNGLMULTITEXCOORD2SVARBPROC glMultiTexCoord2svARB;
|
extern PFNGLMULTITEXCOORD2SVARBPROC blMultiTexCoord2svARB;
|
||||||
extern PFNGLMULTITEXCOORD3DARBPROC glMultiTexCoord3dARB;
|
extern PFNGLMULTITEXCOORD3DARBPROC blMultiTexCoord3dARB;
|
||||||
extern PFNGLMULTITEXCOORD3DVARBPROC glMultiTexCoord3dvARB;
|
extern PFNGLMULTITEXCOORD3DVARBPROC blMultiTexCoord3dvARB;
|
||||||
extern PFNGLMULTITEXCOORD3FARBPROC glMultiTexCoord3fARB;
|
extern PFNGLMULTITEXCOORD3FARBPROC blMultiTexCoord3fARB;
|
||||||
extern PFNGLMULTITEXCOORD3FVARBPROC glMultiTexCoord3fvARB;
|
extern PFNGLMULTITEXCOORD3FVARBPROC blMultiTexCoord3fvARB;
|
||||||
extern PFNGLMULTITEXCOORD3IARBPROC glMultiTexCoord3iARB;
|
extern PFNGLMULTITEXCOORD3IARBPROC blMultiTexCoord3iARB;
|
||||||
extern PFNGLMULTITEXCOORD3IVARBPROC glMultiTexCoord3ivARB;
|
extern PFNGLMULTITEXCOORD3IVARBPROC blMultiTexCoord3ivARB;
|
||||||
extern PFNGLMULTITEXCOORD3SARBPROC glMultiTexCoord3sARB;
|
extern PFNGLMULTITEXCOORD3SARBPROC blMultiTexCoord3sARB;
|
||||||
extern PFNGLMULTITEXCOORD3SVARBPROC glMultiTexCoord3svARB;
|
extern PFNGLMULTITEXCOORD3SVARBPROC blMultiTexCoord3svARB;
|
||||||
extern PFNGLMULTITEXCOORD4DARBPROC glMultiTexCoord4dARB;
|
extern PFNGLMULTITEXCOORD4DARBPROC blMultiTexCoord4dARB;
|
||||||
extern PFNGLMULTITEXCOORD4DVARBPROC glMultiTexCoord4dvARB;
|
extern PFNGLMULTITEXCOORD4DVARBPROC blMultiTexCoord4dvARB;
|
||||||
extern PFNGLMULTITEXCOORD4FARBPROC glMultiTexCoord4fARB;
|
extern PFNGLMULTITEXCOORD4FARBPROC blMultiTexCoord4fARB;
|
||||||
extern PFNGLMULTITEXCOORD4FVARBPROC glMultiTexCoord4fvARB;
|
extern PFNGLMULTITEXCOORD4FVARBPROC blMultiTexCoord4fvARB;
|
||||||
extern PFNGLMULTITEXCOORD4IARBPROC glMultiTexCoord4iARB;
|
extern PFNGLMULTITEXCOORD4IARBPROC blMultiTexCoord4iARB;
|
||||||
extern PFNGLMULTITEXCOORD4IVARBPROC glMultiTexCoord4ivARB;
|
extern PFNGLMULTITEXCOORD4IVARBPROC blMultiTexCoord4ivARB;
|
||||||
extern PFNGLMULTITEXCOORD4SARBPROC glMultiTexCoord4sARB;
|
extern PFNGLMULTITEXCOORD4SARBPROC blMultiTexCoord4sARB;
|
||||||
extern PFNGLMULTITEXCOORD4SVARBPROC glMultiTexCoord4svARB;
|
extern PFNGLMULTITEXCOORD4SVARBPROC blMultiTexCoord4svARB;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef GL_ARB_shader_objects
|
#ifdef GL_ARB_shader_objects
|
||||||
extern PFNGLDELETEOBJECTARBPROC glDeleteObjectARB;
|
extern PFNGLDELETEOBJECTARBPROC blDeleteObjectARB;
|
||||||
extern PFNGLGETHANDLEARBPROC glGetHandleARB;
|
extern PFNGLGETHANDLEARBPROC blGetHandleARB;
|
||||||
extern PFNGLDETACHOBJECTARBPROC glDetachObjectARB;
|
extern PFNGLDETACHOBJECTARBPROC blDetachObjectARB;
|
||||||
extern PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB;
|
extern PFNGLCREATESHADEROBJECTARBPROC blCreateShaderObjectARB;
|
||||||
extern PFNGLSHADERSOURCEARBPROC glShaderSourceARB;
|
extern PFNGLSHADERSOURCEARBPROC blShaderSourceARB;
|
||||||
extern PFNGLCOMPILESHADERARBPROC glCompileShaderARB;
|
extern PFNGLCOMPILESHADERARBPROC blCompileShaderARB;
|
||||||
extern PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB;
|
extern PFNGLCREATEPROGRAMOBJECTARBPROC blCreateProgramObjectARB;
|
||||||
extern PFNGLATTACHOBJECTARBPROC glAttachObjectARB;
|
extern PFNGLATTACHOBJECTARBPROC blAttachObjectARB;
|
||||||
extern PFNGLLINKPROGRAMARBPROC glLinkProgramARB;
|
extern PFNGLLINKPROGRAMARBPROC blLinkProgramARB;
|
||||||
extern PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB;
|
extern PFNGLUSEPROGRAMOBJECTARBPROC blUseProgramObjectARB;
|
||||||
extern PFNGLVALIDATEPROGRAMARBPROC glValidateProgramARB;
|
extern PFNGLVALIDATEPROGRAMARBPROC blValidateProgramARB;
|
||||||
extern PFNGLUNIFORM1FARBPROC glUniform1fARB;
|
extern PFNGLUNIFORM1FARBPROC blUniform1fARB;
|
||||||
extern PFNGLUNIFORM2FARBPROC glUniform2fARB;
|
extern PFNGLUNIFORM2FARBPROC blUniform2fARB;
|
||||||
extern PFNGLUNIFORM3FARBPROC glUniform3fARB;
|
extern PFNGLUNIFORM3FARBPROC blUniform3fARB;
|
||||||
extern PFNGLUNIFORM4FARBPROC glUniform4fARB;
|
extern PFNGLUNIFORM4FARBPROC blUniform4fARB;
|
||||||
extern PFNGLUNIFORM1IARBPROC glUniform1iARB;
|
extern PFNGLUNIFORM1IARBPROC blUniform1iARB;
|
||||||
extern PFNGLUNIFORM2IARBPROC glUniform2iARB;
|
extern PFNGLUNIFORM2IARBPROC blUniform2iARB;
|
||||||
extern PFNGLUNIFORM3IARBPROC glUniform3iARB;
|
extern PFNGLUNIFORM3IARBPROC blUniform3iARB;
|
||||||
extern PFNGLUNIFORM4IARBPROC glUniform4iARB;
|
extern PFNGLUNIFORM4IARBPROC blUniform4iARB;
|
||||||
extern PFNGLUNIFORM1FVARBPROC glUniform1fvARB;
|
extern PFNGLUNIFORM1FVARBPROC blUniform1fvARB;
|
||||||
extern PFNGLUNIFORM2FVARBPROC glUniform2fvARB;
|
extern PFNGLUNIFORM2FVARBPROC blUniform2fvARB;
|
||||||
extern PFNGLUNIFORM3FVARBPROC glUniform3fvARB;
|
extern PFNGLUNIFORM3FVARBPROC blUniform3fvARB;
|
||||||
extern PFNGLUNIFORM4FVARBPROC glUniform4fvARB;
|
extern PFNGLUNIFORM4FVARBPROC blUniform4fvARB;
|
||||||
extern PFNGLUNIFORM1IVARBPROC glUniform1ivARB;
|
extern PFNGLUNIFORM1IVARBPROC blUniform1ivARB;
|
||||||
extern PFNGLUNIFORM2IVARBPROC glUniform2ivARB;
|
extern PFNGLUNIFORM2IVARBPROC blUniform2ivARB;
|
||||||
extern PFNGLUNIFORM3IVARBPROC glUniform3ivARB;
|
extern PFNGLUNIFORM3IVARBPROC blUniform3ivARB;
|
||||||
extern PFNGLUNIFORM4IVARBPROC glUniform4ivARB;
|
extern PFNGLUNIFORM4IVARBPROC blUniform4ivARB;
|
||||||
extern PFNGLUNIFORMMATRIX2FVARBPROC glUniformMatrix2fvARB;
|
extern PFNGLUNIFORMMATRIX2FVARBPROC blUniformMatrix2fvARB;
|
||||||
extern PFNGLUNIFORMMATRIX3FVARBPROC glUniformMatrix3fvARB;
|
extern PFNGLUNIFORMMATRIX3FVARBPROC blUniformMatrix3fvARB;
|
||||||
extern PFNGLUNIFORMMATRIX4FVARBPROC glUniformMatrix4fvARB;
|
extern PFNGLUNIFORMMATRIX4FVARBPROC blUniformMatrix4fvARB;
|
||||||
extern PFNGLGETOBJECTPARAMETERFVARBPROC glGetObjectParameterfvARB;
|
extern PFNGLGETOBJECTPARAMETERFVARBPROC blGetObjectParameterfvARB;
|
||||||
extern PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB;
|
extern PFNGLGETOBJECTPARAMETERIVARBPROC blGetObjectParameterivARB;
|
||||||
extern PFNGLGETINFOLOGARBPROC glGetInfoLogARB;
|
extern PFNGLGETINFOLOGARBPROC blGetInfoLogARB;
|
||||||
extern PFNGLGETATTACHEDOBJECTSARBPROC glGetAttachedObjectsARB;
|
extern PFNGLGETATTACHEDOBJECTSARBPROC blGetAttachedObjectsARB;
|
||||||
extern PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB;
|
extern PFNGLGETUNIFORMLOCATIONARBPROC blGetUniformLocationARB;
|
||||||
extern PFNGLGETACTIVEUNIFORMARBPROC glGetActiveUniformARB;
|
extern PFNGLGETACTIVEUNIFORMARBPROC blGetActiveUniformARB;
|
||||||
extern PFNGLGETUNIFORMFVARBPROC glGetUniformfvARB;
|
extern PFNGLGETUNIFORMFVARBPROC blGetUniformfvARB;
|
||||||
extern PFNGLGETUNIFORMIVARBPROC glGetUniformivARB;
|
extern PFNGLGETUNIFORMIVARBPROC blGetUniformivARB;
|
||||||
extern PFNGLGETSHADERSOURCEARBPROC glGetShaderSourceARB;
|
extern PFNGLGETSHADERSOURCEARBPROC blGetShaderSourceARB;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GL_ARB_vertex_shader
|
#ifdef GL_ARB_vertex_shader
|
||||||
extern PFNGLBINDATTRIBLOCATIONARBPROC glBindAttribLocationARB;
|
extern PFNGLBINDATTRIBLOCATIONARBPROC blBindAttribLocationARB;
|
||||||
extern PFNGLGETACTIVEATTRIBARBPROC glGetActiveAttribARB;
|
extern PFNGLGETACTIVEATTRIBARBPROC blGetActiveAttribARB;
|
||||||
extern PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB;
|
extern PFNGLGETATTRIBLOCATIONARBPROC blGetAttribLocationARB;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} /* namespace bgl */
|
} /* namespace bgl */
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
#define GL_GLEXT_LEGACY 1
|
||||||
#include <OpenGL/gl.h>
|
#include <OpenGL/gl.h>
|
||||||
#include <OpenGL/glu.h>
|
#include <OpenGL/glu.h>
|
||||||
#else
|
#else
|
||||||
@@ -1265,10 +1266,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti(
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
|
|
||||||
@@ -1281,10 +1282,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti(
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
||||||
@@ -1296,10 +1297,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti(
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
||||||
@@ -1311,10 +1312,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti(
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
||||||
@@ -1336,10 +1337,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti(
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
||||||
@@ -1352,10 +1353,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti(
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
||||||
@@ -1368,10 +1369,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti(
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
|
|
||||||
@@ -1385,10 +1386,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti(
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
|
|
||||||
@@ -1416,10 +1417,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti(
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
|
|
||||||
@@ -1432,10 +1433,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti(
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
|
|
||||||
@@ -1448,10 +1449,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti(
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
|
|
||||||
@@ -1471,10 +1472,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti(
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
|
|
||||||
@@ -1488,10 +1489,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti(
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
||||||
@@ -1504,10 +1505,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti(
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
||||||
@@ -1620,10 +1621,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti_Ex(const vecVertexArray & vertex
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
|
|
||||||
@@ -1638,10 +1639,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti_Ex(const vecVertexArray & vertex
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
|
|
||||||
@@ -1656,10 +1657,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti_Ex(const vecVertexArray & vertex
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
|
|
||||||
@@ -1674,10 +1675,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti_Ex(const vecVertexArray & vertex
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
|
|
||||||
@@ -1721,10 +1722,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti_Ex(const vecVertexArray & vertex
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
|
|
||||||
@@ -1740,10 +1741,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti_Ex(const vecVertexArray & vertex
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
|
|
||||||
@@ -1759,10 +1760,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti_Ex(const vecVertexArray & vertex
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
|
|
||||||
@@ -1777,10 +1778,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti_Ex(const vecVertexArray & vertex
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
||||||
@@ -1824,10 +1825,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti_Ex(const vecVertexArray & vertex
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
||||||
@@ -1840,10 +1841,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti_Ex(const vecVertexArray & vertex
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
||||||
@@ -1856,10 +1857,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti_Ex(const vecVertexArray & vertex
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
||||||
@@ -1896,10 +1897,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti_Ex(const vecVertexArray & vertex
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
||||||
@@ -1913,10 +1914,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti_Ex(const vecVertexArray & vertex
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
||||||
@@ -1930,10 +1931,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti_Ex(const vecVertexArray & vertex
|
|||||||
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
if( vertexarray[(indexarray[vindex])].getFlag() & TV_2NDUV &&
|
||||||
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
vertexarray[(indexarray[vindex])].getUnit() == unit )
|
||||||
{
|
{
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV2());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bgl::glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
bgl::blMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, vertexarray[(indexarray[vindex])].getUV1());
|
||||||
}
|
}
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
#define GL_GLEXT_LEGACY 1
|
||||||
#include <OpenGL/gl.h>
|
#include <OpenGL/gl.h>
|
||||||
#else
|
#else
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ endif
|
|||||||
ifeq ($(OS),darwin)
|
ifeq ($(OS),darwin)
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CCC = g++
|
CCC = g++
|
||||||
CFLAGS += -pipe -fPIC -ffast-math -mcpu=7450 -mtune=7450
|
CFLAGS += -pipe -fPIC -ffast-math -mcpu=7450 -mtune=G5
|
||||||
CCFLAGS += -pipe -fPIC
|
CCFLAGS += -pipe -fPIC
|
||||||
# REL_CFLAGS += -O2
|
# REL_CFLAGS += -O2
|
||||||
# REL_CCFLAGS += -O2
|
# REL_CCFLAGS += -O2
|
||||||
|
|||||||
@@ -46,9 +46,6 @@ all debug::
|
|||||||
|
|
||||||
# First generic defaults for all platforms which should be constant.
|
# First generic defaults for all platforms which should be constant.
|
||||||
# Note: ?= lets these defaults be overruled by environment variables,
|
# Note: ?= lets these defaults be overruled by environment variables,
|
||||||
export NAN_NO_KETSJI=true
|
|
||||||
export NAN_JUST_BLENDERDYNAMIC=true
|
|
||||||
export NAN_NO_OPENAL=true
|
|
||||||
export SRCHOME ?= $(NANBLENDERHOME)/source
|
export SRCHOME ?= $(NANBLENDERHOME)/source
|
||||||
export CONFIG_GUESS := $(shell ${SRCHOME}/tools/guess/guessconfig)
|
export CONFIG_GUESS := $(shell ${SRCHOME}/tools/guess/guessconfig)
|
||||||
export OS := $(shell echo ${CONFIG_GUESS} | sed -e 's/-.*//')
|
export OS := $(shell echo ${CONFIG_GUESS} | sed -e 's/-.*//')
|
||||||
@@ -189,6 +186,9 @@ endif
|
|||||||
export NAN_SDLCFLAGS ?= -I$(NAN_SDL)/include
|
export NAN_SDLCFLAGS ?= -I$(NAN_SDL)/include
|
||||||
export NAN_SDLLIBS ?= $(NAN_SDL)/lib/libSDL.a -framework Cocoa -framework IOKit
|
export NAN_SDLLIBS ?= $(NAN_SDL)/lib/libSDL.a -framework Cocoa -framework IOKit
|
||||||
|
|
||||||
|
export NAN_NO_KETSJI=false
|
||||||
|
|
||||||
|
|
||||||
# Uncomment the following line to use Mozilla inplace of netscape
|
# Uncomment the following line to use Mozilla inplace of netscape
|
||||||
# CPPFLAGS +=-DMOZ_NOT_NET
|
# CPPFLAGS +=-DMOZ_NOT_NET
|
||||||
# Location of MOZILLA/Netscape header files...
|
# Location of MOZILLA/Netscape header files...
|
||||||
|
|||||||
Reference in New Issue
Block a user