Merge branch 'master' into blender2.8
[blender.git] / release / scripts / startup / bl_ui / properties_physics_softbody.py
index 32f220c..e873bb4 100644 (file)
@@ -25,6 +25,11 @@ from bl_ui.properties_physics_common import (
         )
 
 
+def softbody_panel_enabled(md):
+    return True
+    #return (md.point_cache.is_baked is False)
+
+
 class PhysicButtonsPanel:
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
@@ -34,11 +39,12 @@ 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 (not rd.use_game_engine) and (context.soft_body)
+        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)
 
 
 class PHYSICS_PT_softbody(PhysicButtonsPanel, Panel):
     bl_label = "Soft Body"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw(self, context):
         layout = self.layout
@@ -50,6 +56,7 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel, Panel):
 
         # General
         split = layout.split()
+        split.enabled = softbody_panel_enabled(md)
 
         col = split.column()
         col.label(text="Object:")
@@ -61,14 +68,18 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel, Panel):
         col.label(text="Simulation:")
         col.prop(softbody, "speed")
 
+        layout.prop(softbody, "collision_group")
+
 
 class PHYSICS_PT_softbody_goal(PhysicButtonsPanel, Panel):
     bl_label = "Soft Body Goal"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw_header(self, context):
         softbody = context.soft_body.settings
 
+        self.layout.active = softbody_panel_enabled(context.soft_body)
         self.layout.prop(softbody, "use_goal", text="")
 
     def draw(self, context):
@@ -78,7 +89,7 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel, Panel):
         softbody = md.settings
         ob = context.object
 
-        layout.active = softbody.use_goal
+        layout.active = softbody.use_goal and softbody_panel_enabled(md)
 
         split = layout.split()
 
@@ -103,10 +114,12 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, Panel):
     bl_label = "Soft Body Edges"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw_header(self, context):
         softbody = context.soft_body.settings
 
+        self.layout.active = softbody_panel_enabled(context.soft_body)
         self.layout.prop(softbody, "use_edges", text="")
 
     def draw(self, context):
@@ -116,7 +129,7 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, Panel):
         softbody = md.settings
         ob = context.object
 
-        layout.active = softbody.use_edges
+        layout.active = softbody.use_edges and softbody_panel_enabled(md)
 
         split = layout.split()
 
@@ -151,10 +164,12 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_softbody_collision(PhysicButtonsPanel, Panel):
     bl_label = "Soft Body Self Collision"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw_header(self, context):
         softbody = context.soft_body.settings
 
+        self.layout.active = softbody_panel_enabled(context.soft_body)
         self.layout.prop(softbody, "use_self_collision", text="")
 
     def draw(self, context):
@@ -163,7 +178,7 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel, Panel):
         md = context.soft_body
         softbody = md.settings
 
-        layout.active = softbody.use_self_collision
+        layout.active = softbody.use_self_collision and softbody_panel_enabled(md)
 
         layout.label(text="Collision Ball Size Calculation:")
         layout.prop(softbody, "collision_type", expand=True)
@@ -178,6 +193,7 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_softbody_solver(PhysicButtonsPanel, Panel):
     bl_label = "Soft Body Solver"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw(self, context):
         layout = self.layout
@@ -185,6 +201,8 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel, Panel):
         md = context.soft_body
         softbody = md.settings
 
+        layout.active = softbody_panel_enabled(md)
+
         # Solver
         split = layout.split()
 
@@ -208,6 +226,7 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel, Panel):
 class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel, Panel):
     bl_label = "Soft Body Field Weights"
     bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw(self, context):
         md = context.soft_body