Page MenuHome

Prevent Boolean Modifier Dependency Cycles
AbandonedPublic

Authored by Hans Goudey (HooglyBoogly) on May 18 2020, 9:42 PM.

Details

Reviewers
Brecht Van Lommel (brecht)
Group Reviewers
User Interface
Summary

An unusual but possible situation is when two objects have boolean modifiers with each other as a target.

This is a dependency cycle, and it quickly creates messy geometry and slows down Blender a lot.

This patch prevents the creation of this specific dependency cycle. There shouldn't be any actual usecase negatively affected.

I would understand the argument that trying to prevent this sort of situation is a slippery slope and that it shouldn't be a goal to babysit users, but this is a quick fix without much of a downside IMO.

I didn't find any instances of WM_report in rna_*.c files, but a report in the console defeats the purpose here.

D4730 would also display this information, but it wouldn't prevent the cycle.

Diff Detail

Repository
rB Blender
Branch
boolean-modifier-cycle-warn (branched from master)
Build Status
Buildable 8104
Build 8104: arc lint + arc unit

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.May 18 2020, 9:42 PM
Brecht Van Lommel (brecht) requested changes to this revision.May 18 2020, 11:39 PM

It seems reasonable, but I'm not sure it's really necessary once we get dependency graph cycle warnings.

source/blender/makesrna/intern/rna_modifier.c
923

self will never be NULL, so !self || can be left out.

930–932

Use BKE_report(reports, ..).

This revision now requires changes to proceed.May 18 2020, 11:39 PM

BKE_report just shows up in terminal for me, and there's already a dependency cycle warning there.

But I also agree that finishing up D4730 would be a better solution, I don't think this is worth it.