Now that we have managed to create a simple object in Blender using Python, we are ready to go to the next step. If you don’t know what vertices, edges, faces, or meshes are check this article where I explain these: Drawing a Circle Since our object only contains a single point, we only used the first parameter(vertices). You will notice that the from_pydata() method is key. It might not look like a lot for now, but so was it not so for the Big Bang? View_layer.active_layer_(new_object)Īfter running the script, we can see that a new object with the name “dot” was created and that it only contains a single dot. Open Blender, delete the default cube and click in the Scripting tab and paste the following code: import bpy What you are waiting for? Let’s get started! Drawing an Object with a single pointīefore we even start talking about Math, let’s create an object in Blender with a single point at the origin, using the Python Blender API. This is going to be a fun project and a way to get acquainted with python and 3D modeling with Blender. The maths that we are going to use is rather simple and I will try to explain it as we go along. In this article, I am going to show you, how to create a 3D spinning donut but instead of using C code, we will be using Python and Blender. See the resources at the bottom of this page to check it out. If you haven’t watched this donut in action yet, I highly recommend you. And if spinning a donut with ASCII characters is not hard enough, and it clearly wasn’t for Andy Sloane, this code also simulates a light source so that when the donut spins you are able to see the lighting shine as the donut spins.Ī donut-shaped C code can generate a spinning donut. If you have been sleeping under a donut… I mean rock, you will not have heard yet of the donut-shaped C code that can generate a 3D spinning donut, projected onto 2D using ASCII characters.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |