[Bf-blender-cvs] [6a03ec9f0e8] usd-importer-T81257-merge: USD Import: switch on all eCacheFileType enums.

makowalski noreply at git.blender.org
Tue Apr 13 16:45:46 CEST 2021


Commit: 6a03ec9f0e879d15343e359aa93a075db88b547c
Author: makowalski
Date:   Mon Apr 12 20:47:15 2021 -0400
Branches: usd-importer-T81257-merge
https://developer.blender.org/rB6a03ec9f0e879d15343e359aa93a075db88b547c

USD Import: switch on all eCacheFileType enums.

Extended transformcache_evaluate() logic to handle all
eCacheFileType enums with no default. Per review for
differential D10700: Whenever a new enum value is
added in the future, the compiler will produce a warning
that it should be handled here.

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

M	source/blender/blenkernel/intern/constraint.c
M	source/blender/makesdna/DNA_cachefile_types.h

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

diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 923fbac0d55..19426b32200 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -5311,17 +5311,17 @@ static void transformcache_evaluate(bConstraint *con, bConstraintOb *cob, ListBa
   }
 
   switch (cache_file->type) {
-#  ifdef WITH_ALEMBIC
     case CACHEFILE_TYPE_ALEMBIC:
+#  ifdef WITH_ALEMBIC
       ABC_get_transform(data->reader, cob->matrix, time, cache_file->scale);
-      break;
 #  endif
-#  ifdef WITH_USD
+      break;
     case CACHEFILE_TYPE_USD:
+#  ifdef WITH_USD
       USD_get_transform(data->reader, cob->matrix, time * FPS, cache_file->scale);
-      break;
 #  endif
-    default:
+      break;
+    case CACHE_FILE_TYPE_INVALID:
       break;
   }
 #else
diff --git a/source/blender/makesdna/DNA_cachefile_types.h b/source/blender/makesdna/DNA_cachefile_types.h
index 6ad31728d20..87df703571a 100644
--- a/source/blender/makesdna/DNA_cachefile_types.h
+++ b/source/blender/makesdna/DNA_cachefile_types.h
@@ -33,12 +33,8 @@ struct GSet;
 
 /* CacheFile::type */
 typedef enum {
-#ifdef WITH_ALEMBIC
   CACHEFILE_TYPE_ALEMBIC = 1,
-#endif
-#ifdef WITH_USD
   CACHEFILE_TYPE_USD = 2,
-#endif
   CACHE_FILE_TYPE_INVALID = 0,
 } eCacheFileType;



More information about the Bf-blender-cvs mailing list