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.

1
vote
1answer
14 views

Set active bone in pose mode from Python script

I'm trying to use the function bpy.ops.pose.constraint_add() on bones through a script, but stupid thing is that I can't find how to set the bones as active ones which is needed to call this function.
0
votes
0answers
14 views

Graph animation - How can I access individual faces via the API?

I want to create a visual representation for quite a lot of data. I did not stumble up on a tool to construct a 3D or 2D graph in Blender yet. If there is anything like that it would solve my problem ...
0
votes
0answers
9 views

add light button with for loop and enum [duplicate]

i want to add a specific light button with this script not call a menu from where i can choose what light i want to add. ...
0
votes
0answers
25 views

Script to render multiple orthographic projections?

I have a model imported in Blender. I want to render approx. 30-100 views using an ortho camera from specific viewpoints. I have a list of 30-100 definitions of planar surfaces and directions for the ...
0
votes
0answers
12 views

Select Most Recent Report in Info Editor with Python

How would you select the most recent report in the Info editor via Python? I know that the most recent report will have the highest report_index value, but I'm not sure how to tell blender to find the ...
0
votes
0answers
40 views

How do I fix bpy.ops.object.mode_set.poll() failed, context is incorrect?

I am trying to convert a metaball object to a mesh, but I cant pass this stage. I am basically stuck. I checked out all the bpy.context and context override and bpy.ops posts and documents and i ...
0
votes
1answer
9 views

How to get list of bm.verts that belong to a deform layer?

I have a previously assigned Vertex Groups on my object. After creating the bmesh, if I understand correctly that Vertex Group should now be ...
1
vote
1answer
19 views

Loop copying over vertex coordinates is not working

I'm completely baffled by this - it makes no sense to me at all! I'm trying to copy over vertex coordinates from an object in blender into a list, and at the end of the loop the entire list is filled ...
0
votes
0answers
13 views

How can I count the characters per line in text object?

I'm currently working on displaying paragraphs of text in blender, where I would like to have some control over how many characters are shown per line. To keep text readable I want to limit how many ...
3
votes
1answer
66 views

How do you mathematically reverse a perspective transformation?

Maybe that's not the best title for this question, but I find it hard to describe what I'm trying to do in a generic way, so I'll just describe the situation. My friend and I are designing a human ...
1
vote
1answer
28 views

How can I list all the matcaps and studio lights via python?

I'm currently working on new addon for blender 2.8 but I got stuck because I need to find a way to list all the Matcaps and Studio lights installed inside blender. I'm using this to list all the ...
0
votes
0answers
13 views

Player movement relative to camera (a la Super Mario Galaxy) in BGE

I'm attempting to create a gravity platformer in the style of Super Mario Galaxy for the Wii. I've figured out the gravity mechanic quite well, but the camera player movement has been difficult to ...
0
votes
0answers
12 views

Found Bundled Python

if anyone could help i would be grateful. So I installed blender and when I start it, it shows in cmd "Bundled Python" . I don't know what to do. But its only for .app , when I install blender through ...
1
vote
0answers
35 views

Python Script Fix for 2.8 Rigify [closed]

How could I write a script to find all bones that are using a custom shape and enable wire-frame on them, so I don't have to do it manually for like 100+ bones. I'm not that good with Python. I had ...
0
votes
1answer
19 views

How do I change the shape of an object while keeping all of its data?

This is my first time making a game in Blender and I've been using the cube that is the first thing on your screen as my player. The player has a bunch of code in it now and I want it to be a ...
1
vote
0answers
52 views

bake vertex color to texture with python

I'm trying a find a way to bake existent vertex color of an object to texture file with python code. can anyone help me? EDIT: I found this: ...
1
vote
1answer
20 views

How to use Keyframes and the Python API programmatically?

Currently I have a default cube and 400 frames. Here's what I have working without keyframing ...
1
vote
1answer
63 views

Problem with drivers value's statement

i set up cube rotation and movement by object near by cube,but i also want to set up its z location so it cannot penetrate through plane every time it move forward and backward,there is some problem ...
1
vote
0answers
24 views

Selecting the active layer

Every time I create a script to create text it adds the text into layer 1, when in fact I am working in layer 3. I realize the "True" relates to layer 1, so I possibly require a script in its place.? ...
1
vote
1answer
15 views

Offset on driver via scripted expression

I am trying to rotate a set of limbs on a centipede all slightly offset from each other in a 360 degree cycle. Each one will have a driver with an offset, thus the centipede would walk as seen here ...
0
votes
1answer
13 views

How to alter operator property while it's invoking

In this script, I am taking two names, and printing them. The first name should be chosen from the menu or written manually (a new one). ...
2
votes
1answer
24 views

Keyframing specified object location at frame from csv data

I've been trying animate a large amount of objects based on location and frame data from an excel sheet. So far I've read through a dozen different threads both here and other forums, but I'm just not ...
0
votes
0answers
14 views

Is there a way to use box deselect while using the tools in Blender 2.8?

Tools such as the transform, rotate, and move tools? I know about pressing B to bring it up, but I'm used to holding down control and then holding and dragging the left mouse button to deselect things ...
2
votes
1answer
42 views

Find any node connected to a material's displacement input and replace it with a normal map node?

I am attempting to open models that have been created in 2.7 in 2.8. But I am having some trouble with the nodes not looking correct and and final results in 2.8 are not satisfactory. And I must ...
0
votes
1answer
19 views

sapling tree gen problems 2.8

The problem occured unexpectedly and appears only in one particular .blend file. After shift-a then curve>sapling tree gen no new object is created. Info shows up, pointing three lines in py's and ...
0
votes
1answer
12 views

BGE: Getting rigged door mesh to update for collisions

I set off to create a rigged door, thinking a single mesh object with moving parts should be easier to manage than having each part as a separate object - especially once there are a large number of ...
0
votes
1answer
31 views

Notify Operator when scene property update

I want to call a method of an operator when a scene property has changed. I know there is an update callback: ...
1
vote
0answers
10 views

activate Grease Pencil layer via python 2.80

When separating bits out of a grease pencil into a new object, Blender creates a default layer in this new object. But it leaves the layer "inactive". After that, I can't run any operators on the ...
0
votes
1answer
34 views

Problem to update fcurve driver

My problem is get the "angle" for updating the expression inside , in this example the expression is a simple string for explain , but i want controll expression by floatprop(that is not a problem) ...
0
votes
0answers
15 views

How would one go by making an armature importing script?

See title. I've been experimenting with a custom version of the .obj format that has armature data. Problem is that there's no importer script, and I wanted to make one. Blender already imports the ...
0
votes
0answers
19 views

Check if bpy.ops.pose.copy() button was pressed (and question about event.type)

I wrote some custom script with modal operator. If I understood right - modal operators mainly used with event.type for checking which button was pressed. Here is ...
1
vote
0answers
28 views

Rotating selected vertices around given point using a matrix? (python, bmesh, modal, without bmesh.ops.rotate)

Is there a way to rotate bm.verts around a given point (another vertex, cursor etc) by multiplying v.co with Marix.Rotation and not using bmesh.ops.rotate? Like this: ...
1
vote
1answer
26 views

Accessing volume checkbox of a camera in the Stereoscopy section

Is there a way to check/uncheck the volume checkbox in the stereoscopy tab in the settings of a camera via the Blender Python API? Update: ...
1
vote
2answers
32 views

duplicate the mesh in edit mode and flip normals using python script

I want to make my two sided (input model is collada). so, for that i want to duplicate all the faces in edit mode and then flip normals, and then export the model as fbx. i want to do this using ...
1
vote
0answers
18 views

Calling Blender from Python, local machine vs Server; Unable to find pixel format

I have a python script that calls blender, my blender file, a python program performed in Blender, and 2 variables passed into the python script in blender. The command looks like this. ...
3
votes
0answers
17 views

When a Driver is being evaluated are the final positions of objects finished evaluating?

When a Driver is being evaluated are the final positions of objects finished evaluating? Does the Dependency Graph take into account references made in a Driver for a topological sort? The Blender ...
1
vote
3answers
55 views

I am trying to create a Script that does a Smart UV unwrap of seperate connected parts of a mesh

This is what I got so far. Note that I have a counter which I check with 10 while I'm testing, so it doesn't pass through everything, since it takes quite a while. The reason for doing this is that ...
0
votes
0answers
16 views

How would you make an addon both 2.7 AND 2.8 versions compatible? [duplicate]

Is it possible to put some sort of condition checking the user's blender version and depending on that make either register the class in old-fashioned way or the new API one?
1
vote
0answers
27 views

Blender 2.80: Different collections in each viewport

Is it possible to restrict visible collections in each viewport separately. Here is how it was done in 2.79 using lock_camera_and_layers
0
votes
0answers
21 views

BPY Convert gpencil to curves with a script?

I have a scene with a GP object selected, and tried to run a very simple script from the script editor: ...
1
vote
1answer
19 views

Do plugins/APIs exist to edit blender-python-scripts in Intellij IDEA?

I find the code editing environment on blender pretty stiff and it makes my development slower because I have to type every piece of code letter by letter so to say. I was just wondering if it were ...
0
votes
1answer
41 views

Correct way to delete double material on object by exact words inside

I try to excluding objects except 4 types, the objects in question have these letters in the name, but they are not always in the same place, for example ".Type1.001" to delete duplicate material , ...
0
votes
1answer
31 views

Circle Array Modifier for face rotation

I know how to add a circular array modifier, it is shown e.g. in a video like this: https://www.youtube.com/watch?v=whjFb0xFoLk But what I want to do is to create such a circular array that is ...
1
vote
2answers
76 views

Way to hide , (not hide_viewport) in blender 2.8

hide_viewport is the new api (old hide) but no have new api for "Close little eye" is possible? edit: For now this visibility (collection or object) is not expose in bpy,as Confirmed,with Medium ...
7
votes
5answers
598 views
0
votes
0answers
30 views

Error when use: bpy.data.collections.remove(my_coll) blender 2.8

I not understand if is a bug or is my mistake,that script work fine , but i not understand tipology of error, ERROR (bke.library): c:\b\win64_cmake_vs2017\win64_cmake_vs2017\blender.git\source\...
0
votes
0answers
25 views

Are there any tutorials/resources for generating objects in random locations?

I'd like to write a script that places 3 objects of my choosing in random places in all xyz dimensions (with constant size, but varying rotations and locations) and I'm wondering where I should go to ...
2
votes
1answer
59 views

How to correctly merge two objects in blender

I am trying to merge two close boxes into one single cuboid, from the GUI I am able to successfully create the two boxes and set a boolean modifier to the first box to unify(UNION) with the second box ...
1
vote
1answer
33 views

Problem with return super().__getattribute__(attr) blender 2.8

That script make this problem: return super().getattribute(attr) AttributeError: 'ParticleSystem' object has no attribute 'my_particle_settings' i think is a good solution , about create a particle ...
0
votes
0answers
12 views

How can I navigate 2d viewport (Image Editor) using Python?

I want offset 2d view with specific vector. Can find way to do it.Please help. I have tried this way: ...