Skip to content

Commit fc2f213

Browse files
committed
Clear logging
1 parent e11e44a commit fc2f213

File tree

3 files changed

+0
-55
lines changed

3 files changed

+0
-55
lines changed

my-app/src/App.js

-41
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,14 @@ function App() {
6363

6464
useEffect(() => {
6565
if (isRendering){
66-
console.log(isRendering);
6766
collectingRenderData();
6867
}
6968
}, [videoCurrentTime, isRendering]);
7069

7170
useEffect(() => {
7271
const newTimeline = [];
7372

74-
// console.log("INSIDE USE EFFECTS")
75-
// console.log(textElements)
76-
7773
if (animations){
78-
79-
// console.log(animations)
80-
81-
8274
animations.forEach((animeObj) => {
8375

8476
// Wrapper to get React variables, which is out of Anime.js scope
@@ -104,7 +96,6 @@ function App() {
10496
const newTextElements = [...textElements];
10597
newTextElements.push(newTextElement);
10698
setTextElements(newTextElements);
107-
// console.log(newTextElements)
10899
};
109100

110101
// Hidden flag for TextInspector
@@ -114,7 +105,6 @@ function App() {
114105

115106
const onHandleTextElementsChange = (newValue) => {
116107
setTextElements(newValue);
117-
// console.log(textElements)
118108
};
119109

120110
// Getting pointer to text object
@@ -132,11 +122,8 @@ function App() {
132122
const handleTextPosChange = (event, data, id) => {
133123
const index = textElements.findIndex((element) => element.id === id);
134124
const newTextElements = [...textElements];
135-
// console.log(data);
136125
newTextElements[index].posX = data.x;
137126
newTextElements[index].posY = data.y;
138-
// console.log(newTextElements[index].posX);
139-
// console.log(data);
140127

141128
setTextElements(newTextElements);
142129
};
@@ -158,7 +145,6 @@ function App() {
158145
const newTime = (timelineRange.current.value / 100) * videoDuration.current;
159146
setVideoCurrentTime(newTime);
160147
video.current.currentTime = newTime;
161-
// console.log(convertTime(videoCurrentTime));
162148
animationTimeline.forEach(animation => {
163149
animation.seek(newTime * MILLISECONDS_PER_SECOND);
164150
});
@@ -194,7 +180,6 @@ function App() {
194180
const textElement = textElements[textElementIndex];
195181
const id = textElement.id;
196182
const keyframes = textElement.keyframes;
197-
// console.log(keyframes);
198183
const newAnimations = [...animations];
199184
let animationIndex = newAnimations.findIndex((animation) => animation.animeElementId === id);
200185
if (animationIndex !== -1){
@@ -259,9 +244,6 @@ function App() {
259244

260245
const changeTextObjectProperties = (textElementId, properties, latestTextElements) => {
261246

262-
// console.log("INSIDE CHANGE FUNC:");
263-
// console.log(latestTextElements);
264-
265247
const index = textElements.findIndex((element) => element.id === textElementId);
266248
const newTextElements = [...latestTextElements];
267249

@@ -291,11 +273,7 @@ function App() {
291273
newTextElements[index].strokeColor = strokeColor;
292274
newTextElements[index].strokeThickness = strokeThickness;
293275

294-
// console.log(textColor);
295-
296276
setTextElements(newTextElements);
297-
// console.log("UPDATED TEXT ELEMENTS:");
298-
// console.log(newTextElements);
299277
};
300278

301279
const onHandleFileChange = (event) => {
@@ -308,8 +286,6 @@ function App() {
308286

309287
const convertTime = (timeInSeconds) => {
310288

311-
// console.log(timeInSeconds)
312-
313289
const milliseconds = (timeInSeconds % 1).toFixed(3) * 1000;
314290
const seconds = Math.floor(timeInSeconds % 60);
315291
const minutes = Math.floor(timeInSeconds / 60);
@@ -326,28 +302,16 @@ function App() {
326302
};
327303

328304
const collectingRenderData = () => {
329-
// console.log("INSIDE collecting render data");
330305
setIsLoading(true);
331306

332-
// console.log(video.current.videoWidth);
333-
// console.log(video.current.videoHeight);
334-
335307
const timeStep = 1 / VIDEO_FPS;
336308

337-
// console.log(textElements);
338-
//
339-
// console.log("VIDEO CURRENT TIME");
340-
// console.log(videoCurrentTime);
341-
342309
const nextRenderTime = Number((videoCurrentTime + timeStep).toFixed(3)) >= Number(videoDuration.current.toFixed(3)) ? videoDuration.current : Number((videoCurrentTime + timeStep).toFixed(3)); //Operations for correct float calculation
343310

344311
// Using for instead of forEach, because of eslint warning
345312
for (let i = 0; i < textElements.length; i++){
346313
const textElement = textElements[i];
347314

348-
// console.log(textElement.posX);
349-
// console.log(textElement.posY);
350-
351315
framesData.current.push({
352316
id: textElement.id,
353317
startTime: convertTime(videoCurrentTime),
@@ -370,8 +334,6 @@ function App() {
370334

371335
if (Number(videoCurrentTime) === Number(videoDuration.current)){
372336
setIsRender(false);
373-
console.log("START GENERATE app.js");
374-
console.log(framesData.current);
375337
if (framesData.current){
376338
const downloadBlob = ASSGenerator(video.current, framesData.current);
377339
tempDownloadLink.current.href = URL.createObjectURL(downloadBlob);
@@ -387,8 +349,6 @@ function App() {
387349
const onHandleDownload = () => {
388350
tempDownloadLink.current.click();
389351
setIsLoading(false);
390-
console.log(isLoading);
391-
console.log(isRendering);
392352
};
393353

394354

@@ -443,7 +403,6 @@ function App() {
443403
onHandleTimeUpdate = {onHandleTimeUpdate}
444404
onLoadedMetadata={() => {
445405
videoDuration.current = video.current.duration
446-
console.log(video.current.duration)
447406
}}
448407
videoSource={videoSource}
449408
/>

my-app/src/Components/TextInspector.jsx

-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const TextInspector = ({TextObject, isHidden, onHandleIsHiddenChange, textElemen
1313
const deleteTextElement = (id) => {
1414
const newTextElements = textElements.filter(element => element.id !== id);
1515
onHandleTextElementsChange(newTextElements);
16-
console.log(textElements);
1716
};
1817

1918
const changeTextElementContent = (e, id) => {
@@ -149,10 +148,6 @@ const TextInspector = ({TextObject, isHidden, onHandleIsHiddenChange, textElemen
149148

150149
newTextElements[index].keyframes.sort((a, b) => a.timeKF - b.timeKF);
151150

152-
// console.log("Keyframe added")
153-
// console.log(newTextElements[index].keyframes)
154-
// console.log(newTextElements)
155-
156151
onHandleTextElementsChange(newTextElements);
157152
updateAnimationObjectKeyframes(index);
158153
};

my-app/src/Modules/ASSGenerator.js

-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
'use strict'
22

33
const generateASS = (video, framesData) => {
4-
5-
console.log("START GENERATE");
6-
console.log(framesData);
7-
8-
console.log(video.offsetWidth);
9-
console.log(video.offsetHeight);
10-
114
const videoOffsetX = video.offsetWidth / 2;
125
const videoOffsetY = video.offsetHeight / 2;
136
const proportionX = video.videoWidth / video.offsetWidth;
@@ -25,10 +18,8 @@ const generateASS = (video, framesData) => {
2518
Style: ASS Animation,Arial,20,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,1,0,0,0,100,100,0,0,1,2,0,2,10,10,10,1\n\n
2619
[Events]\n
2720
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text`;
28-
console.log("FINISH GENERATE INFO");
2921

3022
const dialogues = framesData.map(data => {
31-
console.log("CREATING DIALOGUE");
3223
if (data.opacity !== 255){
3324
return `Dialogue: 0,${data.startTime},${data.endTime},ASS Animation,Animation ID${data.id},0,0,0,,{\\pos(${(data.posX + videoOffsetX) * proportionX},${(data.posY + videoOffsetY + data.fontSize/2) * proportionY})\\fs${data.fontSize * proportionY}\\fscx${data.scaleX * 100}\\fscy${data.scaleY * 100}\\frz${data.rotateZ}\\frx${data.rotateX}\\fry${data.rotateY}\\c&H${data.textColor}\\3c&H${data.strokeColor}&\\bord${data.strokeThickness}\\1a&H${data.opacity}&\\2a&H${data.opacity}&\\3a&H${data.opacity}&\\4a&H${data.opacity}&}${data.content}`;
3425
}

0 commit comments

Comments
 (0)