Page MenuHome

Boolean Modifier: Operand types
ClosedPublic

Authored by Zachary (AFWS) on Sat, Sep 5, 10:06 PM.
Tags
None
Tokens
"Like" token, awarded by roman13."Love" token, awarded by rbx775."Love" token, awarded by gilberto_rodrigues."Burninate" token, awarded by DotBow."Love" token, awarded by jc4d."Love" token, awarded by belich."Burninate" token, awarded by amonpaike."Burninate" token, awarded by imad_mss."Love" token, awarded by Alaska."Love" token, awarded by chironamo."Love" token, awarded by erickblender."Love" token, awarded by manitwo."Love" token, awarded by rpserge.

Details

Summary

This allows users to use a collection for the boolean modifier and gets rid of the long modifier stack.

Operand Types

  • Object
  • Collection

Currently, requires 20 modifiers with using single objects.

With collection, stack requires only 2 modifiers.

Issues

Seems it doesn't get updated when you delete/move objects from/to collection and you have to move object for update.

Diff Detail

Event Timeline

Zachary (AFWS) requested review of this revision.Sat, Sep 5, 10:06 PM
Zachary (AFWS) created this revision.

Thanks for the patch. I will be looking at this.

Fixed object display update.

Here is an updated diff that resolves the conflicts with the changes I just made in master to add a 'Self' flag for Exact.

Thanks for this revision! The code works well. There is one issue to fix: when get_quick_mesh returns non-NULL in BMD_mesh_bm_create, you return an uninitialized bm.

Other than that, as you suspected, the biggest point of contention here is that having the Display override for the operands is problematic in several ways:

  1. It is out of synch with the Display type property, so can lead to user confusion
  2. Various addons no doubt already help users set the Display type for the operands, and those will likely break with this
  3. I noticed that if I deleted the collection from the Boolean modifier, the operands stayed in their overridden Wire display, which makes #1 even more of an issue.

I do understand that this is useful, and for new users of Boolean, would no doubt resolve a point of confusion that everyone has -- why does it seem that the boolean did not work? (Answer: because the operand objects are still visible). So I would like the opinion of the other Modeling Module owners and the UI team on this question. Campbell?

Another minor point: I would have preferred that you didn't make a whole new enumeration for Boolean operations just because you can't do Intersect in a cascade. Is there not some way to use the current one and just disable the button for "Intersect" or pop up an error message if the user chooses that? I have another reason to ask for this change. The Exact solver will in fact be able to do an Intersect with a whole collection. I just have to change the test_fn to be an n-ary function and pass in the union of all the meshes at one go. This will also be a lot faster, so I intend to do this when the solver is Exact. Then I would only want to disable or error-message the Intersect operation on a collection when the solver is not Exact.

An even more minor point: it would be better not to use shorts for the two things you added to the dna. I think they could be bits in the flag, and I believe there's a way to tell rna that the bits are an enum.

A good compromise for the wire display problem might be providing a button right in the modifier to toggle the wireframe visibility of the objects. This is still a bit out of the ordinary, but it could be very useful.

It could even be pretty unobtrusive like this: (or a full text button)

In object_modifier.c there are special operators for specific modifiers to do somewhat similar things.

Modifiers should definitely not make any modifications to other objects during evaluation. An operator seems like a good solution to me.

Zachary (AFWS) updated this revision to Diff 28697.EditedWed, Sep 9, 6:22 PM

Removed display option and updated. @Howard Trickey (howardt) hopefully this fixed your issues.

Zachary (AFWS) retitled this revision from Boolean Modifier: Operand types and display option to Boolean Modifier: Operand types.Wed, Sep 9, 6:24 PM
Zachary (AFWS) edited the summary of this revision. (Show Details)

Removed ModifierData from BMD_mesh_bm_create

I applied this diff, with some more changes needed to use it properly with the Exact solver (in Intersect mode). Also fixed a few minor things - warnings, and the rna definition for the Operand Type so that it didn't overwrite the Self flag.

Thanks for the patch, Zachary!

This revision is now accepted and ready to land.Sun, Sep 13, 11:02 PM

Closing since this has been committed.