diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-08-30 03:41:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-08-30 03:41:09 +0400 |
commit | 75697c40a039e8f64573bedd5211c442e2af9e9c (patch) | |
tree | af111682037c4568eec377984005928046d867b6 /source | |
parent | c2696ae63182da338d69a5127f03b1ad8b88f6c9 (diff) | |
parent | d7bf9688ac78169a37fbfc0d3d5bcd5b5be19170 (diff) |
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r22717:22875
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/object/object_edit.c | 11 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 26 | ||||
-rw-r--r-- | source/blender/render/intern/source/rayshade.c | 17 | ||||
-rw-r--r-- | source/blender/render/intern/source/rendercore.c | 2 | ||||
-rw-r--r-- | source/gameengine/Converter/BL_BlenderDataConversion.cpp | 4 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_GameObject.cpp | 8 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.cpp | 27 | ||||
-rw-r--r-- | source/gameengine/PyDoc/GameLogic.py | 8 |
9 files changed, 45 insertions, 59 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 4b7d3474d98..04187c93196 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -6367,6 +6367,17 @@ static Base *object_add_duplicate_internal(Scene *scene, Base *base, int dupflag } } } + if(dupflag & USER_DUP_PSYS) { + ParticleSystem *psys; + for(psys=obn->particlesystem.first; psys; psys=psys->next) { + id= (ID*) psys->part; + if(id) { + ID_NEW_US(psys->part) + else psys->part= psys_copy_settings(psys->part); + id->us--; + } + } + } id= obn->data; didit= 0; diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 100f55ffe33..826eea43a4d 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -440,6 +440,7 @@ extern UserDef U; /* from blenkernel blender.c */ #define USER_DUP_TEX (1 << 8) #define USER_DUP_ARM (1 << 9) #define USER_DUP_ACT (1 << 10) +#define USER_DUP_PSYS (1 << 11) /* gameflags */ #define USER_DEPRECATED_FLAG 1 diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 946aa1cd682..ba980d4caf4 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -1864,47 +1864,51 @@ static void rna_def_userdef_edit(BlenderRNA *brna) prop= RNA_def_property(srna, "duplicate_mesh", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MESH); - RNA_def_property_ui_text(prop, "Duplicate Mesh", "Causes mesh data to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Mesh", "Causes mesh data to be duplicated with the object."); prop= RNA_def_property(srna, "duplicate_surface", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_SURF); - RNA_def_property_ui_text(prop, "Duplicate Surface", "Causes surface data to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Surface", "Causes surface data to be duplicated with the object."); prop= RNA_def_property(srna, "duplicate_curve", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_CURVE); - RNA_def_property_ui_text(prop, "Duplicate Curve", "Causes curve data to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Curve", "Causes curve data to be duplicated with the object."); prop= RNA_def_property(srna, "duplicate_text", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_FONT); - RNA_def_property_ui_text(prop, "Duplicate Text", "Causes text data to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Text", "Causes text data to be duplicated with the object."); prop= RNA_def_property(srna, "duplicate_metaball", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MBALL); - RNA_def_property_ui_text(prop, "Duplicate Metaball", "Causes metaball data to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Metaball", "Causes metaball data to be duplicated with the object."); prop= RNA_def_property(srna, "duplicate_armature", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ARM); - RNA_def_property_ui_text(prop, "Duplicate Armature", "Causes armature data to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Armature", "Causes armature data to be duplicated with the object."); prop= RNA_def_property(srna, "duplicate_lamp", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_LAMP); - RNA_def_property_ui_text(prop, "Duplicate Lamp", "Causes lamp data to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Lamp", "Causes lamp data to be duplicated with the object."); prop= RNA_def_property(srna, "duplicate_material", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MAT); - RNA_def_property_ui_text(prop, "Duplicate Material", "Causes material data to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Material", "Causes material data to be duplicated with the object."); prop= RNA_def_property(srna, "duplicate_texture", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_TEX); - RNA_def_property_ui_text(prop, "Duplicate Texture", "Causes texture data to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Texture", "Causes texture data to be duplicated with the object."); prop= RNA_def_property(srna, "duplicate_ipo", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_IPO); - RNA_def_property_ui_text(prop, "Duplicate Ipo", "Causes ipo data to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Ipo", "Causes ipo data to be duplicated with the object."); prop= RNA_def_property(srna, "duplicate_action", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ACT); - RNA_def_property_ui_text(prop, "Duplicate Action", "Causes actions to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Action", "Causes actions to be duplicated with the object."); + + prop= RNA_def_property(srna, "duplicate_particle", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_PSYS); + RNA_def_property_ui_text(prop, "Duplicate Particle", "Causes particle systems to be duplicated with the object."); } static void rna_def_userdef_language(BlenderRNA *brna) diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 4cc731611a4..d2599f6050c 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -1267,15 +1267,20 @@ void ray_trace(ShadeInput *shi, ShadeResult *shr) } if(shi->combinedflag & SCE_PASS_REFLECT) { + /* values in shr->spec can be greater then 1.0. + * In this case the mircol uses a zero blending factor, so ignoring it is ok. + * Fixes bug #18837 - when the spec is higher then 1.0, + * diff can become a negative color - Campbell */ - f= fr*(1.0f-shr->spec[0]); f1= 1.0f-i; - diff[0]= f*mircol[0] + f1*diff[0]; + f1= 1.0f-i; - f= fg*(1.0f-shr->spec[1]); f1= 1.0f-i; - diff[1]= f*mircol[1] + f1*diff[1]; + diff[0] *= f1; + diff[1] *= f1; + diff[2] *= f1; - f= fb*(1.0f-shr->spec[2]); f1= 1.0f-i; - diff[2]= f*mircol[2] + f1*diff[2]; + if(shr->spec[0]<1.0f) diff[0] += mircol[0] * (fr*(1.0f-shr->spec[0])); + if(shr->spec[1]<1.0f) diff[1] += mircol[1] * (fg*(1.0f-shr->spec[1])); + if(shr->spec[2]<1.0f) diff[2] += mircol[2] * (fb*(1.0f-shr->spec[2])); } } } diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index b774bf6374d..5db81288c1e 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -2234,7 +2234,7 @@ static int bake_check_intersect(Isect *is, int ob, RayFace *face) /* no direction checking for now, doesn't always improve the result * (INPR(shi->facenor, bs->dir) > 0.0f); */ - return (R.objectinstance[ob].obr->ob != bs->actob); + return (R.objectinstance[ob & ~RE_RAY_TRANSFORM_OFFS].obr->ob != bs->actob); } static int bake_intersect_tree(RayTree* raytree, Isect* isect, float *start, float *dir, float sign, float *hitco, float *dist) diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index ed03bb0bdd5..230820719aa 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1377,7 +1377,9 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, bool isCompoundChild = false; bool hasCompoundChildren = !parent && (blenderobject->gameflag & OB_CHILD); - if (parent/* && (parent->gameflag & OB_DYNAMIC)*/) { + /* When the parent is not OB_DYNAMIC and has no OB_COLLISION then it gets no bullet controller + * and cant be apart of the parents compound shape */ + if (parent && (parent->gameflag & (OB_DYNAMIC | OB_COLLISION))) { if ((parent->gameflag & OB_CHILD) != 0 && (blenderobject->gameflag & OB_CHILD)) { diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 91213bee865..eeff39ab9b1 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -2520,12 +2520,10 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo, } } MT_Point3 fromPoint = NodeGetWorldPosition(); + if (dist != 0.0f) - { - MT_Vector3 toDir = toPoint-fromPoint; - toDir.normalize(); - toPoint = fromPoint + (dist) * toDir; - } + toPoint = fromPoint + dist * (toPoint-fromPoint).safe_normalized(); + PHY_IPhysicsEnvironment* pe = KX_GetActiveScene()->GetPhysicsEnvironment(); KX_IPhysicsController *spc = GetPhysicsController(); KX_GameObject *parent = GetParent(); diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 5afaf61dee2..67ab67814b2 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -448,32 +448,6 @@ static PyObject *pyPrintExt(PyObject *,PyObject *,PyObject *) } -static PyObject *gEvalExpression(PyObject*, PyObject* value) -{ - char* txt= _PyUnicode_AsString(value); - - if (txt==NULL) { - PyErr_SetString(PyExc_TypeError, "Expression.calc(text): expects a single string argument"); - return NULL; - } - - CParser parser; - CExpression* expr = parser.ProcessText(txt); - CValue* val = expr->Calculate(); - expr->Release(); - - if (val) { - PyObject* pyobj = val->ConvertValueToPython(); - if (pyobj) - return pyobj; - else - return val->GetProxy(); - } - - Py_RETURN_NONE; -} - - static struct PyMethodDef game_methods[] = { {"expandPath", (PyCFunction)gPyExpandPath, METH_VARARGS, (const char *)gPyExpandPath_doc}, {"sendMessage", (PyCFunction)gPySendMessage, METH_VARARGS, (const char *)gPySendMessage_doc}, @@ -500,7 +474,6 @@ static struct PyMethodDef game_methods[] = { {"getAverageFrameRate", (PyCFunction) gPyGetAverageFrameRate, METH_NOARGS, (const char *)"Gets the estimated average frame rate"}, {"getBlendFileList", (PyCFunction)gPyGetBlendFileList, METH_VARARGS, (const char *)"Gets a list of blend files in the same directory as the current blend file"}, {"PrintGLInfo", (PyCFunction)pyPrintExt, METH_NOARGS, (const char *)"Prints GL Extension Info"}, - {"EvalExpression", (PyCFunction)gEvalExpression, METH_O, (const char *)"Evaluate a string as a game logic expression"}, {NULL, (PyCFunction) NULL, 0, NULL } }; diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index 72e2c3ed7f5..d22b1690e74 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -447,14 +447,6 @@ def setPhysicsTicRate(ticrate): @type ticrate: float """ -def EvalExpression(text): - """ - Evaluate the string as an expression, similar to the expression controller logic brick. - @param text: The expression to evaluate. - @type text: string - @return: The result of the expression. The type depends on the expression. - """ - #{ Utility functions def getAverageFrameRate(): """ |