[Bf-blender-cvs] [d3ef995] alembic_pointcache: Store a custom context pointer "cache_user" for point cache operators, so that all point caches can use the export feature.

Lukas Tönne noreply at git.blender.org
Thu Feb 12 15:56:56 CET 2015


Commit: d3ef995912fcf74a2c612500772f2adec16a2fe3
Author: Lukas Tönne
Date:   Thu Feb 12 15:46:12 2015 +0100
Branches: alembic_pointcache
https://developer.blender.org/rBd3ef995912fcf74a2c612500772f2adec16a2fe3

Store a custom context pointer "cache_user" for point cache operators,
so that all point caches can use the export feature.

This was enabled only for particles. There is a lot of weird unexplained
code with special cases all over the place - unified point cache should
be possible in the end, but currently it's still a mess.

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

M	release/scripts/startup/bl_ui/properties_particle.py
M	release/scripts/startup/bl_ui/properties_physics_cloth.py
M	release/scripts/startup/bl_ui/properties_physics_common.py
M	release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
M	release/scripts/startup/bl_ui/properties_physics_smoke.py
M	release/scripts/startup/bl_ui/properties_physics_softbody.py
M	release/scripts/startup/bl_ui/properties_scene.py

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

diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py
index 56b0ad6..971621c 100644
--- a/release/scripts/startup/bl_ui/properties_particle.py
+++ b/release/scripts/startup/bl_ui/properties_particle.py
@@ -422,7 +422,7 @@ class PARTICLE_PT_cache(ParticleButtonsPanel, Panel):
     def draw(self, context):
         psys = context.particle_system
 
-        point_cache_ui(self, context, psys.point_cache, True, 'HAIR' if (psys.settings.type == 'HAIR') else 'PSYS')
+        point_cache_ui(self, context, psys, psys.point_cache, True, 'HAIR' if (psys.settings.type == 'HAIR') else 'PSYS')
 
 
 class PARTICLE_PT_velocity(ParticleButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py
index b423131..fa9131d 100644
--- a/release/scripts/startup/bl_ui/properties_physics_cloth.py
+++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py
@@ -119,7 +119,7 @@ class PHYSICS_PT_cloth_cache(PhysicButtonsPanel, Panel):
 
     def draw(self, context):
         md = context.cloth
-        point_cache_ui(self, context, md.point_cache, cloth_panel_enabled(md), 'CLOTH')
+        point_cache_ui(self, context, md, md.point_cache, cloth_panel_enabled(md), 'CLOTH')
 
 
 class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py
index 8f40736..598fb77 100644
--- a/release/scripts/startup/bl_ui/properties_physics_common.py
+++ b/release/scripts/startup/bl_ui/properties_physics_common.py
@@ -99,7 +99,7 @@ class PHYSICS_PT_add(PhysicButtonsPanel, Panel):
 
 # cache-type can be 'PSYS' 'HAIR' 'SMOKE' etc
 
-def point_cache_ui(self, context, cache, enabled, cachetype):
+def point_cache_ui(self, context, cache_user, cache, enabled, cachetype):
     ### special cases (don't ask, it's mysterious) ###
     # cache types that support external cache data
     supports_external       = (cachetype in {'PSYS', 'HAIR', 'SMOKE'})
@@ -116,6 +116,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
 
     layout = self.layout
     layout.context_pointer_set("point_cache", cache)
+    layout.context_pointer_set("point_cache_user", cache_user)
 
     row = layout.row()
     if supports_external:
@@ -124,8 +125,6 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
         if supports_library_path:
             row.prop(cache, "use_library_path", "Use Lib Path")
 
-        layout.context_pointer_set("point_cache_user", context.particle_system)
-
     if cache.use_external:
         split = layout.split(percentage=0.35)
         col = split.column()
diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
index 3858a13..d2d7134 100644
--- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
+++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
@@ -407,7 +407,7 @@ class PHYSICS_PT_dp_cache(PhysicButtonsPanel, Panel):
         surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
         cache = surface.point_cache
 
-        point_cache_ui(self, context, cache, (cache.state.is_baked is False), 'DYNAMIC_PAINT')
+        point_cache_ui(self, context, surface, cache, (cache.state.is_baked is False), 'DYNAMIC_PAINT')
 
 
 class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py
index d0e11d3..d63d039 100644
--- a/release/scripts/startup/bl_ui/properties_physics_smoke.py
+++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py
@@ -310,7 +310,7 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel):
         layout.label(text="Compression:")
         layout.prop(md, "point_cache_compress_type", expand=True)
 
-        point_cache_ui(self, context, cache, (cache.state.is_baked is False), 'SMOKE')
+        point_cache_ui(self, context, md, cache, (cache.state.is_baked is False), 'SMOKE')
 
 
 class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_physics_softbody.py b/release/scripts/startup/bl_ui/properties_physics_softbody.py
index a279e87..9b1f9e3 100644
--- a/release/scripts/startup/bl_ui/properties_physics_softbody.py
+++ b/release/scripts/startup/bl_ui/properties_physics_softbody.py
@@ -74,7 +74,7 @@ class PHYSICS_PT_softbody_cache(PhysicButtonsPanel, Panel):
 
     def draw(self, context):
         md = context.soft_body
-        point_cache_ui(self, context, md.point_cache, softbody_panel_enabled(md), 'SOFTBODY')
+        point_cache_ui(self, context, md.settings, md.point_cache, softbody_panel_enabled(md), 'SOFTBODY')
 
 
 class PHYSICS_PT_softbody_goal(PhysicButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py
index f49520e..a95e264 100644
--- a/release/scripts/startup/bl_ui/properties_scene.py
+++ b/release/scripts/startup/bl_ui/properties_scene.py
@@ -353,7 +353,7 @@ class SCENE_PT_rigid_body_cache(SceneButtonsPanel, Panel):
         scene = context.scene
         rbw = scene.rigidbody_world
 
-        point_cache_ui(self, context, rbw.point_cache, rbw.point_cache.state.is_baked is False and rbw.enabled, 'RIGID_BODY')
+        point_cache_ui(self, context, rbw, rbw.point_cache, rbw.point_cache.state.is_baked is False and rbw.enabled, 'RIGID_BODY')
 
 
 class SCENE_PT_rigid_body_field_weights(SceneButtonsPanel, Panel):




More information about the Bf-blender-cvs mailing list