Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [python]

Python is an object-oriented programming language. In Blender, it is used as a general purpose scripting language and to create add-ons to extend Blender's functionality.

1
vote
1answer
45 views

Why does my rendered object appear too big compared to object taken with real camera?

When I try to render a cube it appears too big compared to an image taken with a real camera and to the opencv method projectPoints. My setup I have a box and film it with a camera. A motion ...
0
votes
0answers
10 views

Creating polygon from vertices alorithm

Is there somebody who can describe a theory behind creating quads from pointcloud(vertices) in blender python ? Is the only way to check length betweeen vertices like: (theory) ...
1
vote
1answer
61 views

Getting the actual (not default) value of a node socket that is linked to another socket

I know how to get the default_value from a node socket as described in this answer. But the answer there doesn't answer the question, namely: how to get the actual ...
2
votes
0answers
31 views

Select pass mode via python script

I want to change the value of "Pass" type inside the "UV/Image Editor" area as shown on image. The default "Pass" value is "Combined" and I want to change the value to other available types with ...
0
votes
0answers
6 views

Python bmesh.update_edit_mesh() doesn't work as I expect

I've been doing something like: cube = bmesh.ops.create_cube(bm) bmesh.update_edit_mesh(mesh) print(mesh.vertices) The return is ...
1
vote
1answer
51 views

Why does Blender seem to freeze when I run this script?

I'm extremely new to Blender. I've watched a few guides on modelling, rigging and animating and have made myself a character with a bunch of animations. But I'm not looking to export the model, I'm ...
0
votes
1answer
47 views

Deselect Neighbours Faces

is it possible in blender v2.70 or with a python function deselect neighbours faces, so that they are alone ? i'll upload a picture to understand what I mean. I hope it's doable.
1
vote
1answer
46 views

Generate Rig is not scaled correctly

So at first I was having problems generating my metarig so I went into the preferences and turned on the auto run python scripts which fixed the problem, but then I ran into another one my generated ...
0
votes
1answer
28 views

set random active face in python without toggle mode

In python how can I set random active Face in edit mode without toggle the Object/Edit Mode ? For example re code in this answer can you also automatically set an active face again from the script to ...
1
vote
1answer
34 views

How to register a property group in blender 2.8

Is there a way to add a property group to this method of registering, without adding a separate register/unregister function? ...
1
vote
0answers
12 views

bpy.ops.object.scale_clear(clear_delta=false) (the alt-s command in 3d view) lowers ram usage?

One of my projects has a script that creates thousands of objects every time it runs and even though it deleted the old objects there's still a ram build-up over time. For example, just now it hit ...
0
votes
1answer
8 views

Reselect faces that was already selected?

How can I reselect faces that is already selected? I need to get selected faces, do something else, and then reselect those faces again. I tried this ,but it doesn't work. ...
0
votes
0answers
12 views

How select Material Slot with one active face in python

hello guys i have a problem by selecting the material slot. when selecting the material slot, has no active Face... how can i make him select an active Face under the selected Faces ?
0
votes
1answer
44 views

How to add a curve name from bevel_object to the name of the output image render?

Excuse me, I misunderstood the question. Usually, when rendering, the image can be saved with F3 or through the node's "File Output", with a name of the form "ImageXXX", according to the frame number. ...
0
votes
1answer
46 views

Why does trying to render with Cuda on a remote server fail?

I’m trying to do a remote render on a server with linux, when I do renders by Cpu it’s fine, but when I want to use cuda I have errors. The script that I use is this These are my Gpu When calling ...
0
votes
0answers
12 views

Tryed to install mb-lab- master to blender user preference error message invalid syntax

tried to install MB-Lab-master from github and receive this message from the user preference menu on Blender 2.79b see: https://github.com/animate1978/MB-Lab/wiki/Installation second question is , If ...
1
vote
0answers
7 views

How should operator id_remap be used?

I'm trying to use id_remap on some materials, but Blender crashes when I try to use the operator. I've tried many different ways to invoke it. Right now I have: ...
0
votes
0answers
19 views

How can I stop my Blender script from eating my entire computer's memory?

I'm working on a project that loads a bunch of 3D models (around 100 models) into a scene, exports a render, then deletes all the models and loads in 100 fresh models into a new scene, then dumps them,...
0
votes
1answer
41 views

Pie menu goes away after selecting an option

For example when I used the pie menu to set the mode to edit mode, the pie menu immediately goes away after i select edit mode. How do I keep the pie menu floating even after multiple lmb clicks on ...
0
votes
0answers
9 views

How can I modify the layout.label in a custom node in the Node Editor?

As you can see, I created some custom nodes, and I need to modify the middle label in each node when I create a new node, how can I do this? Here is my source code: ...
0
votes
1answer
41 views

Uniquely addressing vertices in python

This has been driving me crazy for some time, because it seems so simple, but I just cannot find a way to do it despite exhaustive searching. Say I'm in bmesh, and I create a vertex, and I add it to ...
0
votes
1answer
14 views

python : creating 4D simplex by connecting all vertices with ever possible triangular face

I'm creating higher dimensional shapes (4+ dimensions) and for a simplex, every vertex is connected so that any 3 vertices you pick form a triangle. this is simple to do with shapes with a low vertex ...
0
votes
1answer
41 views

What is Location in Python?

I would like to know what variable Blender uses to determine location. Something like position_x = 0 or something? I dunno.
0
votes
1answer
40 views

Trying to create a simple add-on but Python keeps throwing errors

I am trying to create a simple add-on that will automatically reload images in Blender. I managed to find a few scripts that helped me and when I press "Run Script" it works as expected. However, when ...
2
votes
1answer
64 views

Change edge information display in Blender 2.80 with python

I am currently porting my personal addons to Blender 2.8 and this used to work fine in 2.79: ...
2
votes
1answer
18 views

How can I execute renaming objects before calling other functions using Python?

I am making an animated Rubik's Cube. The rotations work as intended. After a layer is turned, the pieces must be renamed to reflect their new location before executing another rotation. This works ...
0
votes
3answers
29 views

How can I check face selection in edit mode

How can I check if the mesh in edit mode has polygons (Faces) selected or not via Python? I use Blender v2.79. I am working on a face selection check for a tool. If no polygons are selected in the ...
0
votes
0answers
13 views

What is the appropriate way to run thread in blender internal?

Below is a code I tried, that allows you to constantly change an objects location and rotation to match the symmetry. However whenever I use it it tells me that writing to ID classes in this context ...
6
votes
1answer
1k views

Is there a way to convert a mesh's UV's into a second mesh using a script?

So what I've been doing to bake Cycles depth maps is based on the following thread found on the BA.org forum and I've mentioned this here already but I'd like to take this a step further using a ...
12
votes
2answers
10k views

How to create a custom UI?

I was watching this video on making a custom UI tab using Python, and in the line from bpy.types import Menu, Panel, UIList, I see the names of objects that look ...
1
vote
0answers
11 views

Custom Drag and Drop for importing .srt files

I made Subsimport that lets users import .srt files into the VSE. I'd like to improve it by allowing users to drag .srt files into the timeline instead of having to click the "Import" button. Does ...
1
vote
1answer
42 views

Change the “used UVLayer” in all materials in texture_slot 0

i have a model with multiple materials and i like to change the UV-Map for the texture slot "0" I got it to work with only one material: ...
0
votes
1answer
50 views

How do I name a selected group via python script

Hi python/blender users, I was wondering if anyone knows a simple python command that allows me to rename the selected group. I am working on a script that requires a renaming mid operator. I found ...
0
votes
1answer
71 views

Render layer selection when rendering via python

I'm working on a script that renders certain render layers defined in the operator. The script is supposed to make a list of currently enabled render layers, disable all of them, and then enable the ...
0
votes
1answer
25 views

Python to show one of objects by choosing

I have a question about Python. By the way, I'm a beginner of English and Python. I have a script to show Toruses from an imported txt file containing center coordinates. Thanks to this website, it ...
0
votes
1answer
59 views

Blender 2.8 : python code to switch shading mode (between wireframe and solid mode)

If i switch between solid and wireframe mode, i can see in the info window that these commands are invoked : ...
0
votes
0answers
48 views

Location along actual (beveled) curve instead of points

The following code generates a tree root structure, by making each sub-root start at a point along the previous sub-root. They are all NURBS paths. The hitch, as you will see, is that the points are ...
1
vote
2answers
857 views

How to properly paste Python function block into python console?

Hi i have some questions : i want to paste block of function into the python console and got a lot of indentation error. Is this a bug or do i miss something ? i'm using 2.79. I'm new in coding. ...
0
votes
0answers
8 views

Mute button for bge

I have make a game with music.I want to make a button that can mute and unmute the music. Many thanks for any answers
0
votes
1answer
46 views

Change stroke drawing order (Arrange stroke)-Grease pencil

Just curious, the default stroke draw order in greasepencil is bottom to top(i.e first stroke at the bottom,next stroke on top of it and so on ...).Can this order ebe reversed (i.e top to bottom)? I ...
4
votes
1answer
155 views
+50

python get “image” of 3D view for streaming / realtime EEVEE rendering

I know its possible to take a screenshot with python of a particular window (take screenshots programmatically in bpy?), but is there a better way to get an image (in base64 format) of exactly whats ...
0
votes
1answer
37 views

creating a fake origin point in the BGE?

in the figure below you'll see two separate points in time and three object. You can also see the direction object C is facing. I am trying to replicate a false point of origin for object B at the ...
0
votes
1answer
11 views

Blender Python: How to activate the Auto Refresh in a imported sequence on Image Editor?

I'm developing a way to import DICOM slices on Blender. All works well, but I'm with dificults to activate the Auto Refresh after import the sequence: I really read a lot of examples and the ...
1
vote
0answers
19 views

Create image and textured polygon from python

I am trying to create a textured polygon from python and have it display properly in the 3D View in Texture mode. I can create the mesh, uv coordinates, object, material, texture, and image. If I ...
1
vote
1answer
29 views

Python Join Objects

I'm completly new to Blender. I currently work on a project which could utilize Blender for Beveling. To get in touch with blender I first played around with the programm itself and then tried to ...
0
votes
1answer
26 views

Get the exact half of a mesh with bpy

I have to select the exact half of a mesh in Blender 2.79 thorugh a Python script. I tried obd = bpy.data.objects[actor_name].dimensions for a selected object but ...
1
vote
1answer
48 views

How to use a weight to check if an object is stable?

Let's say that you have a table with randomly generated legs, and that you want to check if the table is stable enough to stand with a weights placed, one at a time, in four different spots on the ...
3
votes
4answers
1k views

Python: vertex normal according to World

If i get a normal of a vertex - i'll get it in local coordinates. For example: bpy.context.object.data.vertices[0].normal If an object will have rotation or ...