Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenloader/intern/versioning_290.c')
-rw-r--r--source/blender/blenloader/intern/versioning_290.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c
index 7dc1aab833e..73a4b1a9098 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -31,8 +31,10 @@
#include "DNA_genfile.h"
#include "DNA_gpencil_modifier_types.h"
#include "DNA_gpencil_types.h"
+#include "DNA_hair_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
+#include "DNA_pointcloud_types.h"
#include "DNA_rigidbody_types.h"
#include "DNA_screen_types.h"
#include "DNA_shader_fx_types.h"
@@ -251,6 +253,25 @@ static void panels_remove_x_closed_flag_recursive(Panel *panel)
}
}
+static void do_versions_point_attributes(CustomData *pdata)
+{
+ /* Change to generic named float/float3 attributes. */
+ const int CD_LOCATION = 43;
+ const int CD_RADIUS = 44;
+
+ for (int i = 0; i < pdata->totlayer; i++) {
+ CustomDataLayer *layer = &pdata->layers[i];
+ if (layer->type == CD_LOCATION) {
+ STRNCPY(layer->name, "Position");
+ layer->type = CD_PROP_FLOAT3;
+ }
+ else if (layer->type == CD_RADIUS) {
+ STRNCPY(layer->name, "Radius");
+ layer->type = CD_PROP_FLOAT;
+ }
+ }
+}
+
void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
{
UNUSED_VARS(fd);
@@ -555,6 +576,15 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
+ /* Hair and PointCloud attributes. */
+ for (Hair *hair = bmain->hairs.first; hair != NULL; hair = hair->id.next) {
+ do_versions_point_attributes(&hair->pdata);
+ }
+ for (PointCloud *pointcloud = bmain->pointclouds.first; pointcloud != NULL;
+ pointcloud = pointcloud->id.next) {
+ do_versions_point_attributes(&pointcloud->pdata);
+ }
+
/* Keep this block, even when empty. */
}
}