Linked Questions

30
votes
1answer
10k 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 ...
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"...
4
votes
1answer
7k views

Rendering a cube as png file using Blender's Python API

I am new to Blender. I create a cube and want to render it. Since, we are later going to do this for large number of shapes, we are working with Blender's Python API. I want to save this rendering as ...
11
votes
1answer
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 ...
11
votes
1answer
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: ...
7
votes
3answers
6k views

Batch exporting of multiple objects into separate STL files

I have as scene with 45 objects, I am trying to write a script that will export all of the objects into separate STL files. Any ideas? Here is a broken script I have right now: ...
12
votes
2answers
1k views

Is there a way to calculate mean curvature of a triangular mesh?

So I've written a script which does this: Before: After: The code is: ...
1
vote
1answer
9k views

Creating objects with a 'for loop' and setting each new one a keyframe within the 'for loop'

So I wish to have a script which creates an object then set's it keyframe at a frame, 'f', before creating another object and setting a keyframe at a new frame, say f+1. However it always sets the ...
6
votes
1answer
746 views

How do I create 2 Edge Loops adjacent to selected Edge Loop?

I'd like to know if there are any techniques or addons available for creating adjacent edge loops in a mesh based on a selected edge loop. The functionality would be similar to the Offset Edge Loop ...
3
votes
2answers
2k views

How do I subdivide a cube via scripting?

I have an object named "Cube" selected, and I set the mode to EDIT via cube = bpy.data.objects.get('Cube') cube.select=True bpy.ops.object.mode_set(mode='EDIT') ...
2
votes
2answers
2k views

How does Blender figure out the normal of a face?

I want to use bpy module to create a polygon in blender. However, I have some problem with the normal of faces. See the following example (adopt from this post): ...
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 & ...
1
vote
1answer
1k views

link nodes in compositor blender 2.8

While trying to link two nodes via python I get this error: AttributeError: 'set' object has no attribute 'output' I can't understand why, following the docs ...
1
vote
1answer
890 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 ...
1
vote
2answers
455 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 ...

15 30 50 per page