#!/usr/bin/env python # -*- coding: utf-8 -*- """ 版权所有: 清泉时代科技有限公司 联系方式: q.100@qq.com 创建日期: 2023/08/08 """ import os import maya.cmds as cmds def sg_demo_help(help_name): """ 显示Super Animation演示帮助窗口 参数: help_name (str): 帮助图片的名称 """ # 如果窗口已存在则删除 if cmds.window('demoHelpImageWin', exists=True): cmds.deleteUI('demoHelpImageWin') # 创建新窗口 cmds.window( 'demoHelpImageWin', title="Super Animation Demo Help" ) # 获取环境变量中的路径 path = os.environ.get('SG_PATH') image_path = os.path.join(path, 'images', 'ARKit', f'{help_name}.png') # 创建布局 cmds.formLayout('demoHelpFormLayout', width=610, height=800) # 创建滚动布局 scroll_layout = cmds.scrollLayout('asDemoHelpImage') form_layout_b = cmds.formLayout('asDemoHelpFormLayoutB') # 添加图片 cmds.image(image=image_path) # 返回上级布局 cmds.setParent('..') cmds.setParent('..') # 设置窗口大小 cmds.window('demoHelpImageWin', edit=True, widthHeight=(804, 580)) # 设置布局附着 cmds.formLayout( 'demoHelpFormLayout', edit=True, attachForm=[ ('asDemoHelpImage', 'right', 0), ('asDemoHelpImage', 'left', 0), ('asDemoHelpImage', 'top', 0), ('asDemoHelpImage', 'bottom', 0) ] ) # 显示窗口 cmds.showWindow('demoHelpImageWin')