Sunday merger of orange branch with bf-blender
authorTon Roosendaal <ton@blender.org>
Sun, 11 Dec 2005 23:04:27 +0000 (23:04 +0000)
committerTon Roosendaal <ton@blender.org>
Sun, 11 Dec 2005 23:04:27 +0000 (23:04 +0000)
15 files changed:
source/blender/blenkernel/intern/curve.c
source/blender/blenlib/intern/util.c
source/blender/python/api2_2x/Material.c
source/blender/python/api2_2x/Mesh.c
source/blender/python/api2_2x/Text3d.c
source/blender/python/api2_2x/Texture.c
source/blender/python/api2_2x/doc/Mathutils.py
source/blender/python/api2_2x/gen_utils.c
source/blender/python/api2_2x/sceneTimeLine.c
source/blender/render/intern/source/rendercore.c
source/blender/src/buttons_editing.c
source/blender/src/buttons_logic.c
source/blender/src/editfont.c
source/blender/src/editmesh_loop.c
source/blender/src/outliner.c

index d0f46bfbaa8153bb559c0748733cf071d87b09d5..f0bf3672a3525c6b9478eaa013d36591ecd855c1 100644 (file)
@@ -1182,8 +1182,11 @@ void makebevelcurve(Object *ob, ListBase *disp)
        int nr, a;
 
        cu= ob->data;
-
        disp->first = disp->last = NULL;
+
+       /* if a font object is being edited, then do nothing */
+       if( ob == G.obedit && ob->type == OB_FONT ) return;
+
        if(cu->bevobj && cu->bevobj!=ob) {
                if(cu->bevobj->type==OB_CURVE) {
                        bevcu= cu->bevobj->data;
index 62aa663409ee1669ca5531205de3c0157c415e1a..74e8e575fdab39245e3ac79628a74f787ec90ec5 100644 (file)
@@ -437,11 +437,14 @@ void BLI_makestringcode(const char *relfile, char *file)
        char * q;
        char * lslash;
        int len=0;
-
        char temp[FILE_MAXDIR+FILE_MAXFILE];
        char res[FILE_MAXDIR+FILE_MAXFILE];
+       
+       /* if file is already relative, bail out */
+       if(file[0]=='/' && file[1]=='/') return;
+       
        strcpy(temp, relfile);
-
+       
 #ifdef WIN32
        if (strlen(file) > 2) {
                if ( temp[1] == ':' && file[1] == ':' && temp[0] != file[0] )
index 50390025ee2d3361491d89fccb90597213b93fbf..e0fe70b54f8dee4dfb2a2caaf5e687d48b52c0c9 100644 (file)
@@ -2938,6 +2938,34 @@ static PyObject *Matr_oldsetMode( BPy_Material * self, PyObject * args )
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                NULL, NULL, NULL, NULL, NULL, NULL
        };
+       static int bitmask = MA_TRACEBLE
+                               | MA_SHADOW
+                               | MA_SHLESS
+                               | MA_WIRE
+                               | MA_VERTEXCOL
+                               | MA_VERTEXCOLP
+                               | MA_HALO
+                               | MA_ZTRA
+                               | MA_ZINV
+                               | MA_HALO_RINGS
+                               | MA_HALO_LINES
+                               | MA_ONLYSHADOW
+                               | MA_HALO_XALPHA
+                               | MA_STAR
+                               | MA_FACETEXTURE
+                               | MA_HALOTEX
+                               | MA_HALOPUNO
+                               | MA_NOMIST
+                               | MA_HALO_SHADE
+                               | MA_HALO_FLARE
+                               | MA_RADIO
+                               | MA_RAYMIRROR
+                               | MA_ZTRA
+                               | MA_RAYTRANSP
+                               | MA_ONLYSHADOW
+                               | MA_NOMIST
+                               | MA_ENV;
+
 
        /* 
         * check for a single integer argument; do a quick check for now
@@ -2947,7 +2975,7 @@ static PyObject *Matr_oldsetMode( BPy_Material * self, PyObject * args )
        if ( (PySequence_Size( args ) == 1)
                    && PyInt_Check ( PyTuple_GET_ITEM ( args , 0 ) )
                    && PyArg_ParseTuple( args, "i", &flag ) 
-                   && flag < (MA_RAYMIRROR >> 1) ) {
+                       && (flag & bitmask) == flag ) {
                        ok = 1;
 
        /*
index ab286b20761c873d445f50814220ae36fff3cd6e..d4ef5b79c0edee6ae735ada81c08520bfafa47cd 100644 (file)
@@ -1122,6 +1122,11 @@ static PyObject *MVert_repr( BPy_MVert * self )
        return PyString_FromString( format );
 }
 
+static long MVert_hash( BPy_MVert *self )
+{
+       return (long)self->index;
+}
+
 /************************************************************************
  *
  * Python MVert_Type structure definition
@@ -1153,7 +1158,7 @@ PyTypeObject MVert_Type = {
 
        /* More standard operations (here for binary compatibility) */
 
-       NULL,                       /* hashfunc tp_hash; */
+       ( hashfunc ) MVert_hash,    /* hashfunc tp_hash; */
        NULL,                       /* ternaryfunc tp_call; */
        NULL,                       /* reprfunc tp_str; */
        NULL,                       /* getattrofunc tp_getattro; */
@@ -1252,7 +1257,7 @@ PyTypeObject PVert_Type = {
 
        /* More standard operations (here for binary compatibility) */
 
-       NULL,                       /* hashfunc tp_hash; */
+       ( hashfunc ) MVert_hash,    /* hashfunc tp_hash; */
        NULL,                       /* ternaryfunc tp_call; */
        NULL,                       /* reprfunc tp_str; */
        NULL,                       /* getattrofunc tp_getattro; */
@@ -2207,6 +2212,11 @@ static PyObject *MEdge_repr( BPy_MEdge * self )
                        (int)self->index );
 }
 
+static long MEdge_hash( BPy_MEdge *self )
+{
+       return (long)self->index;
+}
+
 /************************************************************************
  *
  * Python MEdge_Type structure definition
@@ -2238,7 +2248,7 @@ PyTypeObject MEdge_Type = {
 
        /* More standard operations (here for binary compatibility) */
 
-       NULL,                       /* hashfunc tp_hash; */
+       ( hashfunc ) MEdge_hash,    /* hashfunc tp_hash; */
        NULL,                       /* ternaryfunc tp_call; */
        NULL,                       /* reprfunc tp_str; */
        NULL,                       /* getattrofunc tp_getattro; */
@@ -3665,6 +3675,11 @@ static PyObject *MFace_repr( BPy_MFace* self )
                                (int)face->v3, (int)self->index ); 
 }
 
+static long MFace_hash( BPy_MFace *self )
+{
+       return (long)self->index;
+}
+
 /************************************************************************
  *
  * Python MFace_Type structure definition
@@ -3696,7 +3711,7 @@ PyTypeObject MFace_Type = {
 
        /* More standard operations (here for binary compatibility) */
 
-       NULL,                       /* hashfunc tp_hash; */
+       ( hashfunc ) MFace_hash,    /* hashfunc tp_hash; */
        NULL,                       /* ternaryfunc tp_call; */
        NULL,                       /* reprfunc tp_str; */
        NULL,                       /* getattrofunc tp_getattro; */
index 504ca9252c3e880b3e03722f4c839dbac1fb2ff2..0561245b7c4dbec0d861dcd8fa962aa6faf035c7 100644 (file)
@@ -39,6 +39,7 @@
 #include "BKE_library.h"
 #include "BKE_global.h"
 #include "BKE_main.h"
+#include "BIF_editfont.h"      /* do_textedit() */
 #include "Curve.h"
 #include "constant.h"
 #include "Types.h"
@@ -48,7 +49,6 @@
 //no prototypes declared in header files - external linkage outside of python
 extern VFont *get_builtin_font(void);  
 extern void freedisplist(struct ListBase *lb);
-extern VFont *get_builtin_font(void);
 extern VFont *give_vfontpointer(int);
 extern VFont *exist_vfont(char *str);
 extern VFont *load_vfont(char *name);
@@ -486,29 +486,46 @@ static PyObject *Text3d_setName( BPy_Text3d * self, PyObject * args )
 static PyObject *Text3d_setText( BPy_Text3d * self, PyObject * args )
 {
        char *text;
-       if( !PyArg_ParseTuple( args, "s", &text  ) )
-               return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
-                                               "expected string argument" ) );
-       if( self ) {
+
+       if( !PyArg_ParseTuple( args, "s", &text ) )
+               return EXPP_ReturnPyObjError( PyExc_AttributeError,
+                               "expected string argument" );
+
+       /*
+        * If the text is currently being edited, then we have to put the
+        * text into the edit buffer.
+        */
+
+       if( G.obedit && G.obedit->data == self->curve ) {
+               short qual = G.qual;
+               G.qual = 0;             /* save key qualifier, then clear it */
+               self->curve->pos = self->curve->len = 0;
+               while ( *text )
+                       do_textedit( 0, 0, *text++ );
+               G.qual = qual;
+       } else {
+               short len = (short)strlen(text);
                MEM_freeN( self->curve->str );
-               if(self->curve->strinfo != NULL)
-                       MEM_freeN(self->curve->strinfo);
-               self->curve->strinfo = MEM_callocN((strlen(text)+1)*sizeof(CharInfo), "strinfo");
-               self->curve->str = MEM_mallocN( strlen (text)+1, "str" );
+               self->curve->str = MEM_callocN( len+sizeof(wchar_t), "str" );
                strcpy( self->curve->str, text );
-               self->curve->pos = (short)strlen ( text );
-               self->curve->len = (short)strlen ( text );
+               self->curve->pos = len;
+               self->curve->len = len;
+
+               if( self->curve->strinfo )
+                       MEM_freeN( self->curve->strinfo );
+               /* don't know why this is +4, just duplicating load_editText() */
+               self->curve->strinfo = MEM_callocN( (len+4) *sizeof(CharInfo),
+                               "strinfo");
        }
-       Py_INCREF( Py_None );
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *Text3d_getText( BPy_Text3d * self )
 {
-       if ( strlen(self->curve->str) )
-               return PyString_FromString (self->curve->str);
-       else 
-               return Py_None;
+       if( self->curve->str )
+               return PyString_FromString( self->curve->str );
+
+       Py_RETURN_NONE;
 }
 
 static PyObject* Text3d_getDrawMode(BPy_Text3d* self)
index 7f576069795f88ca703a6b081b81433c8b273bba..157f2e19cb70745ae1cd0008869f867e30f4bf38 100644 (file)
@@ -1341,12 +1341,12 @@ static PyObject *Texture_getExtend( BPy_Texture * self )
 static PyObject *Texture_getImage( BPy_Texture * self )
 {
        /* we need this to be an IMAGE texture, and we must have an image */
-       if( ( self->texture->type != TEX_IMAGE ) || !self->texture->ima ) {
-               Py_INCREF( Py_None );
-               return Py_None;
-       }
+       if( ( self->texture->type == TEX_IMAGE ||
+                               self->texture->type == TEX_ENVMAP )
+                       && self->texture->ima )
+               return Image_CreatePyObject( self->texture->ima );
 
-       return Image_CreatePyObject( self->texture->ima );
+       Py_RETURN_NONE;
 }
 
 
index 5f552a6949456a95bcf40cc808b0e97b88e27e21..2d4e0a0c092d6912f7bdeeb8949afd7587693c5e 100644 (file)
@@ -49,7 +49,7 @@ def Intersect(vec1, vec2, vec3, ray, orig, clip=1):
   @type vec3: Vector object.
   @param vec3: A 3d vector, one corner of the triangle.
   @type ray: Vector object.
-  @param ray: A 3d vector, the orientation of the ray.
+  @param ray: A 3d vector, the orientation of the ray. the length of the ray is not used, only the direction.
   @type orig: Vector object.
   @param orig: A 3d vector, the origin of the ray.
   @type clip: integer
@@ -117,6 +117,7 @@ def LineIntersect(vec1, vec2, vec3, vec4):
 def CopyVec(vector):
   """
   Create a copy of the Vector object.
+  @attention: B{DEPRECATED} use Vector(vector) instead.
   @type vector: Vector object.
   @param vector: A 2d,3d or 4d vector to be copied.
   @rtype: Vector object.
@@ -148,7 +149,7 @@ def DotVecs(vec1, vec2):
 
 def AngleBetweenVecs(vec1, vec2):
   """
-  Return the angle between two vectors.
+  Return the angle between two vectors. Zero length vectors raise an error.
   @type vec1: Vector object.
   @param vec1: A 2d or 3d vector.
   @type vec2: Vector object.
@@ -437,7 +438,9 @@ class Vector:
 
   def __init__(list = None):
     """
-    Create a new 2d, 3d, or 4d Vector object from a list of numbers.
+    Create a new 2d, 3d, or 4d Vector object from a list of floating point numbers.
+    @note: that python uses higher precission floating point numbers, so values assigned to a vector may have some rounding error.
+    
 
     Example::
       v = Vector(1,0,0)
@@ -460,7 +463,9 @@ class Vector:
 
   def normalize():
     """
-    Normalize the vector.
+    Normalize the vector, making the length of the vector always 1.0
+    @note: Normalize works for vectors of all sizes, however 4D Vectors w axis is left untouched.
+    @note: Normalizing a vector where all values are zero results in all axis having a nan value (not a number).
     @return: a copy of itself
     """
 
@@ -481,13 +486,13 @@ class Vector:
 
   def resize3D():
     """
-    Resize the vector to 3d.
+    Resize the vector to 3d. New axis will be 0.0.
     @return: a copy of itself
     """
 
   def resize4D():
     """
-    Resize the vector to 4d.
+    Resize the vector to 4d. New axis will be 0.0.
     @return: a copy of itself
     """
 
@@ -630,8 +635,8 @@ class Quaternion:
     Example::
       quat = Quaternion(1,2,3,4)
       quat = Quaternion(axis, angle)
-       quat = Quaternion()
-       quat = Quaternion(180, list)
+    quat = Quaternion()
+    quat = Quaternion(180, list)
 
     @type list: PyList of int/float
     @param list: A 3d or 4d list to initialize quaternion.
@@ -757,6 +762,7 @@ class Matrix:
   def identity():
     """
     Set the matrix to the identity matrix.
+    An object with zero location and rotation, a scale of 1, will have an identity matrix.
     @return: a copy of itself
     """
 
index 25d3a7912b8f7d3d5b34028b8a0dfd77a2842057..4e42c06d2a873cab2416a64f71f2ab184c31cbdf 100644 (file)
@@ -486,10 +486,10 @@ PyObject *EXPP_clearScriptLinks( ScriptLink * slink, PyObject * args )
                        char *str;
                        str = PyString_AsString ( PySequence_GetItem( seq, i ) );
                        for ( j = 0 ; j < slink->totscript ; ++j ) {
-                               if ( slink->scripts[j] && !strcmp ( slink->scripts[j]->name+2, str ) ) {
+                               if ( slink->scripts[j] && !strcmp( slink->scripts[j]->name+2, str ) )
                                        slink->scripts[j] = NULL;
+                               if( !slink->scripts[j] )
                                        ++deleted; 
-                               }
                        }
                }
        }
index f1480347e73024dda0af28a866806b7f8ba15fef..58830d28ab4b7913838d92cf2d5105d67fe70169 100644 (file)
@@ -166,34 +166,56 @@ PyObject *M_TimeLine_Get (PyObject *self, PyObject *args) {
 
 static PyObject *TimeLine_getFramesMarked (BPy_TimeLine *self, PyObject *args) {
 
-       PyObject *marker_list= PyDict_New ();
+       PyObject *marker_dict= PyDict_New ();
        TimeMarker *marker_it= NULL;
-       PyObject *tmarker= NULL;
+       PyObject *tmarker= NULL, *pyo= NULL;
 
-       if (!PyArg_ParseTuple( args, "|O", &tmarker ))
+       if (!PyArg_ParseTuple (args, "|O", &tmarker))
                return EXPP_ReturnPyObjError (PyExc_TypeError,
-                                             "expected nothing, or or two ints as arguments.");
+                               "expected nothing, string or int.");
        if (tmarker) {
-               int f;
+               int f= (int)PyInt_AS_LONG (tmarker);
                char s[64];
-               f = PyInt_AsLong (tmarker);
-               if (PyInt_Check (tmarker) && f != 0) {
+
+               if (PyString_Check (tmarker) && (BLI_strncpy (s, PyString_AsString(tmarker), 64)) )
                        for (marker_it= self->marker_list->first; marker_it; marker_it= marker_it->next)
-                               if (marker_it->frame==f) PyDict_SetItem (marker_list, PyInt_FromLong ((long int)marker_it->frame), PyString_FromString (marker_it->name));
-               }
-               else if (PyString_Check (tmarker) && (BLI_strncpy(s, PyString_AsString (tmarker), 64)) ) { 
+                               if (!strcmp (marker_it->name, s)) {
+                                       f= (int)marker_it->frame;
+                                       tmarker= PyInt_FromLong ((long int)marker_it->frame);
+                                       break;
+                               }
+               if (PyInt_Check (tmarker) && f!=0)
                        for (marker_it= self->marker_list->first; marker_it; marker_it= marker_it->next)
-                               if (!strcmp (marker_it->name, s)) PyDict_SetItem (marker_list, PyInt_FromLong ((long int)marker_it->frame), PyString_FromString (marker_it->name));
-
-               }
+                               if (marker_it->frame==f) {
+                                       if ((pyo= PyDict_GetItem ((PyObject*)marker_dict, PyInt_FromLong ((long int)marker_it->frame))) )
+                                               PyList_Append (pyo, PyString_FromString (marker_it->name));
+                                       else {
+                                               if (!pyo) pyo= PyList_New (0);
+                                               PyList_Append (pyo, PyString_FromString (marker_it->name));
+                                       }
+
+                                       PyDict_SetItem (marker_dict, PyInt_FromLong ((long int)marker_it->frame), pyo);
+                               }
        }
        else
-               for (marker_it= self->marker_list->first; marker_it; marker_it= marker_it->next) 
-                       PyDict_SetItem (marker_list, PyInt_FromLong ((long int)marker_it->frame), PyString_FromString (marker_it->name)); 
-       
-       return marker_list;
+               for (marker_it= self->marker_list->first; marker_it; marker_it= marker_it->next) {
+                       if ((pyo= PyDict_GetItem ((PyObject *)marker_dict, PyInt_FromLong ((long int)marker_it->frame))) )
+                               PyList_Append (pyo, PyString_FromString (marker_it->name));
+                       else {
+                               pyo= PyList_New (0);
+                               PyList_Append (pyo, PyString_FromString (marker_it->name));
+                       }
+                       PyDict_SetItem (marker_dict, PyInt_FromLong ((long int)marker_it->frame), pyo);
+               }
+
+               if (pyo) { /** because warnings messages **/
+                       Py_DECREF (pyo);        
+               }
+
+               return marker_dict;
 }
 
+
 static PyObject *TimeLine_addMarker (BPy_TimeLine *self, PyObject *args) {
        int frame= 0;
        TimeMarker *marker= NULL, *marker_it= NULL;
index f5b14fccaed5d6cb7e01ceca247014938aa2caac..68be4cdbb8305f0d3470c709ab88c168fac8bb8a 100644 (file)
@@ -2314,18 +2314,27 @@ void *shadepixel(float x, float y, int z, int facenr, int mask, float *col, floa
                                shi.co[1]= (0.5 + y - 0.5*R.recty)*fy - R.winmat[3][1]/R.winmat[1][1];
                                
                                /* using a*x + b*y + c*z = d equation, (a b c) is normal */
-                               shi.co[2]= (dface - shi.facenor[0]*shi.co[0] - shi.facenor[1]*shi.co[1])/shi.facenor[2];
+                               if(shi.facenor[2]!=0.0f)
+                                       shi.co[2]= (dface - shi.facenor[0]*shi.co[0] - shi.facenor[1]*shi.co[1])/shi.facenor[2];
+                               else
+                                       shi.co[2]= 0.0f;
                                
                                zcor= 1.0; // only to prevent not-initialize
                                
                                if(shi.osatex || (R.r.mode & R_SHADOW) ) {
                                        shi.dxco[0]= fx;
                                        shi.dxco[1]= 0.0;
-                                       shi.dxco[2]= (shi.facenor[0]*fx)/shi.facenor[2];
+                                       if(shi.facenor[2]!=0.0f)
+                                               shi.dxco[2]= (shi.facenor[0]*fx)/shi.facenor[2];
+                                       else 
+                                               shi.dxco[2]= 0.0f;
                                        
                                        shi.dyco[0]= 0.0;
                                        shi.dyco[1]= fy;
-                                       shi.dyco[2]= (shi.facenor[1]*fy)/shi.facenor[2];
+                                       if(shi.facenor[2]!=0.0f)
+                                               shi.dyco[2]= (shi.facenor[1]*fy)/shi.facenor[2];
+                                       else 
+                                               shi.dyco[2]= 0.0f;
                                }
                        }
                        else {
index 52e71f7cfa8b36d8a1856c082545ee6edd2c3dc3..f186c286aab1dd4189fbb126d8bd545959f3d31e 100644 (file)
@@ -1027,12 +1027,14 @@ static void modifiers_setOnCage(void *ob_v, void *md_v)
        Object *ob = ob_v;
        ModifierData *md;
        
-       for (md=ob->modifiers.first; md; md=md->next)
-               if (md!=md_v)
-                       md->mode &= ~eModifierMode_OnCage;
+       int i, cageIndex = modifiers_getCageIndex(ob, NULL );
 
-       md = md_v;
-       md->mode ^= eModifierMode_OnCage;
+       for( i = 0, md=ob->modifiers.first; md; ++i, md=md->next )
+               if( md == md_v ) {
+                       if( i >= cageIndex )
+                               md->mode ^= eModifierMode_OnCage;
+                       break;
+               }
 }
 
 static void modifiers_clearHookOffset(void *ob_v, void *md_v)
index f56aefbeedd54262444d375fe0d9ae12e6c0767b..9933a907897791bdd4f864dee9071dfdb48a69c5 100644 (file)
 #include <math.h>
 #include <string.h>
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 #ifndef WIN32
 #include <unistd.h>
 #else
@@ -714,7 +710,7 @@ static char *actuator_name(int type)
        case ACT_GAME:
                return "Game";
        case ACT_VISIBILITY:
-               return "Game";
+               return "Visibility";
        }
        return "unknown";
 }
@@ -1444,14 +1440,14 @@ static int get_col_actuator(int type)
        case ACT_SOUND:                 return TH_BUT_SETTING2;
        case ACT_CD:                    return TH_BUT_NUM;
        case ACT_CAMERA:                return TH_BUT_TEXTFIELD;
-       case ACT_EDIT_OBJECT:   return TH_BUT_POPUP;
+       case ACT_EDIT_OBJECT:           return TH_BUT_POPUP;
        case ACT_GROUP:                 return TH_BUT_ACTION;
        case ACT_RANDOM:                return TH_BUT_NEUTRAL;
        case ACT_SCENE:                 return TH_BUT_SETTING;
        case ACT_MESSAGE:               return TH_BUT_SETTING1;
        case ACT_GAME:                  return TH_BUT_SETTING2;
-       case ACT_VISIBILITY:    return TH_BUT_NUM;
-       case ACT_CONSTRAINT:    return TH_BUT_ACTION;
+       case ACT_VISIBILITY:            return TH_BUT_NUM;
+       case ACT_CONSTRAINT:            return TH_BUT_ACTION;
        default:                                return TH_BUT_NEUTRAL;
        }
 }
index b161538423c7660e835bb053a86844d8ca0e3082..e7b65f15f16afdefac21c10b37b57cd826a8a70b 100644 (file)
@@ -1157,6 +1157,7 @@ void free_editText(void)
 {
        if(oldstr) MEM_freeN(oldstr);
        if(oldstrinfo) MEM_freeN(oldstrinfo);
+       if(textbuf) MEM_freeN(textbuf);
        textbuf = oldstr = NULL;
        textbufinfo = oldstrinfo = NULL;
        textediting= 0;
index 83d9c6b80ed25e3357effd444b23fa7535c0d993..e3d910fef1023211fc7e0479dd90c59778abe519 100644 (file)
@@ -384,9 +384,9 @@ void CutEdgeloop(int numcuts)
        
        /* now cut the loops */
        if(smooth){
-                       fac= 1.0f;
-                       if(fbutton(&fac, 0.0f, 5.0f, 10, 10, "Smooth:")==0) return;
-                               fac= 0.292f*fac;                        
+               fac= 1.0f;
+               if(fbutton(&fac, 0.0f, 5.0f, 10, 10, "Smooth:")==0) return;
+               fac= 0.292f*fac;                        
                esubdivideflag(SELECT,fac,B_SMOOTH,numcuts,SUBDIV_SELECT_INNER_SEL);
        } else {
                esubdivideflag(SELECT,0,0,numcuts,SUBDIV_SELECT_INNER_SEL);
index 077d43d7a5aa824578e03fba232b31f19711f810..4316c4837cf927c357795f03dd2f54f4336b8f71 100644 (file)
@@ -2584,8 +2584,12 @@ static void outliner_buttons(uiBlock *block, SpaceOops *soops, ListBase *lb)
 
                        // signal for button to open
                        addqueue(curarea->win, BUT_ACTIVATE, OL_NAMEBUTTON);
+                       
+                       /* otherwise keeps open on ESC */
+                       tselem->flag &= ~TSE_TEXTBUT;
                }
-               if((tselem->flag & TSE_CLOSED)==0) outliner_buttons(block, soops, &te->subtree);
+               else 
+                       if((tselem->flag & TSE_CLOSED)==0) outliner_buttons(block, soops, &te->subtree);
        }
 }