Hello,
Is it possible to run a Windows Batch or Python Script from TVPaint?
I have tried tv_ReadUserString and tv_ReqFile, but to no avail.
Thanks!
Running a Batch or Python Script from TVPaint? Topic is solved
-
- Posts: 8
- Joined: 29 May 2016, 17:44
Running a Batch or Python Script from TVPaint?
Last edited by blastframe on 25 Oct 2019, 00:05, edited 1 time in total.
Re: Running a Batch Script from TVPaint?
Have you tried:
sven
Code: Select all
tv_plugin iFile "mount"|"open"|"cmd"|"exec"|"about" [iParameters]
Execute a plugin
[PARAMETERS]
iFile filesystempath The plugin
Info:
For path with special characters (like ':'), you need to write
(to not manage the string as a variable)
tv_***** ... "c:/Users/Mike/Desktop/myfile.ext" ...
For path with spaces, you need to write:
(to manage the path as a single string inside TVPaint Animation)
tv_***** ... '"'"c:/Users/Mike/Desktop/my file with spaces.ext"'"' ...
The path (already encapsulated with quote (") is again encapsulated with:
simple-quote (') quote (") simple-quote (')
"mount"|"open"|"cmd"|"exec"|"about" enum The command to call in the plugin
iParameters string The parameters of the command for 'cmd' and 'exec'
[RETURN]
oResult int The result status returned by the plugin for each command
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
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
-
- Posts: 8
- Joined: 29 May 2016, 17:44
Re: Running a Batch Script from TVPaint?
Hi Sven,
This seems like a step in the right direction, thank you. I am getting an error from TVPaint however.
Here is my batch file, HelloWorld.bat, that works in Command Prompt:
This is my TVPaint George script:
And this is TVPaint's error message when I run it:
"C:/Users/Kevin/Desktop/HelloWorld.bat is either not designed to run on Windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vendor for support. Error status 0xc000012f"
EDIT: I have looked into this and the only examples I could find were using TVPaint's .dll extension files as plugins. If anyone knows if running a script is possible, please let me know!
This seems like a step in the right direction, thank you. I am getting an error from TVPaint however.
Here is my batch file, HelloWorld.bat, that works in Command Prompt:
Code: Select all
ECHO OFF
ECHO Hello World
PAUSE
Code: Select all
tv_plugin "C:/Users/Kevin/Desktop/HelloWorld.bat" open
EDIT: I have looked into this and the only examples I could find were using TVPaint's .dll extension files as plugins. If anyone knows if running a script is possible, please let me know!
Re: Running a Batch or Python Script from TVPaint?
Here are three forum links to discussions which might help:
Executing Command Line
Using Python and FFMPEG
Python Scripting
sven
Executing Command Line
Using Python and FFMPEG
Python Scripting
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
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
-
- Posts: 8
- Joined: 29 May 2016, 17:44
Re: Running a Batch or Python Script from TVPaint?
You've been very helpful, Sven, thank you.
The first forum link had a very useful snippet (I saw your input on that thread as well ):
The other two forum links talked about using Python, but neither explained how to run Python from TVPaint.
Thanks again, Sven, for the help!
The first forum link had a very useful snippet (I saw your input on that thread as well ):
Code: Select all
tv_runscript "C:/Users/Kevin/Desktop/HelloWorld.bat"
Thanks again, Sven, for the help!
Re: Running a Batch or Python Script from TVPaint?
When you distill the best TVPaint/GEORGE solution for your purposes, could you take a few minutes to add a summary that demonstrates what you were trying to do and how you solved it, to this thread, for other script writers? THANKS!
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
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
Re: Running a Batch or Python Script from TVPaint?
This might not work for your purpose, but I've had better luck doing this the other way around.
I have Python scripts that run George scripts instead. That way I can wrap Python code before and after the George script runs. You can run george commands in the Windows commandline by basically calling the TVPaint path and then passing either George commands or scripts as arguments.
eg. "C:/Path/To/TVPaint.exe" "cmd=tv_WriteUserString DeadlineConfig ExportFormat PNG"
eg. "C:/Path/To/TVPaint.exe" "script=C:\Path\To\GeorgeScript.grg"
If that sounds like it could be helpful, I can elaborate further on how it works. But it's been the most reliable way to communicate back and forth with TVPaint and Python.
I have Python scripts that run George scripts instead. That way I can wrap Python code before and after the George script runs. You can run george commands in the Windows commandline by basically calling the TVPaint path and then passing either George commands or scripts as arguments.
eg. "C:/Path/To/TVPaint.exe" "cmd=tv_WriteUserString DeadlineConfig ExportFormat PNG"
eg. "C:/Path/To/TVPaint.exe" "script=C:\Path\To\GeorgeScript.grg"
If that sounds like it could be helpful, I can elaborate further on how it works. But it's been the most reliable way to communicate back and forth with TVPaint and Python.