Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-10-29 15:41:17 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-10-29 15:41:17 +0300
commita05be009a5c4b8d1be4106e6e7679fbdddb4c2b5 (patch)
treedc41eb3eeaff9390f9aa7ff379e6503b62c54355 /release/scripts/modules
parent51ac654b3f07a0c486b44188eb9036e7128dd6d0 (diff)
Cleanup: remove unused object_image_guess
This made sense when we had tex-face feature, since it's removed & unused, remove this function too. D6079 by @alm
Diffstat (limited to 'release/scripts/modules')
-rw-r--r--release/scripts/modules/bpy_extras/object_utils.py41
1 files changed, 0 insertions, 41 deletions
diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py
index 151cfa84f85..9db86782d02 100644
--- a/release/scripts/modules/bpy_extras/object_utils.py
+++ b/release/scripts/modules/bpy_extras/object_utils.py
@@ -24,7 +24,6 @@ __all__ = (
"AddObjectHelper",
"object_add_grid_scale",
"object_add_grid_scale_apply_operator",
- "object_image_guess",
"world_to_camera_view",
)
@@ -225,46 +224,6 @@ def object_add_grid_scale_apply_operator(operator, context):
getattr(operator, prop_id) * grid_scale)
-def object_image_guess(obj, bm=None):
- """
- Return a single image used by the object,
- first checking the texture-faces, then the material.
- """
- # TODO, cycles/nodes materials
- me = obj.data
- if bm is None:
- if obj.mode == 'EDIT':
- import bmesh
- bm = bmesh.from_edit_mesh(me)
-
- if bm is not None:
- tex_layer = bm.faces.layers.tex.active
- if tex_layer is not None:
- for f in bm.faces:
- image = f[tex_layer].image
- if image is not None:
- return image
- else:
- tex_layer = me.uv_textures.active
- if tex_layer is not None:
- for tf in tex_layer.data:
- image = tf.image
- if image is not None:
- return image
-
- for m in obj.data.materials:
- if m is not None:
- # backwards so topmost are highest priority
- for mtex in reversed(m.texture_slots):
- if mtex and mtex.use_map_color_diffuse:
- texture = mtex.texture
- if texture and texture.type == 'IMAGE':
- image = texture.image
- if image is not None:
- return image
- return None
-
-
def world_to_camera_view(scene, obj, coord):
"""
Returns the camera space coords for a 3d point.