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
path: root/source
diff options
context:
space:
mode:
authorMai Lavelle <mai.lavelle@gmail.com>2018-02-07 06:55:15 +0300
committerMai Lavelle <mai.lavelle@gmail.com>2018-02-15 11:26:59 +0300
commitc98af0faaf0d2dc87e9c0007e6fab8f44c2ba608 (patch)
tree14e154ef5b8fc9e3047efb3f859fa47ba5520626 /source
parentca7f826c6f1812d38cd3a6985b5fc8de6e9de78c (diff)
Add versioning code to make particles with default size visible again
Due to changes in draw code particles from old files that may have had a default draw size of 0 will not be visible. Old draw code would check for this and adjust the size, however the unit for draw size has changed from pixels to BU, and it no longer makes sense to have such checks. This patch is to ensure particles from such files remain visible.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenloader/intern/versioning_280.c12
-rw-r--r--source/blender/makesrna/intern/rna_particle.c2
2 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 93c6a9cccba..46021a8b502 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -546,6 +546,18 @@ void do_versions_after_linking_280(Main *main)
}
}
+ if (!MAIN_VERSION_ATLEAST(main, 280, 3)) {
+ /* Due to several changes to particle RNA and draw code particles from older files may no longer
+ * be visible. Here we correct this by setting a default draw size for those files. */
+ for (Object *object = main->object.first; object; object = object->id.next) {
+ for (ParticleSystem *psys = object->particlesystem.first; psys; psys=psys->next) {
+ if(psys->part->draw_size == 0.0f) {
+ psys->part->draw_size = 0.1f;
+ }
+ }
+ }
+ }
+
{
for (WorkSpace *workspace = main->workspaces.first; workspace; workspace = workspace->id.next) {
if (workspace->view_layer) {
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 1064b9f00f0..1a819c3bcdb 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -2382,7 +2382,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
prop = RNA_def_property(srna, "draw_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0, 1000);
RNA_def_property_ui_range(prop, 0, 100, 1, -1);
- RNA_def_property_ui_text(prop, "Draw Size", "Size of particles on viewport in BU (0.1 = default)");
+ RNA_def_property_ui_text(prop, "Draw Size", "Size of particles on viewport in BU");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
prop = RNA_def_property(srna, "child_type", PROP_ENUM, PROP_NONE);