svn merge -r 21041:21301 https://svn.blender.org/svnroot/bf-blender/branches/blender2...
[blender.git] / release / ui / buttons_physic_cloth.py
index bd65392ad63426d5d2350b74d84b73bf95f66d6e..a06c644322ad8f26e52072b356d29009108da80d 100644 (file)
@@ -43,7 +43,54 @@ class Physic_PT_cloth(PhysicButtonsPanel):
                        col.itemR(cloth, "goal_spring", text="Stiffness")
                        col.itemR(cloth, "goal_friction", text="Friction")
                """
                        col.itemR(cloth, "goal_spring", text="Stiffness")
                        col.itemR(cloth, "goal_friction", text="Friction")
                """
+
+class PHYSICS_PT_cloth_cache(PhysicButtonsPanel):
+       __idname__= "PHYSICS_PT_cloth_cache"
+       __label__ = "Cache"
+       __default_closed__ = True
+
+       def draw(self, context):
+               layout = self.layout
+
+               cache = context.cloth.point_cache
+               
+               row = layout.row()
+               row.itemR(cache, "name")
+               
+               row = layout.row()
+               row.itemR(cache, "start_frame")
+               row.itemR(cache, "end_frame")
+               
+               row = layout.row()
+               
+               if cache.baked == True:
+                       row.itemO("PTCACHE_OT_free_bake_cloth", text="Free Bake")
+               else:
+                       row.item_booleanO("PTCACHE_OT_cache_cloth", "bake", True, text="Bake")
+               
+               subrow = row.row()
+               subrow.enabled = cache.frames_skipped or cache.outdated
+               subrow.itemO("PTCACHE_OT_cache_cloth", text="Calculate to Current Frame")
+                       
+               row = layout.row()
+               #row.enabled = particle_panel_enabled(psys)
+               row.itemO("PTCACHE_OT_bake_from_cloth_cache", text="Current Cache to Bake")
+               row.itemR(cache, "step");
        
        
+               row = layout.row()
+               #row.enabled = particle_panel_enabled(psys)
+               row.itemR(cache, "quick_cache")
+               row.itemR(cache, "disk_cache")
+               
+               layout.itemL(text=cache.info)
+               
+               layout.itemS()
+               
+               row = layout.row()
+               row.itemO("PTCACHE_OT_bake_all", "bake", True, text="Bake All Dynamics")
+               row.itemO("PTCACHE_OT_free_bake_all", text="Free All Bakes")
+               layout.itemO("PTCACHE_OT_bake_all", text="Update All Dynamics to current frame")
+               
 class Physic_PT_cloth_collision(PhysicButtonsPanel):
        __idname__ = "Physic_PT_clothcollision"
        __label__ = "Cloth Collision"
 class Physic_PT_cloth_collision(PhysicButtonsPanel):
        __idname__ = "Physic_PT_clothcollision"
        __label__ = "Cloth Collision"
@@ -102,5 +149,6 @@ class Physic_PT_cloth_stiffness(PhysicButtonsPanel):
                sub.itemR(cloth, "bending_stiffness_max", text="Max")
                
 bpy.types.register(Physic_PT_cloth)
                sub.itemR(cloth, "bending_stiffness_max", text="Max")
                
 bpy.types.register(Physic_PT_cloth)
+bpy.types.register(PHYSICS_PT_cloth_cache)
 bpy.types.register(Physic_PT_cloth_collision)
 bpy.types.register(Physic_PT_cloth_stiffness)
 bpy.types.register(Physic_PT_cloth_collision)
 bpy.types.register(Physic_PT_cloth_stiffness)