diff --git a/Assets/DevTests/Animations/BugTests/Jairo_Baldan_Mail.meta b/Assets/DevTests/Animations/BugTests/Jairo_Baldan_Mail.meta new file mode 100644 index 0000000..7d28f6c --- /dev/null +++ b/Assets/DevTests/Animations/BugTests/Jairo_Baldan_Mail.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3d285bcfdf76748fabc401431910bd26 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/DevTests/Animations/BugTests/Jairo_Baldan_Mail/Hand.fla b/Assets/DevTests/Animations/BugTests/Jairo_Baldan_Mail/Hand.fla new file mode 100644 index 0000000..7b73766 Binary files /dev/null and b/Assets/DevTests/Animations/BugTests/Jairo_Baldan_Mail/Hand.fla differ diff --git a/Assets/DevTests/Animations/BugTests/Jairo_Baldan_Mail/Hand.fla.meta b/Assets/DevTests/Animations/BugTests/Jairo_Baldan_Mail/Hand.fla.meta new file mode 100644 index 0000000..789d794 --- /dev/null +++ b/Assets/DevTests/Animations/BugTests/Jairo_Baldan_Mail/Hand.fla.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fc9c3116ef7ac454fa476d8eb8b46f99 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FlashTools/Docs/CHANGELOG.md b/Assets/FlashTools/Docs/CHANGELOG.md index 90fbf73..88be9ea 100644 --- a/Assets/FlashTools/Docs/CHANGELOG.md +++ b/Assets/FlashTools/Docs/CHANGELOG.md @@ -1,5 +1,6 @@ ###### Version 1.3.12 * Upgrade to minimal LTS version +* Fix anchor frame label detector * More readable conversion warnings ###### Version 1.3.11 diff --git a/Assets/FlashTools/FlashExport/Internal/FTBase.jsfl b/Assets/FlashTools/FlashExport/Internal/FTBase.jsfl index 5396a68..8f3a62d 100644 --- a/Assets/FlashTools/FlashExport/Internal/FTBase.jsfl +++ b/Assets/FlashTools/FlashExport/Internal/FTBase.jsfl @@ -13,6 +13,13 @@ if (!String.prototype.format) { }; } +if (!String.prototype.startsWith) { + String.prototype.startsWith = function (searchString, position) { + position = position || 0; + return this.indexOf(searchString, position) === position; + }; +} + ft = {}; ft.trace = function () { diff --git a/Assets/FlashTools/FlashExport/Internal/FTMain.jsfl b/Assets/FlashTools/FlashExport/Internal/FTMain.jsfl index 1208a02..260f1b9 100644 --- a/Assets/FlashTools/FlashExport/Internal/FTMain.jsfl +++ b/Assets/FlashTools/FlashExport/Internal/FTMain.jsfl @@ -38,6 +38,7 @@ ft.profile_function(cfg.profile_mode, function() { ftdoc.remove_unused_items(doc); }, "Remove unused items"); ft.profile_function(cfg.profile_mode, function() { ftdoc.prepare_all_bitmaps(doc); }, "Prepare all bitmaps"); ft.profile_function(cfg.profile_mode, function() { ftdoc.unlock_all_timelines(doc); }, "Unlock all timelines"); + ft.profile_function(cfg.profile_mode, function() { ftdoc.prepare_all_labels(doc); }, "Prepare all labels"); ft.profile_function(cfg.profile_mode, function() { ftdoc.prepare_all_tweens(doc); }, "Prepare all tweens"); ft.profile_function(cfg.profile_mode, function() { ftdoc.prepare_all_groups(doc); }, "Prepare all groups"); ft.profile_function(cfg.profile_mode, function() { ftdoc.calculate_item_scales(doc); }, "Calculate item scales"); @@ -206,6 +207,12 @@ fttim.unlock_all_layers(doc, doc.getTimeline()); }; + ftdoc.prepare_all_labels = function (doc) { + ft.type_assert(doc, Document); + ftlib.prepare_all_labels(doc, doc.library); + fttim.prepare_all_labels(doc, doc.getTimeline()); + }; + ftdoc.prepare_all_tweens = function (doc) { ft.type_assert(doc, Document); ftlib.prepare_all_tweens(doc, doc.library); @@ -497,6 +504,14 @@ }); }; + ftlib.prepare_all_labels = function (doc, library) { + ft.type_assert(doc, Document); + ft.type_assert(library, Library); + ftlib.edit_all_symbol_items(doc, library, function (item) { + fttim.prepare_all_labels(doc, item.timeline); + }); + }; + ftlib.prepare_all_tweens = function (doc, library) { ft.type_assert(doc, Document); ft.type_assert(library, Library); @@ -569,6 +584,11 @@ fttim.is_symbol_movie_clip_instance = function (elem) { return fttim.is_symbol_instance(elem) && elem.symbolType == "movie clip"; }; + + fttim.is_anchor_frame = function (frame) { + ft.type_assert(frame, Frame); + return frame.labelType == "anchor"; + }; fttim.is_tween_frame = function (frame) { ft.type_assert(frame, Frame); @@ -770,6 +790,20 @@ }, true); }; + fttim.prepare_all_labels = function (doc, timeline) { + ft.type_assert(doc, Document); + ft.type_assert(timeline, Timeline); + + var anchor_prefix = "FT_ANCHOR:"; + ft.array_reverse_foreach(timeline.layers, function (layer, layer_index) { + ft.array_foreach(layer.frames, function (frame, frame_index) { + if ( fttim.is_anchor_frame(frame) && !frame.name.startsWith(anchor_prefix) ) { + frame.name = anchor_prefix + frame.name; + } + }, fttim.is_keyframe); + }); + }; + fttim.prepare_all_tweens = function (doc, timeline) { ft.type_assert(doc, Document); ft.type_assert(timeline, Timeline); diff --git a/Assets/FlashTools/Scripts/Editor/FTSwfTools/SwfContextExecuter.cs b/Assets/FlashTools/Scripts/Editor/FTSwfTools/SwfContextExecuter.cs index 998efae..31d8853 100644 --- a/Assets/FlashTools/Scripts/Editor/FTSwfTools/SwfContextExecuter.cs +++ b/Assets/FlashTools/Scripts/Editor/FTSwfTools/SwfContextExecuter.cs @@ -181,7 +181,10 @@ namespace FTSwfTools { } public SwfDisplayList Visit(FrameLabelTag tag, SwfDisplayList dl) { - if ( tag.AnchorFlag == 0 ) { + const string anchor_prefix = "FT_ANCHOR:"; + if ( tag.Name.StartsWith(anchor_prefix) ) { + dl.FrameAnchors.Add(tag.Name.Remove(0, anchor_prefix.Length).Trim()); + } else if ( tag.AnchorFlag == 0 ) { dl.FrameLabels.Add(tag.Name.Trim()); } else { dl.FrameAnchors.Add(tag.Name.Trim()); diff --git a/ProjectStuff/FlashTools.org b/ProjectStuff/FlashTools.org index 123ceae..0774a43 100644 --- a/ProjectStuff/FlashTools.org +++ b/ProjectStuff/FlashTools.org @@ -73,6 +73,8 @@ UNITY_HALF_TEXEL_OFFSET **** DONE Минимальная версия 2017 LTS *** Улучшения **** DONE У ворнингов конверта нет контекста +*** Баги +**** DONE В новом animate сломались якорные фреймы ** DONE Версия 1.3.11 *** Баги **** DONE Триальная версия не поддерживает Unity 2017