New answers tagged python
2
votes
Accepted
How to set a PointerPropery in an Attributes node?
Yes, it's possible, use my_pointer_prop.my_vectors
if you change the values via scripting ...
2
votes
Hide unmasked areas Blender 4.2 API
bpy.ops.paint.hide_show_masked(action='HIDE')
https://docs.blender.org/api/current/bpy.ops.paint.html#bpy.ops.paint.hide_show_masked
Hide/show all masked vertices ...
0
votes
script to clean up video sequence and adjust params (resolution, filepath, etc)
Here is an example script. Let me know if you can change/add to this first attempt.
...
1
vote
How to generate Textures without Rendering to File?
If you wanted to try using geometry to store the texture made in Geometry Nodes, you would need to have some geometry with vertices positioned in 2d space and indexed in similar way as image pixels.
...
1
vote
How to Calculate the Shadow Area Cast by One Object on Another in Blender Using Sunlight?
Assuming manifold geometry, you can elongate the shadow caster(s), and find their boolean mesh intersection with shadow receivers. Then find the surface to the front of the Sun, which you can simply ...
2
votes
Accepted
How to draw consistent dotted line similar to default blender measure tool?
Draw a screen space dash line from (0, 0, 0) to (1, 1, 1)
Fixed dash size: 5 px
gap size: 5 px
colors_len = 0: use 1 color
colors_len = 1: use 2 color
If you see the gap size and dash size changing ...
3
votes
How to set Active and Selected Object into another Scene?
Just like with the context example, you have to set the active object via the view_layer attribute of the scene. Pretty straightforward.
...
1
vote
Accepted
Adding checkbox to Output Panel
Yes, use append or prepend
e.g. bpy.types.VIEW3D_MT_view.append() or ...
0
votes
Geometry nodes Instances data export to CSV file
got the same problem,...
If u got not so dense geometry and just got 21 instances u could
make instances real and delete the geometry nodes on the instances
create the
https://www.youtube.com/watch?v=...
0
votes
Accepted
Blender 4.2: Activate extension with python?
I was able to solve my issue.
First, get the users blender addon folder so it doesn't matter what operator system the user has, then download the addon zip, extract the zip and then enable the addon.
<...
1
vote
How to generate Textures without Rendering to File?
If you bake a texture, you have the image in Blender, it is accessible through the API and is not saved to disk.
If you render an image without output to file
...
1
vote
how to select matching polygons?
You can make a Geometry Nodes tool to select by proximity of another geometry:
Don't forget to enable it for edit mode:
1
vote
Accepted
Selecting vertices with Python only works sometimes
Selecting vertices definitely works fine. You don't deselect any already selected geometry in the script though. To deselect everything, you need to deselect verts, edges and faces because they are ...
0
votes
How to display Size property in form of "number+units" in the custom operator's REDO panel?
@XY has answered my question in the comments, but for some reason hasn't posted it as a full answer.
So, here is the solution (kudos to XY) :
FloatProperty (as any ...
0
votes
Rna subtype iterative redefining
I found an alternative route to tracing executions, it stems ironically from halting the UI entirely.
Just registering a class to invoke(self,context,event) with <...
0
votes
I want to make a transparent block using Blender Python in Blender 4.3
My apologies, I answered my own question but not in the correct manner.
Short answer: it was not the code but the values in the right-hand panes Settings, Scene and Render.
Step by step I have ...
4
votes
Accepted
Why does the color of the UI set by FloatVectorProperty appear inconsistent?
use subtype = "COLOR_GAMMA"
https://docs.blender.org/api/current/bpy_types_enum_items/property_subtype_number_array_items.html#rna-enum-property-subtype-...
0
votes
Not possible to render using optix via bpy in docker image
I found the solution to the problem. I was missing the shared libraries libnvoptix as well as the rtcore library. Once I copied those over it works. Note that copying over is probably not the right ...
0
votes
Using 3rd party Python modules
I tried all the other answers, and they mostly didn't work. The main issue I was facing is that I needed something that I could run without administrative privileges. In particular, I needed ...
2
votes
How to add UI element to a Modifier
Modifier UI is not accessible via Python API. It is not possible to add anything to a panel of a modifier in the Properties editor, Modifier tab using Python.
You can create various types of inputs ...
2
votes
How to change paint brush in Blender 4.3 with python?
The problem is not related to Blender's version.
You did right actions but in the wrong order.
It should be:
bpy.ops.object.mode_set(mode='TEXTURE_PAINT')
...
1
vote
Accepted
Display image in addon
You can use the icon_id of the image with bpy.types.UILayout.icon
This code will display the image icon of the size you want, from the image bpy.data.images
...
1
vote
Accepted
How to open the Manage Unused Data window using python code?
After a bit of trial&error I found that you must call the operator with the special INVOKE_AREA parameter.
...
1
vote
How to get the orientation normal vector to align the camera?
It's not a python solution (you've tagged your question as python).
Select the plane (or the face of the plane in Edit mode if the origin of the plane is not aligned with the face), open the Transform ...
1
vote
1
vote
Accepted
knife_project context
view3d_area.spaces.active.region_3d.update() needs to be called after updating the view with bpy.ops
1
vote
Custom Blender Addon: How to make an input prompt?
You can define bl_property and then a string property inside an operator using the same name, then use invoke function to return a pop-up (...
4
votes
Accepted
How to Connect all Sockets of a Node Group to the Group Input Node in one click
1. Paste to Text Editor and hit the run button
...
1
vote
Accepted
How can I set the active category in the "N" panel?
In blender 4.2 they added the ability to change and set categories. There is another option, through ctypes, it is implemented in my addon UniV, in the operator SplitUVToggle, but it is too complex ...
1
vote
bpy.ops.console.scrollback_append RuntimeError context is incorrect when called from SimpleOperator template
overriding the context of a bpy operator changed, there is now bpy.context.temp_override in blender 4.2+ specifically for changing the window, screen, and area context items.
for example, to ...
2
votes
Accepted
Merge by Distance/remove_double removes 0 vertices when scripted with bpy
Your problem is caused by altered unit scale, which apparently you have to use to recalculate the distances on your own:
...
0
votes
Accepted
How to selecting Principled BSDF node in the shader of the selected object if blender is not set in English
It depends on the situation how you select the node you need. You could loop through nodes until you find the right type:
...
2
votes
Accepted
How to open/edit a node group in a new window via python?
Edit Node Group in new window (Shading node groups only)
...
1
vote
Installing blender from file
TL;DR
Run these commands after extracting blender in /usr/local:
...
Top 50 recent answers are included
Related Tags
python × 13485scripting × 4884
add-on × 1241
game-engine × 666
animation × 652
interface × 633
mesh × 625
rendering × 490
objects × 445
operator × 436
properties × 426
materials × 392
node-editor × 390
bmesh × 311
modifiers × 281
transforms × 268
export × 262
vertices × 260
camera × 243
drivers × 239
3d-view × 236
import × 236
armature × 230
uv × 229
command-line × 227