← All ideas
  • Published 9 Jun 2026

Clean python out of Blender

I was wondering if Blender could output so cleaned Python code to an .py file, so that, if one have during drawing pressed „undo“ for example a couple of times, that Blender would output file (.py) without the „undos“. I am not sure if Blender actual puts out a ready .py-file (but AI said me so, that it could).

Manually with script added lines and objects should come to the same output .py-file. So when one wants to add something manually Blender should understand to open and read the new line, then it would be easy from the file to edit numeral values, dimensions and such things, maybe speeds/time (note that I am a beginner and have not animated yet anything).

I have with AutoCad modelled everything possible and I came after the beginning to realize that everything what one draws comes done by console.

Basically everything is written to console. It would be wonderful if Blender would have the same type of console commands available for use, like in AutoCAD and it would adding to that make a Python file.

Bare Python would be of course hard to write. I actually used AI to make me the Python-lines, which could also come automatically, when written for example „circle 0,0,0 d 10“ - example makes a circle to 0,0,0 with dimension 10 (in AutoCAD).

Measuring from picture is easiest to make with mouse - I think. And snapping for location of next object is also done by mouse „snap corner“ „snap center“ and so.

0%

Development Status: Open

Upvote 0 Downvote 0
teemu
9 Jun 2026

3 Comments

CraigJones

Maybe the title of the proposal should be more like "Getting a Clean Python Output from Blender"

1
CraigJones

Learning to write a Python script and eventually a simple addon is elementary for Blender users since the Text Editor comes with preset code snippets and small script examples. Videos online from many users also show how to use them to get the most out of the Info Editor output for making reproducible results as operators. The scripting environment in Blender is very good when using certain addons that bring better functionality to imitate bigger IDEs.

I would suggest digging into the examples for Simple Operator and learn how to gather output from the Info Editor and put them into the right order inside the Simple Operator example, it is a good exercise to start with.

riley4

This doesn't really make sense. Also this is a large block of text. Try splitting it up.