Saturday merger of bf-blender in orange branch.
authorTon Roosendaal <ton@blender.org>
Sat, 17 Dec 2005 20:25:41 +0000 (20:25 +0000)
committerTon Roosendaal <ton@blender.org>
Sat, 17 Dec 2005 20:25:41 +0000 (20:25 +0000)
19 files changed:
source/blender/blenloader/intern/readfile.c
source/blender/include/BIF_drawoops.h
source/blender/include/BSE_drawoops.h
source/blender/include/blendef.h
source/blender/makesdna/DNA_material_types.h
source/blender/python/api2_2x/BezTriple.c
source/blender/python/api2_2x/Image.c
source/blender/python/api2_2x/Ipocurve.c
source/blender/python/api2_2x/Material.c
source/blender/python/api2_2x/Types.c
source/blender/python/api2_2x/doc/Ipo.py
source/blender/python/api2_2x/doc/Material.py
source/blender/src/buttons_shading.c
source/blender/src/drawoops.c
source/blender/src/editoops.c
source/blender/src/header_oops.c
source/blender/src/outliner.c
source/blender/src/space.c
source/blender/src/toets.c

index 5c0843b1873b117e95a341ed90c5c7a12a326397..0cccf770fda0a19428f9f3942bb1b98f0133fd5a 100644 (file)
@@ -5214,7 +5214,10 @@ BlendFileData *blo_read_file_internal(FileData *fd, BlendReadError *error_r)
                                 */
                        bhead = read_libblock(fd, fd->mainlist.last, bhead, LIB_READ+LIB_EXTERN, NULL);
                        break;
-
+               case ID_GR:
+                       bhead = blo_nextbhead(fd, bhead);
+                       break;
+                       
                default:
                        bhead = read_libblock(fd, bfd->main, bhead, LIB_LOCAL, NULL);
                }
index d60d8b2e0de713ffddf284f148c5bed6a4717947..b42158d14fea6d37916a055d403a23e18df2cefd 100644 (file)
@@ -35,7 +35,7 @@
 
 void give_oopslink_line(Oops *oops, OopsLink *ol, float *v1, float *v2);
 void mysbox(float x1, float y1, float x2, float y2);
-void boundbox_oops(void);
+void boundbox_oops(short sel);
 
 #endif
 
index 78a8107f8e252a84131a4ac0b6d96233eeef45ea..43e1dee59435b4c4132666479759b9037df79608 100644 (file)
@@ -36,7 +36,7 @@
 struct ScrArea;
 struct Oops;
 
-void boundbox_oops(void);
+void boundbox_oops(short sel);
 void give_oopslink_line(struct Oops *oops, struct OopsLink *ol, float *v1, float *v2);
 void draw_oopslink(struct Oops *oops);
 void draw_icon_oops(float *co, short type);
index 05e06afca4e953f43714ffaa9943d3a8d005619c..c79370513fadab99b5c8a7c97d861a43326cfb17 100644 (file)
 #define B_OOPSHOME             251
 #define B_OOPSBORDER           252
 #define B_NEWOOPS              253
+#define B_OOPSVIEWSEL          254
 
 /* INFO: 300 */
 /* watch: also in filesel.c and editobject.c */
index 8e150b10a823912dd00c1501c878a5d76729d857..79d73ff2b996cfdbb3587e11f10f119a0c6975f6 100644 (file)
@@ -172,6 +172,8 @@ typedef struct Material {
                /* note; we drop MA_TANGENT_STR later to become tangent_u */
 #define MA_TANGENT_V   0x4000000
 
+#define        MA_MODE_MASK    0x3ffffff       /* all valid mode bits */
+
 /* diff_shader */
 #define MA_DIFF_LAMBERT                0
 #define MA_DIFF_ORENNAYAR      1
index 324ba2958bb2c8332d69ba2755be4729531eece7..98e53d2fef8534e69cad04916b39ca61100c2798 100644 (file)
@@ -31,6 +31,7 @@
  */
 
 #include "BezTriple.h" /*This must come first */
+#include "DNA_ipo_types.h"
 
 #include "MEM_guardedalloc.h"
 #include "gen_utils.h"
@@ -303,6 +304,8 @@ static PyObject *BezTripleGetAttr( BPy_BezTriple * self, char *name )
                return BezTriple_getTriple( self );
        else if( strcmp( name, "tilt" ) == 0 )
                return PyFloat_FromDouble(self->beztriple->alfa);
+       else if( strcmp( name, "hide" ) == 0 )
+               return PyFloat_FromDouble(self->beztriple->hide);
        else if( strcmp( name, "__members__" ) == 0 )
                return Py_BuildValue( "[s,s,s]", "pt", "vec", "tilt" );
 
@@ -329,7 +332,17 @@ static int BezTripleSetAttr( BPy_BezTriple * self, char *name, PyObject * value
 
        return 0;               /* normal exit */
 #endif
-       if( strcmp( name, "tilt" ) == 0 ) {
+       if( !strcmp( name, "hide" ) ) {
+               int param;
+               if( !PyInt_CheckExact( value ) )
+                       return EXPP_ReturnIntError( PyExc_TypeError,
+                                       "expected int argument" );
+
+               param = (int)PyInt_AS_LONG( value );
+               self->beztriple->hide = (param == 0) ? 0 : IPO_BEZ;
+               return 0;
+       }
+       if( !strcmp( name, "tilt" ) ) {
                if (!PyFloat_Check( value ) )
                        return EXPP_ReturnIntError( PyExc_TypeError, "expected a float" );
 
@@ -337,8 +350,8 @@ static int BezTripleSetAttr( BPy_BezTriple * self, char *name, PyObject * value
                return 0;
        }
 
-       return EXPP_ReturnIntError( PyExc_AttributeError,
-                                     "cannot set a read-only attribute" ) );
+       return EXPP_ReturnIntError( PyExc_AttributeError,
+                                     "cannot set a read-only attribute" );
 }
 
 /*****************************************************************************/
@@ -356,12 +369,11 @@ static PyObject *BezTripleRepr( BPy_BezTriple * self )
         */
        char str[1000];
        sprintf( str,
-                "BezTriple %f %f %f %f %f %f %f %f %f %f\n %d %d %d %d %d %d\n",
+                "BezTriple (%f %f) (%f %f) (%f %f) %f\n (%d %d %d) (%d %d) %d\n",
                 self->beztriple->vec[0][0], self->beztriple->vec[0][1],
-                self->beztriple->vec[0][2], self->beztriple->vec[1][0],
-                self->beztriple->vec[1][1], self->beztriple->vec[1][2],
+                self->beztriple->vec[1][0], self->beztriple->vec[1][1], 
                 self->beztriple->vec[2][0], self->beztriple->vec[2][1],
-                self->beztriple->vec[2][2], self->beztriple->alfa,
+                self->beztriple->alfa,
                 self->beztriple->h1, self->beztriple->h2, self->beztriple->f1,
                 self->beztriple->f2, self->beztriple->f3,
                 self->beztriple->hide );
index ffd129f303ad9e88faeaea00e24062023f1f80a1..f7d135fe7b3c8ba633d082c3ca5410d88be898ec 100644 (file)
@@ -100,7 +100,7 @@ returns None if not found.\n";
 struct PyMethodDef M_Image_methods[] = {
        {"New", M_Image_New, METH_VARARGS, M_Image_New_doc},
        {"Get", M_Image_Get, METH_VARARGS, M_Image_Get_doc},
-       {"GetCurrent", M_Image_GetCurrent, METH_NOARGS, M_Image_GetCurrent_doc},
+       {"GetCurrent", ( PyCFunction ) M_Image_GetCurrent, METH_NOARGS, M_Image_GetCurrent_doc},        
        {"get", M_Image_Get, METH_VARARGS, M_Image_Get_doc},
        {"Load", M_Image_Load, METH_VARARGS, M_Image_Load_doc},
        {NULL, NULL, 0, NULL}
@@ -126,7 +126,7 @@ static PyObject *M_Image_New( PyObject * self, PyObject * args)
        if( !img )
                return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
                                                "couldn't create PyObject Image_Type" ) );
-       image_changed(img, 0);
+       // image_changed(img, 0);
        return Image_CreatePyObject( img );
 }
 
@@ -663,7 +663,7 @@ static PyMethodDef BPy_Image_methods[] = {
         "(int) - Change Image object animation start value"},
        {"setEnd", ( PyCFunction ) Image_setEnd, METH_VARARGS,
         "(int) - Change Image object animation end value"},
-       {"setSpeed", ( PyCFunction ) Image_setEnd, METH_VARARGS,
+       {"setSpeed", ( PyCFunction ) Image_setSpeed, METH_VARARGS,
         "(int) - Change Image object animation speed (fps)"},
        {"save", ( PyCFunction ) Image_save, METH_NOARGS,
         "() - Write image buffer to file"},
@@ -1104,12 +1104,11 @@ static PyObject *Image_getAttr( BPy_Image * self, char *name )
                attr = PyInt_FromLong( self->image->animspeed );
        else if( strcmp( name, "packed" ) == 0 ) {
                if (self->image->packedfile)  {
-                       //Py_INCREF(Py_True);
                        attr = Py_True;
                } else {
-                       //Py_INCREF(Py_False);
                        attr = Py_False;
                }
+               Py_INCREF(attr);
                
        } else if( strcmp( name, "bindcode" ) == 0 )
                attr = PyInt_FromLong( self->image->bindcode );
index 3b6b9bdced4a0f41e5cb30a8750a0b6776248530..608458e476da63ee45809225137c7b5446af8741 100644 (file)
@@ -405,9 +405,11 @@ static PyObject *IpoCurve_addBezier( C_IpoCurve * self, PyObject * args )
        bzt->vec[0][1] = y - 1;
        bzt->vec[1][1] = y;
        bzt->vec[2][1] = y + 1;
+       bzt->vec[0][2] = bzt->vec[1][2] = bzt->vec[2][2] = 0.0;
        /* set handle type to Auto */
-       bzt->h1 = HD_AUTO;
-       bzt->h2 = HD_AUTO;
+       bzt->h1 = bzt->h2 = HD_AUTO;
+       bzt->f1 = bzt->f2 = bzt->f3= 0;
+       bzt->hide = IPO_BEZ;
 
        Py_INCREF( Py_None );
        return Py_None;
index e0fe70b54f8dee4dfb2a2caaf5e687d48b52c0c9..b9f9937d1fd05f12cd46ae21e661dfaf0b507863 100644 (file)
@@ -324,6 +324,13 @@ static PyObject *Material_ModesDict( void )
 
                PyConstant_Insert(c, "TRACEABLE", PyInt_FromLong(MA_TRACEBLE));
                PyConstant_Insert(c, "SHADOW", PyInt_FromLong(MA_SHADOW));
+               PyConstant_Insert(c, "SHADOWBUF", PyInt_FromLong(MA_SHADBUF));
+               PyConstant_Insert(c, "TANGENTSTR", PyInt_FromLong(MA_TANGENT_STR));
+               PyConstant_Insert(c, "FULLOSA", PyInt_FromLong(MA_FULL_OSA));
+               PyConstant_Insert(c, "RAYBIAS", PyInt_FromLong(MA_RAYBIAS));
+               PyConstant_Insert(c, "TRANSPSHADOW", PyInt_FromLong(MA_SHADOW_TRA));
+               PyConstant_Insert(c, "RAMPCOL", PyInt_FromLong(MA_RAMP_COL));
+               PyConstant_Insert(c, "RAMPSPEC", PyInt_FromLong(MA_RAMP_SPEC));
                PyConstant_Insert(c, "SHADELESS", PyInt_FromLong(MA_SHLESS));
                PyConstant_Insert(c, "WIRE", PyInt_FromLong(MA_WIRE));
                PyConstant_Insert(c, "VCOL_LIGHT", PyInt_FromLong(MA_VERTEXCOL));
@@ -1912,46 +1919,20 @@ static int Material_setName( BPy_Material * self, PyObject * value )
 static int Material_setMode( BPy_Material * self, PyObject * value )
 {
        int param;
-       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;
 
        if( !PyInt_CheckExact ( value ) ) {
                char errstr[128];
-               sprintf ( errstr , "expected int bitmask of 0x%08x", bitmask );
+               sprintf ( errstr , "expected int bitmask of 0x%08x", MA_MODE_MASK );
                return EXPP_ReturnIntError( PyExc_TypeError, errstr );
        }
        param = PyInt_AS_LONG ( value );
 
-       if ( ( param & bitmask ) != param )
+       if ( ( param & MA_MODE_MASK ) != param )
                return EXPP_ReturnIntError( PyExc_ValueError,
                                                "invalid bit(s) set in mask" );
 
-       self->material->mode = param;
+       self->material->mode &= ( MA_RAMP_COL | MA_RAMP_SPEC );
+       self->material->mode |= param & ~( MA_RAMP_COL | MA_RAMP_SPEC );
 
        return 0;
 }
@@ -2938,34 +2919,6 @@ 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
@@ -2975,7 +2928,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 & bitmask) == flag ) {
+                       && (flag & MA_MODE_MASK ) == flag ) {
                        ok = 1;
 
        /*
index 2fdaf063862a1fcd313bb567ba940ff4b2be3b17..6f5bbac6a3a5d19f8a5ca60db2992a2442df4356 100644 (file)
@@ -68,7 +68,6 @@ void types_InitAll( void )
        NMFace_Type.ob_type = &PyType_Type;
        NMVert_Type.ob_type = &PyType_Type;
        NMesh_Type.ob_type = &PyType_Type;
-       Mesh_Type.ob_type = &PyType_Type;
        MFace_Type.ob_type = &PyType_Type;
        MVert_Type.ob_type = &PyType_Type;
        PVert_Type.ob_type = &PyType_Type;
index d7776553ff9836d23965e6cd98f676a78a1de891..b4a99c0216bad694e5bf89a7585f305c8c687aaf 100644 (file)
@@ -402,8 +402,12 @@ class BezTriple:
   The BezTriple object
   ====================
   This object gives access to generic data from all beztriple objects in Blender.  If an attribute is listed as being 'read-only' that means you cannot write to it.  Use the set*() methods instead.
-  @ivar pt : a list of the [x,y] coordinates for knot point of this BezTriple.  read-only.
-  @ivar vec : a list of the 3 points [ handle, knot, handle ] that comprise a BezTriple.  See the getTriple() method for an example of the format.  read-only.
+  @ivar pt : the [x,y] coordinates for knot point of this BezTriple.  Read-only.
+  @type pt: list of floats
+  @ivar vec : a list of the 3 points [ handle, knot, handle ] that comprise a BezTriple.  See the getTriple() method for an example of the format.  Read-only.
+  @type vec: list of points
+  @ivar hide: the visibility status of the control point.
+  @type hide: int
   """
 
   def getPoints():
index 80d741d1d9f01cd9cab332a2b11c244fbc4fafcb..d86d00cc5cf399351e9b4e4f3af63ead3d9625d9 100644 (file)
@@ -25,8 +25,18 @@ Example::
 
 @type Modes: readonly dictionary
 @var Modes: The available Material Modes.
+
+  B{Note}: Some Modes are only available when the 'Halo' mode is I{off} and
+  others only when it is I{on}.  But these two subsets of modes share the same
+  numerical values in their Blender C #defines. So, for example, if 'Halo' is
+  on, then 'NoMist' is actually interpreted as 'HaloShaded'.  We marked all
+  such possibilities in the Modes dict below: each halo-related mode that
+  uses an already taken value is preceded by "+" and appear below the normal
+  mode which also uses that value.
+
     - TRACEABLE    - Make Material visible for shadow lamps.
     - SHADOW       - Enable Material for shadows.
+    - SHADOWBUF    - Enable Material to cast shadows with shadow buffers.
     - SHADELESS    - Make Material insensitive to light or shadow.
     - WIRE         - Render only the edges of faces.
     - VCOL_LIGHT   - Add vertex colors as extra light.
@@ -34,28 +44,26 @@ Example::
     - HALO         - Render as a halo.
     - ZTRANSP      - Z-buffer transparent faces.
     - ZINVERT      - Render with inverted Z-buffer.
-    - - HALORINGS  - Render rings over the basic halo.
+    - + HALORINGS  - Render rings over the basic halo.
     - ENV          - Do not render Material.
-    - - HALOLINES  - Render star shaped lines over the basic halo.
+    - + HALOLINES  - Render star shaped lines over the basic halo.
     - ONLYSHADOW   - Let alpha be determined on the degree of shadow.
-    - - HALOXALPHA - Use extreme alpha.
-    - TEXFACE      - UV-Editor assigned texture gives color and texture info
-        for faces.
-    - - HALOSTAR   - Render halo as a star.
+    - + HALOXALPHA - Use extreme alpha.
+    - TEXFACE      - UV-Editor assigned texture gives color and texture info for faces.
+    - + HALOSTAR   - Render halo as a star.
     - NOMIST       - Set the Material insensitive to mist.
-    - - HALOSHADED - Let halo receive light.
+    - + HALOSHADED - Let halo receive light.
     - HALOTEX      - Give halo a texture.
     - HALOPUNO     - Use the vertex normal to specify the dimension of the halo.
     - HALOFLARE    - Render halo as a lens flare.
     - RAYMIRROR    - Enables raytracing for mirror reflection rendering.
     - RAYTRANSP    - Enables raytracing for transparency rendering.
-@warn: Some Modes are only available when the 'Halo' mode is I{off} and
-    others only when it is I{on}.  But these two subsets of modes share the same
-    numerical values in their Blender C #defines. So, for example, if 'Halo' is
-    on, then 'NoMist' is actually interpreted as 'HaloShaded'.  We marked all
-    such possibilities in the Modes dict below: each halo-related mode that
-    uses an already taken value is preceded by "-" and appear below the normal
-    mode which also uses that value.
+    - RAYBIAS      - Prevent ray traced shadow errors with Phong interpolated normals.
+    - RAMPCOL      - Status of colorband ramp for Material's diffuse color.  This is a read-only bit.
+    - RAMPSPEC     - Status of colorband ramp for Material's specular color.  This is a read-only bit.
+    - TANGENTSTR   - Uses direction of strands as normal for tangent-shading.
+    - TRANSPSHADOW - Lets Material receive transparent shadows based on material color and alpha.
+    - FULLOSA      - Force rendering of all OSA samples.
 
 @type Shaders: readonly dictionary
 @var Shaders: The available Material Shaders.
index f12707d7ac457a83334de2bcb978d4bfa3da7393..fcbe1a5d71c57ec1fb85feb5eadc79b75566ca38 100644 (file)
@@ -667,8 +667,12 @@ void do_texbuts(unsigned short event)
                        }
 
                        IMB_freeImBuf(tex->ima->ibuf);
-                       tex->ima->ibuf= 0;
+                       tex->ima->ibuf= NULL;
                        tex->ima->ok= 1;
+                       
+                       if(tex->env)
+                               RE_free_envmapdata(tex->env);
+                       
                        allqueue(REDRAWVIEW3D, 0);
                        allqueue(REDRAWIMAGE, 0);
                        BIF_all_preview_changed();
index 2cc39627d9d0da617e6bf192486b340421c91fa5..4ecc31eb082ebf0d8c2421b856603ef7b2082f58 100644 (file)
@@ -71,7 +71,7 @@
 float oopscalex;
 struct BMF_Font *font; /* for using different sized fonts */
 
-void boundbox_oops()
+void boundbox_oops(short sel)
 {
        Oops *oops;
        float min[2], max[2];
@@ -80,13 +80,13 @@ void boundbox_oops()
        if(G.soops==0) return;
        
        min[0]= 1000.0;
-       max[0]= -10000.0;
+       max[0]= -1000.0;
        min[1]= 1000.0;
        max[1]= -1000.0;
        
        oops= G.soops->oops.first;
        while(oops) {
-               if(oops->hide==0) {
+               if (oops->hide==0 && !sel || (sel && oops->flag & SELECT )) {
                        ok= 1;
                        
                        min[0]= MIN2(min[0], oops->x);
@@ -430,7 +430,7 @@ void drawoopsspace(ScrArea *sa, void *spacedata)
        else {
                build_oops();   /* changed to become first call... */
                
-               boundbox_oops();
+               boundbox_oops(0);
                calc_scrollrcts(sa, G.v2d, curarea->winx, curarea->winy);
 
                myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
index e9eacda97538b6486cdf9ad170a8ac4b8c1fd207..6c8fa7d5f9db7934b6280c8e80d119423ead144e 100644 (file)
@@ -55,6 +55,7 @@
 #include "DNA_screen_types.h"
 #include "DNA_space_types.h"
 #include "DNA_scene_types.h"
+#include "DNA_image_types.h"
 
 #include "BKE_global.h"
 #include "BKE_scene.h"
@@ -424,6 +425,16 @@ static void do_activate_oops(Oops *oops)
                }
                break;
                
+       case ID_IM:
+               if(oops->id && G.sima) {
+                       /* only set if the new image isnt alredy active */
+                       if (G.sima->image != (Image *)oops->id) {
+                               G.sima->image = (Image *)oops->id;
+                               allqueue(REDRAWIMAGE, 0);
+                               scrarea_queue_winredraw(curarea);
+                       }
+               }
+               break;
        }
 }
 
index a8f90b95ed845d31ae0158601a250267bffd30c7..a3f068dc5a5f47222d00e0e3912adb8dffa3df6b 100644 (file)
@@ -63,6 +63,9 @@
 
 #include "BKE_depsgraph.h"
 
+#include "BPY_extern.h"
+#include "BPY_menus.h"
+
 static int viewmovetemp = 0;
 
 void do_oops_buttons(short event)
@@ -74,7 +77,7 @@ void do_oops_buttons(short event)
        switch(event) {
        case B_OOPSHOME:
                init_v2d_oops(curarea, curarea->spacedata.first);       // forces min/max to be reset
-               boundbox_oops();
+               boundbox_oops(0);
                G.v2d->cur= G.v2d->tot;
                dx= 0.15*(G.v2d->cur.xmax-G.v2d->cur.xmin);
                dy= 0.15*(G.v2d->cur.ymax-G.v2d->cur.ymin);
@@ -85,7 +88,21 @@ void do_oops_buttons(short event)
                test_view2d(G.v2d, curarea->winx, curarea->winy);
                scrarea_queue_winredraw(curarea);
                break;
-
+       
+       case B_OOPSVIEWSEL:
+               init_v2d_oops(curarea, curarea->spacedata.first);       // forces min/max to be reset
+               boundbox_oops(1);
+               G.v2d->cur= G.v2d->tot;
+               dx= 0.15*(G.v2d->cur.xmax-G.v2d->cur.xmin);
+               dy= 0.15*(G.v2d->cur.ymax-G.v2d->cur.ymin);
+               G.v2d->cur.xmin-= dx;
+               G.v2d->cur.xmax+= dx;
+               G.v2d->cur.ymin-= dy;
+               G.v2d->cur.ymax+= dy;           
+               test_view2d(G.v2d, curarea->winx, curarea->winy);
+               scrarea_queue_winredraw(curarea);
+               break;
+       
        case B_NEWOOPS:
                scrarea_queue_winredraw(curarea);
                scrarea_queue_headredraw(curarea);
@@ -107,10 +124,13 @@ static void do_oops_viewmenu(void *arg, int event)
     case 2: /* View All */
                do_oops_buttons(B_OOPSHOME);
                break;
-       case 3: /* Maximize Window */
+    case 3: /* View All */
+               do_oops_buttons(B_OOPSVIEWSEL);
+               break;
+       case 4: /* Maximize Window */
                /* using event B_FULL */
                break;
-       case 4: /* show outliner */
+       case 5: /* show outliner */
                {
                        SpaceOops *soops= curarea->spacedata.first;
                        if(soops->type==SO_OOPS || soops->type==SO_DEPSGRAPH) soops->type= SO_OUTLINER;
@@ -120,23 +140,23 @@ static void do_oops_viewmenu(void *arg, int event)
                        scrarea_queue_winredraw(curarea);
                }
                break;
-       case 5:
+       case 6:
                outliner_toggle_visible(curarea);
                break;
-       case 6:
+       case 7:
                outliner_show_hierarchy(curarea);
                break;
-       case 7:
+       case 8:
                outliner_show_active(curarea);
                break;
-       case 8:
+       case 9:
                outliner_one_level(curarea, 1);
                break;
-       case 9:
+       case 10:
                outliner_one_level(curarea, -1);
                break;
 #ifdef SHOWDEPGRAPH
-       case 10:
+       case 11:
                // show deps
                {
                        SpaceOops *soops= curarea->spacedata.first;
@@ -164,9 +184,9 @@ static uiBlock *oops_viewmenu(void *arg_unused)
        uiBlockSetButmFunc(block, do_oops_viewmenu, NULL);
        
        if(soops->type==SO_OOPS) {
-               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Outliner", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
+               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Outliner", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
 #ifdef SHOWDEPGRAPH
-               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Dependancies", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
+               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Dependancies", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
 #endif
                uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");  
 
@@ -176,31 +196,32 @@ static uiBlock *oops_viewmenu(void *arg_unused)
                uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");  
 
                uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
+               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
        }
 #ifdef SHOWDEPGRAPH
        else if(soops->type==SO_DEPSGRAPH) {
-               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Outliner", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Oops Schematic", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
+               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Outliner", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
+               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Oops Schematic", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
        }
 #endif
        else {
-               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Oops Schematic", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
+               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Oops Schematic", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
                
                uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
                
-               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Expand One Level|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
-               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Collapse One Level|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
+               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Expand One Level|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
+               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Collapse One Level|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
                
                uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");  
 
-               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show/Hide All", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hierarchy|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Active|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
+               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show/Hide All", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
+               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hierarchy|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
+               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Active|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
        }
        
        uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");  
-       if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
-       else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
+       if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
+       else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
        
        if(curarea->headertype==HEADERTOP) {
                uiBlockSetDirection(block, UI_DOWN);
@@ -306,6 +327,7 @@ static uiBlock *oops_blockmenu(void *arg_unused)
 }
 
 
+
 void oops_buttons(void)
 {      
        SpaceOops *soops;
@@ -359,6 +381,7 @@ void oops_buttons(void)
                        xmax= GetButStringLength("Block");
                        uiDefPulldownBut(block, oops_blockmenu, NULL, "Block", xco, -2, xmax-3, 24, "");
                        xco+= xmax;
+                       
                }
        }
 
index 4316c4837cf927c357795f03dd2f54f4336b8f71..b659362d60a4a03b3c0dfb632dec8c2994cc1320 100644 (file)
@@ -2472,93 +2472,84 @@ static void outliner_back(SpaceOops *soops)
        }
 }
 
-static void namebutton_cb(void *soopsp, void *oldnamep)
+static void namebutton_cb(void *tep, void *oldnamep)
 {
-       SpaceOops *soops= soopsp;
+       SpaceOops *soops= curarea->spacedata.first;
        TreeStore *ts= soops->treestore;
-       TreeStoreElem *tselem;
-       int a;
+       TreeElement *te= tep;
        
-       if(ts) {
-               /* only one namebutton can exist */
-               for(a=0, tselem= ts->data; a<ts->usedelem; a++, tselem++) {
-                       if(tselem->flag & TSE_TEXTBUT) {
-                               if(tselem->type==0) {
-                                       test_idbutton(tselem->id->name+2);      // library.c, unique name and alpha sort
-                               }
-                               else {
-                                       TreeElement *te= outliner_find_tree_element(&soops->tree, a);
+       if(ts && te) {
+               TreeStoreElem *tselem= TREESTORE(te);
+
+               if(tselem->type==0) {
+                       test_idbutton(tselem->id->name+2);      // library.c, unique name and alpha sort
+               }
+               else {
+                       switch(tselem->type) {
+                       case TSE_DEFGROUP:
+                               unique_vertexgroup_name(te->directdata, (Object *)tselem->id); //       id = object
+                               break;
+                       case TSE_NLA_ACTION:
+                               test_idbutton(tselem->id->name+2);
+                               break;
+                       case TSE_EBONE:
+                               if(G.obedit && G.obedit->data==(ID *)tselem->id) {
+                                       EditBone *ebone= te->directdata;
+                                       char newname[32];
                                        
-                                       if(te) {
-                                               switch(tselem->type) {
-                                               case TSE_DEFGROUP:
-                                                       unique_vertexgroup_name(te->directdata, (Object *)tselem->id); //       id = object
-                                                       break;
-                                               case TSE_NLA_ACTION:
-                                                       test_idbutton(tselem->id->name+2);
-                                                       break;
-                                               case TSE_EBONE:
-                                                       if(G.obedit && G.obedit->data==(ID *)tselem->id) {
-                                                               EditBone *ebone= te->directdata;
-                                                               char newname[32];
-                                                               
-                                                               /* restore bone name */
-                                                               BLI_strncpy(newname, ebone->name, 32);
-                                                               BLI_strncpy(ebone->name, oldnamep, 32);
-                                                               armature_bone_rename(G.obedit->data, oldnamep, newname);
-                                                       }
-                                                       allqueue(REDRAWOOPS, 0);
-                                                       allqueue(REDRAWVIEW3D, 1);
-                                                       allqueue(REDRAWBUTSEDIT, 0);
-                                                       break;
+                                       /* restore bone name */
+                                       BLI_strncpy(newname, ebone->name, 32);
+                                       BLI_strncpy(ebone->name, oldnamep, 32);
+                                       armature_bone_rename(G.obedit->data, oldnamep, newname);
+                               }
+                               allqueue(REDRAWOOPS, 0);
+                               allqueue(REDRAWVIEW3D, 1);
+                               allqueue(REDRAWBUTSEDIT, 0);
+                               break;
 
-                                               case TSE_BONE:
-                                                       {
-                                                               Bone *bone= te->directdata;
-                                                               Object *ob;
-                                                               char newname[32];
-                                                               
-                                                               // always make current object active
-                                                               tree_element_active_object(soops, te);
-                                                               ob= OBACT;
-                                                               
-                                                               /* restore bone name */
-                                                               BLI_strncpy(newname, bone->name, 32);
-                                                               BLI_strncpy(bone->name, oldnamep, 32);
-                                                               armature_bone_rename(ob->data, oldnamep, newname);
-                                                       }
-                                                       allqueue(REDRAWOOPS, 0);
-                                                       allqueue(REDRAWVIEW3D, 1);
-                                                       allqueue(REDRAWBUTSEDIT, 0);
-                                                       break;
-                                               case TSE_POSE_CHANNEL:
-                                                       {
-                                                               bPoseChannel *pchan= te->directdata;
-                                                               Object *ob;
-                                                               char newname[32];
-                                                               
-                                                               // always make current object active
-                                                               tree_element_active_object(soops, te);
-                                                               ob= OBACT;
-                                                               
-                                                               /* restore bone name */
-                                                               BLI_strncpy(newname, pchan->name, 32);
-                                                               BLI_strncpy(pchan->name, oldnamep, 32);
-                                                               armature_bone_rename(ob->data, oldnamep, newname);
-                                                       }
-                                                       allqueue(REDRAWOOPS, 0);
-                                                       allqueue(REDRAWVIEW3D, 1);
-                                                       allqueue(REDRAWBUTSEDIT, 0);
-                                                       break;
-                                                       
-                                               }
-                                       }
+                       case TSE_BONE:
+                               {
+                                       Bone *bone= te->directdata;
+                                       Object *ob;
+                                       char newname[32];
+                                       
+                                       // always make current object active
+                                       tree_element_active_object(soops, te);
+                                       ob= OBACT;
+                                       
+                                       /* restore bone name */
+                                       BLI_strncpy(newname, bone->name, 32);
+                                       BLI_strncpy(bone->name, oldnamep, 32);
+                                       armature_bone_rename(ob->data, oldnamep, newname);
+                               }
+                               allqueue(REDRAWOOPS, 0);
+                               allqueue(REDRAWVIEW3D, 1);
+                               allqueue(REDRAWBUTSEDIT, 0);
+                               break;
+                       case TSE_POSE_CHANNEL:
+                               {
+                                       bPoseChannel *pchan= te->directdata;
+                                       Object *ob;
+                                       char newname[32];
+                                       
+                                       // always make current object active
+                                       tree_element_active_object(soops, te);
+                                       ob= OBACT;
+                                       
+                                       /* restore bone name */
+                                       BLI_strncpy(newname, pchan->name, 32);
+                                       BLI_strncpy(pchan->name, oldnamep, 32);
+                                       armature_bone_rename(ob->data, oldnamep, newname);
                                }
-                               tselem->flag &= ~TSE_TEXTBUT;
+                               allqueue(REDRAWOOPS, 0);
+                               allqueue(REDRAWVIEW3D, 1);
+                               allqueue(REDRAWBUTSEDIT, 0);
+                               break;
+                               
                        }
                }
-               scrarea_queue_redraw(curarea);
        }
+       scrarea_queue_redraw(curarea);
 }
 
 static void outliner_buttons(uiBlock *block, SpaceOops *soops, ListBase *lb)
@@ -2580,7 +2571,7 @@ static void outliner_buttons(uiBlock *block, SpaceOops *soops, ListBase *lb)
                        if(dx<50) dx= 50;
                        
                        bt= uiDefBut(block, TEX, OL_NAMEBUTTON, "",  te->xs+2*OL_X-4, te->ys, dx+10, OL_H-1, te->name, 1.0, (float)len-1, 0, 0, "");
-                       uiButSetFunc(bt, namebutton_cb, soops, NULL);
+                       uiButSetFunc(bt, namebutton_cb, te, NULL);
 
                        // signal for button to open
                        addqueue(curarea->win, BUT_ACTIVATE, OL_NAMEBUTTON);
index cfadcc44ec8a8d0d5ded352eb4b76ded4ba04fe2..ee10006addc1352c83acf313c4146bfe63477b0c 100644 (file)
@@ -4146,6 +4146,11 @@ static void winqreadoopsspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                        if((G.qual==0))
                                do_oops_buttons(B_OOPSHOME);
                        break;
+               
+               case PADPERIOD:
+                       if((G.qual==0))
+                               do_oops_buttons(B_OOPSVIEWSEL);
+                       break;
                        
                case AKEY:
                        if((G.qual==0)) {
index bb8e433251b109426571d584fb700691a5a23be3..3e67eb1ca1f6a0cd7f1918c0158952637b413c13 100644 (file)
@@ -425,6 +425,8 @@ void persptoetsen(unsigned short event)
                                if(((G.qual & LR_CTRLKEY) && (G.qual & LR_ALTKEY)) || (G.qual & LR_SHIFTKEY)) {
                                        void setcameratoview3d(void);   // view.c
                                        setcameratoview3d();
+                                       DAG_object_flush_update(G.scene, G.scene->camera, OB_RECALC_OB);
+                                       allqueue(REDRAWVIEW3D, 0);
                                }                               
                        }
                }