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
0answers
7 views

how to create a sub menu in the sequencer context menu for VSE?

I want to create an addon that will allow me to copy and paste video and image clips from one blender window(VSE) to another separately opened blender window(another VSE window). But I've been ...
0
votes
0answers
6 views

Save copy of scene without locking interface

i use bpy.ops.wm.save_as_mainfile( filepath = new_path, copy = True, relative_remap = False, compress = True ) but while scene is saving i can't use interface. How ...
0
votes
0answers
7 views

Blender 2.7.9 Vertices Data in python Skin modifier

A similar question has been asked here: Access skin modifier radius data but I can't get it to work. What I want to do is change the Vertices Data/Mean Radius X and Mean Radius Y to a certain value ...
0
votes
0answers
6 views

operator draw() method in Node Editor

I am creating a script that creates node in the node editor. I need to accept some properties from the user after creating the node. So I wrote a draw method. But ...
0
votes
1answer
5 views

How To Change Camera Field Of View From Python Script

I'm trying to change the camera FOV by script. I've already seen different questions like this, but the answers doesn't work for me... This is my code: ...
0
votes
1answer
35 views

How can I reset all custom properties into a “Redo Panel”?

I have a "Redo Panel" with some custom properties and an operator at the end, from which I want to reset all custom properties at their default values. How can I do that? Here is an example ...
0
votes
0answers
22 views

Call operator with adjust menu

I need to call an operator from bpy. ops in its operator so that the settings menu would also be called. Here is my operator. ...
0
votes
0answers
26 views

RightClick “Assign shortcuts” doesnt work in Edit-mode?

I am using my own custom menu, and i discovered that i can assign shortcuts to "my operator" but i cant assign shortcut to the same thing while in editmode. in editmode the shortcuts cant be ...
0
votes
0answers
16 views

An object moves along a curve, but followpath doesn't match the curve bevel resolution

I want a car in blender to move along curves, and use curves to represent the trajectory of the car. The speed of the car is non-uniform. I have used the bevel_factor_mapping_start of curves to ...
0
votes
0answers
20 views

Changing actions doesn't affect render

I am rendering all cameras, all collections and all actions. When I change action, the render still renders the first action, not the new action. Here is my render code: ...
1
vote
2answers
41 views

How to detect disconnected parts within a selection?

Consider the following edge selection: What would be the fastest way to return the indices of the different parts of this selection? I am aiming for an output similar to this: edge_indices = [[24, 46,...
0
votes
1answer
33 views

How can I calculate a 28.5 mm hole for a hyperboloid center opening when it's Z=0

How can I calculate a 28.5 mm hole for a hyperboloid center opening when it's Z is equal to 0 The arrows point to where z=0 and the 28.5mm hole should be. (I know I could scale the object but I need ...
0
votes
0answers
14 views

Is there a way to disable the strength circle in the sculpt brush?

In blender 2.79 there was only a circle for the size of the brush. I've switched to blender 2.8 and I found that there is a smaller circle in the brush that tells how strong is the brush that I'm ...
1
vote
0answers
10 views

Using custom socket types in node tree - can't assign PointerProperty

I am working on a Blender addon based on the node system. I would like to be able to pass my own custom types through the node tree. Currently I can use the following types: FloatProperty, IntProperty,...
0
votes
1answer
24 views

How to overide custom node operator variables in the execution

Related to the question here I wanted now to use the export custom node from the same addon. Considering that the invoke() function calls the file browser for ...
-1
votes
0answers
19 views

How to make a button that shades smooth [duplicate]

I am new to Blender python and i want to write a code that can shade smooth by the click of a button. I did some research and i have written this code `import bpy ...
0
votes
0answers
22 views

How to shade smooth using BPY

New to bpy and I'd like to write some code that sets the shading of an object to smooth by just clicking a button. I did some research and I have written the ...
0
votes
0answers
11 views

How to select all vertices of a grease pencil object in edit mode via python?

While in edit mode of a grease pencil object, the tooltip of "select all" says that the corresponding python command would be ...
1
vote
1answer
13 views

Right way to stop export operator from saving with empty filename?

If I have a basic save/export operator like this: ...
0
votes
0answers
22 views

Header Alignment

I'm attempting to add a camera options dropdown to the top header within the 3D viewport, and looking to align it using python. As of right now, if I shrink/expand Blender along its width, the default ...
-1
votes
0answers
21 views

Create a new panel for the DrawFreeHandSpline with the data about resolution/ geometry Extrude & Bevel?

i would like to create a quick simpler panel for the drawspline. So that i can change the" resolution "the " fill mode" and "object-target" of the spline like in the ...
0
votes
0answers
15 views

How to get the current key frame

Now, I want to input a key value automatically in the selected key frame bpy.context.object.animation_ data.action.fcurves[0].keyframe_Points[0].co[0], but in this ...
0
votes
0answers
11 views

NURBS Path not extending all the way to tips

I have two Path objects that I've joined into a single object here for comparison. The one above was generated with a Python script. The one below was added the typical way from the menu Add > ...
0
votes
1answer
12 views

Autostart an Operator from custom node

A Custom Node Creates a Collection and invokes an Operator that registers a 'TIMER' and constantly updates some properties of the 'MotherNode'. ...
0
votes
1answer
20 views

Python - Not finding armature

So it's my first time writing a python script for Blender so I may not be entirely familiar with the API but I know enough python to code something. I'm trying to find an armature in code that is the ...
1
vote
1answer
27 views

How to invoke custom node operator

I am trying to invoke a custom operator from a blender addon, e.g. this one. However, when I call it from the command line I am getting the following error message: ...
0
votes
1answer
43 views

How to convert blender scripts bpy to python scripts py

I am new to Python and Blender and would like to know: How to convert Blender scripts (bpy) to Python scripts (py)? What is the difference between Blender scripts and Python scripts?
1
vote
0answers
30 views

Add > Path with custom geometry using Python [duplicate]

I am writing a Python script and in part of it I want to do an Add > Curve > Path operation, but instead of the default 5-vert straight path, I want one at the object origin (which I have pre-...
0
votes
0answers
22 views

How to get font size of blf module?

blf module has an API to change font size. By this API, I usually change font size and draw text. However, I could not find the API to get font size. Getting font ...
0
votes
0answers
20 views

Blender output to 'INFO' panel

I have two operators which is subclass of Operator first draw dialog window and has button which call the second operator with ...
0
votes
1answer
21 views

MultiFile Add-on with single python file [duplicate]

I am making an add-on in blender that has one python file. In the past, I have been able to just import this add-on as a single python file by itself, but I need to use a .zip file for this because my ...
0
votes
0answers
19 views

FBX importer python error

I'm trying to open an FBX file in Blender 2.9, but I'm getting the following error: What does this error mean, and how can I fix it? AssertionError? The file opens ...
0
votes
0answers
28 views

Render OPTIX on T4 GPU

T4 GPU is an RTX GPU, in the nvidia documentation it supposed to support OPTIX. But when I try to render using OPTIX on that GPU, blender renders on CPU. I tried to retrieve all available GPUs and ...
0
votes
1answer
24 views

How can I add custom icon for my operators in a specific addon?

According to this question and this example I am trying to add some custom icons to my addon's operators. But I have an "issue". In both examples, functions ...
3
votes
1answer
64 views

Updating a 2.7 script that uses frame_current to work with 2.8+

There's a script I find very useful that works in 2.7x that is no longer working in 2.8x, 2.9x. I want to update it to work with current Blender versions. The script takes an object and makes a ...
0
votes
0answers
28 views

sculpting in python using stroke - understanding stroke parameters

I would like to sculpt in python using the following operator: ...
0
votes
1answer
18 views

Moving object based on real world time in blender

I would like to move an object based on time in blender. The issue is, I would like to have it's translate values updated every time I open the scene (or while the scene is open), I don't want it to ...
0
votes
1answer
24 views

Why does not Animation Nodes provide the uv information properly?

Please see the sample nodes below. You can see that the object clearly has UVs and listed in the uv list however Animation Nodes is telling me that it has no uvs. Is this a bug? Is there a way to get ...
-1
votes
0answers
37 views
4
votes
1answer
239 views

Getting a closest point to 3d cursor gives a wrong result

I'm trying to find a point on an edge closest to 3d cursor with .intersect_point_line() but I'm getting a wrong point as a result, here I create an Empty in the ...
1
vote
1answer
52 views

what is the meaning of 4x4 projection matrix?

I want to know the meaning of 4x4 projection matrix and how can I transform it 3x4 usual shape. I understand that, in Blender, I can compute projection matrix as following, ...
3
votes
1answer
52 views

How to get custom menu items show up in the search bar?

I have successfully created a sub menu which extends the Shift+A menu in the shader editor but I would like to have the options show up as results in the search bar. Is this even possible, and if so ...
0
votes
0answers
22 views

Porting add-on from 2.75 to 2.9? [closed]

Can someone help me convert this 2.75 add-on code to 2.9? ...
0
votes
0answers
21 views

How can I set custom width to a redo panel?

Is there any way to set custom width to a redo panel like invoke_props_dialog(operator, width=300) does?
0
votes
0answers
16 views

Launch the full Dialouge of another script from within my own script (Export Add_On)

I have written a small add on that allows a user to create a mesh in a particular way. Once the mesh has been created I would like the user to be able to export the mesh to a dxf file for various ...
1
vote
0answers
13 views

Instancing a space theme with a draw callback

In a somewhat tongue in cheek answer to https://blender.stackexchange.com/a/197340/15543 have come across the possibility of having one instance of a 3d view showing a different theme than another. ...
0
votes
0answers
18 views

Is there a way to record blender steps and create a python file?

Firstly sorry if this question looks silly. But, I am using cloud rendering. So, for every time I make small changes in blend file I have to re-upload the file. I am not familiar with blender's python ...
0
votes
0answers
22 views

How do I copy an EMPTY object?

I have previously used the following to sucessfully duplicate Mesh objects: ...
1
vote
1answer
55 views

A custom node group socket identifier

Is it possible to add a socket to a node group with a custom identifier? So it would be: ...
0
votes
0answers
16 views

How to add additional options to preexisting panels in your addon [duplicate]

What is the method to add extra options to preexisting panels like the ones I have circled in the screenshot in your addon?

1
2 3 4 5
174