diff options
author | Joerg Mueller <nexyon@gmail.com> | 2010-08-13 14:50:29 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2010-08-13 14:50:29 +0400 |
commit | 47d38dbd207bc5dcc5d0965fcf36ea37c366ba35 (patch) | |
tree | 38ffad02c03ea80f3e22e8ef1108f54cc9a20d16 /source | |
parent | fd2a9a0ed07ee82a5409f09b864d8b0a900035aa (diff) | |
parent | 9ce2086506dcf16ecc0d5dce7851439ae8818e78 (diff) |
svn merge -r 31211:31313 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Diffstat (limited to 'source')
185 files changed, 1173 insertions, 933 deletions
diff --git a/source/Makefile b/source/Makefile index 00ff981362c..ece5b6d8bba 100644 --- a/source/Makefile +++ b/source/Makefile @@ -17,7 +17,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/Makefile b/source/blender/Makefile index 1149e1c4be2..8052c175f8e 100644 --- a/source/blender/Makefile +++ b/source/blender/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/avi/Makefile b/source/blender/avi/Makefile index c8ab5fe0aca..96a6573cc67 100644 --- a/source/blender/avi/Makefile +++ b/source/blender/avi/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/avi/intern/Makefile b/source/blender/avi/intern/Makefile index 30f225c8031..8d1af9adb28 100644 --- a/source/blender/avi/intern/Makefile +++ b/source/blender/avi/intern/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/blenfont/Makefile b/source/blender/blenfont/Makefile index 9f34d458126..df1bbb72110 100644 --- a/source/blender/blenfont/Makefile +++ b/source/blender/blenfont/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2009 Blender Foundation # All rights reserved. diff --git a/source/blender/blenfont/intern/Makefile b/source/blender/blenfont/intern/Makefile index 77e87c27a02..d3a6e656028 100644 --- a/source/blender/blenfont/intern/Makefile +++ b/source/blender/blenfont/intern/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2008 Blender Foundation. # All rights reserved. diff --git a/source/blender/blenkernel/BKE_idcode.h b/source/blender/blenkernel/BKE_idcode.h new file mode 100644 index 00000000000..b624e34e1cb --- /dev/null +++ b/source/blender/blenkernel/BKE_idcode.h @@ -0,0 +1,75 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef BKE_ID_INFO_H +#define BKE_ID_INFO_H + +/** + * Convert an idcode into a name. + * + * @param code The code to convert. + * @return A static string representing the name of + * the code. + */ +const char *BKE_idcode_to_name(int code); + +/** + * Convert an idcode into a name (plural). + * + * @param code The code to convert. + * @return A static string representing the name of + * the code. + */ +const char *BKE_idcode_to_name_plural(int code); + +/** + * Convert a name into an idcode (ie. ID_SCE) + * + * @param name The name to convert. + * @return The code for the name, or 0 if invalid. + */ +int BKE_idcode_from_name(const char *name); + +/** + * Return non-zero when an ID type is linkable. + * + * @param code The code to check. + * @return Boolean, 0 when non linkable. + */ +int BKE_idcode_is_linkable(int code); + +/** + * Return if the ID code is a valid ID code. + * + * @param code The code to check. + * @return Boolean, 0 when invalid. + */ +int BKE_idcode_is_valid(int code); + +#endif diff --git a/source/blender/blenkernel/Makefile b/source/blender/blenkernel/Makefile index f0476bbf026..dc5f0a91da6 100644 --- a/source/blender/blenkernel/Makefile +++ b/source/blender/blenkernel/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 8b1443403a3..663fbb89b4e 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -1189,10 +1189,15 @@ static void emDM_getFace(DerivedMesh *dm, int index, MFace *face_r) static void emDM_copyVertArray(DerivedMesh *dm, MVert *vert_r) { - EditVert *ev = ((EditMeshDerivedMesh *)dm)->em->verts.first; + EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; + EditVert *ev = emdm->em->verts.first; + int i; - for( ; ev; ev = ev->next, ++vert_r) { - VECCOPY(vert_r->co, ev->co); + for(i=0; ev; ev = ev->next, ++vert_r, ++i) { + if(emdm->vertexCos) + copy_v3_v3(vert_r->co, emdm->vertexCos[i]); + else + copy_v3_v3(vert_r->co, ev->co); vert_r->no[0] = ev->no[0] * 32767.0; vert_r->no[1] = ev->no[1] * 32767.0; diff --git a/source/blender/blenkernel/intern/Makefile b/source/blender/blenkernel/intern/Makefile index eb14914c7ba..53a9999758c 100644 --- a/source/blender/blenkernel/intern/Makefile +++ b/source/blender/blenkernel/intern/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 841bd635acf..358dd1914e7 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -1573,7 +1573,7 @@ static void alfa_bezpart(BezTriple *prevbezt, BezTriple *bezt, Nurb *nu, float * for(a=0; a<resolu; a++, fac+= dfac) { if (tilt_array) { - if (nu->tilt_interp==3) { /* May as well support for tilt also 2.47 ease interp */ + if (nu->tilt_interp==KEY_CU_EASE) { /* May as well support for tilt also 2.47 ease interp */ *tilt_array = prevbezt->alfa + (bezt->alfa - prevbezt->alfa)*(3.0f*fac*fac - 2.0f*fac*fac*fac); } else { key_curve_position_weights(fac, t, nu->tilt_interp); @@ -1584,7 +1584,7 @@ static void alfa_bezpart(BezTriple *prevbezt, BezTriple *bezt, Nurb *nu, float * } if (radius_array) { - if (nu->radius_interp==3) { + if (nu->radius_interp==KEY_CU_EASE) { /* Support 2.47 ease interp * Note! - this only takes the 2 points into account, * giving much more localized results to changes in radius, sometimes you want that */ diff --git a/source/blender/blenkernel/intern/idcode.c b/source/blender/blenkernel/intern/idcode.c new file mode 100644 index 00000000000..3e8f400967e --- /dev/null +++ b/source/blender/blenkernel/intern/idcode.c @@ -0,0 +1,128 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + * return info about ID types + */ + +#include <stdlib.h> +#include <string.h> + +#include "DNA_ID.h" + +typedef struct { + unsigned short code; + char *name, *plural; + + int flags; +#define IDTYPE_FLAGS_ISLINKABLE (1<<0) +} IDType; + +/* plural need to match rna_main.c's MainCollectionDef */ +static IDType idtypes[]= { + { ID_AC, "Action", "actions", IDTYPE_FLAGS_ISLINKABLE}, + { ID_AR, "Armature", "armatures", IDTYPE_FLAGS_ISLINKABLE}, + { ID_BR, "Brush", "brushes", IDTYPE_FLAGS_ISLINKABLE}, + { ID_CA, "Camera", "cameras", IDTYPE_FLAGS_ISLINKABLE}, + { ID_CU, "Curve", "curves", IDTYPE_FLAGS_ISLINKABLE}, + { ID_GD, "GPencil", "gpencil", IDTYPE_FLAGS_ISLINKABLE}, /* rename gpencil */ + { ID_GR, "Group", "groups", IDTYPE_FLAGS_ISLINKABLE}, + { ID_ID, "ID", "ids", 0}, /* plural is fake */ + { ID_IM, "Image", "images", IDTYPE_FLAGS_ISLINKABLE}, + { ID_IP, "Ipo", "ipos", IDTYPE_FLAGS_ISLINKABLE}, /* deprecated */ + { ID_KE, "Key", "keys", 0}, + { ID_LA, "Lamp", "lamps", IDTYPE_FLAGS_ISLINKABLE}, + { ID_LI, "Library", "libraries", 0}, + { ID_LT, "Lattice", "lattices", IDTYPE_FLAGS_ISLINKABLE}, + { ID_MA, "Material", "materials", IDTYPE_FLAGS_ISLINKABLE}, + { ID_MB, "Metaball", "metaballs", IDTYPE_FLAGS_ISLINKABLE}, + { ID_ME, "Mesh", "meshes", IDTYPE_FLAGS_ISLINKABLE}, + { ID_NT, "NodeTree", "node_groups", IDTYPE_FLAGS_ISLINKABLE}, + { ID_OB, "Object", "objects", IDTYPE_FLAGS_ISLINKABLE}, + { ID_PA, "ParticleSettings", "particles", 0}, + { ID_SCE, "Scene", "scenes", IDTYPE_FLAGS_ISLINKABLE}, + { ID_SCR, "Screen", "screens", 0}, + { ID_SEQ, "Sequence", "sequences", 0}, /* not actually ID data */ + { ID_SO, "Sound", "sounds", IDTYPE_FLAGS_ISLINKABLE}, + { ID_TE, "Texture", "textures", IDTYPE_FLAGS_ISLINKABLE}, + { ID_TXT, "Text", "texts", IDTYPE_FLAGS_ISLINKABLE}, + { ID_VF, "VFont", "fonts", IDTYPE_FLAGS_ISLINKABLE}, + { ID_WO, "World", "worlds", IDTYPE_FLAGS_ISLINKABLE}, + { ID_WM, "WindowManager", "window_managers", 0}, +}; +static int nidtypes= sizeof(idtypes)/sizeof(idtypes[0]); + +static IDType *idtype_from_name(const char *str) +{ + int i= nidtypes; + + while (i--) + if (strcmp(str, idtypes[i].name)==0) + return &idtypes[i]; + + return NULL; +} +static IDType *idtype_from_code(int code) +{ + int i= nidtypes; + + while (i--) + if (code==idtypes[i].code) + return &idtypes[i]; + + return NULL; +} + +int BKE_idcode_is_valid(int code) +{ + return idtype_from_code(code)?1:0; +} + +int BKE_idcode_is_linkable(int code) { + IDType *idt= idtype_from_code(code); + return idt?(idt->flags&IDTYPE_FLAGS_ISLINKABLE):0; +} + +const char *BKE_idcode_to_name(int code) +{ + IDType *idt= idtype_from_code(code); + + return idt?idt->name:NULL; +} + +int BKE_idcode_from_name(const char *name) +{ + IDType *idt= idtype_from_name(name); + + return idt?idt->code:0; +} + +const char *BKE_idcode_to_name_plural(int code) +{ + IDType *idt= idtype_from_code(code); + + return idt?idt->plural:NULL; +} diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index 2ccb33b088a..a0df73d6c42 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -27,6 +27,7 @@ #include <stdio.h> #include <stdlib.h> +#include <stddef.h> #include <string.h> #include "BKE_idprop.h" @@ -491,47 +492,41 @@ void IDP_ReplaceGroupInGroup(IDProperty *dest, IDProperty *src) void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop) { IDProperty *loop; - for (loop=group->data.group.first; loop; loop=loop->next) { - if (BSTR_EQ(loop->name, prop->name)) { - BLI_insertlink(&group->data.group, loop, prop); - - BLI_remlink(&group->data.group, loop); - IDP_FreeProperty(loop); - MEM_freeN(loop); - return; - } + if((loop= IDP_GetPropertyFromGroup(group, prop->name))) { + BLI_insertlink(&group->data.group, loop, prop); + + BLI_remlink(&group->data.group, loop); + IDP_FreeProperty(loop); + MEM_freeN(loop); + } + else { + group->len++; + BLI_addtail(&group->data.group, prop); } - - group->len++; - BLI_addtail(&group->data.group, prop); } /*returns 0 if an id property with the same name exists and it failed, or 1 if it succeeded in adding to the group.*/ int IDP_AddToGroup(IDProperty *group, IDProperty *prop) { - IDProperty *loop; - for (loop=group->data.group.first; loop; loop=loop->next) { - if (BSTR_EQ(loop->name, prop->name)) return 0; + if(IDP_GetPropertyFromGroup(group, prop->name) == NULL) { + group->len++; + BLI_addtail(&group->data.group, prop); + return 1; } - group->len++; - BLI_addtail(&group->data.group, prop); - - return 1; + return 0; } int IDP_InsertToGroup(IDProperty *group, IDProperty *previous, IDProperty *pnew) { - IDProperty *loop; - for (loop=group->data.group.first; loop; loop=loop->next) { - if (BSTR_EQ(loop->name, pnew->name)) return 0; + if(IDP_GetPropertyFromGroup(group, pnew->name) == NULL) { + group->len++; + BLI_insertlink(&group->data.group, previous, pnew); + return 1; } - - group->len++; - BLI_insertlink(&group->data.group, previous, pnew); - return 1; + return 0; } void IDP_RemFromGroup(IDProperty *group, IDProperty *prop) @@ -542,11 +537,7 @@ void IDP_RemFromGroup(IDProperty *group, IDProperty *prop) IDProperty *IDP_GetPropertyFromGroup(IDProperty *prop, const char *name) { - IDProperty *loop; - for (loop=prop->data.group.first; loop; loop=loop->next) { - if (strcmp(loop->name, name)==0) return loop; - } - return NULL; + return (IDProperty *)BLI_findstring(&prop->data.group, name, offsetof(IDProperty, name)); } typedef struct IDPIter { diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index 354b3b0e7d8..f4b931ec52b 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -1850,9 +1850,12 @@ void vertcos_to_key(Object *ob, KeyBlock *kb, float (*vertCos)[3]) tot= count_curveverts(&cu->nurb); } - fp= kb->data= MEM_callocN(tot*elemsize, "key_to_vertcos vertCos"); + if (tot == 0) { + kb->data= NULL; + return; + } - if (tot == 0) return; + fp= kb->data= MEM_callocN(tot*elemsize, "key_to_vertcos vertCos"); /* Copy coords to keyblock */ diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 8d2ad49e7bf..b053d615756 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -1265,13 +1265,13 @@ void BKE_nlastrip_validate_name (AnimData *adt, NlaStrip *strip) char *dot; /* Strip off the suffix */ - dot = strchr(strip->name, '.'); + dot = strrchr(strip->name, '.'); if (dot) *dot=0; /* Try different possibilities */ for (number = 1; number <= 999; number++) { /* assemble alternative name */ - BLI_snprintf(tempname, 128, "%s%c%03d", strip->name, ".", number); + BLI_snprintf(tempname, 128, "%s.%03d", strip->name, number); /* if hash doesn't have this, set it */ if (BLI_ghash_haskey(gh, tempname) == 0) { diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 36c23216585..ea30b33655f 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -1855,9 +1855,8 @@ static void node_group_execute(bNodeStack *stack, void *data, bNode *gnode, bNod /* for groups, only execute outputs for edited group */ if(node->typeinfo->nclass==NODE_CLASS_OUTPUT) { - if(gnode->flag & NODE_GROUP_EDIT) - if(node->flag & NODE_DO_OUTPUT) - node->typeinfo->execfunc(data, node, nsin, nsout); + if(node->type==CMP_NODE_OUTPUT_FILE || (gnode->flag & NODE_GROUP_EDIT)) + node->typeinfo->execfunc(data, node, nsin, nsout); } else node->typeinfo->execfunc(data, node, nsin, nsout); diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 18eedd63906..115cfac7627 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -2501,7 +2501,7 @@ void object_handle_update(Scene *scene, Object *ob) /* includes all keys and modifiers */ if(ob->type==OB_MESH) { - EditMesh *em = BKE_mesh_get_editmesh(ob->data); + EditMesh *em = (ob == scene->obedit)? BKE_mesh_get_editmesh(ob->data): NULL; /* evaluate drivers */ // XXX: should we push this to derivedmesh instead? diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 0d7738353df..4c85656dd91 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -69,6 +69,8 @@ static int ccgDM_getVertMapIndex(CCGSubSurf *ss, CCGVert *v); static int ccgDM_getEdgeMapIndex(CCGSubSurf *ss, CCGEdge *e); static int ccgDM_getFaceMapIndex(CCGSubSurf *ss, CCGFace *f); +static int ccgDM_use_grid_pbvh(CCGDerivedMesh *ccgdm); + /// static void *arena_alloc(CCGAllocatorHDL a, int numBytes) { @@ -1249,7 +1251,7 @@ static void ccgDM_glNormalFast(float *a, float *b, float *c, float *d) static void ccgdm_pbvh_update(CCGDerivedMesh *ccgdm) { - if(ccgdm->pbvh && ccgdm->multires.mmd) { + if(ccgdm->pbvh && ccgDM_use_grid_pbvh(ccgdm)) { CCGFace **faces; int totface; diff --git a/source/blender/blenlib/BLI_listbase.h b/source/blender/blenlib/BLI_listbase.h index 599487354c3..c4dc0894f80 100644 --- a/source/blender/blenlib/BLI_listbase.h +++ b/source/blender/blenlib/BLI_listbase.h @@ -45,6 +45,7 @@ void BLI_insertlink(struct ListBase *listbase, void *vprevlink, void *vnewlink); void *BLI_findlink(struct ListBase *listbase, int number); int BLI_findindex(struct ListBase *listbase, void *vlink); void *BLI_findstring(struct ListBase *listbase, const char *id, int offset); +void *BLI_findstring_ptr(struct ListBase *listbase, const char *id, int offset); int BLI_findstringindex(struct ListBase *listbase, const char *id, int offset); void BLI_freelistN(struct ListBase *listbase); void BLI_addtail(struct ListBase *listbase, void *vlink); diff --git a/source/blender/blenlib/Makefile b/source/blender/blenlib/Makefile index ae8a5afd0ba..d4dcfaeeabf 100644 --- a/source/blender/blenlib/Makefile +++ b/source/blender/blenlib/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/blenlib/intern/Makefile b/source/blender/blenlib/intern/Makefile index 7ef44aff881..018fd3477df 100644 --- a/source/blender/blenlib/intern/Makefile +++ b/source/blender/blenlib/intern/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c index 0a6831558d1..776f2d085df 100644 --- a/source/blender/blenlib/intern/listbase.c +++ b/source/blender/blenlib/intern/listbase.c @@ -374,6 +374,27 @@ void *BLI_findstring(ListBase *listbase, const char *id, int offset) return NULL; } +void *BLI_findstring_ptr(ListBase *listbase, const char *id, int offset) +{ + Link *link= NULL; + const char *id_iter; + + if (listbase == NULL) return NULL; + + link= listbase->first; + while (link) { + /* exact copy of BLI_findstring(), except for this line */ + id_iter= *((const char **)(((const char *)link) + offset)); + + if(id[0] == id_iter[0] && strcmp(id, id_iter)==0) + return link; + + link= link->next; + } + + return NULL; +} + int BLI_findstringindex(ListBase *listbase, const char *id, int offset) { Link *link= NULL; diff --git a/source/blender/blenlib/intern/math_geom_inline.c b/source/blender/blenlib/intern/math_geom_inline.c index 697ac8dc782..f2d8e27cbd5 100644 --- a/source/blender/blenlib/intern/math_geom_inline.c +++ b/source/blender/blenlib/intern/math_geom_inline.c @@ -15,7 +15,7 @@ * * 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. + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 260f59aa03c..cf773d575e5 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -586,7 +586,7 @@ int BLI_path_abs(char *path, const char *basepath) BLI_strncpy(tmp, path, FILE_MAX); } #else - BLI_strncpy(tmp, path, FILE_MAX); + BLI_strncpy(tmp, path, sizeof(tmp)); /* Check for loading a windows path on a posix system * in this case, there is no use in trying C:/ since it @@ -603,7 +603,7 @@ int BLI_path_abs(char *path, const char *basepath) #endif - BLI_strncpy(base, basepath, FILE_MAX); + BLI_strncpy(base, basepath, sizeof(base)); BLI_cleanup_file(NULL, base); @@ -626,13 +626,13 @@ int BLI_path_abs(char *path, const char *basepath) BLI_strncpy(path, tmp+2, FILE_MAX); memcpy(tmp, base, baselen); - strcpy(tmp+baselen, path); - strcpy(path, tmp); + BLI_strncpy(tmp+baselen, path, sizeof(tmp)-baselen); + BLI_strncpy(path, tmp, FILE_MAX); } else { - strcpy(path, tmp+2); + BLI_strncpy(path, tmp+2, FILE_MAX); } } else { - strcpy(path, tmp); + BLI_strncpy(path, tmp, FILE_MAX); } if (path[0]!='\0') { @@ -1162,7 +1162,7 @@ void BLI_make_existing_file(char *name) { char di[FILE_MAXDIR+FILE_MAXFILE], fi[FILE_MAXFILE]; - strcpy(di, name); + BLI_strncpy(di, name, sizeof(di)); BLI_splitdirstring(di, fi); /* test exist */ diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index edb6aecabb1..80310b1ef8a 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -237,8 +237,19 @@ void BLI_builddir(char *dirname, char *relname) if (newnum){ - if (files) files=(struct direntry *)realloc(files,(totnum+newnum) * sizeof(struct direntry)); - else files=(struct direntry *)malloc(newnum * sizeof(struct direntry)); + if(files) { + void *tmp= realloc(files, (totnum+newnum) * sizeof(struct direntry)); + if(tmp) { + files= (struct direntry *)tmp; + } + else { /* realloc fail */ + free(files); + files= NULL; + } + } + + if(files==NULL) + files=(struct direntry *)malloc(newnum * sizeof(struct direntry)); if (files){ dlink = (struct dirlink *) dirbase->first; diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h index d6418f426c8..eeced13b57b 100644 --- a/source/blender/blenloader/BLO_readfile.h +++ b/source/blender/blenloader/BLO_readfile.h @@ -111,38 +111,6 @@ BlendFileData *BLO_read_from_memfile(struct Main *oldmain, const char *filename, void BLO_blendfiledata_free( BlendFileData *bfd); - -/** - * Convert an idcode into a name. - * - * @param code The code to convert. - * @return A static string representing the name of - * the code. - */ - char* -BLO_idcode_to_name( - int code); - -/** - * Convert an idcode into a name (plural). - * - * @param code The code to convert. - * @return A static string representing the name of - * the code. - */ - char* -BLO_idcode_to_name_plural( - int code); - -/** - * Convert a name into an idcode (ie. ID_SCE) - * - * @param name The name to convert. - * @return The code for the name, or 0 if invalid. - */ - int -BLO_idcode_from_name( - char *name); /** * Open a blendhandle from a file path. diff --git a/source/blender/blenloader/Makefile b/source/blender/blenloader/Makefile index 4ffc558f889..069bad4d371 100644 --- a/source/blender/blenloader/Makefile +++ b/source/blender/blenloader/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/blenloader/intern/Makefile b/source/blender/blenloader/intern/Makefile index f4690fcc066..fe178ea2610 100644 --- a/source/blender/blenloader/intern/Makefile +++ b/source/blender/blenloader/intern/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index 6101012203a..d66d802c8ee 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -46,6 +46,7 @@ #include "BKE_main.h" #include "BKE_library.h" // for free_main +#include "BKE_idcode.h" #include "BKE_report.h" #include "BLO_readfile.h" @@ -61,111 +62,9 @@ #include "BLI_winstuff.h" #endif - /** - * IDType stuff, I plan to move this - * out into its own file + prefix, and - * make sure all IDType handling goes through - * these routines. - */ - -typedef struct { - unsigned short code; - char *name, *plural; - - int flags; -#define IDTYPE_FLAGS_ISLINKABLE (1<<0) -} IDType; - -/* plural need to match rna_main.c's MainCollectionDef */ -static IDType idtypes[]= { - { ID_AC, "Action", "actions", IDTYPE_FLAGS_ISLINKABLE}, - { ID_AR, "Armature", "armatures", IDTYPE_FLAGS_ISLINKABLE}, - { ID_BR, "Brush", "brushes", IDTYPE_FLAGS_ISLINKABLE}, - { ID_CA, "Camera", "cameras", IDTYPE_FLAGS_ISLINKABLE}, - { ID_CU, "Curve", "curves", IDTYPE_FLAGS_ISLINKABLE}, - { ID_GD, "GPencil", "gpencil", IDTYPE_FLAGS_ISLINKABLE}, /* rename gpencil */ - { ID_GR, "Group", "groups", IDTYPE_FLAGS_ISLINKABLE}, - { ID_ID, "ID", "ids", 0}, /* plural is fake */ - { ID_IM, "Image", "images", IDTYPE_FLAGS_ISLINKABLE}, - { ID_IP, "Ipo", "ipos", IDTYPE_FLAGS_ISLINKABLE}, /* deprecated */ - { ID_KE, "Key", "keys", 0}, - { ID_LA, "Lamp", "lamps", IDTYPE_FLAGS_ISLINKABLE}, - { ID_LI, "Library", "libraries", 0}, - { ID_LT, "Lattice", "lattices", IDTYPE_FLAGS_ISLINKABLE}, - { ID_MA, "Material", "materials", IDTYPE_FLAGS_ISLINKABLE}, - { ID_MB, "Metaball", "metaballs", IDTYPE_FLAGS_ISLINKABLE}, - { ID_ME, "Mesh", "meshes", IDTYPE_FLAGS_ISLINKABLE}, - { ID_NT, "NodeTree", "node_groups", IDTYPE_FLAGS_ISLINKABLE}, - { ID_OB, "Object", "objects", IDTYPE_FLAGS_ISLINKABLE}, - { ID_PA, "ParticleSettings", "particles", 0}, - { ID_SCE, "Scene", "scenes", IDTYPE_FLAGS_ISLINKABLE}, - { ID_SCR, "Screen", "screens", 0}, - { ID_SEQ, "Sequence", "sequences", 0}, /* not actually ID data */ - { ID_SO, "Sound", "sounds", IDTYPE_FLAGS_ISLINKABLE}, - { ID_TE, "Texture", "textures", IDTYPE_FLAGS_ISLINKABLE}, - { ID_TXT, "Text", "texts", IDTYPE_FLAGS_ISLINKABLE}, - { ID_VF, "VFont", "fonts", IDTYPE_FLAGS_ISLINKABLE}, - { ID_WO, "World", "worlds", IDTYPE_FLAGS_ISLINKABLE}, - { ID_WM, "WindowManager", "window_managers", 0}, -}; -static int nidtypes= sizeof(idtypes)/sizeof(idtypes[0]); - /* local prototypes --------------------- */ void BLO_blendhandle_print_sizes(BlendHandle *, void *); - -static IDType *idtype_from_name(char *str) -{ - int i= nidtypes; - - while (i--) - if (BLI_streq(str, idtypes[i].name)) - return &idtypes[i]; - - return NULL; -} -static IDType *idtype_from_code(int code) -{ - int i= nidtypes; - - while (i--) - if (code==idtypes[i].code) - return &idtypes[i]; - - return NULL; -} - -static int bheadcode_is_idcode(int code) -{ - return idtype_from_code(code)?1:0; -} - -static int idcode_is_linkable(int code) { - IDType *idt= idtype_from_code(code); - return idt?(idt->flags&IDTYPE_FLAGS_ISLINKABLE):0; -} - -char *BLO_idcode_to_name(int code) -{ - IDType *idt= idtype_from_code(code); - - return idt?idt->name:NULL; -} - -int BLO_idcode_from_name(char *name) -{ - IDType *idt= idtype_from_name(name); - - return idt?idt->code:0; -} - -char *BLO_idcode_to_name_plural(int code) -{ - IDType *idt= idtype_from_code(code); - - return idt?idt->plural:NULL; -} - /* Access routines used by filesel. */ BlendHandle *BLO_blendhandle_from_file(char *file) @@ -308,13 +207,13 @@ LinkNode *BLO_blendhandle_get_linkable_groups(BlendHandle *bh) for (bhead= blo_firstbhead(fd); bhead; bhead= blo_nextbhead(fd, bhead)) { if (bhead->code==ENDB) { break; - } else if (bheadcode_is_idcode(bhead->code)) { - if (idcode_is_linkable(bhead->code)) { - char *str= BLO_idcode_to_name(bhead->code); + } else if (BKE_idcode_is_valid(bhead->code)) { + if (BKE_idcode_is_linkable(bhead->code)) { + const char *str= BKE_idcode_to_name(bhead->code); - if (!BLI_ghash_haskey(gathered, str)) { + if (!BLI_ghash_haskey(gathered, (void *)str)) { BLI_linklist_prepend(&names, strdup(str)); - BLI_ghash_insert(gathered, str, NULL); + BLI_ghash_insert(gathered, (void *)str, NULL); } } } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index e36b73189e6..c67375d8aa2 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -105,6 +105,7 @@ #include "BKE_image.h" #include "BKE_lattice.h" #include "BKE_library.h" // for which_libbase +#include "BKE_idcode.h" #include "BKE_main.h" // for Main #include "BKE_mesh.h" // for ME_ defines (patching) #include "BKE_modifier.h" @@ -4106,8 +4107,9 @@ static void composite_patch(bNodeTree *ntree, Scene *scene) static void link_paint(FileData *fd, Scene *sce, Paint *p) { - if(p && p->brush) { + if(p) { p->brush= newlibadr_us(fd, sce->id.lib, p->brush); + p->paint_cursor= NULL; } } @@ -12592,8 +12594,8 @@ static void read_libraries(FileData *basefd, ListBase *mainlist) append_id_part(fd, mainptr, id, &realid); if (!realid) { - BKE_reportf(fd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath); - if(!G.background && basefd->reports) printf("LIB ERROR: %s:'%s' missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath); + BKE_reportf(fd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' missing from '%s'\n", BKE_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath); + if(!G.background && basefd->reports) printf("LIB ERROR: %s:'%s' missing from '%s'\n", BKE_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath); } change_idid_adr(mainlist, basefd, id, realid); @@ -12628,8 +12630,8 @@ static void read_libraries(FileData *basefd, ListBase *mainlist) ID *idn= id->next; if(id->flag & LIB_READ) { BLI_remlink(lbarray[a], id); - BKE_reportf(basefd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath); - if(!G.background && basefd->reports)printf("LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath); + BKE_reportf(basefd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BKE_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath); + if(!G.background && basefd->reports)printf("LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BKE_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath); change_idid_adr(mainlist, basefd, id, NULL); MEM_freeN(id); diff --git a/source/blender/blenpluginapi/Makefile b/source/blender/blenpluginapi/Makefile index 83678309b45..c91161d8cfd 100644 --- a/source/blender/blenpluginapi/Makefile +++ b/source/blender/blenpluginapi/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/blenpluginapi/intern/Makefile b/source/blender/blenpluginapi/intern/Makefile index 20a61e9a25c..696462f3f46 100644 --- a/source/blender/blenpluginapi/intern/Makefile +++ b/source/blender/blenpluginapi/intern/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/collada/Makefile b/source/blender/collada/Makefile index 3b5f09594de..d4cc18d22b6 100644 --- a/source/blender/collada/Makefile +++ b/source/blender/collada/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2008 Blender Foundation. # All rights reserved. diff --git a/source/blender/collada/SConscript b/source/blender/collada/SConscript index b86e7312698..91c3a381272 100644 --- a/source/blender/collada/SConscript +++ b/source/blender/collada/SConscript @@ -14,7 +14,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2006, Blender Foundation # All rights reserved. diff --git a/source/blender/editors/Makefile b/source/blender/editors/Makefile index e259168a4ef..168d919e6de 100644 --- a/source/blender/editors/Makefile +++ b/source/blender/editors/Makefile @@ -17,7 +17,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) Blender Foundation. # All rights reserved. diff --git a/source/blender/editors/animation/Makefile b/source/blender/editors/animation/Makefile index a7f36aa58ac..f120091e917 100644 --- a/source/blender/editors/animation/Makefile +++ b/source/blender/editors/animation/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/armature/Makefile b/source/blender/editors/armature/Makefile index 4838282de92..707ceb55246 100644 --- a/source/blender/editors/armature/Makefile +++ b/source/blender/editors/armature/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/curve/Makefile b/source/blender/editors/curve/Makefile index 6449700e50b..d9c51c7420e 100644 --- a/source/blender/editors/curve/Makefile +++ b/source/blender/editors/curve/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/datafiles/Makefile b/source/blender/editors/datafiles/Makefile index d7bb4e7222f..c76014df60e 100644 --- a/source/blender/editors/datafiles/Makefile +++ b/source/blender/editors/datafiles/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/gpencil/Makefile b/source/blender/editors/gpencil/Makefile index 9bc5f491a83..f3e781a0369 100644 --- a/source/blender/editors/gpencil/Makefile +++ b/source/blender/editors/gpencil/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/interface/Makefile b/source/blender/editors/interface/Makefile index 115740a8403..7b5d4e60fbd 100644 --- a/source/blender/editors/interface/Makefile +++ b/source/blender/editors/interface/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 7179ef96dc0..2a9a1335b1f 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -1146,7 +1146,7 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *wcol, rcti *rect) glColor4fv( &cbd->r ); glVertex2fv(v1); glVertex2fv(v2); - for( a = 1; a < sizex; a++ ) { + for( a = 1; a <= sizex; a++ ) { pos = ((float)a) / (sizex-1); do_colorband( coba, pos, colf ); if (but->block->color_profile != BLI_PR_NONE) @@ -1163,19 +1163,8 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *wcol, rcti *rect) glDisable(GL_BLEND); /* outline */ - v1[0]= x1; v1[1]= y1; - - cpack(0x0); - glBegin(GL_LINE_LOOP); - glVertex2fv(v1); - v1[0]+= sizex; - glVertex2fv(v1); - v1[1]+= sizey; - glVertex2fv(v1); - v1[0]-= sizex; - glVertex2fv(v1); - glEnd(); - + glColor4f(0.0, 0.0, 0.0, 1.0); + fdrawbox(x1, y1, x1+sizex, y1+sizey); /* help lines */ v1[0]= v2[0]=v3[0]= x1; @@ -1231,6 +1220,7 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *wcol, rcti *rect) } } glEnd(); + } void ui_draw_but_NORMAL(uiBut *but, uiWidgetColors *wcol, rcti *rect) diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index e1a760628b0..8dcc204f06f 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -4262,7 +4262,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event) return WM_UI_HANDLER_BREAK; } /* reset to default */ - else if(event->type == ZEROKEY && event->val == KM_PRESS) { + else if(ELEM(event->type, ZEROKEY,PAD0) && event->val == KM_PRESS) { if (!(ELEM3(but->type, HSVCIRCLE, HSVCUBE, HISTOGRAM))) ui_set_but_default(C, but); } diff --git a/source/blender/editors/mesh/Makefile b/source/blender/editors/mesh/Makefile index 8ae40e1b957..be57f72329a 100644 --- a/source/blender/editors/mesh/Makefile +++ b/source/blender/editors/mesh/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/metaball/Makefile b/source/blender/editors/metaball/Makefile index d971ec9b412..c28ef59e9db 100644 --- a/source/blender/editors/metaball/Makefile +++ b/source/blender/editors/metaball/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/object/Makefile b/source/blender/editors/object/Makefile index 7c081355ed5..4694653b115 100644 --- a/source/blender/editors/object/Makefile +++ b/source/blender/editors/object/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index 98252723816..a03d1a29333 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -225,11 +225,11 @@ static void bake_update(void *bkv) static void bake_freejob(void *bkv) { BakeRender *bkr= bkv; - BLI_end_threads(&bkr->threads); finish_bake_internal(bkr); if(bkr->tot==0) BKE_report(bkr->reports, RPT_ERROR, "No Images found to bake to"); MEM_freeN(bkr); + G.rendering = 0; } /* catch esc */ @@ -269,6 +269,7 @@ static int objects_bake_render_invoke(bContext *C, wmOperator *op, wmEvent *_eve WM_jobs_callbacks(steve, bake_startjob, NULL, bake_update, NULL); G.afbreek= 0; + G.rendering = 1; WM_jobs_start(CTX_wm_manager(C), steve); diff --git a/source/blender/editors/physics/Makefile b/source/blender/editors/physics/Makefile index e9260b66087..9ffc3a5b372 100644 --- a/source/blender/editors/physics/Makefile +++ b/source/blender/editors/physics/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/render/Makefile b/source/blender/editors/render/Makefile index 85b70172e0a..510e5372e22 100644 --- a/source/blender/editors/render/Makefile +++ b/source/blender/editors/render/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index ae34dc967f5..2561a2c8dbc 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -791,7 +791,7 @@ void BIF_view3d_previewrender(Main *bmain, Scene *scene, ScrArea *sa) lay |= v3d->lay; else lay= v3d->lay; - RE_Database_FromScene(re, scene, lay, 0); // 0= dont use camera view + RE_Database_FromScene(re, bmain, scene, lay, 0); // 0= dont use camera view rstats= RE_GetStats(re); if(rstats->convertdone) diff --git a/source/blender/editors/screen/Makefile b/source/blender/editors/screen/Makefile index 23c9d130eec..2ab35a32888 100644 --- a/source/blender/editors/screen/Makefile +++ b/source/blender/editors/screen/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/sculpt_paint/Makefile b/source/blender/editors/sculpt_paint/Makefile index 012a39b8d25..f9f39fea7eb 100644 --- a/source/blender/editors/sculpt_paint/Makefile +++ b/source/blender/editors/sculpt_paint/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/sound/Makefile b/source/blender/editors/sound/Makefile index 10145035eb4..211fcfb9a4c 100644 --- a/source/blender/editors/sound/Makefile +++ b/source/blender/editors/sound/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_action/Makefile b/source/blender/editors/space_action/Makefile index e856587acca..19aeb54cc2f 100644 --- a/source/blender/editors/space_action/Makefile +++ b/source/blender/editors/space_action/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_api/Makefile b/source/blender/editors/space_api/Makefile index 474fbe89053..deaa46a9582 100644 --- a/source/blender/editors/space_api/Makefile +++ b/source/blender/editors/space_api/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_buttons/Makefile b/source/blender/editors/space_buttons/Makefile index a4894ede06b..28758fb168b 100644 --- a/source/blender/editors/space_buttons/Makefile +++ b/source/blender/editors/space_buttons/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_console/Makefile b/source/blender/editors/space_console/Makefile index 3f760b1ad67..4ae157507e0 100644 --- a/source/blender/editors/space_console/Makefile +++ b/source/blender/editors/space_console/Makefile @@ -17,7 +17,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2009 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c index f5d913e9f32..4ee69bbd809 100644 --- a/source/blender/editors/space_console/space_console.c +++ b/source/blender/editors/space_console/space_console.c @@ -35,13 +35,12 @@ #include "MEM_guardedalloc.h" -#include "BLO_readfile.h" /* get the ID name for dnd*/ - #include "BLI_blenlib.h" #include "BLI_math.h" #include "BKE_context.h" #include "BKE_screen.h" +#include "BKE_idcode.h" #include "ED_screen.h" @@ -177,7 +176,7 @@ static void id_drop_copy(wmDrag *drag, wmDropBox *drop) char text[64]; ID *id= drag->poin; - snprintf(text, sizeof(text), "bpy.data.%s['%s']", BLO_idcode_to_name_plural(GS(id->name)), id->name+2); + snprintf(text, sizeof(text), "bpy.data.%s['%s']", BKE_idcode_to_name_plural(GS(id->name)), id->name+2); /* copy drag path to properties */ RNA_string_set(drop->ptr, "text", text); diff --git a/source/blender/editors/space_file/Makefile b/source/blender/editors/space_file/Makefile index 48f6879b029..1fc27795f08 100644 --- a/source/blender/editors/space_file/Makefile +++ b/source/blender/editors/space_file/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 22c5270ae6d..f25fab45c7c 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -426,21 +426,25 @@ static void renamebutton_cb(bContext *C, void *arg1, char *oldname) SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); ARegion* ar = CTX_wm_region(C); +#if 0 struct direntry *file = (struct direntry *)arg1; +#endif BLI_make_file_string(G.sce, orgname, sfile->params->dir, oldname); - BLI_strncpy(filename, file->relname, sizeof(filename)); + BLI_strncpy(filename, sfile->params->renameedit, sizeof(filename)); BLI_make_file_string(G.sce, newname, sfile->params->dir, filename); if( strcmp(orgname, newname) != 0 ) { if (!BLI_exists(newname)) { BLI_rename(orgname, newname); /* to make sure we show what is on disk */ +#if 0 /* this is cleared anyway, no need */ + MEM_freeN(file->relname); + file->relname= BLI_strdup(sfile->params->renameedit); +#endif ED_fileselect_clear(C, sfile); - } else { - BLI_strncpy(file->relname, oldname, strlen(oldname)+1); } - + ED_region_tag_redraw(ar); } } @@ -535,7 +539,7 @@ void file_draw_list(const bContext *C, ARegion *ar) int but_width = (FILE_IMGDISPLAY == params->display) ? layout->tile_w : layout->column_widths[COLUMN_NAME]; uiBut *but = uiDefBut(block, TEX, 1, "", spos, sy-layout->tile_h-3, - but_width, layout->textheight*2, file->relname, 1.0f, (float)FILE_MAX,0,0,""); + but_width, layout->textheight*2, sfile->params->renameedit, 1.0f, (float)sizeof(sfile->params->renameedit),0,0,""); uiButSetRenameFunc(but, renamebutton_cb, file); if ( 0 == uiButActiveOnly(C, block, but)) { file->flags &= ~EDITING; diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 2664082b20b..c3bea2a5bea 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -57,6 +57,7 @@ #include "BKE_main.h" #include "BKE_report.h" #include "BLO_readfile.h" +#include "BKE_idcode.h" #include "DNA_space_types.h" @@ -881,7 +882,7 @@ static int groupname_to_code(char *group) if (lslash) lslash[0]= '\0'; - return BLO_idcode_from_name(buf); + return BKE_idcode_from_name(buf); } void filelist_from_library(struct FileList* filelist) diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 8783296f5c2..0dbd1048348 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -62,8 +62,6 @@ #include "BLI_storage_types.h" #include "BLI_dynstr.h" -#include "BLO_readfile.h" - #include "BKE_context.h" #include "BKE_global.h" diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 2f023aeebc1..7b9423332f2 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -232,6 +232,7 @@ static void file_refresh(const bContext *C, ScrArea *sa) file->flags |= EDITING; } } + BLI_strncpy(sfile->params->renameedit, sfile->params->renamefile, sizeof(sfile->params->renameedit)); params->renamefile[0] = '\0'; } if (sfile->layout) sfile->layout->dirty= 1; diff --git a/source/blender/editors/space_graph/Makefile b/source/blender/editors/space_graph/Makefile index 65cdf1a3ffb..633242355f0 100644 --- a/source/blender/editors/space_graph/Makefile +++ b/source/blender/editors/space_graph/Makefile @@ -17,7 +17,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_image/Makefile b/source/blender/editors/space_image/Makefile index 1838b9ce73d..773a6920961 100644 --- a/source/blender/editors/space_image/Makefile +++ b/source/blender/editors/space_image/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index be2782ab25c..314d5dd9043 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -739,7 +739,22 @@ static int open_exec(bContext *C, wmOperator *op) static int open_invoke(bContext *C, wmOperator *op, wmEvent *event) { SpaceImage *sima= CTX_wm_space_image(C); - char *path= (sima && sima->image)? sima->image->name: U.textudir; + char *path=U.textudir; + Image *ima= NULL; + + if(sima) { + ima= sima->image; + } + + if (ima==NULL) { + Tex *tex= CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data; + if(tex && tex->type==TEX_IMAGE) + ima= tex->ima; + } + + if(ima) + path= ima->name; + if(!RNA_property_is_set(op->ptr, "relative_path")) RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); diff --git a/source/blender/editors/space_info/Makefile b/source/blender/editors/space_info/Makefile index 931c2f2097c..46feeec8613 100644 --- a/source/blender/editors/space_info/Makefile +++ b/source/blender/editors/space_info/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_logic/Makefile b/source/blender/editors/space_logic/Makefile index 90cd73bd62a..9b72e132be8 100644 --- a/source/blender/editors/space_logic/Makefile +++ b/source/blender/editors/space_logic/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 12d566a3ab7..790eac7aa27 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -3929,7 +3929,7 @@ static void draw_actuator_filter_2d(uiLayout *layout, PointerRNA *ptr) split=uiLayoutSplit(layout, 0.75, 1); row= uiLayoutRow(split, 0); uiLayoutSetActive(row, RNA_boolean_get(ptr, "enable_motion_blur")==1); - uiItemR(row, ptr, "motion_blur_value", 0, NULL, 0); + uiItemR(row, ptr, "motion_blur_factor", 0, NULL, 0); uiItemR(split, ptr, "enable_motion_blur", UI_ITEM_R_TOGGLE, NULL, 0); break; default: // all other 2D Filters diff --git a/source/blender/editors/space_nla/Makefile b/source/blender/editors/space_nla/Makefile index d7c9477dc83..fd940081c16 100644 --- a/source/blender/editors/space_nla/Makefile +++ b/source/blender/editors/space_nla/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index 3e0ec5afac2..d834fb07ee7 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -384,20 +384,22 @@ static int nlaedit_add_tracks_exec (bContext *C, wmOperator *op) /* add tracks... */ for (ale= anim_data.first; ale; ale= ale->next) { - NlaTrack *nlt= (NlaTrack *)ale->data; - AnimData *adt= ale->adt; - - /* check if just adding a new track above this one, - * or whether we're adding a new one to the top of the stack that this one belongs to - */ - if (above_sel) { - /* just add a new one above this one */ - add_nlatrack(adt, nlt); - } - else if ((lastAdt == NULL) || (adt != lastAdt)) { - /* add one track to the top of the owning AnimData's stack, then don't add anymore to this stack */ - add_nlatrack(adt, NULL); - lastAdt= adt; + if(ale->type == ANIMTYPE_NLATRACK) { + NlaTrack *nlt= (NlaTrack *)ale->data; + AnimData *adt= ale->adt; + + /* check if just adding a new track above this one, + * or whether we're adding a new one to the top of the stack that this one belongs to + */ + if (above_sel) { + /* just add a new one above this one */ + add_nlatrack(adt, nlt); + } + else if ((lastAdt == NULL) || (adt != lastAdt)) { + /* add one track to the top of the owning AnimData's stack, then don't add anymore to this stack */ + add_nlatrack(adt, NULL); + lastAdt= adt; + } } } @@ -450,11 +452,13 @@ static int nlaedit_delete_tracks_exec (bContext *C, wmOperator *op) /* delete tracks */ for (ale= anim_data.first; ale; ale= ale->next) { - NlaTrack *nlt= (NlaTrack *)ale->data; - AnimData *adt= ale->adt; - - /* call delete on this track - deletes all strips too */ - free_nlatrack(&adt->nla_tracks, nlt); + if(ale->type == ANIMTYPE_NLATRACK) { + NlaTrack *nlt= (NlaTrack *)ale->data; + AnimData *adt= ale->adt; + + /* call delete on this track - deletes all strips too */ + free_nlatrack(&adt->nla_tracks, nlt); + } } /* free temp data */ diff --git a/source/blender/editors/space_node/Makefile b/source/blender/editors/space_node/Makefile index 5bd6e95e28c..6c12149a43f 100644 --- a/source/blender/editors/space_node/Makefile +++ b/source/blender/editors/space_node/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_outliner/Makefile b/source/blender/editors/space_outliner/Makefile index 8d7cd017e0b..bd6725c5b71 100644 --- a/source/blender/editors/space_outliner/Makefile +++ b/source/blender/editors/space_outliner/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_script/Makefile b/source/blender/editors/space_script/Makefile index 3322cb61a7f..35462b8c255 100644 --- a/source/blender/editors/space_script/Makefile +++ b/source/blender/editors/space_script/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_sequencer/Makefile b/source/blender/editors/space_sequencer/Makefile index 2fb3de516b4..bb1cbdf1cd3 100644 --- a/source/blender/editors/space_sequencer/Makefile +++ b/source/blender/editors/space_sequencer/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_sound/Makefile b/source/blender/editors/space_sound/Makefile index a072684d543..03764c97a96 100644 --- a/source/blender/editors/space_sound/Makefile +++ b/source/blender/editors/space_sound/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_text/Makefile b/source/blender/editors/space_text/Makefile index 50871017085..8bc12852e18 100644 --- a/source/blender/editors/space_text/Makefile +++ b/source/blender/editors/space_text/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 926ccc1914a..2e5bb4a63e0 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -111,8 +111,8 @@ static void flatten_string_append(FlattenString *fs, char c, int accum) nbuf= MEM_callocN(sizeof(*fs->buf)*fs->len, "fs->buf"); naccum= MEM_callocN(sizeof(*fs->accum)*fs->len, "fs->accum"); - memcpy(nbuf, fs->buf, fs->pos); - memcpy(naccum, fs->accum, fs->pos); + memcpy(nbuf, fs->buf, fs->pos * sizeof(*fs->buf)); + memcpy(naccum, fs->accum, fs->pos * sizeof(*fs->accum)); if(fs->buf != fs->fixedbuf) { MEM_freeN(fs->buf); @@ -1101,6 +1101,22 @@ static void draw_cursor(SpaceText *st, ARegion *ar) } } + if(st->line_hlight) { + y= ar->winy-2 - vsell*st->lheight; + if(!(y<0 || y > ar->winy)) { /* check we need to draw */ + int x1= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET; + int x2= x1 + ar->winx; + y= ar->winy-2 - vsell*st->lheight; + + glColor4ub(255, 255, 255, 32); + + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glRecti(x1-4, y, x2, y-st->lheight+1); + glDisable(GL_BLEND); + } + } + if(!hidden) { /* Draw the cursor itself (we draw the sel. cursor as this is the leading edge) */ x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET; @@ -1288,7 +1304,7 @@ void draw_text_main(SpaceText *st, ARegion *ar) } y= ar->winy-st->lheight; winx= ar->winx - TXT_SCROLL_WIDTH; - + /* draw cursor */ draw_cursor(st, ar); diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 0e0a9592104..d39056c6bbc 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -1709,6 +1709,8 @@ static int toggle_overwrite_exec(bContext *C, wmOperator *op) st->overwrite= !st->overwrite; + WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, st->text); + return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_time/Makefile b/source/blender/editors/space_time/Makefile index e0bf3943dd8..958c3018f82 100644 --- a/source/blender/editors/space_time/Makefile +++ b/source/blender/editors/space_time/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_userpref/Makefile b/source/blender/editors/space_userpref/Makefile index be7206f51ce..8510c355ab4 100644 --- a/source/blender/editors/space_userpref/Makefile +++ b/source/blender/editors/space_userpref/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_view3d/Makefile b/source/blender/editors/space_view3d/Makefile index 9204f2482c6..58d88194c22 100644 --- a/source/blender/editors/space_view3d/Makefile +++ b/source/blender/editors/space_view3d/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index aad91e74af9..334b72ee1ed 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -306,7 +306,10 @@ static int view3d_smoothview_invoke(bContext *C, wmOperator *op, wmEvent *event) if(rv3d->smooth_timer==NULL || rv3d->smooth_timer!=event->customdata) return OPERATOR_PASS_THROUGH; - step = (rv3d->smooth_timer->duration)/sms->time_allowed; + if(sms->time_allowed != 0.0f) + step = (rv3d->smooth_timer->duration)/sms->time_allowed; + else + step = 1.0f; /* end timer */ if(step >= 1.0f) { diff --git a/source/blender/editors/transform/Makefile b/source/blender/editors/transform/Makefile index 607038b413b..9d23b763cd6 100644 --- a/source/blender/editors/transform/Makefile +++ b/source/blender/editors/transform/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/util/Makefile b/source/blender/editors/util/Makefile index 303079daeee..8535b3fb402 100644 --- a/source/blender/editors/util/Makefile +++ b/source/blender/editors/util/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/uvedit/Makefile b/source/blender/editors/uvedit/Makefile index d589bbec3bc..e4b9ae72ccb 100644 --- a/source/blender/editors/uvedit/Makefile +++ b/source/blender/editors/uvedit/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/gpu/Makefile b/source/blender/gpu/Makefile index b9bde147115..eaa8a69bfdd 100644 --- a/source/blender/gpu/Makefile +++ b/source/blender/gpu/Makefile @@ -18,7 +18,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/gpu/intern/Makefile b/source/blender/gpu/intern/Makefile index 2637bff44ac..088b56edbab 100644 --- a/source/blender/gpu/intern/Makefile +++ b/source/blender/gpu/intern/Makefile @@ -18,7 +18,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/ikplugin/Makefile b/source/blender/ikplugin/Makefile index 370ed418464..28726586cc8 100644 --- a/source/blender/ikplugin/Makefile +++ b/source/blender/ikplugin/Makefile @@ -12,7 +12,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/ikplugin/intern/Makefile b/source/blender/ikplugin/intern/Makefile index 0c54e5d1264..352ab90df9d 100644 --- a/source/blender/ikplugin/intern/Makefile +++ b/source/blender/ikplugin/intern/Makefile @@ -12,7 +12,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/imbuf/Makefile b/source/blender/imbuf/Makefile index cc9b56b3cd8..78eea89173f 100644 --- a/source/blender/imbuf/Makefile +++ b/source/blender/imbuf/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/imbuf/intern/Makefile b/source/blender/imbuf/intern/Makefile index f3fa17385fe..8e7272100b9 100644 --- a/source/blender/imbuf/intern/Makefile +++ b/source/blender/imbuf/intern/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/imbuf/intern/cineon/Makefile b/source/blender/imbuf/intern/cineon/Makefile index 99a9a5dbd46..6e940d530a9 100644 --- a/source/blender/imbuf/intern/cineon/Makefile +++ b/source/blender/imbuf/intern/cineon/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/imbuf/intern/dds/Makefile b/source/blender/imbuf/intern/dds/Makefile index e14f9320d19..d4f04382899 100644 --- a/source/blender/imbuf/intern/dds/Makefile +++ b/source/blender/imbuf/intern/dds/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/imbuf/intern/openexr/Makefile b/source/blender/imbuf/intern/openexr/Makefile index 083089b11d5..820b2aeb003 100644 --- a/source/blender/imbuf/intern/openexr/Makefile +++ b/source/blender/imbuf/intern/openexr/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c index 1624e9c2b01..f3415d44ecb 100644 --- a/source/blender/imbuf/intern/thumbs.c +++ b/source/blender/imbuf/intern/thumbs.c @@ -248,8 +248,8 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im char tdir[FILE_MAX]; char temp[FILE_MAX]; char mtime[40]= "0"; /* incase we can't stat the file */ - char cwidth[40]; - char cheight[40]; + char cwidth[40]= "0"; /* incase images have no data */ + char cheight[40]= "0"; char thumb[40]; short tsize = 128; short ex, ey; @@ -264,7 +264,7 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im tsize = 256; break; case THB_FAIL: - tsize = 0; + tsize = 1; break; default: return 0; /* unknown size */ @@ -280,7 +280,7 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im return NULL; } if (size == THB_FAIL) { - img = IMB_allocImBuf(0,0,32, IB_rect | IB_metadata, 0); + img = IMB_allocImBuf(1,1,32, IB_rect | IB_metadata, 0); if (!img) return 0; } else { if (THB_SOURCE_IMAGE == source || THB_SOURCE_BLEND == source) { diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index 973ba896100..8537b703c69 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -346,5 +346,9 @@ typedef enum eBezTriple_KeyframeType { #define CU_CHINFO_SMALLCAPS (1<<4) #define CU_CHINFO_SMALLCAPS_CHECK (1<<5) /* set at runtime, checks if case switching is needed */ +/* mixed with KEY_LINEAR but define here since only curve supports */ +#define KEY_CU_EASE 3 + + #endif diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index e5308cccdfe..bf64bc27b48 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -161,6 +161,7 @@ typedef struct FileSelectParams { char dir[240]; /* directory */ char file[80]; /* file */ char renamefile[80]; + char renameedit[80]; /* annoying but the first is only used for initialization */ short type; /* XXXXX for now store type here, should be moved to the operator */ short flag; /* settings for filter, hiding dots files,... */ @@ -303,7 +304,8 @@ typedef struct SpaceText { int showlinenrs; int tabnumber; - int showsyntax; + short showsyntax; + short line_hlight; short overwrite; short live_edit; /* run python while editing, evil */ float pix_per_line; diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index e7a5a6e5f56..e9e058cbbd6 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -32,7 +32,7 @@ #define DNA_TEXTURE_TYPES_H #include "DNA_ID.h" -#include "DNA_image_types.h" +#include "DNA_image_types.h" /* ImageUser */ struct AnimData; struct Ipo; diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 7c8a24e9e8c..ceac7e4d1d7 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -33,7 +33,7 @@ #define DNA_USERDEF_TYPES_H #include "DNA_listBase.h" -#include "DNA_texture_types.h" +#include "DNA_texture_types.h" /* ColorBand */ /* themes; defines in BIF_resource.h */ struct ColorBand; diff --git a/source/blender/makesdna/Makefile b/source/blender/makesdna/Makefile index 82009d2b80a..f83a6288e8d 100644 --- a/source/blender/makesdna/Makefile +++ b/source/blender/makesdna/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/makesdna/intern/Makefile b/source/blender/makesdna/intern/Makefile index 01c4d87a4fc..55b0c42acda 100644 --- a/source/blender/makesdna/intern/Makefile +++ b/source/blender/makesdna/intern/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/makesrna/Makefile b/source/blender/makesrna/Makefile index bed3e85550d..2b025949d77 100644 --- a/source/blender/makesrna/Makefile +++ b/source/blender/makesrna/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # Contributor(s): Blender Foundation (2008). # diff --git a/source/blender/makesrna/intern/Makefile b/source/blender/makesrna/intern/Makefile index 4262a3538c2..f4ab4712faa 100644 --- a/source/blender/makesrna/intern/Makefile +++ b/source/blender/makesrna/intern/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # Contributor(s): Blender Foundation (2008). # diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index b15f736ac76..8e7a2a8cab3 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -23,6 +23,7 @@ */ #include <stdlib.h> +#include <stddef.h> #include <string.h> #include <ctype.h> @@ -258,14 +259,10 @@ int RNA_struct_idproperties_check(StructRNA *srna) static IDProperty *rna_idproperty_find(PointerRNA *ptr, const char *name) { IDProperty *group= RNA_struct_idproperties(ptr, 0); - IDProperty *idprop; - if(group) { - for(idprop=group->data.group.first; idprop; idprop=idprop->next) - if(strcmp(idprop->name, name) == 0) - return idprop; - } - + if(group) + return IDP_GetPropertyFromGroup(group, name); + return NULL; } @@ -577,9 +574,9 @@ FunctionRNA *RNA_struct_find_function(PointerRNA *ptr, const char *identifier) FunctionRNA *func; StructRNA *type; for(type= ptr->type; type; type= type->base) { - for(func= type->functions.first; func; func= func->cont.next) { - if(strcmp(func->identifier, identifier)==0) - return func; + func= BLI_findstring_ptr(&type->functions, identifier, offsetof(FunctionRNA, identifier)); + if(func) { + return func; } } return NULL; @@ -3592,7 +3589,8 @@ int RNA_property_is_set(PointerRNA *ptr, const char *name) return 1; } else { - // printf("RNA_property_is_set: %s.%s not found.\n", ptr->type->identifier, name); + /* python raises an error */ + /* printf("RNA_property_is_set: %s.%s not found.\n", ptr->type->identifier, name); */ return 0; } } @@ -3777,27 +3775,12 @@ int RNA_function_defined(FunctionRNA *func) PropertyRNA *RNA_function_get_parameter(PointerRNA *ptr, FunctionRNA *func, int index) { - PropertyRNA *parm; - int i; - - parm= func->cont.properties.first; - for(i= 0; parm; parm= parm->next, i++) - if(i==index) - return parm; - - return NULL; + return BLI_findlink(&func->cont.properties, index); } PropertyRNA *RNA_function_find_parameter(PointerRNA *ptr, FunctionRNA *func, const char *identifier) { - PropertyRNA *parm; - - parm= func->cont.properties.first; - for(; parm; parm= parm->next) - if(strcmp(parm->identifier, identifier)==0) - return parm; - - return NULL; + return BLI_findstring(&func->cont.properties, identifier, offsetof(PropertyRNA, identifier)); } const struct ListBase *RNA_function_defined_parameters(FunctionRNA *func) @@ -3813,18 +3796,18 @@ ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *ptr, void *data; int alloc_size= 0, size; - parms->arg_count= 0; - parms->ret_count= 0; - + parms->arg_count= 0; + parms->ret_count= 0; + /* allocate data */ for(parm= func->cont.properties.first; parm; parm= parm->next) { alloc_size += rna_parameter_size_alloc(parm); - if(parm->flag & PROP_OUTPUT) - parms->ret_count++; - else - parms->arg_count++; - } + if(parm->flag & PROP_OUTPUT) + parms->ret_count++; + else + parms->arg_count++; + } parms->data= MEM_callocN(alloc_size, "RNA_parameter_list_create"); parms->func= func; diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index 077b8ffe199..fb51fa26395 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -526,7 +526,7 @@ static void rna_def_histogram(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_mode_items[] = { - {HISTO_MODE_LUMA, "Luma", ICON_COLOR, "Luma", ""}, + {HISTO_MODE_LUMA, "LUMA", ICON_COLOR, "Luma", ""}, {HISTO_MODE_RGB, "RGB", ICON_COLOR, "Red Green Blue", ""}, {HISTO_MODE_R, "R", ICON_COLOR, "Red", ""}, {HISTO_MODE_G, "G", ICON_COLOR, "Green", ""}, diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 2cd7953d878..d513b13c923 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -29,6 +29,7 @@ #include "rna_internal.h" #include "DNA_curve_types.h" +#include "DNA_key_types.h" #include "DNA_material_types.h" #include "DNA_scene_types.h" @@ -1252,10 +1253,10 @@ static void rna_def_curve(BlenderRNA *brna) static void rna_def_curve_nurb(BlenderRNA *brna) { static EnumPropertyItem spline_interpolation_items[] = { - {BEZT_IPO_CONST, "LINEAR", 0, "Linear", ""}, - {BEZT_IPO_LIN, "CARDINAL", 0, "Cardinal", ""}, - {BEZT_IPO_BEZ, "BSPLINE", 0, "BSpline", ""}, - {BEZT_IPO_BEZ, "EASE", 0, "Ease", ""}, + {KEY_LINEAR, "LINEAR", 0, "Linear", ""}, + {KEY_CARDINAL, "CARDINAL", 0, "Cardinal", ""}, + {KEY_BSPLINE, "BSPLINE", 0, "BSpline", ""}, + {KEY_CU_EASE, "EASE", 0, "Ease", ""}, /* todo, define somewhere, not one of BEZT_IPO_* */ {0, NULL, 0, NULL, NULL}}; StructRNA *srna; diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index 3930c2ff3f7..510b69d7f46 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -257,12 +257,12 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna) prop= RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "animStart"); RNA_def_property_range(prop, 0, 100); - RNA_def_property_ui_text(prop, "Start Time", "Simulation time of the first blender frame"); + RNA_def_property_ui_text(prop, "Start Time", "Simulation time of the first blender frame (in seconds)"); prop= RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "animEnd"); RNA_def_property_range(prop, 0, 100); - RNA_def_property_ui_text(prop, "End Time", "Simulation time of the last blender frame"); + RNA_def_property_ui_text(prop, "End Time", "Simulation time of the last blender frame (in seconds)"); prop= RNA_def_property(srna, "real_world_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "realsize"); diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index efe3d39d6cd..70438ae3d8c 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -77,6 +77,8 @@ static void rna_Image_save_render(Image *image, bContext *C, ReportList *reports if (!BKE_write_ibuf(NULL, ibuf, path, scene->r.imtype, scene->r.subimtype, scene->r.quality)) { BKE_reportf(reports, RPT_ERROR, "Couldn't write image: %s", path); } + + BKE_image_release_ibuf(image, lock); } else { BKE_reportf(reports, RPT_ERROR, "Scene not in context, couldn't get save parameters"); } diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index ee38505d792..91385742f77 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -2115,10 +2115,10 @@ static void rna_def_dupli_object(BlenderRNA *brna) /* RNA_def_property_pointer_funcs(prop, "rna_DupliObject_object_get", NULL, NULL, NULL); */ RNA_def_property_ui_text(prop, "Object", "Object being duplicated"); - prop= RNA_def_property(srna, "object_matrix", PROP_FLOAT, PROP_MATRIX); + prop= RNA_def_property(srna, "matrix_original", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "omat"); RNA_def_property_array(prop, 16); - RNA_def_property_ui_text(prop, "Object Matrix", "Duplicated object transformation matrix"); + RNA_def_property_ui_text(prop, "Object Matrix", "The original matrix of this object before it was duplicated"); prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "mat"); diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index f921595304d..45dc7fadd94 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -205,8 +205,8 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "diss_speed"); - RNA_def_property_range(prop, 1.0, 100.0); - RNA_def_property_ui_range(prop, 1.0, 1000.0, 1, 0); + RNA_def_property_range(prop, 1.0, 10000.0); + RNA_def_property_ui_range(prop, 1.0, 10000.0, 1, 0); RNA_def_property_ui_text(prop, "Dissolve Speed", "Dissolve Speed"); RNA_def_property_update(prop, 0, NULL); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 436e9f60dc7..d72eb25dd2f 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -567,31 +567,30 @@ static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value) } /* Space Console */ -static void rna_ConsoleLine_line_get(PointerRNA *ptr, char *value) +static void rna_ConsoleLine_body_get(PointerRNA *ptr, char *value) { ConsoleLine *ci= (ConsoleLine*)ptr->data; strcpy(value, ci->line); } -static int rna_ConsoleLine_line_length(PointerRNA *ptr) +static int rna_ConsoleLine_body_length(PointerRNA *ptr) { ConsoleLine *ci= (ConsoleLine*)ptr->data; return ci->len; } -static void rna_ConsoleLine_line_set(PointerRNA *ptr, const char *value) +static void rna_ConsoleLine_body_set(PointerRNA *ptr, const char *value) { ConsoleLine *ci= (ConsoleLine*)ptr->data; int len= strlen(value); - if(len < ci->len_alloc) { /* allocated size is enough? */ - strcpy(ci->line, value); - } - else { /* allocate a new strnig */ + if((len >= ci->len_alloc) || (len * 2 < ci->len_alloc) ) { /* allocate a new strnig */ MEM_freeN(ci->line); - ci->line= BLI_strdup(value); - ci->len_alloc= len; + ci->line= MEM_mallocN((len + 1) * sizeof(char), "rna_consoleline"); + ci->len_alloc= len + 1; } + + memcpy(ci->line, value, len + 1); ci->len= len; if(ci->cursor > len) /* clamp the cursor */ @@ -1536,31 +1535,28 @@ static void rna_def_space_text(BlenderRNA *brna) RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); /* display */ - prop= RNA_def_property(srna, "syntax_highlight", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "showsyntax", 0); - RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting"); - RNA_def_property_ui_icon(prop, ICON_SYNTAX_OFF, 1); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); - - prop= RNA_def_property(srna, "word_wrap", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "show_word_wrap", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "wordwrap", 0); RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceTextEditor_word_wrap_set"); RNA_def_property_ui_text(prop, "Word Wrap", "Wrap words if there is not enough horizontal space"); RNA_def_property_ui_icon(prop, ICON_WORDWRAP_OFF, 1); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); - prop= RNA_def_property(srna, "line_numbers", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "show_line_numbers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "showlinenrs", 0); RNA_def_property_ui_text(prop, "Line Numbers", "Show line numbers next to the text"); RNA_def_property_ui_icon(prop, ICON_LINENUMBERS_OFF, 1); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); - prop= RNA_def_property(srna, "overwrite", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, "Overwrite", "Overwrite characters when typing rather than inserting them"); + prop= RNA_def_property(srna, "show_syntax_highlight", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "showsyntax", 0); + RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting"); + RNA_def_property_ui_icon(prop, ICON_SYNTAX_OFF, 1); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); - prop= RNA_def_property(srna, "live_edit", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, "Live Edit", "Run python while editing"); + prop= RNA_def_property(srna, "show_line_highlight", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "line_hlight", 0); + RNA_def_property_ui_text(prop, "Highlight Line", "Highlight the current line"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); prop= RNA_def_property(srna, "tab_width", PROP_INT, PROP_NONE); @@ -1575,6 +1571,15 @@ static void rna_def_space_text(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); + /* functionality options */ + prop= RNA_def_property(srna, "overwrite", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_ui_text(prop, "Overwrite", "Overwrite characters when typing rather than inserting them"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); + + prop= RNA_def_property(srna, "live_edit", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_ui_text(prop, "Live Edit", "Run python while editing"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); + /* find */ prop= RNA_def_property(srna, "find_all", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_ALL); @@ -1925,8 +1930,8 @@ static void rna_def_console_line(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Console Input", "Input line for the interactive console"); // XXX using non-inited "prop", uh? RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL); - prop= RNA_def_property(srna, "line", PROP_STRING, PROP_NONE); - RNA_def_property_string_funcs(prop, "rna_ConsoleLine_line_get", "rna_ConsoleLine_line_length", "rna_ConsoleLine_line_set"); + prop= RNA_def_property(srna, "body", PROP_STRING, PROP_NONE); + RNA_def_property_string_funcs(prop, "rna_ConsoleLine_body_get", "rna_ConsoleLine_body_length", "rna_ConsoleLine_body_set"); RNA_def_property_ui_text(prop, "Line", "Text in the line"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL); diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c index d8651e5d05d..e8d1422d045 100644 --- a/source/blender/makesrna/intern/rna_text.c +++ b/source/blender/makesrna/intern/rna_text.c @@ -76,7 +76,7 @@ static int rna_Text_modified_get(PointerRNA *ptr) return text_file_modified(text); } -static void rna_TextLine_line_get(PointerRNA *ptr, char *value) +static void rna_TextLine_body_get(PointerRNA *ptr, char *value) { TextLine *line= (TextLine*)ptr->data; @@ -86,21 +86,23 @@ static void rna_TextLine_line_get(PointerRNA *ptr, char *value) strcpy(value, ""); } -static int rna_TextLine_line_length(PointerRNA *ptr) +static int rna_TextLine_body_length(PointerRNA *ptr) { TextLine *line= (TextLine*)ptr->data; return line->len; } -static void rna_TextLine_line_set(PointerRNA *ptr, const char *value) +static void rna_TextLine_body_set(PointerRNA *ptr, const char *value) { TextLine *line= (TextLine*)ptr->data; + int len= strlen(value); if(line->line) MEM_freeN(line->line); - - line->line= BLI_strdup(value); - line->len= strlen(line->line); + + line->line= MEM_mallocN((len + 1) * sizeof(char), "rna_text_body"); + line->len= len; + memcpy(line->line, value, len + 1); if(line->format) { MEM_freeN(line->format); @@ -118,8 +120,8 @@ static void rna_def_text_line(BlenderRNA *brna) srna = RNA_def_struct(brna, "TextLine", NULL); RNA_def_struct_ui_text(srna, "Text Line", "Line of text in a Text datablock"); - prop= RNA_def_property(srna, "line", PROP_STRING, PROP_NONE); - RNA_def_property_string_funcs(prop, "rna_TextLine_line_get", "rna_TextLine_line_length", "rna_TextLine_line_set"); + prop= RNA_def_property(srna, "body", PROP_STRING, PROP_NONE); + RNA_def_property_string_funcs(prop, "rna_TextLine_body_get", "rna_TextLine_body_length", "rna_TextLine_body_set"); RNA_def_property_ui_text(prop, "Line", "Text in the line"); RNA_def_property_update(prop, NC_TEXT|NA_EDITED, NULL); } diff --git a/source/blender/modifiers/MOD_modifiertypes.h b/source/blender/modifiers/MOD_modifiertypes.h index bd10b4aa6fc..a792b163eea 100644 --- a/source/blender/modifiers/MOD_modifiertypes.h +++ b/source/blender/modifiers/MOD_modifiertypes.h @@ -18,7 +18,7 @@ * * 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. + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Contributor(s): Ben Batt * diff --git a/source/blender/modifiers/Makefile b/source/blender/modifiers/Makefile index 4b2c4b0a036..ddcddb90186 100644 --- a/source/blender/modifiers/Makefile +++ b/source/blender/modifiers/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/modifiers/intern/MOD_none.c b/source/blender/modifiers/intern/MOD_none.c index 3a5dc4dce33..0c749b79f5a 100644 --- a/source/blender/modifiers/intern/MOD_none.c +++ b/source/blender/modifiers/intern/MOD_none.c @@ -18,7 +18,7 @@ * * 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. + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2005 Blender Foundation. * All rights reserved. diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c index 24b907dcfa8..59612d0cdae 100644 --- a/source/blender/modifiers/intern/MOD_util.c +++ b/source/blender/modifiers/intern/MOD_util.c @@ -18,7 +18,7 @@ * * 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. + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2005 Blender Foundation. * All rights reserved. diff --git a/source/blender/modifiers/intern/MOD_util.h b/source/blender/modifiers/intern/MOD_util.h index 9592a3ce123..5750e042199 100644 --- a/source/blender/modifiers/intern/MOD_util.h +++ b/source/blender/modifiers/intern/MOD_util.h @@ -18,7 +18,7 @@ * * 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. + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Contributor(s): Ben Batt * diff --git a/source/blender/modifiers/intern/Makefile b/source/blender/modifiers/intern/Makefile index 849bc11662e..94ea068a1bc 100644 --- a/source/blender/modifiers/intern/Makefile +++ b/source/blender/modifiers/intern/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/nodes/Makefile b/source/blender/nodes/Makefile index a173908aeb1..f997e640a17 100644 --- a/source/blender/nodes/Makefile +++ b/source/blender/nodes/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) Blender Foundation. # All rights reserved. diff --git a/source/blender/nodes/intern/CMP_nodes/Makefile b/source/blender/nodes/intern/CMP_nodes/Makefile index 5e8753570af..5e97864fb95 100644 --- a/source/blender/nodes/intern/CMP_nodes/Makefile +++ b/source/blender/nodes/intern/CMP_nodes/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/nodes/intern/Makefile b/source/blender/nodes/intern/Makefile index 08f4b936c76..1ffc09bce2c 100644 --- a/source/blender/nodes/intern/Makefile +++ b/source/blender/nodes/intern/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/nodes/intern/SHD_nodes/Makefile b/source/blender/nodes/intern/SHD_nodes/Makefile index b6b21d5f5f8..666ffd4a7d3 100644 --- a/source/blender/nodes/intern/SHD_nodes/Makefile +++ b/source/blender/nodes/intern/SHD_nodes/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/nodes/intern/TEX_nodes/Makefile b/source/blender/nodes/intern/TEX_nodes/Makefile index f42660bd562..74eabe7932a 100644 --- a/source/blender/nodes/intern/TEX_nodes/Makefile +++ b/source/blender/nodes/intern/TEX_nodes/Makefile @@ -18,7 +18,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/python/Makefile b/source/blender/python/Makefile index 8e2a04b8449..43b6f91369b 100644 --- a/source/blender/python/Makefile +++ b/source/blender/python/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) Blender Foundation. # All rights reserved. diff --git a/source/blender/python/doc/sphinx_doc_gen.py b/source/blender/python/doc/sphinx_doc_gen.py index 3dd61a32676..1355d2508a5 100644 --- a/source/blender/python/doc/sphinx_doc_gen.py +++ b/source/blender/python/doc/sphinx_doc_gen.py @@ -45,6 +45,7 @@ import rna_info reload(rna_info) # lame, python wont give some access +ClassMethodDescriptorType = type(dict.__dict__['fromkeys']) MethodDescriptorType = type(dict.get) GetSetDescriptorType = type(int.real) @@ -153,10 +154,10 @@ def py_descr2sphinx(ident, fw, descr, module_name, type_name, identifier): if type(descr) == GetSetDescriptorType: fw(ident + ".. attribute:: %s\n\n" % identifier) write_indented_lines(ident + " ", fw, doc, False) - elif type(descr) == MethodDescriptorType: # GetSetDescriptorType's are not documented yet + elif type(descr) in (MethodDescriptorType, ClassMethodDescriptorType): write_indented_lines(ident, fw, doc, False) else: - raise TypeError("type was not GetSetDescriptorType or MethodDescriptorType") + raise TypeError("type was not GetSetDescriptorType, MethodDescriptorType or ClassMethodDescriptorType") write_example_ref(ident, fw, module_name + "." + type_name + "." + identifier) fw("\n") @@ -270,7 +271,11 @@ def pymodule2sphinx(BASEPATH, module_name, module, title): descr_items = [(key, descr) for key, descr in sorted(value.__dict__.items()) if not key.startswith("__")] for key, descr in descr_items: - if type(descr) == MethodDescriptorType: # GetSetDescriptorType's are not documented yet + if type(descr) == ClassMethodDescriptorType: + py_descr2sphinx(" ", fw, descr, module_name, type_name, key) + + for key, descr in descr_items: + if type(descr) == MethodDescriptorType: py_descr2sphinx(" ", fw, descr, module_name, type_name, key) for key, descr in descr_items: diff --git a/source/blender/python/generic/Makefile b/source/blender/python/generic/Makefile index dc674478dab..0df98046f63 100644 --- a/source/blender/python/generic/Makefile +++ b/source/blender/python/generic/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/python/generic/mathutils.c b/source/blender/python/generic/mathutils.c index 2bfd9a6d0c6..ada5bac8c2a 100644 --- a/source/blender/python/generic/mathutils.c +++ b/source/blender/python/generic/mathutils.c @@ -46,6 +46,13 @@ * - Vector.toTrackQuat --> Vector.to_track_quat * - Quaternion * Quaternion --> cross product (not dot product) * + * moved into class functions. + * - Mathutils.RotationMatrix -> mathutils.Matrix.Rotation + * - Mathutils.ScaleMatrix -> mathutils.Matrix.Scale + * - Mathutils.ShearMatrix -> mathutils.Matrix.Shear + * - Mathutils.TranslationMatrix -> mathutils.Matrix.Translation + * - Mathutils.OrthoProjectionMatrix -> mathutils.Matrix.OrthoProjection + * * Moved to Geometry module: Intersect, TriangleArea, TriangleNormal, QuadNormal, LineIntersect */ @@ -94,434 +101,7 @@ int mathutils_array_parse(float *array, int array_min, int array_max, PyObject * } //----------------------------------MATRIX FUNCTIONS-------------------- -//----------------------------------mathutils.RotationMatrix() ---------- -//mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc. -static char M_Mathutils_RotationMatrix_doc[] = -".. function:: RotationMatrix(angle, size, axis)\n" -"\n" -" Create a matrix representing a rotation.\n" -"\n" -" :arg angle: The angle of rotation desired, in radians.\n" -" :type angle: float\n" -" :arg size: The size of the rotation matrix to construct [2, 4].\n" -" :type size: int\n" -" :arg axis: a string in ['X', 'Y', 'Z'] or a 3D Vector Object (optional when size is 2).\n" -" :type axis: string or :class:`Vector`\n" -" :return: A new rotation matrix.\n" -" :rtype: :class:`Matrix`\n"; - -static PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args) -{ - VectorObject *vec= NULL; - char *axis= NULL; - int matSize; - float angle = 0.0f; - float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; - - if(!PyArg_ParseTuple(args, "fi|O", &angle, &matSize, &vec)) { - PyErr_SetString(PyExc_TypeError, "mathutils.RotationMatrix(angle, size, axis): expected float int and a string or vector\n"); - return NULL; - } - - if(vec && !VectorObject_Check(vec)) { - axis= _PyUnicode_AsString((PyObject *)vec); - if(axis==NULL || axis[0]=='\0' || axis[1]!='\0' || axis[0] < 'X' || axis[0] > 'Z') { - PyErr_SetString(PyExc_TypeError, "mathutils.RotationMatrix(): 3rd argument axis value must be a 3D vector or a string in 'X', 'Y', 'Z'\n"); - return NULL; - } - else { - /* use the string */ - vec= NULL; - } - } - - while (angle<-(Py_PI*2)) - angle+=(Py_PI*2); - while (angle>(Py_PI*2)) - angle-=(Py_PI*2); - - if(matSize != 2 && matSize != 3 && matSize != 4) { - PyErr_SetString(PyExc_AttributeError, "mathutils.RotationMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); - return NULL; - } - if(matSize == 2 && (vec != NULL)) { - PyErr_SetString(PyExc_AttributeError, "mathutils.RotationMatrix(): cannot create a 2x2 rotation matrix around arbitrary axis\n"); - return NULL; - } - if((matSize == 3 || matSize == 4) && (axis == NULL) && (vec == NULL)) { - PyErr_SetString(PyExc_AttributeError, "mathutils.RotationMatrix(): please choose an axis of rotation for 3d and 4d matrices\n"); - return NULL; - } - if(vec) { - if(vec->size != 3) { - PyErr_SetString(PyExc_AttributeError, "mathutils.RotationMatrix(): the vector axis must be a 3D vector\n"); - return NULL; - } - - if(!BaseMath_ReadCallback(vec)) - return NULL; - - } - /* check for valid vector/axis above */ - if(vec) { - axis_angle_to_mat3( (float (*)[3])mat,vec->vec, angle); - } - else if(matSize == 2) { - //2D rotation matrix - mat[0] = (float) cos (angle); - mat[1] = (float) sin (angle); - mat[2] = -((float) sin(angle)); - mat[3] = (float) cos(angle); - } else if(strcmp(axis, "X") == 0) { - //rotation around X - mat[0] = 1.0f; - mat[4] = (float) cos(angle); - mat[5] = (float) sin(angle); - mat[7] = -((float) sin(angle)); - mat[8] = (float) cos(angle); - } else if(strcmp(axis, "Y") == 0) { - //rotation around Y - mat[0] = (float) cos(angle); - mat[2] = -((float) sin(angle)); - mat[4] = 1.0f; - mat[6] = (float) sin(angle); - mat[8] = (float) cos(angle); - } else if(strcmp(axis, "Z") == 0) { - //rotation around Z - mat[0] = (float) cos(angle); - mat[1] = (float) sin(angle); - mat[3] = -((float) sin(angle)); - mat[4] = (float) cos(angle); - mat[8] = 1.0f; - } - else { - /* should never get here */ - PyErr_SetString(PyExc_AttributeError, "mathutils.RotationMatrix(): unknown error\n"); - return NULL; - } - - if(matSize == 4) { - //resize matrix - mat[10] = mat[8]; - mat[9] = mat[7]; - mat[8] = mat[6]; - mat[7] = 0.0f; - mat[6] = mat[5]; - mat[5] = mat[4]; - mat[4] = mat[3]; - mat[3] = 0.0f; - } - //pass to matrix creation - return newMatrixObject(mat, matSize, matSize, Py_NEW, NULL); -} - -static char M_Mathutils_TranslationMatrix_doc[] = -".. function:: TranslationMatrix(vector)\n" -"\n" -" Create a matrix representing a translation.\n" -"\n" -" :arg vector: The translation vector.\n" -" :type vector: :class:`Vector`\n" -" :return: An identity matrix with a translation.\n" -" :rtype: :class:`Matrix`\n"; - -static PyObject *M_Mathutils_TranslationMatrix(PyObject * self, VectorObject * vec) -{ - float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; - - if(!VectorObject_Check(vec)) { - PyErr_SetString(PyExc_TypeError, "mathutils.TranslationMatrix(): expected vector\n"); - return NULL; - } - if(vec->size != 3 && vec->size != 4) { - PyErr_SetString(PyExc_TypeError, "mathutils.TranslationMatrix(): vector must be 3D or 4D\n"); - return NULL; - } - - if(!BaseMath_ReadCallback(vec)) - return NULL; - - //create a identity matrix and add translation - unit_m4((float(*)[4]) mat); - mat[12] = vec->vec[0]; - mat[13] = vec->vec[1]; - mat[14] = vec->vec[2]; - - return newMatrixObject(mat, 4, 4, Py_NEW, NULL); -} -//----------------------------------mathutils.ScaleMatrix() ------------- -//mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc. -static char M_Mathutils_ScaleMatrix_doc[] = -".. function:: ScaleMatrix(factor, size, axis)\n" -"\n" -" Create a matrix representing a scaling.\n" -"\n" -" :arg factor: The factor of scaling to apply.\n" -" :type factor: float\n" -" :arg size: The size of the scale matrix to construct [2, 4].\n" -" :type size: int\n" -" :arg axis: Direction to influence scale. (optional).\n" -" :type axis: :class:`Vector`\n" -" :return: A new scale matrix.\n" -" :rtype: :class:`Matrix`\n"; - -static PyObject *M_Mathutils_ScaleMatrix(PyObject * self, PyObject * args) -{ - VectorObject *vec = NULL; - float norm = 0.0f, factor; - int matSize, x; - float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; - - if(!PyArg_ParseTuple(args, "fi|O!", &factor, &matSize, &vector_Type, &vec)) { - PyErr_SetString(PyExc_TypeError, "mathutils.ScaleMatrix(): expected float int and optional vector\n"); - return NULL; - } - if(matSize != 2 && matSize != 3 && matSize != 4) { - PyErr_SetString(PyExc_AttributeError, "mathutils.ScaleMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); - return NULL; - } - if(vec) { - if(vec->size > 2 && matSize == 2) { - PyErr_SetString(PyExc_AttributeError, "mathutils.ScaleMatrix(): please use 2D vectors when scaling in 2D\n"); - return NULL; - } - - if(!BaseMath_ReadCallback(vec)) - return NULL; - - } - if(vec == NULL) { //scaling along axis - if(matSize == 2) { - mat[0] = factor; - mat[3] = factor; - } else { - mat[0] = factor; - mat[4] = factor; - mat[8] = factor; - } - } else { //scaling in arbitrary direction - //normalize arbitrary axis - for(x = 0; x < vec->size; x++) { - norm += vec->vec[x] * vec->vec[x]; - } - norm = (float) sqrt(norm); - for(x = 0; x < vec->size; x++) { - vec->vec[x] /= norm; - } - if(matSize == 2) { - mat[0] = 1 +((factor - 1) *(vec->vec[0] * vec->vec[0])); - mat[1] =((factor - 1) *(vec->vec[0] * vec->vec[1])); - mat[2] =((factor - 1) *(vec->vec[0] * vec->vec[1])); - mat[3] = 1 + ((factor - 1) *(vec->vec[1] * vec->vec[1])); - } else { - mat[0] = 1 + ((factor - 1) *(vec->vec[0] * vec->vec[0])); - mat[1] =((factor - 1) *(vec->vec[0] * vec->vec[1])); - mat[2] =((factor - 1) *(vec->vec[0] * vec->vec[2])); - mat[3] =((factor - 1) *(vec->vec[0] * vec->vec[1])); - mat[4] = 1 + ((factor - 1) *(vec->vec[1] * vec->vec[1])); - mat[5] =((factor - 1) *(vec->vec[1] * vec->vec[2])); - mat[6] =((factor - 1) *(vec->vec[0] * vec->vec[2])); - mat[7] =((factor - 1) *(vec->vec[1] * vec->vec[2])); - mat[8] = 1 + ((factor - 1) *(vec->vec[2] * vec->vec[2])); - } - } - if(matSize == 4) { - //resize matrix - mat[10] = mat[8]; - mat[9] = mat[7]; - mat[8] = mat[6]; - mat[7] = 0.0f; - mat[6] = mat[5]; - mat[5] = mat[4]; - mat[4] = mat[3]; - mat[3] = 0.0f; - } - //pass to matrix creation - return newMatrixObject(mat, matSize, matSize, Py_NEW, NULL); -} -//----------------------------------mathutils.OrthoProjectionMatrix() --- -//mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc. -static char M_Mathutils_OrthoProjectionMatrix_doc[] = -".. function:: OrthoProjectionMatrix(plane, size, axis)\n" -"\n" -" Create a matrix to represent an orthographic projection.\n" -"\n" -" :arg plane: Can be any of the following: ['X', 'Y', 'XY', 'XZ', 'YZ', 'R'], where a single axis is for a 2D matrix and 'R' requires axis is given.\n" -" :type plane: string\n" -" :arg size: The size of the projection matrix to construct [2, 4].\n" -" :type size: int\n" -" :arg axis: Arbitrary perpendicular plane vector (optional).\n" -" :type axis: :class:`Vector`\n" -" :return: A new projection matrix.\n" -" :rtype: :class:`Matrix`\n"; -static PyObject *M_Mathutils_OrthoProjectionMatrix(PyObject * self, PyObject * args) -{ - VectorObject *vec = NULL; - char *plane; - int matSize, x; - float norm = 0.0f; - float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; - - if(!PyArg_ParseTuple(args, "si|O!", &plane, &matSize, &vector_Type, &vec)) { - PyErr_SetString(PyExc_TypeError, "mathutils.OrthoProjectionMatrix(): expected string and int and optional vector\n"); - return NULL; - } - if(matSize != 2 && matSize != 3 && matSize != 4) { - PyErr_SetString(PyExc_AttributeError,"mathutils.OrthoProjectionMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); - return NULL; - } - if(vec) { - if(vec->size > 2 && matSize == 2) { - PyErr_SetString(PyExc_AttributeError, "mathutils.OrthoProjectionMatrix(): please use 2D vectors when scaling in 2D\n"); - return NULL; - } - - if(!BaseMath_ReadCallback(vec)) - return NULL; - - } - if(vec == NULL) { //ortho projection onto cardinal plane - if((strcmp(plane, "X") == 0) && matSize == 2) { - mat[0] = 1.0f; - } else if((strcmp(plane, "Y") == 0) && matSize == 2) { - mat[3] = 1.0f; - } else if((strcmp(plane, "XY") == 0) && matSize > 2) { - mat[0] = 1.0f; - mat[4] = 1.0f; - } else if((strcmp(plane, "XZ") == 0) && matSize > 2) { - mat[0] = 1.0f; - mat[8] = 1.0f; - } else if((strcmp(plane, "YZ") == 0) && matSize > 2) { - mat[4] = 1.0f; - mat[8] = 1.0f; - } else { - PyErr_SetString(PyExc_AttributeError, "mathutils.OrthoProjectionMatrix(): unknown plane - expected: X, Y, XY, XZ, YZ\n"); - return NULL; - } - } else { //arbitrary plane - //normalize arbitrary axis - for(x = 0; x < vec->size; x++) { - norm += vec->vec[x] * vec->vec[x]; - } - norm = (float) sqrt(norm); - for(x = 0; x < vec->size; x++) { - vec->vec[x] /= norm; - } - if((strcmp(plane, "R") == 0) && matSize == 2) { - mat[0] = 1 - (vec->vec[0] * vec->vec[0]); - mat[1] = -(vec->vec[0] * vec->vec[1]); - mat[2] = -(vec->vec[0] * vec->vec[1]); - mat[3] = 1 - (vec->vec[1] * vec->vec[1]); - } else if((strcmp(plane, "R") == 0) && matSize > 2) { - mat[0] = 1 - (vec->vec[0] * vec->vec[0]); - mat[1] = -(vec->vec[0] * vec->vec[1]); - mat[2] = -(vec->vec[0] * vec->vec[2]); - mat[3] = -(vec->vec[0] * vec->vec[1]); - mat[4] = 1 - (vec->vec[1] * vec->vec[1]); - mat[5] = -(vec->vec[1] * vec->vec[2]); - mat[6] = -(vec->vec[0] * vec->vec[2]); - mat[7] = -(vec->vec[1] * vec->vec[2]); - mat[8] = 1 - (vec->vec[2] * vec->vec[2]); - } else { - PyErr_SetString(PyExc_AttributeError, "mathutils.OrthoProjectionMatrix(): unknown plane - expected: 'r' expected for axis designation\n"); - return NULL; - } - } - if(matSize == 4) { - //resize matrix - mat[10] = mat[8]; - mat[9] = mat[7]; - mat[8] = mat[6]; - mat[7] = 0.0f; - mat[6] = mat[5]; - mat[5] = mat[4]; - mat[4] = mat[3]; - mat[3] = 0.0f; - } - //pass to matrix creation - return newMatrixObject(mat, matSize, matSize, Py_NEW, NULL); -} - -static char M_Mathutils_ShearMatrix_doc[] = -".. function:: ShearMatrix(plane, factor, size)\n" -"\n" -" Create a matrix to represent an shear transformation.\n" -"\n" -" :arg plane: Can be any of the following: ['X', 'Y', 'XY', 'XZ', 'YZ'], where a single axis is for a 2D matrix.\n" -" :type plane: string\n" -" :arg factor: The factor of shear to apply.\n" -" :type factor: float\n" -" :arg size: The size of the shear matrix to construct [2, 4].\n" -" :type size: int\n" -" :return: A new shear matrix.\n" -" :rtype: :class:`Matrix`\n"; - -static PyObject *M_Mathutils_ShearMatrix(PyObject * self, PyObject * args) -{ - int matSize; - char *plane; - float factor; - float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; - - if(!PyArg_ParseTuple(args, "sfi", &plane, &factor, &matSize)) { - PyErr_SetString(PyExc_TypeError,"mathutils.ShearMatrix(): expected string float and int\n"); - return NULL; - } - if(matSize != 2 && matSize != 3 && matSize != 4) { - PyErr_SetString(PyExc_AttributeError,"mathutils.ShearMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); - return NULL; - } - - if((strcmp(plane, "X") == 0) - && matSize == 2) { - mat[0] = 1.0f; - mat[2] = factor; - mat[3] = 1.0f; - } else if((strcmp(plane, "Y") == 0) && matSize == 2) { - mat[0] = 1.0f; - mat[1] = factor; - mat[3] = 1.0f; - } else if((strcmp(plane, "XY") == 0) && matSize > 2) { - mat[0] = 1.0f; - mat[4] = 1.0f; - mat[6] = factor; - mat[7] = factor; - } else if((strcmp(plane, "XZ") == 0) && matSize > 2) { - mat[0] = 1.0f; - mat[3] = factor; - mat[4] = 1.0f; - mat[5] = factor; - mat[8] = 1.0f; - } else if((strcmp(plane, "YZ") == 0) && matSize > 2) { - mat[0] = 1.0f; - mat[1] = factor; - mat[2] = factor; - mat[4] = 1.0f; - mat[8] = 1.0f; - } else { - PyErr_SetString(PyExc_AttributeError, "mathutils.ShearMatrix(): expected: x, y, xy, xz, yz or wrong matrix size for shearing plane\n"); - return NULL; - } - if(matSize == 4) { - //resize matrix - mat[10] = mat[8]; - mat[9] = mat[7]; - mat[8] = mat[6]; - mat[7] = 0.0f; - mat[6] = mat[5]; - mat[5] = mat[4]; - mat[4] = mat[3]; - mat[3] = 0.0f; - } - //pass to matrix creation - return newMatrixObject(mat, matSize, matSize, Py_NEW, NULL); -} /* Utility functions */ @@ -647,11 +227,6 @@ void BaseMathObject_dealloc(BaseMathObject * self) /*----------------------------MODULE INIT-------------------------*/ struct PyMethodDef M_Mathutils_methods[] = { - {"RotationMatrix", (PyCFunction) M_Mathutils_RotationMatrix, METH_VARARGS, M_Mathutils_RotationMatrix_doc}, - {"ScaleMatrix", (PyCFunction) M_Mathutils_ScaleMatrix, METH_VARARGS, M_Mathutils_ScaleMatrix_doc}, - {"ShearMatrix", (PyCFunction) M_Mathutils_ShearMatrix, METH_VARARGS, M_Mathutils_ShearMatrix_doc}, - {"TranslationMatrix", (PyCFunction) M_Mathutils_TranslationMatrix, METH_O, M_Mathutils_TranslationMatrix_doc}, - {"OrthoProjectionMatrix", (PyCFunction) M_Mathutils_OrthoProjectionMatrix, METH_VARARGS, M_Mathutils_OrthoProjectionMatrix_doc}, {NULL, NULL, 0, NULL} }; diff --git a/source/blender/python/generic/mathutils_matrix.c b/source/blender/python/generic/mathutils_matrix.c index d54ee9a30ec..24239e1f541 100644 --- a/source/blender/python/generic/mathutils_matrix.c +++ b/source/blender/python/generic/mathutils_matrix.c @@ -181,6 +181,438 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds) return newMatrixObject(matrix, argSize, seqSize, Py_NEW, NULL); } +/*-----------------------CLASS-METHODS----------------------------*/ + +//----------------------------------mathutils.RotationMatrix() ---------- +//mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc. +static char C_Matrix_Rotation_doc[] = +".. classmethod:: Rotation(angle, size, axis)\n" +"\n" +" Create a matrix representing a rotation.\n" +"\n" +" :arg angle: The angle of rotation desired, in radians.\n" +" :type angle: float\n" +" :arg size: The size of the rotation matrix to construct [2, 4].\n" +" :type size: int\n" +" :arg axis: a string in ['X', 'Y', 'Z'] or a 3D Vector Object (optional when size is 2).\n" +" :type axis: string or :class:`Vector`\n" +" :return: A new rotation matrix.\n" +" :rtype: :class:`Matrix`\n"; + +static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args) +{ + VectorObject *vec= NULL; + char *axis= NULL; + int matSize; + float angle = 0.0f; + float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; + + if(!PyArg_ParseTuple(args, "fi|O", &angle, &matSize, &vec)) { + PyErr_SetString(PyExc_TypeError, "mathutils.RotationMatrix(angle, size, axis): expected float int and a string or vector\n"); + return NULL; + } + + if(vec && !VectorObject_Check(vec)) { + axis= _PyUnicode_AsString((PyObject *)vec); + if(axis==NULL || axis[0]=='\0' || axis[1]!='\0' || axis[0] < 'X' || axis[0] > 'Z') { + PyErr_SetString(PyExc_TypeError, "mathutils.RotationMatrix(): 3rd argument axis value must be a 3D vector or a string in 'X', 'Y', 'Z'\n"); + return NULL; + } + else { + /* use the string */ + vec= NULL; + } + } + + while (angle<-(Py_PI*2)) + angle+=(Py_PI*2); + while (angle>(Py_PI*2)) + angle-=(Py_PI*2); + + if(matSize != 2 && matSize != 3 && matSize != 4) { + PyErr_SetString(PyExc_AttributeError, "mathutils.RotationMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); + return NULL; + } + if(matSize == 2 && (vec != NULL)) { + PyErr_SetString(PyExc_AttributeError, "mathutils.RotationMatrix(): cannot create a 2x2 rotation matrix around arbitrary axis\n"); + return NULL; + } + if((matSize == 3 || matSize == 4) && (axis == NULL) && (vec == NULL)) { + PyErr_SetString(PyExc_AttributeError, "mathutils.RotationMatrix(): please choose an axis of rotation for 3d and 4d matrices\n"); + return NULL; + } + if(vec) { + if(vec->size != 3) { + PyErr_SetString(PyExc_AttributeError, "mathutils.RotationMatrix(): the vector axis must be a 3D vector\n"); + return NULL; + } + + if(!BaseMath_ReadCallback(vec)) + return NULL; + + } + + /* check for valid vector/axis above */ + if(vec) { + axis_angle_to_mat3( (float (*)[3])mat,vec->vec, angle); + } + else if(matSize == 2) { + //2D rotation matrix + mat[0] = (float) cos (angle); + mat[1] = (float) sin (angle); + mat[2] = -((float) sin(angle)); + mat[3] = (float) cos(angle); + } else if(strcmp(axis, "X") == 0) { + //rotation around X + mat[0] = 1.0f; + mat[4] = (float) cos(angle); + mat[5] = (float) sin(angle); + mat[7] = -((float) sin(angle)); + mat[8] = (float) cos(angle); + } else if(strcmp(axis, "Y") == 0) { + //rotation around Y + mat[0] = (float) cos(angle); + mat[2] = -((float) sin(angle)); + mat[4] = 1.0f; + mat[6] = (float) sin(angle); + mat[8] = (float) cos(angle); + } else if(strcmp(axis, "Z") == 0) { + //rotation around Z + mat[0] = (float) cos(angle); + mat[1] = (float) sin(angle); + mat[3] = -((float) sin(angle)); + mat[4] = (float) cos(angle); + mat[8] = 1.0f; + } + else { + /* should never get here */ + PyErr_SetString(PyExc_AttributeError, "mathutils.RotationMatrix(): unknown error\n"); + return NULL; + } + + if(matSize == 4) { + //resize matrix + mat[10] = mat[8]; + mat[9] = mat[7]; + mat[8] = mat[6]; + mat[7] = 0.0f; + mat[6] = mat[5]; + mat[5] = mat[4]; + mat[4] = mat[3]; + mat[3] = 0.0f; + } + //pass to matrix creation + return newMatrixObject(mat, matSize, matSize, Py_NEW, (PyTypeObject *)cls); +} + + +static char C_Matrix_Translation_doc[] = +".. classmethod:: Translation(vector)\n" +"\n" +" Create a matrix representing a translation.\n" +"\n" +" :arg vector: The translation vector.\n" +" :type vector: :class:`Vector`\n" +" :return: An identity matrix with a translation.\n" +" :rtype: :class:`Matrix`\n"; + +static PyObject *C_Matrix_Translation(PyObject *cls, VectorObject * vec) +{ + float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; + + if(!VectorObject_Check(vec)) { + PyErr_SetString(PyExc_TypeError, "mathutils.TranslationMatrix(): expected vector\n"); + return NULL; + } + if(vec->size != 3 && vec->size != 4) { + PyErr_SetString(PyExc_TypeError, "mathutils.TranslationMatrix(): vector must be 3D or 4D\n"); + return NULL; + } + + if(!BaseMath_ReadCallback(vec)) + return NULL; + + //create a identity matrix and add translation + unit_m4((float(*)[4]) mat); + mat[12] = vec->vec[0]; + mat[13] = vec->vec[1]; + mat[14] = vec->vec[2]; + + return newMatrixObject(mat, 4, 4, Py_NEW, (PyTypeObject *)cls); +} +//----------------------------------mathutils.ScaleMatrix() ------------- +//mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc. +static char C_Matrix_Scale_doc[] = +".. classmethod:: Scale(factor, size, axis)\n" +"\n" +" Create a matrix representing a scaling.\n" +"\n" +" :arg factor: The factor of scaling to apply.\n" +" :type factor: float\n" +" :arg size: The size of the scale matrix to construct [2, 4].\n" +" :type size: int\n" +" :arg axis: Direction to influence scale. (optional).\n" +" :type axis: :class:`Vector`\n" +" :return: A new scale matrix.\n" +" :rtype: :class:`Matrix`\n"; + +static PyObject *C_Matrix_Scale(PyObject *cls, PyObject *args) +{ + VectorObject *vec = NULL; + float norm = 0.0f, factor; + int matSize, x; + float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; + + if(!PyArg_ParseTuple(args, "fi|O!", &factor, &matSize, &vector_Type, &vec)) { + PyErr_SetString(PyExc_TypeError, "mathutils.ScaleMatrix(): expected float int and optional vector\n"); + return NULL; + } + if(matSize != 2 && matSize != 3 && matSize != 4) { + PyErr_SetString(PyExc_AttributeError, "mathutils.ScaleMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); + return NULL; + } + if(vec) { + if(vec->size > 2 && matSize == 2) { + PyErr_SetString(PyExc_AttributeError, "mathutils.ScaleMatrix(): please use 2D vectors when scaling in 2D\n"); + return NULL; + } + + if(!BaseMath_ReadCallback(vec)) + return NULL; + + } + if(vec == NULL) { //scaling along axis + if(matSize == 2) { + mat[0] = factor; + mat[3] = factor; + } else { + mat[0] = factor; + mat[4] = factor; + mat[8] = factor; + } + } else { //scaling in arbitrary direction + //normalize arbitrary axis + for(x = 0; x < vec->size; x++) { + norm += vec->vec[x] * vec->vec[x]; + } + norm = (float) sqrt(norm); + for(x = 0; x < vec->size; x++) { + vec->vec[x] /= norm; + } + if(matSize == 2) { + mat[0] = 1 +((factor - 1) *(vec->vec[0] * vec->vec[0])); + mat[1] =((factor - 1) *(vec->vec[0] * vec->vec[1])); + mat[2] =((factor - 1) *(vec->vec[0] * vec->vec[1])); + mat[3] = 1 + ((factor - 1) *(vec->vec[1] * vec->vec[1])); + } else { + mat[0] = 1 + ((factor - 1) *(vec->vec[0] * vec->vec[0])); + mat[1] =((factor - 1) *(vec->vec[0] * vec->vec[1])); + mat[2] =((factor - 1) *(vec->vec[0] * vec->vec[2])); + mat[3] =((factor - 1) *(vec->vec[0] * vec->vec[1])); + mat[4] = 1 + ((factor - 1) *(vec->vec[1] * vec->vec[1])); + mat[5] =((factor - 1) *(vec->vec[1] * vec->vec[2])); + mat[6] =((factor - 1) *(vec->vec[0] * vec->vec[2])); + mat[7] =((factor - 1) *(vec->vec[1] * vec->vec[2])); + mat[8] = 1 + ((factor - 1) *(vec->vec[2] * vec->vec[2])); + } + } + if(matSize == 4) { + //resize matrix + mat[10] = mat[8]; + mat[9] = mat[7]; + mat[8] = mat[6]; + mat[7] = 0.0f; + mat[6] = mat[5]; + mat[5] = mat[4]; + mat[4] = mat[3]; + mat[3] = 0.0f; + } + //pass to matrix creation + return newMatrixObject(mat, matSize, matSize, Py_NEW, (PyTypeObject *)cls); +} +//----------------------------------mathutils.OrthoProjectionMatrix() --- +//mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc. +static char C_Matrix_OrthoProjection_doc[] = +".. classmethod:: OrthoProjection(plane, size, axis)\n" +"\n" +" Create a matrix to represent an orthographic projection.\n" +"\n" +" :arg plane: Can be any of the following: ['X', 'Y', 'XY', 'XZ', 'YZ', 'R'], where a single axis is for a 2D matrix and 'R' requires axis is given.\n" +" :type plane: string\n" +" :arg size: The size of the projection matrix to construct [2, 4].\n" +" :type size: int\n" +" :arg axis: Arbitrary perpendicular plane vector (optional).\n" +" :type axis: :class:`Vector`\n" +" :return: A new projection matrix.\n" +" :rtype: :class:`Matrix`\n"; +static PyObject *C_Matrix_OrthoProjection(PyObject *cls, PyObject *args) +{ + VectorObject *vec = NULL; + char *plane; + int matSize, x; + float norm = 0.0f; + float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; + + if(!PyArg_ParseTuple(args, "si|O!", &plane, &matSize, &vector_Type, &vec)) { + PyErr_SetString(PyExc_TypeError, "mathutils.OrthoProjectionMatrix(): expected string and int and optional vector\n"); + return NULL; + } + if(matSize != 2 && matSize != 3 && matSize != 4) { + PyErr_SetString(PyExc_AttributeError,"mathutils.OrthoProjectionMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); + return NULL; + } + if(vec) { + if(vec->size > 2 && matSize == 2) { + PyErr_SetString(PyExc_AttributeError, "mathutils.OrthoProjectionMatrix(): please use 2D vectors when scaling in 2D\n"); + return NULL; + } + + if(!BaseMath_ReadCallback(vec)) + return NULL; + + } + if(vec == NULL) { //ortho projection onto cardinal plane + if((strcmp(plane, "X") == 0) && matSize == 2) { + mat[0] = 1.0f; + } else if((strcmp(plane, "Y") == 0) && matSize == 2) { + mat[3] = 1.0f; + } else if((strcmp(plane, "XY") == 0) && matSize > 2) { + mat[0] = 1.0f; + mat[4] = 1.0f; + } else if((strcmp(plane, "XZ") == 0) && matSize > 2) { + mat[0] = 1.0f; + mat[8] = 1.0f; + } else if((strcmp(plane, "YZ") == 0) && matSize > 2) { + mat[4] = 1.0f; + mat[8] = 1.0f; + } else { + PyErr_SetString(PyExc_AttributeError, "mathutils.OrthoProjectionMatrix(): unknown plane - expected: X, Y, XY, XZ, YZ\n"); + return NULL; + } + } else { //arbitrary plane + //normalize arbitrary axis + for(x = 0; x < vec->size; x++) { + norm += vec->vec[x] * vec->vec[x]; + } + norm = (float) sqrt(norm); + for(x = 0; x < vec->size; x++) { + vec->vec[x] /= norm; + } + if((strcmp(plane, "R") == 0) && matSize == 2) { + mat[0] = 1 - (vec->vec[0] * vec->vec[0]); + mat[1] = -(vec->vec[0] * vec->vec[1]); + mat[2] = -(vec->vec[0] * vec->vec[1]); + mat[3] = 1 - (vec->vec[1] * vec->vec[1]); + } else if((strcmp(plane, "R") == 0) && matSize > 2) { + mat[0] = 1 - (vec->vec[0] * vec->vec[0]); + mat[1] = -(vec->vec[0] * vec->vec[1]); + mat[2] = -(vec->vec[0] * vec->vec[2]); + mat[3] = -(vec->vec[0] * vec->vec[1]); + mat[4] = 1 - (vec->vec[1] * vec->vec[1]); + mat[5] = -(vec->vec[1] * vec->vec[2]); + mat[6] = -(vec->vec[0] * vec->vec[2]); + mat[7] = -(vec->vec[1] * vec->vec[2]); + mat[8] = 1 - (vec->vec[2] * vec->vec[2]); + } else { + PyErr_SetString(PyExc_AttributeError, "mathutils.OrthoProjectionMatrix(): unknown plane - expected: 'r' expected for axis designation\n"); + return NULL; + } + } + if(matSize == 4) { + //resize matrix + mat[10] = mat[8]; + mat[9] = mat[7]; + mat[8] = mat[6]; + mat[7] = 0.0f; + mat[6] = mat[5]; + mat[5] = mat[4]; + mat[4] = mat[3]; + mat[3] = 0.0f; + } + //pass to matrix creation + return newMatrixObject(mat, matSize, matSize, Py_NEW, (PyTypeObject *)cls); +} + +static char C_Matrix_Shear_doc[] = +".. classmethod:: Shear(plane, factor, size)\n" +"\n" +" Create a matrix to represent an shear transformation.\n" +"\n" +" :arg plane: Can be any of the following: ['X', 'Y', 'XY', 'XZ', 'YZ'], where a single axis is for a 2D matrix.\n" +" :type plane: string\n" +" :arg factor: The factor of shear to apply.\n" +" :type factor: float\n" +" :arg size: The size of the shear matrix to construct [2, 4].\n" +" :type size: int\n" +" :return: A new shear matrix.\n" +" :rtype: :class:`Matrix`\n"; + +static PyObject *C_Matrix_Shear(PyObject *cls, PyObject *args) +{ + int matSize; + char *plane; + float factor; + float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; + + if(!PyArg_ParseTuple(args, "sfi", &plane, &factor, &matSize)) { + PyErr_SetString(PyExc_TypeError,"mathutils.ShearMatrix(): expected string float and int\n"); + return NULL; + } + if(matSize != 2 && matSize != 3 && matSize != 4) { + PyErr_SetString(PyExc_AttributeError,"mathutils.ShearMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); + return NULL; + } + + if((strcmp(plane, "X") == 0) + && matSize == 2) { + mat[0] = 1.0f; + mat[2] = factor; + mat[3] = 1.0f; + } else if((strcmp(plane, "Y") == 0) && matSize == 2) { + mat[0] = 1.0f; + mat[1] = factor; + mat[3] = 1.0f; + } else if((strcmp(plane, "XY") == 0) && matSize > 2) { + mat[0] = 1.0f; + mat[4] = 1.0f; + mat[6] = factor; + mat[7] = factor; + } else if((strcmp(plane, "XZ") == 0) && matSize > 2) { + mat[0] = 1.0f; + mat[3] = factor; + mat[4] = 1.0f; + mat[5] = factor; + mat[8] = 1.0f; + } else if((strcmp(plane, "YZ") == 0) && matSize > 2) { + mat[0] = 1.0f; + mat[1] = factor; + mat[2] = factor; + mat[4] = 1.0f; + mat[8] = 1.0f; + } else { + PyErr_SetString(PyExc_AttributeError, "mathutils.ShearMatrix(): expected: x, y, xy, xz, yz or wrong matrix size for shearing plane\n"); + return NULL; + } + if(matSize == 4) { + //resize matrix + mat[10] = mat[8]; + mat[9] = mat[7]; + mat[8] = mat[6]; + mat[7] = 0.0f; + mat[6] = mat[5]; + mat[5] = mat[4]; + mat[4] = mat[3]; + mat[3] = 0.0f; + } + //pass to matrix creation + return newMatrixObject(mat, matSize, matSize, Py_NEW, (PyTypeObject *)cls); +} + /* assumes rowsize == colsize is checked and the read callback has run */ static float matrix_determinant(MatrixObject * self) { @@ -1326,6 +1758,13 @@ static struct PyMethodDef Matrix_methods[] = { {"to_quat", (PyCFunction) Matrix_toQuat, METH_NOARGS, Matrix_toQuat_doc}, {"copy", (PyCFunction) Matrix_copy, METH_NOARGS, Matrix_copy_doc}, {"__copy__", (PyCFunction) Matrix_copy, METH_NOARGS, Matrix_copy_doc}, + + /* class methods */ + {"Rotation", (PyCFunction) C_Matrix_Rotation, METH_VARARGS | METH_CLASS, C_Matrix_Rotation_doc}, + {"Scale", (PyCFunction) C_Matrix_Scale, METH_VARARGS | METH_CLASS, C_Matrix_Scale_doc}, + {"Shear", (PyCFunction) C_Matrix_Shear, METH_VARARGS | METH_CLASS, C_Matrix_Shear_doc}, + {"Translation", (PyCFunction) C_Matrix_Translation, METH_O | METH_CLASS, C_Matrix_Translation_doc}, + {"OrthoProjection", (PyCFunction) C_Matrix_OrthoProjection, METH_VARARGS | METH_CLASS, C_Matrix_OrthoProjection_doc}, {NULL, NULL, 0, NULL} }; diff --git a/source/blender/python/generic/noise.c b/source/blender/python/generic/noise.c index 168ee65795d..b07950099a3 100644 --- a/source/blender/python/generic/noise.c +++ b/source/blender/python/generic/noise.c @@ -18,7 +18,7 @@ * * 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. + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. diff --git a/source/blender/python/intern/Makefile b/source/blender/python/intern/Makefile index 419092cbe21..309ad9a42f1 100644 --- a/source/blender/python/intern/Makefile +++ b/source/blender/python/intern/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index ff273fa098d..9b2248d1ed4 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -35,6 +35,7 @@ #include "MEM_guardedalloc.h" #include "BKE_utildefines.h" +#include "BKE_idcode.h" #include "BKE_context.h" #include "BKE_global.h" /* evil G.* */ #include "BKE_report.h" @@ -418,25 +419,50 @@ static PyObject *pyrna_prop_richcmp(PyObject *a, PyObject *b, int op) } /*----------------------repr--------------------------------------------*/ -static PyObject *pyrna_struct_repr( BPy_StructRNA *self ) +static PyObject *pyrna_struct_str( BPy_StructRNA *self ) { - PyObject *pyob; + PyObject *ret; char *name; /* print name if available */ name= RNA_struct_name_get_alloc(&self->ptr, NULL, FALSE); if(name) { - pyob= PyUnicode_FromFormat( "<bpy_struct, %.200s(\"%.200s\")>", RNA_struct_identifier(self->ptr.type), name); + ret= PyUnicode_FromFormat( "<bpy_struct, %.200s(\"%.200s\")>", RNA_struct_identifier(self->ptr.type), name); MEM_freeN(name); - return pyob; + return ret; } return PyUnicode_FromFormat( "<bpy_struct, %.200s at %p>", RNA_struct_identifier(self->ptr.type), self->ptr.data); } -static PyObject *pyrna_prop_repr( BPy_PropertyRNA *self ) +static PyObject *pyrna_struct_repr(BPy_StructRNA *self) +{ + ID *id= self->ptr.id.data; + if(id == NULL) + return pyrna_struct_str(self); /* fallback */ + + if(RNA_struct_is_ID(self->ptr.type)) { + return PyUnicode_FromFormat( "bpy.data.%s[\"%s\"]", BKE_idcode_to_name_plural(GS(id->name)), id->name+2); + } + else { + PyObject *ret; + char *path; + path= RNA_path_from_ID_to_struct(&self->ptr); + if(path) { + ret= PyUnicode_FromFormat( "bpy.data.%s[\"%s\"].%s", BKE_idcode_to_name_plural(GS(id->name)), id->name+2, path); + MEM_freeN(path); + } + else { /* cant find, print something sane */ + ret= PyUnicode_FromFormat( "bpy.data.%s[\"%s\"]...%s", BKE_idcode_to_name_plural(GS(id->name)), id->name+2, RNA_struct_identifier(self->ptr.type)); + } + + return ret; + } +} + +static PyObject *pyrna_prop_str( BPy_PropertyRNA *self ) { - PyObject *pyob; + PyObject *ret; PointerRNA ptr; char *name; const char *type_id= NULL; @@ -470,15 +496,36 @@ static PyObject *pyrna_prop_repr( BPy_PropertyRNA *self ) name= RNA_struct_name_get_alloc(&ptr, NULL, FALSE); if(name) { - pyob= PyUnicode_FromFormat( "<bpy_%.200s, %.200s.%.200s(\"%.200s\")>", type_fmt, RNA_struct_identifier(self->ptr.type), RNA_property_identifier(self->prop), name); + ret= PyUnicode_FromFormat( "<bpy_%.200s, %.200s.%.200s(\"%.200s\")>", type_fmt, RNA_struct_identifier(self->ptr.type), RNA_property_identifier(self->prop), name); MEM_freeN(name); - return pyob; + return ret; } } return PyUnicode_FromFormat( "<bpy_%.200s, %.200s.%.200s>", type_fmt, RNA_struct_identifier(self->ptr.type), RNA_property_identifier(self->prop)); } +static PyObject *pyrna_prop_repr(BPy_PropertyRNA *self) +{ + ID *id= self->ptr.id.data; + PyObject *ret; + char *path; + + if(id == NULL) + return pyrna_prop_str(self); /* fallback */ + + path= RNA_path_from_ID_to_property(&self->ptr, self->prop); + if(path) { + ret= PyUnicode_FromFormat( "bpy.data.%s[\"%s\"].%s", BKE_idcode_to_name_plural(GS(id->name)), id->name+2, path); + MEM_freeN(path); + } + else { /* cant find, print something sane */ + ret= PyUnicode_FromFormat( "bpy.data.%s[\"%s\"]...%s", BKE_idcode_to_name_plural(GS(id->name)), id->name+2, RNA_property_identifier(self->prop)); + } + + return ret; +} + static long pyrna_struct_hash( BPy_StructRNA *self ) { return _Py_HashPointer(self->ptr.data); @@ -2039,12 +2086,34 @@ static char pyrna_struct_is_property_set_doc[] = static PyObject *pyrna_struct_is_property_set(BPy_StructRNA *self, PyObject *args) { + PropertyRNA *prop; char *name; + int ret; if (!PyArg_ParseTuple(args, "s:is_property_set", &name)) return NULL; - return PyBool_FromLong(RNA_property_is_set(&self->ptr, name)); + if((prop= RNA_struct_find_property(&self->ptr, name)) == NULL) { + PyErr_Format(PyExc_TypeError, "%.200s.is_property_set(\"%.200s\") not found", RNA_struct_identifier(self->ptr.type), name); + return NULL; + } + + /* double property lookup, could speed up */ + /* return PyBool_FromLong(RNA_property_is_set(&self->ptr, name)); */ + if(RNA_property_flag(prop) & PROP_IDPROPERTY) { + IDProperty *group= RNA_struct_idproperties(&self->ptr, 0); + if(group) { + ret= IDP_GetPropertyFromGroup(group, name) ? 1:0; + } + else { + ret= 0; + } + } + else { + ret= 1; + } + + return PyBool_FromLong(ret); } static char pyrna_struct_is_property_hidden_doc[] = @@ -2059,15 +2128,16 @@ static PyObject *pyrna_struct_is_property_hidden(BPy_StructRNA *self, PyObject * { PropertyRNA *prop; char *name; - int hidden; if (!PyArg_ParseTuple(args, "s:is_property_hidden", &name)) return NULL; - - prop= RNA_struct_find_property(&self->ptr, name); - hidden= (prop)? (RNA_property_flag(prop) & PROP_HIDDEN): 1; - return PyBool_FromLong(hidden); + if((prop= RNA_struct_find_property(&self->ptr, name)) == NULL) { + PyErr_Format(PyExc_TypeError, "%.200s.is_property_hidden(\"%.200s\") not found", RNA_struct_identifier(self->ptr.type), name); + return NULL; + } + + return PyBool_FromLong(RNA_property_flag(prop) & PROP_HIDDEN); } static char pyrna_struct_path_resolve_doc[] = @@ -3530,7 +3600,7 @@ PyTypeObject pyrna_struct_Type = { ( hashfunc )pyrna_struct_hash, /* hashfunc tp_hash; */ NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ + (reprfunc) pyrna_struct_str, /* reprfunc tp_str; */ ( getattrofunc ) pyrna_struct_getattro, /* getattrofunc tp_getattro; */ ( setattrofunc ) pyrna_struct_setattro, /* setattrofunc tp_setattro; */ @@ -3597,7 +3667,7 @@ PyTypeObject pyrna_prop_Type = { NULL, /* getattrfunc tp_getattr; */ NULL, /* setattrfunc tp_setattr; */ NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */ - ( reprfunc ) pyrna_prop_repr, /* tp_repr */ + (reprfunc) pyrna_prop_repr, /* tp_repr */ /* Method suites for standard classes */ @@ -3609,7 +3679,7 @@ PyTypeObject pyrna_prop_Type = { ( hashfunc ) pyrna_prop_hash, /* hashfunc tp_hash; */ NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ + (reprfunc) pyrna_prop_str, /* reprfunc tp_str; */ /* will only use these if this is a subtype of a py class */ NULL, /* getattrofunc tp_getattro; */ diff --git a/source/blender/quicktime/Makefile b/source/blender/quicktime/Makefile index 3d8ab2f0adc..d0055780556 100644 --- a/source/blender/quicktime/Makefile +++ b/source/blender/quicktime/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/quicktime/apple/Makefile b/source/blender/quicktime/apple/Makefile index 88eea6ea002..cdb00ab9ef2 100644 --- a/source/blender/quicktime/apple/Makefile +++ b/source/blender/quicktime/apple/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/readblenfile/Makefile b/source/blender/readblenfile/Makefile index d291cb84315..f0a46d077a8 100644 --- a/source/blender/readblenfile/Makefile +++ b/source/blender/readblenfile/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/readblenfile/intern/Makefile b/source/blender/readblenfile/intern/Makefile index 54316903f23..dc59ca3b9ed 100644 --- a/source/blender/readblenfile/intern/Makefile +++ b/source/blender/readblenfile/intern/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/readblenfile/stub/Makefile b/source/blender/readblenfile/stub/Makefile index a2b0fe88f6a..94a55407418 100644 --- a/source/blender/readblenfile/stub/Makefile +++ b/source/blender/readblenfile/stub/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/readblenfile/test/Makefile b/source/blender/readblenfile/test/Makefile index 50f50f5c54c..cc294ac60b3 100644 --- a/source/blender/readblenfile/test/Makefile +++ b/source/blender/readblenfile/test/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/render/Makefile b/source/blender/render/Makefile index 11ddbad0b94..7be54ac359f 100644 --- a/source/blender/render/Makefile +++ b/source/blender/render/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h index af7f3fcf387..b12e45ecd9c 100644 --- a/source/blender/render/extern/include/RE_pipeline.h +++ b/source/blender/render/extern/include/RE_pipeline.h @@ -193,7 +193,7 @@ void RE_SetPixelSize(struct Render *re, float pixsize); void RE_SetView (struct Render *re, float mat[][4]); /* make or free the dbase */ -void RE_Database_FromScene(struct Render *re, struct Scene *scene, unsigned int lay, int use_camera_view); +void RE_Database_FromScene(struct Render *re, struct Main *bmain, struct Scene *scene, unsigned int lay, int use_camera_view); void RE_Database_Free (struct Render *re); /* project dbase again, when viewplane/perspective changed */ diff --git a/source/blender/render/intern/Makefile b/source/blender/render/intern/Makefile index 4fce37df175..4043902a40f 100644 --- a/source/blender/render/intern/Makefile +++ b/source/blender/render/intern/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/render/intern/include/renderdatabase.h b/source/blender/render/intern/include/renderdatabase.h index 76e7fe7b4f3..4c80616665d 100644 --- a/source/blender/render/intern/include/renderdatabase.h +++ b/source/blender/render/intern/include/renderdatabase.h @@ -34,6 +34,7 @@ struct Object; struct VlakRen; struct VertRen; struct HaloRen; +struct Main; struct Material; struct Render; struct MCol; @@ -137,7 +138,7 @@ void RE_set_customdata_names(struct ObjectRen *obr, struct CustomData *data); /* convertblender.c */ void init_render_world(Render *re); -void RE_Database_FromScene_Vectors(Render *re, struct Scene *sce, unsigned int lay); +void RE_Database_FromScene_Vectors(Render *re, struct Main *bmain, struct Scene *sce, unsigned int lay); #endif /* RENDERDATABASE_H */ diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 26783d21da7..149890f830d 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -4889,13 +4889,14 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp } /* used to be 'rotate scene' */ -void RE_Database_FromScene(Render *re, Scene *scene, unsigned int lay, int use_camera_view) +void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int lay, int use_camera_view) { extern int slurph_opt; /* key.c */ Scene *sce; float mat[4][4]; float amb[3]; + re->main= bmain; re->scene= scene; re->lay= lay; @@ -5433,7 +5434,7 @@ static void free_dbase_object_vectors(ListBase *lb) BLI_freelistN(lb); } -void RE_Database_FromScene_Vectors(Render *re, Scene *sce, unsigned int lay) +void RE_Database_FromScene_Vectors(Render *re, Main *bmain, Scene *sce, unsigned int lay) { ObjectInstanceRen *obi, *oldobi; StrandSurface *mesh; @@ -5475,7 +5476,7 @@ void RE_Database_FromScene_Vectors(Render *re, Scene *sce, unsigned int lay) re->strandsurface= strandsurface; if(!re->test_break(re->tbh)) - RE_Database_FromScene(re, sce, lay, 1); + RE_Database_FromScene(re, bmain, sce, lay, 1); if(!re->test_break(re->tbh)) { for(step= 0; step<2; step++) { diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 6c6e200a74e..183b46af863 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1768,9 +1768,9 @@ static void do_render_3d(Render *re) /* make render verts/faces/halos/lamps */ if(render_scene_needs_vector(re)) - RE_Database_FromScene_Vectors(re, re->scene, re->lay); + RE_Database_FromScene_Vectors(re, re->main, re->scene, re->lay); else - RE_Database_FromScene(re, re->scene, re->lay, 1); + RE_Database_FromScene(re, re->main, re->scene, re->lay, 1); threaded_tile_processor(re); @@ -2142,6 +2142,7 @@ static void render_scene(Render *re, Scene *sce, int cfra) RE_InitState(resc, re, &sce->r, NULL, winx, winy, &re->disprect); /* still unsure entity this... */ + resc->main= re->main; resc->scene= sce; resc->lay= sce->lay; diff --git a/source/blender/verify/Makefile b/source/blender/verify/Makefile index 88ac835c505..4451d5baf22 100644 --- a/source/blender/verify/Makefile +++ b/source/blender/verify/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/verify/intern/Makefile b/source/blender/verify/intern/Makefile index 5f1cac41e28..009fd1c6e28 100644 --- a/source/blender/verify/intern/Makefile +++ b/source/blender/verify/intern/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/windowmanager/Makefile b/source/blender/windowmanager/Makefile index 90621f66057..1596921b5ee 100644 --- a/source/blender/windowmanager/Makefile +++ b/source/blender/windowmanager/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) Blender Foundation. # All rights reserved. diff --git a/source/blender/windowmanager/intern/Makefile b/source/blender/windowmanager/intern/Makefile index 18085194405..60be5fed4b2 100644 --- a/source/blender/windowmanager/intern/Makefile +++ b/source/blender/windowmanager/intern/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index fcf8951d796..8d36711032b 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -26,7 +26,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include "string.h" +#include <string.h> +#include <stddef.h> #include "DNA_windowmanager_types.h" @@ -149,9 +150,9 @@ MenuType *WM_menutype_find(const char *idname, int quiet) MenuType* mt; if (idname[0]) { - for(mt=menutypes.first; mt; mt=mt->next) - if(strcmp(idname, mt->idname)==0) - return mt; + mt= BLI_findstring(&menutypes, idname, offsetof(MenuType, idname)); + if(mt) + return mt; } if(!quiet) diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 4c3e88d978e..23994905b96 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -63,6 +63,7 @@ #include "BKE_screen.h" /* BKE_ST_MAXNAME */ #include "BKE_utildefines.h" #include "BKE_brush.h" // JW +#include "BKE_idcode.h" #include "BIF_gl.h" #include "BIF_glutil.h" /* for paint cursor */ @@ -102,11 +103,11 @@ wmOperatorType *WM_operatortype_find(const char *idname, int quiet) char idname_bl[OP_MAX_TYPENAME]; // XXX, needed to support python style names without the _OT_ syntax WM_operator_bl_idname(idname_bl, idname); - + if (idname_bl[0]) { - for(ot= global_ops.first; ot; ot= ot->next) { - if(strncmp(ot->idname, idname_bl, OP_MAX_TYPENAME)==0) - return ot; + ot= BLI_findstring_ptr(&global_ops, idname_bl, offsetof(wmOperatorType, idname)); + if(ot) { + return ot; } } @@ -1586,7 +1587,7 @@ static int wm_link_append_exec(bContext *C, wmOperator *op) scene_deselect_all(scene); bh = BLO_blendhandle_from_file(libname); - idcode = BLO_idcode_from_name(group); + idcode = BKE_idcode_from_name(group); flag = wm_link_append_flag(op); diff --git a/source/blenderplayer/bad_level_call_stubs/Makefile b/source/blenderplayer/bad_level_call_stubs/Makefile index 1d9f6a27327..49efd08c710 100644 --- a/source/blenderplayer/bad_level_call_stubs/Makefile +++ b/source/blenderplayer/bad_level_call_stubs/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index 6400628fb08..1688b6e3d96 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -264,6 +264,13 @@ struct MTFace *EM_get_active_mtface(struct EditMesh *em, struct EditFace **act_e void make_editMesh(struct Scene *scene, struct Object *ob){} void load_editMesh(struct Scene *scene, struct Object *ob){} +void make_editLatt(struct Object *obedit){} +void load_editLatt(struct Object *obedit){} + +void load_editNurb (struct Object *obedit){} +void make_editNurb (struct Object *obedit){} + + void uiItemR(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, int flag, char *name, int icon){} struct PointerRNA uiItemFullO(struct uiLayout *layout, char *idname, char *name, int icon, struct IDProperty *properties, int context, int flag){struct PointerRNA a; return a;} diff --git a/source/creator/Makefile b/source/creator/Makefile index bfbb2173cff..08f732ad486 100644 --- a/source/creator/Makefile +++ b/source/creator/Makefile @@ -17,7 +17,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/darwin/Makefile b/source/darwin/Makefile index 7e65d399d44..5c68f43f606 100644 --- a/source/darwin/Makefile +++ b/source/darwin/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/BlenderRoutines/Makefile b/source/gameengine/BlenderRoutines/Makefile index 4a437aff97d..3d0f5344c74 100644 --- a/source/gameengine/BlenderRoutines/Makefile +++ b/source/gameengine/BlenderRoutines/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 0575c55846b..b4ddc4f9e54 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -100,6 +100,7 @@ extern "C" extern "C" { #include "BKE_context.h" #include "BLO_readfile.h" + #include "BKE_idcode.h" #include "BKE_report.h" #include "DNA_space_types.h" #include "DNA_windowmanager_types.h" /* report api */ @@ -938,7 +939,7 @@ bool KX_BlenderSceneConverter::LinkBlendFile(const char *path, char *group, KX_S Main *main_tmp= NULL; /* created only for linking, then freed */ LinkNode *names = NULL; BlendHandle *bpy_openlib = NULL; /* ptr to the open .blend file */ - int idcode= BLO_idcode_from_name(group); + int idcode= BKE_idcode_from_name(group); short flag= 0; /* dont need any special options */ ReportList reports; static char err_local[255]; diff --git a/source/gameengine/Converter/Makefile b/source/gameengine/Converter/Makefile index b6da47930d3..142841b2b36 100644 --- a/source/gameengine/Converter/Makefile +++ b/source/gameengine/Converter/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/Expressions/Makefile b/source/gameengine/Expressions/Makefile index 09512c3ae87..892a8c2b246 100644 --- a/source/gameengine/Expressions/Makefile +++ b/source/gameengine/Expressions/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/GameLogic/Joystick/Makefile b/source/gameengine/GameLogic/Joystick/Makefile index 02def1cec62..5ab297824dd 100644 --- a/source/gameengine/GameLogic/Joystick/Makefile +++ b/source/gameengine/GameLogic/Joystick/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/GameLogic/Makefile b/source/gameengine/GameLogic/Makefile index ba1e1c25ee7..9c8bd73cdc0 100644 --- a/source/gameengine/GameLogic/Makefile +++ b/source/gameengine/GameLogic/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/GamePlayer/Makefile b/source/gameengine/GamePlayer/Makefile index c4f78f23117..30a13f26503 100644 --- a/source/gameengine/GamePlayer/Makefile +++ b/source/gameengine/GamePlayer/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/GamePlayer/common/Makefile b/source/gameengine/GamePlayer/common/Makefile index e1b07a226f6..e28cacb826a 100644 --- a/source/gameengine/GamePlayer/common/Makefile +++ b/source/gameengine/GamePlayer/common/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/GamePlayer/common/unix/Makefile b/source/gameengine/GamePlayer/common/unix/Makefile index c86f61b45d8..db29a087b28 100644 --- a/source/gameengine/GamePlayer/common/unix/Makefile +++ b/source/gameengine/GamePlayer/common/unix/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/GamePlayer/common/windows/Makefile b/source/gameengine/GamePlayer/common/windows/Makefile index 3f1deb05f3a..200f84dd3e6 100644 --- a/source/gameengine/GamePlayer/common/windows/Makefile +++ b/source/gameengine/GamePlayer/common/windows/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/GamePlayer/ghost/Makefile b/source/gameengine/GamePlayer/ghost/Makefile index a7fcf46b695..b2fcd2ac1ff 100644 --- a/source/gameengine/GamePlayer/ghost/Makefile +++ b/source/gameengine/GamePlayer/ghost/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/Ketsji/KXNetwork/Makefile b/source/gameengine/Ketsji/KXNetwork/Makefile index 365ed8fc9c3..aebbd7921cb 100644 --- a/source/gameengine/Ketsji/KXNetwork/Makefile +++ b/source/gameengine/Ketsji/KXNetwork/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 5aa75a62258..303890fd630 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -122,7 +122,7 @@ extern "C" { #include "KX_BlenderSceneConverter.h" #include "KX_MeshProxy.h" /* for creating a new library of mesh objects */ extern "C" { - #include "BLO_readfile.h" + #include "BKE_idcode.h" } #include "NG_NetworkScene.h" //Needed for sendMessage() @@ -661,7 +661,7 @@ static PyObject *gLibNew(PyObject*, PyObject* args) return NULL; } - idcode= BLO_idcode_from_name(group); + idcode= BKE_idcode_from_name(group); if(idcode==0) { PyErr_Format(PyExc_ValueError, "invalid group given \"%s\"", group); return NULL; diff --git a/source/gameengine/Ketsji/Makefile b/source/gameengine/Ketsji/Makefile index 1a7ec415382..79c8626d295 100644 --- a/source/gameengine/Ketsji/Makefile +++ b/source/gameengine/Ketsji/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/Makefile b/source/gameengine/Makefile index bcb4b9098e7..0fdac2acce2 100644 --- a/source/gameengine/Makefile +++ b/source/gameengine/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/Network/LoopBackNetwork/Makefile b/source/gameengine/Network/LoopBackNetwork/Makefile index 690fd644094..236c28b0f23 100644 --- a/source/gameengine/Network/LoopBackNetwork/Makefile +++ b/source/gameengine/Network/LoopBackNetwork/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/Network/Makefile b/source/gameengine/Network/Makefile index c6b22276113..99a047c8b95 100644 --- a/source/gameengine/Network/Makefile +++ b/source/gameengine/Network/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/Network/TerraplayNetwork/Makefile b/source/gameengine/Network/TerraplayNetwork/Makefile index d987263d433..d5a4c86740b 100644 --- a/source/gameengine/Network/TerraplayNetwork/Makefile +++ b/source/gameengine/Network/TerraplayNetwork/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/Physics/Bullet/Makefile b/source/gameengine/Physics/Bullet/Makefile index 433d1df3d2f..0514565534d 100644 --- a/source/gameengine/Physics/Bullet/Makefile +++ b/source/gameengine/Physics/Bullet/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/Physics/Dummy/Makefile b/source/gameengine/Physics/Dummy/Makefile index 0e36266ae09..9a600a0365f 100644 --- a/source/gameengine/Physics/Dummy/Makefile +++ b/source/gameengine/Physics/Dummy/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/Physics/Makefile b/source/gameengine/Physics/Makefile index da0d4cafd2e..f5f914c2ac2 100644 --- a/source/gameengine/Physics/Makefile +++ b/source/gameengine/Physics/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/Physics/common/Makefile b/source/gameengine/Physics/common/Makefile index f87da383520..369699e1b90 100644 --- a/source/gameengine/Physics/common/Makefile +++ b/source/gameengine/Physics/common/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/Rasterizer/Makefile b/source/gameengine/Rasterizer/Makefile index c877e423a71..d800a02b181 100644 --- a/source/gameengine/Rasterizer/Makefile +++ b/source/gameengine/Rasterizer/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile index aedbc2705f0..357bdf9d99b 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/SceneGraph/Makefile b/source/gameengine/SceneGraph/Makefile index acec1b729e8..8a797ae5a0e 100644 --- a/source/gameengine/SceneGraph/Makefile +++ b/source/gameengine/SceneGraph/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/gameengine/VideoTexture/Makefile b/source/gameengine/VideoTexture/Makefile index 1cb147860cd..af3417eef02 100644 --- a/source/gameengine/VideoTexture/Makefile +++ b/source/gameengine/VideoTexture/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/icons/Makefile b/source/icons/Makefile index a31ae9a56c7..5832a098592 100644 --- a/source/icons/Makefile +++ b/source/icons/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/kernel/Makefile b/source/kernel/Makefile index b71491b46d1..aa0b3dd3bf1 100644 --- a/source/kernel/Makefile +++ b/source/kernel/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/kernel/gen_messaging/Makefile b/source/kernel/gen_messaging/Makefile index f94f6f082dd..a1d203bcf18 100644 --- a/source/kernel/gen_messaging/Makefile +++ b/source/kernel/gen_messaging/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/kernel/gen_messaging/intern/Makefile b/source/kernel/gen_messaging/intern/Makefile index f88bcd53c6e..7b6b2169540 100644 --- a/source/kernel/gen_messaging/intern/Makefile +++ b/source/kernel/gen_messaging/intern/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/kernel/gen_system/Makefile b/source/kernel/gen_system/Makefile index 31535ad2a97..45f491cbeb4 100644 --- a/source/kernel/gen_system/Makefile +++ b/source/kernel/gen_system/Makefile @@ -15,7 +15,7 @@ # # 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. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. |