1

Ok, so I've written an addon that allows me to import an image as a plane, and then subdivides that plane based on the dimensions of the image. Now though, I need the script to select all of the subdivided faces that are transparent (the alpha pixels of the imported texture) and delete them.

Select faces: enter image description here

Delete faces: enter image description here

Deleting the faces once they are selected is obviously very simple, but unfortunately it seems that due to the fact that all of the faces are using the same material identifying the transparent faces isn't quite as simple. Does anyone have any advice?

If it helps, this is what I am trying to accomplish (ignoring the bad UVs for now): enter image description here

As you can see I need to get rid of the transparent faces before extruding. Thanks in advance!

Jacob H.
  • 11
  • 1
  • If the faces have been assigned all the same material then can't you just select these faces with bpy.ops.object.material_slot_select()? Of course, first, you have to figure out which material slot has the transparent material in it and set the material index in the context to this slot (e.g. bpy.context.object.active_material_index = 1). – Blunder Feb 24 '23 at 19:27
  • 1
    Hard to say without seeing the script, but wouldn't it be easier if you didn't spawn these cubes in the first place ? Seems like you want something like this https://blender.stackexchange.com/q/205539/86891 – Gorgious Feb 25 '23 at 10:46

0 Answers0