Linked Questions

37 votes
2 answers
14k 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 ...
Salvatore's user avatar
  • 747
28 votes
1 answer
30k views

Blender 2.8 API, python, set active object

I'm trying to amend an addon that I made for Blender 2.7X to work with Blender 2.80. The problem is with bpy.context.scene.objects.active = some_object This is ...
Georges D's user avatar
  • 4,842
34 votes
4 answers
6k views

Why avoid bpy.ops?

Simple and maybe stupid question: I was reading this lot of time, that "you should avoid using bpy.ops, or "instead of ...
Zéiksz's user avatar
  • 1,939
11 votes
1 answer
4k views

Run an edit-mode operator on every object in the scene

I want to untriangulate every object in my scene with this script: ...
JamesNZ's user avatar
  • 233
9 votes
3 answers
3k views

What's the difference among object, active_object, and selected_objects?

I am wondering if following statements are true: active_object is always identical to object. ...
TheBusyTypist's user avatar
0 votes
2 answers
2k views

How to assign a new material for each object using Python?

Is it possible to assign a new Material(Principled BSDF shader) to each mesh or a selection of meshes in my scene using Python? The script should use the individual mesh name to name the material and ...
user62799's user avatar
1 vote
1 answer
2k views

Python- problem with "bpy.data.objects['anyobject'].select=True "

What happens exactly, is that after duplicating an object, then deselecting all selected objects, using: ...
user8844's user avatar
0 votes
0 answers
630 views

KeyError: 'bpy_prop_collection[key]: key "m_avg_Pelvis" not found' but that key actually exist

...
Nicholas Jela's user avatar
0 votes
1 answer
452 views

Unable to deselect newly added object with Python (Change red selection to orange) - Blender 2.8

I am trying to add an object using from_pydata but am unable to deselect the added item - which is currently outlined in red and then select it so it is outlined in orange - and enter Edit mode. `...
KK_'s user avatar
  • 48
0 votes
1 answer
76 views

How to apply a bevel to a curve using python?

In a previous version of blender I had script that applied a bevel to a curve, but now cannot get it to work in 2.92. or above. I want to apply the bevel to an object referenced by the variable ...
John's user avatar
  • 1