1
$\begingroup$

Ver. 2.79. I was hoping I could change some annoying settings by just editing some of the .PY files bundled with blender. Especially default inset amount. Maybe it's not that easy.

But for example, I see this file - "C:\Program Files\Blender Foundation\2.79\scripts\addons\mesh_inset__init__.py"

Within that file is this code:

inset_amount = FloatProperty(name="Amount",
    description="Amount to move inset edges",
    default=5.0,

I was hoping just changing that default might do what I want, but it doesn't seem to have any effect. Does anyone know if/how I can do this without having to recompile Blender?

$\endgroup$
1
$\begingroup$

Try to look in User Preferences, in Input tab. There is 2 different ways to do what.

First if your command called right from key-building. In this case you don't need to edit any python code, just go in Input tab, find command and here you can set any default settings as you like:

enter image description here

For example, I changed segments count. And after changing press Save user settings.

Second than your command called from menu, like W -> Remove doubles. You can also create a new shortcut and edit this settings like I explained before:

enter image description here

But of course it will affects only on new keybinding. So how to change default settings in menu? This time also go in Input tab, find command Call Menu that calls from keybinding (in case of Remove doubles it will be W ): enter image description here

And we interested in Name of menu (in our case it is "VIEW3D_MT_edit_mesh_specials")

This is what can search in files, and find menu like this:

class VIEW3D_MT_edit_mesh_specials(Menu):
    bl_label = "Specials"

    def draw(self, context):
        layout = self.layout

        layout.operator_context = 'INVOKE_REGION_WIN'

        layout.operator("mesh.subdivide", text="Subdivide").smoothness = 0.0
        layout.operator("mesh.subdivide", text="Subdivide Smooth").smoothness = 1.0

        layout.separator()

        layout.operator("mesh.merge", text="Merge...")
        layout.operator("mesh.remove_doubles")

        layout.separator()

        layout.operator("mesh.hide", text="Hide").unselected = False
        layout.operator("mesh.reveal", text="Reveal")
        layout.operator("mesh.select_all", text="Select Inverse").action = 'INVERT'

        layout.separator()

        layout.operator("mesh.flip_normals")
        layout.operator("mesh.vertices_smooth", text="Smooth")
        layout.operator("mesh.vertices_smooth_laplacian", text="Laplacian Smooth")

        layout.separator()

        layout.operator("mesh.inset")
        layout.operator("mesh.bevel", text="Bevel")
        layout.operator("mesh.bridge_edge_loops")

        layout.separator()

        layout.operator("mesh.faces_shade_smooth")
        layout.operator("mesh.faces_shade_flat")

        layout.separator()

        layout.operator("mesh.blend_from_shape")
        layout.operator("mesh.shape_propagate_to_all")
        layout.operator("mesh.shortest_path_select")
        layout.operator("mesh.sort_elements")
        layout.operator("mesh.symmetrize")
        layout.operator("mesh.symmetry_snap")

I found this file here: /usr/share/blender/2.79/scripts/startup/bl_ui/space_view3d.py

This is a menu, that called from Call Menu("VIEW3D_MT_edit_mesh_specials"). Here you can add some default parameters.

$\endgroup$
  • $\begingroup$ Although it says to avoid comments like "thanks" I really want to thank you, Crantisz. I can't believe all this time I overlooked the fact that default settings can be changed in keybindings. The inset thing drove me crazy for so long. If I decide to edit e.g. space_view3d.py, do you know how I can find the syntax to write in my own new defaults? For example how would I specify a new merge distance for remove doubles, is it going to be similar to the subdivide smooth syntax? Something like .merge_distance = 1.0 ? $\endgroup$ – CreeDorofl Nov 13 '17 at 8:01
  • 1
    $\begingroup$ @CreeDorofl on top panel you can find list of last used commands i.stack.imgur.com/yQF2F.jpg $\endgroup$ – Crantisz Nov 13 '17 at 11:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.