2020-07-12 21:04:38 +08:00
|
|
|
import bpy
|
2020-09-03 13:57:06 +08:00
|
|
|
from bpy_extras.io_utils import unpack_list
|
2020-07-12 21:04:38 +08:00
|
|
|
|
2020-10-07 15:20:51 +08:00
|
|
|
def ShowMessageBox(message, title, icon):
|
2020-07-12 21:04:38 +08:00
|
|
|
|
|
|
|
def draw(self, context):
|
2020-10-07 15:20:51 +08:00
|
|
|
layout = self.layout
|
|
|
|
for item in message:
|
|
|
|
layout.label(text=item, translate=False)
|
2020-07-12 21:04:38 +08:00
|
|
|
|
2020-09-03 13:57:06 +08:00
|
|
|
bpy.context.window_manager.popup_menu(draw, title = title, icon = icon)
|
2020-10-08 13:07:43 +08:00
|
|
|
|
|
|
|
def AddSceneAndMove2Cursor(obj):
|
2020-10-10 11:11:08 +08:00
|
|
|
Move2Cursor(obj)
|
2020-10-08 13:07:43 +08:00
|
|
|
|
|
|
|
view_layer = bpy.context.view_layer
|
|
|
|
collection = view_layer.active_layer_collection.collection
|
|
|
|
collection.objects.link(obj)
|
2020-10-10 11:11:08 +08:00
|
|
|
|
|
|
|
def Move2Cursor(obj):
|
|
|
|
obj.location = bpy.context.scene.cursor.location
|