[Bf-blender-cvs] [684ad4f] alembic_pointcache: Some directory reorganization and a bunch of other stuff ...

Lukas Tönne noreply at git.blender.org
Thu Oct 16 16:52:41 CEST 2014


Commit: 684ad4f91ed05f3b90afc47b457f32ae95389172
Author: Lukas Tönne
Date:   Fri Oct 11 18:43:58 2013 +0200
Branches: alembic_pointcache
https://developer.blender.org/rB684ad4f91ed05f3b90afc47b457f32ae95389172

Some directory reorganization and a bunch of other stuff ...

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

M	source/blender/makesrna/intern/rna_pointcache.c
M	source/blender/pointcache/CMakeLists.txt
M	source/blender/pointcache/PTC_api.cpp
M	source/blender/pointcache/PTC_api.h
D	source/blender/pointcache/PTC_archive.cpp
D	source/blender/pointcache/PTC_archive.h
D	source/blender/pointcache/PTC_particles.cpp
D	source/blender/pointcache/PTC_particles.h
D	source/blender/pointcache/PTC_schema.h
A	source/blender/pointcache/intern/archive.cpp
A	source/blender/pointcache/intern/archive.h
A	source/blender/pointcache/intern/particles.cpp
A	source/blender/pointcache/intern/particles.h
A	source/blender/pointcache/intern/schema.h
A	source/blender/pointcache/intern/types.h
M	source/blender/pointcache/test.cpp

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

diff --git a/source/blender/makesrna/intern/rna_pointcache.c b/source/blender/makesrna/intern/rna_pointcache.c
index cd5e406..0ff4c70 100644
--- a/source/blender/makesrna/intern/rna_pointcache.c
+++ b/source/blender/makesrna/intern/rna_pointcache.c
@@ -32,6 +32,7 @@
 #include "DNA_scene_types.h"
 
 #include "RNA_define.h"
+#include "RNA_types.h"
 
 #include "rna_internal.h"
 
@@ -295,6 +296,7 @@ static void rna_def_ptcache_point_caches(BlenderRNA *brna, PropertyRNA *cprop)
 static void rna_def_pointcache(BlenderRNA *brna)
 {
 	StructRNA *srna;
+	FunctionRNA *func;
 	PropertyRNA *prop;
 
 #ifdef POINTCACHE_OLD
@@ -406,6 +408,9 @@ static void rna_def_pointcache(BlenderRNA *brna)
 	RNA_def_property_struct_type(prop, "PointCache");
 	RNA_def_property_ui_text(prop, "Point Cache List", "Point cache list");
 	rna_def_ptcache_point_caches(brna, prop);
+
+	func = RNA_def_function(srna, "test", "PTC_test_archive");
+	RNA_def_function_flag(func, FUNC_NO_SELF);
 }
 
 void RNA_def_pointcache(BlenderRNA *brna)
diff --git a/source/blender/pointcache/CMakeLists.txt b/source/blender/pointcache/CMakeLists.txt
index 78f88dc..bd02a66 100644
--- a/source/blender/pointcache/CMakeLists.txt
+++ b/source/blender/pointcache/CMakeLists.txt
@@ -14,17 +14,17 @@
 # along with this program; if not, write to the Free Software Foundation,
 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #
-# The Original Code is Copyright (C) 2011, Blender Foundation
+# The Original Code is Copyright (C) 2013, Blender Foundation
 # All rights reserved.
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): Jeroen Bakker, Monique Dewanchand, Blender Developers Fund.
-#
 # ***** END GPL LICENSE BLOCK *****
 
 set(INC
 	.
+	intern
+	../makesdna
 	../../../intern/guardedalloc
 )
 
@@ -36,18 +36,19 @@ set(SRC
 
 	PTC_api.h
 	PTC_api.cpp
-	PTC_schema.h
-
-	PTC_archive.h
-	PTC_archive.cpp
-	PTC_particles.h
-	PTC_particles.cpp
 )
 
 if(WITH_ALEMBIC)
 	list(APPEND INC_SYS ${ALEMBIC_INCLUDE_DIRS} ${OPENEXR_INCLUDE_DIR}/OpenEXR)
 
-#	add_subdirectory(alembic)
+	list(APPEND SRC
+	intern/archive.h
+	intern/archive.cpp
+	intern/particles.h
+	intern/particles.cpp
+	intern/schema.h
+	intern/types.h
+	)
 
 	add_definitions(-DWITH_ALEMBIC)
 endif()
diff --git a/source/blender/pointcache/PTC_api.cpp b/source/blender/pointcache/PTC_api.cpp
index 379687a..dcd04ce 100644
--- a/source/blender/pointcache/PTC_api.cpp
+++ b/source/blender/pointcache/PTC_api.cpp
@@ -17,11 +17,17 @@
  */
 
 #include "PTC_api.h"
-#include "PTC_archive.h"
 
-extern "C" {
+#ifdef WITH_ALEMBIC
+
+#include "archive.h"
+#include "particles.h"
+
+#include "DNA_object_types.h"
+#include "DNA_particle_types.h"
 
 typedef struct PTCArchive PTCArchive;
+typedef struct PTCObject PTCObject;
 
 PTCArchive *PTC_archive_create(const char *filename)
 {
@@ -38,4 +44,27 @@ void PTC_archive_free(PTCArchive *_archive)
 	delete archive;
 }
 
-} /* extern C */
+
+void PTC_write_particles(PTCArchive *_archive, Object *ob, ParticleSystem *psys)
+{
+	OArchive *archive = (OArchive *)_archive;
+	
+	OObject root = archive->getTop();
+	
+//	OParticles particles(root.getChild(psys->name).getPtr(), kWrapExisting);
+//	if (!particles.getPtr())
+//		particles = OParticles(root, psys->name);
+}
+
+#else
+
+PTCArchive *PTC_archive_create(const char *filename)
+{
+	return NULL;
+}
+
+void PTC_archive_free(PTCArchive *_archive)
+{
+}
+
+#endif
diff --git a/source/blender/pointcache/PTC_api.h b/source/blender/pointcache/PTC_api.h
index 612da40..ce14f9d 100644
--- a/source/blender/pointcache/PTC_api.h
+++ b/source/blender/pointcache/PTC_api.h
@@ -23,17 +23,20 @@
 extern "C" {
 #endif
 
-void test_archive();
+void PTC_test_archive(void);
 
 
 struct PTCArchive;
-struct PTCObject;
 
 struct PTCArchive *PTC_archive_create(const char *filename);
 void PTC_archive_free(struct PTCArchive *archive);
 
 
-//PTCObject *PTC_object_particles()
+/* Particles */
+struct Object;
+struct ParticleSystem;
+
+void PTC_write_particles(struct PTCArchive *archive, struct Object *ob, struct ParticleSystem *psys);
 
 #ifdef __cplusplus
 } /* extern C */
diff --git a/source/blender/pointcache/PTC_schema.h b/source/blender/pointcache/PTC_schema.h
deleted file mode 100644
index 5013969..0000000
--- a/source/blender/pointcache/PTC_schema.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright 2013, Blender Foundation.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef PTC_SCHEMA_H
-#define PTC_SCHEMA_H
-
-//namespace PTC {
-
-#ifdef WITH_ALEMBIC
-
-#include <Alembic/AbcGeom/Foundation.h>
-#include <Alembic/AbcGeom/SchemaInfoDeclarations.h>
-#include <Alembic/AbcGeom/IGeomParam.h>
-#include <Alembic/AbcGeom/IGeomBase.h>
-#include <Alembic/AbcGeom/OGeomBase.h>
-#include <Alembic/AbcGeom/OGeomParam.h>
-
-//using namespace Alembic::AbcGeom::ALEMBIC_VERSION_NS;
-using namespace Alembic::AbcGeom;
-namespace Util = Alembic::Util;
-
-#define PTC_SCHEMA_INFO ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO
-
-//template <class INFO>
-//class ISchema : public Abc::ISchema<INFO>
-//{
-//};
-
-
-//template <class SCHEMA>
-//class ISchemaObject : public Abc::ISchemaObject<SCHEMA>
-//{
-//};
-
-
-//typedef Abc::ISampleSelector ISampleSelector;
-
-
-//template <class INFO>
-//class OSchema : public Abc::OSchema<INFO>
-//{
-//};
-
-//typedef Abc::SchemaObject<GeometricThingySchema> GeometricThingy;
-
-#else
-
-#define PTC_SCHEMA_INFO(STITLE, SBTYP, SDFLT, STDEF)
-
-template <class INFO>
-class ISchema
-{
-};
-
-
-template <class SCHEMA>
-class ISchemaObject
-{
-};
-
-
-template <class INFO>
-class OSchema
-{
-};
-
-#endif
-
-//} /* namespace PTC */
-
-#endif  /* PTC_SCHEMA_H */
diff --git a/source/blender/pointcache/PTC_archive.cpp b/source/blender/pointcache/intern/archive.cpp
similarity index 100%
rename from source/blender/pointcache/PTC_archive.cpp
rename to source/blender/pointcache/intern/archive.cpp
diff --git a/source/blender/pointcache/PTC_archive.h b/source/blender/pointcache/intern/archive.h
similarity index 85%
rename from source/blender/pointcache/PTC_archive.h
rename to source/blender/pointcache/intern/archive.h
index 5315dc4..1301751 100644
--- a/source/blender/pointcache/PTC_archive.h
+++ b/source/blender/pointcache/intern/archive.h
@@ -19,10 +19,4 @@
 #ifndef PTC_ARCHIVE_H
 #define PTC_ARCHIVE_H
 
-#include <Alembic/Abc/OArchive.h>
-#include <Alembic/AbcCoreHDF5/ReadWrite.h>
-
-using namespace Alembic::Abc;
-namespace Util = Alembic::Util;
-
 #endif  /* PTC_ARCHIVE_H */
diff --git a/source/blender/pointcache/PTC_particles.cpp b/source/blender/pointcache/intern/particles.cpp
similarity index 99%
rename from source/blender/pointcache/PTC_particles.cpp
rename to source/blender/pointcache/intern/particles.cpp
index 6790d1e..63d073a 100644
--- a/source/blender/pointcache/PTC_particles.cpp
+++ b/source/blender/pointcache/intern/particles.cpp
@@ -16,7 +16,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-#include "PTC_particles.h"
+#include "particles.h"
 
 //namespace PTC {
 
diff --git a/source/blender/pointcache/PTC_particles.h b/source/blender/pointcache/intern/particles.h
similarity index 77%
rename from source/blender/pointcache/PTC_particles.h
rename to source/blender/pointcache/intern/particles.h
index 5319054..696d456 100644
--- a/source/blender/pointcache/PTC_particles.h
+++ b/source/blender/pointcache/intern/particles.h
@@ -21,7 +21,8 @@
 
 //namespace PTC {
 
-#include "PTC_schema.h"
+#include "schema.h"
+#include "types.h"
 
 PTC_SCHEMA_INFO("Particles", "Particles", ".particles", ParticlesSchemaInfo);
 
@@ -36,11 +37,11 @@ public:
 		// Users don't ever create this data directly.
 		Sample() { reset(); }
 
-		Abc::P3fArraySamplePtr getPositions() const { return m_positions; }
-		Abc::UInt64ArraySamplePtr getIds() const { return m_ids; }
-		Abc::V3fArraySamplePtr getVelocities() const { return m_velocities; }
+		P3fArraySamplePtr getPositions() const { return m_positions; }
+		UInt64ArraySamplePtr getIds() const { return m_ids; }
+		V3fArraySamplePtr getVelocities() const { return m_velocities; }
 
-		Abc::Box3d getSelfBounds() const { return m_selfBounds; }
+		Box3d getSelfBounds() const { return m_selfBounds; }
 
 		bool valid() const
 		{
@@ -59,11 +60,11 @@ public:
 
 	protected:
 		friend class IParticlesSchema;
-		Abc::P3fArraySamplePtr m_positions;
-		Abc::UInt64ArraySamplePtr m_ids;
-		Abc::V3fArraySamplePtr m_velocities;
+		P3fArraySamplePtr m_positions;
+		UInt64ArraySamplePtr m_ids;
+		V3fArraySamplePtr m_velocities;
 
-		Abc::Box3d m_selfBounds;
+		Box3d m_selfBounds;
 	};
 
 	//-*************************************************************************
@@ -93,8 +94,8 @@ public:
 	IParticlesSchema(CPROP_PTR iParent,
 	                 const std::string &iName,
 
-	                 const Abc::Argument &iArg0 = Abc::Argument(),
-	                 const Abc::Argument &iArg1 = Abc::Argument())
+	                 const Argument &iArg0 = Argument(),
+	                 const Argument &iArg1 = Argument())
 	  : IGeomBaseSchema<ParticlesSchemaInfo>(iParent, iName,
 	                                         iArg0, iArg1)
 	{
@@ -105,8 +106,8 @@ public:
 	//! schema name used.
 	template <class CPROP_PTR>
 	explicit IParticlesSchema(CPROP_PTR iParent,
-	                          const Abc::Argument &iArg0 = Abc::Argument(),
-	                          const Abc::Argument &iArg1 = Abc::Argument())
+	                          const Argument &iArg0 = Argument(),
+	                          const Argument &iArg1 = Argument())
 	    : IGeomBaseSchema<ParticlesSchem

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list