formatting file paths

A forum dedicated to George scripting questions
Post Reply
jeremyb
Posts: 31
Joined: 31 Jul 2020, 08:52

formatting file paths

Post by jeremyb »

Hi,

I am trying to understand why I have this difference formatting file paths between tv_loadsequenceand tv_saveproject.

Note : the .grg script part are from the script : tvp_test.grg

tv_saveproject

cmdline :

Code: Select all

"C:\Program Files\[...] Animation 11.5 Pro (64bits).exe" "cmd=tv_WriteUserString VfxConfig ProjectFullPath A:\work\jeremyb\test_script\tvpaint\test_file.tvpp" "script=A:\work\jeremyb\test_script\tvpaint\tvp_test.grg"
If i save my project with :

Code: Select all

tv_ReadUserString "VfxConfig" "ProjectFullPath" ""
projectFullPath = result
tv_saveproject projectFullPath
It's ok

BUT if i save my project with

Code: Select all

tv_ReadUserString "VfxConfig" "ProjectFullPath" ""
projectFullPath = '"'result'"'
tv_saveproject projectFullPath
isn't working

tv_loadsequence

cmdline :

Code: Select all

"C:\Program Files\[...] Animation 11.5 Pro (64bits).exe" "cmd=tv_WriteUserString VfxConfig PlayblastFullPath A:\work\jeremyb\test_script\tvpaint\playplast\sht0020.mov" "script=A:\work\jeremyb\test_script\tvpaint\tvp_test.grg"
With or without, formatting file paths is working.

Code: Select all

result or '"'result'"'
have you an idea ?
WINDOWS 10 : 10.0.19044 Build 19044
TVPAINT : 11.5.3-64bit dec 3 2021
CPU : i9-9900
RAM : 64Go
CG: RTX 2080 SUPER 8go
Svengali
Posts: 1552
Joined: 28 Dec 2006, 10:08

Re: formatting file paths

Post by Svengali »

jeremyb wrote: 12 May 2022, 16:38
BUT if i save my project with

Code: Select all

tv_ReadUserString "VfxConfig" "ProjectFullPath" ""
projectFullPath = '"'result'"'
tv_saveproject projectFullPath
isn't working

have you an idea ?
Your problem may be:

When you need to enclose a string in double quotes, you should write like this:
open with ' " (single then double)
close with " ' (double then single)

So the line should read:

projectFullPath = '"result"' // note that it looks like triple enclosing quotes but is really this: ' "result" '

The result is a string variable (projectFullPath) that ENCLOSES ANY extended path (which may or may not include SPACES) by double quotes, which becomes a stored path that can then be correctly executed.

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
jeremyb
Posts: 31
Joined: 31 Jul 2020, 08:52

Re: formatting file paths

Post by jeremyb »

Hi,
thank you for your feedback

after trying, it's the same problem, nohtin append.

Code: Select all

tv_ReadUserString "VfxConfig" "ProjectFullPath" ""
projectFullPath = '"result"' // << ' " result " ' , double qote simple quote
tv_saveproject projectFullPath
but if i remove quote, it works.
Currently, this should not be a problem because all the paths are 'automated' without spaces. But I would like to understand why ?

Strangly in TVpaint Deadline Submitter (GeorgeScript.grg - line 56) they wrote ' " ' result ' " '
and I think it should work if it's in the plugin deadline (I didn't try)

Code: Select all

//get scenePath
tv_ReadUserString "DeadlineConfig" "ScenePath" ""
scenePath = '"'result'"'
WINDOWS 10 : 10.0.19044 Build 19044
TVPAINT : 11.5.3-64bit dec 3 2021
CPU : i9-9900
RAM : 64Go
CG: RTX 2080 SUPER 8go
Svengali
Posts: 1552
Joined: 28 Dec 2006, 10:08

Re: formatting file paths

Post by Svengali »

J,
I gave you wrong advice - looking at the GEORGE syntax file again, and some of my own scripts, I see that enclosing a string variable needs to be ' " '.
Sorry.

I'm curious... Is your script outputting .tvpp files or is it outputting video renders?

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
jeremyb
Posts: 31
Joined: 31 Jul 2020, 08:52

Re: formatting file paths

Post by jeremyb »

hi,
When i want to output movie, isn't problem strangly... But when i want to save tvpaint file i've got error.
WINDOWS 10 : 10.0.19044 Build 19044
TVPAINT : 11.5.3-64bit dec 3 2021
CPU : i9-9900
RAM : 64Go
CG: RTX 2080 SUPER 8go
Post Reply