Hello,
I’m looking for more information about these 3 script function CopyFile,SynchronizeDir,SynchronizeFile.
I’m trying to copy all maps from one point to another but without success.
i try this :
CopyFile( “C:\temp\.”, “C:\maps\.” );
SynchronizeDir( “C:\temp\.”, “C:\maps\” );
SynchronizeFile( “C:\temp\.”, “C:\maps\” );
Something is wrong because its doesn’t work.
Could you help me ?
All windows right on folder are in everyone for test purpose … so no security issue.
Thanks !!
Hi Lemble:
/bool/ CopyFile( /string/ SrcFilePath, /string/ DestFilePath )
Copies the file from the SrcFilePath to the DestFilePath. Returns true
on success, false otherwise.
Example: CopyFile( “C:\temp\fileA.jpg”, “C:\maps\fileA.jpg” );
/void/ SynchronizeFile( /string/ SrcFilePath, /string/ DestFilePath )
Ensures that DestFilePath file is the same as SrcFilePath file.
Example: SynchronizeFile( “C:\temp\fileA.jpg”, “C:\maps\fileA.jpg” );
/void/ SynchronizeDir( /string/ SrcDirPath, /string/ DestDirPath )
Ensures that the contents of the DestDirPath directory are the same as
the SrcDirPath directory.
Example: SynchronizeDir( “C:\temp\”, “C:\maps\” );
In your case, you probably want to use SynchronizeDir. Just make sure
you are passing the full directory path for each parameter, without the
wildcard (.).
Cheers,
- Ryan
–
–
Ryan Russell
Frantic Films Software
http://software.franticfilms.com/
204-949-0070
Hello,
Thanks for you answer.
For SynchronizeDir( “C:\temp\”, “C:\maps\” );
if file are missing on destination folder, are they copied ?
Thanks
Yes, anything missing (or different) in the destination folder is copied
over from the source folder.
Cheers,
- Ryan
–
–
Ryan Russell
Frantic Films Software
http://software.franticfilms.com/
204-949-0070
Hello,
is there a possibility to activate some debug information to see which file are copied during synchro, in client log windows ?
Not at the moment. It would be useful to add such a feature in the
future though.
Cheers,
- Ryan
–
–
Ryan Russell
Frantic Films Software
http://software.franticfilms.com/
204-949-0070
Hello,
Please find first test, and first script issue :
testmkdir = MakeDir( “C:\maps” );
testsourcefile = FileExists( “C:\temp\white.jpg” );
testsyncdir = SynchronizeDir( “C:\temp\”, “C:\maps\” );
testdestfile = FileExists( “C:\maps\white.jpg” );
LogInfo( " Create folder : " … testmkdir );
LogInfo( " Source file : " … testsourcefile );
LogInfo( " Source file : " … testsyncdir );
LogInfo( " Source file : " … testdestfile );
logfile:
RenderPluginException.Cause: JobError (2)
Exception.TargetSite: Void EndJob()
Exception.Source: DeadlinePluginLoader
Exception.StackTrace:
at Deadline.Plugins.PluginLoader.EndJob()
at Deadline.Plugins.Plugin.Dispose()
Scheduler Thread - Render Thread 0 threw an error:
Scheduler Thread - Exception during render: call to empty boost::function
what is wrong ?
Try mixing up the code like this (this should help determine which function call is causing the error, and we can go from there):
testmkdir = MakeDir( "C:\\maps" );
LogInfo( " Create folder : " .. testmkdir );
testsourcefile = FileExists( "C:\\temp\\white.jpg" );
LogInfo( " Source file : " .. testsourcefile );
testsyncdir = SynchronizeDir( "C:\\temp\\", "C:\\maps\\" );
LogInfo( " Source file : " .. testsyncdir );
testdestfile = FileExists( "C:\\maps\\white.jpg" );
LogInfo( " Source file : " .. testdestfile );
Hello,
please find new error log with your change:
0: INFO: Create folder : 0
0: INFO: Source file : 1
Exception Details
RenderPluginException – Attempted to access undefined variable: overrideBitmapPager at overrideBitmapPager == “true”, overrideBitmapPager == “1” ) ) { SetINISetting( “Performance”, “BitmapPager”, originalBitmapPager, maxIniFile ); LogInfo( "Restored Bitmap Pager setting to " … GetINISetting( “Performance”, “BitmapPager”, “0”, maxIniFile ) ); }
RenderPluginException.Cause: JobError (2)
Exception.TargetSite: Void EndJob()
Exception.Source: DeadlinePluginLoader
Exception.StackTrace:
at Deadline.Plugins.PluginLoader.EndJob()
at Deadline.Plugins.Plugin.Dispose()
Scheduler Thread - Render Thread 0 threw an error:
Scheduler Thread - Exception during render: call to empty boost::function
its seems that issue come from SynchronizeDir function.
thanks
Try changing the SynchronizeDir line to look like this:
testsyncdir = SynchronizeDir( "C:\\temp", "C:\\maps" );
The problem might just be the extra "\\" at the end of each parameter. Let us know if this helps!
Cheers,
- Ryan
Hello,
I remove the \ at the end of both directory.
Same issue, with same log error.
Any other idea ?
Thanks
Hmm, what’s odd is this error message:
RenderPluginException – Attempted to access undefined variable:
overrideBitmapPager at overrideBitmapPager == “true”,
overrideBitmapPager == “1” ) ) { SetINISetting( “Performance”,
“BitmapPager”, originalBitmapPager, maxIniFile ); LogInfo( "Restored
Bitmap Pager setting to " … GetINISetting( “Performance”,
“BitmapPager”, “0”, maxIniFile ) ); }
This seems to be separate from the scripting code you added. If you take
all of the additional code you added and tried rendering again, does it
work? Also, just to confirm, are you using the 3dsmaxCmd plugin?
Cheers,
- Ryan
–
–
Ryan Russell
Frantic Films Software
http://software.franticfilms.com/
204-949-0070
hello,
yes i use it. please find complet prerendertask.ffs:
LogInfo( “3dsmaxCmd render job starting…” );
LogInfo( “--------------------------------” );
testmkdir = MakeDir( “C:\maps” );
LogInfo( " Create folder : " … testmkdir );
testsourcefile = FileExists( “C:\temp\white.jpg” );
LogInfo( " Source file : " … testsourcefile );
testsyncdir = SynchronizeDir( “C:\temp”, “C:\maps” );
LogInfo( " Source file : " … testsyncdir );
testdestfile = FileExists( “C:\maps\white.jpg” );
LogInfo( " Source file : " … testdestfile );
LogInfo( “--------------------------------” );
// get the max ini filename
maxCmdExeList = GetPluginConfigEntry( “Max” … Trim(GetJobInfoEntryWithDefault( “Version”, “8” )) … “Cmd_RenderExecutable” );
maxCmdExe = SearchFileList( maxCmdExeList );
maxIniFile = EnsureTrailingBackSlash( DirectoryFromPath( maxCmdExe ) ) … “3dsmax.ini”;
originalBitmapPager = “0”;
overrideBitmapPager = ToLower( GetJobInfoEntryWithDefault( “OverrideBitmapPager”, “false” ) );
if( Or( overrideBitmapPager == “true”, overrideBitmapPager == “1” ) )
{
bitmapPager = ToLower( GetJobInfoEntryWithDefault( “BitmapPager”, “false” ) );
bitmapPagerValue = “0”;
if( Or( bitmapPager == “true”, bitmapPager == “1” ) )
{
bitmapPagerValue = “1”;
}
originalBitmapPager = GetINISetting( “Performance”, “BitmapPager”, “0”, maxIniFile );
LogInfo( "Original Bitmap Pager setting was " … originalBitmapPager );
SetINISetting( “Performance”, “BitmapPager”, bitmapPagerValue, maxIniFile );
LogInfo( "New Bitmap Pager setting is " … GetINISetting( “Performance”, “BitmapPager”, “0”, maxIniFile ) );
}
stripStitching = false;
I was able to reproduce this problem, and it is due to a bug in the
SynchronizeDir function. I’ve attached a new build of the Script plugin
here, which should fix the problem. Note that the majority of our
plugins (including 3dsmaxCmd) simply use a renamed copy of the
Script.deadline file, so to install it:
- Go to the plugin directory (where the prerendertask.ffs file is), and
move the *.deadline file out of the directory (don’t delete it, just in
case there are problems with the new file).
- Copy the Script.deadline file to the plugin directory.
- Rename the Script.deadline file you copied over to the original
*.deadline name that you moved out of the directory.
- Try to render again.
Let us know if this works for you.
Cheers,
- Ryan
–
–
Ryan Russell
Frantic Films Software
http://software.franticfilms.com/
204-949-0070
Yes !
Its working thanks you.
could i copy this new script.deadline file every where ?
The only plugins that don’t use a copy of the Script.deadline file are
the 3dsmax# (where # could be 5-9) plugins, and the Combustion3 plugin.
For the rest, you can copy the new Script.deadline plugin over.
Cheers,
- Ryan
–
–
Ryan Russell
Frantic Films Software
http://software.franticfilms.com/
204-949-0070
hello,
I will check same synchronize function with 3dsmax 9 tonight. Have you already test it with max 9 plugin ?
The max 9 plugin doesn’t support the same type of scripting as the
Script.deadline derived plugins. It does have a customize.ms file though
which is called when the max scene is loaded, so you would have to use
that (and the appropriate maxscript calls) to synchronize the directories.
Cheers,
- Ryan
–
–
Ryan Russell
Frantic Films Software
http://software.franticfilms.com/
204-949-0070