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.

0
votes
0answers
7 views

How to change property after mouse release

I have a custom property of the type bpy.props.FloatProperty , that has a update=update_function . then I have that mapped to a row.prop() with slider=True. Now for better and predictable user ...
0
votes
0answers
6 views

Aligning empty object with Bezier curve point using Python

I'm using a Bezier curve to generate a shape. Once I'm happy with the shape I process it with a script I wrote. Among other things it adds 2 empty objects: one at the start of the curve, one at the ...
0
votes
0answers
9 views

(Python API) Importing, Setting Pivot Point, Locating and Rotating

I’m trying to import a model, set its location it and rotate the whole model using the quaternion mode. Here’ s my code: ...
0
votes
0answers
10 views

Drifting a car in bge

I want to make a rally game.How to make a python or logic bricks (if it is possible) that can make a car drift when I turn left and right.
0
votes
0answers
8 views

How to check if render cancelled in render_post handler

I am doing multiple renders using this template: https://blender.stackexchange.com/a/71830/66604. 'post' is executing after render. In this method I am doing operations on files saved during render. ...
0
votes
0answers
12 views

How to update Blender's naming index thing (.001, .002, etc.) after joining objects

I've been trying to reuse certain parts of code as functions in my bpy scripts. But that means that the same bmesh will be created as 'my_bmesh.001' the next time I run that function. To deal with ...
0
votes
1answer
12 views

Store current region 3d

I have to store the current region 3d for an object in a Python addon. context.space_data.region_3d But I have to create a copy of this, I dont want to store a ...
1
vote
0answers
9 views

Multiple renders issues: render_pre handler do not set render borders before rendering

I am doing multiple renders using this template: https://blender.stackexchange.com/a/71830/66604. Method 'pre' should be executed before every render - and it is, for example then I am setting render ...
1
vote
1answer
16 views

Burst fire in bge

What I'm trying to achieve is some kind of python script or logic brick system that allows me to tap a key or button once and then through that action send out a burst of messages to an object that ...
0
votes
0answers
20 views

In Python how can I name the active selection Low Poly, join the others and name them High Poly?

In a Blender 2.8 script I want to bake multiple high poly objects on one low poly. After selecting everything I want to bake and making the low poly the active selection, I can rename it "High Poly" ...
0
votes
0answers
16 views

Rounded corners for 2d rectangle with Python

in my addon I have a 2d shape (polyline) for which I want to add rounded corners (step-wise, like the bevel does, when added edges for the bevel). This means I want to decide that I add for example 2,...
0
votes
1answer
21 views

Using Python loop to attach empty to each bone in Armature

I'm stuck at the part of my loop where the empty gets constrained to the bone. I don't know how to refer to the bones and empties I want to constrain since their names vary as the loop runs. Here's ...
0
votes
0answers
17 views

Hotkey to go DIRECTLY to vertex, edge, face edit mode?

As a long time user of other prominent 3d software, I'm used to being able to be in object mode and press 1 hotkey to go directly to vertex, edge, or face mode. I'm using 2.8 and love it, but for ...
0
votes
0answers
12 views

Select the outer edges?

How can I select just the outer edges? I have tried several things without success. I need to delete/dissolve the outer edges ,but this needs to be done with code.
0
votes
0answers
9 views

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

How can I get or access the actual (not default) value of a node socket in blender 2.80 or 2.79? This post is similar to this which provides an image to explain the problem as well. J. Bakker ...
0
votes
0answers
22 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) ...
0
votes
0answers
7 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
0answers
16 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
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 ...
0
votes
1answer
9 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
14 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 ?
1
vote
1answer
38 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? ...
0
votes
1answer
52 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.
0
votes
0answers
20 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,...
1
vote
1answer
13 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
11 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
0answers
20 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 ...
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
1answer
17 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
0answers
14 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 ...
0
votes
3answers
32 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 ...
3
votes
1answer
41 views
+100

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
25 views

Clip depth field of view in nodes

I am a beginner in Blender. This is what I do to save the depth: I can get the real Z in meter from the camera to the object. But how to simulate the field of view ...
0
votes
0answers
9 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
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
12 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
30 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 ...
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 ...
0
votes
1answer
39 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
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
1answer
30 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
0answers
29 views

Change Viewport Shading with Python Button

I've found the following script from this question ...
0
votes
1answer
26 views

Blender 2.80 Python Addon Creating

I would like to write an Addon for blender 2.80 with python 3.7 but I can't find any tutorial or other material for learning how to do. I have used the template in blender for creating my base Addon ...
0
votes
1answer
17 views

Python: How do I export a single object as a .dae file?

I need to be able to export multiple .dae files from a single .blend but I'm not sure about the process of doing this. Is it possible? When I export the .dae manually, it exports all the objects in ...
0
votes
0answers
10 views

python convert bgl.Buffer to bytes for writing to file

I'm trying to convert a bgl.Buffer object in blender python to bytes which can be written to a file, so far I'm not sure how to do it at all? Getting error: "TypeError: a bytes-like object is required,...
1
vote
0answers
23 views

How do I create an enumproperty dropdown menu that shows up in Blender 2.8?

I'm trying to get my addon and its categories and dropdown menus to show up in blender 2.8 like this: Simple Asset Manager , but can't seem to get anything to show up, I updated some of the code which ...
0
votes
0answers
17 views

how to add a custom function to bpy.ops

I'm trying to make my own bpy.ops python function, like bpy.ops.hi() for example, or even bpy.someotherfunction(). I realize that the submodules are only "fakes" as it says in the ops.py file, and ...
2
votes
2answers
38 views

Auto Run Python Script from Text window frustration

I have a blend file that contains the following scenes: • Clothing • Compositing • Paper • Social Media • Van The idea is that guys in my office who aren't 3d literate can save a logo design as a ...
2
votes
2answers
84 views

Check if the whole plane is being on a orthographic camera render (or get a proportion of the rendered plane)

Situation: On my scene, planes can be positioned anywhere and I should not move them - I move around only camera. After positioning a orthographic camera with a script, I am not sure if the whole ...
0
votes
2answers
34 views

non-linear scaling of STL-files along the Z-Axis

I have an STL that is about 400mm in Z. I would like it to scale for example 2% for the first 100mm and 1% the rest of the 300mm. This should work for objects that are shorter than 400mm but still ...