1
$\begingroup$

What causes, in the script below, the error given in the title?

if mat.texture_slots[0] == None:
    tex = target_object.material.texture_slots.add()

    tex.texture = bpy.data.texture.new(target_object.name, type='IMAGE')

    tex.texture_coords = 'UV'
# target_object.texture = bpy.ops.texture.new()

    new_image = bpy.data.images.load(image_filename)
$\endgroup$
1
$\begingroup$

Material.texture_slots is only available for blender internal render.

How to add a Texture to a Material using Python?

$\endgroup$
1
  • $\begingroup$ I'm getting this in the effort to create an old importing plugin for 2.8. Thank you for the pointer. I know nothing about Blender internals. This is the ultimate "just in time learning" project!! $\endgroup$
    – Bob Denny
    May 1 '20 at 0:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.