-2
$\begingroup$

I do some edit on a mesh, but I want to know the script of what I am editing on the mesh for scripting an operator.

$\endgroup$
7
  • 2
    $\begingroup$ Hi and Welcome! Consider that the bare minimum here is to show some effort towards your goal. I'd recommend always add the current state of your code to your question, makes it way easier to give an answer. Please read: blender.stackexchange.com/help/how-to-ask, Cheers $\endgroup$
    – brockmann
    Apr 4 at 12:45
  • $\begingroup$ What? I did not know the code, how can I state? I come here to ask people how can I do. Please show your answer if you know. Thanks $\endgroup$ Apr 4 at 13:07
  • 1
    $\begingroup$ Unclear what you're asking for, hence no answer. Again edit your question, recommend post your code and read: blender.stackexchange.com/help/how-to-ask $\endgroup$
    – brockmann
    Apr 4 at 13:14
  • $\begingroup$ I will try, but I really don't know the code. $\endgroup$ Apr 4 at 13:26
  • 2
    $\begingroup$ Not sure what you mean by that. Please edit your question, describe in detail what you're looking for and add some research efforts at least. $\endgroup$
    – brockmann
    Apr 4 at 13:36
0
$\begingroup$

To know the script of what you're doing in the scene, you can see the Info Area in the Scripting Workspace. What you do in Blender will appear here, copy the script of what you did, and paste it to your script. enter image description here

I deleted the cube, and add back a new cube to the scene. It showed the script in the Info Area bpy.ops.object.delete(use_global=False, confirm=False) is the script that I deleted the cube but you just need to type bpy.ops.object.delete() if you keep the default size and location.

The Info Area show bpy.ops.mesh.primitive_cube_add(size=2, enter_editmode=False, align='WORLD', location=(0, 0, 0), scale=(1, 1, 1)) that I add a cube, but you just need to type bpy.ops.mesh.primitive_cube_add() if you keep the default size and location.

$\endgroup$
10
  • $\begingroup$ And... Can you send a photo to show where is the context menu??? $\endgroup$ Apr 4 at 13:10
  • $\begingroup$ OMG, thank you. I understood! $\endgroup$ Apr 4 at 13:21
  • $\begingroup$ Your context menu is called Info Area which actually is an Area and no menu, also there is no Scripting Tab it's actually a so called Workspace, read the manual: docs.blender.org/manual/en/latest/interface/window_system/… $\endgroup$
    – brockmann
    Apr 4 at 13:21
  • 2
    $\begingroup$ Still not correct. You can try to paste that in a script and run it but there is no guaranty that it will work since it just records the operators and properties available in the UI. If the question is how to create a mesh, then the answer is: Read the API docs and learn about Bmesh. $\endgroup$
    – brockmann
    Apr 4 at 13:48
  • 2
    $\begingroup$ Out of curiosity: How do you know exactly what the OP wants based on these questions? Trying to push your rep count? $\endgroup$
    – brockmann
    Apr 4 at 13:54

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