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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'uv_magic_uv/muv_texproj_ops.py')
-rw-r--r--uv_magic_uv/muv_texproj_ops.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/uv_magic_uv/muv_texproj_ops.py b/uv_magic_uv/muv_texproj_ops.py
index 08b1d919..7b796e81 100644
--- a/uv_magic_uv/muv_texproj_ops.py
+++ b/uv_magic_uv/muv_texproj_ops.py
@@ -20,8 +20,8 @@
__author__ = "Nutti <nutti.metro@gmail.com>"
__status__ = "production"
-__version__ = "4.3"
-__date__ = "1 Apr 2017"
+__version__ = "4.3.1"
+__date__ = "6 June 2017"
from collections import namedtuple
@@ -229,12 +229,22 @@ class MUV_TexProjProject(bpy.types.Operator):
bl_description = "Project Texture"
bl_options = {'REGISTER', 'UNDO'}
+ @classmethod
+ def poll(cls, context):
+ obj = context.active_object
+ return obj is not None and obj.type == "MESH"
+
def execute(self, context):
sc = context.scene
+ if context.mode != "EDIT_MESH":
+ self.report({'WARNING'}, "Mesh must be in Edit mode")
+ return {'CANCELLED'}
+
if sc.muv_texproj_tex_image == "None":
self.report({'WARNING'}, "No textures are selected")
return {'CANCELLED'}
+
_, region, space = muv_common.get_space(
'VIEW_3D', 'WINDOW', 'VIEW_3D')
@@ -249,6 +259,7 @@ class MUV_TexProjProject(bpy.types.Operator):
if not bm.loops.layers.uv:
self.report({'WARNING'}, "Object must have more than one UV map")
return {'CANCELLED'}
+
uv_layer = bm.loops.layers.uv.verify()
tex_layer = bm.faces.layers.tex.verify()