Linked Questions

6
votes
1answer
3k views

How to find out why “context is incorrect”? [duplicate]

I have been trying to write my first addon for Blender over the last couple of days. One error I came across quite often is the context is incorrect error for an ...
2
votes
1answer
735 views

bpy.ops.view3d.view_selected() issue [duplicate]

I try to import an obj file and make a rendered image, by a python script. How to center the view to the mesh? I've tried bpy.ops.view3d.view_selected() but i get ...
1
vote
1answer
1k views

View3D operations problem [duplicate]

Currently i am trying to change the viewport of the 3D View window using a python script. I am using this function bpy.ops.view3d.viewnumpad(type='TOP'); But it ...
0
votes
1answer
204 views

Autosmooth script fails in edit mode but works in object mode [duplicate]

Here is a script I did to automate autosmooth and set the degree. Pretty simple. It works in object mode great, however in edit mode it fails. What I do not understand is why. It does not matter if I ...
1
vote
0answers
93 views

Incorrect context Runtime Error on calling .poll() method via command line [duplicate]

I'm trying to get a python based audio visualisation script to work in blender via command line interface. Here's the code myscript.py When I run the following in blender 2.66 on Ubuntu 14.04 ...
1
vote
0answers
76 views

Why do I get a 'context is incorrect' error when trying to use Python `bpy.ops.nla.tracks.add()`with the NLA? [duplicate]

I am trying to use bpy.ops.nla.tracks.add() but I get this error:
2
votes
0answers
70 views

Spin a Mesh from Python API [duplicate]

I am trying to create a simple python script that will spin an edge around a parallel axis to create part of a cylinder. The script should be executed in batch and do the following: Copy an empty ...
8
votes
2answers
4k views

How to cut a mesh into smaller pieces with python?

I have a big terrain object, I'm trying to write a script that cut it in smaller pieces and then I will export the pieces to other formats. This is required by a game engine because the mesh, if not ...
6
votes
2answers
3k views

How do I override context for bpy.ops.mesh.loopcut?

I am trying to use loopcut in a python script in Blender 2.71. I have tried using the following code from "Loop cut and slide using python script in blender": ...
4
votes
3answers
2k views

Purge unused data (e.g. particle system, or groups) by script

How can I completely remove a objects (e.g. particle system or groups used in particle systems) in blender using python? The problem is this: I have a script, with which I create a scene (e.g. adding ...
5
votes
2answers
2k views

Spin mesh (to create solid of revolution)

I want to be able to take a function f(x) and first make a plot of the function on given interval and then build a solid of revolution of that mesh by rotating it around X-axis of the plot. I've made ...
6
votes
1answer
3k views

How do I get the correct context for Python operators?

I am currently trying to use the operator bpy.ops.sequencer.duplicate() in a python script, but I am having trouble finding the correct context to pass to it, as I ...
5
votes
2answers
2k views

How to find an operator's source code?

I am trying to call bpy.ops.object.parent_clear in blender background mode (no GUI) and it fails with an "context is incorrect" message. I would like to read the ...
3
votes
1answer
1k views

Zoom to selection in Python gives RuntimeError

I'm new to Blender Python and writing a start-up script that imports mesh from another application to Blender for rendering. I have a small problem however - imported mesh objects are too large for ...
6
votes
2answers
897 views

How to access properties of the 3d Viewport?

I've just started trying to write a script to speed up my workflow in Blender, but I'm having trouble interpreting the Python commands that show up when you hover the cursor over a button. For ...

15 30 50 per page