[Bf-blender-cvs] [05a9788b254] master: Fix T64101: Crash entering edit mode with particle system

Sergey Sharybin noreply at git.blender.org
Fri May 24 14:54:55 CEST 2019


Commit: 05a9788b254d4e168f7a46d406aadf34b449d465
Author: Sergey Sharybin
Date:   Fri May 24 14:52:43 2019 +0200
Branches: master
https://developer.blender.org/rB05a9788b254d4e168f7a46d406aadf34b449d465

Fix T64101: Crash entering edit mode with particle system

Explicitly disable particles in edit for now.

Those were not rendered already, but were attempted to be converted
to Cycles structures (if UVs were not needed for hair nothing was
rendered, but if UVs are needed then crash happened).

Would be nice to bring hair in edit mode back, but this is a bit
more involved change, which will be done later.

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

M	intern/cycles/blender/blender_curves.cpp
M	source/blender/makesrna/intern/rna_particle.c

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

diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp
index 1a36376f36e..29a1408d85d 100644
--- a/intern/cycles/blender/blender_curves.cpp
+++ b/intern/cycles/blender/blender_curves.cpp
@@ -978,7 +978,7 @@ void BlenderSync::sync_curves(
   /* obtain general settings */
   const bool use_curves = scene->curve_system_manager->use_curves;
 
-  if (!(use_curves && b_ob.mode() != b_ob.mode_PARTICLE_EDIT)) {
+  if (!(use_curves && b_ob.mode() != b_ob.mode_PARTICLE_EDIT && b_ob.mode() != b_ob.mode_EDIT)) {
     if (!motion)
       mesh->compute_bounds();
     return;
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 641bf4128d0..a3178e0407f 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -534,6 +534,11 @@ static void rna_ParticleSystem_uv_on_emitter(ParticleSystem *particlesystem,
                                              int uv_no,
                                              float r_uv[2])
 {
+  if (modifier->mesh_final == NULL) {
+    BKE_report(reports, RPT_ERROR, "Object was not yet evaluated");
+    zero_v2(r_uv);
+    return;
+  }
   if (!CustomData_has_layer(&modifier->mesh_final->ldata, CD_MLOOPUV)) {
     BKE_report(reports, RPT_ERROR, "Mesh has no UV data");
     zero_v2(r_uv);



More information about the Bf-blender-cvs mailing list