[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28795] branches/hairsim: hairsim temporary branch for durian

Joseph Eagar joeedh at gmail.com
Sun May 16 22:52:54 CEST 2010


Revision: 28795
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28795
Author:   joeedh
Date:     2010-05-16 22:52:53 +0200 (Sun, 16 May 2010)

Log Message:
-----------
hairsim temporary branch for durian

Modified Paths:
--------------
    branches/hairsim/release/scripts/ui/properties_particle.py
    branches/hairsim/release/scripts/ui/properties_physics_cloth.py
    branches/hairsim/release/scripts/ui/properties_physics_common.py
    branches/hairsim/release/scripts/ui/properties_physics_field.py
    branches/hairsim/release/scripts/ui/properties_physics_smoke.py
    branches/hairsim/release/scripts/ui/properties_physics_softbody.py
    branches/hairsim/source/blender/blenkernel/BKE_cloth.h
    branches/hairsim/source/blender/blenkernel/BKE_collision.h
    branches/hairsim/source/blender/blenkernel/BKE_pointcache.h
    branches/hairsim/source/blender/blenkernel/BKE_utildefines.h
    branches/hairsim/source/blender/blenkernel/intern/DerivedMesh.c
    branches/hairsim/source/blender/blenkernel/intern/cdderivedmesh.c
    branches/hairsim/source/blender/blenkernel/intern/cloth.c
    branches/hairsim/source/blender/blenkernel/intern/collision.c
    branches/hairsim/source/blender/blenkernel/intern/implicit.c
    branches/hairsim/source/blender/blenkernel/intern/particle_system.c
    branches/hairsim/source/blender/blenkernel/intern/pointcache.c
    branches/hairsim/source/blender/blenlib/BLI_edgehash.h
    branches/hairsim/source/blender/blenlib/BLI_math_geom.h
    branches/hairsim/source/blender/blenlib/BLI_math_matrix.h
    branches/hairsim/source/blender/blenlib/BLI_math_rotation.h
    branches/hairsim/source/blender/blenlib/BLI_math_vector.h
    branches/hairsim/source/blender/blenlib/intern/BLI_ghash.c
    branches/hairsim/source/blender/blenlib/intern/BLI_kdopbvh.c
    branches/hairsim/source/blender/blenlib/intern/edgehash.c
    branches/hairsim/source/blender/blenlib/intern/math_base_inline.c
    branches/hairsim/source/blender/blenlib/intern/math_geom.c
    branches/hairsim/source/blender/blenlib/intern/math_matrix.c
    branches/hairsim/source/blender/blenlib/intern/math_rotation.c
    branches/hairsim/source/blender/blenlib/intern/math_vector.c
    branches/hairsim/source/blender/blenlib/intern/math_vector_inline.c
    branches/hairsim/source/blender/blenloader/intern/readfile.c
    branches/hairsim/source/blender/editors/interface/interface.c
    branches/hairsim/source/blender/editors/interface/interface_layout.c
    branches/hairsim/source/blender/editors/mesh/editmesh.c
    branches/hairsim/source/blender/editors/mesh/editmesh_lib.c
    branches/hairsim/source/blender/editors/mesh/mesh_data.c
    branches/hairsim/source/blender/editors/sculpt_paint/sculpt.c
    branches/hairsim/source/blender/editors/space_view3d/view3d_buttons.c
    branches/hairsim/source/blender/makesdna/DNA_cloth_types.h
    branches/hairsim/source/blender/makesrna/intern/rna_cloth.c
    branches/hairsim/source/blender/modifiers/intern/MOD_collision.c
    branches/hairsim/source/blender/modifiers/intern/MOD_explode.c
    branches/hairsim/source/blender/modifiers/intern/MOD_solidify.c
    branches/hairsim/source/blender/python/generic/geometry.c
    branches/hairsim/source/creator/creator.c
    branches/hairsim/source/gameengine/Ketsji/KX_GameObject.cpp
    branches/hairsim/source/gameengine/Ketsji/KX_ObjectActuator.cpp

Modified: branches/hairsim/release/scripts/ui/properties_particle.py
===================================================================
--- branches/hairsim/release/scripts/ui/properties_particle.py	2010-05-16 20:13:47 UTC (rev 28794)
+++ branches/hairsim/release/scripts/ui/properties_particle.py	2010-05-16 20:52:53 UTC (rev 28795)
@@ -24,8 +24,12 @@
 from properties_physics_common import effector_weights_ui
 from properties_physics_common import basic_force_field_settings_ui
 from properties_physics_common import basic_force_field_falloff_ui
+
 from properties_physics_cloth import PHYSICS_PT_cloth_collision
 
+narrowui = 180
+
+
 def particle_panel_enabled(context, psys):
     return (psys.point_cache.baked is False) and (not psys.edited) and (not context.particle_system_editable)
 
@@ -36,30 +40,9 @@
         return False
     if psys.settings is None:
         return False
-    
     return psys.settings.type in ('EMITTER', 'REACTOR', 'HAIR')
 
-class PARTICLE_PT_cloth_collision (PHYSICS_PT_cloth_collision):
-    bl_space_type = 'PROPERTIES'
-    bl_region_type = 'WINDOW'
-    bl_context = "particle"
 
-    def poll(self, context):
-        print(particle_panel_poll(context))
-        if not particle_panel_poll(context):
-            return False
-        
-        return True
-
-    def get_cloth(self, context):
-        if context.particle_system is None:
-            return False
-        
-        if context.particle_system.cloth is None:
-            return False
-            
-        return context.particle_system.cloth
-
 class ParticleButtonsPanel(bpy.types.Panel):
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
@@ -95,7 +78,7 @@
 
             col = split.column()
             col.label(text="Name:")
-            col.label(text="Settindgs:")
+            col.label(text="Settings:")
 
             col = split.column()
             col.prop(psys, "name", text="")
@@ -154,7 +137,6 @@
 class PARTICLE_PT_custom_props(ParticleButtonsPanel, PropertyPanel):
     _context_path = "particle_system.settings"
 
-
 class PARTICLE_PT_emission(ParticleButtonsPanel):
     bl_label = "Emission"
 
@@ -169,6 +151,7 @@
 
         psys = context.particle_system
         part = psys.settings
+        wide_ui = context.region.width > narrowui
 
         layout.enabled = particle_panel_enabled(context, psys) and not psys.multiple_caches
 
@@ -190,7 +173,10 @@
         layout.row().label(text="Emit From:")
 
         row = layout.row()
-        row.prop(part, "emit_from", expand=True)
+        if wide_ui:
+            row.prop(part, "emit_from", expand=True)
+        else:
+            row.prop(part, "emit_from", text="")
         row = layout.row()
         row.prop(part, "trand")
         if part.distribution != 'GRID':
@@ -198,7 +184,10 @@
 
         if part.emit_from == 'FACE' or part.emit_from == 'VOLUME':
             row = layout.row()
-            row.prop(part, "distribution", expand=True)
+            if wide_ui:
+                row.prop(part, "distribution", expand=True)
+            else:
+                row.prop(part, "distribution", text="")
 
             row = layout.row()
 
@@ -208,6 +197,22 @@
             elif part.distribution == 'GRID':
                 row.prop(part, "grid_resolution")
 
+class PARTICLE_PT_collisions(PHYSICS_PT_cloth_collision):
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "particle"
+    
+    def poll(self, context):
+        psys = context.particle_system
+        if psys is None:
+            return False
+        if psys.settings is None:
+            return False
+        return psys.cloth != None and psys.settings.type == 'HAIR'
+    
+    def get_cloth(self, context):
+        return context.particle_system.cloth
+    
 
 class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel):
     bl_label = "Hair dynamics"
@@ -252,8 +257,8 @@
         sub.prop(cloth, "bending_stiffness", text="Bending")
         sub.prop(cloth, "internal_friction", slider=True)
         sub.prop(cloth, "collider_friction", slider=True)
-        sub.prop(cloth, "flexibility_damping", slider=True)
-        
+        sub.prop(cloth, "flexibility_damping", text="Flexibility", slider=True)
+
         col = split.column()
 
         col.label(text="Damping:")
@@ -281,10 +286,9 @@
         return psys.settings.type in ('EMITTER', 'REACTOR') or (psys.settings.type == 'HAIR' and psys.hair_dynamics)
 
     def draw(self, context):
-
         psys = context.particle_system
 
-        point_cache_ui(self, context, psys.point_cache, particle_panel_enabled(context, psys), not psys.hair_dynamics, 0)
+        point_cache_ui(self, context, psys.point_cache, True, 'HAIR' if psys.hair_dynamics else 'PSYS')
 
 
 class PARTICLE_PT_velocity(ParticleButtonsPanel):
@@ -348,6 +352,7 @@
 
         psys = context.particle_system
         part = psys.settings
+        wide_ui = context.region.width > narrowui
 
         layout.enabled = particle_panel_enabled(context, psys)
 
@@ -365,7 +370,10 @@
         sub.prop(part, "random_phase_factor", text="Random", slider=True)
 
         layout.row().label(text="Angular Velocity:")
-        layout.row().prop(part, "angular_velocity_mode", expand=True)
+        if wide_ui:
+            layout.row().prop(part, "angular_velocity_mode", expand=True)
+        else:
+            layout.row().prop(part, "angular_velocity_mode", text="")
         split = layout.split()
 
         sub = split.column()
@@ -388,11 +396,16 @@
 
         psys = context.particle_system
         part = psys.settings
+        wide_ui = context.region.width > narrowui
 
         layout.enabled = particle_panel_enabled(context, psys)
 
         row = layout.row()
-        row.prop(part, "physics_type", expand=True)
+        if wide_ui:
+            row.prop(part, "physics_type", expand=True)
+        else:
+            row.prop(part, "physics_type", text="")
+
         if part.physics_type != 'NO':
             row = layout.row()
             col = row.column(align=True)
@@ -678,6 +691,7 @@
 
         psys = context.particle_system
         part = psys.settings
+        wide_ui = context.region.width > narrowui
 
         row = layout.row()
         row.prop(part, "material")
@@ -693,7 +707,10 @@
         sub.prop(part, "died")
 
         row = layout.row()
-        row.prop(part, "ren_as", expand=True)
+        if wide_ui:
+            row.prop(part, "ren_as", expand=True)
+        else:
+            row.prop(part, "ren_as", text="")
 
         split = layout.split()
 
@@ -786,7 +803,10 @@
             sub.label(text="Align:")
 
             row = layout.row()
-            row.prop(part, "billboard_align", expand=True)
+            if wide_ui:
+                row.prop(part, "billboard_align", expand=True)
+            else:
+                row.prop(part, "billboard_align", text="")
             row.prop(part, "billboard_lock", text="Lock")
             row = layout.row()
             row.prop(part, "billboard_object")
@@ -811,9 +831,9 @@
             row.prop(psys, "billboard_split_uv")
             row = layout.row()
             row.label(text="Animate:")
-            row.prop(part, "billboard_animation", expand=True)
+            row.prop(part, "billboard_animation", text="")
             row.label(text="Offset:")
-            row.prop(part, "billboard_split_offset", expand=True)
+            row.prop(part, "billboard_split_offset", text="")
 
         if part.ren_as == 'HALO' or part.ren_as == 'LINE' or part.ren_as == 'BILLBOARD':
             row = layout.row()
@@ -846,9 +866,13 @@
 
         psys = context.particle_system
         part = psys.settings
+        wide_ui = context.region.width > narrowui
 
         row = layout.row()
-        row.prop(part, "draw_as", expand=True)
+        if wide_ui:
+            row.prop(part, "draw_as", expand=True)
+        else:
+            row.prop(part, "draw_as", text="")
 
         if part.draw_as == 'NONE' or (part.ren_as == 'NONE' and part.draw_as == 'RENDER'):
             return
@@ -896,8 +920,12 @@
 
         psys = context.particle_system
         part = psys.settings
+        wide_ui = context.region.width > narrowui
 
-        layout.row().prop(part, "child_type", expand=True)
+        if wide_ui:
+            layout.row().prop(part, "child_type", expand=True)
+        else:
+            layout.row().prop(part, "child_type", text="")
 
         if part.child_type == 'NONE':
             return
@@ -953,7 +981,10 @@
         col.label(text="hair parting controls")
 
         layout.row().label(text="Kink:")
-        layout.row().prop(part, "kink", expand=True)
+        if wide_ui:
+            layout.row().prop(part, "kink", expand=True)
+        else:
+            layout.row().prop(part, "kink", text="")
 
         split = layout.split()
 
@@ -1073,7 +1104,7 @@
 classes = [
     PARTICLE_PT_context_particles,
     PARTICLE_PT_hair_dynamics,
-	PARTICLE_PT_cloth_collision,
+    PARTICLE_PT_collisions,
     PARTICLE_PT_cache,
     PARTICLE_PT_emission,
     PARTICLE_PT_velocity,
@@ -1089,6 +1120,7 @@
 
     PARTICLE_PT_custom_props]
 
+
 def register():
     register = bpy.types.register
     for cls in classes:

Modified: branches/hairsim/release/scripts/ui/properties_physics_cloth.py
===================================================================
--- branches/hairsim/release/scripts/ui/properties_physics_cloth.py	2010-05-16 20:13:47 UTC (rev 28794)
+++ branches/hairsim/release/scripts/ui/properties_physics_cloth.py	2010-05-16 20:52:53 UTC (rev 28795)
@@ -143,7 +143,7 @@
 
     def draw(self, context):
         md = context.cloth
-        point_cache_ui(self, context, md.point_cache, cloth_panel_enabled(md), 0, 0)
+        point_cache_ui(self, context, md.point_cache, cloth_panel_enabled(md), 'CLOTH')
 
 
 class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):

Modified: branches/hairsim/release/scripts/ui/properties_physics_common.py
===================================================================
--- branches/hairsim/release/scripts/ui/properties_physics_common.py	2010-05-16 20:13:47 UTC (rev 28794)
+++ branches/hairsim/release/scripts/ui/properties_physics_common.py	2010-05-16 20:52:53 UTC (rev 28795)
@@ -20,8 +20,10 @@
 
 narrowui = 180
 
+import bpy
 
-def point_cache_ui(self, context, cache, enabled, particles, smoke):
+#cachetype can be 'PSYS' 'HAIR' 'SMOKE' etc
+def point_cache_ui(self, context, cache, enabled, cachetype):
     layout = self.layout
 
     wide_ui = context.region.width > narrowui
@@ -34,13 +36,12 @@

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list