Compare commits
42 Commits
versions/1
...
versions/1
| Author | SHA1 | Date | |
|---|---|---|---|
| abaaced469 | |||
| 5f24a7dfd9 | |||
| 5f3302b459 | |||
| 4471d05910 | |||
| 9d0846d7dc | |||
| 8142f49e90 | |||
| 4033ca68e8 | |||
| f0fafc4314 | |||
| 47973918ad | |||
| 8b165ba45f | |||
| 0a9aa0c5de | |||
| a56825cf4b | |||
| 90b2d90157 | |||
| 84a7539b56 | |||
| f26d1f1f2e | |||
| 3b775751a2 | |||
| 26fde9fe89 | |||
| f0f18e6aec | |||
| 9ea77def56 | |||
| fa15c96de4 | |||
| a147b74ddf | |||
| 7ef01ccc2e | |||
| ee998c3770 | |||
| 26427f2220 | |||
| 1341a47f09 | |||
| 29dc1b3253 | |||
| 8ca72bf194 | |||
| d5575c005a | |||
| 94c44c37cb | |||
| f9b9acd3b7 | |||
| 26e30e45f2 | |||
| 4451018727 | |||
| b1feaec2c9 | |||
| a38e05f955 | |||
| d591379acc | |||
| 8ded077428 | |||
| 3c5f3784e5 | |||
| 513e477214 | |||
| 55d7df349e | |||
| faff1d4c6e | |||
| 103190fcc7 | |||
| 8867ed855a |
BIN
Assets/DevTests/Animations/AlphaTests/Elefun/android.fla
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 489500abc518741b59e7a95b93295317
|
||||
timeCreated: 1497866267
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/DevTests/Animations/AlphaTests/Tests.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31fd11df111b54e3dbf8f0b135da45d9
|
||||
folderAsset: yes
|
||||
timeCreated: 1494224348
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/DevTests/Animations/AlphaTests/Tests/Characters_1.fla
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9b15c852977e54b3b8b1dfc4fa6fc920
|
||||
timeCreated: 1495641252
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/DevTests/Animations/AlphaTests/Tests/FX_overlay.fla
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b037662f7f638455d9cc6d4251710ee2
|
||||
timeCreated: 1495627091
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/DevTests/Animations/AlphaTests/Tests/Torch.fla
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 667a3cd1a987d40d5a4c9b6495da5480
|
||||
timeCreated: 1494255165
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/DevTests/Animations/AlphaTests/Tests/charexp.fla
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 12654680c0cae45d3a44f4fc666262bd
|
||||
timeCreated: 1494492625
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/DevTests/Animations/AlphaTests/Tests/cyclops_test.fla
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7dc9a5d8bf33d4b30b9a58e370cad87e
|
||||
timeCreated: 1494508632
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/DevTests/Animations/AlphaTests/Tests/pyromancer_body.fla
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f878ff9c96174385bb57a48f18a6335
|
||||
timeCreated: 1495910510
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/DevTests/Animations/AlphaTests/Tests/pyromancer_ci.fla
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c82e30d4e993d450f8a475c408afc80f
|
||||
timeCreated: 1495664549
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/DevTests/Animations/AlphaTests/Tests/pyromancer_head.fla
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 89dfadc78afc648c3a5aaf39c5cec6e2
|
||||
timeCreated: 1495655881
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7c9df19bccf1d4987a1c2359f55b921f
|
||||
timeCreated: 1495661693
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/DevTests/Animations/AlphaTests/Tests/tweens.fla
Executable file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b209e60e405544f2bbdc7a9db61b81d
|
||||
timeCreated: 1495206863
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/DevTests/Animations/AlphaTests/Tests/分镜修改版.fla
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8006ea931faa744169bb2c56d2b04da8
|
||||
timeCreated: 1495311730
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/DevTests/Animations/AlphaTests/Tortuga/cyclop.fla
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b35790b065a454a32a0518138e64d15f
|
||||
timeCreated: 1491582789
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/DevTests/Animations/FeatureTests/10_unlocks.fla
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1c95e140e6cc841508d2f6a21b33068b
|
||||
timeCreated: 1495287492
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/DevTests/Animations/FeatureTests/9.1_groups.fla
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ad3f6a723d9604fe9b44fe73494e6899
|
||||
timeCreated: 1494279688
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/DevTests/Animations/FeatureTests/9.2_groups.fla
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 221b4d2156b3446cbbf03c70db9e69fd
|
||||
timeCreated: 1495746942
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/DevTests/Animations/FeatureTests/9.3_groups.fla
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 16c36ac5146fc41799851c3b081b6846
|
||||
timeCreated: 1495749347
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/DevTests/Animations/FeatureTests/9.4_groups.fla
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 137690fcc02e7478f8f0c6733fe7889c
|
||||
timeCreated: 1495903354
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/DevTests/Animations/FeatureTests/9_groups.fla
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 95dbb06a4f0c9413480c9e92aba982d3
|
||||
timeCreated: 1494272922
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,3 +1,17 @@
|
||||
###### Version 1.3.8
|
||||
* Fix shape groups in tweens problems
|
||||
* Fix drawing object shape problems
|
||||
* Fix locked elements problem
|
||||
* Fix optimizator bitmap trim problems
|
||||
* Fix Unity 5.6 submesh sorting bug
|
||||
* Fix convertSelectionToBitmap for big item (over 4000px)
|
||||
* Fix overlay blending mode
|
||||
* Add HD, SD script export
|
||||
* Add shape tween warning
|
||||
* Add SwfClip bounds functions (currentLocalBounds, currentWorldBounds)
|
||||
* Remove excess "if" instruction from shaders
|
||||
* Remove excess animation reimports
|
||||
|
||||
###### Version 1.3.7
|
||||
* Fix multiple import
|
||||
* Fix single frame optimization
|
||||
|
||||
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 29 KiB |
@@ -1,6 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e336e165518cf4d8680e2fff9c6b59ba
|
||||
timeCreated: 1486894953
|
||||
timeCreated: 1497547324
|
||||
licenseType: Free
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
|
||||
@@ -24,11 +24,11 @@ MonoBehaviour:
|
||||
- StartVertex: 0
|
||||
IndexCount: 6
|
||||
Vertices:
|
||||
- {x: 0.028839836, y: -0.03892601}
|
||||
- {x: 0.9771797, y: -0.03892601}
|
||||
- {x: 0.9771797, y: -0.8959397}
|
||||
- {x: 0.028839836, y: -0.8959397}
|
||||
UVs: 00000000ff4aff52
|
||||
- {x: 0.029411115, y: -0.035497963}
|
||||
- {x: 0.97329503, y: -0.035497963}
|
||||
- {x: 0.97329503, y: -0.8919796}
|
||||
- {x: 0.029411115, y: -0.8919796}
|
||||
UVs: 00000000ff55ff5d
|
||||
AddColors: 0000000000000000
|
||||
MulColors: 0002000200020002
|
||||
Materials:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a25723a1cd8b141a6b489606584a6f65
|
||||
timeCreated: 1480707413
|
||||
timeCreated: 1494801036
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
|
||||
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 66 KiB |
@@ -1,6 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c1278c7f98af44db8a86e620305eb32b
|
||||
timeCreated: 1486894967
|
||||
timeCreated: 1497547327
|
||||
licenseType: Free
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
|
||||
@@ -25,110 +25,110 @@ MonoBehaviour:
|
||||
IndexCount: 156
|
||||
Vertices:
|
||||
- {x: 0.17883545, y: -0.33088514}
|
||||
- {x: 0.27845198, y: -0.41441038}
|
||||
- {x: 0.18850175, y: -0.5216897}
|
||||
- {x: 0.0888852, y: -0.4381645}
|
||||
- {x: 0.27924088, y: -0.41507185}
|
||||
- {x: 0.19028847, y: -0.52116114}
|
||||
- {x: 0.08988304, y: -0.43697444}
|
||||
- {x: 0.04699825, y: -0.5018102}
|
||||
- {x: 0.13128917, y: -0.5724854}
|
||||
- {x: 0.041338928, y: -0.67976475}
|
||||
- {x: -0.042951997, y: -0.60908955}
|
||||
- {x: 0.13262679, y: -0.57360697}
|
||||
- {x: 0.04558219, y: -0.67742085}
|
||||
- {x: -0.040046353, y: -0.60562414}
|
||||
- {x: 0.28633544, y: -0.32388517}
|
||||
- {x: 0.3936148, y: -0.4138354}
|
||||
- {x: 0.31008956, y: -0.51345193}
|
||||
- {x: 0.20281021, y: -0.4235017}
|
||||
- {x: 0.21864823, y: -0.34363583}
|
||||
- {x: 0.30293915, y: -0.41431102}
|
||||
- {x: 0.23868898, y: -0.49093914}
|
||||
- {x: 0.15439805, y: -0.42026395}
|
||||
- {x: 0.122, y: -0.39949995}
|
||||
- {x: 0.412, y: -0.39949995}
|
||||
- {x: 0.412, y: -0.7594999}
|
||||
- {x: 0.122, y: -0.7594999}
|
||||
- {x: 0.3912854, y: -0.4118823}
|
||||
- {x: 0.30582932, y: -0.5138017}
|
||||
- {x: 0.20087935, y: -0.42580456}
|
||||
- {x: 0.22631103, y: -0.35006085}
|
||||
- {x: 0.30587783, y: -0.41677502}
|
||||
- {x: 0.23916365, y: -0.49634182}
|
||||
- {x: 0.15959686, y: -0.42962766}
|
||||
- {x: 0.122, y: -0.40399995}
|
||||
- {x: 0.40749973, y: -0.40399995}
|
||||
- {x: 0.40749973, y: -0.7604953}
|
||||
- {x: 0.122, y: -0.7604953}
|
||||
- {x: 0.2266193, y: -0.65309644}
|
||||
- {x: 0.32225987, y: -0.60883987}
|
||||
- {x: 0.35238072, y: -0.7319035}
|
||||
- {x: 0.25674015, y: -0.7761601}
|
||||
- {x: 0.32643726, y: -0.6069068}
|
||||
- {x: 0.3576628, y: -0.7344838}
|
||||
- {x: 0.2578448, y: -0.7806734}
|
||||
- {x: 0.173, y: -0.71999997}
|
||||
- {x: 0.313, y: -0.71999997}
|
||||
- {x: 0.313, y: -0.79999995}
|
||||
- {x: 0.173, y: -0.79999995}
|
||||
- {x: 0.31064036, y: -0.71999997}
|
||||
- {x: 0.31064036, y: -0.79705167}
|
||||
- {x: 0.173, y: -0.79705167}
|
||||
- {x: 0.2075, y: -0.69649994}
|
||||
- {x: 0.3075, y: -0.69649994}
|
||||
- {x: 0.3075, y: -0.76649994}
|
||||
- {x: 0.2075, y: -0.76649994}
|
||||
- {x: 0.19299999, y: -0.6795}
|
||||
- {x: 0.30299997, y: -0.6795}
|
||||
- {x: 0.30299997, y: -0.7295}
|
||||
- {x: 0.19299999, y: -0.7295}
|
||||
- {x: 0.3041623, y: -0.69649994}
|
||||
- {x: 0.3041623, y: -0.7633929}
|
||||
- {x: 0.2075, y: -0.7633929}
|
||||
- {x: 0.19299999, y: -0.66949993}
|
||||
- {x: 0.30682567, y: -0.66949993}
|
||||
- {x: 0.30682567, y: -0.71853286}
|
||||
- {x: 0.19299999, y: -0.71853286}
|
||||
- {x: 0.315, y: -0.63199997}
|
||||
- {x: 0.45499998, y: -0.63199997}
|
||||
- {x: 0.45499998, y: -0.732}
|
||||
- {x: 0.315, y: -0.732}
|
||||
- {x: 0.45133758, y: -0.63199997}
|
||||
- {x: 0.45133758, y: -0.73108685}
|
||||
- {x: 0.315, y: -0.73108685}
|
||||
- {x: 0.305, y: -0.752}
|
||||
- {x: 0.45499998, y: -0.752}
|
||||
- {x: 0.45499998, y: -0.83199996}
|
||||
- {x: 0.305, y: -0.83199996}
|
||||
- {x: 0.44998062, y: -0.752}
|
||||
- {x: 0.44998062, y: -0.8315501}
|
||||
- {x: 0.305, y: -0.8315501}
|
||||
- {x: 0.337, y: -0.71599996}
|
||||
- {x: 0.447, y: -0.71599996}
|
||||
- {x: 0.447, y: -0.77599996}
|
||||
- {x: 0.337, y: -0.77599996}
|
||||
- {x: 0.3195, y: -0.70399994}
|
||||
- {x: 0.4495, y: -0.70399994}
|
||||
- {x: 0.4495, y: -0.74399996}
|
||||
- {x: 0.3195, y: -0.74399996}
|
||||
- {x: 0.18099998, y: -0.36449996}
|
||||
- {x: 0.571, y: -0.36449996}
|
||||
- {x: 0.571, y: -0.6744999}
|
||||
- {x: 0.18099998, y: -0.6744999}
|
||||
- {x: 0.3995, y: -0.32349998}
|
||||
- {x: 0.6395, y: -0.32349998}
|
||||
- {x: 0.6395, y: -0.8135}
|
||||
- {x: 0.3995, y: -0.8135}
|
||||
- {x: 0.1625, y: -0.49149996}
|
||||
- {x: 0.5925, y: -0.49149996}
|
||||
- {x: 0.5925, y: -0.6514999}
|
||||
- {x: 0.1625, y: -0.6514999}
|
||||
- {x: 0.13650002, y: 0.087000005}
|
||||
- {x: 0.6465, y: 0.087000005}
|
||||
- {x: 0.6465, y: -0.45299998}
|
||||
- {x: 0.13650002, y: -0.45299998}
|
||||
- {x: 0.442047, y: -0.71599996}
|
||||
- {x: 0.442047, y: -0.7778359}
|
||||
- {x: 0.337, y: -0.7778359}
|
||||
- {x: 0.3295, y: -0.70399994}
|
||||
- {x: 0.46136615, y: -0.70399994}
|
||||
- {x: 0.46136615, y: -0.7479553}
|
||||
- {x: 0.3295, y: -0.7479553}
|
||||
- {x: 0.17849998, y: -0.36099997}
|
||||
- {x: 0.5664945, y: -0.36099997}
|
||||
- {x: 0.5664945, y: -0.67049855}
|
||||
- {x: 0.17849998, y: -0.67049855}
|
||||
- {x: 0.40300003, y: -0.32099998}
|
||||
- {x: 0.6404988, y: -0.32099998}
|
||||
- {x: 0.6404988, y: -0.8089962}
|
||||
- {x: 0.40300003, y: -0.8089962}
|
||||
- {x: 0.1575, y: -0.49599996}
|
||||
- {x: 0.5875, y: -0.49599996}
|
||||
- {x: 0.5875, y: -0.65249896}
|
||||
- {x: 0.1575, y: -0.65249896}
|
||||
- {x: 0.13700001, y: 0.08049999}
|
||||
- {x: 0.65149796, y: 0.08049999}
|
||||
- {x: 0.65149796, y: -0.45499286}
|
||||
- {x: 0.13700001, y: -0.45499286}
|
||||
- {x: 0.262, y: -0.17849998}
|
||||
- {x: 0.362, y: -0.17849998}
|
||||
- {x: 0.362, y: -0.28849998}
|
||||
- {x: 0.262, y: -0.28849998}
|
||||
- {x: 0.36318973, y: -0.17849998}
|
||||
- {x: 0.36318973, y: -0.2919961}
|
||||
- {x: 0.262, y: -0.2919961}
|
||||
- {x: 0.13250002, y: -0.16}
|
||||
- {x: 0.22250001, y: -0.16}
|
||||
- {x: 0.22250001, y: -0.28}
|
||||
- {x: 0.13250002, y: -0.28}
|
||||
- {x: 0.21949664, y: -0.16}
|
||||
- {x: 0.21949664, y: -0.27586058}
|
||||
- {x: 0.13250002, y: -0.27586058}
|
||||
- {x: 0.11150001, y: -0.17449999}
|
||||
- {x: 0.5215, y: -0.17449999}
|
||||
- {x: 0.5215, y: -0.48449996}
|
||||
- {x: 0.11150001, y: -0.48449996}
|
||||
- {x: 0.09650002, y: 0.017000007}
|
||||
- {x: 0.5265, y: 0.017000007}
|
||||
- {x: 0.5265, y: -0.33299997}
|
||||
- {x: 0.09650002, y: -0.33299997}
|
||||
- {x: -0.020737303, y: -0.44349837}
|
||||
- {x: 0.3277887, y: -0.47559524}
|
||||
- {x: 0.30486238, y: -0.7245424}
|
||||
- {x: -0.043663636, y: -0.6924455}
|
||||
- {x: 0.4193734, y: -0.45619494}
|
||||
- {x: 0.559305, y: -0.45187333}
|
||||
- {x: 0.56331795, y: -0.5818099}
|
||||
- {x: 0.4233863, y: -0.58613145}
|
||||
- {x: 0.31538656, y: -0.5147328}
|
||||
- {x: 0.45426717, y: -0.5323866}
|
||||
- {x: 0.43661335, y: -0.6712672}
|
||||
- {x: 0.29773277, y: -0.6536134}
|
||||
- {x: 0.52488655, y: -0.17449999}
|
||||
- {x: 0.52488655, y: -0.48745242}
|
||||
- {x: 0.11150001, y: -0.48745242}
|
||||
- {x: 0.09200001, y: 0.015500011}
|
||||
- {x: 0.5254972, y: 0.015500011}
|
||||
- {x: 0.5254972, y: -0.3314986}
|
||||
- {x: 0.09200001, y: -0.3314986}
|
||||
- {x: -0.016302101, y: -0.44440895}
|
||||
- {x: 0.33271846, y: -0.47655135}
|
||||
- {x: 0.31025076, y: -0.72051847}
|
||||
- {x: -0.038769808, y: -0.68837607}
|
||||
- {x: 0.42293343, y: -0.45808592}
|
||||
- {x: 0.5598651, y: -0.45385697}
|
||||
- {x: 0.5639706, y: -0.5867913}
|
||||
- {x: 0.4270389, y: -0.5910202}
|
||||
- {x: 0.31725287, y: -0.5119459}
|
||||
- {x: 0.4556355, y: -0.5295364}
|
||||
- {x: 0.43754044, y: -0.6718882}
|
||||
- {x: 0.29915783, y: -0.6542977}
|
||||
- {x: 0.37866077, y: -0.5215725}
|
||||
- {x: 0.47755602, y: -0.50675315}
|
||||
- {x: 0.49533924, y: -0.6254274}
|
||||
- {x: 0.39644396, y: -0.6402468}
|
||||
- {x: 0.26616642, y: -0.5326745}
|
||||
- {x: 0.36073795, y: -0.58885443}
|
||||
- {x: 0.2892362, y: -0.7092182}
|
||||
- {x: 0.19466466, y: -0.65303826}
|
||||
UVs: ffbaff22ffc17f29fff7ff05fffe7f0bffbaff297fc1ff307fe57f0c7feaff117f3c7fc87f4effd6ffeaff11ffefff167fbeff417fc2ff48fff07f117ff47f167f4c7fabff4effb07f497fd77f4e7fde7fbeff317fc27f397f4c7fa57f4fffaa7f4c7fc17f4effc77f3c7fb4ff4bffc7ffde00007ff7ff0bff447fe9ff4cfffe7fc300007fde7f19ffea7f0c7ff07f11fff07f0cfff6ff107f3c7f9fff4bffb37f3c7f89ff4dff9e7f3c7fd7ff48ffe8ffbaff297fc1ff30ffba7f1bffc17f22ffde7f0cffe47f11fff70000fffe7f05
|
||||
- {x: 0.47597006, y: -0.5069908}
|
||||
- {x: 0.49384904, y: -0.6263043}
|
||||
- {x: 0.39653975, y: -0.640886}
|
||||
- {x: 0.26679638, y: -0.53944594}
|
||||
- {x: 0.36222652, y: -0.596136}
|
||||
- {x: 0.29327887, y: -0.7122002}
|
||||
- {x: 0.19784872, y: -0.6555102}
|
||||
UVs: fff3ff27fffa7f2e7f437fd77f4affdcfff3ff2e7ffaff35ff4a7fd77f50ffdcffb97f75ffcbff83ff47fff17f4f7ff9fff3ff157ff9ff1ffff9ff15fffeff1cfff3ff457ff7ff4dff40fff17f47fffaff47ffb0ff4d7fbb7ffb7f207fff7f277ffc00007fffff08ff40ffdd7f507ff1ffa07f757fb97f81fff30000fffb7f15ff507f89ff6bffa27f077ff97f0dfffe00007ff9ff06fffeff3bffbf7f4dffd67fe5ff63fff67f797fcc7f75ffd8ff86fff3ff2e7ffaff35fff37f20fffa7f27ff0d7ff9ff137ffeff3b7fd7ff42ffdc
|
||||
AddColors: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
MulColors: 00020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002
|
||||
Materials:
|
||||
|
||||
|
Before Width: | Height: | Size: 269 KiB After Width: | Height: | Size: 1.4 MiB |
@@ -1,6 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a799322aa44e44b38980bc9d307f0c38
|
||||
timeCreated: 1486894960
|
||||
timeCreated: 1497547325
|
||||
licenseType: Free
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
|
||||
@@ -25,18 +25,18 @@ MonoBehaviour:
|
||||
IndexCount: 18
|
||||
Vertices:
|
||||
- {x: 1.4074999, y: -1.2465}
|
||||
- {x: 1.4567962, y: -1.2465}
|
||||
- {x: 1.4567962, y: -1.265126}
|
||||
- {x: 1.4074999, y: -1.265126}
|
||||
- {x: 1.4563452, y: -1.2465}
|
||||
- {x: 1.4563452, y: -1.2653537}
|
||||
- {x: 1.4074999, y: -1.2653537}
|
||||
- {x: 1.3955, y: -1.242}
|
||||
- {x: 1.4708942, y: -1.242}
|
||||
- {x: 1.4708942, y: -1.2696567}
|
||||
- {x: 1.3955, y: -1.2696567}
|
||||
- {x: 1.4714679, y: -1.242}
|
||||
- {x: 1.4714679, y: -1.2697064}
|
||||
- {x: 1.3955, y: -1.2697064}
|
||||
- {x: 1.3870001, y: -1.2475}
|
||||
- {x: 1.4810733, y: -1.2475}
|
||||
- {x: 1.4810733, y: -1.2815095}
|
||||
- {x: 1.3870001, y: -1.2815095}
|
||||
UVs: bf443fa4ff4cbfacff0f7ff23f1c7fff7f1c7fee3f26fff8
|
||||
- {x: 1.4802694, y: -1.2475}
|
||||
- {x: 1.4802694, y: -1.2818046}
|
||||
- {x: 1.3870001, y: -1.2818046}
|
||||
UVs: 5f447f8a9f875fce00007f8a3f443fd37f8e0000fff47f6c
|
||||
AddColors: 000000000000000000000000000000000000000000000000
|
||||
MulColors: 000200020001000200020002000100020002000200010002
|
||||
Materials:
|
||||
|
||||
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 133 KiB |
@@ -1,6 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 47e46d443fd064d78ae33281e2840297
|
||||
timeCreated: 1486894975
|
||||
timeCreated: 1497547328
|
||||
licenseType: Free
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
|
||||
@@ -1,841 +1,5 @@
|
||||
if (!String.prototype.format) {
|
||||
String.prototype.format = function () {
|
||||
var args = arguments;
|
||||
return this.replace(/{(\d+)}/g, function (match, number) {
|
||||
return typeof args[number] != 'undefined' ? args[number] : match;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
//
|
||||
// ft config
|
||||
//
|
||||
|
||||
var ft = {
|
||||
profile_mode : false,
|
||||
verbose_mode : false,
|
||||
|
||||
graphics_scale : 1.0,
|
||||
scale_precision : 0.01,
|
||||
|
||||
optimize_big_items : true,
|
||||
optimize_small_items : true,
|
||||
optimize_static_items : true,
|
||||
optimize_single_graphics : true,
|
||||
|
||||
export_path_postfix : "_export"
|
||||
};
|
||||
|
||||
//
|
||||
// ft base functions
|
||||
//
|
||||
|
||||
ft.trace = function () {
|
||||
fl.outputPanel.trace(
|
||||
Array.prototype.join.call(arguments, " "));
|
||||
};
|
||||
|
||||
ft.trace_fmt = function (format) {
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
ft.trace(format.format.apply(format, args));
|
||||
};
|
||||
|
||||
ft.clear_output = function () {
|
||||
fl.outputPanel.clear();
|
||||
};
|
||||
|
||||
ft.assert = function (expr, format) {
|
||||
if (!expr) {
|
||||
if (format === undefined) {
|
||||
throw "!!!Assert!!!";
|
||||
} else {
|
||||
var args = Array.prototype.slice.call(arguments, 2);
|
||||
throw "!!!Assert!!! " + format.format.apply(format, args);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ft.type_assert = function (item, type) {
|
||||
var type_is_string = (typeof type === 'string');
|
||||
ft.assert(
|
||||
(type_is_string && typeof item === type) ||
|
||||
(!type_is_string && item instanceof type),
|
||||
"Type error: {0} != {1}",
|
||||
typeof item,
|
||||
type_is_string ? type : type.constructor.name);
|
||||
};
|
||||
|
||||
ft.type_assert_if_defined = function (item, type) {
|
||||
if (item && item !== undefined) {
|
||||
ft.type_assert(item, type);
|
||||
}
|
||||
};
|
||||
|
||||
ft.is_function = function (func) {
|
||||
return func && typeof(func) === 'function';
|
||||
};
|
||||
|
||||
ft.profile_function = function (func, msg) {
|
||||
ft.type_assert(func, Function);
|
||||
ft.type_assert(msg, 'string');
|
||||
if (!ft.profile_function_stack) {
|
||||
ft.profile_function_stack = [];
|
||||
}
|
||||
if (!ft.profile_function_level) {
|
||||
ft.profile_function_level = 0;
|
||||
}
|
||||
var stack_index = ft.profile_function_stack.length;
|
||||
ft.profile_function_stack.push({
|
||||
msg: msg,
|
||||
level: ft.profile_function_level,
|
||||
time: 0
|
||||
});
|
||||
++ft.profile_function_level;
|
||||
var func_time = ft.get_call_function_time(func);
|
||||
--ft.profile_function_level;
|
||||
ft.profile_function_stack[stack_index].time = func_time;
|
||||
if (stack_index == 0) {
|
||||
for (var i = 0; i < ft.profile_function_stack.length; ++i) {
|
||||
var info = ft.profile_function_stack[i];
|
||||
var ident = "--";
|
||||
for (var j = 0; j < info.level; ++j) {
|
||||
ident += "--";
|
||||
}
|
||||
if (ft.profile_mode) {
|
||||
ft.trace_fmt("{0} Profile: '{1}' : {2}", ident, info.msg, info.time);
|
||||
}
|
||||
}
|
||||
ft.profile_function_stack = [];
|
||||
}
|
||||
};
|
||||
|
||||
ft.get_call_function_time = function (func) {
|
||||
ft.type_assert(func, Function);
|
||||
var b_time = Date.now();
|
||||
func();
|
||||
var e_time = Date.now();
|
||||
return (e_time - b_time) / 1000;
|
||||
};
|
||||
|
||||
ft.escape_path = function (path) {
|
||||
ft.type_assert(path, 'string');
|
||||
return path.replace(/ /g, '%20');
|
||||
};
|
||||
|
||||
ft.escape_string = function (str) {
|
||||
ft.type_assert(str, 'string');
|
||||
return str
|
||||
.replace(/\&/g, '&')
|
||||
.replace(/\"/g, '"')
|
||||
.replace(/\'/g, ''')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>');
|
||||
};
|
||||
|
||||
ft.combine_path = function (lhs, rhs) {
|
||||
ft.type_assert(lhs, 'string');
|
||||
ft.type_assert(rhs, 'string');
|
||||
return ft.escape_path(lhs) + ft.escape_path(rhs);
|
||||
};
|
||||
|
||||
ft.array_foldl = function (arr, func, acc) {
|
||||
ft.type_assert(arr, Array);
|
||||
ft.type_assert(func, Function);
|
||||
for (var index = 0; index < arr.length; ++index) {
|
||||
var value = arr[index];
|
||||
acc = func(value, acc);
|
||||
}
|
||||
return acc;
|
||||
};
|
||||
|
||||
ft.array_foldr = function (arr, func, acc) {
|
||||
ft.type_assert(arr, Array);
|
||||
ft.type_assert(func, Function);
|
||||
for (var index = arr.length - 1; index >= 0; --index) {
|
||||
var value = arr[index];
|
||||
acc = func(value, acc);
|
||||
}
|
||||
return acc;
|
||||
};
|
||||
|
||||
ft.array_filter = function (arr, filter) {
|
||||
ft.type_assert(arr, Array);
|
||||
ft.type_assert(filter, Function);
|
||||
var new_arr = [];
|
||||
for (var index = 0; index < arr.length; ++index) {
|
||||
var value = arr[index];
|
||||
if (filter(value, index)) {
|
||||
new_arr.push(value);
|
||||
}
|
||||
}
|
||||
return new_arr;
|
||||
};
|
||||
|
||||
ft.array_foreach = function (arr, func, filter) {
|
||||
ft.type_assert(arr, Array);
|
||||
ft.type_assert(func, Function);
|
||||
ft.type_assert_if_defined(filter, Function);
|
||||
for (var index = 0; index < arr.length; ++index) {
|
||||
var value = arr[index];
|
||||
if (filter === undefined || filter(value, index)) {
|
||||
func(value, index);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ft.array_reverse_foreach = function (arr, func, filter) {
|
||||
ft.type_assert(arr, Array);
|
||||
ft.type_assert(func, Function);
|
||||
ft.type_assert_if_defined(filter, Function);
|
||||
for (var index = arr.length - 1; index >= 0; --index) {
|
||||
var value = arr[index];
|
||||
if (filter === undefined || filter(value, index)) {
|
||||
func(value, index);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ft.approximately = function(a, b, precision) {
|
||||
ft.type_assert(a, 'number');
|
||||
ft.type_assert(b, 'number');
|
||||
ft.type_assert(precision, 'number');
|
||||
return Math.abs(b - a) < Math.abs(precision);
|
||||
};
|
||||
|
||||
ft.gen_unique_name = function () {
|
||||
if (!ft.gen_unique_name_index) {
|
||||
ft.gen_unique_name_index = 0;
|
||||
}
|
||||
++ft.gen_unique_name_index;
|
||||
return "ft_unique_name_" + ft.gen_unique_name_index;
|
||||
};
|
||||
|
||||
//
|
||||
// document
|
||||
//
|
||||
|
||||
var ftdoc = {};
|
||||
|
||||
ftdoc.prepare = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.profile_function(function() { ftdoc.prepare_folders(doc); }, "Prepare folders");
|
||||
ft.profile_function(function() { ftdoc.full_exit_edit_mode(doc); }, "Full exit edit mode");
|
||||
ft.profile_function(function() { ftdoc.remove_unused_items(doc); }, "Remove unused items");
|
||||
ft.profile_function(function() { ftdoc.prepare_all_bitmaps(doc); }, "Prepare all bitmaps");
|
||||
ft.profile_function(function() { ftdoc.unlock_all_timelines(doc); }, "Unlock all timelines");
|
||||
ft.profile_function(function() { ftdoc.calculate_item_scales(doc); }, "Calculate item scales");
|
||||
ft.profile_function(function() { ftdoc.optimize_all_timelines(doc); }, "Optimize all timelines");
|
||||
ft.profile_function(function() { ftdoc.rasterize_all_shapes(doc); }, "Rasterize all shapes");
|
||||
ft.profile_function(function() { ftdoc.export_swf(doc); }, "Export swf");
|
||||
};
|
||||
|
||||
ftdoc.get_temp = function (doc) {
|
||||
if (!ftdoc.hasOwnProperty("temp")) {
|
||||
ftdoc["temp"] = {
|
||||
max_scales : {}
|
||||
}
|
||||
}
|
||||
return ftdoc["temp"];
|
||||
};
|
||||
|
||||
ftdoc.calculate_item_final_scale = function (doc, optional_item) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert_if_defined(optional_item, LibraryItem);
|
||||
var final_scale = ft.graphics_scale;
|
||||
if (optional_item && (ft.optimize_big_items || ft.optimize_small_items)) {
|
||||
var item_name = optional_item.name;
|
||||
var max_scales = ftdoc.get_temp(doc).max_scales;
|
||||
if (max_scales.hasOwnProperty(item_name)) {
|
||||
var max_scale = max_scales[item_name];
|
||||
var big_item = ft.optimize_big_items && (max_scale - ft.scale_precision > 1.0);
|
||||
var small_item = ft.optimize_small_items && (max_scale + ft.scale_precision < 1.0);
|
||||
if (big_item || small_item) {
|
||||
final_scale *= max_scale;
|
||||
}
|
||||
}
|
||||
}
|
||||
return final_scale;
|
||||
};
|
||||
|
||||
ftdoc.convert_selection_to_bitmap = function (doc, optional_item) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert_if_defined(optional_item, LibraryItem);
|
||||
var final_scale = ftdoc.calculate_item_final_scale(doc, optional_item);
|
||||
if (ft.approximately(final_scale, 1.0, ft.scale_precision)) {
|
||||
doc.convertSelectionToBitmap();
|
||||
} else {
|
||||
var wrapper_item_name = ft.gen_unique_name();
|
||||
var wrapper_item = doc.convertToSymbol("graphic", wrapper_item_name , "top left");
|
||||
fttim.recursive_scale_filters(doc, wrapper_item.timeline, final_scale);
|
||||
var elem = doc.selection[0];
|
||||
var elem_x = elem.x;
|
||||
var elem_y = elem.y;
|
||||
var elem_w = elem.width;
|
||||
var elem_h = elem.height;
|
||||
doc.scaleSelection(final_scale, final_scale);
|
||||
doc.convertSelectionToBitmap();
|
||||
doc.scaleSelection(1.0 / final_scale, 1.0 / final_scale);
|
||||
var new_elem = doc.selection[0];
|
||||
new_elem.x = elem_x;
|
||||
new_elem.y = elem_y;
|
||||
new_elem.width = elem_w;
|
||||
new_elem.height = elem_h;
|
||||
}
|
||||
};
|
||||
|
||||
ftdoc.prepare_folders = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
var export_folder = ftdoc.get_export_folder(doc);
|
||||
if (!FLfile.exists(export_folder) && !FLfile.createFolder(export_folder)) {
|
||||
throw "Can't create document export folder ({0})!"
|
||||
.format(export_folder);
|
||||
}
|
||||
};
|
||||
|
||||
ftdoc.get_export_folder = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
return ft.combine_path(
|
||||
ft.escape_path(doc.pathURI),
|
||||
ft.export_path_postfix + "/");
|
||||
};
|
||||
|
||||
ftdoc.full_exit_edit_mode = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
for (var i = 0; i < 100; ++i) {
|
||||
doc.exitEditMode();
|
||||
}
|
||||
};
|
||||
|
||||
ftdoc.remove_unused_items = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
var unused_items = doc.library.unusedItems;
|
||||
if (unused_items && unused_items !== undefined) {
|
||||
ft.array_reverse_foreach(unused_items, function(item) {
|
||||
if (ft.verbose_mode) {
|
||||
ft.trace_fmt("Remove unused item: {0}", item.name);
|
||||
}
|
||||
doc.library.deleteItem(item.name);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
ftdoc.unlock_all_timelines = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
ftlib.unlock_all_timelines(doc, doc.library);
|
||||
fttim.unlock(doc.getTimeline());
|
||||
};
|
||||
|
||||
ftdoc.calculate_item_scales = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
|
||||
var max_scales = ftdoc.get_temp(doc).max_scales;
|
||||
|
||||
var walk_by_timeline = function(timeline, func, acc) {
|
||||
ft.type_assert(timeline, Timeline);
|
||||
ft.type_assert(func, Function);
|
||||
ft.array_foreach(timeline.layers, function (layer) {
|
||||
ft.array_foreach(layer.frames, function (frame) {
|
||||
ft.array_foreach(frame.elements, function (elem) {
|
||||
walk_by_timeline(
|
||||
elem.libraryItem.timeline,
|
||||
func,
|
||||
func(elem, acc));
|
||||
}, fttim.is_symbol_instance);
|
||||
}, fttim.is_keyframe);
|
||||
});
|
||||
};
|
||||
|
||||
var walk_by_library = function(lib, func, acc) {
|
||||
ft.type_assert(lib, Library);
|
||||
ft.type_assert(func, Function);
|
||||
ft.array_foreach(lib.items, function (item) {
|
||||
walk_by_timeline(item.timeline, func, acc)
|
||||
}, ftlib.is_symbol_item);
|
||||
};
|
||||
|
||||
var x_func = function(elem, acc) {
|
||||
var elem_sx = elem.scaleX * acc;
|
||||
var item_name = elem.libraryItem.name;
|
||||
max_scales[item_name] = Math.max(
|
||||
max_scales.hasOwnProperty(item_name) ? max_scales[item_name] : elem_sx,
|
||||
elem_sx);
|
||||
return elem_sx;
|
||||
};
|
||||
|
||||
var y_func = function(elem, acc) {
|
||||
var elem_sy = elem.scaleY * acc;
|
||||
var item_name = elem.libraryItem.name;
|
||||
max_scales[item_name] = Math.max(
|
||||
max_scales.hasOwnProperty(item_name) ? max_scales[item_name] : elem_sy,
|
||||
elem_sy);
|
||||
return elem_sy;
|
||||
};
|
||||
|
||||
walk_by_library(doc.library, x_func, 1.0);
|
||||
walk_by_timeline(doc.getTimeline(), x_func, 1.0);
|
||||
|
||||
walk_by_library(doc.library, y_func, 1.0);
|
||||
walk_by_timeline(doc.getTimeline(), y_func, 1.0);
|
||||
|
||||
if (ft.verbose_mode) {
|
||||
for (var item_name in max_scales) {
|
||||
var max_scale = max_scales.hasOwnProperty(item_name) ? max_scales[item_name] : 1.0;
|
||||
if (max_scale - ft.scale_precision > 1.0) {
|
||||
ft.trace_fmt("Big item for optimize: {0} - {1}", item_name, max_scale);
|
||||
} else if (max_scale + ft.scale_precision < 1.0) {
|
||||
ft.trace_fmt("Small item for optimize: {0} - {1}", item_name, max_scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ftdoc.optimize_all_timelines = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
if (ft.optimize_static_items) {
|
||||
ft.profile_function(function () {
|
||||
ftlib.optimize_static_items(doc, doc.library);
|
||||
}, "Optimize static items");
|
||||
}
|
||||
if (ft.optimize_single_graphics) {
|
||||
ft.profile_function(function () {
|
||||
ftlib.optimize_single_graphics(doc, doc.library);
|
||||
}, "Optimize single graphics");
|
||||
}
|
||||
};
|
||||
|
||||
ftdoc.rasterize_all_shapes = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
ftlib.rasterize_all_shapes(doc, doc.library);
|
||||
fttim.rasterize_all_shapes(doc, doc.getTimeline());
|
||||
};
|
||||
|
||||
ftdoc.prepare_all_bitmaps = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
ftlib.prepare_all_bitmaps(doc.library);
|
||||
};
|
||||
|
||||
ftdoc.export_swf = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.trace_fmt("!!!Document!!!: '{0}' conversion complete!", doc.name);
|
||||
doc.exportSWF(ftdoc.get_export_swf_path(doc));
|
||||
};
|
||||
|
||||
ftdoc.get_export_swf_path = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
return ft.combine_path(
|
||||
ftdoc.get_export_folder(doc),
|
||||
doc.name + ".swf");
|
||||
};
|
||||
|
||||
//
|
||||
// library
|
||||
//
|
||||
|
||||
var ftlib = {};
|
||||
|
||||
ftlib.is_folder_item = function (item) {
|
||||
ft.type_assert(item, LibraryItem);
|
||||
return item.itemType == "folder";
|
||||
};
|
||||
|
||||
ftlib.is_bitmap_item = function (item) {
|
||||
ft.type_assert(item, LibraryItem);
|
||||
return item.itemType == "bitmap";
|
||||
};
|
||||
|
||||
ftlib.is_symbol_item = function (item) {
|
||||
ft.type_assert(item, LibraryItem);
|
||||
return item.itemType == "graphic" || item.itemType == "movie clip";
|
||||
};
|
||||
|
||||
ftlib.find_item_by_name = function (library, item_name) {
|
||||
ft.type_assert(library, Library);
|
||||
ft.type_assert(item_name, 'string');
|
||||
for (var i = 0; i < library.items.length; ++i) {
|
||||
var item = library.items[i];
|
||||
if (item.name == item_name) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
ftlib.edit_all_items = function (doc, library, func, filter) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(library, Library);
|
||||
ft.type_assert(func, Function);
|
||||
ft.type_assert_if_defined(filter, Function);
|
||||
ft.array_foreach(library.items, function (item) {
|
||||
if (library.editItem(item.name)) {
|
||||
func(item);
|
||||
doc.exitEditMode();
|
||||
}
|
||||
}, filter);
|
||||
};
|
||||
|
||||
ftlib.edit_all_symbol_items = function (doc, library, func) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(library, Library);
|
||||
ft.type_assert(func, Function);
|
||||
ftlib.edit_all_items(doc, library, func, ftlib.is_symbol_item);
|
||||
};
|
||||
|
||||
ftlib.unlock_all_timelines = function (doc, library) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(library, Library);
|
||||
ftlib.edit_all_symbol_items(doc, library, function (item) {
|
||||
fttim.unlock(item.timeline);
|
||||
});
|
||||
};
|
||||
|
||||
ftlib.optimize_static_items = function (doc, library) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(library, Library);
|
||||
|
||||
var replaces = {};
|
||||
ft.array_reverse_foreach(library.items, function (item) {
|
||||
var new_item_name = ft.gen_unique_name();
|
||||
if (ftlib.bake_symbol_item(doc, library, item.name, new_item_name, 0)) {
|
||||
replaces[item.name] = new_item_name;
|
||||
if (ft.verbose_mode) {
|
||||
ft.trace_fmt("Optimize static item: '{0}'", item.name);
|
||||
}
|
||||
} else {
|
||||
if (ft.verbose_mode) {
|
||||
ft.trace_fmt("NOT Optimize static item: '{0}'", item.name);
|
||||
}
|
||||
}
|
||||
}, function (item) {
|
||||
return ftlib.is_symbol_item(item) && fttim.is_static(item.timeline);
|
||||
});
|
||||
|
||||
ftlib.edit_all_symbol_items(doc, library, function (item) {
|
||||
fttim.replace_baked_symbols(doc, item.timeline, replaces);
|
||||
});
|
||||
fttim.replace_baked_symbols(doc, doc.getTimeline(), replaces);
|
||||
};
|
||||
|
||||
ftlib.bake_symbol_item = function (doc, library, item_name, new_item_name, first_frame) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(library, Library);
|
||||
ft.type_assert(item_name, 'string');
|
||||
ft.type_assert(new_item_name, 'string');
|
||||
ft.type_assert(first_frame, 'number');
|
||||
|
||||
if (library.itemExists(new_item_name)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var item = ftlib.find_item_by_name(library, item_name);
|
||||
if (!item) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var item_frame_area = fttim.calculate_frame_area(item.timeline, first_frame);
|
||||
var item_elems_area = fttim.calculate_elems_area(item.timeline, first_frame);
|
||||
|
||||
if (ft.verbose_mode) {
|
||||
ft.trace_fmt(
|
||||
"Library item: '{0}'\n- frame area: {1}\n- elems area: {2}",
|
||||
item_name, item_frame_area, item_elems_area);
|
||||
}
|
||||
|
||||
if (item_frame_area >= item_elems_area) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!library.addNewItem("graphic", new_item_name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!library.editItem(new_item_name)) {
|
||||
library.deleteItem(new_item_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (library.addItemToDocument({x: 0, y: 0}, item_name)) {
|
||||
var new_item_elem = doc.selection[0];
|
||||
new_item_elem.symbolType = "graphic";
|
||||
new_item_elem.firstFrame = first_frame;
|
||||
new_item_elem.setTransformationPoint({x: 0, y: 0});
|
||||
new_item_elem.transformX = 0;
|
||||
new_item_elem.transformY = 0;
|
||||
ftdoc.convert_selection_to_bitmap(doc, item);
|
||||
doc.exitEditMode();
|
||||
return true;
|
||||
} else {
|
||||
doc.exitEditMode();
|
||||
library.deleteItem(new_item_name);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
ftlib.optimize_single_graphics = function (doc, library) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(library, Library);
|
||||
ft.array_reverse_foreach(library.items, function (item) {
|
||||
fttim.optimize_single_graphics(doc, item.timeline, item);
|
||||
}, ftlib.is_symbol_item);
|
||||
fttim.optimize_single_graphics(doc, doc.getTimeline(), null);
|
||||
};
|
||||
|
||||
ftlib.rasterize_all_shapes = function (doc, library) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(library, Library);
|
||||
ftlib.edit_all_symbol_items(doc, library, function (item) {
|
||||
fttim.rasterize_all_shapes(doc, item.timeline);
|
||||
});
|
||||
};
|
||||
|
||||
ftlib.prepare_all_bitmaps = function (library) {
|
||||
ft.type_assert(library, Library);
|
||||
ft.array_foreach(library.items, function (item) {
|
||||
item.compressionType = "lossless";
|
||||
}, ftlib.is_bitmap_item);
|
||||
};
|
||||
|
||||
//
|
||||
// timeline
|
||||
//
|
||||
|
||||
var fttim = {};
|
||||
|
||||
fttim.is_shape_instance = function (elem) {
|
||||
return elem.elementType == "shape";
|
||||
};
|
||||
|
||||
fttim.is_symbol_instance = function (elem) {
|
||||
return elem.elementType == "instance" && elem.instanceType == "symbol";
|
||||
};
|
||||
|
||||
fttim.is_symbol_graphic_instance = function (elem) {
|
||||
return fttim.is_symbol_instance(elem) && elem.symbolType == "graphic";
|
||||
};
|
||||
|
||||
fttim.is_symbol_graphic_single_frame_instance = function (elem) {
|
||||
return fttim.is_symbol_instance(elem) && elem.symbolType == "graphic" && elem.loop == "single frame";
|
||||
};
|
||||
|
||||
fttim.is_symbol_movie_clip_instance = function (elem) {
|
||||
return fttim.is_symbol_instance(elem) && elem.symbolType == "movie clip";
|
||||
};
|
||||
|
||||
fttim.is_shape_frame = function (frame) {
|
||||
ft.type_assert(frame, Frame);
|
||||
return frame.tweenType == "shape";
|
||||
};
|
||||
|
||||
fttim.is_keyframe = function (frame, frame_index) {
|
||||
ft.type_assert(frame, Frame);
|
||||
ft.type_assert(frame_index, 'number');
|
||||
return frame.startFrame == frame_index;
|
||||
};
|
||||
|
||||
fttim.is_not_guide_layer = function(layer) {
|
||||
ft.type_assert(layer, Layer);
|
||||
return layer.layerType != "guide";
|
||||
};
|
||||
|
||||
fttim.unlock = function (timeline) {
|
||||
ft.type_assert(timeline, Timeline);
|
||||
ft.array_foreach(timeline.layers, function (layer) {
|
||||
layer.locked = false;
|
||||
layer.visible = true;
|
||||
});
|
||||
};
|
||||
|
||||
fttim.calculate_elems_area = function (timeline, frame_index) {
|
||||
ft.type_assert(timeline, Timeline);
|
||||
ft.type_assert(frame_index, 'number');
|
||||
return ft.array_foldl(timeline.layers, function (layer, acc) {
|
||||
if (frame_index >= 0 && frame_index < layer.frames.length) {
|
||||
return ft.array_foldl(layer.frames[frame_index].elements, function (elem, acc2) {
|
||||
return acc2 + Math.round(elem.width) * Math.round(elem.height);
|
||||
}, acc);
|
||||
} else {
|
||||
return acc;
|
||||
}
|
||||
}, 0);
|
||||
};
|
||||
|
||||
fttim.calculate_frame_area = function (timeline, frame_index) {
|
||||
ft.type_assert(timeline, Timeline);
|
||||
ft.type_assert(frame_index, 'number');
|
||||
var bounds = ft.array_foldl(timeline.layers, function (layer, acc) {
|
||||
if (frame_index >= 0 && frame_index < layer.frames.length) {
|
||||
return ft.array_foldl(layer.frames[frame_index].elements, function (elem, acc2) {
|
||||
acc2.left = Math.min(acc2.left, elem.left);
|
||||
acc2.right = Math.max(acc2.right, elem.left + elem.width);
|
||||
acc2.top = Math.min(acc2.top, elem.top);
|
||||
acc2.bottom = Math.max(acc2.bottom, elem.top + elem.height);
|
||||
return acc2;
|
||||
}, acc);
|
||||
} else {
|
||||
return acc;
|
||||
}
|
||||
}, {
|
||||
left: Number.POSITIVE_INFINITY,
|
||||
right: Number.NEGATIVE_INFINITY,
|
||||
top: Number.POSITIVE_INFINITY,
|
||||
bottom: Number.NEGATIVE_INFINITY
|
||||
});
|
||||
var frame_width = Math.max(0, bounds.right - bounds.left);
|
||||
var frame_height = Math.max(0, bounds.bottom - bounds.top);
|
||||
return Math.round(frame_width) * Math.round(frame_height);
|
||||
}
|
||||
|
||||
fttim.recursive_scale_filters = function (doc, timeline, scale) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(timeline, Timeline);
|
||||
ft.array_foreach(timeline.layers, function (layer) {
|
||||
ft.array_foreach(layer.frames, function (frame, frame_index) {
|
||||
ft.array_foreach(frame.elements, function (elem) {
|
||||
var elem_filters = elem.filters;
|
||||
if (elem_filters && elem_filters !== undefined) {
|
||||
ft.array_foreach(elem_filters, function (elem_filter, filter_index) {
|
||||
elem_filter.blurX *= scale;
|
||||
elem_filter.blurY *= scale;
|
||||
});
|
||||
elem.filters = elem_filters;
|
||||
}
|
||||
fttim.recursive_scale_filters(doc, elem.libraryItem.timeline, scale);
|
||||
}, fttim.is_symbol_instance);
|
||||
}, fttim.is_keyframe);
|
||||
}, fttim.is_not_guide_layer);
|
||||
};
|
||||
|
||||
fttim.replace_baked_symbols = function (doc, timeline, replaces) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(timeline, Timeline);
|
||||
ft.array_foreach(timeline.layers, function (layer) {
|
||||
ft.array_foreach(layer.frames, function (frame, frame_index) {
|
||||
if (timeline.currentFrame != frame_index) {
|
||||
timeline.currentFrame = frame_index;
|
||||
}
|
||||
ft.array_foreach(frame.elements, function (elem) {
|
||||
if (replaces.hasOwnProperty(elem.libraryItem.name)) {
|
||||
doc.selectNone();
|
||||
doc.selection = [elem];
|
||||
doc.swapElement(replaces[elem.libraryItem.name]);
|
||||
}
|
||||
}, fttim.is_symbol_instance);
|
||||
}, fttim.is_keyframe);
|
||||
}, fttim.is_not_guide_layer);
|
||||
};
|
||||
|
||||
fttim.optimize_single_graphics = function (doc, timeline, opt_item) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(timeline, Timeline);
|
||||
ft.array_foreach(timeline.layers, function (layer) {
|
||||
ft.array_foreach(layer.frames, function (frame, frame_index) {
|
||||
ft.array_foreach(frame.elements, function (elem) {
|
||||
var lib_item_name = elem.libraryItem.name;
|
||||
var lib_item_cache_name = "ft_cache_name_" + lib_item_name + "_" + elem.firstFrame;
|
||||
if (ftlib.bake_symbol_item(doc, doc.library, lib_item_name, lib_item_cache_name, elem.firstFrame)) {
|
||||
if (ft.verbose_mode) {
|
||||
ft.trace_fmt("Optimize single graphic '{0}' for frame '{1}' in '{2}'",
|
||||
lib_item_name, elem.firstFrame, timeline.name);
|
||||
}
|
||||
if (opt_item == null || doc.library.editItem(opt_item.name)) {
|
||||
if (timeline.currentFrame != frame_index) {
|
||||
timeline.currentFrame = frame_index;
|
||||
}
|
||||
doc.selectNone();
|
||||
doc.selection = [elem];
|
||||
doc.swapElement(lib_item_cache_name);
|
||||
doc.selection[0].firstFrame = 0;
|
||||
doc.exitEditMode();
|
||||
}
|
||||
} else {
|
||||
if (ft.verbose_mode) {
|
||||
ft.trace_fmt("NOT Optimize single graphic '{0}' for frame '{1}' in '{2}'",
|
||||
lib_item_name, elem.firstFrame, timeline.name);
|
||||
}
|
||||
}
|
||||
}, function (elem) {
|
||||
return fttim.is_symbol_graphic_single_frame_instance(elem) && !fttim.is_static(elem.libraryItem.timeline);
|
||||
});
|
||||
}, fttim.is_keyframe);
|
||||
}, fttim.is_not_guide_layer);
|
||||
};
|
||||
|
||||
fttim.is_static = function (timeline) {
|
||||
ft.type_assert(timeline, Timeline);
|
||||
if (timeline.frameCount > 1) {
|
||||
return false;
|
||||
}
|
||||
return ft.array_foldl(timeline.layers, function (layer, acc) {
|
||||
return ft.array_foldl(layer.frames, function (frame, acc2) {
|
||||
return ft.array_foldl(frame.elements, function (elem, acc3) {
|
||||
return acc3 && fttim.is_symbol_instance(elem) ? elem.blendMode != "erase" && (fttim.is_symbol_graphic_single_frame_instance(elem) || fttim.is_static(elem.libraryItem.timeline)) : acc3;
|
||||
}, acc2);
|
||||
}, acc);
|
||||
}, true);
|
||||
};
|
||||
|
||||
fttim.rasterize_all_shapes = function (doc, timeline) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(timeline, Timeline);
|
||||
|
||||
ft.array_reverse_foreach(timeline.layers, function (layer, layer_index) {
|
||||
timeline.setSelectedLayers(layer_index);
|
||||
ft.array_foreach(layer.frames, function (frame, frame_index) {
|
||||
if ( ft.is_function(frame.convertToFrameByFrameAnimation) ) {
|
||||
frame.convertToFrameByFrameAnimation();
|
||||
} else {
|
||||
throw "Animation uses shape tweens. To export this animation you should use Adobe Animate CC or higher!";
|
||||
}
|
||||
}, function (frame, frame_index) {
|
||||
return fttim.is_keyframe(frame, frame_index) && fttim.is_shape_frame(frame);
|
||||
});
|
||||
}, fttim.is_not_guide_layer);
|
||||
|
||||
var any_rasterize = false;
|
||||
ft.array_reverse_foreach(timeline.layers, function (layer, layer_index) {
|
||||
timeline.setSelectedLayers(layer_index);
|
||||
ft.array_foreach(layer.frames, function (frame, frame_index) {
|
||||
timeline.currentFrame = frame_index;
|
||||
timeline.setSelectedFrames(frame_index, frame_index + 1, true);
|
||||
doc.selectNone();
|
||||
doc.selection = ft.array_filter(frame.elements, fttim.is_shape_instance);
|
||||
if (doc.selection.length > 0) {
|
||||
ftdoc.convert_selection_to_bitmap(doc, timeline.libraryItem);
|
||||
doc.arrange("back");
|
||||
any_rasterize = true;
|
||||
}
|
||||
}, fttim.is_keyframe);
|
||||
}, fttim.is_not_guide_layer);
|
||||
if (any_rasterize && ft.verbose_mode) {
|
||||
ft.trace_fmt("Rasterize vector shapes in '{0}'", timeline.name);
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
// main
|
||||
//
|
||||
|
||||
(function () {
|
||||
ft.clear_output();
|
||||
fl.showIdleMessage(false);
|
||||
ft.trace("- Start -");
|
||||
ft.array_foreach(fl.documents, function (doc) {
|
||||
try {
|
||||
ft.trace_fmt("!!!Document!!!: '{0}'", doc.name);
|
||||
ftdoc.prepare(doc);
|
||||
} catch (e) {
|
||||
ft.trace_fmt("!!!Document!!!: '{0}' conversion error: '{1}'", doc.name, e);
|
||||
}
|
||||
});
|
||||
ft.profile_function(function () {
|
||||
ft.array_foreach(fl.documents, function (doc) {
|
||||
if (doc.canRevert()) {
|
||||
fl.revertDocument(doc);
|
||||
}
|
||||
});
|
||||
}, "Revert documents");
|
||||
ft.trace("- Finish -");
|
||||
})();
|
||||
})();
|
||||
var script_dir = fl.scriptURI.replace('FlashExport.jsfl', '');
|
||||
fl.runScript(script_dir + 'Internal/FTBase.jsfl');
|
||||
fl.runScript(script_dir + 'Internal/FTMain.jsfl', "ft_main", {
|
||||
graphics_scale : 1.0
|
||||
});
|
||||
@@ -1,6 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4a1ba4a960de04365b94351f8c3f24d0
|
||||
timeCreated: 1472974636
|
||||
guid: 7646daba632cc4e63997be01363bc478
|
||||
timeCreated: 1495135907
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
|
||||
5
Assets/FlashTools/FlashExport/FlashExport_HD.jsfl
Normal file
@@ -0,0 +1,5 @@
|
||||
var script_dir = fl.scriptURI.replace('FlashExport_HD.jsfl', '');
|
||||
fl.runScript(script_dir + 'Internal/FTBase.jsfl');
|
||||
fl.runScript(script_dir + 'Internal/FTMain.jsfl', "ft_main", {
|
||||
graphics_scale : 2.0
|
||||
});
|
||||
8
Assets/FlashTools/FlashExport/FlashExport_HD.jsfl.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da5312cca96fd439c854e5cea0aa8eb5
|
||||
timeCreated: 1495136101
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
5
Assets/FlashTools/FlashExport/FlashExport_SD.jsfl
Normal file
@@ -0,0 +1,5 @@
|
||||
var script_dir = fl.scriptURI.replace('FlashExport_SD.jsfl', '');
|
||||
fl.runScript(script_dir + 'Internal/FTBase.jsfl');
|
||||
fl.runScript(script_dir + 'Internal/FTMain.jsfl', "ft_main", {
|
||||
graphics_scale : 0.5
|
||||
});
|
||||
8
Assets/FlashTools/FlashExport/FlashExport_SD.jsfl.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 16e7c78934deb4375b76aebfee58b550
|
||||
timeCreated: 1495136690
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/FlashTools/FlashExport/Internal.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c77692aa8dc1141c6897240794676fd8
|
||||
folderAsset: yes
|
||||
timeCreated: 1495136428
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
238
Assets/FlashTools/FlashExport/Internal/FTBase.jsfl
Normal file
@@ -0,0 +1,238 @@
|
||||
if (!Array.prototype.peek) {
|
||||
Array.prototype.peek = function () {
|
||||
return this[this.length - 1];
|
||||
};
|
||||
}
|
||||
|
||||
if (!String.prototype.format) {
|
||||
String.prototype.format = function () {
|
||||
var args = arguments;
|
||||
return this.replace(/{(\d+)}/g, function (match, number) {
|
||||
return typeof args[number] != 'undefined' ? args[number] : match;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
ft = {};
|
||||
|
||||
ft.trace = function () {
|
||||
fl.outputPanel.trace(
|
||||
Array.prototype.join.call(arguments, " "));
|
||||
};
|
||||
|
||||
ft.trace_fmt = function (format) {
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
ft.trace(format.format.apply(format, args));
|
||||
};
|
||||
|
||||
ft.clear_output = function () {
|
||||
fl.outputPanel.clear();
|
||||
};
|
||||
|
||||
ft.assert = function (expr, format) {
|
||||
if (!expr) {
|
||||
if (format === undefined) {
|
||||
throw "!!!Assert!!!";
|
||||
} else {
|
||||
var args = Array.prototype.slice.call(arguments, 2);
|
||||
throw "!!!Assert!!! " + format.format.apply(format, args);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ft.type_assert = function (item, type) {
|
||||
var type_is_string = (typeof type === 'string');
|
||||
ft.assert(
|
||||
(type_is_string && typeof item === type) ||
|
||||
(!type_is_string && item instanceof type),
|
||||
"Type error: {0} != {1}",
|
||||
typeof item,
|
||||
type_is_string ? type : type.constructor.name);
|
||||
};
|
||||
|
||||
ft.type_assert_if_defined = function (item, type) {
|
||||
if (item && item !== undefined) {
|
||||
ft.type_assert(item, type);
|
||||
}
|
||||
};
|
||||
|
||||
ft.is_function = function (func) {
|
||||
return func && typeof(func) === 'function';
|
||||
};
|
||||
|
||||
ft.profile_function = function (verbose, func, msg) {
|
||||
ft.type_assert(verbose, 'boolean');
|
||||
ft.type_assert(func, Function);
|
||||
ft.type_assert(msg, 'string');
|
||||
if (!ft.profile_function_stack) {
|
||||
ft.profile_function_stack = [];
|
||||
}
|
||||
if (!ft.profile_function_level) {
|
||||
ft.profile_function_level = 0;
|
||||
}
|
||||
var stack_index = ft.profile_function_stack.length;
|
||||
ft.profile_function_stack.push({
|
||||
msg: msg,
|
||||
level: ft.profile_function_level,
|
||||
time: 0
|
||||
});
|
||||
++ft.profile_function_level;
|
||||
var func_time = ft.get_call_function_time(func);
|
||||
--ft.profile_function_level;
|
||||
ft.profile_function_stack[stack_index].time = func_time;
|
||||
if (stack_index === 0) {
|
||||
for (var i = 0; i < ft.profile_function_stack.length; ++i) {
|
||||
var info = ft.profile_function_stack[i];
|
||||
var ident = "-";
|
||||
for (var j = 0; j < info.level; ++j) {
|
||||
ident += "-";
|
||||
}
|
||||
if (verbose) {
|
||||
ft.trace_fmt("{0} [Profile] {1} ({2}s)", ident, info.msg, info.time);
|
||||
}
|
||||
}
|
||||
ft.profile_function_stack = [];
|
||||
}
|
||||
};
|
||||
|
||||
ft.get_call_function_time = function (func) {
|
||||
ft.type_assert(func, Function);
|
||||
var b_time = Date.now();
|
||||
func();
|
||||
var e_time = Date.now();
|
||||
return (e_time - b_time) / 1000;
|
||||
};
|
||||
|
||||
ft.escape_path = function (path) {
|
||||
ft.type_assert(path, 'string');
|
||||
return path.replace(/ /g, '%20');
|
||||
};
|
||||
|
||||
ft.escape_string = function (str) {
|
||||
ft.type_assert(str, 'string');
|
||||
return str
|
||||
.replace(/\&/g, '&')
|
||||
.replace(/\"/g, '"')
|
||||
.replace(/\'/g, ''')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>');
|
||||
};
|
||||
|
||||
ft.combine_path = function (lhs, rhs) {
|
||||
ft.type_assert(lhs, 'string');
|
||||
ft.type_assert(rhs, 'string');
|
||||
return ft.escape_path(lhs) + ft.escape_path(rhs);
|
||||
};
|
||||
|
||||
ft.array_any = function (arr, func) {
|
||||
ft.type_assert(arr, Array);
|
||||
ft.type_assert(func, Function);
|
||||
for (var index = 0; index < arr.length; ++index) {
|
||||
var value = arr[index];
|
||||
if (func(value)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
ft.array_foldl = function (arr, func, acc) {
|
||||
ft.type_assert(arr, Array);
|
||||
ft.type_assert(func, Function);
|
||||
for (var index = 0; index < arr.length; ++index) {
|
||||
var value = arr[index];
|
||||
acc = func(value, acc);
|
||||
}
|
||||
return acc;
|
||||
};
|
||||
|
||||
ft.array_foldr = function (arr, func, acc) {
|
||||
ft.type_assert(arr, Array);
|
||||
ft.type_assert(func, Function);
|
||||
for (var index = arr.length - 1; index >= 0; --index) {
|
||||
var value = arr[index];
|
||||
acc = func(value, acc);
|
||||
}
|
||||
return acc;
|
||||
};
|
||||
|
||||
ft.array_clone = function (arr) {
|
||||
ft.type_assert(arr, Array);
|
||||
return arr.concat();
|
||||
};
|
||||
|
||||
ft.array_filter = function (arr, filter) {
|
||||
ft.type_assert(arr, Array);
|
||||
ft.type_assert(filter, Function);
|
||||
var new_arr = [];
|
||||
for (var index = 0; index < arr.length; ++index) {
|
||||
var value = arr[index];
|
||||
if (filter(value, index)) {
|
||||
new_arr.push(value);
|
||||
}
|
||||
}
|
||||
return new_arr;
|
||||
};
|
||||
|
||||
ft.array_merge = function (arrA, arrB) {
|
||||
ft.type_assert(arrA, Array);
|
||||
ft.type_assert(arrB, Array);
|
||||
return arrA.concat(ft.array_filter(arrB, function (value) {
|
||||
return !ft.array_contains(arrA, value);
|
||||
}));
|
||||
};
|
||||
|
||||
ft.array_contains = function (arr, elem) {
|
||||
ft.type_assert(arr, Array);
|
||||
return arr.indexOf(elem) >= 0;
|
||||
};
|
||||
|
||||
ft.array_foreach = function (arr, func, filter) {
|
||||
ft.type_assert(arr, Array);
|
||||
ft.type_assert(func, Function);
|
||||
ft.type_assert_if_defined(filter, Function);
|
||||
for (var index = 0; index < arr.length; ++index) {
|
||||
var value = arr[index];
|
||||
if (filter === undefined || filter(value, index)) {
|
||||
func(value, index);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ft.array_group_by = function (arr, func) {
|
||||
return ft.array_foldl(arr, function (value, acc) {
|
||||
if (acc.length > 0 && func(acc.peek().peek()) === func(value)) {
|
||||
acc.peek().push(value);
|
||||
} else {
|
||||
acc.push([value]);
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
};
|
||||
|
||||
ft.array_reverse_foreach = function (arr, func, filter) {
|
||||
ft.type_assert(arr, Array);
|
||||
ft.type_assert(func, Function);
|
||||
ft.type_assert_if_defined(filter, Function);
|
||||
for (var index = arr.length - 1; index >= 0; --index) {
|
||||
var value = arr[index];
|
||||
if (filter === undefined || filter(value, index)) {
|
||||
func(value, index);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ft.approximately = function(a, b, precision) {
|
||||
ft.type_assert(a, 'number');
|
||||
ft.type_assert(b, 'number');
|
||||
ft.type_assert(precision, 'number');
|
||||
return Math.abs(b - a) < Math.abs(precision);
|
||||
};
|
||||
|
||||
ft.gen_unique_name = function () {
|
||||
if (!ft.gen_unique_name_index) {
|
||||
ft.gen_unique_name_index = 0;
|
||||
}
|
||||
++ft.gen_unique_name_index;
|
||||
return "ft_unique_name_" + ft.gen_unique_name_index;
|
||||
};
|
||||
8
Assets/FlashTools/FlashExport/Internal/FTBase.jsfl.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1332fd3507afd4431af5d795f220d01e
|
||||
timeCreated: 1495302866
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
955
Assets/FlashTools/FlashExport/Internal/FTMain.jsfl
Normal file
@@ -0,0 +1,955 @@
|
||||
ft_main = function (opts) {
|
||||
opts = opts || {};
|
||||
|
||||
//
|
||||
// config
|
||||
//
|
||||
|
||||
var cfg = {
|
||||
profile_mode : opts.profile_mode === undefined ? false : opts.profile_mode,
|
||||
verbose_mode : opts.verbose_mode === undefined ? false : opts.verbose_mode,
|
||||
|
||||
graphics_scale : opts.graphics_scale === undefined ? 1.0 : opts.graphics_scale,
|
||||
scale_precision : opts.scale_precision === undefined ? 0.01 : opts.scale_precision,
|
||||
|
||||
optimize_big_items : opts.optimize_big_items === undefined ? true : opts.optimize_big_items,
|
||||
optimize_small_items : opts.optimize_small_items === undefined ? true : opts.optimize_small_items,
|
||||
optimize_static_items : opts.optimize_static_items === undefined ? true : opts.optimize_static_items,
|
||||
optimize_single_graphics : opts.optimize_single_graphics === undefined ? true : opts.optimize_single_graphics,
|
||||
|
||||
open_documents : opts.open_documents === undefined ? [] : opts.open_documents,
|
||||
export_path_postfix : opts.export_path_postfix === undefined ? "_export" : opts.export_path_postfix,
|
||||
close_after_conversion : opts.close_after_conversion === undefined ? false : opts.close_after_conversion,
|
||||
revert_after_conversion : opts.revert_after_conversion === undefined ? true : opts.revert_after_conversion,
|
||||
max_convertible_selection : opts.max_convertible_selection === undefined ? 3900 : opts.max_convertible_selection
|
||||
};
|
||||
|
||||
//
|
||||
// document
|
||||
//
|
||||
|
||||
var ftdoc = {};
|
||||
|
||||
ftdoc.prepare = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.profile_function(cfg.profile_mode, function() { ftdoc.prepare_folders(doc); }, "Prepare folders");
|
||||
ft.profile_function(cfg.profile_mode, function() { ftdoc.full_exit_edit_mode(doc); }, "Full exit edit mode");
|
||||
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_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");
|
||||
ft.profile_function(cfg.profile_mode, function() { ftdoc.optimize_all_timelines(doc); }, "Optimize all timelines");
|
||||
ft.profile_function(cfg.profile_mode, function() { ftdoc.rasterize_all_shapes(doc); }, "Rasterize all shapes");
|
||||
ft.profile_function(cfg.profile_mode, function() { ftdoc.export_swf(doc); }, "Export swf");
|
||||
};
|
||||
|
||||
ftdoc.get_temp = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
if (!ftdoc.get_temp_ft_temp) {
|
||||
ftdoc.get_temp_ft_temp = {};
|
||||
}
|
||||
if (!ftdoc.get_temp_ft_temp[doc.pathURI]) {
|
||||
ftdoc.get_temp_ft_temp[doc.pathURI] = {
|
||||
max_scales : {}
|
||||
};
|
||||
}
|
||||
return ftdoc.get_temp_ft_temp[doc.pathURI];
|
||||
};
|
||||
|
||||
ftdoc.calculate_item_prefer_scale = function (doc, optional_item) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert_if_defined(optional_item, LibraryItem);
|
||||
var final_scale = cfg.graphics_scale;
|
||||
if (optional_item && (cfg.optimize_big_items || cfg.optimize_small_items)) {
|
||||
var item_name = optional_item.name;
|
||||
var max_scales = ftdoc.get_temp(doc).max_scales;
|
||||
if (max_scales && max_scales.hasOwnProperty(item_name)) {
|
||||
var max_scale = max_scales[item_name];
|
||||
var big_item = cfg.optimize_big_items && (max_scale - cfg.scale_precision > 1.0);
|
||||
var small_item = cfg.optimize_small_items && (max_scale + cfg.scale_precision < 1.0);
|
||||
if (big_item || small_item) {
|
||||
final_scale *= max_scale;
|
||||
}
|
||||
}
|
||||
}
|
||||
return final_scale;
|
||||
};
|
||||
|
||||
ftdoc.convert_selection_to_bitmap = function (doc, location_name, optional_item) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(location_name, 'string');
|
||||
ft.type_assert_if_defined(optional_item, LibraryItem);
|
||||
|
||||
var selection_r = doc.getSelectionRect();
|
||||
var selection_w = selection_r.right - selection_r.left;
|
||||
var selection_h = selection_r.bottom - selection_r.top;
|
||||
|
||||
var max_scale = cfg.max_convertible_selection / Math.max(selection_w, selection_h);
|
||||
var prefer_scale = ftdoc.calculate_item_prefer_scale(doc, optional_item);
|
||||
var final_scale = Math.min(prefer_scale, max_scale);
|
||||
|
||||
if (final_scale < prefer_scale) {
|
||||
var down_scale = Math.floor(final_scale / prefer_scale * 1000) * 0.001;
|
||||
ft.trace_fmt(
|
||||
"[Warning] {0}\n" +
|
||||
"- Converted element was downscaled ({1}x) to maximum allowed size ({2}px)",
|
||||
location_name, down_scale, cfg.max_convertible_selection);
|
||||
}
|
||||
|
||||
if (ft.approximately(final_scale, 1.0, cfg.scale_precision)) {
|
||||
(function() {
|
||||
var elem_r = doc.getSelectionRect();
|
||||
|
||||
var elem_x = elem_r.left;
|
||||
var elem_y = elem_r.top;
|
||||
var elem_w = elem_r.right - elem_r.left;
|
||||
var elem_h = elem_r.bottom - elem_r.top;
|
||||
|
||||
var elem_dx = Math.round(elem_x) - elem_x;
|
||||
var elem_dy = Math.round(elem_y) - elem_y;
|
||||
var elem_dw = Math.round(elem_w) - elem_w;
|
||||
var elem_dh = Math.round(elem_h) - elem_h;
|
||||
|
||||
doc.convertSelectionToBitmap();
|
||||
var elem = doc.selection[0];
|
||||
|
||||
elem.x -= elem_dx;
|
||||
elem.y -= elem_dy;
|
||||
elem.width -= elem_dw;
|
||||
elem.height -= elem_dh;
|
||||
})();
|
||||
} else {
|
||||
(function() {
|
||||
var wrapper_item_name = ft.gen_unique_name();
|
||||
var wrapper_item = doc.convertToSymbol("graphic", wrapper_item_name , "top left");
|
||||
fttim.recursive_scale_filters(doc, wrapper_item, final_scale);
|
||||
|
||||
var elem = doc.selection[0];
|
||||
elem.setTransformationPoint({x: 0, y: 0});
|
||||
doc.scaleSelection(final_scale, final_scale);
|
||||
|
||||
var elem_x = elem.x;
|
||||
var elem_y = elem.y;
|
||||
var elem_w = elem.width;
|
||||
var elem_h = elem.height;
|
||||
|
||||
var elem_dx = Math.round(elem_x) - elem_x;
|
||||
var elem_dy = Math.round(elem_y) - elem_y;
|
||||
var elem_dw = Math.round(elem_w) - elem_w;
|
||||
var elem_dh = Math.round(elem_h) - elem_h;
|
||||
|
||||
doc.convertSelectionToBitmap();
|
||||
elem = doc.selection[0];
|
||||
|
||||
elem.x -= elem_dx;
|
||||
elem.y -= elem_dy;
|
||||
elem.width -= elem_dw;
|
||||
elem.height -= elem_dh;
|
||||
|
||||
elem.setTransformationPoint({x: (elem_x - elem.x), y: (elem_y - elem.y)});
|
||||
doc.scaleSelection(1.0 / final_scale, 1.0 / final_scale);
|
||||
|
||||
fttim.recursive_scale_filters(doc, wrapper_item, 1.0 / final_scale);
|
||||
})();
|
||||
}
|
||||
};
|
||||
|
||||
ftdoc.prepare_folders = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
var export_folder = ftdoc.get_export_folder(doc);
|
||||
if (!FLfile.exists(export_folder) && !FLfile.createFolder(export_folder)) {
|
||||
throw "Can't create document export folder ({0})!"
|
||||
.format(export_folder);
|
||||
}
|
||||
};
|
||||
|
||||
ftdoc.get_export_folder = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
return ft.combine_path(
|
||||
ft.escape_path(doc.pathURI),
|
||||
cfg.export_path_postfix + "/");
|
||||
};
|
||||
|
||||
ftdoc.full_exit_edit_mode = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
for (var i = 0; i < 100; ++i) {
|
||||
doc.exitEditMode();
|
||||
}
|
||||
};
|
||||
|
||||
ftdoc.remove_unused_items = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
var unused_items = doc.library.unusedItems;
|
||||
if (unused_items && unused_items !== undefined) {
|
||||
ft.array_reverse_foreach(unused_items, function(item) {
|
||||
if (cfg.verbose_mode) {
|
||||
ft.trace_fmt("Remove unused item: {0}", item.name);
|
||||
}
|
||||
doc.library.deleteItem(item.name);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
ftdoc.prepare_all_bitmaps = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
ftlib.prepare_all_bitmaps(doc.library);
|
||||
};
|
||||
|
||||
ftdoc.unlock_all_timelines = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
ftlib.unlock_all_timelines(doc, doc.library);
|
||||
fttim.unlock_all_layers(doc, doc.getTimeline());
|
||||
};
|
||||
|
||||
ftdoc.prepare_all_tweens = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
ftlib.prepare_all_tweens(doc, doc.library);
|
||||
fttim.prepare_all_tweens(doc, doc.getTimeline());
|
||||
};
|
||||
|
||||
ftdoc.prepare_all_groups = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
var arr1 = ftlib.prepare_all_groups(doc, doc.library);
|
||||
var arr2 = fttim.prepare_all_groups(doc, doc.getTimeline());
|
||||
var new_symbols = arr1.concat(arr2);
|
||||
var process_item = function (item) {
|
||||
if (doc.library.editItem(item.name)) {
|
||||
var arr3 = fttim.prepare_all_groups(doc, item.timeline);
|
||||
new_symbols = new_symbols.concat(arr3);
|
||||
doc.exitEditMode();
|
||||
}
|
||||
};
|
||||
while (new_symbols.length > 0) {
|
||||
var new_symbols_copy = ft.array_clone(new_symbols);
|
||||
new_symbols = [];
|
||||
ft.array_foreach(new_symbols_copy, process_item);
|
||||
}
|
||||
};
|
||||
|
||||
ftdoc.calculate_item_scales = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
|
||||
var max_scales = {};
|
||||
|
||||
var walk_by_timeline = function(timeline, func, acc) {
|
||||
ft.type_assert(timeline, Timeline);
|
||||
ft.type_assert(func, Function);
|
||||
ft.array_foreach(timeline.layers, function (layer) {
|
||||
ft.array_foreach(layer.frames, function (frame) {
|
||||
ft.array_foreach(frame.elements, function (elem) {
|
||||
walk_by_timeline(
|
||||
elem.libraryItem.timeline,
|
||||
func,
|
||||
func(elem, acc));
|
||||
}, fttim.is_symbol_instance);
|
||||
}, fttim.is_keyframe);
|
||||
});
|
||||
};
|
||||
|
||||
var walk_by_library = function(lib, func, acc) {
|
||||
ft.type_assert(lib, Library);
|
||||
ft.type_assert(func, Function);
|
||||
ft.array_foreach(lib.items, function (item) {
|
||||
walk_by_timeline(item.timeline, func, acc);
|
||||
}, ftlib.is_symbol_item);
|
||||
};
|
||||
|
||||
var x_func = function(elem, acc) {
|
||||
var elem_sx = elem.scaleX * acc;
|
||||
var item_name = elem.libraryItem.name;
|
||||
max_scales[item_name] = Math.max(
|
||||
max_scales.hasOwnProperty(item_name) ? max_scales[item_name] : elem_sx,
|
||||
elem_sx);
|
||||
return elem_sx;
|
||||
};
|
||||
|
||||
var y_func = function(elem, acc) {
|
||||
var elem_sy = elem.scaleY * acc;
|
||||
var item_name = elem.libraryItem.name;
|
||||
max_scales[item_name] = Math.max(
|
||||
max_scales.hasOwnProperty(item_name) ? max_scales[item_name] : elem_sy,
|
||||
elem_sy);
|
||||
return elem_sy;
|
||||
};
|
||||
|
||||
walk_by_library(doc.library, x_func, 1.0);
|
||||
walk_by_timeline(doc.getTimeline(), x_func, 1.0);
|
||||
|
||||
walk_by_library(doc.library, y_func, 1.0);
|
||||
walk_by_timeline(doc.getTimeline(), y_func, 1.0);
|
||||
|
||||
ftdoc.get_temp(doc).max_scales = max_scales;
|
||||
|
||||
if (cfg.verbose_mode) {
|
||||
for (var item_name in max_scales) {
|
||||
var max_scale = max_scales.hasOwnProperty(item_name) ? max_scales[item_name] : 1.0;
|
||||
if (max_scale - cfg.scale_precision > 1.0) {
|
||||
ft.trace_fmt("Big item for optimize: {0} - {1}", item_name, max_scale);
|
||||
} else if (max_scale + cfg.scale_precision < 1.0) {
|
||||
ft.trace_fmt("Small item for optimize: {0} - {1}", item_name, max_scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ftdoc.optimize_all_timelines = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
if (cfg.optimize_static_items) {
|
||||
ft.profile_function(cfg.profile_mode, function () {
|
||||
ftlib.optimize_static_items(doc, doc.library);
|
||||
}, "Optimize static items");
|
||||
}
|
||||
if (cfg.optimize_single_graphics) {
|
||||
ft.profile_function(cfg.profile_mode, function () {
|
||||
ftlib.optimize_single_graphics(doc, doc.library);
|
||||
}, "Optimize single graphics");
|
||||
}
|
||||
};
|
||||
|
||||
ftdoc.rasterize_all_shapes = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
ftlib.rasterize_all_shapes(doc, doc.library);
|
||||
fttim.rasterize_all_shapes(doc, doc.getTimeline());
|
||||
};
|
||||
|
||||
ftdoc.export_swf = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
doc.exportSWF(ftdoc.get_export_swf_path(doc));
|
||||
};
|
||||
|
||||
ftdoc.get_export_swf_path = function (doc) {
|
||||
ft.type_assert(doc, Document);
|
||||
return ft.combine_path(
|
||||
ftdoc.get_export_folder(doc),
|
||||
doc.name + ".swf");
|
||||
};
|
||||
|
||||
//
|
||||
// library
|
||||
//
|
||||
|
||||
var ftlib = {};
|
||||
|
||||
ftlib.is_folder_item = function (item) {
|
||||
ft.type_assert(item, LibraryItem);
|
||||
return item.itemType == "folder";
|
||||
};
|
||||
|
||||
ftlib.is_bitmap_item = function (item) {
|
||||
ft.type_assert(item, LibraryItem);
|
||||
return item.itemType == "bitmap";
|
||||
};
|
||||
|
||||
ftlib.is_symbol_item = function (item) {
|
||||
ft.type_assert(item, LibraryItem);
|
||||
return item.itemType == "graphic" || item.itemType == "movie clip";
|
||||
};
|
||||
|
||||
ftlib.find_item_by_name = function (library, item_name) {
|
||||
ft.type_assert(library, Library);
|
||||
ft.type_assert(item_name, 'string');
|
||||
for (var i = 0; i < library.items.length; ++i) {
|
||||
var item = library.items[i];
|
||||
if (item.name == item_name) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
ftlib.edit_all_items = function (doc, library, func, filter) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(library, Library);
|
||||
ft.type_assert(func, Function);
|
||||
ft.type_assert_if_defined(filter, Function);
|
||||
ft.array_foreach(library.items, function (item) {
|
||||
if (library.editItem(item.name)) {
|
||||
func(item);
|
||||
doc.exitEditMode();
|
||||
}
|
||||
}, filter);
|
||||
};
|
||||
|
||||
ftlib.edit_all_symbol_items = function (doc, library, func) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(library, Library);
|
||||
ft.type_assert(func, Function);
|
||||
ftlib.edit_all_items(doc, library, func, ftlib.is_symbol_item);
|
||||
};
|
||||
|
||||
ftlib.prepare_all_bitmaps = function (library) {
|
||||
ft.type_assert(library, Library);
|
||||
ft.array_foreach(library.items, function (item) {
|
||||
item.compressionType = "lossless";
|
||||
}, ftlib.is_bitmap_item);
|
||||
};
|
||||
|
||||
ftlib.unlock_all_timelines = function (doc, library) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(library, Library);
|
||||
ftlib.edit_all_symbol_items(doc, library, function (item) {
|
||||
fttim.unlock_all_layers(doc, item.timeline);
|
||||
});
|
||||
};
|
||||
|
||||
ftlib.optimize_static_items = function (doc, library) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(library, Library);
|
||||
|
||||
var replaces = {};
|
||||
ft.array_reverse_foreach(library.items, function (item) {
|
||||
var new_item_name = ft.gen_unique_name();
|
||||
if (ftlib.bake_symbol_item(doc, library, item.name, new_item_name, 0)) {
|
||||
replaces[item.name] = new_item_name;
|
||||
if (cfg.verbose_mode) {
|
||||
ft.trace_fmt("Optimize static item: '{0}'", item.name);
|
||||
}
|
||||
} else {
|
||||
if (cfg.verbose_mode) {
|
||||
ft.trace_fmt("NOT Optimize static item: '{0}'", item.name);
|
||||
}
|
||||
}
|
||||
}, function (item) {
|
||||
return ftlib.is_symbol_item(item) && fttim.is_static(item.timeline);
|
||||
});
|
||||
|
||||
ftlib.edit_all_symbol_items(doc, library, function (item) {
|
||||
fttim.replace_baked_symbols(doc, item.timeline, replaces);
|
||||
});
|
||||
fttim.replace_baked_symbols(doc, doc.getTimeline(), replaces);
|
||||
};
|
||||
|
||||
ftlib.bake_symbol_item = function (doc, library, item_name, new_item_name, first_frame) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(library, Library);
|
||||
ft.type_assert(item_name, 'string');
|
||||
ft.type_assert(new_item_name, 'string');
|
||||
ft.type_assert(first_frame, 'number');
|
||||
|
||||
if (library.itemExists(new_item_name)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var item = ftlib.find_item_by_name(library, item_name);
|
||||
if (!item) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var item_frame_area = fttim.calculate_frame_area(item.timeline, first_frame);
|
||||
var item_elems_area = fttim.calculate_elems_area(item.timeline, first_frame);
|
||||
|
||||
if (cfg.verbose_mode) {
|
||||
ft.trace_fmt(
|
||||
"Library item: '{0}'\n- frame area: {1}\n- elems area: {2}",
|
||||
item_name, item_frame_area, item_elems_area);
|
||||
}
|
||||
|
||||
if (item_frame_area >= item_elems_area) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!library.addNewItem("graphic", new_item_name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!library.editItem(new_item_name)) {
|
||||
library.deleteItem(new_item_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (library.addItemToDocument({x: 0, y: 0}, item_name)) {
|
||||
var new_item_elem = doc.selection[0];
|
||||
new_item_elem.symbolType = "graphic";
|
||||
new_item_elem.firstFrame = first_frame;
|
||||
new_item_elem.setTransformationPoint({x: 0, y: 0});
|
||||
new_item_elem.transformX = 0;
|
||||
new_item_elem.transformY = 0;
|
||||
var location_name = "Symbol: {0}".format(item_name);
|
||||
ftdoc.convert_selection_to_bitmap(doc, location_name, item);
|
||||
doc.exitEditMode();
|
||||
return true;
|
||||
} else {
|
||||
doc.exitEditMode();
|
||||
library.deleteItem(new_item_name);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
ftlib.optimize_single_graphics = function (doc, library) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(library, Library);
|
||||
ft.array_reverse_foreach(library.items, function (item) {
|
||||
fttim.optimize_single_graphics(doc, item.timeline, item);
|
||||
}, ftlib.is_symbol_item);
|
||||
fttim.optimize_single_graphics(doc, doc.getTimeline(), null);
|
||||
};
|
||||
|
||||
ftlib.rasterize_all_shapes = function (doc, library) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(library, Library);
|
||||
ftlib.edit_all_symbol_items(doc, library, function (item) {
|
||||
fttim.rasterize_all_shapes(doc, item.timeline);
|
||||
});
|
||||
};
|
||||
|
||||
ftlib.prepare_all_tweens = 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_tweens(doc, item.timeline);
|
||||
});
|
||||
};
|
||||
|
||||
ftlib.prepare_all_groups = function (doc, library) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(library, Library);
|
||||
var new_symbols = [];
|
||||
ftlib.edit_all_symbol_items(doc, library, function (item) {
|
||||
var arr = fttim.prepare_all_groups(doc, item.timeline);
|
||||
new_symbols = new_symbols.concat(arr);
|
||||
});
|
||||
return new_symbols;
|
||||
};
|
||||
|
||||
//
|
||||
// timeline
|
||||
//
|
||||
|
||||
var fttim = {};
|
||||
|
||||
fttim.is_element_locked = function (elem) {
|
||||
return elem.locked;
|
||||
};
|
||||
|
||||
fttim.is_shape_element = function (elem) {
|
||||
return elem.elementType == "shape";
|
||||
};
|
||||
|
||||
fttim.is_group_shape_element = function (elem) {
|
||||
return fttim.is_shape_element(elem) && elem.isGroup;
|
||||
};
|
||||
|
||||
fttim.is_object_shape_element = function (elem) {
|
||||
return fttim.is_shape_element(elem) && elem.isDrawingObject;
|
||||
};
|
||||
|
||||
fttim.is_simple_shape_element = function (elem) {
|
||||
return fttim.is_shape_element(elem) && !elem.isGroup && !elem.isDrawingObject;
|
||||
};
|
||||
|
||||
fttim.is_complex_shape_element = function (elem) {
|
||||
return fttim.is_shape_element(elem) && (elem.isGroup || elem.isDrawingObject);
|
||||
};
|
||||
|
||||
fttim.is_instance_element = function (elem) {
|
||||
return elem.elementType == "instance";
|
||||
};
|
||||
|
||||
fttim.is_bitmap_instance = function (elem) {
|
||||
return fttim.is_instance_element(elem) && elem.instanceType == "bitmap";
|
||||
};
|
||||
|
||||
fttim.is_symbol_instance = function (elem) {
|
||||
return fttim.is_instance_element(elem) && elem.instanceType == "symbol";
|
||||
};
|
||||
|
||||
fttim.is_symbol_graphic_instance = function (elem) {
|
||||
return fttim.is_symbol_instance(elem) && elem.symbolType == "graphic";
|
||||
};
|
||||
|
||||
fttim.is_symbol_graphic_single_frame_instance = function (elem) {
|
||||
return fttim.is_symbol_instance(elem) && elem.symbolType == "graphic" && elem.loop == "single frame";
|
||||
};
|
||||
|
||||
fttim.is_symbol_movie_clip_instance = function (elem) {
|
||||
return fttim.is_symbol_instance(elem) && elem.symbolType == "movie clip";
|
||||
};
|
||||
|
||||
fttim.is_tween_frame = function (frame) {
|
||||
ft.type_assert(frame, Frame);
|
||||
return frame.tweenType != "none";
|
||||
};
|
||||
|
||||
fttim.is_shape_tween_frame = function (frame) {
|
||||
ft.type_assert(frame, Frame);
|
||||
return frame.tweenType == "shape";
|
||||
};
|
||||
|
||||
fttim.is_motion_tween_frame = function (frame) {
|
||||
ft.type_assert(frame, Frame);
|
||||
return frame.tweenType == "motion";
|
||||
};
|
||||
|
||||
fttim.is_keyframe = function (frame, frame_index) {
|
||||
ft.type_assert(frame, Frame);
|
||||
ft.type_assert(frame_index, 'number');
|
||||
return frame.startFrame == frame_index;
|
||||
};
|
||||
|
||||
fttim.is_not_guide_layer = function(layer) {
|
||||
ft.type_assert(layer, Layer);
|
||||
return layer.layerType != "guide";
|
||||
};
|
||||
|
||||
fttim.unlock_all_layers = function (doc, timeline) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(timeline, Timeline);
|
||||
ft.array_foreach(timeline.layers, function (layer, layer_index) {
|
||||
layer.locked = false;
|
||||
layer.visible = true;
|
||||
ft.array_foreach(layer.frames, function (frame, frame_index) {
|
||||
var has_locked = ft.array_any(frame.elements, fttim.is_element_locked);
|
||||
if (has_locked) {
|
||||
timeline.currentFrame = frame_index;
|
||||
try {
|
||||
doc.unlockAllElements();
|
||||
} catch (e) {}
|
||||
}
|
||||
}, fttim.is_keyframe);
|
||||
});
|
||||
};
|
||||
|
||||
fttim.calculate_elems_area = function (timeline, frame_index) {
|
||||
ft.type_assert(timeline, Timeline);
|
||||
ft.type_assert(frame_index, 'number');
|
||||
return ft.array_foldl(timeline.layers, function (layer, acc) {
|
||||
if (frame_index >= 0 && frame_index < layer.frames.length) {
|
||||
return ft.array_foldl(layer.frames[frame_index].elements, function (elem, acc2) {
|
||||
return acc2 + Math.round(elem.width) * Math.round(elem.height);
|
||||
}, acc);
|
||||
} else {
|
||||
return acc;
|
||||
}
|
||||
}, 0);
|
||||
};
|
||||
|
||||
fttim.calculate_frame_area = function (timeline, frame_index) {
|
||||
ft.type_assert(timeline, Timeline);
|
||||
ft.type_assert(frame_index, 'number');
|
||||
var bounds = ft.array_foldl(timeline.layers, function (layer, acc) {
|
||||
if (frame_index >= 0 && frame_index < layer.frames.length) {
|
||||
return ft.array_foldl(layer.frames[frame_index].elements, function (elem, acc2) {
|
||||
acc2.left = Math.min(acc2.left, elem.left);
|
||||
acc2.right = Math.max(acc2.right, elem.left + elem.width);
|
||||
acc2.top = Math.min(acc2.top, elem.top);
|
||||
acc2.bottom = Math.max(acc2.bottom, elem.top + elem.height);
|
||||
return acc2;
|
||||
}, acc);
|
||||
} else {
|
||||
return acc;
|
||||
}
|
||||
}, {
|
||||
left: Number.POSITIVE_INFINITY,
|
||||
right: Number.NEGATIVE_INFINITY,
|
||||
top: Number.POSITIVE_INFINITY,
|
||||
bottom: Number.NEGATIVE_INFINITY
|
||||
});
|
||||
var frame_width = Math.max(0, bounds.right - bounds.left);
|
||||
var frame_height = Math.max(0, bounds.bottom - bounds.top);
|
||||
return Math.round(frame_width) * Math.round(frame_height);
|
||||
};
|
||||
|
||||
fttim.scale_elem_filters = function (elem, scale) {
|
||||
if (fttim.is_symbol_instance(elem)) {
|
||||
var elem_filters = elem.filters;
|
||||
if (elem_filters && elem_filters !== undefined) {
|
||||
ft.array_foreach(elem_filters, function (elem_filter, filter_index) {
|
||||
elem_filter.blurX *= scale;
|
||||
elem_filter.blurY *= scale;
|
||||
});
|
||||
elem.filters = elem_filters;
|
||||
}
|
||||
}
|
||||
if (fttim.is_group_shape_element(elem)) {
|
||||
ft.array_foreach(elem.members, function(member) {
|
||||
fttim.scale_elem_filters(member, scale);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
fttim.recursive_scale_filters = function (doc, item, scale, optional_scaled_items) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(item, LibraryItem);
|
||||
ft.type_assert(scale, 'number');
|
||||
ft.type_assert_if_defined(optional_scaled_items, Array);
|
||||
|
||||
var scaled_items = optional_scaled_items || [];
|
||||
if (ft.array_contains(scaled_items, item)) {
|
||||
return;
|
||||
} else {
|
||||
scaled_items.push(item);
|
||||
}
|
||||
|
||||
ft.array_foreach(item.timeline.layers, function (layer) {
|
||||
ft.array_foreach(layer.frames, function (frame, frame_index) {
|
||||
ft.array_foreach(frame.elements, function (elem) {
|
||||
fttim.scale_elem_filters(elem, scale);
|
||||
if (fttim.is_group_shape_element(elem)) {
|
||||
ft.array_foreach(elem.members, function(member) {
|
||||
fttim.recursive_scale_filters(doc, member.libraryItem, scale, scaled_items);
|
||||
}, fttim.is_symbol_instance);
|
||||
}
|
||||
if (fttim.is_symbol_instance(elem)) {
|
||||
fttim.recursive_scale_filters(doc, elem.libraryItem, scale, scaled_items);
|
||||
}
|
||||
});
|
||||
}, fttim.is_keyframe);
|
||||
}, fttim.is_not_guide_layer);
|
||||
};
|
||||
|
||||
fttim.replace_baked_symbols = function (doc, timeline, replaces) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(timeline, Timeline);
|
||||
ft.array_foreach(timeline.layers, function (layer) {
|
||||
ft.array_foreach(layer.frames, function (frame, frame_index) {
|
||||
timeline.currentFrame = frame_index;
|
||||
doc.selectNone();
|
||||
ft.array_foreach(frame.elements, function (elem) {
|
||||
if (replaces.hasOwnProperty(elem.libraryItem.name)) {
|
||||
doc.selectNone();
|
||||
doc.selection = [elem];
|
||||
doc.swapElement(replaces[elem.libraryItem.name]);
|
||||
}
|
||||
}, fttim.is_symbol_instance);
|
||||
}, fttim.is_keyframe);
|
||||
}, fttim.is_not_guide_layer);
|
||||
};
|
||||
|
||||
fttim.optimize_single_graphics = function (doc, timeline, opt_item) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(timeline, Timeline);
|
||||
ft.array_foreach(timeline.layers, function (layer) {
|
||||
ft.array_foreach(layer.frames, function (frame, frame_index) {
|
||||
ft.array_foreach(frame.elements, function (elem) {
|
||||
var lib_item_name = elem.libraryItem.name;
|
||||
var lib_item_cache_name = "ft_cache_name_" + lib_item_name + "_" + elem.firstFrame;
|
||||
if (ftlib.bake_symbol_item(doc, doc.library, lib_item_name, lib_item_cache_name, elem.firstFrame)) {
|
||||
if (cfg.verbose_mode) {
|
||||
ft.trace_fmt("Optimize single graphic '{0}' for frame '{1}' in '{2}'",
|
||||
lib_item_name, elem.firstFrame, timeline.name);
|
||||
}
|
||||
if (opt_item === null || doc.library.editItem(opt_item.name)) {
|
||||
if (timeline.currentFrame != frame_index) {
|
||||
timeline.currentFrame = frame_index;
|
||||
}
|
||||
doc.selectNone();
|
||||
doc.selection = [elem];
|
||||
doc.swapElement(lib_item_cache_name);
|
||||
doc.selection[0].firstFrame = 0;
|
||||
doc.exitEditMode();
|
||||
}
|
||||
} else {
|
||||
if (cfg.verbose_mode) {
|
||||
ft.trace_fmt("NOT Optimize single graphic '{0}' for frame '{1}' in '{2}'",
|
||||
lib_item_name, elem.firstFrame, timeline.name);
|
||||
}
|
||||
}
|
||||
}, function (elem) {
|
||||
return fttim.is_symbol_graphic_single_frame_instance(elem) && !fttim.is_static(elem.libraryItem.timeline);
|
||||
});
|
||||
}, fttim.is_keyframe);
|
||||
}, fttim.is_not_guide_layer);
|
||||
};
|
||||
|
||||
fttim.is_static = function (timeline) {
|
||||
ft.type_assert(timeline, Timeline);
|
||||
if (timeline.frameCount > 1) {
|
||||
return false;
|
||||
}
|
||||
return ft.array_foldl(timeline.layers, function (layer, acc) {
|
||||
return ft.array_foldl(layer.frames, function (frame, acc2) {
|
||||
return ft.array_foldl(frame.elements, function (elem, acc3) {
|
||||
return acc3 && fttim.is_symbol_instance(elem) ? elem.blendMode != "erase" && (fttim.is_symbol_graphic_single_frame_instance(elem) || fttim.is_static(elem.libraryItem.timeline)) : acc3;
|
||||
}, acc2);
|
||||
}, acc);
|
||||
}, true);
|
||||
};
|
||||
|
||||
fttim.prepare_all_tweens = function (doc, timeline) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(timeline, Timeline);
|
||||
|
||||
var is_end_of_tween = function(frame_index, frames) {
|
||||
while (--frame_index >= 0) {
|
||||
var frame = frames[frame_index];
|
||||
if (fttim.is_keyframe(frame, frame_index)) {
|
||||
return fttim.is_motion_tween_frame(frame) && frame.duration > 1;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
ft.array_reverse_foreach(timeline.layers, function (layer, layer_index) {
|
||||
ft.array_foreach(layer.frames, function (frame, frame_index) {
|
||||
if (fttim.is_shape_tween_frame(frame)) {
|
||||
if (ft.is_function(frame.convertToFrameByFrameAnimation)) {
|
||||
ft.trace_fmt(
|
||||
"[Warning] Timeline: '{0}' Layer: '{1}' Frame: {2}\n" +
|
||||
"- Shape tween strongly not recommended because it rasterized to frame-by-frame bitmap sequence.",
|
||||
timeline.name, layer.name, frame_index + 1);
|
||||
frame.convertToFrameByFrameAnimation();
|
||||
} else {
|
||||
throw "Animation uses shape tweens. To export this animation you should use Adobe Animate CC or higher!";
|
||||
}
|
||||
} else if (fttim.is_motion_tween_frame(frame) || is_end_of_tween(frame_index, layer.frames)) {
|
||||
var has_shapes = ft.array_any(frame.elements, fttim.is_shape_element);
|
||||
if (has_shapes || frame.elements.length > 1) {
|
||||
ft.trace_fmt(
|
||||
"[Warning] Timeline: '{0}' Layer: '{1}' Frame: {2}\n" +
|
||||
"- Frame contains incorrect objects for motion tween.",
|
||||
timeline.name, layer.name, frame_index + 1);
|
||||
timeline.currentFrame = frame_index;
|
||||
doc.selectNone();
|
||||
doc.selection = frame.elements;
|
||||
doc.convertToSymbol("graphic", ft.gen_unique_name(), "top left");
|
||||
}
|
||||
}
|
||||
}, fttim.is_keyframe);
|
||||
}, fttim.is_not_guide_layer);
|
||||
};
|
||||
|
||||
fttim.prepare_all_groups = function (doc, timeline) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(timeline, Timeline);
|
||||
|
||||
var check_need_for_ungroup = function (frame, elem) {
|
||||
if (fttim.is_tween_frame(frame)) {
|
||||
return true;
|
||||
}
|
||||
if (fttim.is_group_shape_element(elem)) {
|
||||
return ft.array_any(elem.members, function (member) {
|
||||
if (fttim.is_instance_element(member)) {
|
||||
return true;
|
||||
}
|
||||
return check_need_for_ungroup(frame, member);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
var new_symbols = [];
|
||||
ft.array_reverse_foreach(timeline.layers, function (layer, layer_index) {
|
||||
ft.array_foreach(layer.frames, function (frame, frame_index) {
|
||||
var has_complex_shapes = ft.array_any(frame.elements, fttim.is_complex_shape_element);
|
||||
if (has_complex_shapes) {
|
||||
timeline.currentFrame = frame_index;
|
||||
doc.selectNone();
|
||||
|
||||
var elements = ft.array_clone(frame.elements);
|
||||
ft.array_foreach(elements, function (elem, elem_index) {
|
||||
if (fttim.is_simple_shape_element(elem)) {
|
||||
// nothing
|
||||
} else if (fttim.is_complex_shape_element(elem) && check_need_for_ungroup(frame, elem)) {
|
||||
doc.selectNone();
|
||||
doc.selection = [elem];
|
||||
if (fttim.is_object_shape_element(elem)) {
|
||||
doc.breakApart();
|
||||
doc.group();
|
||||
}
|
||||
doc.unGroup();
|
||||
try {
|
||||
doc.unlockAllElements();
|
||||
} catch (e) {}
|
||||
var wrapper_item = doc.convertToSymbol("graphic", ft.gen_unique_name(), "top left");
|
||||
new_symbols.push(wrapper_item);
|
||||
} else {
|
||||
doc.selectNone();
|
||||
doc.selection = [elem];
|
||||
doc.arrange("front");
|
||||
}
|
||||
});
|
||||
}
|
||||
}, fttim.is_keyframe);
|
||||
}, fttim.is_not_guide_layer);
|
||||
return new_symbols;
|
||||
};
|
||||
|
||||
fttim.rasterize_all_shapes = function (doc, timeline) {
|
||||
ft.type_assert(doc, Document);
|
||||
ft.type_assert(timeline, Timeline);
|
||||
|
||||
var rasterize_count = 0;
|
||||
ft.array_reverse_foreach(timeline.layers, function (layer, layer_index) {
|
||||
ft.array_foreach(layer.frames, function (frame, frame_index) {
|
||||
var has_shapes = ft.array_any(frame.elements, fttim.is_shape_element);
|
||||
if (has_shapes) {
|
||||
timeline.currentFrame = frame_index;
|
||||
doc.selectNone();
|
||||
var groups_arr = ft.array_group_by(frame.elements, fttim.is_shape_element);
|
||||
for (var i = 0; i < groups_arr.length; ++i) {
|
||||
var groups = groups_arr[i];
|
||||
if (fttim.is_shape_element(groups.peek())) {
|
||||
doc.selectNone();
|
||||
doc.selection = groups;
|
||||
var location_name = "Timeline: {0}".format(timeline.name);
|
||||
ftdoc.convert_selection_to_bitmap(doc, location_name, timeline.libraryItem);
|
||||
++rasterize_count;
|
||||
} else {
|
||||
doc.selectNone();
|
||||
doc.selection = groups;
|
||||
doc.arrange("front");
|
||||
}
|
||||
}
|
||||
}
|
||||
}, fttim.is_keyframe);
|
||||
}, fttim.is_not_guide_layer);
|
||||
|
||||
if (rasterize_count > 0 && cfg.verbose_mode) {
|
||||
ft.trace_fmt("Rasterize vector shapes({0}) in '{1}'", rasterize_count, timeline.name);
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
// run
|
||||
//
|
||||
|
||||
(function () {
|
||||
ft.clear_output();
|
||||
fl.showIdleMessage(false);
|
||||
ft.trace("[Start]");
|
||||
|
||||
if (cfg.open_documents.length > 0) {
|
||||
ft.profile_function(cfg.profile_mode, function () {
|
||||
ft.array_foreach(cfg.open_documents, function (uri) {
|
||||
fl.openDocument(uri);
|
||||
});
|
||||
}, "Open documents");
|
||||
}
|
||||
|
||||
ft.profile_function(cfg.profile_mode, function() {
|
||||
ft.array_foreach(fl.documents, function (doc) {
|
||||
ft.profile_function(cfg.profile_mode, function() {
|
||||
try {
|
||||
ft.trace_fmt("[Document] '{0}' conversion started...", doc.name);
|
||||
ftdoc.prepare(doc);
|
||||
ft.trace_fmt("[Document] '{0}' conversion complete!", doc.name);
|
||||
} catch (e) {
|
||||
ft.trace_fmt("[Document] '{0}' conversion error: '{1}'", doc.name, e);
|
||||
}
|
||||
}, "Prepare document: '{0}'".format(doc.name));
|
||||
});
|
||||
}, "Prepare documents");
|
||||
|
||||
if (cfg.revert_after_conversion) {
|
||||
ft.profile_function(cfg.profile_mode, function () {
|
||||
ft.array_foreach(fl.documents, function (doc) {
|
||||
if (doc.canRevert()) {
|
||||
fl.revertDocument(doc);
|
||||
}
|
||||
});
|
||||
}, "Revert documents");
|
||||
}
|
||||
|
||||
if (cfg.close_after_conversion) {
|
||||
ft.profile_function(cfg.profile_mode, function () {
|
||||
ft.array_foreach(fl.documents, function (doc) {
|
||||
fl.closeDocument(doc, false);
|
||||
});
|
||||
}, "Close documents");
|
||||
}
|
||||
|
||||
ft.trace("[Finish]");
|
||||
})();
|
||||
};
|
||||
8
Assets/FlashTools/FlashExport/Internal/FTMain.jsfl.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b3dd0d0b9e23846999d958ecbe82e112
|
||||
timeCreated: 1495142673
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -135,9 +135,8 @@ inline swf_mask_v2f_t swf_mask_vert(swf_mask_appdata_t IN) {
|
||||
|
||||
inline fixed4 swf_frag(swf_v2f_t IN) : SV_Target {
|
||||
fixed4 c = tex2D(_MainTex, IN.uv);
|
||||
if ( _ExternalAlpha ) {
|
||||
c.a *= tex2D(_AlphaTex, IN.uv).r;
|
||||
}
|
||||
fixed4 a = tex2D(_AlphaTex, IN.uv).r;
|
||||
c.a = lerp(c.a, a.r, _ExternalAlpha);
|
||||
if ( c.a > 0.01 ) {
|
||||
c = c * IN.mulcolor + IN.addcolor;
|
||||
}
|
||||
@@ -147,9 +146,8 @@ inline fixed4 swf_frag(swf_v2f_t IN) : SV_Target {
|
||||
|
||||
inline fixed4 swf_grab_frag(swf_grab_v2f_t IN) : SV_Target {
|
||||
fixed4 c = tex2D(_MainTex, IN.uv);
|
||||
if ( _ExternalAlpha ) {
|
||||
c.a *= tex2D(_AlphaTex, IN.uv).r;
|
||||
}
|
||||
fixed4 a = tex2D(_AlphaTex, IN.uv).r;
|
||||
c.a = lerp(c.a, a.r, _ExternalAlpha);
|
||||
if ( c.a > 0.01 ) {
|
||||
c = c * IN.mulcolor + IN.addcolor;
|
||||
c = grab_blend(_GrabTexture, IN.screenpos, c);
|
||||
@@ -160,9 +158,8 @@ inline fixed4 swf_grab_frag(swf_grab_v2f_t IN) : SV_Target {
|
||||
|
||||
inline fixed4 swf_mask_frag(swf_mask_v2f_t IN) : SV_Target {
|
||||
fixed4 c = tex2D(_MainTex, IN.uv);
|
||||
if ( _ExternalAlpha ) {
|
||||
c.a *= tex2D(_AlphaTex, IN.uv).r;
|
||||
}
|
||||
fixed4 a = tex2D(_AlphaTex, IN.uv).r;
|
||||
c.a = lerp(c.a, a.r, _ExternalAlpha);
|
||||
if ( c.a < 0.01 ) {
|
||||
discard;
|
||||
}
|
||||
|
||||
@@ -12,11 +12,11 @@ MonoBehaviour:
|
||||
m_Name: SwfSettings
|
||||
m_EditorClassIdentifier:
|
||||
Settings:
|
||||
MaxAtlasSize: 1024
|
||||
MaxAtlasSize: 2048
|
||||
AtlasPadding: 1
|
||||
PixelsPerUnit: 100
|
||||
GenerateMipMaps: 0
|
||||
AtlasPowerOfTwo: 1
|
||||
AtlasForceSquare: 1
|
||||
AtlasTextureFilter: 1
|
||||
AtlasTextureFormat: 0
|
||||
AtlasTextureFormat: 2
|
||||
|
||||
@@ -42,7 +42,11 @@ namespace FTEditor.Editors {
|
||||
}
|
||||
|
||||
static void ReconvertAsset(SwfAsset asset) {
|
||||
asset.Atlas = null;
|
||||
if ( asset.Atlas ) {
|
||||
AssetDatabase.DeleteAsset(
|
||||
AssetDatabase.GetAssetPath(asset.Atlas));
|
||||
asset.Atlas = null;
|
||||
}
|
||||
EditorUtility.SetDirty(asset);
|
||||
AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(asset));
|
||||
}
|
||||
@@ -69,10 +73,6 @@ namespace FTEditor.Editors {
|
||||
AllAssetsForeach(p => ApplyOverriddenSettings(p));
|
||||
}
|
||||
|
||||
void ReconvertAllAsset() {
|
||||
AllAssetsForeach(p => ReconvertAsset(p));
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
@@ -105,7 +105,7 @@ namespace FTEditor.Editors {
|
||||
GUILayout.BeginHorizontal();
|
||||
{
|
||||
if ( GUILayout.Button("Reconvert") ) {
|
||||
ReconvertAllAsset();
|
||||
ApplyAllOverriddenSettings();
|
||||
}
|
||||
GUILayout.FlexibleSpace();
|
||||
var default_settings = GetSettingsHolder().Settings;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEditor;
|
||||
|
||||
using System.IO;
|
||||
@@ -40,6 +41,9 @@ namespace FTEditor.Editors {
|
||||
var clip_go = new GameObject(clip.name);
|
||||
clip_go.AddComponent<MeshFilter>();
|
||||
clip_go.AddComponent<MeshRenderer>();
|
||||
#if UNITY_5_6_OR_NEWER
|
||||
clip_go.AddComponent<SortingGroup>();
|
||||
#endif
|
||||
clip_go.AddComponent<SwfClip>().clip = clip;
|
||||
clip_go.AddComponent<SwfClipController>();
|
||||
return clip_go;
|
||||
|
||||
@@ -174,13 +174,14 @@ namespace FTEditor.Editors {
|
||||
if ( isTargetValidForPreview ) {
|
||||
_previewUtils.BeginPreview(r, background);
|
||||
{
|
||||
if ( targetAtlas ) {
|
||||
_matPropBlock.SetTexture("_MainTex", targetAtlas);
|
||||
}
|
||||
_matPropBlock.SetTexture(
|
||||
"_MainTex",
|
||||
targetAtlas ? targetAtlas : Texture2D.whiteTexture);
|
||||
if ( targetAtlasA ) {
|
||||
_matPropBlock.SetTexture("_AlphaTex", targetAtlasA);
|
||||
_matPropBlock.SetFloat("_ExternalAlpha", 1.0f);
|
||||
} else {
|
||||
_matPropBlock.SetTexture("_AlphaTex", Texture2D.whiteTexture);
|
||||
_matPropBlock.SetFloat("_ExternalAlpha", 0.0f);
|
||||
}
|
||||
ConfigureCameraForSequence(_previewUtils.m_Camera, targetSequence);
|
||||
|
||||
@@ -18,15 +18,15 @@ namespace FTEditor.Postprocessors {
|
||||
string[] moved_assets,
|
||||
string[] moved_from_asset_paths)
|
||||
{
|
||||
var asset_paths = imported_assets
|
||||
.Where(p => Path.GetExtension(p).ToLower().Equals(".asset"));
|
||||
var assets = asset_paths
|
||||
var assets = imported_assets
|
||||
.Where(p => Path.GetExtension(p).ToLower().Equals(".asset"))
|
||||
.Select(p => AssetDatabase.LoadAssetAtPath<SwfAsset>(p))
|
||||
.Where(p => !!p);
|
||||
foreach ( var asset in assets ) {
|
||||
var asset_copy = asset;
|
||||
.Where(p => p && !p.Atlas);
|
||||
if ( assets.Any() ) {
|
||||
EditorApplication.delayCall += () => {
|
||||
SwfAssetProcess(asset_copy);
|
||||
foreach ( var asset in assets ) {
|
||||
SwfAssetProcess(asset);
|
||||
}
|
||||
AssetDatabase.SaveAssets();
|
||||
};
|
||||
}
|
||||
@@ -34,23 +34,26 @@ namespace FTEditor.Postprocessors {
|
||||
|
||||
static void SwfAssetProcess(SwfAsset asset) {
|
||||
try {
|
||||
if ( !asset.Atlas ) {
|
||||
EditorUtility.SetDirty(asset);
|
||||
var asset_data = SwfEditorUtils.DecompressAsset<SwfAssetData>(asset.Data, progress => {
|
||||
_progressBar.UpdateProgress("decompress swf asset", progress);
|
||||
});
|
||||
asset.Atlas = LoadAssetAtlas(asset);
|
||||
if ( asset.Atlas ) {
|
||||
ConfigureAtlas(asset);
|
||||
ConfigureClips(asset, asset_data);
|
||||
} else {
|
||||
_progressBar.UpdateTitle(asset.name);
|
||||
var new_data = ConfigureBitmaps(
|
||||
asset,
|
||||
SwfEditorUtils.DecompressAsset<SwfAssetData>(asset.Data));
|
||||
asset.Data = SwfEditorUtils.CompressAsset(new_data);
|
||||
asset.Atlas = LoadAssetAtlas(asset);
|
||||
if ( asset.Atlas ) {
|
||||
ConfigureAtlas(asset);
|
||||
ConfigureClips(asset, new_data);
|
||||
}
|
||||
EditorUtility.SetDirty(asset);
|
||||
var new_data = ConfigureBitmaps(asset, asset_data);
|
||||
asset.Data = SwfEditorUtils.CompressAsset(new_data, progress => {
|
||||
_progressBar.UpdateProgress("compress swf asset", progress);
|
||||
});
|
||||
}
|
||||
} catch ( Exception e ) {
|
||||
Debug.LogErrorFormat(
|
||||
"<b>[FlashTools]</b> Postprocess swf asset error: {0}",
|
||||
e.Message);
|
||||
asset,
|
||||
"<b>[FlashTools]</b> Postprocess swf asset error: {0}\nPath: {1}",
|
||||
e.Message, AssetDatabase.GetAssetPath(asset));
|
||||
AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(asset));
|
||||
} finally {
|
||||
if ( asset ) {
|
||||
@@ -208,6 +211,12 @@ namespace FTEditor.Postprocessors {
|
||||
#else
|
||||
atlas_importer.textureFormat = SwfAtlasFormatToImporterFormat(asset.Settings.AtlasTextureFormat);
|
||||
#endif
|
||||
|
||||
var atlas_settings = new TextureImporterSettings();
|
||||
atlas_importer.ReadTextureSettings(atlas_settings);
|
||||
atlas_settings.spriteMeshType = SpriteMeshType.FullRect;
|
||||
atlas_importer.SetTextureSettings(atlas_settings);
|
||||
|
||||
atlas_importer.SaveAndReimport();
|
||||
}
|
||||
|
||||
|
||||
@@ -24,17 +24,18 @@ namespace FTEditor.Postprocessors {
|
||||
{
|
||||
var swf_paths = imported_assets
|
||||
.Where(p => Path.GetExtension(p).ToLower().Equals(".swf"));
|
||||
if ( swf_paths.Any() && SwfEditorUtils.IsDemoEnded ) {
|
||||
var title = "Demo version";
|
||||
var message =
|
||||
"This demo is for evaluation purpose only. " +
|
||||
"It means that you can't have more than 5 animation assets in the project.";
|
||||
EditorUtility.DisplayDialog(title, message, "Ok");
|
||||
} else {
|
||||
foreach ( var swf_path in swf_paths ) {
|
||||
var swf_path_copy = swf_path;
|
||||
if ( swf_paths.Any() ) {
|
||||
if ( SwfEditorUtils.IsDemoEnded ) {
|
||||
var title = "Demo version";
|
||||
var message =
|
||||
"This demo is for evaluation purpose only. " +
|
||||
"It means that you can't have more than 5 animation assets in the project.";
|
||||
EditorUtility.DisplayDialog(title, message, "Ok");
|
||||
} else {
|
||||
EditorApplication.delayCall += () => {
|
||||
SwfFileProcess(swf_path_copy);
|
||||
foreach ( var swf_path in swf_paths ) {
|
||||
SwfFileProcess(swf_path);
|
||||
}
|
||||
AssetDatabase.SaveAssets();
|
||||
};
|
||||
}
|
||||
@@ -42,29 +43,40 @@ namespace FTEditor.Postprocessors {
|
||||
}
|
||||
|
||||
static void SwfFileProcess(string swf_path) {
|
||||
var swf_hash = SwfEditorUtils.GetFileHashWithVersion(swf_path);
|
||||
var swf_asset_path = Path.ChangeExtension(swf_path, ".asset");
|
||||
SwfEditorUtils.LoadOrCreateAsset<SwfAsset>(swf_asset_path, (swf_asset, created) => {
|
||||
if ( created ) {
|
||||
if ( !string.IsNullOrEmpty(swf_asset.Hash) && swf_asset.Hash == swf_hash ) {
|
||||
return true;
|
||||
} else if ( created ) {
|
||||
var default_settings = SwfEditorUtils.GetSettingsHolder().Settings;
|
||||
swf_asset.Settings = default_settings;
|
||||
swf_asset.Overridden = default_settings;
|
||||
}
|
||||
return SafeLoadSwfAsset(swf_path, swf_asset);
|
||||
return SafeLoadSwfAsset(swf_path, swf_hash, swf_asset);
|
||||
});
|
||||
}
|
||||
|
||||
static bool SafeLoadSwfAsset(string swf_path, SwfAsset swf_asset) {
|
||||
static bool SafeLoadSwfAsset(string swf_path, string swf_hash, SwfAsset swf_asset) {
|
||||
try {
|
||||
_progressBar.UpdateTitle(Path.GetFileName(swf_path));
|
||||
var new_data = LoadSwfAssetData(swf_path);
|
||||
swf_asset.Data = SwfEditorUtils.CompressAsset(new_data);
|
||||
swf_asset.Atlas = null;
|
||||
var new_data = LoadSwfAssetData(swf_path);
|
||||
swf_asset.Data = SwfEditorUtils.CompressAsset(new_data, progress => {
|
||||
_progressBar.UpdateProgress("swf asset compression", progress);
|
||||
});
|
||||
swf_asset.Hash = swf_hash;
|
||||
if ( swf_asset.Atlas ) {
|
||||
AssetDatabase.DeleteAsset(
|
||||
AssetDatabase.GetAssetPath(swf_asset.Atlas));
|
||||
swf_asset.Atlas = null;
|
||||
}
|
||||
EditorUtility.SetDirty(swf_asset);
|
||||
return true;
|
||||
} catch ( Exception e ) {
|
||||
Debug.LogErrorFormat(
|
||||
"<b>[FlashTools]</b> Parsing swf error: {0}",
|
||||
e.Message);
|
||||
AssetDatabase.LoadMainAssetAtPath(swf_path),
|
||||
"<b>[FlashTools]</b> Parsing swf error: {0}\nPath: {1}",
|
||||
e.Message, swf_path);
|
||||
return false;
|
||||
} finally {
|
||||
_progressBar.HideProgress();
|
||||
@@ -98,9 +110,6 @@ namespace FTEditor.Postprocessors {
|
||||
.Where(p => !string.IsNullOrEmpty(p.ExportName))
|
||||
.ToList();
|
||||
for ( var i = 0; i < sprite_defs.Count; ++i ) {
|
||||
_progressBar.UpdateProgress(
|
||||
"load swf symbols",
|
||||
(float)(i + 1) / sprite_defs.Count);
|
||||
var def = sprite_defs[i];
|
||||
var name = def.ExportName;
|
||||
var tags = def.ControlTags.Tags;
|
||||
@@ -118,6 +127,9 @@ namespace FTEditor.Postprocessors {
|
||||
});
|
||||
var symbol_frames = new List<SwfFrameData>();
|
||||
while ( executer.NextFrame(tags, disp_lst) ) {
|
||||
_progressBar.UpdateProgress(
|
||||
string.Format("swf symbols loading ({0})", symbol_name),
|
||||
(float)(executer.CurrentTag + 1) / tags.Count);
|
||||
symbol_frames.Add(LoadSymbolFrameData(library, disp_lst));
|
||||
}
|
||||
return new SwfSymbolData{
|
||||
@@ -370,6 +382,8 @@ namespace FTEditor.Postprocessors {
|
||||
return new SwfBlendModeData(SwfBlendModeData.Types.Subtract);
|
||||
case SwfBlendMode.Mode.Invert:
|
||||
return new SwfBlendModeData(SwfBlendModeData.Types.Invert);
|
||||
case SwfBlendMode.Mode.Overlay:
|
||||
return new SwfBlendModeData(SwfBlendModeData.Types.Overlay);
|
||||
case SwfBlendMode.Mode.Hardlight:
|
||||
return new SwfBlendModeData(SwfBlendModeData.Types.Hardlight);
|
||||
default:
|
||||
|
||||
@@ -4,6 +4,7 @@ using UnityEditor;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
|
||||
using Ionic.Zlib;
|
||||
@@ -184,14 +185,14 @@ namespace FTEditor {
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
public static byte[] CompressAsset<T>(T asset) {
|
||||
public static byte[] CompressAsset<T>(T asset, System.Action<float> progress_act) {
|
||||
var bytes = AssetToBytes(asset);
|
||||
var result = ZlibStream.CompressBuffer(bytes);
|
||||
var result = CompressBuffer(bytes, progress_act);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static T DecompressAsset<T>(byte[] data) {
|
||||
var bytes = ZlibStream.UncompressBuffer(data);
|
||||
public static T DecompressAsset<T>(byte[] data, System.Action<float> progress_act) {
|
||||
var bytes = DecompressBuffer(data, progress_act);
|
||||
var result = BytesToAsset<T>(bytes);
|
||||
return result;
|
||||
}
|
||||
@@ -211,6 +212,41 @@ namespace FTEditor {
|
||||
}
|
||||
}
|
||||
|
||||
static byte[] CompressBuffer(byte[] bytes, System.Action<float> progress_act) {
|
||||
using ( var output = new MemoryStream() ) {
|
||||
using ( var compressor = new ZlibStream(output, CompressionMode.Compress, CompressionLevel.Default) ) {
|
||||
var n = 0;
|
||||
while ( n < bytes.Length ) {
|
||||
var count = Mathf.Min(4 * 1024, bytes.Length - n);
|
||||
compressor.Write(bytes, n, count);
|
||||
n += count;
|
||||
if ( progress_act != null ) {
|
||||
progress_act((float)n / bytes.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
return output.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
static byte[] DecompressBuffer(byte[] compressed_bytes, System.Action<float> progress_act) {
|
||||
using ( var input = new MemoryStream(compressed_bytes) ) {
|
||||
using ( var decompressor = new ZlibStream(input, CompressionMode.Decompress) ) {
|
||||
using ( var output = new MemoryStream() ) {
|
||||
int n;
|
||||
var buffer = new byte[4 * 1024];
|
||||
while ( (n = decompressor.Read(buffer, 0, buffer.Length)) != 0 ) {
|
||||
output.Write(buffer, 0, n);
|
||||
if ( progress_act != null ) {
|
||||
progress_act((float)decompressor.Position / input.Length);
|
||||
}
|
||||
}
|
||||
return output.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
// Demo
|
||||
@@ -259,6 +295,32 @@ namespace FTEditor {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
// FileHash
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
public static string GetFileHashWithVersion(string path) {
|
||||
return string.Format(
|
||||
"{0}={1}",
|
||||
GetFileHash(path), SwfVersion.AsString);
|
||||
}
|
||||
|
||||
static string GetFileHash(string path) {
|
||||
try {
|
||||
using ( var sha256 = SHA256.Create() ) {
|
||||
var file_bytes = File.ReadAllBytes(path);
|
||||
var hash_bytes = sha256.ComputeHash(file_bytes);
|
||||
return
|
||||
System.Convert.ToBase64String(hash_bytes) +
|
||||
file_bytes.LongLength.ToString();
|
||||
}
|
||||
} catch ( System.Exception ) {
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
// Menu
|
||||
@@ -286,6 +348,21 @@ namespace FTEditor {
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem("Tools/FlashTools/Reconvert all swf assets")]
|
||||
static void Tools_FlashTools_ReconvertAllSwfAssets() {
|
||||
Tools_FlashTools_ReimportAllSwfFiles();
|
||||
var swf_assets = GetAllSwfAssets();
|
||||
foreach ( var swf_asset in swf_assets ) {
|
||||
if ( swf_asset.Atlas ) {
|
||||
AssetDatabase.DeleteAsset(
|
||||
AssetDatabase.GetAssetPath(swf_asset.Atlas));
|
||||
swf_asset.Atlas = null;
|
||||
}
|
||||
EditorUtility.SetDirty(swf_asset);
|
||||
AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(swf_asset));
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem("Tools/FlashTools/Pregenerate all materials")]
|
||||
static void PregenerateAllMaterials() {
|
||||
var blend_modes = System.Enum.GetValues(typeof(SwfBlendModeData.Types));
|
||||
@@ -299,6 +376,10 @@ namespace FTEditor {
|
||||
SwfMaterialCache.GetDecrMaskMaterial();
|
||||
}
|
||||
|
||||
static SwfAsset[] GetAllSwfAssets() {
|
||||
return SwfEditorUtils.LoadAllAssetsDBByFilter<SwfAsset>("t:SwfAsset");
|
||||
}
|
||||
|
||||
static string[] GetAllSwfFilePaths() {
|
||||
return AssetDatabase.GetAllAssetPaths()
|
||||
.Where(p => Path.GetExtension(p).ToLower().Equals(".swf"))
|
||||
|
||||
@@ -27,6 +27,17 @@ namespace FTRuntime.Internal {
|
||||
//
|
||||
//
|
||||
|
||||
public static T GetOrCreateComponent<T>(GameObject obj) where T : Component {
|
||||
var comp = obj.GetComponent<T>();
|
||||
return comp != null
|
||||
? comp
|
||||
: obj.AddComponent<T>();
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
public static void FillGeneratedMesh(Mesh mesh, SwfClipAsset.MeshData mesh_data) {
|
||||
if ( mesh_data.SubMeshes.Length > 0 ) {
|
||||
mesh.subMeshCount = mesh_data.SubMeshes.Length;
|
||||
|
||||
@@ -6,6 +6,8 @@ namespace FTRuntime {
|
||||
public class SwfAsset : ScriptableObject {
|
||||
[HideInInspector]
|
||||
public byte[] Data;
|
||||
[HideInInspector]
|
||||
public string Hash;
|
||||
[SwfReadOnly]
|
||||
public Texture2D Atlas;
|
||||
[HideInInspector]
|
||||
@@ -15,6 +17,7 @@ namespace FTRuntime {
|
||||
|
||||
void Reset() {
|
||||
Data = new byte[0];
|
||||
Hash = string.Empty;
|
||||
Atlas = null;
|
||||
Settings = SwfSettingsData.identity;
|
||||
Overridden = SwfSettingsData.identity;
|
||||
|
||||
@@ -1,13 +1,21 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using FTRuntime.Internal;
|
||||
|
||||
namespace FTRuntime {
|
||||
[ExecuteInEditMode, DisallowMultipleComponent]
|
||||
#if UNITY_5_6_OR_NEWER
|
||||
[RequireComponent(typeof(MeshFilter), typeof(MeshRenderer), typeof(SortingGroup))]
|
||||
#else
|
||||
[RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))]
|
||||
#endif
|
||||
public class SwfClip : MonoBehaviour {
|
||||
|
||||
MeshFilter _meshFilter = null;
|
||||
MeshRenderer _meshRenderer = null;
|
||||
#if UNITY_5_6_OR_NEWER
|
||||
SortingGroup _sortingGroup = null;
|
||||
#endif
|
||||
|
||||
bool _dirtyMesh = true;
|
||||
SwfClipAsset.Sequence _curSequence = null;
|
||||
@@ -182,6 +190,34 @@ namespace FTRuntime {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current frame mesh bounding volume in local space
|
||||
/// (Since 1.3.8)
|
||||
/// </summary>
|
||||
/// <value>The bounding volume in local space</value>
|
||||
public Bounds currentLocalBounds {
|
||||
get {
|
||||
var frame = GetCurrentBakedFrame();
|
||||
return frame != null
|
||||
? frame.CachedMesh.bounds
|
||||
: new Bounds();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current frame mesh bounding volume in world space
|
||||
/// (Since 1.3.8)
|
||||
/// </summary>
|
||||
/// <value>The bounding volume in world space</value>
|
||||
public Bounds currentWorldBounds {
|
||||
get {
|
||||
Internal_UpdateMesh();
|
||||
return _meshRenderer
|
||||
? _meshRenderer.bounds
|
||||
: new Bounds();
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
// Functions
|
||||
@@ -247,7 +283,7 @@ namespace FTRuntime {
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
internal void Internal_LateUpdate() {
|
||||
internal void Internal_UpdateMesh() {
|
||||
if ( _meshFilter && _meshRenderer && _dirtyMesh ) {
|
||||
var baked_frame = GetCurrentBakedFrame();
|
||||
if ( baked_frame != null ) {
|
||||
@@ -274,8 +310,11 @@ namespace FTRuntime {
|
||||
}
|
||||
|
||||
void ClearCache() {
|
||||
_meshFilter = GetComponent<MeshFilter>();
|
||||
_meshRenderer = GetComponent<MeshRenderer>();
|
||||
_meshFilter = SwfUtils.GetOrCreateComponent<MeshFilter>(gameObject);
|
||||
_meshRenderer = SwfUtils.GetOrCreateComponent<MeshRenderer>(gameObject);
|
||||
#if UNITY_5_6_OR_NEWER
|
||||
_sortingGroup = SwfUtils.GetOrCreateComponent<SortingGroup>(gameObject);
|
||||
#endif
|
||||
_dirtyMesh = true;
|
||||
_curSequence = null;
|
||||
_curPropBlock = null;
|
||||
@@ -336,6 +375,12 @@ namespace FTRuntime {
|
||||
_meshRenderer.sortingOrder = sortingOrder;
|
||||
_meshRenderer.sortingLayerName = sortingLayer;
|
||||
}
|
||||
#if UNITY_5_6_OR_NEWER
|
||||
if ( _sortingGroup ) {
|
||||
_sortingGroup.sortingOrder = sortingOrder;
|
||||
_sortingGroup.sortingLayerName = sortingLayer;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void UpdatePropBlock() {
|
||||
@@ -348,13 +393,14 @@ namespace FTRuntime {
|
||||
var sprite = clip ? clip.Sprite : null;
|
||||
var atlas = sprite && sprite.texture ? sprite.texture : Texture2D.whiteTexture;
|
||||
var atlasA = sprite ? sprite.associatedAlphaSplitTexture : null;
|
||||
if ( atlas ) {
|
||||
_curPropBlock.SetTexture("_MainTex", atlas);
|
||||
}
|
||||
_curPropBlock.SetTexture(
|
||||
"_MainTex",
|
||||
atlas ? atlas : Texture2D.whiteTexture);
|
||||
if ( atlasA ) {
|
||||
_curPropBlock.SetTexture("_AlphaTex", atlasA);
|
||||
_curPropBlock.SetFloat("_ExternalAlpha", 1.0f);
|
||||
} else {
|
||||
_curPropBlock.SetTexture("_AlphaTex", Texture2D.whiteTexture);
|
||||
_curPropBlock.SetFloat("_ExternalAlpha", 0.0f);
|
||||
}
|
||||
_meshRenderer.SetPropertyBlock(_curPropBlock);
|
||||
|
||||
@@ -309,18 +309,23 @@ namespace FTRuntime {
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
internal void Internal_Update(float scaled_dt, float unscaled_dt) {
|
||||
if ( isPlaying ) {
|
||||
_tickTimer += useUnscaledDt ? unscaled_dt : scaled_dt;
|
||||
do {
|
||||
var frame_rate = clip ? clip.frameRate * rateScale : 0.0f;
|
||||
var frame_time = frame_rate > 0.0f ? 1.0f / frame_rate : 0.0f;
|
||||
if ( frame_time > 0.0f && frame_time <= _tickTimer ) {
|
||||
_tickTimer -= frame_time;
|
||||
while ( isPlaying && clip ) {
|
||||
var dt = useUnscaledDt ? unscaled_dt : scaled_dt;
|
||||
var frame_rate = clip.frameRate * rateScale;
|
||||
if ( dt > 0.0f && frame_rate > 0.0f ) {
|
||||
_tickTimer += frame_rate * dt;
|
||||
if ( _tickTimer >= 1.0f ) {
|
||||
var unused_dt = (_tickTimer - 1.0f) / frame_rate;
|
||||
_tickTimer = 0.0f;
|
||||
TimerTick();
|
||||
scaled_dt = unused_dt * (scaled_dt / dt);
|
||||
unscaled_dt = unused_dt * (unscaled_dt / dt);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} while ( isPlaying );
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -262,7 +262,7 @@ namespace FTRuntime {
|
||||
for ( int i = 0, e = _clips.Count; i < e; ++i ) {
|
||||
var clip = _clips[i];
|
||||
if ( clip ) {
|
||||
clip.Internal_LateUpdate();
|
||||
clip.Internal_UpdateMesh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,14 +30,14 @@ namespace FTRuntime {
|
||||
public static SwfSettingsData identity {
|
||||
get {
|
||||
return new SwfSettingsData{
|
||||
MaxAtlasSize = 1024,
|
||||
MaxAtlasSize = 2048,
|
||||
AtlasPadding = 1,
|
||||
PixelsPerUnit = 100.0f,
|
||||
GenerateMipMaps = false,
|
||||
AtlasPowerOfTwo = true,
|
||||
AtlasForceSquare = true,
|
||||
AtlasTextureFilter = AtlasFilter.Bilinear,
|
||||
AtlasTextureFormat = AtlasFormat.AutomaticCompressed};
|
||||
AtlasTextureFormat = AtlasFormat.AutomaticTruecolor};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
15
Assets/FlashTools/Scripts/FTRuntime/SwfVersion.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace FTRuntime {
|
||||
public static class SwfVersion {
|
||||
public const int Major = 1;
|
||||
public const int Minor = 3;
|
||||
public const int Revision = 8;
|
||||
|
||||
public static string AsString {
|
||||
get {
|
||||
return string.Format(
|
||||
"{0}.{1}.{2}",
|
||||
Major, Minor, Revision);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/FlashTools/Scripts/FTRuntime/SwfVersion.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9326b7a46761449f7bbb3d857cffacec
|
||||
timeCreated: 1495899500
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -65,6 +65,9 @@
|
||||
<None Include="..\..\Assets\FlashTools\Scripts\FTRuntime\SwfSettings.cs.meta">
|
||||
<Link>FTRuntime\SwfSettings.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\Assets\FlashTools\Scripts\FTRuntime\SwfVersion.cs.meta">
|
||||
<Link>FTRuntime\SwfVersion.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\Assets\FlashTools\Scripts\FTRuntime\Yields.meta">
|
||||
<Link>FTRuntime\Yields.meta</Link>
|
||||
</None>
|
||||
@@ -115,6 +118,9 @@
|
||||
<Compile Include="..\..\Assets\FlashTools\Scripts\FTRuntime\SwfSettings.cs">
|
||||
<Link>FTRuntime\SwfSettings.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\Assets\FlashTools\Scripts\FTRuntime\SwfVersion.cs">
|
||||
<Link>FTRuntime\SwfVersion.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\Assets\FlashTools\Scripts\FTRuntime\Internal\SwfAssocList.cs">
|
||||
<Link>FTRuntime\Internal\SwfAssocList.cs</Link>
|
||||
</Compile>
|
||||
|
||||
@@ -28,9 +28,6 @@
|
||||
<DefineConstants>FT_VERSION_FULL</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<Folder Include="FTSwfTools\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="mscorlib">
|
||||
<HintPath>..\DLLs\mscorlib.dll</HintPath>
|
||||
@@ -45,6 +42,9 @@
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="FTSwfTools\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\Assets\FlashTools\Scripts\Editor\FTSwfTools\SwfContext.cs">
|
||||
<Link>FTSwfTools\SwfContext.cs</Link>
|
||||
|
||||
@@ -22,7 +22,7 @@ GraphicsSettings:
|
||||
- {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_PreloadedShaders: []
|
||||
m_ShaderSettings:
|
||||
useScreenSpaceShadows: 1
|
||||
useScreenSpaceShadows: 0
|
||||
m_BuildTargetShaderSettings: []
|
||||
m_LightmapStripping: 0
|
||||
m_FogStripping: 0
|
||||
|
||||
249
ProjectStuff/FlashTools.org
Normal file
@@ -0,0 +1,249 @@
|
||||
* Flash Animation Toolset
|
||||
** Планы
|
||||
*** Поддержка PlayMaker
|
||||
*** Флеш фильтры
|
||||
*** Поддержка звуков
|
||||
*** Поддержка uGUI
|
||||
*** Поддержка "tight" атласов
|
||||
*** Подумать на счет бандлов, чтобы паковать несколько анимаций в одну текстуру
|
||||
*** Нужна поддержка незабейканных анимаций
|
||||
*** Нужна возможность выгрузки иерархий из флеша
|
||||
*** Подумать на тему опциональных нормалей для меша
|
||||
*** Подумать на тему возможности заменять материалы на свои
|
||||
*** Блендинг моды
|
||||
**** Alpha, Erase
|
||||
**** Использовать UNITY_FRAMEBUFFER_FETCH_AVAILABLE для iOS
|
||||
#pragma only_renderers framebufferfetch
|
||||
*** Выборочный экспорт
|
||||
**** Экспортных клипов
|
||||
**** Сиквенций для клипа
|
||||
**** Не паковать неиспользуемые битмапы
|
||||
*** Выгрузка статических клипов как спрайтов в текстуре
|
||||
*** PingPong режим контроллера
|
||||
*** Кропать битмапы
|
||||
Возможно даже с опциональными поворотами в качестве оптимизации места
|
||||
*** Кеш мешей в SwfManager
|
||||
**** Создание и наполнение мешей для кадров в SwfManager
|
||||
**** Возможность задания максимального размера сгенерированных мешей в кеше
|
||||
*** Обрабатывать дублирующиеся кадры анимации
|
||||
*** Улучшить превью
|
||||
**** Кнопочки для старта и паузы
|
||||
**** Зум
|
||||
**** Выбор кадра
|
||||
**** В превью писать стату по клипу
|
||||
*** Баги на погуглить
|
||||
**** В превью не работает стенсил
|
||||
https://github.com/MattRix/UnityDecompiled/blob/master/UnityEditor/UnityEditor/PreviewRenderUtility.cs
|
||||
**** Починить превью префаба в редакторе
|
||||
** Версия X.X.X
|
||||
*** Общее
|
||||
**** Написать автоматический скрипт выгрузки API Reference
|
||||
*** Улучшения
|
||||
**** Поддержка Unity Animator
|
||||
**** Сделать внешний конфиг для конвертации swf
|
||||
***** Общие настройки оптимизации и скейла
|
||||
***** Возможность задавать растеризованный скеил для отдельных клипов
|
||||
**** Нужные более понятные ворнинги на неподдерживаемые теги
|
||||
**** Нужен ворнинг на использование флеш-ide старой версии
|
||||
**** Возможность конфигурировать параметры групп в редакторе, а не только в рантайме
|
||||
https://gist.github.com/talecrafter/111ea3345911bd238f4998b4d5a04bf3
|
||||
** TODO Версия 1.3.9
|
||||
*** Общее
|
||||
**** TODO Написать гайд по качеству выгружаемых анимаций
|
||||
**** TODO Гайд по использованию ETC1 текстур для анимаций
|
||||
*** Улучшения
|
||||
**** TODO Сделать возможность задавать локальные настройки для папки, а не только глобальные
|
||||
**** TODO Note на ассет когда текстура сжата до максимального размера
|
||||
**** TODO У ворнингов конверта нет контекста
|
||||
**** TODO Поддержка юнити-атласов
|
||||
**** TODO Поддержка задавать теги и сплит текстур на альфу для etc
|
||||
*** Баги
|
||||
**** TODO Скейлы клипов не проверяются в группах
|
||||
**** TODO graphics_scale не влияет на растр
|
||||
**** TODO Оптимизации по скейлу не влияют на растр
|
||||
**** TODO Не работает конвертация в batchmod'е
|
||||
**** TODO Площадь для оптимизации вычисляется некорректно при повёрнутых клипах
|
||||
**** TODO Возможно проблемы с DX9
|
||||
UNITY_UV_STARTS_AT_TOP
|
||||
UNITY_HALF_TEXEL_OFFSET
|
||||
** TODO Версия 1.3.8
|
||||
*** Улучшения
|
||||
**** DONE Ворнинг на shape-tween
|
||||
**** DONE Скрипты для выгрузки в разных масштабах
|
||||
**** DONE Избавиться от условия на _ExternalAlpha
|
||||
**** DONE Добавить возможность брать bounds у клипа
|
||||
**** DONE Не реимпортить на каждый чих анимацию, хранить хэш
|
||||
dipyalov: фишка в том, что swf обновился, но и собранные ассеты-то тоже обновились
|
||||
**** DONE Добавить версию в хэш анимаций, дабы они конвертились при смене версии плагина
|
||||
**** DONE Добавить ворнинг на некорректные твины (с шейпами и группами)
|
||||
**** DONE Группы без шейпов не нужно растеризировать
|
||||
**** DONE Элемент может быть залокан (element.locked)
|
||||
**** DONE Возможно не стоит преобразовывать группы в символы
|
||||
Таки стоит, но с рекурсивным выносом в отдельные символы и последующей их обработкой
|
||||
**** DONE В ошибках конвертации писать, что нужно прогнать через скрипт экспорта
|
||||
А еще лучше как-то метить прогнанную анимацию и нет
|
||||
**** DONE Добавить прогресс на LoadSymbol
|
||||
**** DONE Реализовать прогресс для CompressAsset
|
||||
*** Баги
|
||||
**** DONE При больших (>= 4000 пикселей) выделениях не работает convertSelectionToBitmap
|
||||
**** DONE В ошибках конвертации не пишется путь до swf
|
||||
**** DONE Не растеризуются группы в твинах
|
||||
**** DONE Проблемы с порядком drawing objects и groups при экспорте
|
||||
**** DONE При конверте нескольких документов накапливаются временные значения(max_scale, unique_id)
|
||||
**** DONE Unity может переставлять сабмеши на одинаковой глубине (проблема с масками)
|
||||
https://fogbugz.unity3d.com/default.asp?910858_0diqjnj67814hj3i
|
||||
http://ru.esotericsoftware.com/forum/Submeshes-render-in-random-order-with-orthographic-camera-8528
|
||||
**** DONE При автоплее с пустым клипом контроллер накапливает _tickTimer
|
||||
**** DONE Шейпы в классических твинах (да, это ошибка, но флеш её пропускает) не растеризуются
|
||||
**** DONE При множественном импорте ошибка в импорте по поводу удаление из-под носа ассета воспроизводится 100%
|
||||
**** DONE Некорректно кончающиеся твинны плохо дружат с оптимизацией и растеризацией
|
||||
**** DONE Скейл фильтров не заходит в группы
|
||||
**** DONE Поставить обязательный full rect для спрайтов пока нет поддержки юнити атласов
|
||||
** DONE Версия 1.3.7
|
||||
*** Баги
|
||||
**** DONE Проблемы в single frame optimization (не выходит из забейканого символа)
|
||||
**** DONE Не импортит несколько анимаций за раз
|
||||
** DONE Версия 1.3.6
|
||||
*** Улучшения
|
||||
**** DONE Заюзать CustomYieldInstruction для кастомных корутин
|
||||
**** DONE Написать расширение для удобного пользования корутин
|
||||
**** DONE Оптимизация растеризации больших клипов
|
||||
**** DONE добавить export_path_postfix
|
||||
*** Баги
|
||||
**** DONE При оптимизации и скейлинге очень маленькие айтемы уезжают
|
||||
** DONE Версия 1.3.5
|
||||
*** Общее
|
||||
**** DONE Обновить документацию
|
||||
*** Баги
|
||||
**** DONE Проблема с отсутствующим спрайтом при первом импорте
|
||||
** DONE Версия 1.3.4
|
||||
*** Баги
|
||||
**** DONE Проблемы в cs6 (isArray)
|
||||
**** DONE Обновить систему импорта анимаций, т.к. импорт идёт два раза + иногда атласы пустые
|
||||
** DONE Версия 1.3.3
|
||||
*** Баги
|
||||
**** DONE unusedItems не определен в CS6
|
||||
** DONE Версия 1.3.2
|
||||
*** Баги
|
||||
**** DONE Пофиксить поведение graphics_scale вместе с оптимизацией small_item
|
||||
** DONE Версия 1.3.1
|
||||
*** Баги
|
||||
**** DONE Пофиксить деприкейтеты в 5.5
|
||||
** DONE Версия 1.3.0
|
||||
*** Улучшения
|
||||
**** DONE Сделать приписку, что мол маски в превью не работают
|
||||
**** DONE Оптимизировать растеризацию вектора, который используется только в даунскейле
|
||||
**** DONE Разделение альфы и диффуза для андройд (ETC1)
|
||||
**** DONE Возможность при экспорте указывать скеил анимации, чтобы растеризовалось x2 к нормальному размеру, например
|
||||
** DONE Версия 1.2.0
|
||||
*** Улучшения
|
||||
**** DONE Написать импорт без двух фаз с помощью трюка с подпиской на апдейт редактора после импорта всех ассетов
|
||||
https://github.com/talecrafter/AnimationImporter/blob/master/Assets/AnimationImporter/Editor/AnimationAssetPostProcessor.cs
|
||||
*** Код
|
||||
**** DONE Корутины на ожидание анимации
|
||||
https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-unity/Assets/spine-unity/Modules/YieldInstructions
|
||||
**** DONE Заюзать PreferBinarySerialization
|
||||
https://docs.unity3d.com/ScriptReference/PreferBinarySerialization.html
|
||||
**** DONE Добавить возможность игнорировать масштабирование времени для групп и отдельных анимаций
|
||||
*** Баги
|
||||
**** DONE Проблемы с реконвертом дублированных или копированных клипов ассетов
|
||||
**** DONE Глючат guide слои
|
||||
** DONE Версия 1.1.1
|
||||
*** Баги
|
||||
**** DONE Жизнь просле смерти по дестрою из ивента при лаге
|
||||
**** DONE Отвалился CS6 на анимации медведя от Tortuga
|
||||
Добавить ворнинг на неподдерживаемые shape tween в CS6
|
||||
** DONE Версия 1.1
|
||||
*** Код
|
||||
**** DONE Нужно уметь обрабатывать несколько FrameLabel'ов в одном кадре и иметь доступ к ним
|
||||
currentLabel, currentLabels, currentFrameLabel
|
||||
**** DONE Разделение сиквенций переделать на anchor frame label
|
||||
**** DONE Возможность пользовательских событий из кадров анимации
|
||||
** DONE Версия 1.0
|
||||
*** Общее
|
||||
**** DONE Оформление страницы в сторе
|
||||
***** DONE Иконки
|
||||
***** DONE Описание
|
||||
***** DONE Видео конвертации анимации и добавления её в игру
|
||||
***** DONE Скриншоты
|
||||
**** DONE Документация
|
||||
***** DONE Xml документация в коде
|
||||
***** DONE Страница плагина на сайте
|
||||
****** DONE Описание фич
|
||||
****** DONE Пошаговые уроки
|
||||
****** DONE Описание методов API
|
||||
*** Код
|
||||
**** DONE Спрятать internal функции из SwfManager и SwfClop
|
||||
**** DONE Возможность бесплатной версии
|
||||
***** DONE Запаковать весь код в dll
|
||||
***** DONE Поработать с internal для внутренних классов dll, дабы наружу не торчали
|
||||
***** DONE Ограничить конвертацию на N клипов в проекте
|
||||
**** DONE Поддержка палитровых битмапов
|
||||
посмотреть с премультед альфой ли они
|
||||
*** Баги
|
||||
**** DONE При ошибках конверта swf - ассет должен остаться не измененный или не появиться вообще с одной ошибкой парсинга
|
||||
**** DONE Нужны одинаковые имена для dll разных версий
|
||||
** DONE Версия 0.5
|
||||
*** Улучшения
|
||||
**** DONE Выводить ошибки при встрече не поддерживаемых режимов смешивания и фильтров
|
||||
**** DONE Блендинг моды
|
||||
*** Баги
|
||||
**** DONE Клеить в один кадр только если это целесообразно по площади
|
||||
** DONE Версия 0.4
|
||||
*** Улучшения
|
||||
**** DONE Возможность подмешивать свой цвет в анимацию (tint)
|
||||
**** DONE Добавить свой префикс для сообщений в лог
|
||||
**** DONE Кнопка дефолтных настроек в меню
|
||||
**** DONE Ворнинг об установке неверной секвенции
|
||||
**** DONE GotoAndX добавить выбор секвенций
|
||||
**** DONE Play, Stop добавить rewind
|
||||
**** DONE Кнопка для переконверта всех анимаций
|
||||
**** DONE Добавить в менеджер анимаций rate scale, паузу и резюм
|
||||
**** DONE Группы анимаций с отдельной паузой и рейт скейлом
|
||||
*** Баги
|
||||
**** DONE С переносами всей папки какая-то беда, особенно с копированием
|
||||
**** DONE При даунскейле поганятся края спрайтов
|
||||
** DONE Версия 0.3
|
||||
*** Улучшения
|
||||
**** DONE Вынести ссылку на дефолтные настройки в каждый ассет для удобного доступа к ним
|
||||
**** DONE Рисовать превью для ассета анимации
|
||||
**** DONE Показывать в инспекторе ассета информацию о всех последовательностях
|
||||
для этого есть превью теперь
|
||||
**** DONE В редакторе ассета показывать все дочерние клипы
|
||||
**** DONE Ну добавлять в геометрию полностью прозрачные инстансы
|
||||
**** DONE Добавить GotoAndStop, GotoAndPlay
|
||||
*** Баги
|
||||
**** DONE min и max для умножения трансформаций цвета проверить
|
||||
**** DONE Материалы всё еще появляются в инспекторе, хотя должны быть скрыты
|
||||
**** DONE currentFrame при автоплее скидывается в ноль
|
||||
**** DONE после проигрывания в редакторе с автоплеем currentFrame скидывается в ноль
|
||||
**** DONE после реимпорта снова не обновляется анимация на сцене
|
||||
**** DONE При импорте нескольких swf на долго зависает без причин
|
||||
ибо размер ассетов получается просто гиганский
|
||||
еще лишние сейвы были
|
||||
**** DONE Sorting Layer не рисуется болдом, когда перегружен из префаба
|
||||
**** DONE В событиях клипа нужно иметь возможность удалять самого себя
|
||||
**** DONE При множественном экспорте ревертится только последний документ
|
||||
**** DONE Мультиредактирования секвенции анимации не работает для разных ассетов
|
||||
** DONE Версия 0.2
|
||||
*** Улучшения
|
||||
**** DONE Проверять дубликаты битмапов
|
||||
**** DONE Запекать статичные клипы в одну текстуру
|
||||
**** DONE Выборочная выгрузка отдельных клипов
|
||||
**** DONE Выводить в лог ошибки о непонятных и не поддерживаемых тегах
|
||||
**** DONE HashSet в менеджере заменить AssocList'ом
|
||||
*** Баги
|
||||
**** DONE Нужно выводить в лог ошибки о зашитом векторе
|
||||
** DONE Версия 0.1
|
||||
*** Улучшения
|
||||
**** DONE Reverse анимация
|
||||
**** DONE Варианты анимации по названию фреймов
|
||||
**** DONE События в контроллер анимации
|
||||
**** DONE Смена скорости проигрывания анимации
|
||||
*** Баги
|
||||
**** DONE Нельзя переместить плагин в другую папку
|
||||
**** DONE При исключении в подготовке кадров анимации не удаляется полученный некорректный ассет
|
||||
**** DONE Глючит множественное редактирование анимаций в инспекторе
|
||||
**** DONE Анимации на сцене теряют материалы после реконверта их ассета
|
||||
**** DONE Изменения в инстансе префаба скидываются при старте
|
||||
**** DONE При внешней замене swf теряются ссылки с анимаций на ассет
|
||||
|
Before Width: | Height: | Size: 452 KiB After Width: | Height: | Size: 452 KiB |