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
0answers
13 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
10 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
107 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
15 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
35 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
27 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
26 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
33 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. ...
0
votes
0answers
13 views

Running Modal Operator based on condition: Is this legit?

I am using a Modal Operator in my add-on and would like to know if it is a bad idea to use the same Operator sometimes modal and sometimes directly: ...
1
vote
2answers
56 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
74 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
48 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
46 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
19 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
25 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
21 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
55 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
40 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 ...
1
vote
2answers
31 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
31 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
306 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
33 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
24 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
1answer
45 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
47 views

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

I have an operator that has properties like below ...
1
vote
0answers
168 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
27 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
29 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
229 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 ...
0
votes
0answers
38 views

How to check from the script that modal operator is running?

Or at least it would be great if there is any way to know that modal operator was cancelled
1
vote
1answer
93 views

Can't get the active_object in Operator

I try to get the active object by "bpy.context.scene.objects.active" in my operator, but I receive a error 'Context' object has no attribute 'objects', what's wrong?My scripts is as follow: ...
0
votes
1answer
119 views

Blender Python: Running multiple timers

I have a bit of a weird problem that I simply cannot seem to get around. I want to run 2 timers, each set to a different interval. The problem that I'm having is that both classes receive each others ...
1
vote
1answer
187 views

Trying to make a pie menu with custom operator

Trying to understand how i can add the operator i made to a pie menu for me to use, when i run it nothing shows. Treat me like a noob at coding, thank you for your time ...
0
votes
0answers
40 views

Calling bpy.ops.wm.revert_mainfile() operator multiple times in one script

I have a script which iterates over objects in the scene. Each iteration removes the rigid body property from the given object (bpy.ops.rigidbody.object_remove()), ...
0
votes
0answers
408 views

How can I use a boolean property inside of a custom operator class?

Hi Blender/Python users, I am working on an add-on where I'm trying to make an operator class as a button that runs a different set of commands depending on whether custom boolean properties are ...
0
votes
2answers
60 views

Keep getting .poll() Context is Incorrect Error even though I set the correct context

I keep getting "Context is incorrect" errors even though I use an override. Here is the .blend: http://pasteall.org/blend/index.php?id=50312 It has one of my models I am coding some Animation ...
0
votes
0answers
21 views

Get operator information while user is doing operator

In my example I am working with a resizing operator, bpy.context.active_operator.properties.value[0] Gives the x-scale, and so on. However, the scale operator ...
0
votes
1answer
417 views

How to create toggle button use python in blender

I want to make a toggle button for my custom operator. It works similar to checkbox: once the button is clicked, the operator keeps running until the button gets another click, so will the button ...
0
votes
0answers
51 views

How to access the operator instance members?

I'm testing Blender's scripting, with this simple operator from the documentation: ...
1
vote
1answer
104 views

Get an executable list of executed operators in python

What is it for: I’m writing an addon for blender which will have to store operators that have been executed since a custom button has been pressed, until another button is pressed. What do I need: If ...
0
votes
0answers
47 views

Good practice to develop Blender Addon : Execute/Invoke command (INVOKE DEFAULT, FINISHED, etc.)

How can I use the "execution content" at the end of execute/invoke command (INVOKE_DEFAULT, FINISHED) ? (https://docs.blender.org/api/blender_python_api_2_63_17/bpy.ops.html#execution-context) Could ...
0
votes
0answers
28 views

Good practice to develop Blender Addon : Objects and operations

I understand there is many kinds of "objects". The objects themselves such as cube, sphere, etc. (that are meshes), lights and camera, but also particle emitters, materials, node_tree, etc. The first ...
0
votes
0answers
124 views

Commands from serial port to blender controls

I'd like to make some extra keyboard on Arduino to send some commands to Blender. Some commands just duplicating existing shortcuts, some of them I need to start custom python scripts during ...
1
vote
0answers
190 views

object set_origin not working

I have been looking at similar questions yet the following script is not returning any error but the origin of the object is not changed. What did I not set right? The context seems ok since I have ...
1
vote
0answers
20 views

What do bl_undo_group and bl_translation_context properties do?

Both Operator and Macro struct's have the properties: bl_undo_group bl_translation_context Other than being string values no other information seems available for these properties. Can anyone ...
1
vote
0answers
94 views

Cancel Blender operators from python

Is it possible to cancel a recently run operator from a handler, if it fails to pass some condition? I basicaly want to restrict some objects which have a custom property from editing, so I want to ...
2
votes
1answer
128 views

How to extend an Operator

I tried to extend my own Operator but it doesn't work. What am I doing wrong? If I add this operator I get "Test" ...
1
vote
1answer
94 views

Python: How to select one 'BoolVectorProperty' value at a time unless 'shift' key is held

I am trying to overwrite the bpy.ops.object.move_to_layer operator in Blender so that I can move other objects when the selected objects are moved. When I try to ...
3
votes
1answer
168 views

Why are these buttons performing the same operation?

I'm writing a simple script that will help me use Blender better. One script sets everything up that's needed for retopology. The second just makes a hexagon and fan fills its face. Individually, I ...