diff options
author | Ton Roosendaal <ton@blender.org> | 2005-12-02 16:55:13 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-12-02 16:55:13 +0300 |
commit | 066f79cfa4ca23b8fefc8612c3c6c80866549aa9 (patch) | |
tree | 8c6271986ded1be2641af8f368c46c64f0e1e8d7 | |
parent | d1c59501214a4616fb65f2010072397f08e0e021 (diff) | |
parent | a332c7c387b3b154fb7479f2ac1bd0d232c812de (diff) |
Friday merge of bf-blender into orange branch.
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/modifier.c | 15 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/softbody.c | 2 | ||||
-rw-r--r-- | source/blender/python/api2_2x/CurNurb.c | 21 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Effect.c | 2 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Library.c | 6 | ||||
-rw-r--r-- | source/blender/python/api2_2x/doc/Curve.py | 32 | ||||
-rw-r--r-- | source/blender/render/intern/source/rendercore.c | 49 | ||||
-rw-r--r-- | source/blender/src/booleanops.c | 2 | ||||
-rw-r--r-- | source/blender/src/buttons_editing.c | 5 | ||||
-rw-r--r-- | source/blender/src/buttons_object.c | 2 | ||||
-rw-r--r-- | source/blender/src/editobject.c | 4 |
12 files changed, 106 insertions, 37 deletions
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 4f62748e20e..9273bd8eb71 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1104,8 +1104,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase) v2= bezt->vec[0]; forward_diff_bezier(v1[0], v1[3], v2[0], v2[3], data, nu->resolu, 3); forward_diff_bezier(v1[1], v1[4], v2[1], v2[4], data+1, nu->resolu, 3); - if((nu->type & 8)==0) - forward_diff_bezier(v1[2], v1[5], v2[2], v2[5], data+2, nu->resolu, 3); + forward_diff_bezier(v1[2], v1[5], v2[2], v2[5], data+2, nu->resolu, 3); data+= 3*nu->resolu; } diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 19bd31386ff..ea65d311e53 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -1586,12 +1586,15 @@ int modifiers_isDeformed(Object *ob) ModifierData *md = modifiers_getVirtualModifierList(ob); for (; md; md=md->next) { - if (md->type==eModifierType_Armature) - return 1; - if (md->type==eModifierType_Curve) - return 1; - if (md->type==eModifierType_Lattice) - return 1; + if(ob==G.obedit && (md->mode & eModifierMode_Editmode)==0); + else { + if (md->type==eModifierType_Armature) + return 1; + if (md->type==eModifierType_Curve) + return 1; + if (md->type==eModifierType_Lattice) + return 1; + } } return 0; } diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index e2b2738ed5f..5b98a3bf794 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -1293,7 +1293,7 @@ static void softbody_baked_add(Object *ob, float framenr) dfra= (float)sb->interval; if(sb->totkey==0) { - if(sb->sfra >= sb->efra) return; /* safety, UI or py setting allows * + if(sb->sfra >= sb->efra) return; /* safety, UI or py setting allows */ if(sb->interval<1) sb->interval= 1; /* just be sure */ sb->totkey= 1 + (int)(ceil( (efra-sfra)/dfra ) ); diff --git a/source/blender/python/api2_2x/CurNurb.c b/source/blender/python/api2_2x/CurNurb.c index 0b5f09c0efc..922178f7662 100644 --- a/source/blender/python/api2_2x/CurNurb.c +++ b/source/blender/python/api2_2x/CurNurb.c @@ -638,7 +638,8 @@ static PyObject *CurNurb_getFlagU( BPy_CurNurb * self ) * * set curve's flagu and recalculate the knots * - * Possible values: 0 - uniform, 1 - endpoints, 2 - bezier + * Possible values: 0 - uniform, 2 - endpoints, 4 - bezier + * bit 0 controls CU_CYCLIC */ static PyObject *CurNurb_setFlagU( BPy_CurNurb * self, PyObject * args ) @@ -646,9 +647,12 @@ static PyObject *CurNurb_setFlagU( BPy_CurNurb * self, PyObject * args ) int flagu; if( !PyArg_ParseTuple( args, "i", &( flagu ) ) ) - return ( EXPP_ReturnPyObjError - ( PyExc_AttributeError, - "expected integer argument" ) ); + return EXPP_ReturnPyObjError( PyExc_TypeError, + "expected integer argument in range [0,5]" ); + + if( flagu < 0 || flagu > 5 ) + return EXPP_ReturnPyObjError( PyExc_AttributeError, + "expected integer argument in range [0,5]" ); if( self->nurb->flagu != flagu ) { self->nurb->flagu = (short)flagu; @@ -689,9 +693,12 @@ static PyObject *CurNurb_setFlagV( BPy_CurNurb * self, PyObject * args ) int flagv; if( !PyArg_ParseTuple( args, "i", &( flagv ) ) ) - return ( EXPP_ReturnPyObjError - ( PyExc_AttributeError, - "expected integer argument" ) ); + return EXPP_ReturnPyObjError( PyExc_TypeError, + "expected integer argument in range [0,5]" ); + + if( flagv < 0 || flagv > 5 ) + return EXPP_ReturnPyObjError( PyExc_AttributeError, + "expected integer argument in range [0,5]" ); if( self->nurb->flagv != flagv ) { self->nurb->flagv = (short)flagv; diff --git a/source/blender/python/api2_2x/Effect.c b/source/blender/python/api2_2x/Effect.c index fab16c7e8f3..975770f2d3a 100644 --- a/source/blender/python/api2_2x/Effect.c +++ b/source/blender/python/api2_2x/Effect.c @@ -734,7 +734,7 @@ PyObject *Effect_Init( void ) dict = PyModule_GetDict( submodule ); - EXPP_dict_set_item_str( dict, "Particle", particle ); + PyDict_SetItemString( dict, "Particle", particle ); return ( submodule ); } diff --git a/source/blender/python/api2_2x/Library.c b/source/blender/python/api2_2x/Library.c index 54f4676306b..a4b97bfeef6 100644 --- a/source/blender/python/api2_2x/Library.c +++ b/source/blender/python/api2_2x/Library.c @@ -39,6 +39,7 @@ #include "DNA_object_types.h" #include "BKE_library.h" /* for all_local */ #include "BKE_font.h" /* for text_to_curve */ +#include "BKE_utildefines.h" #include "BKE_global.h" #include "BKE_main.h" #include "BLO_readfile.h" @@ -137,6 +138,8 @@ struct PyMethodDef M_Library_methods[] = { PyObject *M_Library_Open( PyObject * self, PyObject * args ) { char *fname = NULL; + char filename[FILE_MAXDIR+FILE_MAXFILE]; + int len = 0; if( !PyArg_ParseTuple( args, "s", &fname ) ) { @@ -149,7 +152,10 @@ PyObject *M_Library_Open( PyObject * self, PyObject * args ) Py_DECREF( Py_None ); /* incref'ed by above function */ } + /* G.sce = last file loaded, save for UI and restore after opening file */ + BLI_strncpy(filename, G.sce, sizeof(filename)); bpy_openlib = BLO_blendhandle_from_file( fname ); + BLI_strncpy(G.sce, filename, sizeof(filename)); if( !bpy_openlib ) return Py_BuildValue( "i", 0 ); diff --git a/source/blender/python/api2_2x/doc/Curve.py b/source/blender/python/api2_2x/doc/Curve.py index 72ed08456e6..91396a2eccf 100644 --- a/source/blender/python/api2_2x/doc/Curve.py +++ b/source/blender/python/api2_2x/doc/Curve.py @@ -418,8 +418,8 @@ class CurNurb: The CurNurb also supports the sequence protocol which means you can access the control points of a CurNurb using the [] operator. - @ivar flagU: The CurNurb knot flag U. See L{setFlagU} for bit definitions. - @ivar flagV: The CurNurb knot flag V (0: uniform, 1: endpoints, 2: bezier) + @ivar flagU: The CurNurb knot flag U. See L{setFlagU} for description. + @ivar flagV: The CurNurb knot flag V. See L{setFlagU} for description. @ivar type: The type of the curve (Poly: 0, Bezier: 1, NURBS: 4) """ @@ -484,35 +484,37 @@ class CurNurb: def getFlagU(): """ - Get the CurNurb knot flag U. This flag is a bitfield. See L{setFlagU} for bit definitions. + Get the CurNurb knot flag U. @rtype: integer - @return: 0 - uniform, 2 - endpoints, 4 - bezier + @return: See L{setFlagU} for description of return value. """ - def setFlagU( value ): + def setFlagU( flag ): """ - Set the entire CurNurb knot flag U (knots are recalculated automatically). Another of Blender's bitfields. - - bit 0: continuous. - - bit 1: endpoints. - - bit 2: bezier. - @type value: integer - @param value: CurNurb knot flag (0 - uniform, 2 - endpoints, 4 - bezier) + Set the entire CurNurb knot flag U (knots are recalculated automatically). + The flag can be one of six values: + - 0 or 1: uniform knots + - 2 or 3: endpoints knots + - 4 or 5: bezier knots + Bit 0 controls whether or not the curve is cyclic (1 = cyclic). + @type flag: integer + @param flag: CurNurb knot flag @rtype: PyNone @return: PyNone """ def getFlagV(): """ - Get the CurNurb knot flag V + Get the CurNurb knot flag V. @rtype: integer - @return: 0 - uniform, 1 - endpoints, 2 - bezier + @return: See L{setFlagU} for description of return value. """ def setFlagV( value ): """ - Set the CurNurb knot flag V (knots are recalculated automatically) + Set the CurNurb knot flag V (knots are recalculated automatically). @type value: integer - @param value: CurNurb knot flag (0 - uniform, 1 - endpoints, 2 - bezier) + @param value: See L{setFlagU} for description of return. @rtype: PyNone @return: PyNone """ diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 911a1c8fb14..26ac9b51af4 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -113,6 +113,48 @@ void calc_view_vector(float *view, float x, float y) } } +static void fogcolor(float *colf, float *rco, float *view) +{ + float alpha, stepsize, dist, hor[3], zen[3], vec[3], dview[3]; + float accum[4]={0.0f, 0.0f, 0.0f, 0.0f}, div=0.0f; + + hor[0]= R.wrld.horr; hor[1]= R.wrld.horg; hor[2]= R.wrld.horb; + zen[0]= R.wrld.zenr; zen[1]= R.wrld.zeng; zen[2]= R.wrld.zenb; + + VECCOPY(vec, rco); + + /* we loop from cur coord to mist start in steps */ + stepsize= 1.0f; + + div= ABS(view[2]); + dview[0]= view[0]/(stepsize*div); + dview[1]= view[1]/(stepsize*div); + dview[2]= -stepsize; + +if(G.rt) printf("\n"); + for(dist= -rco[2]; dist>R.wrld.miststa; dist-= stepsize) { + + hor[0]= R.wrld.horr; hor[1]= R.wrld.horg; hor[2]= R.wrld.horb; + alpha= 1.0f; + do_sky_tex(vec, vec, NULL, hor, zen, &alpha); +if(G.rt) printf("dist %f ", dist); +if(G.rt) printvecf("vec", vec); + + accum[3]= (dist-R.wrld.miststa)/R.wrld.mistdist; +if(G.rt) printf("accum %f\n", accum[3]); + accum[3]= hor[0]*accum[3]; + + /* premul! */ + accum[0]= hor[0]*accum[3]; + accum[1]= hor[1]*accum[3]; + accum[2]= hor[2]*accum[3]; + addAlphaOverFloat(colf, accum); + + VECSUB(vec, vec, dview); + } + +} + float mistfactor(float zcor, float *co) /* dist en height, return alpha */ { float fac, hi; @@ -2333,8 +2375,13 @@ void *shadepixel(float x, float y, int z, int facenr, int mask, float *col, floa } } + /* FOG */ + if(0) {//(R.wrld.mode & WO_MIST) && (shi.mat->mode & MA_NOMIST)==0 ) { + fogcolor(col, shi.co, shi.view); + } + /* MIST */ - if( (R.wrld.mode & WO_MIST) && (shi.mat->mode & MA_NOMIST)==0 ) { + if((R.wrld.mode & WO_MIST) && (shi.mat->mode & MA_NOMIST)==0 ) { if(R.r.mode & R_ORTHO) alpha= mistfactor(-shi.co[2], shi.co); else diff --git a/source/blender/src/booleanops.c b/source/blender/src/booleanops.c index 414ea4a5d57..1b1d5705ab9 100644 --- a/source/blender/src/booleanops.c +++ b/source/blender/src/booleanops.c @@ -694,7 +694,7 @@ NewBooleanMesh( ); } - if (success) { + if (success==1) { // descriptions of the output; CSG_VertexIteratorDescriptor vd_o; CSG_FaceIteratorDescriptor fd_o; diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 17b72a856c2..8292357698b 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -511,6 +511,7 @@ void do_common_editbuts(unsigned short event) // old name, is a mix of object an allqueue(REDRAWVIEW3D, 0); } } + countall(); break; case B_HIDE: if(G.obedit) { @@ -3028,11 +3029,13 @@ void do_meshbuts(unsigned short event) sel_verts_defgroup(1); allqueue (REDRAWVIEW3D, 1); allqueue(REDRAWOOPS, 0); + countall(); break; case B_DESELVGROUP: sel_verts_defgroup(0); allqueue (REDRAWVIEW3D, 1); allqueue(REDRAWOOPS, 0); + countall(); break; case B_LINKEDVGROUP: copy_linked_vgroup_channels(ob); @@ -3091,7 +3094,6 @@ void do_meshbuts(unsigned short event) break; } } - if(G.obedit==0 || (G.obedit->type!=OB_MESH)) return; switch(event) { @@ -3168,6 +3170,7 @@ void do_meshbuts(unsigned short event) allqueue(REDRAWVIEW3D, 0); break; } + /* WATCH IT: previous events only in editmode! */ } diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index b3d84eb18ed..8281ce7bc8f 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -1896,7 +1896,7 @@ static void object_softbodies(Object *ob) uiDefButF(block, NUM, B_SOFTBODY_CHANGE, "Goal:", 160,100,150,20, &sb->defgoal, 0.0, 1.0, 10, 0, "Default Goal (vertex target position) value, when no Vertex Group used"); } else { - uiDefButS(block, TOG, B_SOFTBODY_CHANGE, "W", 140,100,20,20, &sb->vertgroup, 0, 1, 0, 0, "Use Lattice weight values"); + uiDefButS(block, TOG, B_SOFTBODY_CHANGE, "W", 140,100,20,20, &sb->vertgroup, 0, 1, 0, 0, "Use control point weight values"); uiDefButF(block, NUM, B_SOFTBODY_CHANGE, "Goal:", 160,100,150,20, &sb->defgoal, 0.0, 1.0, 10, 0, "Default Goal (vertex target position) value, when no Vertex Group used"); } diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index a7a8ba0c5a6..811dbd79f23 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -2022,9 +2022,11 @@ void special_editmenu(void) waitcursor(1); ret = NewBooleanMesh(BASACT,base_select,nr); if (ret==0) { - error("An internal error occurred -- sorry!"); + error("An internal error occurred"); } else if(ret==-1) { error("Selected meshes must have faces to perform boolean operations"); + } else if (ret==-2) { + error("Both meshes must be a closed mesh"); } else BIF_undo_push("Boolean"); waitcursor(0); |