After Effects JSON importer creates wrong timing of some layers Topic is solved

Please use this part to report bugs & errors, ask questions & "How to..."
Post Reply
User avatar
maara_p
Posts: 16
Joined: 13 Feb 2018, 15:53
Contact:

After Effects JSON importer creates wrong timing of some layers

Post by maara_p »

Hello!

I've been having this problem for a while now. Tried to solve it by updating TVPaint, but the behaviour is still the same. This is my process:

1.
I Export structure of my project using JSON from TVPaint (v 11.5.3 - 64 bits):

This is the original visual:
Image

This is my export settings:
Image

2.
I use the importer script distributed with the TVPaint v 11.5 to import my project into After Effects (v 22.1.1 - build 74):

This is my import settings:
Image

3.
And this is an example of the wrong timing of some instances that appear in the imported layers:
Image
(certain Tusks color instance appears 1-2 frames earlier than it should - see original TVP visual of this frame in (1) for comparison).

So my intuition is that somewhere in the script there is some rounding of time values happening that works most of the time but occasionally rounds to a wrong value for the time remap in AE? Just a wild guess.

Did anyone experience this with this script?
Any help will be greatly appreciated as this script was otherwise saving us eternity for compositing.

(Note: In some instances I was able to get correct timing by switching the "Sequence Import Mode" to "Native", but that doesn't work in my latest case either)
User avatar
Dean
Site Admin
Posts: 964
Joined: 28 May 2018, 09:07

Re: After Effects JSON importer creates wrong timing of some layers

Post by Dean »

Hello, maybe the "ignore duplicate images" is in cause? As it creates less images for your export in the end, which might explain was certain elements arrive too early in the AE timeline.
Probably a vampire
User avatar
maara_p
Posts: 16
Joined: 13 Feb 2018, 15:53
Contact:

Re: After Effects JSON importer creates wrong timing of some layers

Post by maara_p »

You're right! Thank you very much!!

This just saved months to our project.
User avatar
D.T. Nethery
Posts: 4125
Joined: 27 Sep 2006, 19:19

Re: After Effects JSON importer creates wrong timing of some layers

Post by D.T. Nethery »

Dean wrote: 20 Sep 2022, 07:49 Hello, maybe the "ignore duplicate images" is in cause? As it creates less images for your export in the end, which might explain was certain elements arrive too early in the AE timeline.
maara_p wrote: 20 Sep 2022, 09:49 You're right! Thank you very much!!

This just saved months to our project.

This is good information to know about the AE Export/Import script . I suggest this information about how "ignore duplicate images" can affect the timing of the images imported into AE be included in the TVPaint User Guide in the section about the Export Import script.

Animator, TVPaint Beta-Tester, Animation Educator and Consultant.
MacOS 12.7.1 Monterey , Mac Mini (2018) , 3.2 GHz 6-Core Intel Core i7,
16 GB RAM , TVPaint PRO 11.7.1 - 64bit , Wacom Cintiq 21UX 2nd Gen.
,Wacom Intuos Pro 5 , Wacom driver version 6.3.39-1
User avatar
Hironori Takagi
Posts: 279
Joined: 14 May 2018, 10:15
Location: Tokyo, Japan
Contact:

Re: After Effects JSON importer creates wrong timing of some layers

Post by Hironori Takagi »

Previously, I pointed out the following to the development members.
・The number of keyframes increases by one when exporting in Raw value mode
It has not been resolved.
20190611-2.png
I think the reason for your question is that you are using an export method that assumes a Native Sequence instead of an Index, as you have answered in the past.
TVPaint 11.7.2(Nov 14 2023), Windows11 Pro, HP Spectre x360 Convertible 14-ea0xxx / TVPaint 11.7.1(Dec 22 2022) Mac OS 11.6, Apple MacBookPro M1 2020
User avatar
D.T. Nethery
Posts: 4125
Joined: 27 Sep 2006, 19:19

Re: After Effects JSON importer creates wrong timing of some layers

Post by D.T. Nethery »

Now I noticed another problem with the option Ignore Duplicate Images. It makes sense to me to avoid exporting duplicate images, to cut down on the file size , but it seems to cause trouble.

Today I exported a scene where I had checked Ignore Duplicate Images. When I imported it into After Effects only about half of my layers were exported to AE (I double-checked to see that all the layers are in the folder with the JSON file ... all layers are there in the folder, but for some reason many of the layers don't get imported to AE).

What is the purpose of the option Ignore Duplicate Images if checking that option won't allow the scene to be imported correctly into AE,with the proper timing or with all the layers included ?

In the user guide about Ignore Duplicate Images it only says: " select this option when you don’t want duplicated images to be exported." But there should be some sort of warning that choosing this option may cause the scene to not be imported properly into AE.

Screen Shot 2022-12-12 at 5.40.31 PM.png
Screen Shot 2022-12-12 at 5.40.31 PM.png (12.57 KiB) Viewed 3891 times

Here are my settings for export to JSON:

Screen Shot 2022-12-12 at 5.24.40 PM.png
------

UPDATE: I believe this is definitely a bug in 11.7 (haven't tried 11.7.1 yet). I went back to version 11.5.3 to export to JSON, then used the script to import to After Effects . It worked as expected. Because this is an older topic that already has the green check-mark ("solved") applied, I am going to start a new topic about this issue in TVPaint 11.7.

Animator, TVPaint Beta-Tester, Animation Educator and Consultant.
MacOS 12.7.1 Monterey , Mac Mini (2018) , 3.2 GHz 6-Core Intel Core i7,
16 GB RAM , TVPaint PRO 11.7.1 - 64bit , Wacom Cintiq 21UX 2nd Gen.
,Wacom Intuos Pro 5 , Wacom driver version 6.3.39-1
User avatar
D.T. Nethery
Posts: 4125
Joined: 27 Sep 2006, 19:19

Re: After Effects JSON importer creates wrong timing of some layers

Post by D.T. Nethery »

Lately I've been using the JSON export quite a bit . Something else I found out (or was reminded of) about the JSON export/import script is it doesn't like to have % as part of the Layer Name. For example, if you have a Shadow layer that is set at 40% opacity to make it transparent , don't name the layer "Shadow 40%" . The AE Import Script won't import it to AE if it has % as part of the layer name (and it won't import any of the layers above or below the layer that has % as part of the layer name). If you like to have a reminder about the intended opacity percentage, as I do , then name the layer something like "Shadow 40" or "Shadow 40 percent" or "Shadow 40 opacity" as a reminder that the layer is to be exposed at 40% opacity. Don't include the % symbol in the layer name.

I would like to request that this be confirmed by TVPaint Support. If using the % symbol as part of a layer name prevents the entire project from being imported properly into AE then that should be included in the User Guide in the section about JSON.

Animator, TVPaint Beta-Tester, Animation Educator and Consultant.
MacOS 12.7.1 Monterey , Mac Mini (2018) , 3.2 GHz 6-Core Intel Core i7,
16 GB RAM , TVPaint PRO 11.7.1 - 64bit , Wacom Cintiq 21UX 2nd Gen.
,Wacom Intuos Pro 5 , Wacom driver version 6.3.39-1
User avatar
Dean
Site Admin
Posts: 964
Joined: 28 May 2018, 09:07

Re: After Effects JSON importer creates wrong timing of some layers

Post by Dean »

Hello David, just made a test and the layer containing "%" was not imported, but the rest of the project was.
As you know, we excluded some symbols from appearing in the layer names in TVPaint recently, since they caused issues depending on several factors: where the project's content was imported afterwards, the computer's language etc...
IIRC, the percentage symbol wasn't causing this kind of issue before, also it is quite common to use this symbol in TVPaint layer names, though, so maybe the problem appeared recently or I might just have never encountered it.
I am on Windows, though. I will conduct some additional tests with Matthieu when he comes back from his holiday.
Probably a vampire
User avatar
D.T. Nethery
Posts: 4125
Joined: 27 Sep 2006, 19:19

Re: After Effects JSON importer creates wrong timing of some layers

Post by D.T. Nethery »

Dean wrote: 22 Dec 2022, 13:45 Hello David, just made a test and the layer containing "%" was not imported, but the rest of the project was.

As you know, we excluded some symbols from appearing in the layer names in TVPaint recently, since they caused issues depending on several factors: where the project's content was imported afterwards, the computer's language etc...

IIRC, the percentage symbol wasn't causing this kind of issue before, also it is quite common to use this symbol in TVPaint layer names, though, so maybe the problem appeared recently or I might just have never encountered it.

I am on Windows, though. I will conduct some additional tests with Matthieu when he comes back from his holiday.

Thanks for confirming. It definitely happens on Mac. If % symbol is used as part of a layer name it will not be imported into After Effects. (in my experience it will also prevent importing any layers above the layer that has a % symbol as part of the layer name. So for now the workaround is to avoid using % as part of a layer name.

Animator, TVPaint Beta-Tester, Animation Educator and Consultant.
MacOS 12.7.1 Monterey , Mac Mini (2018) , 3.2 GHz 6-Core Intel Core i7,
16 GB RAM , TVPaint PRO 11.7.1 - 64bit , Wacom Cintiq 21UX 2nd Gen.
,Wacom Intuos Pro 5 , Wacom driver version 6.3.39-1
Svengali
Posts: 1552
Joined: 28 Dec 2006, 10:08

Re: After Effects JSON importer creates wrong timing of some layers

Post by Svengali »

David's suggestion to simply avoid the percent sign in TVPaint naming makes sense.

A search on google topic "what does a percentage sign mean in a JSON file" might shed some light on the problem. One google reply says that the percent sign is used as an operator in JavaScript, supposedly what JSON is written with.

Personally, I know nothing about JSON or JavaScript, but I have run across special usage of the percent sign in other programming.

sven
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
D.T. Nethery
Posts: 4125
Joined: 27 Sep 2006, 19:19

Re: After Effects JSON importer creates wrong timing of some layers

Post by D.T. Nethery »

Unrelated to the issue of using % symbol in layer names, but related to exporting to JSON file in general: something else I have learned is that the length of layer names has an effect on how long it takes to export a scene to JSON file with all the PNG sequences separated in individual folders. The shorter the layer name, the faster the export. Longer layer names increase the time it takes to export. This should have been something I understood intuitively because it is logical that the more data the computer has to process and write to the file, the longer it takes. But I didn't notice it until recently because on some of the scenes I've been working with recently I included some "descriptive" info as part of a layer name, such as: 'Paul's Shadow on TOP of car roof 24' (the 24 referring to the layer opacity of 24% , so the shadow is transparent on top of the car roof) Because by default JSON layer structure assigns the name of the layer to each PNG image exported, a lengthy descriptive layer name like 'Paul's Shadow on TOP of car roof 24' increases the time it takes to export each image. Better if I had named the layer 'Paul Shad Top 24' or 'PShad Top 24' or 'PShad24'.

Screen Shot 2022-12-22 at 10.43.29 AM.png
Screen Shot 2022-12-22 at 10.43.29 AM.png (70.1 KiB) Viewed 3763 times

The fastest way is to name layers simply with an A, B, C, D, E, F, G ... system , so a layer may simply be named 'A' , or a 1, 2, 3, 4, 5, 6, 7 ... system so a layer name is just '1' or at most '1-A' .

I believe that the JSON naming structure can also be adjusted to not include the full layer name , but in my laziness I have left it set to the default naming structure which includes the full layer name appended to each image.

----

Speaking of shadows (or other layers with the opacity set to other than 100%) , I would suggest that you always double-check the layer opacity after the layers have been imported into After Effects because I have noticed that After Effects tends to change the opacity one percentage point up or down. So if you had a layer set to 24% opacity in TVPaint , when you check it in AE it will likely be set to 23% or 25% . In most cases the difference between a layer's opacity being 24% or 25% is not going to be noticeable, but still ... if you set it to 24% , it should stay 24%, not change to 23% or 25%. I don't know if this is a bug in TVPaint's AE Export/Import script or a bug in how AE reads the script.

Animator, TVPaint Beta-Tester, Animation Educator and Consultant.
MacOS 12.7.1 Monterey , Mac Mini (2018) , 3.2 GHz 6-Core Intel Core i7,
16 GB RAM , TVPaint PRO 11.7.1 - 64bit , Wacom Cintiq 21UX 2nd Gen.
,Wacom Intuos Pro 5 , Wacom driver version 6.3.39-1
User avatar
D.T. Nethery
Posts: 4125
Joined: 27 Sep 2006, 19:19

Re: After Effects JSON importer creates wrong timing of some layers

Post by D.T. Nethery »

D.T. Nethery wrote: 22 Dec 2022, 14:45
Dean wrote: 22 Dec 2022, 13:45 Hello David, just made a test and the layer containing "%" was not imported, but the rest of the project was.

As you know, we excluded some symbols from appearing in the layer names in TVPaint recently, since they caused issues depending on several factors: where the project's content was imported afterwards, the computer's language etc...

IIRC, the percentage symbol wasn't causing this kind of issue before, also it is quite common to use this symbol in TVPaint layer names, though, so maybe the problem appeared recently or I might just have never encountered it.

I am on Windows, though. I will conduct some additional tests with Matthieu when he comes back from his holiday.

Thanks for confirming. It definitely happens on Mac. If % symbol is used as part of a layer name it will not be imported into After Effects. (in my experience it will also prevent importing any layers above the layer that has a % symbol as part of the layer name. So for now the workaround is to avoid using % as part of a layer name.

You might want to add a note to the User Guide on the JSON Export page to warn the user that the % symbol should not be used as part of a layer name because it will disrupt the export.
https://www.tvpaint.com/doc/tvp11/index ... cture-json

The wording of the explanation will need to be chosen carefully because the % symbol IS used as part of the Folder name pattern and File name pattern, so potentially it is confusing to tell users not to use the % symbol. (but this applies only to naming Layers in the TVPaint file)

Image

Animator, TVPaint Beta-Tester, Animation Educator and Consultant.
MacOS 12.7.1 Monterey , Mac Mini (2018) , 3.2 GHz 6-Core Intel Core i7,
16 GB RAM , TVPaint PRO 11.7.1 - 64bit , Wacom Cintiq 21UX 2nd Gen.
,Wacom Intuos Pro 5 , Wacom driver version 6.3.39-1
Post Reply