Skip to main content

All Questions

0 votes
0 answers
20 views

Ray_casting from curve origins doesn't hit any part of the mesh

The terminal prints none, which I guess means the raycast is not hitting anything. To replicate this output. Run the script and navigate to its sidebar in the viewport, select the two nerve curves and ...
3 votes
1 answer
408 views

How to draw text and shapes to a Texture?

Using Python I'm trying to generate a texture with a few lines and text. I've got a proof of concept using Pillow and a function to convert from PIL Image to Blender Image, but I would like to avoid ...
0 votes
1 answer
43 views

Is there a way to change the active texture in texture paint mode using Python?

Is there a way to access the variable that is responsible for the active texture of a certain material for texture painting and change it? It is better to use the image variable itself and not an ...
4 votes
1 answer
256 views

Save Edited (Texture Paint) Image Sequence

I load an image texture (of 3 frames) as a material node. I draw on all (3) frames in texture paint mode. I want to save all modified images at once, preferably with python. How can I save all images ...
0 votes
1 answer
33 views

How can I add custom section panel to the Texture Paint Properties?

I’m trying to add custom panel to the Texture Paint tools on the Properties tab, it’s suppoesd to be a simple task, but from some reason it’s doesn’t really work. I think the problem is on the ...
3 votes
1 answer
906 views

Extract Palette from image - how to define the number of colors?

Image editor allows you to extract a palette via Image-->extract Palette. Is there a way to set the number of color the image gets reduced to? Python gives you a threshold value at least. ...
1 vote
0 answers
74 views

How can I Use 2D Texture Paint in 3D View (Python)?

The 3D Fill tool fills the entire texture, while the 2D one respects different values within the image (only fills clicked sections). As a workaround I need to split the window and open Image Editor (...
1 vote
1 answer
99 views

Texture Paint a straight Line using Python

Refactoring this post to simplify the request: I need to draw a straight line/continuous Stroke in Python with Texture Paint. Unfortunately it is currently only placing a single dot at either end of ...
0 votes
1 answer
137 views

Issues with using painting tools via python script

I am trying to apply colour to an object with a python script. I have found several other posts that were also struggling with this. However, their solutions didn’t fix my problem. Drawing on the ...
0 votes
1 answer
104 views

Scripting which image is active in Single Image Paint mode?

i'm doing some scripting with the texture paint mode, basically calling bpy.ops.paint.project_image on multiple layers. It's working fine, except I can't figure out ...
4 votes
1 answer
559 views

Blender 3 scripting: texture drawing

How do I instantiate objects in Blender 3? I am trying to programmatically draw on a mesh's texture. According to the docs, the function to call is ...
2 votes
0 answers
231 views

Stencil Texture : How to align it exaclty to the camera region by code?

I'm doing texture mapping with tracked stencil video texture. The probleme is that I cannot place the stencil exatly at the size of the camera vieport/region when looking from the camera. I have tried ...
0 votes
1 answer
445 views

Fill a UDIM tile with python API

I'm working on an addon that requires me to generate and fill UDIM tiles in a texture with the python API, however I am stuck at the point of filling the tile. The following code creates a new tiled ...
3 votes
0 answers
603 views

Texture Painting in Blender with Python script

I can Sculpt using Python but am having trouble getting Texture Painting to work. Here is a working example of Sculpting: ...
1 vote
1 answer
615 views

Incorrect Context bpy.ops.paint.image_paint(mode='NORMAL', stroke=None)

can somebody help me figuring out what the correct context of the image_paint operator is? I thought it needed to be the VIEW_3D Area with ...

15 30 50 per page