Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [operator]

An operator is a processing unit that is invoked/executed on scene data by the window manager.

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

Why can't I import a specific class from the module?

I'm trying to retrieve a class from the module called draw_op. The problem is in the module, some of classes can be imported normally while some don't. Error: <...
user avatar
0 votes
1 answer
44 views

How to set context to edit mode

I've been reading through this page on how to change the context of a Python script so that the poll is correct. I recently ran the AssetGen addon that broke because it reported that bpy.ops.uv....
user avatar
  • 2,959
0 votes
0 answers
19 views

Prevent properties dialog from closing during file/path selection

Given the following code, I have ha dialog box with three with two StringProperty properties with FILE_PATH AND ...
user avatar
0 votes
1 answer
42 views

Align Active Object to Curve based on Eyedropper

FYI, this is based on my old question in previous post Is it possible to use single pointer to assign on multiple modifers' Pointer Properties at once?. Now, for my learning and experiement purpose, I ...
user avatar
  • 179
1 vote
1 answer
18 views

How to make a button know what iteration in the loop it is

I'm writing some UI where, for each material slot an object has, there is an interface that involves a button. I need this button to know which material slot index it is associated with, but I can't ...
user avatar
  • 2,959
1 vote
1 answer
30 views

How can I update a Panel from an Operator?

I have an Operator that fetches some data on execute. I want to iterate the results, adding rows to the layout of a Panel. I'm stuck on how to give the Operator a reference to the Panel. ...
user avatar
0 votes
1 answer
17 views

How to not draw undo props when shift is pressed?

I want to draw undo props only when the shift is not pressed ...
user avatar
  • 506
2 votes
0 answers
27 views

Invoke a Modal from Add-on Registration

In my Add-on's __init__.py file I'm calling my modal operator's register function, then trying to invoke it using the following code: ...
user avatar
0 votes
1 answer
22 views

Control several Modifier parameters via Modal operator

Let's say I have this code for adding the Solidify mod to the object by ctrl+W. By holding Shift I can control the Thickness parameter. How can I switch to the Offset parameter and still be able to ...
user avatar
0 votes
0 answers
8 views

How to convert normal code to operator code

I am new to making addons in Blender. How do I take this code and make it an operator? ...
user avatar
  • 1
1 vote
1 answer
74 views

Blender Python: display dropdown enum using bpy.context.active_object.data.shape_keys.key_blocks.items()

My Goal is to have 4 dropdown lists of shapekeys in a 3D view panel, allow the user to select 1 shapekey in each dropdown, and then reference those user-selected shapekeys in scripting that modifies ...
user avatar
  • 501
4 votes
1 answer
113 views

How do you access the TEXT_EDITOR header so you can add an operator?

I'm trying to create a button in the Header of the TEXT_EDITOR but for some reason the button isn't actually appearing in the header when I run the code? I'm not sure why this is happening. ...
user avatar
2 votes
1 answer
43 views

Type Error: self.text

After learned about new changes in blender API, I had to update script from 2.8 into 3.0 using : instead of =. So following the ...
user avatar
  • 179
1 vote
2 answers
33 views

How to detect events in modal by keymap

Root problem: I have a modal for the 3DView where I want to allow users to use any 3DView navigation input (pan, zoom, FPS walk) via {PASS_THROUGH} but no other ...
user avatar
3 votes
2 answers
54 views

Is it possible to use single pointer to assign on multiple modifers' Pointer Properties at once?

Bear with me, I am still new to python in blender, I apologize, I am not very good with words or is capable of explaining the issues I am having or solutions I am looking for. So instead of struggling ...
user avatar
  • 179
0 votes
0 answers
17 views

Keep Custom Operator (created by python API) properties expanded/open by default

My question is exactly the same as this one, except it is for a custom-created operator using the python API. I would like to know how to programmatically keep the properties popup expanded. ...
user avatar
3 votes
1 answer
57 views

Display object custom value in the object panel

I'm trying to create some tool for blender that requires to store and show some boolean value for each object. I have create simple Panel in Object context with one bool property sadly it's not ...
user avatar
0 votes
0 answers
132 views

Google colab render not working

This is the code am running. Everything is running without error but I can't get the authorization code but google accepts my drive without error. Finally not initiating render. ...
user avatar
  • 1
0 votes
0 answers
17 views

Changing the mouse pointer to be like the default blender Rotate pointer?

I was looking into bpy.context.window.cursor_set() because I want my modal add-on to have the same cursor that you get when rotating stuff in blender, but it seems that the parameters for curusor_set ...
user avatar
  • 173
0 votes
0 answers
47 views

How can I call operator methods by changing values in a panel?

Currently I have a script that draws a line strip whose vertices depend on 2 boolean values, controlled from a panel. However, the line is only updated when the operator is invoked. What I need is for ...
user avatar
3 votes
2 answers
154 views

How to put buttons, sliders, ect. in the N panel with an addon [duplicate]

My goal is to make an addon that makes a new tab in the sidebar with sliders and buttons and stuff that do nothing (it’s my first addon, so I’m just experimenting). I stole some code from the cursor ...
user avatar
  • 437
2 votes
1 answer
65 views

Disable button when another button has been enabled [duplicate]

So what I need is when Eyes Follow Cam is False then Head Follow cam and Influence is disabled(grayed out) and when Eyes Follow Cam is True then Head Follow cam and Influence is enabled Here is the ...
user avatar
0 votes
0 answers
25 views

2D mousemove axis from 3D Vector?

I'm working on one part of my modal operator and I'd like to be able to use the mousemove event to change a variable, but the mouse movement should have a specific linear direction to it, that is ...
user avatar
  • 173
4 votes
1 answer
72 views

Automatically run a script when an object is transformed or a condition is met

I am new to blender coding and I made a script to calculate a complex bone rotation. The script is intended to run like a constraint in the sense that it will execute only when the "target" ...
user avatar
0 votes
1 answer
45 views

bmesh as global variable in a modal function?

I am updating as well as trying to optimize an add-on that I haven't touched in a couple of years. I learned python as I was making that add-on back in the day, actually, and now am reading that the ...
user avatar
  • 173
0 votes
0 answers
31 views

STL Import operator seems to be asynchronous

I'm trying to import an STL in a script and then operate on the imported object but something strange happens: bpy.ops.import_mesh.stl() seems to be asynchronous or ...
user avatar
  • 1,209
0 votes
0 answers
61 views

how to scale operator menu (scale_x) wider

EDIT!! I will rephrase my question The script I am working on has the same operator menu as you would get when adding a plane. Add > mesh > plane. No popup or whatsoever. It is a custom drawing, ...
user avatar
  • 170
5 votes
2 answers
262 views

A comprehensive list of operator overrides

I feel like I'm always spending far too much time playing scripting whack-a-mole whenever I want to override an operator in one of my scripts. I'd like to build a comprehensive one-stop-shop list for ...
user avatar
  • 25.3k
1 vote
1 answer
61 views

Custom operator menu

I am seeking for some examples to make a custom operator menu. The operator menu that comes OOTB is The more options you have the longer (higher) the menu will be. I would like to make a menu that is ...
user avatar
  • 170
1 vote
1 answer
53 views

Blender crashes using a bmesh python operator

The following python operator crashes blender. I'm using 2.93.5 on Win10. Strangely however, if I use the python terminal built into blender I can import bpy, bmesh ...
user avatar
0 votes
0 answers
36 views

How to show built-in operator report?

For example this "remove double" operator will show report how many vertices has been removed if through GUI. but it wouldn't show report if operator run trough script, example simple script:...
user avatar
  • 190
1 vote
0 answers
43 views

a strange problem when creating an operator with Python

My understanding of creating an operator with Python is basically this: ...
user avatar
2 votes
0 answers
38 views

Connecting an Operator with a Panel Float Slider

I have a very basic question about Operators and Properties. I can't wrap my mind around how I'd make a Float slider in a Panel that affects a selected object in the 3D view as I drag it in real time. ...
user avatar
0 votes
0 answers
100 views

context.active_object vs context.scene.objects.active

Both context.active_object and context.scene.objects.active allow to get the active object in the scene. In most cases, they ...
user avatar
2 votes
1 answer
40 views

How do I properly store a value with a modal operator invoke?

I am trying to understand why storing a value on a modal invoke doesn't always work if not creating a class property. The following example works for some properties (focal length for instance) but ...
user avatar
  • 274
0 votes
0 answers
192 views

"make instances real" behaviour has changed in Blender 2.9, how to get the same behaviour back as 2.8?

"Make Instances Real" took a collection instance and made it into a collection this collection would include collection instances if they existed, for example i might have a road instance ...
user avatar
0 votes
0 answers
47 views

Using bpy.ops.export_scene.fbx outside of blender

I'm writing script for Shotgrid to Blender connection. I have a problem with using one operator. Inside my script, it's fails on this line: ...
user avatar
  • 1
1 vote
0 answers
23 views

Get operator pop-up current position

Is there any way to get the current position (x, y) of some active operator pop-up? I want to get the correct position even if for some reason I drag this pop-up from it invoke position (Meaning that ...
user avatar
1 vote
1 answer
29 views

How to get me modal operator's mouse to jump across view3d region like with blender's built in scale operator?

Is there a function built into blender that allows your mouse to infinitely scroll across the screen? I see this function on a lot of built in functions and was hoping to use it for mine. Below is a ...
user avatar
  • 103
0 votes
0 answers
37 views

How to provide large data at operator execution, arguments or otherwise?

What I want to do: Create an addon that "inflates" 2D polygons into 3D meshes (using more ways than just extrude). There will be an option to select predefined polygons as an enum type (...
user avatar
0 votes
0 answers
79 views

Override context (selected objects) of bpy.ops.view3d.localview

I want to move parent along with children to local view. Some children have hide_select=True. I tried doing something like this to no avail: ...
user avatar
  • 59
0 votes
0 answers
70 views

When writing an operator, what is the blender-idiomatic way of parameterising on an object?

I am trying to write a new operator using bpy. It will operate on the currently selected objects and add particle systems, then use a user-selected object as the render object in the particle systems (...
user avatar
0 votes
1 answer
28 views

Trying to make an add-on to keep Operators somewhere where I can always use them if I need something (2.8+)

Disclaimer: I know pretty much nothing about python, I'm learning as I go along. I just watched a video where someone went over the basics of python scripting in Blender, so I have some understanding ...
user avatar
1 vote
1 answer
53 views

Blender's python interpreter lock and modal operator

I have the following code snippet which I am trying to run two operators from an addon: ...
user avatar
  • 349
0 votes
0 answers
12 views

change the operator label after a repeat (shift R)

I want to repeat an operator with shift R and then have a different label in the redo panel "operator label (Repeated)" N.B: I see "is_repeat_last" in the API, but I don't see on ...
user avatar
1 vote
1 answer
41 views

Blender Python operator to center view (ALT+MIDDLEMOUSE shortcut like)

I am trying to center the view to the mouse point in a Python modal operator. However, I just couldn't find the right operator in the API documentation. https://docs.blender.org/api/current/bpy.ops....
user avatar
0 votes
1 answer
102 views

Runtime Error : Modifier is disabled, skipping apply (2.83.9) with boolean modifier

So I'm trying to do a boolean operation between two objects. Here's how I'm trying to do it. ...
user avatar
  • 1
1 vote
0 answers
176 views

Blender's Simple Operator Example not working

I am just learning programming and am having difficulty running this example code from Blender's official python documentation on the quick start page: https://docs.blender.org/api/2.93/...
user avatar
1 vote
0 answers
30 views

Can I prevent user from importing a non-existant or incorrect file in an import operator?

Losing my Blender flower on this one :) I'm using an operator to select the filepath of a .txt file. ...
user avatar
  • 25.3k
0 votes
0 answers
35 views

Can I bound an operator property with the value of another property?

In my specific example, I'm trying to generate objects rotating around an axis. The object generation works as intended, however I wanted to add bounds to the properties to not allow overlap between ...
user avatar
  • 1

1
2 3 4 5
8