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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
660 views

Change text based on frame [duplicate]

I want to give an explanation in text during an animation I made in blender. However, with my current script, I only see the second text displayed during the whole animation. How do I change my code ...
Laura's user avatar
  • 72
0 votes
0 answers
29 views

Setting translation overrides scaling

With the default scene with the cube selected, consider this script: ...
Martin's user avatar
  • 1
0 votes
0 answers
533 views

Access and using geometry nodes as functions in Python

How can I use the Geometry nodes graph in python or at least get access to one of its node functionality? For example I want to use the Attribute Sample Texture Node along side editing vertex group ...
barakooda's user avatar
  • 183
0 votes
0 answers
326 views

Re-align imported animation keyframes to blender frames

I've imported a motion capture armature from an fbx file, the problem is whenever I check the action number of keyframes for any fcurve they are much more than I expected from previewing the action ...
Ahmed Ali's user avatar
  • 563
0 votes
0 answers
102 views

What is the best way to encode a material into python code?

I'm looking for the most widely applicable a way to convert materials into executable python code, with code. This method should be able to accomodate node groups, and multiple nodes with identically ...
Exporer's user avatar
  • 13
0 votes
1 answer
264 views

Python access to walk_speed setting of Walk/Fly Navigation Mode [duplicate]

Is it possibile to access walk_speed setting of Walk Navigation mode via python API? (I know how to activate the Walk mode by script, but I want to change the walk speed).
igmar's user avatar
  • 199
0 votes
0 answers
392 views

Delete a single vertex from a spline

I want to create a curve with 4 points in python. So i figured that I could subdivide a primitive curve twice and delete one of the points. The code below kinda works by selecting a single point and ...
DrDress's user avatar
  • 543
0 votes
1 answer
248 views

Node Editor - Python - Expose listed Node Groups dynamically in Node shelf panel

Issue Currently, node groups are only accessible in the Add menu then group sub-menu. You can't just click and drag them into use. You have to search, or go into sub-menus to use them. Question It ...
Draise's user avatar
  • 206
0 votes
1 answer
690 views

Render and save " view port render image (openGL)" with python directly?

on which can save and load custom props (drive shape keys) and pose bone transform for Armature characters as preset.json with some options. Then I hope to enhance it by generating preview images (jpg,...
tokikake's user avatar
  • 185
0 votes
1 answer
881 views

How to add node in the center of the Shader Editor with python?

I would like to create a node, and center it in the node_tree view that is the "Shader Editor". Keeping in mind that this operator is only executed by a button in the context of the Shader ...
Noob Cat's user avatar
  • 1,144
0 votes
1 answer
297 views

Placing bone at each vertex -> How do I then connect each bone exclusively to that vertex?

Add a bone at each vertex location? Using the above, I can place a bone at each vertex, however, it doesn't connect the bone to that vertex. How can I edit the code in the solution to make it so each ...
Sam's user avatar
  • 3
0 votes
2 answers
325 views

How to set an image strip (ImageSequence) length via python?

I have this piece of code which creates an image strip but I can't find the way how to set the length of that: ...
Prag's user avatar
  • 998
0 votes
2 answers
149 views

Evaluate FCurve without keyframes won't work

i'm stuck here, i'm trying to evaluate a newly created FCurve to get the current value of associated property, and keep getting "0". Here's an example working code with scale: ...
tonton's user avatar
  • 211
0 votes
1 answer
560 views

Block with rounded edges in python

I can easily make a primitive box with python code. But I would like to make the edges parallel to the z-axis rounded with a given radius. Sort of like the picture below but without all the ...
DrDress's user avatar
  • 543
0 votes
1 answer
93 views

Select Dyntopo field and check it as True

I would like to select the Dyntopo and place a check into the field, yet I can only find a toggle script bpy.ops.sculpt.dynamic_topology_toggle(). I'm not sure ...
Michael Teiniker's user avatar
0 votes
2 answers
2k views

Exporting UV Layout with only outlines

newbie here. I have a very specific question. I’ve done a ton of research and didn’t find anything useful. So, as the Title suggests, I’m trying to export UV layout without all the edges inside of the ...
Aleks K.'s user avatar
  • 159
0 votes
1 answer
272 views

I need a code to get the current value of the waveform from an audio file at specific frame

I would like to build a function that does something based on the current value of the waveform of an audio. Inputs: An audio file: like a speaker object or a path on the hard drive or a track name ...
user2824371's user avatar
0 votes
1 answer
122 views

Convert from Bezier surfaces RIB file into something Blender can import?

Can anybody recommend a free converter that’ll turn a Bezier surfaces RIB file into a mesh format that Blender can import? I have a RIB file of Ed Catmull's "Gumbo" that I’d like to use in ...
KickAir8p's user avatar
  • 2,342
0 votes
1 answer
169 views

Change tile grid shape

I'm trying to change the tile_grid_shape in the UV Editor window located in the UV Editing workspace. The problem is that the only way to do this that I found is bpy.context.... but using context is ...
Aleks K.'s user avatar
  • 159
0 votes
1 answer
228 views

Is the object that is associated with an action selected?

I have a script that goes through all of the actions in bpy.data.actions. for action in bpy.data.actions: First, is there a way to return the object the action is ...
Michael's user avatar
0 votes
1 answer
709 views

Exporting rotations of selected objects to a text file

I am using this script which I got from the internet and it works perfectly for 2.79. Please could someone help adding selected objects rotation to export to the same txt file? In degrees.... Thanks ...
Michael Teiniker's user avatar
0 votes
1 answer
419 views

Grid Illumination

I want to know if there is a method for figuring out how much light is incident on a mesh using python. Some function for it that I can use or any leads on how can I implement this function will help ...
Sami's user avatar
  • 1
0 votes
1 answer
82 views

Dual functionality for a single hotkey (S for Scale) - similar to the G hotkey for Move and Slide Move

If you press "S" you activate the scale tool, but I'm trying to create a script where if you press "S" again while the tool is already active... you start to cycle between pivot point modes (median ...
Armored Wolf's user avatar
0 votes
1 answer
1k views

Moving and rotating using CSV

I have used the script to move an object using CSV. Can it be modified to include rotation as well? Can this be done using one imported file, or is it best with two imported files. One for Location ...
Michael Teiniker's user avatar
0 votes
0 answers
285 views

Cleaning unused Material Slots in Blender 2.80 Beta [duplicate]

In Blender 2.80, I've deleted a material and have empty material slots on my objects. I want to clean this up. I have this bit of code: ...
SupaGu's user avatar
  • 119
0 votes
1 answer
355 views

Python: How to Export All the UV Layouts in Blender

Can anyone confirm this script works in 2.79b? (I can't use 2.8 at the moment) The script is supposed to export the UV layouts of all selected meshes at once to a specific folder, but I'm no coder, ...
Emboo2's user avatar
  • 278
0 votes
1 answer
141 views

Changing the scene

I have tried changing the scene, but it doesn't seem to work. Am i missing something? ...
Michael Teiniker's user avatar
0 votes
1 answer
607 views

PyQt and Tkinter seem to not work with Blender 2.8

When importing PyQt5 blender throws this: ...
joseluis chavez's user avatar
0 votes
0 answers
230 views

How to split object by plane via script

I have a single complex 3D object. I would like to cut this object at regular intervals along the x-axis into separate objects. This is because I want to apply a separate particle system to each piece,...
alex.l's user avatar
  • 45
0 votes
1 answer
2k views

"bpy.context.scene.object_bases" not working in 2.80?

The 2.8 documentation for the context override is found here: https://docs.blender.org/api/blender2.8/bpy.ops.html?highlight=object_bases ...
morph3us's user avatar
  • 1,429
0 votes
2 answers
395 views

How to use mathutils.noise.hetero_terrain?

I am not sure what I am missing, but all I get is a value of 1 on every return.. ...
VSB's user avatar
  • 453
0 votes
2 answers
2k views

How to scale an object via a slider in Python?

First: I'm new to Python programming in Blender. I already know how add a row to scale one single axis of an object by using a slider in the tools panel e.g. I'm using this code snippet to do this: <...
Christoph Werner's user avatar
0 votes
1 answer
3k views

How to mirror a mesh on x-axis on pivot point with python?

I've an object with pivot point in the centre (0,0,0). I want to mirror it by python on the x-axis and do it for all objects in my current scene. I tried this, but the second line seems not to be ...
Bruno Bieri's user avatar
0 votes
1 answer
693 views

Ungrouping a node group with Python

What is the correct way to ungroup a node group from a script? Essentially, I have a material that contains both nodes and node groups. I would like to expand all node groups in that material, ...
Lewis's user avatar
  • 1,260
0 votes
2 answers
416 views

Problem executing string

In 2.79 I was using exec() with a string to run operators, however in 2.8 copying from the info panel into exec() gives an error with the constraint_matrix: ...
Way2Close's user avatar
  • 440
0 votes
1 answer
60 views

How to write python to show Toruses from an imported txt file containing center coordinates

I have a question about Python. By the way, I'm beginner of Python and English. I wrote a script showing Toruses from an imported txt file containing center coordinates, but I got an error at ...
Haruki Miyamoto's user avatar
0 votes
2 answers
2k views

Python: doing an action depending of the type of object [closed]

hello i have a really simple problem if my active object is an mesh i want to do an action, if its an empty another one, ... ect so i want for example in this case, move the location of the active ...
Fox's user avatar
  • 1,872
0 votes
1 answer
293 views

Deselect Neighbours Faces

is it possible in blender v2.70 or with a python function deselect neighbours faces, so that they are alone ? i'll upload a picture to understand what I mean. I hope it's doable.
DevilSam's user avatar
  • 141
0 votes
0 answers
760 views

Rounded corners for 2d rectangle with Python [duplicate]

in my addon I have a 2d shape (polyline) for which I want to add rounded corners (step-wise, like the bevel does, when added edges for the bevel). This means I want to decide that I add for example 2,...
Jayanam's user avatar
  • 655
0 votes
2 answers
6k views

Looping through selected objects one at a time?

OK, from the selected objects, I need to join one selected object with the active object and execute some other code. Then from the others select the next selected object and then execute the code ...
AFWS's user avatar
  • 762
0 votes
0 answers
229 views

Add-On Dev: Default of PointerProperty changes based on type?

I'm trying to make sense of something I've noticed while debugging. When I add a property of bpy.props.PointerProperty with ...
Robert's user avatar
  • 1,235
0 votes
1 answer
2k views

Connect parent bone tail to child head

I'd like to connect the tail of a parent bone to the head of a child bone, because it looks more organized. This is how it currently looks like This is how it should look like Since there are a lot ...
sezanzeb's user avatar
  • 111
0 votes
1 answer
5k views

How to move a bone in pose mode using python?

Knowing the names of the bone and the armature, I would like to animate the bone by setting the location and/or rotation of the bone starting from say frame 24 to 48. I'm an absolute beginner and I ...
user2824371's user avatar
0 votes
1 answer
2k views

Blender 2.8 (python) - input RGB doesn't match hex color nor actual color

A python script inputs RGB values into a Principled BSDF surface node. The system-computed hex equivalent is wrong as is the color. The color I want is 414c55. The script passes RGB values 0.254,...
vndep's user avatar
  • 713
0 votes
3 answers
486 views

Want to run two scripts when I change to edit mode

Im not good at python script, but I want to run two actitons when I change to edit mode. or I want to know register any Hoykey for run this scripts? ...
Jin K's user avatar
  • 11
0 votes
1 answer
873 views

center point in camera view [duplicate]

Is there a simple way in python to rotate/position a camera so that a specific point (X,Y,Z) is in the middle of the camera viewfinder in Blender 2.8?
vndep's user avatar
  • 713
0 votes
1 answer
1k views

Projection of point on plane

I have a point in 3d view (found out with region_2d_to_origin_3d of mouse position). I want to find its projection on a plane defined by a normal (x1, y1, z1) in orthographic view. How to do this? ...
greentail's user avatar
0 votes
1 answer
1k views

Creating path curve using python script [duplicate]

I'm using the following script to create path curve: ...
AvivSham's user avatar
  • 175
0 votes
0 answers
234 views

How to draw Object selection with eyedropper layout using Python script [duplicate]

I wanted to draw this Object selector layout using Python Script and Retrive the Selected Object Also Apply the Modifier to Selected Object I have Tried this from the another question asking for same ...
Rakesh choudhary's user avatar
0 votes
2 answers
299 views

Why do i get this Merge Operator: Enum not found error?

I am recently learning to extend blender and trying to create a custom utilities panel. I'm trying to add a "merge vertices" button on a panel but I keep getting errors saying; ...
Ian Dela Cruz's user avatar