From 4a8087db763496acc9dd0b7188557374c4c60322 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 15 Dec 2005 02:06:37 +0000 Subject: Fixed some warnings from GetCurrent, remaining warnings seem to have no obvious solution attr = Py_True; // Image.c:1107: warning: dereferencing type-punned pointer will break strict-aliasing rules --- source/blender/python/api2_2x/Image.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/Image.c b/source/blender/python/api2_2x/Image.c index ffd129f303a..a6de6d21263 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 ); } @@ -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 ); -- cgit v1.2.3 From eaeb1253376ccef80a9453993bc4156bc334a6b6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 15 Dec 2005 02:50:08 +0000 Subject: Made Ctrl+RMB on an image in the oops view, activates images in the UV/Image window. Faster way to flick through images. --- source/blender/src/editoops.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source') 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; } } -- cgit v1.2.3 From 4a708ae5404f8f7db73f8702541af8f15c6dd79e Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 15 Dec 2005 18:37:47 +0000 Subject: Disabled reading Groups from bf-blender. There was old rudimentary code for Groups in official release still, which will give very bad results when loading an Orange branch file with bf-blender, save over, and read back in Orange branch. Now, reading files with Groups in bf-blender will just completely ignore them (not read nor save). That's destructive, but normal behaviour and stable. --- source/blender/blenloader/intern/readfile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index cb4e7546b53..455c45b00ea 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5186,7 +5186,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); } -- cgit v1.2.3 From 6e7e6d23574dfdc68c6ddbf7e3a004812e638379 Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Thu, 15 Dec 2005 19:12:31 +0000 Subject: -- removed redundant initialization for Mesh_Type (thanks LetterRip) --- source/blender/python/api2_2x/Types.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source') 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; -- cgit v1.2.3 From 641f3cd72ddee21efc542e55c8f5178edab7fd88 Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Thu, 15 Dec 2005 20:55:52 +0000 Subject: -- Fix misspelling in Material's TraShad tooltip. --- source/blender/src/buttons_shading.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 98d4d5d537f..dc784486dc9 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -3071,7 +3071,7 @@ static void material_panel_shading(Material *ma) uiBlockBeginAlign(block); uiDefButBitI(block, TOG, MA_SHADOW, 0, "Shadow", 245,120,65,19, &(ma->mode), 0, 0, 0, 0, "Makes material receive shadows"); - uiDefButBitI(block, TOG, MA_SHADOW_TRA, 0, "TraShadow", 245,100,65,19, &(ma->mode), 0, 0, 0, 0, "Recieves transparent shadows based at material color and alpha"); + uiDefButBitI(block, TOG, MA_SHADOW_TRA, 0, "TraShadow", 245,100,65,19, &(ma->mode), 0, 0, 0, 0, "Receives transparent shadows based at material color and alpha"); uiDefButBitI(block, TOG, MA_RAYBIAS, 0, "Bias", 245,80,65,19, &(ma->mode), 0, 0, 0, 0, "Prevents ray traced shadow errors with phong interpolated normals (terminator problem)"); uiBlockEndAlign(block); -- cgit v1.2.3 From 826591d778dc30fa727473757b11eb8b31cec5ab Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Thu, 15 Dec 2005 21:54:00 +0000 Subject: -- Added BPy support for new Material modes. Recent additions of new mode bits broke input-checking in the API, so added a bitmask #define in DNA_material_types.h which contains all valid mode bits. --- source/blender/makesdna/DNA_material_types.h | 2 + source/blender/python/api2_2x/Material.c | 71 +++++---------------------- source/blender/python/api2_2x/doc/Material.py | 36 ++++++++------ 3 files changed, 36 insertions(+), 73 deletions(-) (limited to 'source') diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 5ef327502e1..451b8ba692f 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -157,6 +157,8 @@ typedef struct Material { #define MA_TANGENT_STR 0x1000000 #define MA_SHADBUF 0x2000000 +#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/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/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. -- cgit v1.2.3 From 3a50444ad4e50f7dedfb8a0ba990d2f30b79b43c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 16 Dec 2005 13:50:45 +0000 Subject: Oops, left the script menu in there. problems. --- source/blender/include/BIF_drawoops.h | 2 +- source/blender/include/BSE_drawoops.h | 2 +- source/blender/include/blendef.h | 1 + source/blender/src/drawoops.c | 8 ++--- source/blender/src/header_oops.c | 67 +++++++++++++++++++++++------------ source/blender/src/space.c | 5 +++ 6 files changed, 57 insertions(+), 28 deletions(-) (limited to 'source') 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 ab36972ea18..cc6e8d054f5 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/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/header_oops.c b/source/blender/src/header_oops.c index 1da5dc6100f..6316d6d6bac 100644 --- a/source/blender/src/header_oops.c +++ b/source/blender/src/header_oops.c @@ -71,6 +71,9 @@ #include "BKE_depsgraph.h" +#include "BPY_extern.h" +#include "BPY_menus.h" + static int viewmovetemp = 0; void do_oops_buttons(short event) @@ -82,7 +85,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); @@ -93,7 +96,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); @@ -115,10 +132,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; @@ -128,23 +148,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; @@ -172,9 +192,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, ""); @@ -184,31 +204,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); @@ -314,6 +335,7 @@ static uiBlock *oops_blockmenu(void *arg_unused) } + void oops_buttons(void) { SpaceOops *soops; @@ -367,6 +389,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/space.c b/source/blender/src/space.c index 5c07f1ba341..b89be1ad436 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -4142,6 +4142,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)) { -- cgit v1.2.3 From e76e78e78a9ab31b5e7c13fe76115f360ac8436b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 16 Dec 2005 22:40:20 +0000 Subject: typo, thanks letterrip. --- source/blender/python/api2_2x/Image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/Image.c b/source/blender/python/api2_2x/Image.c index a6de6d21263..f7d135fe7b3 100644 --- a/source/blender/python/api2_2x/Image.c +++ b/source/blender/python/api2_2x/Image.c @@ -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"}, -- cgit v1.2.3 From f73f226ed7338b8a0384bbada10ac80a3d5acbdd Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Sat, 17 Dec 2005 04:57:48 +0000 Subject: -- Bugfix #3617; addBezier() was not initializing all the attributes for a the beztriple, so things like the hidden and handle select states were set to random values. Added a beztriple.hide attribute so that the hide attribute can be set/cleared from the BPy API. --- source/blender/python/api2_2x/BezTriple.c | 26 +++++++++++++++++++------- source/blender/python/api2_2x/Ipocurve.c | 6 ++++-- source/blender/python/api2_2x/doc/Ipo.py | 8 ++++++-- 3 files changed, 29 insertions(+), 11 deletions(-) (limited to 'source') 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/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/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(): -- cgit v1.2.3 From dd8edc92cb8258aad5c6f467fbf7f87c7d550f0a Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sat, 17 Dec 2005 13:06:22 +0000 Subject: Environment mapping "Reload" button didn't work. Required more stuff to reset. --- source/blender/src/buttons_shading.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index dc784486dc9..246e9daa390 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(); -- cgit v1.2.3 From 16b6f81a7c08ff8a4343df38fcce7768e0213118 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sat, 17 Dec 2005 14:27:33 +0000 Subject: * ctrl-alt-numpad0 didn't correctly update 3dview when the camera had anything parented to it. Fix for #3596 (http://projects.blender.org/tracker/index.php?func=detail&aid=3596&group_id=9&atid=125) --- source/blender/src/toets.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source') diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c index 0fee06a65d8..a99355359f1 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); } } } -- cgit v1.2.3 From 66d0d7e2dbd327988b7418f5ce1bd1cd4beb5927 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sat, 17 Dec 2005 20:22:36 +0000 Subject: Ack! Error in the renaming code for outliner, it skipped doing the handling callbacks that checked for double names... this was caused by a bugfix I did a week ago for ESC on rename button in outliner. Discovered in time by Andy, thanks! --- source/blender/src/outliner.c | 149 ++++++++++++++++++++---------------------- 1 file changed, 70 insertions(+), 79 deletions(-) (limited to 'source') diff --git a/source/blender/src/outliner.c b/source/blender/src/outliner.c index b565fb2f340..d7cc7bdc478 100644 --- a/source/blender/src/outliner.c +++ b/source/blender/src/outliner.c @@ -2393,93 +2393,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; ausedelem; 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); } - tselem->flag &= ~TSE_TEXTBUT; + 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; + } } - scrarea_queue_redraw(curarea); } + scrarea_queue_redraw(curarea); } static void outliner_buttons(uiBlock *block, SpaceOops *soops, ListBase *lb) @@ -2501,7 +2492,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); -- cgit v1.2.3