[Bf-blender-cvs] [940c17a] alembic_pointcache: Big revert of all things pointcache, old code is impossible to work with.

Lukas Tönne noreply at git.blender.org
Thu Feb 19 20:40:53 CET 2015


Commit: 940c17af81b79bf1bbe06b61b7f0aad1d6019ce7
Author: Lukas Tönne
Date:   Thu Feb 19 19:41:16 2015 +0100
Branches: alembic_pointcache
https://developer.blender.org/rB940c17af81b79bf1bbe06b61b7f0aad1d6019ce7

Big revert of all things pointcache, old code is impossible to work with.

The Alembic caching must be integrated with Blender as a new, entirely
independent feature. The old pointcache code can not be surgically
removed without major damage to vital features. Instead of wasting more
time trying to deal with an outdated complicated system, a better choice
is implementing a new caching system next to it and if possible phase
out the old one at some point ...

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

M	build_files/cmake/macros.cmake
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
M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
M	source/blender/CMakeLists.txt
M	source/blender/blenfont/BLF_translation.h
M	source/blender/blenkernel/BKE_cloth.h
M	source/blender/blenkernel/BKE_library.h
M	source/blender/blenkernel/BKE_main.h
M	source/blender/blenkernel/BKE_particle.h
M	source/blender/blenkernel/BKE_pointcache.h
M	source/blender/blenkernel/intern/bpath.c
M	source/blender/blenkernel/intern/cloth.c
M	source/blender/blenkernel/intern/depsgraph.c
M	source/blender/blenkernel/intern/dynamicpaint.c
M	source/blender/blenkernel/intern/idcode.c
M	source/blender/blenkernel/intern/library.c
M	source/blender/blenkernel/intern/object.c
M	source/blender/blenkernel/intern/particle.c
M	source/blender/blenkernel/intern/particle_system.c
M	source/blender/blenkernel/intern/pointcache.c
M	source/blender/blenkernel/intern/rigidbody.c
M	source/blender/blenkernel/intern/smoke.c
M	source/blender/blenkernel/intern/softbody.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/versioning_250.c
M	source/blender/blenloader/intern/versioning_270.c
M	source/blender/blenloader/intern/versioning_legacy.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/editors/interface/interface_templates.c
M	source/blender/editors/object/object_edit.c
M	source/blender/editors/physics/CMakeLists.txt
M	source/blender/editors/physics/SConscript
M	source/blender/editors/physics/particle_edit.c
M	source/blender/editors/physics/physics_intern.h
M	source/blender/editors/physics/physics_ops.c
M	source/blender/editors/physics/physics_pointcache.c
M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/editors/space_time/space_time.c
M	source/blender/editors/space_view3d/drawobject.c
M	source/blender/editors/transform/transform_conversions.c
M	source/blender/ikplugin/intern/itasc_plugin.cpp
M	source/blender/makesdna/DNA_ID.h
M	source/blender/makesdna/DNA_dynamicpaint_types.h
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/makesdna/DNA_object_force.h
M	source/blender/makesdna/DNA_particle_types.h
D	source/blender/makesdna/DNA_pointcache_types.h
M	source/blender/makesdna/DNA_rigidbody_types.h
M	source/blender/makesdna/DNA_smoke_types.h
M	source/blender/makesdna/intern/makesdna.c
M	source/blender/makesrna/RNA_access.h
M	source/blender/makesrna/RNA_enum_types.h
M	source/blender/makesrna/SConscript
M	source/blender/makesrna/intern/CMakeLists.txt
M	source/blender/makesrna/intern/SConscript
M	source/blender/makesrna/intern/makesrna.c
M	source/blender/makesrna/intern/rna_ID.c
D	source/blender/makesrna/intern/rna_cache_library.c
M	source/blender/makesrna/intern/rna_fluidsim.c
M	source/blender/makesrna/intern/rna_internal.h
M	source/blender/makesrna/intern/rna_main.c
M	source/blender/makesrna/intern/rna_main_api.c
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/makesrna/intern/rna_object_force.c
M	source/blender/makesrna/intern/rna_particle.c
M	source/blender/makesrna/intern/rna_smoke.c
M	source/blender/modifiers/intern/MOD_cloth.c
M	source/blender/modifiers/intern/MOD_collision.c
M	source/blender/modifiers/intern/MOD_dynamicpaint.c
M	source/blender/modifiers/intern/MOD_particleinstance.c
M	source/blender/modifiers/intern/MOD_pointcache.c
M	source/blender/modifiers/intern/MOD_smoke.c
M	source/blender/pointcache/PTC_api.cpp
M	source/blender/pointcache/PTC_api.h
M	source/blender/pointcache/intern/ptc_types.h
M	source/blender/pointcache/intern/reader.cpp
M	source/blender/pointcache/intern/reader.h
M	source/blender/pointcache/intern/writer.cpp
M	source/blender/pointcache/intern/writer.h
M	source/blender/pointcache/util/util_path.cpp
M	source/blender/pointcache/util/util_path.h
M	source/blender/render/intern/source/pipeline.c
M	source/blender/render/intern/source/voxeldata.c
M	source/blender/windowmanager/intern/wm_operators.c
M	tests/python/bl_run_operators.py

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

diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 2babd3d..b2048c1 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -566,7 +566,6 @@ macro(SETUP_BLENDER_SORTED_LIBS)
 		bf_blenfont
 		bf_pointcache
 		bf_pointcache_alembic
-		bf_pointcache
 		bf_intern_audaspace
 		bf_intern_mikktspace
 		bf_intern_dualcon
diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py
index cd1ab55..d1d6ee6 100644
--- a/release/scripts/startup/bl_ui/properties_particle.py
+++ b/release/scripts/startup/bl_ui/properties_particle.py
@@ -37,7 +37,7 @@ def particle_panel_enabled(context, psys):
     if psys.settings.type in {'EMITTER', 'REACTOR'} and phystype in {'NO', 'KEYED'}:
         return True
     else:
-        return not psys.point_cache.lock_settings and (not psys.is_edited) and (not context.particle_system_editable)
+        return (psys.point_cache.is_baked is False) and (not psys.is_edited) and (not context.particle_system_editable)
 
 
 def particle_panel_poll(cls, context):
@@ -250,7 +250,7 @@ class PARTICLE_PT_emission(ParticleButtonsPanel, Panel):
         psys = context.particle_system
         part = particle_get_settings(context)
 
-        layout.enabled = particle_panel_enabled(context, psys)
+        layout.enabled = particle_panel_enabled(context, psys) and (psys is None or not psys.has_multiple_caches)
 
         row = layout.row()
         row.active = part.distribution != 'GRID'
@@ -333,7 +333,7 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel):
         cloth = cloth_md.settings
         result = cloth_md.solver_result
 
-        layout.enabled = psys.use_hair_dynamics and not psys.point_cache.lock_settings
+        layout.enabled = psys.use_hair_dynamics and psys.point_cache.is_baked is False
 
         row = layout.row(align=True)
         row.menu("PARTICLE_MT_hair_dynamics_presets", text=bpy.types.PARTICLE_MT_hair_dynamics_presets.bl_label)
@@ -415,18 +415,14 @@ class PARTICLE_PT_cache(ParticleButtonsPanel, Panel):
         if psys.settings.is_fluid:
             return False
         phystype = psys.settings.physics_type
-        #if phystype == 'NO' or phystype == 'KEYED':
-        #    return False
-        #return (psys.settings.type in {'EMITTER', 'REACTOR'} or (psys.settings.type == 'HAIR' and psys.use_hair_dynamics)) and engine in cls.COMPAT_ENGINES
-        return engine in cls.COMPAT_ENGINES
+        if phystype == 'NO' or phystype == 'KEYED':
+            return False
+        return (psys.settings.type in {'EMITTER', 'REACTOR'} or (psys.settings.type == 'HAIR' and (psys.use_hair_dynamics or psys.point_cache.is_baked))) and engine in cls.COMPAT_ENGINES
 
     def draw(self, context):
-        layout = self.layout
         psys = context.particle_system
 
-        point_cache_ui(self, context, psys, psys.point_cache, True, 'HAIR' if (psys.settings.type == 'HAIR') else 'PSYS')
-
-        layout.prop(psys, "point_cache_paths")
+        point_cache_ui(self, context, psys.point_cache, True, 'HAIR' if (psys.settings.type == 'HAIR') else 'PSYS')
 
 
 class PARTICLE_PT_velocity(ParticleButtonsPanel, Panel):
@@ -945,8 +941,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
             col.label(text="Timing:")
             col.prop(part, "use_absolute_path_time")
 
-            # XXX first case included baked caches before, this feature has been removed, not sure how it should work
-            if part.type == 'HAIR':
+            if part.type == 'HAIR' or psys.point_cache.is_baked:
                 col.prop(part, "path_start", text="Start", slider=not part.use_absolute_path_time)
             else:
                 col.prop(part, "trail_count")
@@ -1116,11 +1111,11 @@ class PARTICLE_PT_draw(ParticleButtonsPanel, Panel):
 
         if part.draw_percentage != 100 and psys is not None:
             if part.type == 'HAIR':
-                if psys.use_hair_dynamics:
+                if psys.use_hair_dynamics and psys.point_cache.is_baked is False:
                     layout.row().label(text="Display percentage makes dynamics inaccurate without baking!")
             else:
                 phystype = part.physics_type
-                if phystype != 'NO' and phystype != 'KEYED':
+                if phystype != 'NO' and phystype != 'KEYED' and psys.point_cache.is_baked is False:
                     layout.row().label(text="Display percentage makes dynamics inaccurate without baking!")
 
         row = layout.row()
diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py
index 7ef5c07..a5cbffb 100644
--- a/release/scripts/startup/bl_ui/properties_physics_cloth.py
+++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py
@@ -27,7 +27,7 @@ from bl_ui.properties_physics_common import (
 
 
 def cloth_panel_enabled(md):
-    return not md.point_cache.lock_settings
+    return md.point_cache.is_baked is False
 
 
 class CLOTH_MT_presets(Menu):
@@ -116,7 +116,7 @@ class PHYSICS_PT_cloth_cache(PhysicButtonsPanel, Panel):
 
     def draw(self, context):
         md = context.cloth
-        point_cache_ui(self, context, md, md.point_cache, cloth_panel_enabled(md), 'CLOTH')
+        point_cache_ui(self, context, 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 06ddef0..bb0f0cf 100644
--- a/release/scripts/startup/bl_ui/properties_physics_common.py
+++ b/release/scripts/startup/bl_ui/properties_physics_common.py
@@ -97,41 +97,26 @@ class PHYSICS_PT_add(PhysicButtonsPanel, Panel):
                             'CONSTRAINT')  # RB_TODO needs better icon
 
 
-def cache_library_ui(context, layout, cachelib):
-    if not cachelib:
-        return
-
-    layout.prop(cachelib, "filepath")
-
-
 # cache-type can be 'PSYS' 'HAIR' 'SMOKE' etc
-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'})
-    # only smoke supports library paths
-    supports_library_path   = (cachetype in {'SMOKE'})
-    # needs a saved blend file for paths
-    needs_saved_file        = (cachetype in {'SMOKE', 'DYNAMIC_PAINT'})
-    # make exception for smoke cache
-    show_settings           = (not cache.use_external or cachetype in {'SMOKE'})
-    # start/end frames
-    supports_frame_range    = not (cachetype in {'PSYS', 'DYNAMIC_PAINT'})
-    # frame step
-    supports_frame_step     = not (cachetype in {'SMOKE', 'CLOTH', 'DYNAMIC_PAINT', 'RIGID_BODY'})
 
+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)
 
-    layout.template_ID(cache, "cache_library", new="cachelibrary.new")
-    cache_library_ui(context, layout, cache.cache_library)
+    if not cachetype == 'RIGID_BODY':
+        row = layout.row()
+        row.template_list("UI_UL_list", "point_caches", cache, "point_caches",
+                          cache.point_caches, "active_index", rows=1)
+        col = row.column(align=True)
+        col.operator("ptcache.add", icon='ZOOMIN', text="")
+        col.operator("ptcache.remove", icon='ZOOMOUT', text="")
 
     row = layout.row()
-    if supports_external:
+    if cachetype in {'PSYS', 'HAIR', 'SMOKE'}:
         row.prop(cache, "use_external")
 
-        if supports_library_path:
+        if cachetype == 'SMOKE':
             row.prop(cache, "use_library_path", "Use Lib Path")
 
     if cache.use_external:
@@ -144,38 +129,54 @@ def point_cache_ui(self, context, cache_user, cache, enabled, cachetype):
         col.prop(cache, "index", text="")
         col.prop(cache, "filepath", text="")
 
-        cache_info = cache.state.info
+        cache_info = cache.info
         if cache_info:
             layout.label(text=cache_info)
     else:
-        if needs_saved_file and not bpy.data.is_saved:
-            layout.label(text="Cache is disabled until the file is saved")
-            layout.enabled = False
+        if cachetype in {'SMOKE', 'DYNAMIC_PAINT'}:
+            if not bpy.data.is_saved:
+                layout.label(text="Cache is disabled until the file is saved")
+                layout.enabled = False
 
-    if show_settings:
+    if not cache.use_external or cachetype == 'SMOKE':
         row = layout.row(align=True)
 
-        if supports_frame_range:
+        if cachetype not in {'PSYS', 'DYNAMIC_PAINT'}:
             row.enabled = enabled
             row.prop(cache, "frame_start")
             row.prop(cache, "frame_end")
-        if supports_frame_step:
+        if cachetype not in {'SMOKE', 'CLOTH', 'DYNAMIC_PAINT', 'RIGID_BODY'}:
             row.prop(cache, "frame_step")
 
         if cachetype != 'SMOKE':
-            layout.label(text=cache.state.info)
+            layout.label(text=cache.info)
 
         can_bake = True
 
         if cachetype not in {'SMOKE', 'DYNAMIC_PAINT', 'RIGID_BODY'}:
-            col = layout.column()
-            col.enabled = enabled and bpy.data.is_saved
+            split = layout.split()
+            split.enabled = enabled and bpy.data.is_saved
+
+            col = split.column()
+            col.prop(cache, "use_disk_cache")
+
+            col = split.column()
+            col.active = cache.use_disk_cache
             col.prop(cache, "use_library_path", "Use Lib Path")
 
             row = layout.row()
             row.enabled = enabled and bpy.data.is_saved
+            row.active = cache.use_disk_cache
             row.label(text="Compression:")
             row.prop(cache, "compression", expand=True)
+
+            layout.separator()
+
+            if cache.id_data.library and not cache.use_disk_cache:
+                can_bake = False
+
+                col = layout.column(align=True)
+                col.label(text="Linked object bakin

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list