Python script tvLoadProject and missing sound popup

Please use this part to report bugs & errors, ask questions & "How to..."
Post Reply
Maelvon
Posts: 5
Joined: 23 Aug 2022, 18:07

Python script tvLoadProject and missing sound popup

Post by Maelvon »

Hello,

I'm scripting an export of a tvpp files as PNG, and for a tvvp file, I have a

Image

missing sound dependences popup window cf. attachement.

How can I get rid of it in my script?

I'm using "tv_LoadProject silent 1" for now.

Thanks in advance !

Maelvon
Attachments
tvpainttv_LoadProject.PNG
tvpainttv_LoadProject.PNG (12.67 KiB) Viewed 3023 times
Xavier
Posts: 1855
Joined: 01 Oct 2019, 11:08

Re: Python script tvLoadProject and missing sound popup

Post by Xavier »

Maelvon wrote: 26 Aug 2022, 09:53 I'm using "tv_LoadProject silent 1" for now.
Theoretically, that should do the trick. Do not consider it as a "setting" command, it's a parameter that should be used when you actually load the project.

Here's an example that worked for me, on a project with missing dependencies :

Code: Select all

tv_loadproject "/home/xavier/content/A/Project.tvpp" silent 1
That said, regarding the project dependencies I remember fixing issues no so long ago. So maybe you fell into such issue.
What's the behaviour of your TVPaint ? does it seem to freeze ?
You may wait a little bit until the next release, that should fix it.
Xavier
Posts: 1855
Joined: 01 Oct 2019, 11:08

Re: Python script tvLoadProject and missing sound popup

Post by Xavier »

Xavier wrote: 26 Aug 2022, 12:50 That said, regarding the project dependencies I remember fixing issues no so long ago. So maybe you fell into such issue.
What's the behaviour of your TVPaint ? does it seem to freeze ?
You may wait a little bit until the next release, that should fix it.
Actually no, if you saw the popup as you explained then I'd think the silent parameter wasn't used.
Maelvon
Posts: 5
Joined: 23 Aug 2022, 18:07

Re: Python script tvLoadProject and missing sound popup

Post by Maelvon »

Hi Xavier,

The Tvpaint with "tv_LoadProject C:\Myprojectpath\mytpv.tvpp silent 1" hangs as you say (freeze at 90%) with the file which miss the sound file (bar.tvpp).

The script send to os.system:

Code: Select all

C:\"Program Files\TVPaint Developpement\TVPaint Animation 11.5 Pro (64bits)\TVPaint Animation 11.5 Pro (64bits).exe" "cmd=tv_LoadProject C:\Users\foo\Documents\bar.tvpp silent 1" "cmd=tv_SaveMode PNG b32" "cmd=tv_Background NONE" "cmd=tv_AlphaSaveMode NoPreMultiply" "cmd=tv_SaveSequence C:\Users\foo\Documents\bar_001.PNG" "cmd=tv_quit"
I'm on the version 11.5.3-64 [1359wo]

Too bad I came across the bug!
Maelvon
Posts: 5
Joined: 23 Aug 2022, 18:07

Re: Python script tvLoadProject and missing sound popup

Post by Maelvon »

Is there any workarround?
Can I edit/remove the links of all the sound files before exporting the png files?
I'm trying to find a quick solution, cannot really wait for the next TVP version, unless it's scheduled to come out tomorrow!
Xavier
Posts: 1855
Joined: 01 Oct 2019, 11:08

Re: Python script tvLoadProject and missing sound popup

Post by Xavier »

Maelvon wrote: 26 Aug 2022, 15:09 Is there any workarround?
Can I edit/remove the links of all the sound files before exporting the png files?
I'm trying to find a quick solution, cannot really wait for the next TVP version, unless it's scheduled to come out tomorrow!
The bug may occur on every project file with missing dependencies (ie: video that was not preloaded, or sound).
So yes, you can try to open the project in TVPaint : provided you don't click on "ignore all dependencies", TVPaint won't freeze.
Regarding the audio files, you can remove the ones that are missing (or all) using the sound panel.
Regarding the missing non-preloaded videos (if any), you will have to provide an other location I guess... I know no option to remove the references from TVPaint.
Maelvon
Posts: 5
Joined: 23 Aug 2022, 18:07

Re: Python script tvLoadProject and missing sound popup

Post by Maelvon »

Thanks Xavier,

My problem is that I want to export a lot of tvpp files, and cannot check manually, one by one, for missing sounds or videos, and I'll want just to pass this blocking popup in my script!

I've not checked if we can access to the sound panel in command line, is it possible, and how? Like removing all linked sound before exporting to Png.
Xavier
Posts: 1855
Joined: 01 Oct 2019, 11:08

Re: Python script tvLoadProject and missing sound popup

Post by Xavier »

Maelvon wrote: 29 Aug 2022, 13:33 Thanks Xavier,

My problem is that I want to export a lot of tvpp files, and cannot check manually, one by one, for missing sounds or videos, and I'll want just to pass this blocking popup in my script!

I've not checked if we can access to the sound panel in command line, is it possible, and how? Like removing all linked sound before exporting to Png.
There's a complete reference here : https://tvpaint.com/doc/tvp11/files/les ... mmands.txt

You may want to use tv_soundprojectremove :

Code: Select all

tv_soundprojectremove [iTrackIndex]

[DESCRIPTION]
Remove a sound track

[PARAMETERS]
iTrackIndex    int    The track index (if 0 or not set, remove the first one)

[RETURN]
0    int    Track removed

[ERROR]
-2    int    Invalid track index

Code: Select all

[EXAMPLE]
// Remove all sounds
run=1
WHILE run
	tv_SoundProjectRemove 0
	IF result<0
		run=0
	END
END
--------
Xavier
Posts: 1855
Joined: 01 Oct 2019, 11:08

Re: Python script tvLoadProject and missing sound popup

Post by Xavier »

In addition, instead of "cmd=" you may put everything in a script and then use

Code: Select all

TVPaint.exe script="c:\absolute\path\to\script"
https://www.tvpaint.com/doc/tvp11/index ... ts&lang=en
Maelvon
Posts: 5
Joined: 23 Aug 2022, 18:07

Re: Python script tvLoadProject and missing sound popup

Post by Maelvon »

Ok, but there is a certain chicken and egg question here.
As I cannot open with a batch script the files with a missing sound file, while the popup hang the process while opening them.

As I want to open a list of tvpp files, export still png from them. The script either show the "missing sound dependencies" popup, and the script hangs here, or if I set the "silent 1" it also hangs.
So I cannot unlink the soud with the Georges script, as I cannot open open the file first.
The idea of removing the sound file with a script is not working here!

I'm stuck with with "silent 1" bug, and don't see another alternative here, another idea? Wait for the next release!!?
Xavier
Posts: 1855
Joined: 01 Oct 2019, 11:08

Re: Python script tvLoadProject and missing sound popup

Post by Xavier »

Well TVPaint is not meant to do what you're trying to. There will be a dedicated tool soon, but in the meantime we're running out of options !
Post Reply