Working Animations

This commit is contained in:
Hariharan Mudaliar 2025-10-11 15:45:58 +05:30
commit b7959b78fc
6 changed files with 126 additions and 69 deletions

View file

@ -51,16 +51,31 @@ struct IdleAnimationsSettingsSection: View {
selectedForDeletion = animation
showingDeleteAlert = true
},
onEdit: animation.isBuiltIn ? nil : {
onEdit: {
print("🔧 [Edit] Attempting to edit animation: \(animation.name)")
print("🔧 [Edit] Animation source: \(animation.source)")
editingExistingAnimation = animation
if case .lottieFile(let url) = animation.source {
switch animation.source {
case .lottieFile(let url):
print("🔧 [Edit] Lottie file URL: \(url)")
print("🔧 [Edit] File exists: \(FileManager.default.fileExists(atPath: url.path))")
editorSourceURL = url
editorIsRemote = false
showingEditor = true
} else if case .lottieURL(let url) = animation.source {
case .lottieURL(let url):
print("🔧 [Edit] Lottie URL: \(url)")
editorSourceURL = url
editorIsRemote = true
showingEditor = true
case .builtInFace:
print("🔧 [Edit] Built-in face - using dummy URL")
// Use a dummy URL for built-in face (editor only needs URL for preview)
editorSourceURL = URL(string: "builtin://face")!
editorIsRemote = false
showingEditor = true
}
}
)