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 ...
Stavros Piliaris's user avatar
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 ...
Golden Dragon's user avatar
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 ...
Golden Dragon's user avatar
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 (...
nytemairqt's user avatar
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 ...
nytemairqt's user avatar
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 ...
Robin's user avatar
  • 1
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 ...
Joel Davis's user avatar
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 ...
user2971878's user avatar
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. ...
Tortenrandband's user avatar
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 ...
Leander's user avatar
  • 27.3k
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 ...
ISCREAM kevin deguisne 's user avatar
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: ...
Jake's user avatar
  • 31
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 ...
Bortroy's user avatar
  • 11
1 vote
1 answer
276 views

Fill image problem with generated_color in python, into paint workflow

After creating a new image,i know that D.images['my_image'].generated_color = (1,1,1,1) It makes the image all white, in short, it fills it ...
Noob Cat's user avatar
  • 1,269
0 votes
1 answer
54 views

How can a cube/ a group of cubes be painted?

Setup : Blender 2.82 I want to achieve something similar to what was represented below but through a python script. If each cube here represents a pixel, what is the fastest way to change its color ...
cUser's user avatar
  • 155
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 ...
George Profenza's user avatar
1 vote
0 answers
210 views

Modal not running when painting

I'm working on a feature which needs to be a modal that runs when you're painting a stroke. It then needs to repeat that stroke again. For this I'm trying to store the coordinates of the mouse when ...
Joshua Knauber's user avatar
0 votes
0 answers
327 views

Python 2.8 custom texture painting active tool

I'm working on a addon that has a custom active tool in the viewport. This tool is supposed to allow you to do basic texture painting, while at the same time doing some other stuff. My problem is, ...
Joshua Knauber's user avatar
0 votes
1 answer
2k views

How to get the correct size of the image texture in Blender 2.8 with python?

Mutant Bob already helped me a few years ago back when I was dealing with Blender Internal materials, but now I am stuck - how do I get the image size from the active image texture now that we are ...
Craig D Jones's user avatar
1 vote
0 answers
365 views

Python script to texture paint across active viewport

Can't wrap my head around the python API docs for texture painting, I've got the brush and UV mapping setup, just need to automate the brush painting across the active viewport, it doesn't need to be ...
itsmetheperson's user avatar
1 vote
1 answer
1k views

How to get name of image corresponding to active paint slot?

I understand that I can get the paint_active_slot for the active object, and that returns a number that corresponds to the position of the texture in the slot panel and in the texture panel. ...
Craig D Jones's user avatar
0 votes
2 answers
305 views

Radius and strength sliders in pie menus

How do I add the sliders (radius, strength)in texpaint to a pie menu ?
Retrax's user avatar
  • 1,520
1 vote
0 answers
290 views

C++ plugin to edit image

I'm trying to make a c++ and python plugin (something like texture paint tools), but it's too slow because I have to rewrite pixel data (bpy.data.images[0].pixels) completely after every edit. How can ...
Evgen Vasilev's user avatar
0 votes
1 answer
1k views

Is there a python api for texture painting?

Is there a means to script texture painting (cloning) in blender. I will have three uv maps, one for front , one for side and one the unwrapped mesh. I want to clone texture from the front and the ...
sreesreenu's user avatar
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 ...
John's user avatar
  • 11
3 votes
0 answers
161 views

Exporting current frame from the Movie Clip Editor

I'm making some Camera Projection mapping in Blender. The issue I have is that when I Paint my projections using the clone method (with multiple UV maps from view). It's working great except that I ...
melMass's user avatar
  • 444
2 votes
2 answers
495 views

Unable to paint texture

I referenced this tutorial to paint textures using bpy. I just replaced the Cube object with my mesh object loaded from an obj file. Rather than using all the textures I just used one of them (in code ...
user3159395's user avatar
1 vote
0 answers
137 views

UV Map Problems

I write for the importer "unreal engine vertMesh" format, and I have a problem with understanding the process of texturing and uv maps. I import model, shape keys, and then import the UV coords. <...
Vlad Kisly's user avatar
1 vote
0 answers
124 views

where is the texture paint image hiding?

How can I extract the Image(ID) I paint on from Material(ID) of the object? I've tried: bpy.data.materials['Material'].texture_slots[:] But I can see only the ...
user1095108's user avatar
7 votes
1 answer
1k views

Is there a way to save strokes while painting/sculpting?

While painting or sculpting, user draws strokes. Is there a way with python to save those (with brush parameters and pressure data) and then play them back slowly also with python? Point is to ...
matali's user avatar
  • 2,811