Linked Questions

58 votes
5 answers
83k views

Python: How to completely remove an object

How can I completely remove an object (for example a camera) using python scripting? Using something like: scene.objects.unlink(camera) Does not work, since it ...
Jan Rüegg's user avatar
31 votes
5 answers
110k views

Can I delete all materials of all objects in a scene quickly?

Is there a quick way to delete all materials in the scene? I have a scene containing 20+ materials and all linked to objects. I'd like to remove all the materials from my blender file.
ikel's user avatar
  • 1,253
52 votes
2 answers
48k views

poll() failed, context incorrect? - Example: bpy.ops.view3d.background_image_add()

I keep on getting context errors in the Blender Python API. I don't understand the issue of the context in the API, how do I know which is the correct context? Thanks!
Jonathan's user avatar
  • 621
22 votes
5 answers
33k views

How to join objects with Python?

I try to do this: bpy.ops.object.select_all() bpy.ops.object.join() in my script. It selects all the stuff like CtrlA but fails on ...
Zéiksz's user avatar
  • 1,979
14 votes
5 answers
15k views

Set origin to bottom center of multiple objects

I have a lot of 3D objects of various sizes, shapes in blender 2.76b and I would like to set the origin to the bottom center of the objects bounds. I cannot select the bottom edge and snap to cursor ...
MrDave's user avatar
  • 141
11 votes
5 answers
4k views

How to copy modifiers with attribute values from active object to selected objects with python scripting?

Is there a better way to copy a modifier with all attributes from active object to selected object through python scripting other than adding a modifier to selected and copy attributes one by one (...
kilbee's user avatar
  • 1,337
10 votes
3 answers
7k views

Removing all material slots in one go

I need some help in removing all material slots in one go using a python script. I am able to use this, would prefer to ave all removed. ...
Michael Teiniker's user avatar
11 votes
2 answers
7k 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": ...
Mike N.'s user avatar
  • 350
7 votes
2 answers
17k views

How to apply a several modifiers with python (but not necessarily all modifiers)?

Apply modifier button will write this into the console: bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Box Right ") Adding this line after "bool_mod....
Claas Kuhnen's user avatar
  • 1,727
7 votes
1 answer
6k views

Setting the origin for each object to geometry

Blender 2.83 In python I can create all of the features that I want in my world, but when I go to the world, each thing has the same location data. I can click on each and click set origin to geometry,...
JmathLoy's user avatar
2 votes
2 answers
5k views

Slicing an object in 4 parts

I want to cut a model which otherwise would be too big to 3D print in 4 parts . I use the fastcarve add-on and use a plane to slice the model in 2 in the y-axis (|). When I then select a half and use ...
apyl's user avatar
  • 189
4 votes
2 answers
939 views

Move modifier to the top of the stack through python

To my knowledge I believe modifiers can moved up one step in the list through executing this line bpy.ops.object.modifier_move_up() Is there anyway to move a ...
Retrax's user avatar
  • 1,520
6 votes
1 answer
1k views

Set orthographic view using python?

Is there a python function that sets ortho view such that X and Y axes are visible - the equivalent of numpad 7? Thanks in advance!
vndep's user avatar
  • 713
6 votes
1 answer
3k views

Baking smoke on headless machine

I have a linux vps that has some spare resources left from main activity. I can not get the GUI working, but I was thinking if there is a way to use it for baking with python script. I see that there ...
user2801402's user avatar
3 votes
1 answer
3k views

how to specify active window for a series of screen captures in python

I am trying to write a script that does various things to a mesh object from within a loop, and updates the 3D window each time, based on this script. This would be for explanatory and instructive ...
uhoh's user avatar
  • 2,667

15 30 50 per page