UV_OT_lightmap_pack: Distinction between edit and object modes
I don't even know why this operator was ever made to work in object mode. That said, since it does, we should have different options for it (or rather, always do all faces for it).
This commit is contained in:
parent
2b83b36a30
commit
5dbf9e09a8
|
@ -647,11 +647,35 @@ class LightMapPack(Operator):
|
|||
default=0.1,
|
||||
)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
is_editmode = context.active_object.mode == 'EDIT'
|
||||
if is_editmode:
|
||||
layout.prop(self, "PREF_CONTEXT")
|
||||
|
||||
layout.prop(self, "PREF_PACK_IN_ONE")
|
||||
layout.prop(self, "PREF_NEW_UVLAYER")
|
||||
layout.prop(self, "PREF_APPLY_IMAGE")
|
||||
layout.prop(self, "PREF_IMG_PX_SIZE")
|
||||
layout.prop(self, "PREF_BOX_DIV")
|
||||
layout.prop(self, "PREF_MARGIN_DIV")
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
ob = context.active_object
|
||||
return ob and ob.type == 'MESH'
|
||||
|
||||
def execute(self, context):
|
||||
kwargs = self.as_keywords()
|
||||
PREF_CONTEXT = kwargs.pop("PREF_CONTEXT")
|
||||
|
||||
if PREF_CONTEXT == 'SEL_FACES':
|
||||
is_editmode = context.active_object.mode == 'EDIT'
|
||||
|
||||
if not is_editmode:
|
||||
kwargs["PREF_SEL_ONLY"] = False
|
||||
elif PREF_CONTEXT == 'SEL_FACES':
|
||||
kwargs["PREF_SEL_ONLY"] = True
|
||||
elif PREF_CONTEXT == 'ALL_FACES':
|
||||
kwargs["PREF_SEL_ONLY"] = False
|
||||
|
|
Loading…
Reference in New Issue