-3

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.

Duarte Farrajota Ramos
  • 59,425
  • 39
  • 130
  • 187
  • 2
    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: https://blender.stackexchange.com/help/how-to-ask, Cheers – brockmann Apr 04 '21 at 12:45
  • 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 – Doggy is best Apr 04 '21 at 13:07
  • 1
    Unclear what you're asking for, hence no answer. Again edit your question, recommend post your code and read: https://blender.stackexchange.com/help/how-to-ask – brockmann Apr 04 '21 at 13:14
  • I will try, but I really don't know the code. – Doggy is best Apr 04 '21 at 13:26
  • scripts to know what I have done in blender – Doggy is best Apr 04 '21 at 13:35
  • that means example: what is the code when I add a cube – Doggy is best Apr 04 '21 at 13:35
  • 2
    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. – brockmann Apr 04 '21 at 13:36

1 Answers1

0

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.

8N Films
  • 163
  • 1
  • 12
  • And... Can you send a photo to show where is the context menu??? – Doggy is best Apr 04 '21 at 13:10
  • OMG, thank you. I understood! – Doggy is best Apr 04 '21 at 13:21
  • 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: https://docs.blender.org/manual/en/latest/interface/window_system/workspaces.html – brockmann Apr 04 '21 at 13:21
  • Thanks for telling me @brockmann – 8N Films Apr 04 '21 at 13:37
  • 2
    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. – brockmann Apr 04 '21 at 13:48
  • 2
    Out of curiosity: How do you know exactly what the OP wants based on these questions? Trying to push your rep count? – brockmann Apr 04 '21 at 13:54
  • What is Bmesh and API? Don't know what you mean. And also, what is OP? Are you talking about @8NFilms? Because I don't know what you mean by OP – Doggy is best Apr 04 '21 at 14:17
  • @brockmann I know what he wants because he/she tell me to answer this question after I answered this: https://blender.stackexchange.com/questions/218371/how-to-make-a-button-to-add-mesh-that-has-been-edited You can see the comment on that question. Also, what is trying to push rep count? What is rep count? – 8N Films Apr 04 '21 at 15:40
  • @Doggyisbest I think you can find these information in Blender development website: https://wiki.blender.org/wiki/Main_Page – 8N Films Apr 04 '21 at 15:42
  • Magical! Based on that question in the comments, I personally would not be able to get what the question is. Long timer here, and all I can say is that such lucky shots (3 or 4 answers like this, all accepted) never happened to me. Maybe you are just a pretty smart guy or equipped with clairvoyant abilities :D Re your answer, recommend read: https://blender.stackexchange.com/a/67252/31447 (I think all pros and cons are mentioned why this is a bad idea when it comes to add-ons). – brockmann Apr 04 '21 at 19:38