Can you change operation parameters prior to the operation

Apologies for the noob question,

Is there any way to change operation parameters prior to performing an operation like proportional editing or distance merging.

For example, you seem to only be able to set the falloff distance for proportional editing after (or during with the mouse wheel) you have moved the vertex. ie, you move the vertex then this window pops up and you change the fall off there.
image

Similarly, if you select merge by distance, it will first merge the vertices by the default or previous value, then it will allow you to change the value, after which it will perform the merge again.
image

Is there any way of setting the values prior to performing the operation initially?

If you delete the value and tab out of the field it should go to the default back.
Works for numeric fields.

Not that I am aware of. The closest I can think of is if you could run the operation through the python console, but that’s pretty bonky.

Proportional Size is by default set to 1.
Merge by Distance is by default set to 0.001.
You can change these defaults by modifying shortcuts properties in keymap.
(G,R,S shortcuts for Proportional Size, a created custom shortcut for Merge by Distance)

Then, any modification, during operation, is kept for next call of operator.

The only way to set-up values before initiating an operator is to use an active tool.
Because values to display are specific to operators.
How UI could know what values to display without a clue of the desired operator ?
There are hundreds of operators.

It would make sense to have proportional size value in Proportional Editing popover.
Proportional Editing is working with several operators. That could be a mode option.
But you just have to initiate the transform, to be able to modify it with shortcuts (Page Up, Page Down or shift Page UP, Shift Page Down). You are not forced to validate the operator.
For this particular case, that should be easier to modify value after validation.
The resulting shape becomes interactive.
If you modify value before execution, you may make a wrong appreciation of area displaced.

Distance of a Merge by Distance operator would not be used by other operators.
There is no justification to consider it as a mode option, like Auto-Merge threshold.

Thanks all,

I’m not sure I explained it very well. I’m from a maya background so I’m used to selecting the distance threshold before you merge.
The reason I’m finding it awkward is I’m working with a fairly large mesh and having to merge, using a distance I know to be wrong, then effectively undo the first merge and enter the correct distance to merge again, feels like an odd way to do it. (Unless I’m misunderstanding the workflow)

Anyway, I’ve bodged a small script that warks more or less the way maya does. Does this exist natively in Blender?

bl_info = {
    'name': 'Maya merge',
    'blender': (3, 3, 0),
    'category': 'Object'
}

import bpy

PROPS = [

    ('threshold', bpy.props.FloatProperty(name='Threshold',min=0, default=0.0001)),

]

class Merge(bpy.types.Operator):

    bl_idname = 'opr.merge_operator'
    bl_label = 'Merge'

    def execute(self, context):
        context.scene.threshold
        bpy.ops.mesh.remove_doubles(threshold=context.scene.threshold)

        return {'FINISHED'}

# == PANELS
class MayaMergePanel(bpy.types.Panel):
    bl_label = 'Maya Merge v0.03'
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'

    def draw(self, context):
        col = self.layout.column()
        col.operator('opr.merge_operator', text='Merge')
        for (prop_name, _) in PROPS:
            row = col.row()
            row.prop(context.scene, prop_name)
       
# == MAIN ROUTINE
CLASSES = [
    MayaMergePanel,
    Merge
]

def register():
    for (prop_name, prop_value) in PROPS:
        setattr(bpy.types.Scene, prop_name, prop_value)

    for klass in CLASSES:
        bpy.utils.register_class(klass)

def unregister():
    for (prop_name, _) in PROPS:
        delattr(bpy.types.Scene, prop_name)

    for klass in CLASSES:
        bpy.utils.unregister_class(klass)


if __name__ == '__main__':
    register()

But i guess the value is only shown in the UI after you selected the merge operation?
Same in Blender but Blender already shows you the result with the default values (ot the last one)
So just change the value before the operation is finished… no undo needed…

It’s just different… (I guess i would feel arkward selecting the merge operation in Maya… and nothing happens until i set the distance ?)

Edit: typo

All operators have default settings that they are executed with. The short answer is no, there is no easy way to do this like in Maya, you have to register a custom version of an operator for it to work.

As for this…

This has been my no1 pet peeve for 10+ years. I wish there was a way like in Maya to visualize and change the falloff before transforming but right now it’s impossible.

1 Like

IDK how maya do this but … wait… hmmm… according to

there is also just a circle? but if you hit G wit propEdit then there is also a circel before you move aything… ?

I don’t know if you’re talking about Maya or Blender? In Maya you can control the falloff distance independently of the transform operation, and it shows as a gradient over the mesh/curve/surface so you know which parts will be affected. In Blender we have no such visualization, and no way to control the falloff distance before starting the transform (outside of scripting it, which I suppose is possible). This is often problematic as transforming is slow on hires meshes (much less so in recent versions, but still), and the coloring in Maya helps identify exactly where the cutoff happens. In Blender this is guesswork, even while transforming. (writing for OP mostly, as I assume you know all this)

@Okidoki the page you linked talks about a tool I never knew existed tbh. What I do know is the regular transform tools have options for proportional editing, but they’re called “soft selection” and allow the user to control the falloff colors, falloff rate, cutoff, distance method, and so on.
Cf https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2019/ENU/Maya-Modeling/files/GUID-FF7C8670-97C7-4C13-9A6F-3B0A8F881EC9-htm.html

Apparently i just looked into the Maya docu and found nothing (yet) about a shaded coloring in maya… Ye indeed this would be more helpfull.
For me the circle in blender appears in prop edit direcly after pressing G without any movement… but of course this isn’t as nice as a color shaded visualization especially while selecting multiple vertices…
But you know that you can change/adapt the distance with the mousewheel while editing… ?

@Hadriscus Ahh now reading the edited version… one can learn somethign every day :wink:

Yes it does as soon as you trigger the transform operator, but working on a large mesh this is too late -you’re already deep in performance problems.

Yes, unfortunately I have no mouse wheel, no mouse at all in fact. I use a tablet and while there is a semblance of a mouse wheel on it, it’s very impractical to use.

This is how merging works in Maya. You can either select merge which will just use the default value. Or you can select the option box which will allow you to set the merge value before you merge.

The way Blender does it is fine for small data sets, in fact it’s pretty neat to be able to adjust the value and watch the result in real time. But if you’re working with larger data sets, you might have wait for a few seconds for the first merge to take place before you can enter the values you actually want. Granted a few seconds isn’t going to kill me and may give me some valuable time to think about my life, but still, it would be nice to avoid the first merge on large data sets.
Anyway, the script I posted above works the way maya does, so my problem is solved for merging.

The way proportional editing works in maya is, when you press b and move your mouse you adjust the range which is shown as a blue circle. You don’t have to have anything selected or moving to see this.

If you do have any components selected then it shows you which other components will be effected using a colour gradient.

It’s a good system.

Anyway no big deal, I think I can use the sculpt grab feature instead of proportional editing in blender. So I can roughly see the brush size before I start editing.

1 Like

Argghh i always forget the pure tablet users… even if i have one myself…
… and my models seem to be too small… (playing around mostly on an i3-3220 with 8GB) :wink:

1 Like

Ahh yes i saw already a glimpse of it in the mentioned docu but of course… this is nice… (even if maya is availabe for linux nowadays (?)… just too much for my simple purposes… see above…)

Hey,
I’ve written a small addon to try and emulate the way maya sets the proportional editing falloff.

I’m a bit inexperienced with Blender python but it seems to work with a couple of caveates…
The falloff display won’t centre on anything that isn’t a mesh component. It will still show the falloff, but it won’t centre around nurbs, for example.
The same thing applies if you have multiple objects in edit mode. It will still show the falloff size accurately, but it might not be in the right place. Other than that…

Prop Edit > turns proportional editing off and on.
Display > Shows or hides the falloff display.
Radius > sets the falloff radius. (This can be done at any time. The falloff display doesn’t have to be on)

Hope it helps with the tablet, I’ll post the code here and attach the python file. Just install it as you would any other addon.

bl_info = {
    'name': 'Set Proportional Falloff',
    'blender': (3, 0, 0),
    'category': 'Object'
}

import bpy
from mathutils import Vector

class Globals():
    displaySphere = None
    ToggleDisplayButtonText = "Display is Off"
    TogglePropotionalEditingButtonText = "Prop Edit"
    buttonAlert = False
    def update_func(self,context):
        ScaleFalloff(context)
    
    
PROPS = [

    ('radius', bpy.props.FloatProperty(name='radius',min=0, default=1.0, update = Globals.update_func))
]
     
def DoesObjectExist(name):
    for o in bpy.context.scene.objects:
        if o.name == name:           
            Globals.displaySphere = o
            return True
    return False
        
def ScaleFalloff(context):
    radius = context.scene.radius            
    if (DoesObjectExist("prop_fallOff")):

        Globals.displaySphere.empty_display_size = radius
        if (bpy.context.object.type == "MESH"): 
            median = getMedianPoint()
            if (median != None):
                bpy.data.objects["prop_fallOff"].location = median
   
    bpy.context.scene.tool_settings.proportional_size = radius

def ToggleSphere(context):

    if ( (DoesObjectExist("prop_fallOff")) == False):
        if (bpy.context.active_object != None):
            if (bpy.context.active_object.mode != "OBJECT"):
                bpy.ops.object.mode_set(mode='OBJECT')
        #bpy.ops.object.mode_set(mode='OBJECT')
        bpy.ops.object.empty_add(type='SPHERE', align='WORLD', location=(0, 0, 0), scale=(1, 1, 1))
        Globals.displaySphere = bpy.context.object
        Globals.displaySphere.name = "prop_fallOff"
        Globals.displaySphere.empty_display_size = context.scene.radius
        Globals.displaySphere.hide_select = True
        return

    if Globals.displaySphere.hide_get():
        Globals.displaySphere.hide_set(False)
        Globals.ToggleDisplayButtonText = "Display is ON"
        ScaleFalloff(context)
        
    else:
        Globals.displaySphere.hide_set(True)
        Globals.ToggleDisplayButtonText = "Display is OFF"
    

def getMedianPoint():
    ob = bpy.context.object
    if(ob == None):
        return
    ob.update_from_editmode()

    me = ob.data
    verts_sel = [v.co for v in me.vertices if v.select]
    if (len(verts_sel) == 0):
        return
    pivot = sum(verts_sel, Vector()) / len(verts_sel)
    #worldSpace = ("Global:", ob.matrix_world * pivot)
    worldSpace = ob.matrix_world @ pivot
    return worldSpace
    
class ToggleFalloff(bpy.types.Operator):

    bl_idname = 'opr.falloff_operator'
    bl_label = 'ToggleFalloff'
        
    def execute(self, context):        

        ToggleSphere(context)
            
        return {'FINISHED'}
    
class TogglePropotionalEditing(bpy.types.Operator):

    bl_idname = 'opr.proportional_editing_operator'
    bl_label = 'SetFalloff'
        
    def execute(self, context):        
        
        #bpy.context.scene.tool_settings.use_proportional_edit = False

        if(bpy.context.scene.tool_settings.use_proportional_edit):
            bpy.context.scene.tool_settings.use_proportional_edit = False
            bpy.context.scene.tool_settings.use_proportional_edit_objects = False
            Globals.TogglePropotionalEditingButtonText = "Prop Edit is Off"
            Globals.buttonAlert = True
        else:
            bpy.context.scene.tool_settings.use_proportional_edit = True
            bpy.context.scene.tool_settings.use_proportional_edit_objects = True
            Globals.TogglePropotionalEditingButtonText = "Prop Edit is On"
            Globals.buttonAlert = False

    
        return {'FINISHED'}

# == PANELS
class MayaSetFalloffPanel(bpy.types.Panel):
    bl_label = 'Set Prop Falloff v0.09'
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_category = "MTools"

    def draw(self, context):
        col = self.layout.column()
        col.operator('opr.proportional_editing_operator', text=Globals.TogglePropotionalEditingButtonText)
        col.separator()
        col.separator()
        col.alert = False
        col.operator('opr.falloff_operator', text=Globals.ToggleDisplayButtonText)
        for (prop_name, _) in PROPS:
            row = col.row()
            row.prop(context.scene, prop_name)

       
     
# == MAIN ROUTINE
CLASSES = [
    MayaSetFalloffPanel,
    ToggleFalloff,
    TogglePropotionalEditing
]


def register():
    for (prop_name, prop_value) in PROPS:
        setattr(bpy.types.Scene, prop_name, prop_value)

    for klass in CLASSES:
        bpy.utils.register_class(klass)

def unregister():
    for (prop_name, _) in PROPS:
        delattr(bpy.types.Scene, prop_name)

    for klass in CLASSES:
        bpy.utils.unregister_class(klass)


if __name__ == '__main__':
    register()

SetProportionalFalloff.py (4.8 KB)

Hmmm you know this? (tested on linux and v3.2.1):

Warning: 'MayaSetFalloffPanel' does not contain '_PT_' with prefix and suffix

okay until now it’s not showing a circle but an sphere gizmo… which doesn’t move… only until you select some other vertices and switch display off and on again…

Why the sphere gizmo ? I thought the benefit in maya is the colored visualization of the border (and the fading to this border) of the selected vertices ??.. okay okay long… term goals :wink:

Hey thanks for trying it!

I saw that error, not sure what it is. I worked from an old addon/template so I think there was a naming convention change somewhere along the way. It’s not affecting functionality as far as I can see so I’m letting it slide for now… :slight_smile:

Yeah, the gizmo won’t update position until you interact with the addon. Also the “prop on” button won’t update if proportional editing is enabled/disabled in Blender. It’s not ideal.
I’m sure there’s probably a way to read user interaction with the scene/ui. I might look into it later.

The sphere gizmo is just the easiest and quickest way to do it. I wouldn’t know where to begin colouring verticies in the blender viewport. (I actually doubt it’s possible) Maybe you could create a custom shader so it would work in evee mode or something, but thats way, way too much work for me now. This was really just an exercise for me and I’ve hit the limits of my experience.
The important thing for this addon for me is that it allows you to set the falloff value before you make the move. To suit people who use tablets or might just like that option (like me). The gizmo is a guide, but it doesn’t work in all circumstances, which is why there’s an option to switch it off.

Ahh yes, sorry i forgot about hti one…

This addon for (2.8 ??):


seems to do a pretty job… at least looking at the visualization… maybe you want to share some thoughts with the developer (and BA user) ??

1 Like

Well look at that.
I might reach out, would be interesting to find out how it’s done.
Cheers

1 Like