(self)
| 21 | # 2.3. 注意:script_main 此方法是脚本执行入口必须存在此方法 |
| 22 | # 2.3. Note: script_main This method must exist in the script execution portal. |
| 23 | def script_main(self): |
| 24 | |
| 25 | # 初始化数字人 |
| 26 | self.init_new_metahuman(r"D:\Project\Aibote\2024-4-11\NewHuman\model", 0.5, False, False, "") |
| 27 | |
| 28 | # 切换数字人形象 |
| 29 | self.new_metahuman_switch_action(r"D:\Project\Coding\PyAibote\1.mp4", 1.8, False, False, False) |
| 30 | |
| 31 | # 添加数字人背景 |
| 32 | # self.new_metahuman_add_background(r"D:\Project\CompanyInformation\PaidItem\DigitalHuman\Static\Backgroun\1.mp4") |
| 33 | |
| 34 | |
| 35 | # 关闭驱动 方法一 |
| 36 | # os.popen('taskkill /f /t /im "AiDriver.exe"') |
| 37 | |
| 38 | # 关闭驱动 方法二 终端直接输入 |
| 39 | # taskkill /f /t /im "AiDriver.exe" |
| 40 | |
| 41 | # 关闭驱动 方法三 驱动端关闭 [适用于多进程开发] |
| 42 | # result = self.new_metahuman_close_driver() |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | # 主函数死循环时数字人驱动连接断开异常捕获跳出死循环demo示例代码 |
| 48 | # while True: |
| 49 | # try: |
| 50 | # # 死循环中必须加入aibote函数代码 |
| 51 | # result = self.new_metahuman_get_windows_id() |
| 52 | # print("我是个死循环") |
| 53 | # time.sleep(2) |
| 54 | |
| 55 | # # 服务端捕获客户端断开异常跳出线程循环结束连接 |
| 56 | # except OSError as e: |
| 57 | # break |
| 58 | |
| 59 | # # 捕获其他非连接断开异常 |
| 60 | # except Exception as e: |
| 61 | # print(e) |
| 62 | |
| 63 | |
| 64 | # 关闭驱动 方法一 |
| 65 | # os.popen('taskkill /f /t /im "AiDriver.exe"') |
| 66 | |
| 67 | # 关闭驱动 方法二 终端直接输入 |
| 68 | # taskkill /f /t /im "AiDriver.exe" |
| 69 | |
| 70 | # 关闭驱动 方法三 驱动端关闭 [适用于多进程开发] |
| 71 | # result = self.new_metahuman_close_driver() |
| 72 | |
| 73 | |
| 74 |
nothing calls this directly
no test coverage detected