Questions tagged [scripting]
Questions concerning scripting in Blender using the Python programming language. Also use this tag for questions about scripting in OSL (Open Shading Language).
6,449
questions
6
votes
1
answer
5k
views
Getting the list of points that describe a Curve without converting to mesh
I've used mathutils.geometry.interpolate_bezier() in the past to create points for a curve using the bezier handle and knot coordinates.
from the docs:
...
16
votes
2
answers
5k
views
How can I navigate the viewport using Python?
Normally, with most actions that you want to script with Python there is a pop-up tooltip that shows you the function that you want to use. However, for viewport navigation there are no pop-ups, you ...
31
votes
2
answers
14k
views
Is it possible to create image data and save to a file from a script
I'm currently trying to extract textures from a binary file, and ideally I'd like to save each texture to a file or embed in the .blend file. However, before saving ...
8
votes
1
answer
2k
views
How do I get the path my script is running in?
I am writing a Quake 1 .BSP import script with python and I want to extract the textures from the .BSP so that the mesh can be ...
7
votes
2
answers
2k
views
Return list of associated vertex index, weight values for a given vertex_group
I am currently porting some code from the 2.49 API to the 2.6 API and looking for a nice way to replace this function call
...
12
votes
1
answer
322
views
Can unofficial Blender addons be included in a project as a text block and automatically register on load?
I am a keen user of Bassam's typewriter.py addon. It's not part of the official distribution, so I thought I could make my .blend projects more portable by including it as a text block.
I always need ...
13
votes
2
answers
9k
views
How can I create a script that runs continuously but does not block the interface?
I would like to create a script that runs constantly throughout the life of a Blender session. The problem is that Blender's interface "blocks" while the script is running. As a trivial example, if ...
6
votes
2
answers
957
views
Run additional code after user has executed and finished an operator
The script https://gist.github.com/zeffii/5671824 creates a polysphere, but allows the user to set how spherical it is and how many subdivisions it has and its radius as parameters.
The problem is ...
4
votes
1
answer
1k
views
Create a shortcut to pause Preview viewport Cycles rendering?
I'm fairly sure to create the shortcut for pausing the cycles preview render starts with wm.context_toggle, but when I put in ...
19
votes
2
answers
18k
views
how to use BMesh to add verts, faces, and edges to existing geometry
I've puzzled about this for a while, but haven't found an answer I understood. This snippet below does add geometry (3 verts and a face) but it also generates an error, Does going to object mode make ...
11
votes
1
answer
1k
views
Align view to selected operator (numpad .) when scripting?
Whenever I hit Numpad. (align view to selection), it doesn't show up in the info panel. Is there an operator for this, so that I can use it in scripting?
6
votes
1
answer
494
views
How can I make parts of a menu context sensitive in Python?
I am attempting to make a custom menu in Python that is context sensitive. Such that it's contents vary depending on which mode your currently in (e.g. Edit mode or Object mode).
However, when using ...
9
votes
1
answer
2k
views
Changing user preferences via console?
The machine that I'm currently using is an extremely slow netbook. Whenever I go to change user preferences in Blender, it stalls out. What I need to do is activate the "emulate 3 button mouse" ...
15
votes
2
answers
3k
views
Adding operator to the toolshelf?
I'm just starting to learn scripting in Blender with Python. I made a simple operator following the quickstart intro on the Blender documentation:
...