Skip to main content

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 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: ...
zeffii's user avatar
  • 39.7k
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 ...
fouric's user avatar
  • 3,251
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 ...
MrFlamey's user avatar
  • 3,869
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 ...
MrFlamey's user avatar
  • 3,869
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 ...
neomonkeus's user avatar
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 ...
Jakub Steiner's user avatar
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 ...
fouric's user avatar
  • 3,251
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 ...
zeffii's user avatar
  • 39.7k
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 ...
CharlesL's user avatar
  • 15.4k
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 ...
zeffii's user avatar
  • 39.7k
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?
Daniel's user avatar
  • 3,634
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 ...
Jonathan Williamson's user avatar
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" ...
Daniel's user avatar
  • 3,634
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: ...
Daniel's user avatar
  • 3,634

15 30 50 per page
1
426 427 428 429
430