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:
authorDaniel Genrich <daniel.genrich@gmx.net>2008-02-05 18:43:20 +0300
committerDaniel Genrich <daniel.genrich@gmx.net>2008-02-05 18:43:20 +0300
commit3a794a85835f35a76d3f5a8736fd7f9de26401b0 (patch)
tree8a502412980eac451d4b1a650a3cd8ddb8cb88f2
parenta8c25e279d2209665cf7f561c4cb32837dc83aa3 (diff)
Cloth: resolve problems wheen opening old files which have deflection enabled
-rw-r--r--source/blender/src/buttons_object.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c
index ce93a07e843..af22635ffdc 100644
--- a/source/blender/src/buttons_object.c
+++ b/source/blender/src/buttons_object.c
@@ -3250,15 +3250,19 @@ static void field_testTexture(char *name, ID **idpp)
static void object_collision__enabletoggle ( void *ob_v, void *arg2 )
{
Object *ob = ob_v;
+ PartDeflect *pd= ob->pd;
ModifierData *md = modifiers_findByType ( ob, eModifierType_Collision );
if ( !md )
{
- md = modifier_new ( eModifierType_Collision );
- BLI_addhead ( &ob->modifiers, md );
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
+ if(pd && (pd->deflect))
+ {
+ md = modifier_new ( eModifierType_Collision );
+ BLI_addhead ( &ob->modifiers, md );
+ DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
+ allqueue(REDRAWBUTSEDIT, 0);
+ allqueue(REDRAWVIEW3D, 0);
+ }
}
else
{