Adds a bunch of import methods

Yes I did do this code all myself and they have been looked over and modified since proposed to other addons.

The commented MMD animation importer is stashed as a comment for now till an MMD animation importer is properly created.
This commit is contained in:
989onan
2024-07-24 18:20:28 -04:00
parent f0323577c9
commit 7401ba78d5
5 changed files with 299 additions and 53 deletions
+15
View File
@@ -1,6 +1,10 @@
import bpy
import numpy as np
from .dictionaries import bone_names
import threading
import time
import webbrowser
import typing
from typing import List, Optional
from bpy.types import Object, ShapeKey, Mesh, Context
@@ -57,3 +61,14 @@ def get_armature(context, armature_name=None) -> Optional[Object]:
if obj.type == "ARMATURE":
return obj
return next((obj for obj in context.view_layer.objects if obj.type == 'ARMATURE'), None)
def open_web_after_delay_multi_threaded(delay: typing.Optional[float] = 1.0, url: typing.Union[str, typing.Any] = ""):
thread = threading.Thread(target=open_web_after_delay,args=[delay,url],name="open_browser_thread")
thread.start()
def open_web_after_delay(delay, url):
print("opening browser in "+str(delay)+" seconds.")
time.sleep(delay)
webbrowser.open_new_tab(url)