[Bf-blender-cvs] [9a239eea685] blender-v2.79-release: Fix T52344: Softbody on Text.

Bastien Montagne noreply at git.blender.org
Thu Aug 17 14:45:16 CEST 2017


Commit: 9a239eea6851bc9e76796a817d627d478009305d
Author: Bastien Montagne
Date:   Fri Aug 11 14:25:36 2017 +0200
Branches: blender-v2.79-release
https://developer.blender.org/rB9a239eea6851bc9e76796a817d627d478009305d

Fix T52344: Softbody on Text.

Own previous fix (rBd5d626df236b) was not valid, curves are actually
supported by SoftBodies. It was rather a mere UI bug, which was not
including Surfaces and Font obect types in those valid for softbody UI.

Thanks to @brecht for the head up!

Also, fix safe for 2.79, btw.

===================================================================

M	release/scripts/startup/bl_ui/properties_physics_common.py
M	release/scripts/startup/bl_ui/properties_physics_softbody.py
M	source/blender/modifiers/intern/MOD_softbody.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py
index 0b98d8738dc..73d3d5fc755 100644
--- a/release/scripts/startup/bl_ui/properties_physics_common.py
+++ b/release/scripts/startup/bl_ui/properties_physics_common.py
@@ -79,7 +79,7 @@ class PHYSICS_PT_add(PhysicButtonsPanel, Panel):
 
         col = split.column()
 
-        if obj.type in {'MESH', 'LATTICE', 'CURVE'}:
+        if obj.type in {'MESH', 'LATTICE', 'CURVE', 'SURFACE', 'FONT'}:
             physics_add(self, col, context.soft_body, "Soft Body", 'SOFT_BODY', 'MOD_SOFT', True)
 
         if obj.type == 'MESH':
diff --git a/release/scripts/startup/bl_ui/properties_physics_softbody.py b/release/scripts/startup/bl_ui/properties_physics_softbody.py
index 5ce4302891d..5efe105e7d8 100644
--- a/release/scripts/startup/bl_ui/properties_physics_softbody.py
+++ b/release/scripts/startup/bl_ui/properties_physics_softbody.py
@@ -26,6 +26,9 @@ from bl_ui.properties_physics_common import (
         )
 
 
+COMPAT_OB_TYPES = {'MESH', 'LATTICE', 'CURVE', 'SURFACE', 'FONT'}
+
+
 def softbody_panel_enabled(md):
     return (md.point_cache.is_baked is False)
 
@@ -39,7 +42,7 @@ class PhysicButtonsPanel:
     def poll(cls, context):
         ob = context.object
         rd = context.scene.render
-        return (ob and (ob.type == 'MESH' or ob.type == 'LATTICE'or ob.type == 'CURVE')) and (rd.engine in cls.COMPAT_ENGINES) and (context.soft_body)
+        return ob and ob.type in COMPAT_OB_TYPES and rd.engine in cls.COMPAT_ENGINES and context.soft_body
 
 
 class PHYSICS_PT_softbody(PhysicButtonsPanel, Panel):
diff --git a/source/blender/modifiers/intern/MOD_softbody.c b/source/blender/modifiers/intern/MOD_softbody.c
index f5fc1d8ced8..a0bbe5da04a 100644
--- a/source/blender/modifiers/intern/MOD_softbody.c
+++ b/source/blender/modifiers/intern/MOD_softbody.c
@@ -100,7 +100,8 @@ ModifierTypeInfo modifierType_Softbody = {
 	/* structName */        "SoftbodyModifierData",
 	/* structSize */        sizeof(SoftbodyModifierData),
 	/* type */              eModifierTypeType_OnlyDeform,
-	/* flags */             eModifierTypeFlag_AcceptsLattice |
+	/* flags */             eModifierTypeFlag_AcceptsCVs |
+	                        eModifierTypeFlag_AcceptsLattice |
 	                        eModifierTypeFlag_RequiresOriginalData |
 	                        eModifierTypeFlag_Single,




More information about the Bf-blender-cvs mailing list