forked from wabimochi/2dActorTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
814 lines (783 loc) · 43.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="./ext.js"></script>
<script src="./lib/CSInterface.js"></script>
<script src="./lib/jquery-1.9.1.js"></script>
<script src="./node_modules/uikit/dist/js/uikit.min.js"></script>
<script src="./node_modules/uikit/dist/js/uikit-icons.min.js"></script>
<script src="./node_modules/sortablejs/dist/sortable.umd.js"></script>
<script src="./lib/Vulcan.js"></script>
<script src="./js/svg.js"></script>
<script src="./js/util.js"></script>
<script src="./js/setting.js"></script>
<script src="./js/autocropmodule.js"></script>
<script src="./js/actor_edit.js"></script>
<script src="./js/auto_import.js"></script>
<script src="./js/auto_newline.js"></script>
<script src="./js/property_deploy.js"></script>
<script src="./js/subtitle.js"></script>
<script src="./js/trigger_clip_override.js"></script>
<link id="uikitstyle" href="node_modules/uikit/dist/css/uikit.min.css" rel="stylesheet" type="text/css">
<link id="tdactorstyle" href="css/tdActor.css" rel="stylesheet" type="text/css">
<link id="tdactorstyle" href="node_modules/dragula/dist/dragula.min.css" rel="stylesheet" type="text/css">
</head>
<body onContextmenu="return false;" onLoad="onLoaded()" spellcheck="false">
<div id="extension_version"></div>
<div class='uk-flex-center'>
<a href="javascript:history.go(0)" uk-icon="icon: refresh" class='uk-margin-remove'></a>
<a href="#" id='setting_file_not_exist_icon' class='uk-align-right uk-animation-slide-right-small' uk-toggle="target: #settigs_file_modal" uk-icon="icon: warning" style="color:yellow; display: none; margin:0 10px 0 0;" uk-tooltip="title: 設定ファイルがありません。ここをクリックして保存先を指定してください。; pos: bottom-right"></a>
</div>
<div id="settigs_file_modal" uk-modal>
<div class="uk-modal-dialog uk-modal-body">
<button class="uk-modal-close-default" id="setting_save_modal_close" type="button" uk-close></button>
<p>設定ファイル</p>
<div class="uk-flex-center uk-child-width-expand@ss uk-margin-left uk-margin-right" uk-grid>
<button class="uk-button uk-button-secondary uk-button-small uk-padding-remove-left uk-margin-small-left uk-margin-small-right" onClick="NewSettingFile()">保存</button>
<button class="uk-button uk-button-secondary uk-button-small uk-padding-remove-left uk-margin-small-left uk-margin-small-right" onClick="ImportSettingFile()">インポート</button>
</div>
</div>
</div>
<div id="busy_notification" uk-modal='esc-close:false; bg-close:false' class="uk-modal">
<div class="uk-modal-dialog uk-modal-body">
<button class="uk-modal-close-default" type="button" uk-close></button>
<div id="busy_text" style="text-align:center"></div>
<progress id="busy_progress" class="td_progress uk-progress" value="0" max="10"></progress>
</div>
</div>
<div id="error_notification" uk-modal>
<div class="uk-modal-dialog uk-modal-body">
<button class="uk-modal-close-default" type="button" uk-close></button>
<h2 class="uk-modal-title" style="color: #fff;">Error</h2>
<div id="error_text" style="text-align:center; word-break:break-word;"></div>
<hr>
<div id="error_help_label"style="display: inline-block; border-bottom: solid 1px var(--main-color1); padding:0px 10px">Info</div>
<div id="error_notification_help" style="text-align:left"></div>
</div>
</div>
<div id="mainfunc">
<ul class="uk-flex-center" id="function_switch" uk-tab="active: 0;">
<li id="function_subtitle"><a href="#">字幕</a></li>
<li id="function_property_deploy"><a href="#">リファインツール</a></li>
<li id="function_actor"><a href="#">立ち絵</a></li>
<li id="function_auto_import"><a href="#">自動インポート</a></li>
<li id="extention_setting"><a href="#">設定</a></li>
</ul>
<ul class="uk-switcher" id='actor_functions'>
<li>
<div class='uk-flex-center uk-child-width-expand@ss uk-margin-left uk-margin-right'>
<button class="uk-button uk-button-secondary uk-button-small uk-margin-small-left uk-margin-small-right" onClick="importMGT()">mogrtのインポート</button>
<hr>
<details open>
<summary class="td_summary">ソース:Audioと同じフォルダにあるtxtファイル</summary>
<div class='uk-flex-center uk-child-width-expand@ss uk-margin-left uk-margin-right'>
<span class="uk-label tdactor_label uk-width-auto">トラックに並べるMOGRTを選択</span>
<div class="uk-flex" style="align-items: baseline;">
<select class="tdactor_selectbox uk-width-expand uk-select" id="select_mogrt"></select>
<div id="mogrt_history_trash" class="insert_setting_icon" uk-tooltip="履歴から消します" style="padding-left:15px; padding-right:15px" hidden>
<a href="#" class="icon_s" uk-icon="icon: trash"></a>
</div>
</div>
<span class="uk-label tdactor_label uk-width-auto">プリセットタグ</span>
<input class="uk-input uk-light tdinput save_setting_value_on_change" type="text" category="insert_subtitle" id="preset_tag" value=">" placeholder="preset tag...">
<span class="uk-label tdactor_label uk-width-auto uppercase_disable">Replace(正規表現)</span>
<div class='uk-flex-inline'>
<input category='insert_subtitle' class="uk-input uk-light tdinput save_setting_value_on_change" type="text" id="subtitle_replace" value="" placeholder="マッチングパターン">
<input category='insert_subtitle' class="uk-input uk-light tdinput save_setting_value_on_change" type="text" id="subtitle_replace_flag" value="" placeholder="フラグ">
<input category='insert_subtitle' class="uk-input uk-light tdinput save_setting_value_on_change" type="text" id="subtitle_replace_after" value="" placeholder="Replace後">
</div>
<button class="uk-button uk-button-secondary uk-button-small uk-margin-small-right" style='margin-top:8px;' onClick="insertSubtitleFromTextFile()">ターゲットトラックにMOGRTを並べる</button>
<div class='uk-flex-center uk-child-width-expand@ss uk-margin-left uk-margin-right'>
</div>
</div>
</details>
<details>
<summary class="td_summary">ソース:PSD</summary>
<span class="uk-label tdactor_label_secondary uk-width-auto">対象のクリップを選択してコピー/ペーストボタンをクリック</span>
<div class='uk-flex-center uk-child-width-expand@ss uk-margin-left uk-margin-right' style='text-align: center;'>
<button category="insert_subtitle" id="psd_import_bin" class="uk-button uk-button-secondary uk-button-small uk-width-midium uppercase_disable text_ellipsis get_select_project_bin">
インポート先のビンを選択してクリック
</button>
<button class="uk-button uk-button-secondary uk-button-small" style='margin-top:8px;' onClick="insertSubtitleFromPSD()">ターゲットトラックにPSDを並べる</button>
</div>
</details>
<details>
<summary class="td_summary">ソース:テキストエリア</summary>
<div class='uk-flex-center uk-child-width-expand@ss uk-margin-left uk-margin-right'>
<span class="uk-label tdactor_label uk-width-auto">トラックに並べるテキストを入力</span>
<textarea id="subtitles" rows="12" wrap="off" placeholder="input subtitles"></textarea>
<button class="uk-button uk-button-secondary uk-button-small uk-margin-small-left uk-margin-small-right" style='margin-top:8px;' onClick="insertSubtitleFromTextarea()">ターゲットトラックにMOGRTを並べる</button>
</div>
</details>
</div>
<div>
</div>
</li>
<li>
<div class="uk-margin-left uk-width-auto" uk-toggle="target: #offcanvas-nav"><a href="#" class="uk-margin-small-right" uk-icon="icon: menu"></a></div>
<hr>
<div id="offcanvas-nav" uk-offcanvas="overlay: true">
<div class="uk-offcanvas-bar">
<button class="uk-offcanvas-close" type="button" uk-close></button>
<ul class="uk-nav uk-nav-default" uk-switcher="connect: .my-class">
<li class="uk-nav-header">ツールリスト</li>
<li class="uk-nav-divider"></li>
<li class="uk-active"><a href="#">プロパティコピー</a></li>
<li><a href="#">自動改行</a></li>
<li><a href="#">トリガークリップオーバーライト</a></li>
</ul>
</div>
</div>
<ul class="uk-switcher my-class uk-margin">
<li class="uk-active">
<div class='uk-flex-center uk-child-width-expand@ss uk-margin-left uk-margin-right'>
<span class="uk-label tdactor_label_secondary uk-width-auto uk-margin-remove-top">対象のクリップを選択してコピー/ペーストボタンをクリック</span>
<div class="uk-flex-center uk-child-width-expand@ss uk-margin-left uk-margin-right" uk-grid>
<button class="uk-button uk-button-secondary uk-button-small uk-padding-remove-left uk-margin-small-left uk-margin-small-right" onClick="propertyCapture()">コピー</button>
<button class="uk-button uk-button-secondary uk-button-small uk-padding-remove-left uk-margin-small-left uk-margin-small-right" onClick="propertyDeploy()">ペースト</button>
</div>
</div>
<div id="capturedParameters">
</div>
</li>
<li>
<div class="uk-flex-center uk-child-width-expand@ss uk-margin-left uk-margin-right">
<div class="uk-margin"><label><input id="auto_newline_ascii" category="autonewline" class="uk-checkbox td_check save_setting_check_on_change" type="checkbox" checked> 半角英数字は0.5文字としてカウントする</label></div>
<div class="uk-margin"><label><input id="auto_newline_marker" category="autonewline" class="uk-checkbox td_check save_setting_check_on_change" type="checkbox" checked onclick="autoNewLineMarkerUIUpdate()"> 改行対象のクリップ位置にマーカーを付ける</label></div>
<div class="uk-margin-left uk-flex-inline uk-flex-middle" id="auto_newline_normal_marker_color" category="autonewline">
<div class="uk-margin-left"></div>
<div class="merker_color_selector" style="background-color: #718637;"></div>
<div class="merker_color_selector" style="background-color: #D22C36;"></div>
<div class="merker_color_selector" style="background-color: #AF8BB1;"></div>
<div class="merker_color_selector" style="background-color: #E96F24;"></div>
<div class="merker_color_selector" style="background-color: #D0A12B;"></div>
<div class="merker_color_selector" style="background-color: #FFFFFF;"></div>
<div class="merker_color_selector" style="background-color: #428DFC;"></div>
<div class="merker_color_selector" style="background-color: #19F4D6;"></div>
</div>
<div class="uk-margin-left uk-margin">
<label><input id="auto_newline_maxlinecount" category="autonewline" class="uk-input uk-light tdinput input_integer_only save_setting_value_on_change uk-form-small uk-form-width-xsmall uk-margin-left uk-margin-right" type="text" placeholder="行数" value="2">行を超える、もしくは分割できない場合のマーカーの色</label>
</div>
<div class="uk-margin-left uk-flex-inline uk-flex-middle" id="auto_newline_warning_marker_color" category="autonewline">
<div class="uk-margin-left"></div>
<div class="merker_color_selector" style="background-color: #718637;"></div>
<div class="merker_color_selector" style="background-color: #D22C36;"></div>
<div class="merker_color_selector" style="background-color: #AF8BB1;"></div>
<div class="merker_color_selector" style="background-color: #E96F24;"></div>
<div class="merker_color_selector" style="background-color: #D0A12B;"></div>
<div class="merker_color_selector" style="background-color: #FFFFFF;"></div>
<div class="merker_color_selector" style="background-color: #428DFC;"></div>
<div class="merker_color_selector" style="background-color: #19F4D6;"></div>
</div>
<div class="uk-margin"><label><input id="auto_newline_flatten" category="autonewline" class="uk-checkbox td_check save_setting_check_on_change" type="checkbox" checked> 処理する前に改行を消す</label></div>
<div class="uk-margin"><label><input id="auto_newline_insert" category="autonewline" class="uk-checkbox td_check save_setting_check_on_change" type="checkbox" checked> 自動で改行する</label></div>
<div class="uk-margin">
<label>
1行の文字数<input id="auto_newline_maxcount" category="autonewline" class="uk-input uk-light tdinput input_integer_only save_setting_value_on_change uk-form-small uk-form-width-xsmall uk-margin-left uk-margin-right" type="text" value="35">
<a href="#" class="" onClick="countSelectedClipTextLength()" uk-icon="icon: pencil" uk-tooltip="選択中のクリップの文字数を取得"></a>
</label>
</div>
</div>
<div class="uk-flex-center uk-child-width-expand@ss uk-margin-left uk-margin-right">
<span class="uk-label tdactor_label_secondary uk-width-expand">選択中のクリップ、もしくはターゲットトラックにあるソーステキストを対象とします</span>
<button class="uk-button uk-button-secondary uk-width-expand uk-margin-bottom" onClick="autoNewLine_ExecuteButton()">実行</button>
</div>
</li>
<li>
<div class='uk-flex-center uk-child-width-expand@ss uk-margin-left uk-margin-right' id="overwriteclip_trigger_root">
<div class="uk-flex uk-flex-left uk-margin-remove-top">
<span class="uk-label tdactor_label uk-width-auto">トリガー:クリップの開始</span>
</div>
<div class="uk-flex-left uk-margin-left uk-margin-remove-vertical uk-flex-nowrap" uk-grid>
<button category="trigger_clip_override" id="trigger_clipstart_clippath" class="uk-button uk-button-secondary uk-width-large uk-margin-small uk-margin-left uk-margin-remove-bottom uppercase_disable text_ellipsis get_select_project_clip">選択中のクリップをセット</button>
<div class="uk-flex uk-flex-middle uk-width-auto insert_mode uk-flex-nowrap" uk-grid>
<div category="trigger_clip_override" id="trgclp_str_ins_in" class="triggerclip_insert_setting insert_setting_icon insert_inpoint enable" style="padding-left:15px; padding-right:15px"></div>
<div category="trigger_clip_override" id="trgclp_str_ins_out" class="triggerclip_insert_setting insert_setting_icon insert_outpoint disable" style="padding-left:15px; padding-right:15px"></div>
<div category="trigger_clip_override" id="trgclp_str_ins_mkr" class="triggerclip_insert_setting insert_setting_icon insert_marker disable" style="padding-left:15px; padding-right:15px"></div>
<div class="triggerclip_insert_setting insert_setting_icon trigger_clip_trash" style="padding-left:15px; padding-right:15px">
<a href="#" class="icon_s" uk-icon="icon: trash"></a>
</div>
</div>
</div>
<div class="uk-flex uk-flex-left uk-margin-small-top">
<span class="uk-label tdactor_label uk-width-auto">トリガー:クリップの終了</span>
</div>
<div class="uk-flex-left uk-margin-left uk-margin-remove-vertical uk-flex-nowrap" uk-grid>
<button category="trigger_clip_override" id="trigger_clipend_clippath" class="uk-button uk-button-secondary uk-width-large uk-margin-small uk-margin-left uk-margin-remove-bottom uppercase_disable text_ellipsis get_select_project_clip">選択中のクリップをセット</button>
<div class="uk-flex uk-flex-middle uk-width-auto insert_mode uk-flex-nowrap" uk-grid>
<div category="trigger_clip_override" id="trgclp_end_ins_in" class="triggerclip_insert_setting insert_setting_icon insert_inpoint enable" style="padding-left:15px; padding-right:15px"></div>
<div category="trigger_clip_override" id="trgclp_end_ins_out" class="triggerclip_insert_setting insert_setting_icon insert_outpoint disable" style="padding-left:15px; padding-right:15px"></div>
<div category="trigger_clip_override" id="trgclp_end_ins_mkr" class="triggerclip_insert_setting insert_setting_icon insert_marker disable" style="padding-left:15px; padding-right:15px"></div>
<div class="triggerclip_insert_setting insert_setting_icon trigger_clip_trash" style="padding-left:15px; padding-right:15px">
<a href="#" class="icon_s" uk-icon="icon: trash"></a>
</div>
</div>
</div>
<div class="uk-flex uk-flex-left uk-margin-small-top">
<span class="uk-label tdactor_label uk-width-auto">キャラクターの設定ファイル</span>
</div>
<span class="uk-label tdactor_label_secondary uk-margin-remove-bottom uppercase_disable">立ち絵の軽量化をしている場合はセットしてください。</span>
<div class="uk-flex uk-flex-center uk-margin-small uk-flex-nowrap">
<button category="trigger_clip_override" id="trigger_actor_path" class="uk-button uk-button-secondary uk-width-large uk-margin-small uk-margin-right uk-margin-remove-bottom uppercase_disable text_ellipsis get_select_project_mediapath">選択中のクリップをセット</button>
<div class="uk-flex uk-flex-middle uk-width-auto insert_mode uk-flex-nowrap" uk-grid>
<div class="triggerclip_insert_setting insert_setting_icon trigger_clip_trash" style="padding-left:15px; padding-right:15px">
<a href="#" class="icon_s" uk-icon="icon: trash"></a>
</div>
</div>
</div>
</div>
<div class="uk-flex uk-flex-left uk-margin-small-top uk-margin-left">
<span class="uk-label uk-width-auto tdactor_label">クリップをオーバーライトするトラックの選択</span>
</div>
<div class="uk-flex-center uk-child-width-expand@ss uk-margin-left uk-margin-right" uk-grid>
<select class="tdactor_selectbox uk-margin-small-left uk-width-expand uk-select save_setting_value_on_change" category="trigger_clip_override" id="trigger_clip_override_target_seq" type="selectbox">
<option value="0">選択中のシーケンス</option>
<option value="1">アクティブシーケンス</option>
</select>
<select class="tdactor_selectbox uk-margin-small-left uk-width-auto uk-select save_setting_value_on_change" category="trigger_clip_override" id="trigger_clip_override_target_track" type="selectbox">
<option value="0">Video Track</option>
</select>
</div>
<div class="uk-flex-center uk-margin-left uk-margin-right">
<span class="uk-label tdactor_label_secondary uk-width-expand">アクティブシーケンスのターゲットオーディオトラックにあるクリップをトリガーの対象とします</span>
<button class="uk-button uk-button-secondary uk-width-expand uk-margin-bottom" onclick="triggerOverriteClip_ExecuteButton()">実行</button>
</div>
</li>
</ul>
</li>
<li>
<div id="actor_list_root" class="uk-thumbnav td-thumbnav uk-padding uk-padding-small uk-padding-remove-vertical actor_linknav">
<ul>
</ul>
<button id="actor_setting_save_button" class="uk-button uk-button-secondary highlight uk-animation-slide-right-medium uk-width-auto" onClick="SaveActorSetting()" style="margin-left:5px;" hidden>設定の保存</button>
<button id="actor_setting_cancel_button" class="uk-button uk-button-secondary uk-animation-slide-right-medium uk-width-auto" onClick="ActorSettingEnd()" style="margin-left:5px;" hidden>キャンセル</button>
</div>
<div class="uk-flex">
<div id="actor_parts_box" class="uk-width-1-3 actor_parts_top" style="height:100vh; position: sticky; top:0; overflow:scroll; margin-right: 5px; min-width:64px;" hidden>
</div>
<div>
<button id="actor_setting_animation_end_button" class="uk-button uk-button-secondary highlight uk-animation-slide-right-medium uk-width-auto" onClick="AnimationSettingEnd()" style="margin-left:5px;" hidden>アニメーションの設定を終了</button>
<div id="animation_type_root" style="margin-bottom:10px" hidden>
<label>
グループのアニメーションタイプ
<select class="tdactor_selectbox uk-margin-small-left uk-width-auto uk-select" id="select_animation_type">
<option value="0">ランダム</option>
<option value="1">リップシンク(開閉)</option>
</select>
</label>
</div>
<ul class="uk-switcher" id="actor_switcher"></ul>
<div id="animation_editor_root" class="uk-margin-small-left uk-margin-small-right" hidden>
<div>
<div class="uk-label tdactor_inline_label">名前</div>
<input id="animation_editor_name" class="uk-light tdinput" type="text" style="width:300px;">
</div>
<div uk-flex uk-flex-column>
<div class="uk-label tdactor_label">サムネイル</div>
<div id="animation_editor_thumbnail" class="td-thumbnav dragdrop-area-bg" style="min-width:100px; width:fit-content;">
<ul class="uk-flex actor_group" style="min-width:100px; width:fit-content; justify-content: center; padding:10px 20px 10px 20px;">
</ul>
</div>
</div>
<div class="uk-label tdactor_label">フレームクリップ編集</div>
<div>
<div class="uk-margin-small-left uk-margin-right uk-flex uk-flex-left actor_parts_list dragdrop-area-bg" style="position: relative; text-align: center; height:113px">
<div id="animation_editor_help2" style="position:absolute; display:inline-block; font-weight:bold; color:#888; left:0%;">閉じ</div>
<div id="animation_editor_help3" style="position:absolute; display:inline-block; font-weight:bold; color:#888; right:0%;">開き</div>
<div id="animation_editor_thumbnav" class="td-thumbnav uk-width-expand">
<ul class="uk-flex actor_group" style="width:50vw; padding-top:20px">
</ul>
<div id="animation_editor_help1" class="hide_u480" style="position:absolute; display:inline-block; font-weight:bold; color:#8888; white-space:nowrap; transform:translate(-50%, -130%)">ここにパーツをドラッグ&ドロップ</div>
</div>
</div>
</div>
<div class="animation_type0_elm">
<div class="uk-label tdactor_inline_label">間隔(秒)</div>
<input id="animation_editor_interval" class="input_positive_num_only uk-light tdinput" type="text">
</div>
<div class="animation_type0_elm">
<div class="uk-label tdactor_inline_label">ランダムの範囲(秒)</div>
<input id="animation_editor_random_range" class="input_num_only uk-light tdinput" type="text">
</div>
<div class="uk-label tdactor_label">プレビュー</div>
<div id="animation_preview" class="uk-flex uk-flex-column">
<div id="animation_play_button" class="td-icon-button" uk-icon="play"></div>
<div id="animation_view_reset" class="td-icon-button" uk-icon="expand"></div>
<canvas id="animation_preview_canvas" class="thumb_background" width="100" height="100" style="width:100px;height:100px;">The canvas is not valid.</canvas>
</div>
</div>
</div>
</div>
<div id="actor_contextmenu" class="contextmenu">
<ul>
<li id="actor_setting_start_button">設定</li>
<li id="actor_setting_delink">リンク解除</li>
<li id="actor_setting_make_thumbnail">不足しているサムネイルの生成</li>
<li id="actor_setting_delete_thumbnail">サムネイルの削除</li>
<li id="actor_setting_convert_lightweight" uk-tooltip="リンク中のシーケンスを現在の軽量化モードに合わせて変換します">シーケンスの変換</li>
<li id="actor_setting_remove_actor">履歴から消す</li>
</ul>
</div>
<div id="parts_contextmenu" class="contextmenu">
<ul>
<li id="actor_setting_remove_parts_button">削除</li>
</ul>
</div>
<div id="group_contextmenu" class="contextmenu">
<ul>
<li id="actor_setting_add_group_button">グループの追加</li>
<li id="actor_setting_remove_group_button">グループの削除</li>
<li id="actor_setting_add_animation_clip_on_group">アニメーションの設定</li>
</ul>
</div>
<div id="bake_contextmenu" class="contextmenu">
<ul>
<li id="actor_bake_animation">アニメーションのベイク</li>
</ul>
</div>
</li>
<li>
<div class="uk-flex-center uk-child-width-expand@ss uk-margin-left uk-margin-right ">
<span class="uk-label tdactor_label_secondary uk-margin-remove-bottom uppercase_disable">wav, mp3, wmvファイルが作成された際に指定のビンにインポートし、指定のトラックに並べます。</span>
<span class="uk-label tdactor_label_secondary">設定は監視を開始したとき、またはルールを削除したときに保存されます。</span>
</div>
<div class="uk-flex-center uk-child-width-expand@ss uk-margin-left uk-margin-right" id="auto_import_root">
</div>
<div class="uk-flex-center uk-child-width-expand@ss uk-margin-left uk-margin-right">
<button class="uk-button uk-button-secondary uk-width-expand add_watch_dir uk-margin-bottom" onClick="addAutoImportWatchDir()">監視フォルダの追加</button>
</div>
</li>
<li>
<div class="uk-flex-center uk-child-width-expand@ss uk-margin-left uk-margin-right uk-margin-bottom">
<details open>
<summary class="td_summary">共通</summary>
<div class="uk-flex-center uk-child-width-expand@ss uk-margin-left uk-margin-right ">
<span class="uk-label tdactor_label uk-width-auto">テキストファイルの文字コード</span>
<select type="selectbox" class="tdactor_selectbox uk-width-expand uk-select save_setting_value_on_change" category="general" id="select_encoding">
<option value="SJIS">Shift-JIS</option>
<option value="UTF8">UTF-8</option>
<option value="UTF16">UTF-16</option>
<option value="UTF16BE">UTF-16BE</option>
<option value="UTF16LE">UTF-16LE</option>
<option value="EUCJP">EUCJP</option>
<option value="AUTO">AUTO</option>
</select>
<span class="uk-label tdactor_label uk-width-auto">エラーメッセージ</span><br>
<span class="uk-label tdactor_label_secondary uk-width-auto">エラーメッセージが頻繁に表示されて作業に支障が出る場合はチェックを入れてください。</span><br>
<div class="uk-grid-small uk-flex-center" uk-grid style="align-items: center;">
<label><input id="avoid_catch_exception" category="setting_error" class="uk-flex-center uk-checkbox td_check save_setting_check_on_change" type="checkbox"> エラーをcatchしない</label>
</div>
</div>
</details>
<details open>
<summary class="td_summary">立ち絵</summary>
<div class="uk-child-width-expand@ss uk-margin-left uk-margin-right">
<span class="uk-label tdactor_label uk-margin-remove-bottom uk-width-auto">方向キーの追加割り当て</span><br>
<span class="uk-label tdactor_label_secondary uk-width-auto">設定されたキーは立ち絵変更ショートカットキーとして使用できなくなります。割り当てない場合は空白にしてください。</span>
<div class="uk-grid-small uk-flex-center" uk-grid style="align-items: center;">
<div class="uk-width-small uk-text-center">↑</div>
<input class="uk-width-small uk-text-center uk-input uk-light tdinput input_keycode save_setting_value_on_change" type="text" category="setting_actor" id="shortcut_up_arrow" value="" readonly>
</div>
<div class="uk-grid-small uk-flex-center" uk-grid style="align-items: center;">
<div class="uk-width-small uk-text-center">↓</div>
<input class="uk-width-small uk-text-center uk-input uk-light tdinput input_keycode save_setting_value_on_change" type="text" category="setting_actor" id="shortcut_down_arrow" value="" readonly>
</div>
<div class="uk-grid-small uk-flex-center" uk-grid style="align-items: center;">
<div class="uk-width-small uk-text-center">←</div>
<input class="uk-width-small uk-text-center uk-input uk-light tdinput input_keycode save_setting_value_on_change" type="text" category="setting_actor" id="shortcut_left_arrow" value="" readonly>
</div>
<div class="uk-grid-small uk-flex-center" uk-grid style="align-items: center;">
<div class="uk-width-small uk-text-center">→</div>
<input class="uk-width-small uk-text-center uk-input uk-light tdinput input_keycode save_setting_value_on_change" type="text" category="setting_actor" id="shortcut_right_arrow" value="" readonly>
</div>
<span class="uk-label tdactor_label uk-margin-remove-bottom uk-width-auto">リップシンクのオーディオ解析フレームレート</span><br>
<span class="uk-label tdactor_label_secondary uk-width-auto">大きいほどパクパクします。シーケンスのフレームレートより大きいと上手くベイクできないかもしれません。</span>
<div class="uk-grid-small uk-flex-center" uk-grid style="align-items: center;">
<select type="selectbox" class="tdactor_selectbox uk-width-auto uk-select save_setting_value_on_change" category="setting_actor" id="lipsync_framerate">
<option value="15">15fps</option>
<option value="30">30fps</option>
<option value="60">60fps</option>
</select>
</div>
</div>
</details>
</div>
</li>
</ul>
</div>
</body>
<script>
window.addEventListener('error', function(e){
if(!invalid_try_catch){
let msg = e.error.stack.toString();
let info = $('<div>', {class:'error_info_text'});
info.append('不明なエラーが発生しました。<br>問題解決のために、この表示を開発者にお知らせください。<br>その際、個人情報や知られたくない内容が含まれないようご注意ください。');
ErrorNotificationOpen(msg, info);
}
});
function toArrayBuffer(buf) {
return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
}
if (!OSIsWin)
{
keyEventsInterest = JSON.stringify([
{"keyCode": 0}, // "a"
{"keyCode": 0, "ctrlKey" : true},
{"keyCode": 1}, // "s"
{"keyCode": 1, "ctrlKey" : true},
{"keyCode": 2}, // "d"
{"keyCode": 2, "ctrlKey" : true},
{"keyCode": 3}, // "f"
{"keyCode": 3, "ctrlKey" : true},
{"keyCode": 4}, // "h"
{"keyCode": 4, "ctrlKey" : true},
{"keyCode": 5}, // "g"
{"keyCode": 5, "ctrlKey" : true},
{"keyCode": 6}, // "z"
{"keyCode": 6, "ctrlKey" : true},
{"keyCode": 7}, // "x"
{"keyCode": 7, "ctrlKey" : true},
{"keyCode": 8}, // "c"
{"keyCode": 8, "ctrlKey" : true},
{"keyCode": 9}, // "v"
{"keyCode": 9, "ctrlKey" : true},
{"keyCode": 11}, // "b"
{"keyCode": 11, "ctrlKey" : true},
{"keyCode": 12}, // "q"
{"keyCode": 12, "ctrlKey" : true},
{"keyCode": 13}, // "w"
{"keyCode": 13, "ctrlKey" : true},
{"keyCode": 14}, // "e"
{"keyCode": 14, "ctrlKey" : true},
{"keyCode": 15}, // "r"
{"keyCode": 15, "ctrlKey" : true},
{"keyCode": 16}, // "y"
{"keyCode": 16, "ctrlKey" : true},
{"keyCode": 17}, // "t"
{"keyCode": 17, "ctrlKey" : true},
{"keyCode": 18}, // "1"
{"keyCode": 18, "ctrlKey" : true},
{"keyCode": 19}, // "2"
{"keyCode": 19, "ctrlKey" : true},
{"keyCode": 20}, // "3"
{"keyCode": 20, "ctrlKey" : true},
{"keyCode": 21}, // "4"
{"keyCode": 21, "ctrlKey" : true},
{"keyCode": 22}, // "6"
{"keyCode": 22, "ctrlKey" : true},
{"keyCode": 23}, // "5"
{"keyCode": 23, "ctrlKey" : true},
{"keyCode": 24}, // "="
{"keyCode": 24, "ctrlKey" : true},
{"keyCode": 25}, // "9"
{"keyCode": 25, "ctrlKey" : true},
{"keyCode": 26}, // "7"
{"keyCode": 26, "ctrlKey" : true},
{"keyCode": 27}, // "-"
{"keyCode": 28}, // "8"
{"keyCode": 28, "ctrlKey" : true},
{"keyCode": 29}, // "0"
{"keyCode": 29, "ctrlKey" : true},
{"keyCode": 30}, // "]"
{"keyCode": 31}, // "o"
{"keyCode": 31, "ctrlKey" : true},
{"keyCode": 32}, // "u"
{"keyCode": 32, "ctrlKey" : true},
{"keyCode": 33}, // "["
{"keyCode": 34}, // "i"
{"keyCode": 34, "ctrlKey" : true},
{"keyCode": 35}, // "p"
{"keyCode": 35, "ctrlKey" : true},
{"keyCode": 36}, // "RETURN"
{"keyCode": 37}, // "l"
{"keyCode": 37, "ctrlKey" : true},
{"keyCode": 38}, // "j"
{"keyCode": 38, "ctrlKey" : true},
{"keyCode": 39}, // "'"
{"keyCode": 40}, // "k"
{"keyCode": 40, "ctrlKey" : true},
{"keyCode": 41}, // "},"
{"keyCode": 42}, // "\"
{"keyCode": 43}, // ","
{"keyCode": 44}, // "/"
{"keyCode": 45}, // "n"
{"keyCode": 45, "ctrlKey" : true},
{"keyCode": 46}, // "m"
{"keyCode": 46, "ctrlKey" : true},
{"keyCode": 47}, // "."
{"keyCode": 48}, // "TAB"
{"keyCode": 49}, // "SPACE"
{"keyCode": 50}, // "`"
{"keyCode": 51}, // "DELETE"
{"keyCode": 52}, // "ENTER"
{"keyCode": 53}, // "ESCAPE"
{"keyCode": 65}, // "."
{"keyCode": 67}, // "*"
{"keyCode": 69}, // "+"
{"keyCode": 71}, // "CLEAR"
{"keyCode": 75}, // "/"
{"keyCode": 76}, // "ENTER" numberpad on full kbd
{"keyCode": 78}, // "="
{"keyCode": 81}, // "="
{"keyCode": 82}, // "0"
{"keyCode": 82, "ctrlKey" : true},
{"keyCode": 83}, // "1"
{"keyCode": 83, "ctrlKey" : true},
{"keyCode": 84}, // "2"
{"keyCode": 84, "ctrlKey" : true},
{"keyCode": 85}, // "3"
{"keyCode": 85, "ctrlKey" : true},
{"keyCode": 86}, // "4"
{"keyCode": 86, "ctrlKey" : true},
{"keyCode": 87}, // "5"
{"keyCode": 87, "ctrlKey" : true},
{"keyCode": 88}, // "6"
{"keyCode": 88, "ctrlKey" : true},
{"keyCode": 89}, // "7"
{"keyCode": 89, "ctrlKey" : true},
{"keyCode": 91}, // "8"
{"keyCode": 91, "ctrlKey" : true},
{"keyCode": 92}, // "9"
{"keyCode": 92, "ctrlKey" : true},
{"keyCode": 115}, // "HOME"
{"keyCode": 116}, // "PGUP"
{"keyCode": 117}, // "DELETE"
{"keyCode": 119}, // "END"
{"keyCode": 121}, // "PGDN"
{"keyCode": 123}, // "LEFT"
{"keyCode": 124}, // "RIGHT"
{"keyCode": 125}, // "DOWN"
{"keyCode": 126}, // "UP"
]);
csInterface.registerKeyEventsInterest(keyEventsInterest);
}
const KEYCODE_Delete = 'Delete';
const KEYCODE_ArrowLeft = 'ArrowLeft';
const KEYCODE_ArrowUp = 'ArrowUp';
const KEYCODE_ArrowRight = 'ArrowRight';
const KEYCODE_ArrowDown = 'ArrowDown';
const altUpKeyElm = $('#shortcut_up_arrow');
const altDownKeyElm = $('#shortcut_down_arrow');
const altLeftKeyElm = $('#shortcut_left_arrow');
const altRightKeyElm = $('#shortcut_right_arrow');
document.body.addEventListener('keydown', function(e) {
const keycodeInputElm = $('input.input_keycode:focus');
if(keycodeInputElm.length > 0){
if(e.code === 'Escape'){
keycodeInputElm.blur();
} else if(e.code === 'Backspace' || e.code === 'Delete') {
keycodeInputElm.val('');
} else {
keycodeInputElm.val(e.code);
}
keycodeInputElm.change();
return;
}
if($('input:focus').length > 0) return;
if(!$('#actor_switcher').hasClass('setting')) {
if($('#function_actor').hasClass('uk-active')) {
if (e.code === KEYCODE_ArrowUp || (altUpKeyElm.val() !== '' && e.code === altUpKeyElm.val())) {
csInterface.evalScript(makeEvalScript('PrevEditPoint'));
e.preventDefault();
} else if (e.code === KEYCODE_ArrowDown || (altDownKeyElm.val() !== '' && e.code === altDownKeyElm.val())) {
csInterface.evalScript(makeEvalScript('NextEditPoint'));
e.preventDefault();
} else if (e.code === KEYCODE_ArrowLeft || (altLeftKeyElm.val() !== '' && e.code === altLeftKeyElm.val())) {
const linkdActor = $('.actor_sequence_link.linked');
for(let i = linkdActor.length - 1; i >= 0; i--) {
if(linkdActor.eq(i).hasClass('enable')) {
if(i - 1 >= 0) {
linkdActor.eq(i - 1).click();
}
break;
}
}
e.preventDefault();
} else if (e.code === KEYCODE_ArrowRight || (altRightKeyElm.val() !== '' && e.code === altRightKeyElm.val())) {
const linkdActor = $('.actor_sequence_link.linked');
for(let i = 0; i < linkdActor.length; i++) {
if(linkdActor.eq(i).hasClass('enable')) {
if(i + 1 < linkdActor.length) {
linkdActor.eq(i + 1).click();
}
break;
}
}
e.preventDefault();
} else if((e.key >= '0' && e.key <= '9') || (e.key >= 'a' && e.key <= 'z')){
if(e.ctrlKey) {
getActorClipSet(e.key);
} else {
setActorClipSet(e.key);
}
e.preventDefault();
}
}
} else {
if (e.code === KEYCODE_Delete) {
DeleteSelectedParts();
}
}
}, {passive: false});
function loadSetup() {
var extPath = csInterface.getSystemPath(SystemPath.EXTENSION);
sleep(100);
csInterface.evalScript(makeEvalScript('Setup', extPath));
csInterface.addEventListener('numTracksNotification', function(e) {
trackNum = e.data.split(',');
const audioTrackNum = Number(trackNum[1]);
let length = audioTrackSelectBox.length;
for(let i = 0; i < length; i++) {
const selectbox = audioTrackSelectBox[i];
if(selectbox.val() <= audioTrackNum) {
setSettingOK(selectbox);
selectbox.removeAttr('uk-tooltip');
selectbox.removeAttr('max_track_num');
while(selectbox.children().length - 1 > audioTrackNum) {
selectbox.children().last().remove();
}
let value = selectbox.children().length;
while(selectbox.children().length <= audioTrackNum) {
const op = $('<option>', {'value':value});
op.html(value);
selectbox.append(op);
value += 1;
}
} else {
setSettingError(selectbox);
selectbox.attr('uk-tooltip', trackNum[1] + ' 以下を選択してください');
selectbox.attr('max_track_num', trackNum[1]);
}
selectbox.change();
}
const videoTrackNum = Number(trackNum[0]);
length = videoTrackSelectBox.length;
for(let i = 0; i < length; i++) {
const selectbox = videoTrackSelectBox[i];
if(selectbox.val() <= videoTrackNum) {
setSettingOK(selectbox);
selectbox.removeAttr('uk-tooltip');
selectbox.removeAttr('max_track_num');
while(selectbox.children().length - 1 > videoTrackNum) {
selectbox.children().last().remove();
}
let value = selectbox.children().length;
while(selectbox.children().length <= videoTrackNum) {
const op = $('<option>', {'value':value});
op.html(value);
selectbox.append(op);
value += 1;
}
} else {
setSettingError(selectbox);
selectbox.attr('uk-tooltip', trackNum[0] + ' 以下を選択してください');
selectbox.attr('max_track_num', trackNum[0]);
}
selectbox.change();
}
});
csInterface.addEventListener('projectItemsSelect', function(e) {
SetectedProjectItemTreePath = e.data;
});
csInterface.addEventListener('sequenceItemsSelectChanged', function(e) {
csInterface.evalScript(makeEvalScript('GetSelectedSequenceTrackNum'), function(result) {
if(result) {
trackNum = result.split(',');
const videoTrackNum = Number(trackNum[0]);
const trackNumSelectbox = $('#trigger_clip_override_target_track');
trackNumSelectbox.attr('select_seq_track', videoTrackNum);
if(Number($('#trigger_clip_override_target_seq').val()) === 0) {
if(Number(trackNumSelectbox.val()) <= videoTrackNum) {
setSettingOK(trackNumSelectbox);
trackNumSelectbox.removeAttr('uk-tooltip');
trackNumSelectbox.removeAttr('max_track_num');
while(trackNumSelectbox.children().length - 1 > videoTrackNum) {
trackNumSelectbox.children().last().remove();
}
let value = trackNumSelectbox.children().length;
while(trackNumSelectbox.children().length <= videoTrackNum) {
const op = $('<option>', {'value':value});
op.html(value);
trackNumSelectbox.append(op);
value += 1;
}
} else {
setSettingError(trackNumSelectbox);
trackNumSelectbox.attr('uk-tooltip', videoTrackNum + ' 以下を選択してください');
trackNumSelectbox.attr('max_track_num', videoTrackNum);
}
}
trackNumSelectbox.change();
}
});
});
csInterface.addEventListener('getAudioAnimKeyPoint', function(e) {
const [path, id] = e.data.split(',');
const epsTime = 1 / Number($('#lipsync_framerate').val());
const threshold = 0.1;
const audioContext = new AudioContext();
const data = fs.readFileSync(path);
audioContext.decodeAudioData(toArrayBuffer(data), function(audio_context) {
let array = audio_context.getChannelData(0);
let block_size = Math.round(audio_context.sampleRate * epsTime);
let s_array = new Float32Array(Math.ceil(audio_context.length / block_size));
let sum = 0;
let idx = 0;
for(let i = 0; i < array.length;) {
sum = 0;
for(let j = i; j < i + block_size; j++) {
sum += Math.abs(array[j]);
}
s_array[idx] = sum;
idx++;
i += block_size;
}
let max = -100000;
for(let i = 0; i < s_array.length; i++) {
if(max < s_array[i]) max = s_array[i];
}
const keys = [];
const startTime = [];
let prev_key = 0;
let prev_value = 0;
for(let i = 0; i < s_array.length; i++) {
if(i < s_array.length - 1) {
const value = s_array[i] / max;
if(value - threshold < 0 && prev_key === 1){
keys.push(0);
startTime.push(i * epsTime);
prev_key = 0;
prev_value = value;
} else if(value - prev_value > 0 && prev_key === 0){
keys.push(1);
startTime.push(i * epsTime);
prev_key = 1;
prev_value = value;
}
} else {
if(prev_key === 1){
keys.push(0);
startTime.push(i * epsTime);
}
}
}
csInterface.evalScript(makeEvalScript('SetFrameAnimationKeypoints_Audio', id.toString(), keys.join(','), startTime.join(',')), function(result) {});
});
});
$('.insert_inpoint').each(function(index, e){
$(e).append(SVG_INPOINT_CLIP_ICON);
});
$('.insert_outpoint').each(function(index, e){
$(e).append(SVG_OUTPOINT_CLIP_ICON);
});
$('.insert_marker').each(function(index, e){
$(e).append(SVG_MARKER_ICON);
});
ActorEditInitialize();
$('#extension_version').html('v' + getExtensionVersion());
LoadSettings();
}
</script>
<script src="./js/image_viewer.js"></script>
</html>