Armature Selection Improvements.

- Added a check to make sure Armature is valid.
- Added a helper to select the current armature  selected in armature selection.
- Added a helper to get all meshes.
- Updated all current functions to work with the system.
This commit is contained in:
Yusarina
2024-07-24 00:27:14 +01:00
parent 06c7cff4b7
commit 76046f7c6d
6 changed files with 61 additions and 30 deletions
+3 -2
View File
@@ -4,7 +4,7 @@ from typing import List, Optional
import re
from bpy.types import Operator, Context, Object
from ..core.dictionaries import bone_names
from ..core.common import get_selected_armature, simplify_bonename
from ..core.common import get_selected_armature, simplify_bonename, is_valid_armature
from ..functions.translations import t
@register_wrap
@@ -16,7 +16,8 @@ class ConvertToResonite(Operator):
@classmethod
def poll(cls, context: Context) -> bool:
return get_selected_armature(context) is not None
armature = get_selected_armature(context)
return armature is not None and is_valid_armature(armature)
def execute(self, context: Context) -> set:
armature = get_selected_armature(context)