Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2005-12-17 23:25:41 +0300
committerTon Roosendaal <ton@blender.org>2005-12-17 23:25:41 +0300
commit510403277be6c5b34d01b386bfbf66871348f555 (patch)
treecb7a57d6f52fa6fc733993aa58e5b76fe34cf23e /source/blender
parent6d9cda7aaaf117d8043dc850289254dbf1da01b4 (diff)
parent66d0d7e2dbd327988b7418f5ce1bd1cd4beb5927 (diff)
Saturday merger of bf-blender in orange branch.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenloader/intern/readfile.c5
-rw-r--r--source/blender/include/BIF_drawoops.h2
-rw-r--r--source/blender/include/BSE_drawoops.h2
-rw-r--r--source/blender/include/blendef.h1
-rw-r--r--source/blender/makesdna/DNA_material_types.h2
-rw-r--r--source/blender/python/api2_2x/BezTriple.c26
-rw-r--r--source/blender/python/api2_2x/Image.c9
-rw-r--r--source/blender/python/api2_2x/Ipocurve.c6
-rw-r--r--source/blender/python/api2_2x/Material.c71
-rw-r--r--source/blender/python/api2_2x/Types.c1
-rw-r--r--source/blender/python/api2_2x/doc/Ipo.py8
-rw-r--r--source/blender/python/api2_2x/doc/Material.py36
-rw-r--r--source/blender/src/buttons_shading.c6
-rw-r--r--source/blender/src/drawoops.c8
-rw-r--r--source/blender/src/editoops.c11
-rw-r--r--source/blender/src/header_oops.c67
-rw-r--r--source/blender/src/outliner.c149
-rw-r--r--source/blender/src/space.c5
-rw-r--r--source/blender/src/toets.c2
19 files changed, 218 insertions, 199 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 5c0843b1873..0cccf770fda 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -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);
}
diff --git a/source/blender/include/BIF_drawoops.h b/source/blender/include/BIF_drawoops.h
index d60d8b2e0de..b42158d14fe 100644
--- a/source/blender/include/BIF_drawoops.h
+++ b/source/blender/include/BIF_drawoops.h
@@ -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
diff --git a/source/blender/include/BSE_drawoops.h b/source/blender/include/BSE_drawoops.h
index 78a8107f8e2..43e1dee5943 100644
--- a/source/blender/include/BSE_drawoops.h
+++ b/source/blender/include/BSE_drawoops.h
@@ -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);
diff --git a/source/blender/include/blendef.h b/source/blender/include/blendef.h
index 05e06afca4e..c79370513fa 100644
--- a/source/blender/include/blendef.h
+++ b/source/blender/include/blendef.h
@@ -248,6 +248,7 @@
#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 */
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index 8e150b10a82..79d73ff2b99 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -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
diff --git a/source/blender/python/api2_2x/BezTriple.c b/source/blender/python/api2_2x/BezTriple.c
index 324ba2958bb..98e53d2fef8 100644
--- a/source/blender/python/api2_2x/BezTriple.c
+++ b/source/blender/python/api2_2x/BezTriple.c
@@ -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 );
diff --git a/source/blender/python/api2_2x/Image.c b/source/blender/python/api2_2x/Image.c
index ffd129f303a..f7d135fe7b3 100644
--- a/source/blender/python/api2_2x/Image.c
+++ b/source/blender/python/api2_2x/Image.c
@@ -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 );
diff --git a/source/blender/python/api2_2x/Ipocurve.c b/source/blender/python/api2_2x/Ipocurve.c
index 3b6b9bdced4..608458e476d 100644
--- a/source/blender/python/api2_2x/Ipocurve.c
+++ b/source/blender/python/api2_2x/Ipocurve.c
@@ -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;
diff --git a/source/blender/python/api2_2x/Material.c b/source/blender/python/api2_2x/Material.c
index e0fe70b54f8..b9f9937d1fd 100644
--- a/source/blender/python/api2_2x/Material.c
+++ b/source/blender/python/api2_2x/Material.c
@@ -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;
/*
diff --git a/source/blender/python/api2_2x/Types.c b/source/blender/python/api2_2x/Types.c
index 2fdaf063862..6f5bbac6a3a 100644
--- a/source/blender/python/api2_2x/Types.c
+++ b/source/blender/python/api2_2x/Types.c
@@ -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;
diff --git a/source/blender/python/api2_2x/doc/Ipo.py b/source/blender/python/api2_2x/doc/Ipo.py
index d7776553ff9..b4a99c0216b 100644
--- a/source/blender/python/api2_2x/doc/Ipo.py
+++ b/source/blender/python/api2_2x/doc/Ipo.py
@@ -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():
diff --git a/source/blender/python/api2_2x/doc/Material.py b/source/blender/python/api2_2x/doc/Material.py
index 80d741d1d9f..d86d00cc5cf 100644
--- a/source/blender/python/api2_2x/doc/Material.py
+++ b/source/blender/python/api2_2x/doc/Material.py
@@ -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.
diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c
index f12707d7ac4..fcbe1a5d71c 100644
--- a/source/blender/src/buttons_shading.c
+++ b/source/blender/src/buttons_shading.c
@@ -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();
diff --git a/source/blender/src/drawoops.c b/source/blender/src/drawoops.c
index 2cc39627d9d..4ecc31eb082 100644
--- a/source/blender/src/drawoops.c
+++ b/source/blender/src/drawoops.c
@@ -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);
diff --git a/source/blender/src/editoops.c b/source/blender/src/editoops.c
index e9eacda9753..6c8fa7d5f9d 100644
--- a/source/blender/src/editoops.c
+++ b/source/blender/src/editoops.c
@@ -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;
}
}
diff --git a/source/blender/src/header_oops.c b/source/blender/src/header_oops.c
index a8f90b95ed8..a3f068dc5a5 100644
--- a/source/blender/src/header_oops.c
+++ b/source/blender/src/header_oops.c
@@ -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;
+
}
}
diff --git a/source/blender/src/outliner.c b/source/blender/src/outliner.c
index 4316c4837cf..b659362d60a 100644
--- a/source/blender/src/outliner.c
+++ b/source/blender/src/outliner.c
@@ -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);
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index cfadcc44ec8..ee10006addc 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -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)) {
diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c
index bb8e433251b..3e67eb1ca1f 100644
--- a/source/blender/src/toets.c
+++ b/source/blender/src/toets.c
@@ -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);
}
}
}