[Bf-blender-cvs] [ffb083f] alembic_basic_io: DNA/RNA changes

Campbell Barton noreply at git.blender.org
Fri Jul 29 07:15:45 CEST 2016


Commit: ffb083f24739468f875b536bc47782f7b5131873
Author: Campbell Barton
Date:   Fri Jul 29 15:15:19 2016 +1000
Branches: alembic_basic_io
https://developer.blender.org/rBffb083f24739468f875b536bc47782f7b5131873

DNA/RNA changes

- replace ABC_ prefix w/ MOD_MESHSEQ_
- don't use abc_ prefix for DNA paths (this doesn't depend on alembic)
- use an enum-flag for read-data (multiple boolean options).

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

M	release/scripts/startup/bl_ui/properties_constraint.py
M	release/scripts/startup/bl_ui/properties_data_modifier.py
M	source/blender/alembic/intern/abc_mesh.cc
M	source/blender/alembic/intern/abc_object.cc
M	source/blender/alembic/intern/abc_object.h
M	source/blender/alembic/intern/alembic_capi.cc
M	source/blender/blenkernel/intern/constraint.c
M	source/blender/editors/object/object_constraint.c
M	source/blender/makesdna/DNA_constraint_types.h
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/makesrna/intern/rna_constraint.c
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/modifiers/intern/MOD_meshsequencecache.c

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

diff --git a/release/scripts/startup/bl_ui/properties_constraint.py b/release/scripts/startup/bl_ui/properties_constraint.py
index af7470f..cb5f159 100644
--- a/release/scripts/startup/bl_ui/properties_constraint.py
+++ b/release/scripts/startup/bl_ui/properties_constraint.py
@@ -891,7 +891,7 @@ class ConstraintButtonsPanel:
         box = layout.box()
         
         if cache_file is not None:
-            box.prop_search(con, "abc_object_path", cache_file, "object_paths")
+            box.prop_search(con, "object_path", cache_file, "object_paths")
 
     def SCRIPT(self, context, layout, con):
         layout.label("Blender 2.6 doesn't support python constraints yet")
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index f855076..a3f20e4 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -228,13 +228,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
         box = layout.box()
 
         if cache_file is not None:
-            box.prop_search(md, "abc_object_path", cache_file, "object_paths")
+            box.prop_search(md, "object_path", cache_file, "object_paths")
 
         if ob.type == 'MESH':
-            box.prop(md, "read_verts")
-            box.prop(md, "read_faces")
-            box.prop(md, "read_uvs")
-            box.prop(md, "read_mcols")
+            box.row().prop(md, "read_data")
 
     def CAST(self, layout, ob, md):
         split = layout.split(percentage=0.25)
diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc
index 07bd12e..f1c7b6b 100644
--- a/source/blender/alembic/intern/abc_mesh.cc
+++ b/source/blender/alembic/intern/abc_mesh.cc
@@ -964,7 +964,7 @@ ABC_INLINE void read_normals_params(AbcMeshData &abc_data,
 AbcMeshReader::AbcMeshReader(const IObject &object, ImportSettings &settings)
     : AbcObjectReader(object, settings)
 {
-	m_settings->flag |= ABC_READ_ALL;
+	m_settings->read_flag |= MOD_MESHSEQ_READ_ALL;
 
 	IPolyMesh ipoly_mesh(m_iobject, kWrapExisting);
 	m_schema = ipoly_mesh.getSchema();
@@ -1079,19 +1079,19 @@ void read_mesh_sample(ImportSettings *settings,
 
 	do_normals = (abc_mesh_data.face_normals != NULL);
 
-	if ((settings->flag & ABC_READ_UVS) != 0) {
+	if ((settings->read_flag & MOD_MESHSEQ_READ_UV) != 0) {
 		read_uvs_params(config, abc_mesh_data, schema.getUVsParam(), selector);
 	}
 
-	if ((settings->flag & ABC_READ_VERTS) != 0) {
+	if ((settings->read_flag & MOD_MESHSEQ_READ_VERT) != 0) {
 		read_mverts(config, abc_mesh_data);
 	}
 
-	if ((settings->flag & ABC_READ_FACES) != 0) {
+	if ((settings->read_flag & MOD_MESHSEQ_READ_POLY) != 0) {
 		read_mpolys(config, abc_mesh_data);
 	}
 
-	if ((settings->flag & (ABC_READ_UVS | ABC_READ_MCOLS)) != 0) {
+	if ((settings->read_flag & (MOD_MESHSEQ_READ_UV | MOD_MESHSEQ_READ_COLOR)) != 0) {
 		read_custom_data(schema.getArbGeomParams(), config, selector);
 	}
 
@@ -1116,7 +1116,7 @@ ABC_INLINE MEdge *find_edge(MEdge *edges, int totedge, int v1, int v2)
 AbcSubDReader::AbcSubDReader(const IObject &object, ImportSettings &settings)
     : AbcObjectReader(object, settings)
 {
-	m_settings->flag |= ABC_READ_ALL;
+	m_settings->read_flag |= MOD_MESHSEQ_READ_ALL;
 
 	ISubD isubd_mesh(m_iobject, kWrapExisting);
 	m_schema = isubd_mesh.getSchema();
@@ -1193,19 +1193,19 @@ void read_subd_sample(ImportSettings *settings,
 	abc_mesh_data.face_normals = N3fArraySamplePtr();
 	abc_mesh_data.positions = sample.getPositions();
 
-	if ((settings->flag & ABC_READ_UVS) != 0) {
+	if ((settings->read_flag & MOD_MESHSEQ_READ_UV) != 0) {
 		read_uvs_params(config, abc_mesh_data, schema.getUVsParam(), selector);
 	}
 
-	if ((settings->flag & ABC_READ_VERTS) != 0) {
+	if ((settings->read_flag & MOD_MESHSEQ_READ_VERT) != 0) {
 		read_mverts(config, abc_mesh_data);
 	}
 
-	if ((settings->flag & ABC_READ_FACES) != 0) {
+	if ((settings->read_flag & MOD_MESHSEQ_READ_POLY) != 0) {
 		read_mpolys(config, abc_mesh_data);
 	}
 
-	if ((settings->flag & (ABC_READ_UVS | ABC_READ_MCOLS)) != 0) {
+	if ((settings->read_flag & (MOD_MESHSEQ_READ_UV | MOD_MESHSEQ_READ_COLOR)) != 0) {
 		read_custom_data(schema.getArbGeomParams(), config, selector);
 	}
 
diff --git a/source/blender/alembic/intern/abc_object.cc b/source/blender/alembic/intern/abc_object.cc
index 740ba05..5b7b85f 100644
--- a/source/blender/alembic/intern/abc_object.cc
+++ b/source/blender/alembic/intern/abc_object.cc
@@ -207,7 +207,7 @@ void AbcObjectReader::readObjectMatrix(const float time)
 	if (!schema.isConstant()) {
 		bConstraint *con = BKE_constraint_add_for_object(m_object, NULL, CONSTRAINT_TYPE_TRANSFORM_CACHE);
 		bTransformCacheConstraint *data = static_cast<bTransformCacheConstraint *>(con->data);
-		BLI_strncpy(data->abc_object_path, m_iobject.getFullName().c_str(), FILE_MAX);
+		BLI_strncpy(data->object_path, m_iobject.getFullName().c_str(), FILE_MAX);
 
 		data->cache_file = m_settings->cache_file;
 		id_us_plus(&data->cache_file->id);
@@ -224,7 +224,7 @@ void AbcObjectReader::addCacheModifier() const
 	mcmd->cache_file = m_settings->cache_file;
 	id_us_plus(&mcmd->cache_file->id);
 
-	BLI_strncpy(mcmd->abc_object_path, m_iobject.getFullName().c_str(), FILE_MAX);
+	BLI_strncpy(mcmd->object_path, m_iobject.getFullName().c_str(), FILE_MAX);
 }
 
 chrono_t AbcObjectReader::minTime() const
diff --git a/source/blender/alembic/intern/abc_object.h b/source/blender/alembic/intern/abc_object.h
index e664dcb..2e885f2 100644
--- a/source/blender/alembic/intern/abc_object.h
+++ b/source/blender/alembic/intern/abc_object.h
@@ -92,7 +92,8 @@ struct ImportSettings {
 	int sequence_len;
 	int offset;
 
-	int flag;
+	/* From MeshSeqCacheModifierData.read_flag */
+	int read_flag;
 
 	bool validate_meshes;
 
@@ -107,7 +108,7 @@ struct ImportSettings {
 	    , set_frame_range(false)
 	    , sequence_len(1)
 	    , offset(0)
-	    , flag(0)
+	    , read_flag(0)
 	    , validate_meshes(false)
 	    , cache_file(NULL)
 	{}
diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc
index 6270dec..791f021 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -891,7 +891,7 @@ ABC_INLINE CDStreamConfig get_config(DerivedMesh *dm)
 	return config;
 }
 
-static DerivedMesh *read_mesh_sample(DerivedMesh *dm, const IObject &iobject, const float time, int flags)
+static DerivedMesh *read_mesh_sample(DerivedMesh *dm, const IObject &iobject, const float time, int read_flag)
 {
 	IPolyMesh mesh(iobject, kWrapExisting);
 	IPolyMeshSchema schema = mesh.getSchema();
@@ -906,7 +906,7 @@ static DerivedMesh *read_mesh_sample(DerivedMesh *dm, const IObject &iobject, co
 
 	/* Only read point data when streaming meshes, unless we need to create new ones. */
 	ImportSettings settings;
-	settings.flag |= flags;
+	settings.read_flag |= read_flag;
 
 	if (dm->getNumVerts(dm) != positions->size()) {
 		new_dm = CDDM_from_template(dm,
@@ -916,7 +916,7 @@ static DerivedMesh *read_mesh_sample(DerivedMesh *dm, const IObject &iobject, co
 		                            face_indices->size(),
 		                            face_counts->size());
 
-		settings.flag |= ABC_READ_ALL;
+		settings.read_flag |= MOD_MESHSEQ_READ_ALL;
 	}
 
 	CDStreamConfig config = get_config(new_dm ? new_dm : dm);
@@ -941,7 +941,7 @@ static DerivedMesh *read_mesh_sample(DerivedMesh *dm, const IObject &iobject, co
 
 using Alembic::AbcGeom::ISubDSchema;
 
-static DerivedMesh *read_subd_sample(DerivedMesh *dm, const IObject &iobject, const float time, int flags)
+static DerivedMesh *read_subd_sample(DerivedMesh *dm, const IObject &iobject, const float time, int read_flag)
 {
 	ISubD mesh(iobject, kWrapExisting);
 	ISubDSchema schema = mesh.getSchema();
@@ -955,7 +955,7 @@ static DerivedMesh *read_subd_sample(DerivedMesh *dm, const IObject &iobject, co
 	DerivedMesh *new_dm = NULL;
 
 	ImportSettings settings;
-	settings.flag |= flags;
+	settings.read_flag |= read_flag;
 
 	if (dm->getNumVerts(dm) != positions->size()) {
 		new_dm = CDDM_from_template(dm,
@@ -965,7 +965,7 @@ static DerivedMesh *read_subd_sample(DerivedMesh *dm, const IObject &iobject, co
 		                            face_indices->size(),
 		                            face_counts->size());
 
-		settings.flag |= ABC_READ_ALL;
+		settings.read_flag |= MOD_MESHSEQ_READ_ALL;
 	}
 
 	/* Only read point data when streaming meshes, unless we need to create new ones. */
@@ -1067,7 +1067,7 @@ DerivedMesh *ABC_read_mesh(AbcArchiveHandle *handle,
                            const char *object_path,
                            const float time,
                            const char **err_str,
-                           int flags)
+                           int read_flag)
 {
 	IArchive *archive = archive_from_handle(handle);
 
@@ -1092,7 +1092,7 @@ DerivedMesh *ABC_read_mesh(AbcArchiveHandle *handle,
 			return NULL;
 		}
 
-		return read_mesh_sample(dm, iobject, time, flags);
+		return read_mesh_sample(dm, iobject, time, read_flag);
 	}
 	else if (ISubD::matches(header)) {
 		if (ob->type != OB_MESH) {
@@ -1100,7 +1100,7 @@ DerivedMesh *ABC_read_mesh(AbcArchiveHandle *handle,
 			return NULL;
 		}
 
-		return read_subd_sample(dm, iobject, time, flags);
+		return read_subd_sample(dm, iobject, time, read_flag);
 	}
 	else if (IPoints::matches(header)) {
 		if (ob->type != OB_MESH) {
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index d0cb783..508370e 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -4356,7 +4356,7 @@ static void transformcache_evaluate(bConstraint *con, bConstraintOb *cob, ListBa
 	const float frame = BKE_scene_frame_get(scene);
 	const float time = BKE_cachefile_time_offset(data->cache_file, frame, FPS);
 
-	ABC_get_transform(data->cache_file->handle, cob->ob, data->abc_object_path,
+	ABC_get_transform(data->cache_file->handle, cob->ob, data->object_path,
 	                  cob->matrix, time, data->cache_file->scale);
 #else
 	UNUSED_VARS(con, cob);
@@ -4370,7 +4

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list