Jigsaw - Assemble regions with full image size

Discussion and Support of Deadline, the Render Management System
squeakybadger
Posts: 86
Joined: Tue Jul 28, 2009 9:50 am

Jigsaw - Assemble regions with full image size

Postby squeakybadger » Thu May 18, 2017 4:53 am

Hi,

Can Jigsaw assemble the regions it renders at the correct image size of the render? At the moment it is cropping the image to the edges of the regions that have been rendered, so when it comes to overlay in Photoshop, everything needs moving into position. (ie the render is 5kx2k, and the assembled region image is 1kx2k)

I could have sworn it used to render the full image size and have the regions in the correct position, so maybe I have the wrong option selected? It is set on assemble over empty background (output over previous image wont work for us as things usually change)

Thanks.

User avatar
Bobo
Posts: 5977
Joined: Tue Nov 15, 2005 10:26 am
Location: Vancouver, Canada
Contact:

Re: Jigsaw - Assemble regions with full image size

Postby Bobo » Thu May 18, 2017 11:23 am

The way Jigsaw renders its tiles for the Draft Tile Assembler is to crop the tiles to the size of the region, plus eventual padding. Then, in the Draft Tile Assembler control file, it specifies the upper left corner location of the tile relative to the full image. To do this, the SMTDFunctions.CreateJobInfoFile() function writes out the key pair

Code: Select all

RegionType=CROP


The other options for the region type are RegionType=NOCROP and RegionType=BLOWUP.
The "3ds Max Region Rendering" rollout offers a drop-down list with those options (Region, Crop, Blowup).
In your case, you are asking for the Region (NOCROP) option, but it is not exposed in the Jigsaw controls - Jigsaw always defaults to CROP.

If you are not using the Draft Tile Assembler to assemble your images, but you are doing the assembly manually in Photoshop, then you would have to modify the JOB file after it has been written to replace the line

Code: Select all

RegionType=CROP

with

Code: Select all

RegionType=NOCROP

Then all tiles should end up at fill output image resolution, and you could paste them on top of each other in Photoshop without knowing the exact placement of the upper left corner of each one of them.

That being said, it would be possible to add this as a feature to the SMTD Jigsaw code. We could have an option that switches Jigsaw between CROP and NOCROP, and then the Draft Tile Assembler control file needs to have the matching line TilesCropped=True (which is the current hard-coded value), or TilesCropped=False when NOCROP was specified for the renderer. As result, the tiles would be saved as full res. images, and the DTA would still read only the pixels from the specified region of the uncropped file, and paste at the correct location of the background image. But then you could open in Photoshop and do what you want with those full res. images...
Borislav "Bobo" Petrov
Product Specialist
Thinkbox Software Inc.

User avatar
Bobo
Posts: 5977
Joined: Tue Nov 15, 2005 10:26 am
Location: Vancouver, Canada
Contact:

Re: Jigsaw - Assemble regions with full image size

Postby Bobo » Thu May 18, 2017 12:53 pm

Btw, you could modify your SubmitMaxToDeadline_Functions.ms file for now to always submit Jigsaw with RegionType=NOCROP, and set the TilesCropped=False in the Draft Tile Assembler's control files if you want to test it out. I can tell you which lines to modify if you want to try that...
Borislav "Bobo" Petrov
Product Specialist
Thinkbox Software Inc.

squeakybadger
Posts: 86
Joined: Tue Jul 28, 2009 9:50 am

Re: Jigsaw - Assemble regions with full image size

Postby squeakybadger » Mon May 22, 2017 3:30 am

Hi Bobo,

Thanks for that info. As a workaround I set Jigsaw to render a small tile in the top left and bottom right to give it the correct dimensions on output.

If you can show me how to force the NOCROP on Jigsaw that would be great, as every region we send would always need to be the full image size to comp.

Also, what would be the best way to retain changes made to the repo scripts when updates happen (apart from keeping a big list of what needs changing manually?)

Thanks again.

User avatar
Bobo
Posts: 5977
Joined: Tue Nov 15, 2005 10:26 am
Location: Vancouver, Canada
Contact:

Re: Jigsaw - Assemble regions with full image size

Postby Bobo » Mon May 22, 2017 4:54 pm

squeakybadger wrote:If you can show me how to force the NOCROP on Jigsaw that would be great, as every region we send would always need to be the full image size to comp.


In SubmitMaxToDeadline_Functions.ms, locate the code block that looks like

Code: Select all

               )
               else
               (
                  format "RegionPadding=%\n" SMTDSettings.TilesPadding to:JobInfoFile
                  if SMTDSettings.TileBlowupMode and tilesRendering  then --SMTDSettings.TilesRendering
                     format "RegionType=BLOWUP\n" to:JobInfoFile
                  else
                     format "RegionType=CROP\n" to:JobInfoFile
               )


and change the last format from CROP to NOCROP:

Code: Select all

                     format "RegionType=NOCROP\n" to:JobInfoFile


Then locate the code block inside the fn SubmitDraftTileAssemblerJob that looks like:

Code: Select all

                  format "TileCount=%\n" tileCount to:draftConfigFile
                  format "TilesCropped=True\n" to:draftConfigFile
                  format "DistanceAsPixels=True\n" to:draftConfigFile

and change the TilesCropped line to False:

Code: Select all

                  format "TilesCropped=False\n" to:draftConfigFile


Note that I haven't actually tested these changes, but looking at the code, they should make Jigsaw render non-cropped regions, and the assembler will expect them to be non-cropped. Make sure you have a backup copy of the MS file in case it does not work. I will be on a business trip the rest of this week and might not be able to keep an eye on the forum...

squeakybadger wrote:Also, what would be the best way to retain changes made to the repo scripts when updates happen (apart from keeping a big list of what needs changing manually?)

Currently your only hope is that we will include the changes you need as features of the next SMTD update. If you report that the above changes worked correctly, I will add a checkbox option to the Region rollouts to control the CROP/NOCROP behavior of Jigaw and Tile regions in the next version of Deadline. Otherwise you would have to make the changes each time a new update is installed... :(
Borislav "Bobo" Petrov
Product Specialist
Thinkbox Software Inc.

squeakybadger
Posts: 86
Joined: Tue Jul 28, 2009 9:50 am

Re: Jigsaw - Assemble regions with full image size

Postby squeakybadger » Tue May 30, 2017 4:18 am

Hi Bobo,

Finally managed to apply this change, but it looks like it kills the Tile Assembly Job.

Errors from the job:

Code: Select all

=======================================================
Error
=======================================================
Error: Renderer returned non-zero error code, 1. Check the log for more information.
   at Deadline.Plugins.PluginWrapper.RenderTasks(String taskId, Int32 startFrame, Int32 endFrame, String& outMessage, AbortLevel& abortLevel)

=======================================================
Type
=======================================================
RenderPluginException

=======================================================
Stack Trace
=======================================================
   at Deadline.Plugins.SandboxedPlugin.a(DeadlineMessage A_0)
   at Deadline.Plugins.SandboxedPlugin.RenderTask(String taskId, Int32 startFrame, Int32 endFrame)
   at Deadline.Slaves.SlaveRenderThread.a(TaskLogWriter A_0)

=======================================================
Log
=======================================================
2017-05-30 10:07:03:  0: Loading Job's Plugin timeout is Disabled
2017-05-30 10:07:05:  0: Executing plugin command of type 'Sync Files for Job'
2017-05-30 10:07:06:  0: Synchronization time for job files: 951.612 ms
2017-05-30 10:07:06:  0: Synchronizing Plugin DraftTileAssembler from \\piknas003\DeadlineRepository9\plugins\DraftTileAssembler took: 0 seconds
2017-05-30 10:07:06:  0: Done executing plugin command of type 'Sync Files for Job'
2017-05-30 10:07:06:  0: Executing plugin command of type 'Initialize Plugin'
2017-05-30 10:07:06:  0: INFO: Executing plugin script 'C:\Users\Pikcells\AppData\Local\Thinkbox\Deadline9\slave\r1\plugins\592d31ce2b1a7233a8925743\DraftTileAssembler.py'
2017-05-30 10:07:07:  0: INFO: Found Draft python module at: 'C:\Users\Pikcells\AppData\Local\Thinkbox\Deadline9\slave\r1\Draft\Draft.pyd'
2017-05-30 10:07:07:  0: INFO: About: Draft Tile Assembler Plugin for Deadline
2017-05-30 10:07:07:  0: INFO: Render Job As User disabled, running as current user 'Pikcells'
2017-05-30 10:07:07:  0: INFO: The job's environment will be merged with the current environment before rendering
2017-05-30 10:07:07:  0: Done executing plugin command of type 'Initialize Plugin'
2017-05-30 10:07:07:  0: Start Job timeout is disabled.
2017-05-30 10:07:07:  0: Task timeout is disabled.
2017-05-30 10:07:07:  0: Loaded job: temp4 (Region) - jobName Draft Tile Assembly (592d31ce2b1a7233a8925743)
2017-05-30 10:07:07:  0: Successfully mapped X: to //piknas003/Assets
2017-05-30 10:07:07:  0: Successfully mapped Y: to //piknas003/Resources
2017-05-30 10:07:07:  0: Successfully mapped Z: to //piknas003/Projects
2017-05-30 10:07:07:  0: Executing plugin command of type 'Start Job'
2017-05-30 10:07:07:  0: Done executing plugin command of type 'Start Job'
2017-05-30 10:07:07:  0: Plugin rendering frame(s): 0
2017-05-30 10:07:07:  0: Executing plugin command of type 'Render Task'
2017-05-30 10:07:07:  0: INFO: Draft Tile Assembler job starting...
2017-05-30 10:07:07:  0: INFO: Stdout Redirection Enabled: True
2017-05-30 10:07:07:  0: INFO: Stdout Handling Enabled: True
2017-05-30 10:07:07:  0: INFO: Popup Handling Enabled: False
2017-05-30 10:07:07:  0: INFO: Using Process Tree: True
2017-05-30 10:07:07:  0: INFO: Hiding DOS Window: True
2017-05-30 10:07:07:  0: INFO: Creating New Console: False
2017-05-30 10:07:07:  0: INFO: Running as user: Pikcells
2017-05-30 10:07:07:  0: INFO: Looking for bundled python at: 'C:\Program Files\Thinkbox\Deadline9\bin\dpython.exe'
2017-05-30 10:07:07:  0: INFO: Executable: "C:\Program Files\Thinkbox\Deadline9\bin\dpython.exe"
2017-05-30 10:07:07:  0: INFO: Argument: "C:\Users\Pikcells\AppData\Local\Thinkbox\Deadline9\slave\r1\plugins\592d31ce2b1a7233a8925743\Assembler.py" "C:\Users\Pikcells\AppData\Local\Thinkbox\Deadline9\slave\r1\jobsData\592d31ce2b1a7233a8925743\thread0_tempSKx8J0\clipreg2_0_config_2017_5_030__9_48_10_0000.txt" True True True
2017-05-30 10:07:07:  0: INFO: Full Command: "C:\Program Files\Thinkbox\Deadline9\bin\dpython.exe" "C:\Users\Pikcells\AppData\Local\Thinkbox\Deadline9\slave\r1\plugins\592d31ce2b1a7233a8925743\Assembler.py" "C:\Users\Pikcells\AppData\Local\Thinkbox\Deadline9\slave\r1\jobsData\592d31ce2b1a7233a8925743\thread0_tempSKx8J0\clipreg2_0_config_2017_5_030__9_48_10_0000.txt" True True True
2017-05-30 10:07:07:  0: INFO: Startup Directory: "C:\Users\Pikcells\AppData\Local\Thinkbox\Deadline9\slave\r1\Draft"
2017-05-30 10:07:07:  0: INFO: Process Priority: BelowNormal
2017-05-30 10:07:07:  0: INFO: Process Affinity: default
2017-05-30 10:07:07:  0: INFO: Process is now running
2017-05-30 10:07:08:  0: STDOUT: Checking for a license...
2017-05-30 10:07:08:  0: STDOUT: Draft 1.6.4
2017-05-30 10:07:08:  0: STDOUT: Error on missing tiles = True
2017-05-30 10:07:08:  0: STDOUT: Error on missing Background = True
2017-05-30 10:07:08:  0: STDOUT: Distance as pixels = True
2017-05-30 10:07:08:  0: STDOUT: Assembling Single File
2017-05-30 10:07:08:  0: STDOUT: Assembling File: \\piknas003\Projects\2017\R_n_D\_clipreg\clipreg2\clipreg2.exr
2017-05-30 10:07:08:  0: STDOUT: Writing File to temporary location: c:\users\pikcells\appdata\local\temp\clipreg2.exr
2017-05-30 10:07:08:  0: STDOUT: Tiles are not cropped
2017-05-30 10:07:08:  0: STDOUT: Final Image Dimensions = 1280x720
2017-05-30 10:07:08:  0: STDOUT: TileCount given: 9
2017-05-30 10:07:08:  0: STDOUT: No dimensions given for cropping Tile0
2017-05-30 10:07:08:  0: STDOUT: 'Tile0Width'
2017-05-30 10:07:08:  0: STDOUT: Draft Tile Assembler Failed! See job log for more details.
2017-05-30 10:07:08:  0: STDOUT: Traceback (most recent call last):
2017-05-30 10:07:08:  0: STDOUT:   File "C:\Users\Pikcells\AppData\Local\Thinkbox\Deadline9\slave\r1\plugins\592d31ce2b1a7233a8925743\Assembler.py", line 214, in <module>
2017-05-30 10:07:08:  0: STDOUT:     tileWidth = float(data[tileName+"Width"])
2017-05-30 10:07:08:  0: STDOUT: KeyError: 'Tile0Width'
2017-05-30 10:07:08:  0: INFO: Process exit code: 1
2017-05-30 10:07:08:  0: Done executing plugin command of type 'Render Task'

User avatar
Bobo
Posts: 5977
Joined: Tue Nov 15, 2005 10:26 am
Location: Vancouver, Canada
Contact:

Re: Jigsaw - Assemble regions with full image size

Postby Bobo » Tue May 30, 2017 11:34 am

Turns out we also need to supply the Tile Width and Tile Height when the sources are not cropped (duh!), so the Draft Tile Assembler can crop them internally.

If you are going to composite them yourself in Photoshop or another application and you don't intend to use Draft Tile Assembler at all, then the changes you made would be ok - the tile images should be now full resolution, uncropped. Just disable or ignore the DTA job.

If you want to use the Draft Tile Assembler, we need to add a few more lines to the function that creates the DTA control file to supply the width and height. Unfortunately, it is not exactly trivial. Let me know if you want me to look into it.
Borislav "Bobo" Petrov
Product Specialist
Thinkbox Software Inc.

squeakybadger
Posts: 86
Joined: Tue Jul 28, 2009 9:50 am

Re: Jigsaw - Assemble regions with full image size

Postby squeakybadger » Fri Jun 02, 2017 11:54 am

Hi Bobo,

Yes, we are only using the DTA as recompiling in Photoshop won't work with our existing pipeline too well.

If you can take a look at it, that would be great.

Thanks.

User avatar
Bobo
Posts: 5977
Joined: Tue Nov 15, 2005 10:26 am
Location: Vancouver, Canada
Contact:

Re: Jigsaw - Assemble regions with full image size

Postby Bobo » Fri Jun 02, 2017 12:14 pm

squeakybadger wrote:Hi Bobo,

Yes, we are only using the DTA as recompiling in Photoshop won't work with our existing pipeline too well.

If you can take a look at it, that would be great.

Thanks.


Then I must be missing the point - if DTA is recompiling the image, what do you care how the tiles were saved if the final image is made whole anyway? Or are you using the tile images for something else in addition?

I will look into this, but once again it turns out it is not trivial since I don't collect the region size info during submission and will have to heavily modify some already scary code. :mrgreen:
Borislav "Bobo" Petrov
Product Specialist
Thinkbox Software Inc.


Return to “Thinkbox Software - Deadline”

Who is online

Users browsing this forum: Google [Bot] and 2 guests