Create log file with George Script

A forum dedicated to George scripting questions
Post Reply
brianottosen
Posts: 10
Joined: 20 Dec 2012, 13:30

Create log file with George Script

Post by brianottosen »

Hi all

I have a George script for automatic rendering.

The script opens TV Paint and enables relevant layers and export images and quit.

I need my scripts to return information to our job submitter. I have worked on an approach with a log file by the use of tv_WriteTextFile but the problem is that I have to manually confirm writing of the file in the GUI. I have tried to guess what the option "AskUser", mentioned here http://wiki.tvpaint.com/index.php?title ... teTextFile" onclick="window.open(this.href);return false; mean.

Is it possible to do something like this at all with tv_WriteTextFile

In the SDK tv_WriteTextFile seem to not be mentioned at all but there are some other functions TVWriteStringFile() together with open, read and close.

Does anybody know of some example code using these functions?

Another, and possibly better, approach would be to have TV Paint to return errorcodes when the script runs.

Can the .exe file give any errorcodes?

All the best
Brian.
User avatar
Eric Scholl
Posts: 1303
Joined: 04 Apr 2011, 14:40

Re: Create log file with George Script

Post by Eric Scholl »

Hi brianottosen,

What informations do you need from the script ?

Basically, TVPaint doesn't allow scripts to write in a file without asking the user for his agreement. It's an important protection for TVPaint and the users.

Otherwise anybody could write in any file on the system, and we had already some people who succeeded to turn their OS unstable because of that.
brianottosen
Posts: 10
Joined: 20 Dec 2012, 13:30

Re: Create log file with George Script

Post by brianottosen »

As a minimum I need to know ok or error after script execution but I have many things I would like to write in a log file if it I could.

I would like tv paint to return error codes but a log file has more potential for detailed output from a script.

Printing to stdout would also work.

I am able to write image files and project files without user interaction though. So far the only work around I can come up with is to export an image named yyyymmdd_serial_message.jpg (eg. "20121222_01_ok.jpg") but that stinks.
User avatar
Eric Scholl
Posts: 1303
Joined: 04 Apr 2011, 14:40

Re: Create log file with George Script

Post by Eric Scholl »

I think your solution is the only one you can use for now, but printing to stdout is something we could add in our script language.

I am not at office right now, but I will see if I can do something when I'll be back.
Svengali
Posts: 1553
Joined: 28 Dec 2006, 10:08

Re: Create log file with George Script

Post by Svengali »

Several possibilities around the problem...

Perhaps you could simply set aside strings in a memory array and insert sequential text entries, then dump that array into a text file at end of the run.

Second way might be to use RGB values as codes for table entries and insert them sequentially into an image, where each pixel would contain one entry, then save the file at the end of the run and write some kind of simple utility to rescan the pixels and decode the values bacl into a table of messages which could be written to a text file.

Perhaps the sequential PIXEL RGB values could be parsed from ASCII code? Again, recoverable from the image file in a simple text editor at the end of the run.

Then there's always writing entries into the Config file... If you only have a few messages to capture each run, you might check out the tv_WriteUserString command which writes into the config file using Section/Line/Text entries. The documentation warns not to load up the file with too much junk but I've stored a lot of stuff that way. Once finished, you can open the file with a Text editor and search/find your Section, then read the list of entries there. Probably a good idea to use it in something other than the default folder.

Wacky I know, but hey. It's Christmas. :D

You've made me curious as to what kind of image batch processing you are using TVPaint for? Can you share?

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
brianottosen
Posts: 10
Joined: 20 Dec 2012, 13:30

Re: Create log file with George Script

Post by brianottosen »

Thanks for your inputs Svengali.

Your first solution is pretty much what I want to do but the question is how to dump the data to a file on disk without user interaction. First time my script writes to a text file George script make the user confirm, by clicking on a dialogue box on the screen, which can't be automated. Once the saving dialogue has been approved it seem to be possible to add lines to the text file without further confirmation.

Do you have any suggestions on how I can save the text file without user interaction?

Your second solution with the RGB values "hack" is very creative but I would rather try to sweet talk TV Paint to develop a "real" solution where the best would be to get an output on standard out or an error level returned when George scripts are executed from the command prompt.

However - until any such thing is being developed - I will be able to put my messages into the file name of an exported image. This “hack” is not exactly a dream solution but merely the least bad solution I can come up with.

I have decided to use a watched folder approach. Any George script dumped into the watched folder will be processed. Once a script has been processed it is moved to another folder for executed scripts with a "code" in the name. This enables us to submit a "job" with a job id in the file name, such as "12345678.grg", and move it to the processed folder as "12345678_ok.grg" or "12345678_error_project_file_exists.grg".

For information on the batch processing we are setting up please see below.

HoBSoft has been hired to integrate our production management system for a feature film which will be produced in four different studios. We are setting up a lot of automation for transfers, resource ownerships, quality control, rendering of media for multiple editing stations etc.

The TV Paint part of our automation includes three job types.

1. Automatic creation of TV Paint setups
Once a scene is created in our production management system, either via our web interface or via our automatic breakdown of the animatic, it will automatically create a George script which will create a TV Paint setup for the scene.

The TV Paint setups include a layer for each milestone for the project such as animatic, pre layout, posing etc. From the editing we load three different audio files dialog, fx and music and we create a custom palette of layer groups which are assigned to the various layers to be used for the automatic rendering. Finally we create a few technical layers with a field guide and a place holder to indicate the total duration of the scene.

2. Automatic rendering of milestone media
After the TV Paint file has been “born” it will automatically be transferred to the various studios when they need it to work on. The artists must assign proper layer grouping to the layers they make. When an artist has reached a point where he wants feedback from supervisor or director he save and close the project and mark the corresponding tasks as “Ready” in HoBSoft.

This will make HoBSoft start a series of processes:
a. Make local copy
b. Quality control local copy
c. Transfer to head quarter
d. Update render mirror
e. Create George script for rendering current milestone
f. Submit render job
g. Use rendered output to render media files for HoBSoft
h. Use rendered output to render media files for Final Cut Pro
i. Notify supervisor and director to look at the scene

3. Quality control
Check TV Paint setup for various parameters such as resolution and duration and existence of certain layers.
Svengali
Posts: 1553
Joined: 28 Dec 2006, 10:08

Re: Create log file with George Script

Post by Svengali »

Brian,

I went to the hobsoft.net site... and from reviewing the Case Studies posted there I see what you're trying to do. I'm sure the TVPaint programmers will be able to help you. :D

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
Post Reply