[Bf-blender-cvs] [9e2e24a] alembic_pointcache: Fix for circular linker dependency with cache code library.

Lukas Tönne noreply at git.blender.org
Fri Feb 27 11:00:21 CET 2015


Commit: 9e2e24a1d0554fb9fc12af7077bfd49fdec44017
Author: Lukas Tönne
Date:   Fri Feb 27 10:53:45 2015 +0100
Branches: alembic_pointcache
https://developer.blender.org/rB9e2e24a1d0554fb9fc12af7077bfd49fdec44017

Fix for circular linker dependency with cache code library.

The `bf_pointcache_alembic` code is a separate library, to avoid
muddling up core code with alembic includes and preprocessor defines.
Alembic stuff only belongs strictly into alembic code and can be
disabled cleanly.

The `bf_pointcache` and `bf_pointcache_alembic` libraries had a circular
dependency, because the alembic implementation functions were called
directly. Now there is a "Factory" class to abstract the creation of
concrete implementations for readers and writers.
`bf_pointcache_alembic` defines this factory and is registered
//outside// of the core `bf_pointcache` lib, so there is no linker
circularity.

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

M	build_files/cmake/macros.cmake
M	source/blender/pointcache/CMakeLists.txt
M	source/blender/pointcache/PTC_api.cpp
M	source/blender/pointcache/PTC_api.h
M	source/blender/pointcache/alembic/CMakeLists.txt
M	source/blender/pointcache/alembic/abc_cloth.cpp
M	source/blender/pointcache/alembic/abc_mesh.cpp
M	source/blender/pointcache/alembic/abc_particles.cpp
M	source/blender/pointcache/alembic/abc_reader.cpp
M	source/blender/pointcache/alembic/abc_writer.cpp
A	source/blender/pointcache/alembic/alembic.cpp
D	source/blender/pointcache/intern/alembic.h
M	source/blender/pointcache/intern/ptc_types.cpp
M	source/blender/pointcache/intern/ptc_types.h
M	source/creator/CMakeLists.txt
M	source/creator/creator.c
M	source/gameengine/GamePlayer/ghost/CMakeLists.txt
M	source/gameengine/GamePlayer/ghost/GPG_ghost.cpp

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

diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 2babd3d..84cfcb8 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -564,7 +564,6 @@ macro(SETUP_BLENDER_SORTED_LIBS)
 		ge_videotex
 		bf_dna
 		bf_blenfont
-		bf_pointcache
 		bf_pointcache_alembic
 		bf_pointcache
 		bf_intern_audaspace
diff --git a/source/blender/pointcache/CMakeLists.txt b/source/blender/pointcache/CMakeLists.txt
index 7e82e56..7d9872e 100644
--- a/source/blender/pointcache/CMakeLists.txt
+++ b/source/blender/pointcache/CMakeLists.txt
@@ -36,7 +36,6 @@ set(INC_SYS
 )
 
 set(SRC
-	intern/alembic.h
 	intern/export.h
 	intern/export.cpp
 	intern/ptc_types.h
diff --git a/source/blender/pointcache/PTC_api.cpp b/source/blender/pointcache/PTC_api.cpp
index 5456e13..fcf3a57 100644
--- a/source/blender/pointcache/PTC_api.cpp
+++ b/source/blender/pointcache/PTC_api.cpp
@@ -26,7 +26,6 @@
 #include "writer.h"
 #include "export.h"
 
-#include "alembic.h"
 #include "ptc_types.h"
 #include "util_path.h"
 
@@ -96,7 +95,7 @@ void PTC_error_handler_modifier(struct ModifierData *md)
 
 PTCWriterArchive *PTC_open_writer_archive(Scene *scene, const char *path)
 {
-	return (PTCWriterArchive *)abc_writer_archive(scene, path, NULL);
+	return (PTCWriterArchive *)PTC::Factory::alembic->create_writer_archive(scene, path, NULL);
 }
 
 void PTC_close_writer_archive(PTCWriterArchive *_archive)
@@ -107,7 +106,7 @@ void PTC_close_writer_archive(PTCWriterArchive *_archive)
 
 PTCReaderArchive *PTC_open_reader_archive(Scene *scene, const char *path)
 {
-	return (PTCReaderArchive *)abc_reader_archive(scene, path, NULL);
+	return (PTCReaderArchive *)PTC::Factory::alembic->create_reader_archive(scene, path, NULL);
 }
 
 void PTC_close_reader_archive(PTCReaderArchive *_archive)
@@ -410,25 +409,25 @@ void PTC_cachelib_writers_free(PTCWriterArchive *archive, ListBase *writers)
 PTCWriter *PTC_writer_cloth(PTCWriterArchive *_archive, const char *name, Object *ob, ClothModifierData *clmd)
 {
 	PTC::WriterArchive *archive = (PTC::WriterArchive *)_archive;
-	return (PTCWriter *)abc_writer_cloth(archive, name, ob, clmd);
+	return (PTCWriter *)PTC::Factory::alembic->create_writer_cloth(archive, name, ob, clmd);
 }
 
 PTCReader *PTC_reader_cloth(PTCReaderArchive *_archive, const char *name, Object *ob, ClothModifierData *clmd)
 {
 	PTC::ReaderArchive *archive = (PTC::ReaderArchive *)_archive;
-	return (PTCReader *)abc_reader_cloth(archive, name, ob, clmd);
+	return (PTCReader *)PTC::Factory::alembic->create_reader_cloth(archive, name, ob, clmd);
 }
 
 PTCWriter *PTC_writer_hair_dynamics(PTCWriterArchive *_archive, const char *name, Object *ob, ClothModifierData *clmd)
 {
 	PTC::WriterArchive *archive = (PTC::WriterArchive *)_archive;
-	return (PTCWriter *)abc_writer_hair_dynamics(archive, name, ob, clmd);
+	return (PTCWriter *)PTC::Factory::alembic->create_writer_hair_dynamics(archive, name, ob, clmd);
 }
 
 PTCReader *PTC_reader_hair_dynamics(PTCReaderArchive *_archive, const char *name, Object *ob, ClothModifierData *clmd)
 {
 	PTC::ReaderArchive *archive = (PTC::ReaderArchive *)_archive;
-	return (PTCReader *)abc_reader_hair_dynamics(archive, name, ob, clmd);
+	return (PTCReader *)PTC::Factory::alembic->create_reader_hair_dynamics(archive, name, ob, clmd);
 }
 
 
@@ -437,13 +436,13 @@ PTCReader *PTC_reader_hair_dynamics(PTCReaderArchive *_archive, const char *name
 PTCWriter *PTC_writer_derived_mesh(PTCWriterArchive *_archive, const char *name, Object *ob, DerivedMesh **dm_ptr)
 {
 	PTC::WriterArchive *archive = (PTC::WriterArchive *)_archive;
-	return (PTCWriter *)abc_writer_derived_mesh(archive, name, ob, dm_ptr);
+	return (PTCWriter *)PTC::Factory::alembic->create_writer_derived_mesh(archive, name, ob, dm_ptr);
 }
 
 PTCReader *PTC_reader_derived_mesh(PTCReaderArchive *_archive, const char *name, Object *ob)
 {
 	PTC::ReaderArchive *archive = (PTC::ReaderArchive *)_archive;
-	return (PTCReader *)abc_reader_derived_mesh(archive, name, ob);
+	return (PTCReader *)PTC::Factory::alembic->create_reader_derived_mesh(archive, name, ob);
 }
 
 struct DerivedMesh *PTC_reader_derived_mesh_acquire_result(PTCReader *_reader)
@@ -462,14 +461,14 @@ void PTC_reader_derived_mesh_discard_result(PTCReader *_reader)
 PTCWriter *PTC_writer_derived_final(PTCWriterArchive *_archive, const char *name, Object *ob)
 {
 	PTC::WriterArchive *archive = (PTC::WriterArchive *)_archive;
-	return (PTCWriter *)abc_writer_derived_final(archive, name, ob);
+	return (PTCWriter *)PTC::Factory::alembic->create_writer_derived_final(archive, name, ob);
 }
 
 
 PTCWriter *PTC_writer_cache_modifier(PTCWriterArchive *_archive, const char *name, Object *ob, CacheModifierData *cmd)
 {
 	PTC::WriterArchive *archive = (PTC::WriterArchive *)_archive;
-	return (PTCWriter *)abc_writer_cache_modifier(archive, name, ob, cmd);
+	return (PTCWriter *)PTC::Factory::alembic->create_writer_cache_modifier(archive, name, ob, cmd);
 }
 
 
@@ -478,13 +477,13 @@ PTCWriter *PTC_writer_cache_modifier(PTCWriterArchive *_archive, const char *nam
 PTCWriter *PTC_writer_particles(PTCWriterArchive *_archive, const char *name, Object *ob, ParticleSystem *psys)
 {
 	PTC::WriterArchive *archive = (PTC::WriterArchive *)_archive;
-	return (PTCWriter *)abc_writer_particles(archive, name, ob, psys);
+	return (PTCWriter *)PTC::Factory::alembic->create_writer_particles(archive, name, ob, psys);
 }
 
 PTCReader *PTC_reader_particles(PTCReaderArchive *_archive, const char *name, Object *ob, ParticleSystem *psys)
 {
 	PTC::ReaderArchive *archive = (PTC::ReaderArchive *)_archive;
-	return (PTCReader *)abc_reader_particles(archive, name, ob, psys);
+	return (PTCReader *)PTC::Factory::alembic->create_reader_particles(archive, name, ob, psys);
 }
 
 int PTC_reader_particles_totpoint(PTCReader *_reader)
@@ -495,23 +494,23 @@ int PTC_reader_particles_totpoint(PTCReader *_reader)
 PTCWriter *PTC_writer_particle_pathcache_parents(PTCWriterArchive *_archive, const char *name, Object *ob, ParticleSystem *psys)
 {
 	PTC::WriterArchive *archive = (PTC::WriterArchive *)_archive;
-	return (PTCWriter *)abc_writer_particle_pathcache_parents(archive, name, ob, psys);
+	return (PTCWriter *)PTC::Factory::alembic->create_writer_particles_pathcache_parents(archive, name, ob, psys);
 }
 
 PTCReader *PTC_reader_particle_pathcache_parents(PTCReaderArchive *_archive, const char *name, Object *ob, ParticleSystem *psys)
 {
 	PTC::ReaderArchive *archive = (PTC::ReaderArchive *)_archive;
-	return (PTCReader *)abc_reader_particle_pathcache_parents(archive, name, ob, psys);
+	return (PTCReader *)PTC::Factory::alembic->create_reader_particles_pathcache_parents(archive, name, ob, psys);
 }
 
 PTCWriter *PTC_writer_particle_pathcache_children(PTCWriterArchive *_archive, const char *name, Object *ob, ParticleSystem *psys)
 {
 	PTC::WriterArchive *archive = (PTC::WriterArchive *)_archive;
-	return (PTCWriter *)abc_writer_particle_pathcache_children(archive, name, ob, psys);
+	return (PTCWriter *)PTC::Factory::alembic->create_writer_particles_pathcache_children(archive, name, ob, psys);
 }
 
 PTCReader *PTC_reader_particle_pathcache_children(PTCReaderArchive *_archive, const char *name, Object *ob, ParticleSystem *psys)
 {
 	PTC::ReaderArchive *archive = (PTC::ReaderArchive *)_archive;
-	return (PTCReader *)abc_reader_particle_pathcache_children(archive, name, ob, psys);
+	return (PTCReader *)PTC::Factory::alembic->create_reader_particles_pathcache_children(archive, name, ob, psys);
 }
diff --git a/source/blender/pointcache/PTC_api.h b/source/blender/pointcache/PTC_api.h
index d91d926..e05c9f7 100644
--- a/source/blender/pointcache/PTC_api.h
+++ b/source/blender/pointcache/PTC_api.h
@@ -49,6 +49,8 @@ struct PTCReaderArchive;
 struct PTCWriter;
 struct PTCReader;
 
+void PTC_alembic_init(void);
+
 /*** Error Handling ***/
 void PTC_error_handler_std(void);
 void PTC_error_handler_callback(PTCErrorCallback cb, void *userdata);
diff --git a/source/blender/pointcache/alembic/CMakeLists.txt b/source/blender/pointcache/alembic/CMakeLists.txt
index acb9767..1eb5dec 100644
--- a/source/blender/pointcache/alembic/CMakeLists.txt
+++ b/source/blender/pointcache/alembic/CMakeLists.txt
@@ -40,6 +40,8 @@ set(INC_SYS
 )
 
 set(SRC
+	alembic.cpp
+
 	abc_frame_mapper.cpp
 	abc_frame_mapper.h
 	abc_reader.cpp
diff --git a/source/blender/pointcache/alembic/abc_cloth.cpp b/source/blender/pointcache/alembic/abc_cloth.cpp
index b463740..0637d45 100644
--- a/source/blender/pointcache/alembic/abc_cloth.cpp
+++ b/source/blender/pointcache/alembic/abc_cloth.cpp
@@ -16,7 +16,6 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-#include "alembic.h"
 #include "abc_cloth.h"
 #include "util_path.h"
 
diff --git a/source/blender/pointcache/alembic/abc_mesh.cpp b/source/blender/pointcache/alembic/abc_mesh.cpp
index 38eb75c..3063562 100644
--- a/source/blender/pointcache/alembic/abc_mesh.cpp
+++ b/source/blender/pointcache/alembic/abc_mesh.cpp
@@ -16,7 +16,6 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-#include "alembic.h"
 #include "abc_mesh.h"
 #include "util_path.h"
 
diff --git a/source/blender/pointcache/alembic/abc_particles.cpp b/source/blender/pointcache/alembic/abc_particles.cpp
index b6502c6..b360384 100644
--- a/source/blender/pointcache/alembic/abc_particles.cpp
+++ b/source/blender/pointcache/alembic/abc_particles.cpp
@@ -16,8 +16,6 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-#include "alembic.h"
-
 #include "abc_cloth.h"
 #include "abc_particles.h"
 #include "util_path.h"
diff --git a/source/blender/pointcache/alembic/abc_reader.cpp b/source/blender/pointcache/alembic/abc_reader.cpp
index 0178623..c09969d 100644
--- a/source/blender/pointcache/alembic/abc_reader.cpp
+++ b/source/blender/pointcache/alembic/abc_reader.cpp
@@ -19,7 +19,6 @@
 #include <Alembic/AbcCoreHDF5/ReadWrite.h>
 #include <Alembic/Abc/ArchiveInfo.h>
 
-#include "alembic.h"
 #include "abc_reader.h"
 
 #include "util_error_handler.h"
diff --git a/source/blender/pointcache/alembic/abc_writer.cpp b/source/blender/pointcache/alembic/abc_writer.cpp
index 2754557..6c6ca12 100644
--- a/source/blender/pointcache/alembic/ab

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list