Page MenuHome

Particle system doesn't update immediately according to texture properties
Closed, ResolvedPublic

Description

System Information
Operating system: Windows-7-6.1.7601-SP1 64 Bits
Graphics card: GeForce GTX 660 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 442.59

Blender Version
Broken: version: 2.83 (sub 13), branch: master, commit date: 2020-04-16 15:38, hash: rB8cb10c124efe

Short description of error
When I change texture, that influence to density, hair do not update automatically and I forced to refresh it manually.
situation with particles is worse: after rechecking influence, it become disabled (for viewport)

Steps to redo
paint the hair & observe that it doesn't change.
One has to change property slider to update it, or toggle the checkbox.


Event Timeline

Ankit Meel (ankitm) renamed this task from Particle system texture influence update issues. to Particle system doesn't update immediately according to texture properties.Apr 18 2020, 5:17 PM
Ankit Meel (ankitm) updated the task description. (Show Details)
Ankit Meel (ankitm) changed the task status from Needs Triage to Confirmed.Apr 18 2020, 5:20 PM

Please take care to add steps in text, video is secondary. Video is there to assist, not to be the main source of info.

Assigning this task to myself just to let developers know that after having a look at this issue (I'm currently ramping-up on blender coding ), I'll propose the patch below through appropriate code review system.

Still need to understand if this piece of code wasn't there on purpose to avoid possible performance issues while texture painting or if it's acceptable.

@@ -4607,6 +4608,14 @@ static void project_paint_end(ProjPaintState *ps)
     for (a = 0, projIma = ps->projImages; a < ps->image_tot; a++, projIma++) {
       BKE_image_release_ibuf(projIma->ima, projIma->ibuf, NULL);
       DEG_id_tag_update(&projIma->ima->id, 0);
+
+      /* Check if this image is referenced by a texture and update */
+      Main *bmain = G_MAIN;
+      for (Tex *tex = bmain->textures.first; tex; tex = tex->id.next) {
+        if (projIma->ima == tex->ima) {
+          DEG_id_tag_update(&tex->id, 0);
+        }
+      }
     }
   }

Thanks Ankit.
I actually installed arcanist and ended-up with this patch:
https://developer.blender.org/D7472