0
$\begingroup$

That's my answer.cause i am a new guy in this form.i cant find another way to reply this question after being deleted comment by moderator.thks all guys.if you want to know how to change the keyboard shortcut.contact meI could not run the command object.modifier_add as explained here. What's up with this?

That is the problem

$\endgroup$
8
  • $\begingroup$ the linked page shows that there is a pop menu to set up shortup for "add_modifier" and I can't pop it up. How should i do ??Thanks $\endgroup$
    – Jason Chan
    May 5, 2018 at 21:15
  • 2
    $\begingroup$ Using the instructions from linked page I can make the menu appear, so define what doesn't work / isn't clear for you - on step of opening User Prefs window, on step of searching for appropriate context for the shortcut, etc. See also blender.meta.stackexchange.com/q/2449/1245 and please format your questions in a bit more clear way, you can edit it to add any info. $\endgroup$
    – Mr Zak
    May 5, 2018 at 23:30
  • $\begingroup$ means i cant pop up the shortcuts setting menu, i run the script in python console with the command “objects.modifier_add",and no menu mentioned in the linked page poped up $\endgroup$
    – Jason Chan
    May 7, 2018 at 0:02
  • $\begingroup$ Where does it suggest run object.modifier_add in python console? Be like putting milk in your petrol tank and wondering why your car wont start. Add it in the keymap editor $\endgroup$
    – batFINGER
    May 7, 2018 at 16:32
  • $\begingroup$ Possible duplicate of Is there a way to call the Modifier menu with a keyboard shortcut? $\endgroup$ May 7, 2018 at 21:33

1 Answer 1

1
$\begingroup$

The string you type in the shortcut configuration screen is not Python code. It just happens to look somewhat similar to it. To run the operator as Python code, prefix it with bpy.ops, so bpy.ops.object.modifier_add().

However, it's better to not use operators at all, and use a regular Python function instead:

bpy.context.active_object.modifiers.new('operatorname', 'BEVEL')

See the documentation for more info on all the operator type names. This function returns the new modifier, so you can set properties on it directly.

$\endgroup$
2
  • $\begingroup$ have voted your answer. it seems i find the solution,thkyou $\endgroup$
    – Jason Chan
    May 7, 2018 at 22:26
  • $\begingroup$ cause i am a new guys.why i cant write another answer instead of my last deleted one by moderator??...........So I cant past the answer here.emmmm............... $\endgroup$
    – Jason Chan
    May 7, 2018 at 22:30

Not the answer you're looking for? Browse other questions tagged .