Linked Questions

11
votes
2answers
3k views

Rotation around the cursor with low-level python (no bpy.ops)

In order to optimize my script, I would need some help to perform a rotation around the cursor (see Rotate object around cursor with Python) With low-level python, that means, without ...
30
votes
2answers
11k views

Python performance with Blender operators

In my script, I have for loop over many cube objects (~1000) and the treatment is very slow. Looking more in details, I notice that in the same amount of loops: if ...
0
votes
0answers
28 views

To improve runtime, which operators to avoid?

To improve runtimes, I am trying to avoid using operators that lead to scene updates. See here for the background: Python performance with Blender operators Why avoid bpy.ops? Finding vertices in a ...
2
votes
2answers
335 views

How can I delete keyframes and animation data for all selected objects?

I am trying to do as the title suggests: remove all keyframes and animation data from all selected objects. I am just starting out with Python and add-on development so this has proven to be a ...
0
votes
0answers
17 views

Why my blender script runs fine, than throws error during render

I've wrote a script that creates NURB curves as trails for objects. A small part of it, deletes points from the curves if they are longer than a value. The script runs well if I just play the ...
2
votes
1answer
417 views

How can I add a collection using Python?

I'm new to Blender. Tutorial information as recent as January this year appears to be out of date and I can't figure out how to create a new collection and add an object to it. The most recent ...
1
vote
1answer
904 views

Importing fonts using python?

I would like my users to select a font, essentially opening a folder so they can choose from a custom library of fonts. The fonts are located in a folder, such as ...
0
votes
0answers
35 views

Inconsistent/ Random behavior in Blender

I am generating some shape using python in Blender. Most of the times, when I run the code I get what I expect. But sometimes I see the broken mesh as I have shown in the figure. As far as code's ...
16
votes
1answer
6k views

Finding vertices in a Vertex Group using Blender's Python API

Is there an easy way to get the vertices in a vertex group? The only way I've found is pretty brute-force - e.g., to find the vertices of object obs[i] in group "e"...
0
votes
1answer
433 views

Iterating vertex groups in Python

I'm having trouble with a script. I'm trying to duplicate a selected object and copy them into an array configuration. Afterwards i'd like to select the same vertex group of each of the duplicated ...
4
votes
1answer
1k views

knife_project in python

I am a blender noob trying to use bpy.ops.mesh.knife_project() in my script. It fails with the message: RuntimeError: Operator bpy.ops.mesh.knife_project.poll() expected a view3d region & ...
12
votes
2answers
1k views
1
vote
2answers
483 views

Python 2.8 - deleting .001, .002, etc

I found several threads on this subject but could not distill a solution. I am trying to delete .001, .002, etc. The code should delete these, but every time I rerun my code it is as if nothing was ...
0
votes
0answers
154 views

Blender python subdivision problem: mistake or bug?

I've been working on a python script in Blender (2.8) and so far everything's been going fairly smoothly, except for an infuriating problem I encountered yesterday. It seems that the 'bpy.ops.mesh....
0
votes
1answer
294 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. I want to create a script in Blender 2.8 that bakes in selected to active mode. The active selection must be named "...

15 30 50 per page