[feat] promote experience about floor creation.

- change bl_options and rewrite invoke and draw functions to let floor creating window become more visual. credit: BLumia.
- also change 3ds max align and flatten uv presentation after changing creating floor window.
- seperate icon loader/unload module.
This commit is contained in:
2023-01-27 16:28:32 +08:00
parent ef459a210d
commit 9b9fc9cde8
6 changed files with 90 additions and 41 deletions

View File

@ -6,7 +6,7 @@ class BALLANCE_OT_flatten_uv(bpy.types.Operator):
"""Flatten selected face UV. Only works for convex face"""
bl_idname = "ballance.flatten_uv"
bl_label = "Flatten UV"
bl_options = {'UNDO'}
bl_options = {'REGISTER', 'UNDO'}
reference_edge : bpy.props.IntProperty(
name="Reference edge",
@ -20,7 +20,7 @@ class BALLANCE_OT_flatten_uv(bpy.types.Operator):
@classmethod
def poll(self, context):
obj = bpy.context.active_object
if obj == None:
if obj is None:
return False
if obj.type != 'MESH':
return False
@ -28,17 +28,16 @@ class BALLANCE_OT_flatten_uv(bpy.types.Operator):
return False
return True
"""
def invoke(self, context, event):
wm = context.window_manager
return wm.invoke_props_dialog(self)
"""
def execute(self, context):
no_processed_count = _real_flatten_uv(bpy.context.active_object.data, self.reference_edge)
if no_processed_count != 0:
UTILS_functions.show_message_box(
("{} faces may not be processed correctly because they have problem.".format(no_processed_count), ),
"Warning", 'ERROR'
)
print("[Flatten UV] {} faces may not be processed correctly because they have problem.".format(no_processed_count))
return {'FINISHED'}
def draw(self, context):