Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [python]

Python is an object-oriented programming language. In Blender, it is used as a general purpose scripting language and to create add-ons to extend Blender's functionality.

0
votes
0answers
9 views

Can I set region width with python?

I can get TOLLS width with code: for region in bpy.context.area.regions: if region.type == "TOOLS": print(region.width) break I can't set it ...
0
votes
1answer
14 views

Mutable variable in Add Object Python Script

You know how in adding a circle you can dynamically change the number of verts the circle has? How do I add this? Trying to make an eccentricity variable for an ellipse object. Thanks in advance!
1
vote
0answers
3 views

Use python to modify bone and mesh pose

I have downloaded this rigged avatar. I also have a list of 3d positions corresponding to different body parts (left/right foot, hands, knees, elbows, head, ...). What is the best way to set the ...
0
votes
0answers
10 views

Generic file location for an obj file

Everybody has different file locations, so I figured that I would place my obj file in the same location as the pie menu addon script file. I am missing something in the string, because it will not ...
0
votes
0answers
18 views

Way to delete material and slot inside an object (2.8)

I search for this question but I can't find the answer, i have to clear material inside an object but only "get_mat" because object may have other materials in the slots,and is important not delete ...
0
votes
0answers
20 views

Creating a “locked” binary of blender that could detect changes in itself [on hold]

Question I would like to create a branch of Blender, that can be "locked down" in a way that it could verify at startup that it has not been altered. Which areas of Blender source would need to be ...
1
vote
1answer
27 views

Combining both Bevel Tools in to One (Edge Bevel and Vertex Bevel)

Currently in Blender you have two bevels: -Ctrl+B (for edges and faces) -Ctrl+Shift+B (for vertices). I was trying to create an operator that will identify what mode you're in and activate the ...
0
votes
1answer
13 views

Python - How to get a list of background images used by a camera?

I am trying to use python to get a list of names of background images that are being used by a certain camera, I've tried to do it like this: ...
2
votes
0answers
21 views

Setting per-vertex colors

I would like to be able to set vertex colors via bpy. There are a number of answered questions including this one Set a specified vertex color to black via python for coloring the central vertex of a ...
0
votes
0answers
12 views

Prevent Blender 2.8 navigation buttons overriding from modal operator

Is there some way to prevent modal operator call when user click in Blender 2.8 navigation buttons (four rounded buttons at right upper corner - Hand, Zoom etc.)? Or how can i detect coordinates of ...
1
vote
0answers
31 views

Shrinkwrap to project in the direction of view

I require some help with the shrinkwrap modifier to project in the direction of "VIEW". Currently I have a few choices. positive, negative, X,Y,Z. Is there a script for this.. kindly appreciate any ...
0
votes
0answers
21 views

How to turn on texture solid in python code only?

I'm trying to turn on "Textured Solid" under shading, but I'm working on a headless server having to open many obj and I don't know what code I can use to turn it on with no GUI. I've tried ...
2
votes
1answer
44 views

How to add Objects to a scene AND to a list? (Sphere Packing)

I want to add several spheres (rocks) to my scene to create this image: To achieve this look, I have to pack the spheres. And I want to do it in python. That's my plan: Define the radius of the ...
6
votes
1answer
22 views

draw_handler on top of Rendered shading mode

I'm using bpy.types.SpaceView3D.draw_handler_add and the gpu/bgl/...
0
votes
0answers
21 views

Split unjoined mesh into smaller grid based chunks

I have a large blender scene consisting of different objects like streets, trees, walls, roofs, etc. all created from an openstreetmap file imported into blender. I want to split the complete scene ...
0
votes
0answers
44 views

How to make a thumbnail activating a class blender 2.80 [on hold]

test At least 30 characters 1,2,3,3,4,,5,6,6,7,,8,8,,9,9,0,
1
vote
1answer
9 views

Why doesn't updating a particle settings object `frame_start` field work? (in Blender 2.8)

I am creating a ParticleSettings object from python (Blender 2.8). All of the properties are set correctly but for frame_start, which does not change. Any ideas of ...
0
votes
1answer
17 views

Clean up when raising an error with python

I have a script that look like this: ...
1
vote
1answer
17 views

Check if object position and rotation are zero

I want to check if all object transforms are at zero with python. What I have so far is this: ...
0
votes
1answer
22 views

How do I add a cylinder between two moving objects?

This question is related to this thread How to add a Line between two moving Objects with Python? But the answer in this thread uses an edge, while I want it to be a cylinder (just like a bond ...
1
vote
1answer
38 views

How can GPU be used instead of CPU for background processing in a Python script?

I created a Python script that I execute on an Ubuntu server. The script loads a big PLY file (around 100MB), decimates it and smooths it. Currently, the script is quite slow (around 10 minutes to ...
0
votes
0answers
12 views

How would shape keys be used with particles?

Python answers are acceptable. The shape key factor should be driven by particle age as a simple example. Does the Blender pipeline allow such an interaction? One possibility in the simple case is ...
1
vote
0answers
12 views

Setup automatic rendering of different blender files via python scripting

I want to achieve following functionality using python in blender - I want to open blender files located at a given path. Change textures of some objects in that blender file Set angle of the camera ...
0
votes
0answers
25 views

How to delete world (unlink) fwithout get the Name (2.8)

How to delete world without get the name of world in blender 2.8. For add world i use ...
0
votes
1answer
16 views

Is there a way to get custom properties panel in a custom t panel?

I already created a custom t panel and use the custom properties often, was hoping to add them to the panel, but do not know how to grab the custom properties panel and copy it to my t panel. Any help ...
0
votes
0answers
71 views

How to use the template_icon_view in 2.80

Here I have a simple imaginary addon that is able to append 2 cubes from a blendfile. Instead of having buttons, I want to use a preview of the cubes. Such a preview you see in asset managers. (Tried ...
0
votes
0answers
17 views

How to know if certain co-planar faces in Blender form a circle to apply quads later on?

I can get a set of co-planar faces from any mesh. Some of these co-planar faces form a circle while most of them do not. I eventually want to know which faces are forming a circle using Python, so ...
0
votes
0answers
29 views

Face normals to point to view

I require help with a script to make the face normals point to view when creating a plane. Blender seems to use coordinates and it's unpredictable. ...
1
vote
1answer
19 views

Why does my custom addon panel gets deleted after I press x to delete objects in my scene?

Trying to write a beginner addon in 2.8 that takes an input row and column variable, and then creates a row xcolumn calendar. My code worked, but my addon kept disappearing after I press "x" to delete ...
1
vote
0answers
16 views

How do you execute bpy operations in the python console that requires you to hover your mouse over the 3D view port?

I just want to enter bpy.ops.view3d.snap_cursor_to_center() in my python console just to see how it works. I am getting the error: ...
0
votes
0answers
10 views

How to Link/Append world using the blender Python API? [duplicate]

I'm searching a way to append a World in blender Python. I read the reference in How to Link/Append a data-block using the Python API? but that is for group append. is there a way to make that work ...
0
votes
0answers
9 views

How to move Modular Assets in game?

I'm not a newbie to BGE, but not an expert... heck not even intermediate. I started making Modular Assets for a game, but kind of got a little lost when it came to making them movable in game by the ...
1
vote
1answer
19 views

Python script help - assign certain materials to some particular objects

First post here. Using Blender 2.8 and learning the basic of scripting. Can someone help me with a assigning certain materials to some particular objects. Any help would be great, many thanks. ...
0
votes
0answers
8 views

Python scripting in blender 2.79

I'm wondering is there a way to say subdivide a cube in half and select the left half, delete and apply the mirror modifier? I'm trying to create a script moving specific vertices specific increments ...
0
votes
0answers
10 views

How to run some custom code after inserting keyframe?

What I want: I need to insert some keyframes with I After that I need to run some custom code I tried __del__ in my custom ...
1
vote
0answers
13 views

How to specify the size of a text box in a panel?

Please consider the following image: The text box with the value "127.0.0.1:56661" is just too big, it occupies a considerable percentage of the row in the panel leaving small space for the label "...
0
votes
0answers
15 views

What is the convention for the prefix in Operator, Panel and Menu (etc.) Class names?

Considering the Python API documentation about Class registration and the naming convention for operators, panels, etc., here: Class registration It is stated that: The class name convention is: <...
1
vote
0answers
13 views

Vertex coordinates of shape key with subsurf modifier

For mesh objects with shape keys, you can access the vertex coordinates of the shape key using: ...
0
votes
0answers
12 views

Select (Highlight Orange) specific Vertices with Python

can somebody please help me? Im using Blender in version 2.79b and I'm trying to select specific vertices in a (per python) created, already combined object using python. I need the selection, which ...
0
votes
0answers
22 views

how to add a mesh in blender using script?

I need to add a mesh using script. I am not asking about adding the primitive objects using the script. Example: Add a single face with 4 vertices or any simple objects using script.
1
vote
1answer
21 views

How to get user input for a function?

I have created a function that requires a file path input, I found a way to have the user input a file location but I am not sure how to access it. I thought it was assigned to the ...
1
vote
0answers
13 views

bpy.context.scene.objects.active = obj returns None when object exists

As the title says, I am trying to set a specific object as the active object. Everything I have read says that bpy.context.scene.objects.active = obj, will do this. ...
1
vote
0answers
8 views

Retrieving the Material from a NodeTree

For a driver scripted expression I want the name of the material for a node input value. It's an emission node and I want to make the following scripted expression for the emission strength: ...
0
votes
0answers
44 views

Way to copy (not linked) object and vertex group in python. (2.8)

I try to copy object with this way, but this example keeping copy object linked (Like ALT+D) i want to copy without link and preserving the previously assigned vertex group. I have to copy object with ...
0
votes
1answer
17 views

rigid body simulation not rendered correctly

I would like to replace objects at the end of a rigid body simulation by a another object. But the final scene contains the old ones, even when I call obj.hide=True ...
0
votes
0answers
26 views

Copy vertex groups from old object to new object(2.8)

I have to modify new orientation and for this i think to make a copy from old object to new object, but not undertand if is possible to copy vertex grup from old object/ mesh to new object/ mesh : <...
0
votes
0answers
20 views

Fast render, low quality

I'm new to Blender and I was using Adobe Premiere Pro before. The task I have is to join several video files together and cut them on begging and end to make full 4h - 8h clips. I realy don't need ...
0
votes
0answers
7 views

Addon Multiline Text Input

Is it possible to create a multiline text input in a blender add-on? I could not find any such option in StringProperty.
0
votes
0answers
9 views

Can blender text formatting be set without bpy.ops?

I want to set some text for a render from the command line with a python script. I'm hoping to be able to set the formatting of that text. However: bpy.ops seems a clunky way to do so. I was expecting ...