48 lines
1.9 KiB
Python
48 lines
1.9 KiB
Python
import bpy
|
|
import bpy.utils.images
|
|
import os
|
|
|
|
img = None
|
|
|
|
class WM_MT_splash_about_mblender(bpy.types.Menu):
|
|
bl_label = "About Tornavis"
|
|
|
|
def draw(self, context):
|
|
layout = self.layout
|
|
layout.operator_context = 'EXEC_DEFAULT'
|
|
|
|
split = layout.split(factor=0.6)
|
|
split.template_image_ui(image_value = img['id'], scale= 1)
|
|
|
|
layout.row().label(text="Tornavis - A project for giving CAD development to Blender")
|
|
|
|
row = layout.row()
|
|
row.emboss = 'PULLDOWN_MENU'
|
|
col = row.column()
|
|
col.operator("wm.url_open", text="Patreon", icon='FUND').url = "https://www.patreon.com/tornavis"
|
|
col.operator("wm.url_open", text="Credits", icon='URL').url = "https://tornavis.org/#credits"
|
|
col.operator("wm.url_open", text="License", icon='URL').url = "https://tornavis.org/#license"
|
|
col.operator("wm.url_open_preset", text="Tornavis Website", icon='URL').type = 'TORNAVIS'
|
|
|
|
def draw_mblender_about_menu(self, context):
|
|
self.layout.operator("wm.splash_custom", text=WM_MT_splash_about_mblender.bl_label).menutype='WM_MT_splash_about_mblender'
|
|
|
|
def draw_blender_doc_menu(self, context):
|
|
self.layout.operator("wm.url_open_preset", text="Tornavis Project's documentation", icon='URL').type = 'TORNAVIS_DOC'
|
|
|
|
def register():
|
|
global img
|
|
|
|
bpy.types.TOPBAR_MT_blender.append(draw_mblender_about_menu, label_referenced = "About Blender")
|
|
bpy.types.TOPBAR_MT_help.append(draw_blender_doc_menu, label_referenced = "Manual")
|
|
bpy.utils.register_class(WM_MT_splash_about_mblender)
|
|
|
|
path = os.path.join(bpy.utils.system_resource('DATAFILES', path="tornavis"), 'tornavis_logo.png')
|
|
img = bpy.utils.images.load('tornavis-logo', path)
|
|
|
|
def unregister():
|
|
global img
|
|
bpy.utils.unregister_class(AboutMBlenderOperator)
|
|
bpy.utils.unregister_class(WM_MT_splash_about_mblender)
|
|
bpy.utils.images.release(img['id'])
|