forked from bartvdbraak/blender
bugfix for [#6818] object_find.py assumes active uv layer is set
was assuming meshes had UVs
This commit is contained in:
parent
4d2cbdb038
commit
22e6e836fa
@ -41,20 +41,27 @@ import BPyMessages
|
|||||||
|
|
||||||
def get_object_images(ob):
|
def get_object_images(ob):
|
||||||
# Could optimize this
|
# Could optimize this
|
||||||
if ob.type == 'Mesh':
|
if ob.type != 'Mesh':
|
||||||
unique_images = {}
|
return []
|
||||||
me = ob.getData(mesh=1)
|
|
||||||
orig_uvlayer = me.activeUVLayer
|
|
||||||
|
|
||||||
for uvlayer in me.getUVLayerNames():
|
me = ob.getData(mesh=1)
|
||||||
me.activeUVLayer = uvlayer
|
|
||||||
for f in me.faces:
|
|
||||||
i = f.image
|
|
||||||
if i: unique_images[i.name] = i
|
|
||||||
|
|
||||||
me.activeUVLayer = orig_uvlayer
|
if not me.faceUV:
|
||||||
|
return []
|
||||||
|
|
||||||
return unique_images.values()
|
unique_images = {}
|
||||||
|
|
||||||
|
orig_uvlayer = me.activeUVLayer
|
||||||
|
|
||||||
|
for uvlayer in me.getUVLayerNames():
|
||||||
|
me.activeUVLayer = uvlayer
|
||||||
|
for f in me.faces:
|
||||||
|
i = f.image
|
||||||
|
if i: unique_images[i.name] = i
|
||||||
|
|
||||||
|
me.activeUVLayer = orig_uvlayer
|
||||||
|
|
||||||
|
return unique_images.values()
|
||||||
|
|
||||||
# Todo, support other object types, materials
|
# Todo, support other object types, materials
|
||||||
return []
|
return []
|
||||||
|
Loading…
Reference in New Issue
Block a user