Ctrl-A for applying modifier under cursor (2.91) not active (2.92-2.93)

Hi folks!

Since 2.92 there is a new concept of active modifier, which was introduced due to new geometry nodes project.

The problem is that in 2.91 there is a possibility to apply/duplicate modifier which is under cursor while in 2.92 it works only for active one, so there is at least 1 extra step to do the same thing.

Is there a way to return a 2.91 behavior? I know there is probably a way to get it work through python, but it kind of annoying when good features gone… :frowning_face:

8 Likes

Fully agree with you here, having something applied which is not in user focus is a strange behavior, given that the rest of Blender is so much context and what is under the mouse cursor currently oriented.

2 Likes

+1 it took me by surprise too

As far as I can tell going through commits, this changes was made by @HooglyBoogly
@pablovazquez @brecht could you please assist about this decision and if there is a way to get back old behavior?
As for now, the only function of active modifier is viewing corresponding geometry nodes.
But this doesn’t break anything if modifier under cursor will be applied rather than active one.
I think two concepts got messed together…

Hi, I’ll give some justification if it helps.

  • Previously modifiers had no selection or active state, so the hover shortcuts did not conflict with any idea.
  • With geometry nodes there is an active modifier now. Yes, it’s only useful for geometry nodes, this is not ideal, but it’s a necessary idea, and it’s consistent with the idea of active elements elsewhere in Blender.
  • In Blender when you operate on elements you operate on the selection or the active element. So as soon as there is an active element here, it’s really inconsistent to operate on the hovered element.

There is no way to get the old behavior back by just editing the keymap, because the operators had to change for this. I’m not saying this is ideal, I acknowledge that it can be slower, especially combined with the hidden “Apply Modifier” button. I just think returning the old behavior does not make sense here anymore.

2 Likes

Thanks for answer and explanation!
I don’t really know a good way to solve it actually…
It seems we can’t have this working in a blender core after active modifier was introduced.
Is there a way to make this behavior possible using python?

Hmm, you could make new operators that call the set active modifier operator with “invoke” (it will set based on mouse position), then call the “apply modifier” operator.

Hi Hans, I think one of the reasons why it feels so slow compared to the previous method it’s that the number of areas that are clickable to make the modifier active are quite limited: here I already gave my suggestions on all the areas and “actions” that should make the modifier active if clicked. I know you already committed a patch that extended a little bit the clickable space, but I think that if all the areas I mentioned can trigger the active state, this feature will be already way faster and more responsive. Thanks!

I think the main question is how to get the modifier under cursor.
There is a way to grab data path using bpy.ops.ui.copy_data_path_button, but how really to detect the modifier “box”?

Right, that’s what OBJECT_OT_modifier_set_active should do.

Thanks, I think that’s an interesting idea. I’ll try to bring it up with the UI team. I think it would be pretty simple to implement anyway.

2 Likes

Yeap, it works quite nice!
Here is a quick code of an operator (shift-q for applying in this case):

import bpy

class ApplyModifierUnderCursor(bpy.types.Operator):
    bl_idname = "screen.apply_modifier_under_cursor"
    bl_label = ""
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):
        return bpy.ops.object.modifier_set_active.poll()

    def execute(self, context):
        mod_active_old = bpy.context.active_object.modifiers.active.name      
        bpy.ops.object.modifier_set_active('INVOKE_DEFAULT')
        mod_active_new = bpy.context.active_object.modifiers.active.name
        
        try:
            bpy.ops.object.modifier_apply(modifier=mod_active_new)
        except RuntimeError as ex:
            bpy.ops.object.modifier_set_active(modifier=mod_active_old)
            return {'FINISHED'}
        
        if mod_active_old != mod_active_new:
            bpy.ops.object.modifier_set_active(modifier=mod_active_old)
            
        return {'FINISHED'}


addon_keymaps = []

def register():
    # handle the keymap
    wm = bpy.context.window_manager
    kc = wm.keyconfigs.addon
    if kc:
        km = wm.keyconfigs.addon.keymaps.new(name='Screen')
        kmi = km.keymap_items.new(ApplyModifierUnderCursor.bl_idname, type='Q', value='PRESS', shift=True)
        addon_keymaps.append((km, kmi))

def unregister():
    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
    addon_keymaps.clear()


classes = (
    ApplyModifierUnderCursor,
)

if __name__ == "__main__":
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)
    register()
4 Likes

This is the first thing I noticed when first tested geometry nodes in 2.92 alpha. The new concept of active modifier broke extremely convinient workflow.

I think UX team should think of a solution to bring this back. It’s probably too late for 2.92, but it should be back for 2.93. It’s such a useful workflow I can imagine users to be very upset when 2.92 hit the release.

The most simple logic I see here is to trigger modifier under the cursor to become active and then apply/duplicate/delete it based on a hotkey.

If anyone interested, there is a full add-on performing Apple, Duplicate, Remove actions while hovering the modifier:

12 Likes

While I appreciate the effort it’s ridiculous that community have to figure out workarounds for a broken workflow that should work out of the box. Especially when it was working already.

Yeap, that’s sad.
A lot of features struggling here and there, but it is really hard to influate design in blender despite it is open to community.
But since I use latest builds I needed this addon anyway.

Thank you sooo much!
Seems to work great and saves me a lot of frustration…I am sure I would have gotten used to it, but this is way better.

This is extremly bad change. It breaks good workflow for no reason and no option to change it back. Clearly we shoudn`t have addon for this, but thx to the guy who did it though

Thanks so much for this. I hope this functionality returns baked in!

This is sad but thx for the addon !