2
$\begingroup$

Simply stated, I'm looking for the python operator for what the P key does to selected objects in edit mode.

So I'm looping through edges like so:

import bpy

obj = bpy.context.active_object

for e in obj.data.edges:
    print(dir(e))

I'm attempting to find the e.magically_separate_from_object :D but cannot find it.

Usually I'd find out how to do it through the window interface,but I can't find the window interface for P either.

$\endgroup$
  • $\begingroup$ bpy.ops.mesh.separate() $\endgroup$ – gandalf3 Jul 19 '14 at 1:53
  • $\begingroup$ So normally how would I independently discover that little operation without posting on stackexchange? Is there an intuitive way to find it? $\endgroup$ – user5266 Jul 19 '14 at 2:01
  • $\begingroup$ If you hover over the options in the menu which appears when you press P, the python calls should be in the tooltip. You can also search the api reference. $\endgroup$ – gandalf3 Jul 19 '14 at 2:03
  • $\begingroup$ We dont want to have "python operation for..." (...every tool...) - so question should be worded more generally. How do I find the equivalent Python command for a key shortcut or menu item? ~ would be a good question. $\endgroup$ – ideasman42 Jul 19 '14 at 2:50
3
$\begingroup$

If you right click on nearly any button, tool, or menu item in blender there will be a link to the blender python API for that button.
enter image description here
Link to blender python API for bpy.ops.mesh.separate

$\endgroup$
2
$\begingroup$

if you slide down the info editor header, you will see a list of the operators as they are called, this will show you whats going on as you call operators.

$\endgroup$

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.