Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| eeb41dec40 | |||
| 10fb112de7 | |||
| c532e2a6a0 | |||
| 4df5369cbb | |||
| 36550a42e5 | |||
| 2dc3a19283 | |||
| 30115eeaac | |||
| 285c331f79 | |||
| 57ded41f2f | |||
| 948b1bb352 | |||
| 9104bfae67 | |||
| 6d71669849 |
@@ -11,6 +11,9 @@ Join the Neoneko Discord here: https://discord.catsblenderplugin.xyz
|
|||||||
|
|
||||||
Need a more stable toolset while Avatar Toolkit is in Alpha? Then please use Blender 4.x and use our Unofficial Cats Blender Plugin which you can find [here](https://github.com/unofficalcats/Cats-Blender-Plugin-Unofficial-).
|
Need a more stable toolset while Avatar Toolkit is in Alpha? Then please use Blender 4.x and use our Unofficial Cats Blender Plugin which you can find [here](https://github.com/unofficalcats/Cats-Blender-Plugin-Unofficial-).
|
||||||
|
|
||||||
|
### Support us:
|
||||||
|
If you like what we do and want to help support the development of cats you can do it on our pally.gg [here](https://pally.gg/p/teamneoneko) all money is split automatically between all developers and any support is appreciated.
|
||||||
|
|
||||||
## Blender version support policies.
|
## Blender version support policies.
|
||||||
|
|
||||||
You can find them on the wiki here [HERE](https://avatartoolkit.xyz/wiki.html?version=0.1.0#what-is-avatar-toolkits-version-support-policy)
|
You can find them on the wiki here [HERE](https://avatartoolkit.xyz/wiki.html?version=0.1.0#what-is-avatar-toolkits-version-support-policy)
|
||||||
|
|||||||
+17
@@ -1,7 +1,24 @@
|
|||||||
|
import bpy
|
||||||
|
from bpy.app.handlers import persistent
|
||||||
|
|
||||||
modules = None
|
modules = None
|
||||||
ordered_classes = None
|
ordered_classes = None
|
||||||
|
|
||||||
|
def show_version_error_popup():
|
||||||
|
def draw(self, context):
|
||||||
|
self.layout.label(text="Sorry, this version of Avatar Toolkit does not work on this version of Blender.")
|
||||||
|
self.layout.label(text="Please check the GitHub repository for the correct version for your Blender.")
|
||||||
|
self.layout.operator("wm.url_open", text="Open GitHub Repository").url = "https://github.com/teamneoneko/Avatar-Toolkit"
|
||||||
|
|
||||||
|
bpy.context.window_manager.popup_menu(draw, title="Avatar Toolkit Version Error", icon='ERROR')
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
|
# Check Blender version first
|
||||||
|
version = bpy.app.version
|
||||||
|
if version[0] > 4 or (version[0] == 4 and version[1] > 3):
|
||||||
|
show_version_error_popup()
|
||||||
|
return
|
||||||
|
|
||||||
# Add wheel installation check
|
# Add wheel installation check
|
||||||
try:
|
try:
|
||||||
import lz4
|
import lz4
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
schema_version = "1.0.0"
|
schema_version = "1.0.0"
|
||||||
|
|
||||||
id = "avatar_toolkit"
|
id = "avatar_toolkit"
|
||||||
version = "0.1.2"
|
version = "0.1.3"
|
||||||
name = "Avatar Toolkit"
|
name = "Avatar Toolkit"
|
||||||
tagline = "A modern tool for importing and optimizing models for VRChat, Resonite, and other similar games."
|
tagline = "A modern tool for importing and optimizing models for VRChat, Resonite, and other similar games."
|
||||||
maintainer = "Team NekoNeo"
|
maintainer = "Team NekoNeo"
|
||||||
|
|||||||
+77
-6
@@ -17,11 +17,17 @@ from typing import Dict, List, Tuple, Optional, Set, Any
|
|||||||
|
|
||||||
GITHUB_REPO = "teamneoneko/Avatar-Toolkit"
|
GITHUB_REPO = "teamneoneko/Avatar-Toolkit"
|
||||||
|
|
||||||
|
# Define which version series this installation can update to
|
||||||
|
# For example: ["0.1"] means only look for 0.1.x updates
|
||||||
|
# ["0.2", "0.3"] would look for both 0.2.x and 0.3.x updates
|
||||||
|
ALLOWED_VERSION_SERIES = ["0.1"] # Change this based on which version you're building
|
||||||
|
|
||||||
is_checking_for_update: bool = False
|
is_checking_for_update: bool = False
|
||||||
update_needed: bool = False
|
update_needed: bool = False
|
||||||
latest_version: Optional[str] = None
|
latest_version: Optional[str] = None
|
||||||
latest_version_str: str = ''
|
latest_version_str: str = ''
|
||||||
version_list: Optional[Dict[str, List[str]]] = None
|
version_list: Optional[Dict[str, List[str]]] = None
|
||||||
|
last_manual_check_time: float = 0
|
||||||
|
|
||||||
main_dir: str = os.path.dirname(os.path.dirname(__file__))
|
main_dir: str = os.path.dirname(os.path.dirname(__file__))
|
||||||
downloads_dir: str = os.path.join(main_dir, "downloads")
|
downloads_dir: str = os.path.join(main_dir, "downloads")
|
||||||
@@ -34,7 +40,9 @@ class AvatarToolkit_OT_CheckForUpdate(bpy.types.Operator):
|
|||||||
bl_options = {'INTERNAL'}
|
bl_options = {'INTERNAL'}
|
||||||
|
|
||||||
def execute(self, context: bpy.types.Context) -> Set[str]:
|
def execute(self, context: bpy.types.Context) -> Set[str]:
|
||||||
|
global last_manual_check_time
|
||||||
check_for_update_background()
|
check_for_update_background()
|
||||||
|
last_manual_check_time = time.time() # Reset the timer on manual check
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
@@ -80,7 +88,16 @@ class AvatarToolkit_PT_UpdaterPanel(bpy.types.Panel):
|
|||||||
bl_options = {'DEFAULT_CLOSED'}
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
|
|
||||||
def draw(self, context: bpy.types.Context) -> None:
|
def draw(self, context: bpy.types.Context) -> None:
|
||||||
|
global last_manual_check_time
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
|
# Auto-check for updates when panel is drawn, but not too frequently
|
||||||
|
current_time = time.time()
|
||||||
|
if current_time - last_manual_check_time > 300: # 5 minutes between auto-checks
|
||||||
|
if not is_checking_for_update and not update_needed:
|
||||||
|
check_for_update_background()
|
||||||
|
last_manual_check_time = current_time
|
||||||
|
|
||||||
draw_updater_panel(context, layout)
|
draw_updater_panel(context, layout)
|
||||||
|
|
||||||
|
|
||||||
@@ -158,11 +175,23 @@ def get_github_releases() -> bool:
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def check_for_update_available() -> bool:
|
def check_for_update_available() -> bool:
|
||||||
global latest_version, latest_version_str
|
global latest_version, latest_version_str, version_list
|
||||||
if not version_list:
|
if not version_list:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
latest_version = max(version_list.keys(), key=lambda v: [int(x) for x in v.split('.')])
|
# Filter versions by allowed version series
|
||||||
|
compatible_versions = {}
|
||||||
|
for v, info in version_list.items():
|
||||||
|
for prefix in ALLOWED_VERSION_SERIES:
|
||||||
|
if v.startswith(prefix):
|
||||||
|
compatible_versions[v] = info
|
||||||
|
break
|
||||||
|
|
||||||
|
if not compatible_versions:
|
||||||
|
print(f"No compatible versions found in series: {', '.join(ALLOWED_VERSION_SERIES)}")
|
||||||
|
return False
|
||||||
|
|
||||||
|
latest_version = max(compatible_versions.keys(), key=lambda v: [int(x) for x in v.split('.')])
|
||||||
latest_version_str = latest_version
|
latest_version_str = latest_version
|
||||||
|
|
||||||
current_version = get_current_version()
|
current_version = get_current_version()
|
||||||
@@ -195,11 +224,37 @@ def update_now(latest: bool = False) -> None:
|
|||||||
if not version_list:
|
if not version_list:
|
||||||
print("No version list available. Please check for updates first.")
|
print("No version list available. Please check for updates first.")
|
||||||
return
|
return
|
||||||
|
|
||||||
if latest:
|
if latest:
|
||||||
update_link = version_list[latest_version_str][0]
|
# Filter compatible versions
|
||||||
|
compatible_versions = {}
|
||||||
|
for v, info in version_list.items():
|
||||||
|
for prefix in ALLOWED_VERSION_SERIES:
|
||||||
|
if v.startswith(prefix):
|
||||||
|
compatible_versions[v] = info
|
||||||
|
break
|
||||||
|
|
||||||
|
if not compatible_versions:
|
||||||
|
print(f"No compatible versions found in series: {', '.join(ALLOWED_VERSION_SERIES)}")
|
||||||
|
return
|
||||||
|
|
||||||
|
latest_compatible = max(compatible_versions.keys(), key=lambda v: [int(x) for x in v.split('.')])
|
||||||
|
update_link = version_list[latest_compatible][0]
|
||||||
else:
|
else:
|
||||||
update_link = version_list[bpy.context.scene.avatar_toolkit_updater_version_list][0]
|
selected_version = bpy.context.scene.avatar_toolkit_updater_version_list
|
||||||
|
|
||||||
|
# Check if selected version is compatible
|
||||||
|
is_compatible = False
|
||||||
|
for prefix in ALLOWED_VERSION_SERIES:
|
||||||
|
if selected_version.startswith(prefix):
|
||||||
|
is_compatible = True
|
||||||
|
break
|
||||||
|
|
||||||
|
if not is_compatible:
|
||||||
|
print(f"Selected version {selected_version} is not in allowed series: {', '.join(ALLOWED_VERSION_SERIES)}")
|
||||||
|
return
|
||||||
|
|
||||||
|
update_link = version_list[selected_version][0]
|
||||||
|
|
||||||
download_file(update_link)
|
download_file(update_link)
|
||||||
ui_refresh()
|
ui_refresh()
|
||||||
@@ -274,7 +329,17 @@ def finish_update(error: str = '') -> None:
|
|||||||
ui_refresh()
|
ui_refresh()
|
||||||
|
|
||||||
def get_version_list(self, context: bpy.types.Context) -> List[Tuple[str, str, str]]:
|
def get_version_list(self, context: bpy.types.Context) -> List[Tuple[str, str, str]]:
|
||||||
return [(v, v, '') for v in version_list.keys()] if version_list else []
|
if not version_list:
|
||||||
|
return []
|
||||||
|
|
||||||
|
compatible_versions = []
|
||||||
|
for v in version_list.keys():
|
||||||
|
for prefix in ALLOWED_VERSION_SERIES:
|
||||||
|
if v.startswith(prefix):
|
||||||
|
compatible_versions.append(v)
|
||||||
|
break
|
||||||
|
|
||||||
|
return [(v, v, '') for v in compatible_versions]
|
||||||
|
|
||||||
def draw_updater_panel(context: bpy.types.Context, layout: bpy.types.UILayout) -> None:
|
def draw_updater_panel(context: bpy.types.Context, layout: bpy.types.UILayout) -> None:
|
||||||
box = layout.box()
|
box = layout.box()
|
||||||
@@ -287,6 +352,12 @@ def draw_updater_panel(context: bpy.types.Context, layout: bpy.types.UILayout) -
|
|||||||
|
|
||||||
col.separator()
|
col.separator()
|
||||||
|
|
||||||
|
# Show compatibility info
|
||||||
|
col.label(text=f"Update series: {', '.join(s + '.x' for s in ALLOWED_VERSION_SERIES)}", icon='INFO')
|
||||||
|
col.label(text=f"Blender version: {bpy.app.version_string}", icon='BLENDER')
|
||||||
|
|
||||||
|
col.separator()
|
||||||
|
|
||||||
# Update check/status section
|
# Update check/status section
|
||||||
if is_checking_for_update:
|
if is_checking_for_update:
|
||||||
col.operator(AvatarToolkit_OT_CheckForUpdate.bl_idname,
|
col.operator(AvatarToolkit_OT_CheckForUpdate.bl_idname,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"authors": ["Avatar Toolkit Team"],
|
"authors": ["Avatar Toolkit Team"],
|
||||||
"messages": {
|
"messages": {
|
||||||
"AvatarToolkit.label": "Avatar Toolkit (Alpha 0.1.1)",
|
"AvatarToolkit.label": "Avatar Toolkit (Alpha 0.1.3)",
|
||||||
"AvatarToolkit.desc1": "Avatar Toolkit is in Early Access there",
|
"AvatarToolkit.desc1": "Avatar Toolkit is in Early Access there",
|
||||||
"AvatarToolkit.desc2": "will be issues, if you find any issues,",
|
"AvatarToolkit.desc2": "will be issues, if you find any issues,",
|
||||||
"AvatarToolkit.desc3": "please report it on our Github.",
|
"AvatarToolkit.desc3": "please report it on our Github.",
|
||||||
@@ -425,4 +425,4 @@
|
|||||||
"Language.changed.success": "Language changed successfully!",
|
"Language.changed.success": "Language changed successfully!",
|
||||||
"Language.changed.restart": "Some UI elements may require restarting Blender"
|
"Language.changed.restart": "Some UI elements may require restarting Blender"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"authors": ["Avatar Toolkit Team"],
|
"authors": ["Avatar Toolkit Team"],
|
||||||
"messages": {
|
"messages": {
|
||||||
"AvatarToolkit.label": "アバターツールキット (Alpha 0.1.1)",
|
"AvatarToolkit.label": "アバターツールキット (Alpha 0.1.3)",
|
||||||
"AvatarToolkit.desc1": "アバターツールキットは早期アクセス中で",
|
"AvatarToolkit.desc1": "アバターツールキットは早期アクセス中で",
|
||||||
"AvatarToolkit.desc2": "問題が発生する可能性があります。問題を見つけた場合は、",
|
"AvatarToolkit.desc2": "問題が発生する可能性があります。問題を見つけた場合は、",
|
||||||
"AvatarToolkit.desc3": "GitHubで報告してください。",
|
"AvatarToolkit.desc3": "GitHubで報告してください。",
|
||||||
@@ -425,4 +425,4 @@
|
|||||||
"Language.changed.success": "言語が正常に変更されました!",
|
"Language.changed.success": "言語が正常に変更されました!",
|
||||||
"Language.changed.restart": "一部のUI要素の更新にはBlenderの再起動が必要な場合があります"
|
"Language.changed.restart": "一部のUI要素の更新にはBlenderの再起動が必要な場合があります"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"authors": ["Avatar Toolkit Team"],
|
"authors": ["Avatar Toolkit Team"],
|
||||||
"messages": {
|
"messages": {
|
||||||
"AvatarToolkit.label": "아바타 툴킷 (알파 0.1.1)",
|
"AvatarToolkit.label": "아바타 툴킷 (알파 0.1.3)",
|
||||||
"AvatarToolkit.desc1": "아바타 툴킷은 초기 액세스 단계입니다",
|
"AvatarToolkit.desc1": "아바타 툴킷은 초기 액세스 단계입니다",
|
||||||
"AvatarToolkit.desc2": "문제가 발생할 수 있으며, 문제를 발견하시면",
|
"AvatarToolkit.desc2": "문제가 발생할 수 있으며, 문제를 발견하시면",
|
||||||
"AvatarToolkit.desc3": "Github에 보고해 주시기 바랍니다.",
|
"AvatarToolkit.desc3": "Github에 보고해 주시기 바랍니다.",
|
||||||
@@ -425,4 +425,4 @@
|
|||||||
"Language.changed.success": "언어가 성공적으로 변경됨!",
|
"Language.changed.success": "언어가 성공적으로 변경됨!",
|
||||||
"Language.changed.restart": "일부 UI 요소는 블렌더 재시작이 필요할 수 있음"
|
"Language.changed.restart": "일부 UI 요소는 블렌더 재시작이 필요할 수 있음"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user