uhlik / bpy

blender python scripts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UVTEX not working through API

anthonySemaan01 opened this issue · comments

Hello,

I am trying to generate point clouds with UVTEX color using the API.
I am doing the following to give the texture the the active object:
image

On the GUI, the mesh is given the texture but when I am trying to generate the colors using UVTEX I am getting "cannot find active image texture in active material

Thank you for your help

commented

hi, don't know what pcv version you got, but i always require to have image texture node selected and active. you can have multiple texture nodes and this is the way to say which to use. so in script deselect all nodes

for n in nodes:
    n.select = False

and then find reference to image texture node n, set selected and active

n.select = True
nodes.active = n