Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
0
votes
0
answers
40
views
Snap context override on 2.8x
Is there any way to override “object_bases” and “active_base” in order to limit snap to some objects ? … But looks like python context “view_layer” doesn’t expose any of them. …
2
votes
0
answers
1k
views
How to use "Context Override" on the "Disable and Keep Transform" operator?
I found the operator: bpy.ops.constraint.disable_keep_transform()
and I know you should be able to use "Context Override" on the operator to feed it the appropriate context
(found here: https://docs.blender.org … but I havn't been able to find much information about how these operators and the "Context Override" works. …
0
votes
1
answer
73
views
Trying to bake sound with a context override through Python
I'm trying to override the context so I can run bpy.ops.graph.sound_bake() but for some reason I can't get the context right. The code is below, as well as the stack trace. What am I doing wrong? … Python\Python310\lib\site-packages\bpy\3.6\scripts\modules\bpy\ops.py", line 113, in __call__
ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.graph.sound_bake.poll() failed, context …
7
votes
1
answer
1k
views
Override context for operator called from panel
):
layout = self.layout
scene = context.scene
row = layout.row()
row.operator('object.my_operator', text='Activate')
This works fine, but I need to override the context when calling … bl_idname = "object.dummy"
bl_label = "Dummy"
bl_options = {'REGISTER'}
def execute(self, context):
screen = context.screen
override = bpy.context.copy()
# Update the context …
11
votes
2
answers
7k
views
How do I override context for bpy.ops.mesh.loopcut?
As far as I can tell, the context I'm passing in as an override gets passed to the C side of things as python specific context contained in a data pointer of some sort (I haven't investigated enough to … When the poll function gets called for the operator it gets the context indicating a TEXT space instead of a 3D view space so it fails. It appears that the override isn't happening. …
0
votes
0
answers
171
views
Can override context be used to select which objects are rendered?
I found the (kinda minimalistic) documentation about overriding contexts here: https://docs.blender.org/api/current/bpy.ops.html#overriding-context
Unfortunately, it only explains how to override setting … Specifically, I want to override which objects are rendered using
bpy.ops.render.render()
usage could look something like this
override = context.copy()
override["render_objects"] = list(obj1, obj2, …
1
vote
0
answers
424
views
How do I override context for new OBJ Importer? (bpy.ops.wm.obj_import)
I keep getting the error:
RuntimeError: Operator bpy.ops.wm.obj_import.poll() failed, context is incorrect
Looking at the Blender source code (source/blender/editors/io/io_obj.cc#L488), I've found that … I'm not sure how to override the context. How can I override the context for this specific case? Or what workarounds might exist? …
0
votes
1
answer
68
views
How to override context area using script when running Blender using Command Line
I tried common way to override the context using:
import bpy
def get_view3d():
if bpy.context.area.type ! … ,
The goal is I can use another bpy.ops that needs a specific active context. …
2
votes
1
answer
1k
views
How to override context to launch 'ops' commands in Text Editor 3.2
But I can't override the context correctly.
The documentation doesn't clarify much. I'm following this code example, which works as expected. … override = bpy.context.copy()
override['space_data'] = bpy.data.texts['text_to_run.py']
with bpy.context.temp_override(**override):
bpy.ops.text.reload() …
1
vote
2
answers
2k
views
What is the correct context for applying a new particle setting or override it?
I know there is a "Button context" called "bpy.context.particle_settings", but I don't know what to do with that.
What context do I need to apply new particle settings to work (and how)? … or how can I override the context? …
4
votes
2
answers
299
views
How can I run/execute a text block from within Python with the new temp context override syn...
Now in 4.0, passing in context overrides has been depricated in favor of Context.temp_override.
How would I execute this code in 4.0 and beyond? …
3
votes
1
answer
500
views
Why cannot I override the context for bpy.ops.object.origin_set()
I ran the following code to reset the origin of Cube:
import bpy
# set selection
bpy.data.objects["Cube"].select = False
bpy.data.objects["Plane"].select = True
# override context
override = bpy.context.copy … ()
override["selected_bases"] = [bpy.data.scenes[0].object_bases["Cube"]]
override["active_base"] = bpy.data.scenes[0].object_bases["Cube"]
bpy.ops.object.origin_set(override) # works on Plane
bpy.ops.transform.translate …
0
votes
0
answers
3k
views
How do I fix bpy.ops.object.mode_set.poll() failed, context is incorrect?
I checked out all the bpy.context and context override and bpy.ops posts and documents and i still can't make these 2 ops work :( I do not understand why they need special context. … toggle=False)
File "C:\BLENDER_28\2.80\scripts\modules\bpy\ops.py", line 200, in __call__
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.object.mode_set.poll() failed, context …
2
votes
1
answer
347
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:
RuntimeError: Operator bpy.ops.transform.shrink_fatten.poll() failed, context is incorrect
I've … override = context.copy()
for area in context.screen.areas:
if area.type == 'VIEW_3D':
override["area"] = area
override["space_data"] = area.spaces.active
override["region …
1
vote
0
answers
17
views
How to properly override bpy.ops.node.backimage_fit()?
I need some help calling bpy.ops.node.backimage_fit(), I cannot find the proper context override
screen = bpy.context.screen
for area in screen.areas:
if area.type == "NODE_EDITOR":
windows …