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
1
vote
1answer
42 views

give a variable to an operator

For a workflow tool I made a panel in which it displays each separate library that is linked in my file. For each library I want to add some buttons that does stuff to the library in question. So in ...
1
vote
2answers
45 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; ...
2
votes
1answer
28 views

Custom tool, modal gizmo, and non-modal operator (2.8)

I’m prototyping an addon that will have several custom Tools and, when those tools are selected, a bunch of custom Gizmos in 3D views for manipulating various aspects of objects created by the addon. ...
1
vote
0answers
17 views

Bake script works individually, but crashes in loop

I am trying to write a script to bake all of my physics in the correct order. The commands work if I issue them to each cache individually, but if I try to bake them all in a loop, I get a ...
0
votes
1answer
14 views

how to avoid operator `collection_instance_add`?

how to create a instance of a collection from a python script / addon without using the collection_instance_add operator? with the operator i use something like: ...
0
votes
1answer
52 views

Pass collectionProperty through operators (Blender 2.8)

I want to pass some created objects by an operator to another operator for modifications. I tested with CollectionProperty, but can't pass the collection from the first operator to the second one: ...
0
votes
0answers
10 views

Property set/get example for operator needed [duplicate]

Still trying to wrap a property into my Addon where I can dynamically control the values of the resulting variable. Take the default operator_mesh_add example and alter the definition of the width ...
0
votes
0answers
23 views

Blender property update [duplicate]

I am building an operator, which has multiple properties. One of the things I would like to do is update the min/max and update attributes of the property on-demand. I understand that I can create a ...
1
vote
0answers
21 views

gbl shader blender 2.8

After adding an draw handler to my operator my terminal is showing the following: ...
0
votes
0answers
14 views

Context issues while importing Alembic files in a plugin [duplicate]

I keep getting the context is incorrect error and the error is: Operator bpy.ops.wm.alembic_import.poll() failed. I have tried all the solutions shared in this post and in the official documentation ...
0
votes
1answer
98 views

How to interrupt a rendering which is not displayed in the UI to interact with?

I created a script that renders and saves the selected objects. The script is quite large and I don't think it is necessary to post it completely. ...
0
votes
0answers
22 views

Getting the context is incorrect error while importing alembics via python

I keep getting the context is incorrect error and the error is: Error: Operator bpy.ops.wm.alembic_import.poll() failed. Can someone tell me the right context or the way to figure it out? I am ...
1
vote
1answer
20 views

pyNode with button: any way to find which node the button pressed was on?

I want to have a pyNode with some buttons on it that modify the node. Similar to how some of the built-in nodes work (Color Ramp, Curves, etc). I can easily put a button on the node using an operator,...
1
vote
1answer
167 views

Plot single vertices based on xy coordinates from CSV file

I'm aware there are numerous posts/questions already been raised on this, but upon reading the previous posts, I'm not quite able to find exactly what I'm looking for. So apologies if there's a ...
1
vote
1answer
30 views

How do I determine Shift+Left Click modal operator?

I would like to determine if Left Click + Shift pressed at the same time in event.type in a ...
1
vote
2answers
114 views

Combine and duplicate meshes before exporting them?

I'm writing an add-on that exports objects to FBX file format. One of its features will be the ability to merge another object for export. So the user selects object ...
0
votes
0answers
51 views

How to exit with keys like “ESC” or “CANC” from for loop?

I was wondering if there was a simple way to get out of a "for loop" in case it gets too long. I was thinking in a keyboard type input as the interface during this cycle is completely freezed. ...
1
vote
1answer
145 views

(Python) How to add items in context menu in 2.8?

How can I add my operator to existing right-click (context menu) in the shader editor?
0
votes
0answers
12 views

Operator Window

I currently have an operator in a script I'm developing. In this operator, I call bpy.ops.mesh.fill_grid() while in edit mode. I want to get this panel in the ...
0
votes
0answers
26 views

Object creation in modal operator

I'm currently trying to create objects from random arrays, by using timer modal operator. However the code below doesn't work, and I think I miss some knowledge of Blender: ...
0
votes
0answers
21 views

Python Add-On API: Constructing a new item on each execute()

I have a simple operator (extending bpy.types.Operator) which I'm using as a button, and I intend to have it create a new cube each time execute() is called. <...
1
vote
0answers
23 views

Cant get modifier info in execute after running modal for the first time

I am writing a script and I am having problems accessing the new modifier created in the invoke() function from the execute() function. I have tried updating both the viewlayer and the depsgraph but ...
0
votes
0answers
24 views

bpy.ops.object.datalayout_transfer() don't work in Operator

In Blender 2.8 when I run bpy.ops.object.datalayout_transfer() in a Operator I get a error "RuntimeError: Operator bpy.ops.object.datalayout_transfer.poll() failed, context is incorrect" Outsite my ...
2
votes
1answer
337 views

Context Problem in Blender 2.80 python module

I run Blender 2.80 as python module (for running on a server with Django), so there is no gui. Apparently passing the correct context doesn't seem to work for me in this case. I have tried many ...
1
vote
0answers
25 views

Automated rendering actions in modal operator is cancelled

I'm trying to render a bunch of actions with a modal operator that is called with a timer. The first action is rendered as expected, and strangely some times the second and third are rendered aswell, ...
2
votes
0answers
81 views

Subscribe to 'Finished' event of modal operator and get result of the operator

I am currently writing a python script and call a modal operator of an external addon like this: bpy.ops.uvpackmaster2.uv_pack("INVOKE_DEFAULT") My problem now is, ...
0
votes
1answer
37 views

How to show operator properties when running operator in scripts or console?

I run an operator in the console, but the operator properties are not shown in Tool Panel. However, if I run the operator from search, the properties will be shown up. How to show operator ...
0
votes
1answer
34 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 ...
0
votes
1answer
114 views

How to wait for an operation - to another operator - to complete within an operator (import_scene)

Besides the point but why is this not working as a default stack is expected to work? I'm trying to get an operator to call another operator and wait for the operator's response before proceeding. ...
1
vote
2answers
374 views

Modal Operators: Click Object Event

I'm currently working on a python tool using a modal operator. Now I know to finish the operation I can use: if event.type == 'LEFTMOUSE': return {'FINISHED'} ...
0
votes
1answer
243 views

How to display and use operator properties in a custom UI panel?

For example, as you can see in the keymap preferences, there are operators that have properties, like this Smooth Vertices: With this little code ...
0
votes
0answers
173 views

Blender 2.8 Operator Presets not working for me

So I have recently installed the recent blender 2.8, since my last 2.8 version wouldn't show me curves in the right way but now I am having issue interacting with the operator presets for add-ons. ...
2
votes
1answer
94 views

Overriding Context for bpy.ops.transform.shrink_fatten

I can't seem to get sufficient context for calling bpy.ops.transform.shrink_flatten() without this error: ...
0
votes
0answers
38 views

understanding the simple deform modifier (TAPER - FACTOR)

I'm trying to use the simple deform modifier to reproduce what the SHEAR operator does, in order to do so I'm using it in TAPER mode and locking one of the axis deformation, like that the object will ...
0
votes
0answers
31 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
32 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: ...
1
vote
0answers
77 views

Is there a way to change default values of properties of operator?

I tried this to change, but no success Any ideas?
1
vote
1answer
59 views

alternatives for operator's report() function?

it seems that the report() function of Operator type lets all other routines finish before it actually reports. this makes it useless in many instances: for example, when reporting progress on baking ...
2
votes
2answers
64 views

How Bpy.ops.mesh differs from bmesh ops

I know that Bmesh is a standalone module and bpy is an application module. But still why we have mesh related operations under bpy i.e bpy.ops.mesh , if we have bmesh? I need deep insight. Thanks
1
vote
0answers
67 views

Setting New Default Operator Preset?

I'm using Blender 2.8! I've created an operator preset for importing models. It's simple, just import everything with z-forward instead of backwards. Is there anyway to make this default? Every time ...
0
votes
0answers
510 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
49 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). ...
0
votes
0answers
36 views

Blender addon - Writing new mesh operators

Blender has a number of mesh operators, like move, rotate, scale, extrude, bevel, inset, etc. They all consistently respect Blender modes like snapping, proportionate editing, pivot point (esp. ...
1
vote
2answers
71 views

Is there a way to access a bpy.types.Operator value

I have a popup that can allow the user the set a value. I can see that the value is getting set correctly as it reports it to the console. However after the function that calls the Operator ...
1
vote
0answers
68 views

How can I modify multiple properties of an Operator in a Panel? [duplicate]

I have an operator that has properties like below ...
2
votes
0answers
289 views

Override context for operator called from panel

I have an operator, “my_operator”, that is called from a panel, as follows: ...
0
votes
0answers
37 views

How to I render this .wrl using the python api (bpy)

I have been trying to render this wrl files like this one using this code: ...
1
vote
1answer
41 views

How should operator id_remap be used?

I'm trying to use id_remap on some materials, but Blender crashes when I try to use the operator. I've tried many different ways to invoke it. Right now I have: ...
1
vote
0answers
25 views

Code works in Console, not as registered Operator

I made a scene with a cube and a sphere. The sphere has a "displace" modifier on it, which I want to apply while having the cube (or nothing at all) selected. Executing the following lines one by one ...
1
vote
1answer
394 views

How do I pass an argument to an operator that is called inside a panel?

I would like to be able to pass aarguments to operators that I am calling from panels/buttons but I do not know how to do that. At the moment I use "global" variables but they tend to make the code a ...