AWS Thinkbox Discussion Forums

Maxscript Job only renering frame 0

Hello

I just finished writing a Vector Render engine in Maxscript that traces the outlines of 3D objects in 2D space.

Rendering locally is no problem and after replacing the Viewport access Functions in my Engine with the camera objects transform matrix it renders fine on the farm as well without submitting in workstation mode.

however it just renders the first frame. the job has all the tasks set up correctly and even if i modify the frames per task I end up with all my output beeing the same. the scripts output file name number is also based on the slidertime and as i get all the desired output svg’s, i think that the slidertime is indeed changing but not the camera. What could be the reason for this? at the end it is just a camera path constrained to a circle spline. rendering as normal max render job does produce the expected output, so i guess it is not a simple 3d related problem and has something to do with deadline.

I hope someone can help me with this.

just to test everything now, here are my statistic files for the renderer. you can clearly see that the frame count is working but the camera matrix is not updating :frowning:


Vectorion rendertime: 56.3 seconds (raytracing: 39.031s (456778 rays), edgeing: 17.269s)
Vectorion Version: 0.2
frame: 0
camera matrix: (matrix3 [0,1,0] [-0.447214,0,0.894427] [0.894427,0,0.447214] [100,0,50])

subdiv: 10
min_vertclustersize: 40.0
output_res: [1920,1080]
renderres_mult: 1.0
debug_mode: true
show_vfb: false
save_frames: true
debug_spline: false
save_stat_info: true
the_out_path: Z:\temp\AlexR\FF_RigTwo_Rendertest\FINAL\

Spline Optimisation Statistics:
M_004---------------------------------------
vertcluster before: 2093 after: 614
M_003---------------------------------------
vertcluster before: 2333 after: 723
M_001---------------------------------------
vertcluster before: 1539 after: 111
M_002---------------------------------------
vertcluster before: 1253 after: 81

[code]Vectorion rendertime: 39.066 seconds (raytracing: 27.073s (456778 rays), edgeing: 11.993s)
Vectorion Version: 0.2
frame: 1
camera matrix: (matrix3 [0,1,0] [-0.447214,0,0.894427] [0.894427,0,0.447214] [100,0,50])

subdiv: 10
min_vertclustersize: 40.0
output_res: [1920,1080]
renderres_mult: 1.0
debug_mode: true
show_vfb: false
save_frames: true
debug_spline: false
save_stat_info: true
the_out_path: Z:\temp\AlexR\FF_RigTwo_Rendertest\FINAL\

Spline Optimisation Statistics:
M_004---------------------------------------
vertcluster before: 2093 after: 614
M_003---------------------------------------
vertcluster before: 2333 after: 723
M_001---------------------------------------
vertcluster before: 1539 after: 111
M_002---------------------------------------
vertcluster before: 1253 after: 81
[/code]

Hi Alex,

When Max is running in Slave mode (not Force Workstation mode), it has no UI and can not access a valid SliderTime (as the slider is obviously not advancing). The Lightning plugin connecting the Slave with 3ds Max knows the render frame provided by the current task. So when you are running a script job, you MUST always access the current time using the Lightning’s DeadlineUtil interface:

DeadlineUtil.CurrentFrame

You might notice that in the MAXScript Job template offered by SMTD, there is a whole DeadlineUtilStruct defined for the case where the DeadlineUtil is undefined (which is for when testing the script outside of the Deadline Slave environment). In that case, the alternative definition of DeadlineUtil.CurrentFrame is taken from the SliderTime. But when the script is running under the control of the Deadline Slave, the DeadlineUtil will return the actual frame corresponding to the Task, as listed in the Monitor’s Task panel.
So in your code, you could do something like

at time DeadlineUtil.CurrentFrame ( local theCamera = DeadlineUtil.getJobInfoEntry "Camera" local theCameraNode = getNodeByName theCamera local theViewTM = inverse (theCameraNode.transform) DeadlineUtil.LogMessage ("Camera "+theCamera+ " Transform On Frame "+DeadlineUtil.CurrentFrame as string +" is "+ theViewTM as string ) -- do something with the camera transform... )

This is from top of my head, I have not tested the above snippet in an actual job, but it should give you the general idea…

Please let me know if this helped!

Thanks a lot Bobo!!!

As I am from Germany and its evening here already, I will have to test this tomorrow but I will write back If it worked this way.

I still have two questions though:

I get the point with the slidertime and UI… , but why is the frame counter working in my statistics although it gets its information directly from the slidertime value?

and also, as this is a multiframe job, and the Deadline Framework will set the Max Slave to a specific frame already, why is the camera still not moving?

Well, now that you asked about it, I submitted a job with an animated camera, and printed the info about the Transform of the camera with and without AT TIME, and I got the correct transforms in both cases. As you mentioned, SliderTime actually seems to get updated, currentTime does not.

So I would say there is something wrong with your script, rather than with how Deadline handles time - it appears that the Lightning plugin is setting the sliderTime internally to the Task Frame value, and also the time context of 3ds Max even if you omit the AT TIME context.

Here are a few frames as reported in my Slave Log:

2017-03-28 11:46:28:  0: INFO: Starting MAXScript Job...
2017-03-28 11:46:28:  0: INFO: SliderTime:25f
2017-03-28 11:46:28:  0: INFO: CurrentTime:0f
2017-03-28 11:46:28:  0: INFO: DU.CurrentFrame:25
2017-03-28 11:46:28:  0: INFO: Camera PhysCamera001 Transform without At Time context is (matrix3 [0.902646,0.257108,-0.345145] [-0.430384,0.539235,-0.723875] [0,0.801948,0.597393] [1.14441e-05,-3.05176e-05,-205.24])
2017-03-28 11:46:28:  0: INFO: Camera PhysCamera001 Transform At Time 25 is (matrix3 [0.902646,0.257108,-0.345145] [-0.430384,0.539235,-0.723875] [0,0.801948,0.597393] [1.14441e-05,-3.05176e-05,-205.24])
2017-03-28 11:46:28:  0: INFO: Finished MAXScript Job in 0.522 sec.
...
2017-03-28 11:46:35:  0: INFO: Starting MAXScript Job...
2017-03-28 11:46:35:  0: INFO: SliderTime:26f
2017-03-28 11:46:35:  0: INFO: CurrentTime:0f
2017-03-28 11:46:35:  0: INFO: DU.CurrentFrame:26
2017-03-28 11:46:35:  0: INFO: Camera PhysCamera001 Transform without At Time context is (matrix3 [0.910138,0.248888,-0.331214] [-0.414305,0.546753,-0.727607] [0,0.799447,0.600737] [1.14441e-05,-2.28882e-05,-203.939])
2017-03-28 11:46:35:  0: INFO: Camera PhysCamera001 Transform At Time 26 is (matrix3 [0.910138,0.248888,-0.331214] [-0.414305,0.546753,-0.727607] [0,0.799447,0.600737] [1.14441e-05,-2.28882e-05,-203.939])
2017-03-28 11:46:35:  0: INFO: Finished MAXScript Job in 0.518 sec.
...
2017-03-28 11:46:40:  0: INFO: Starting MAXScript Job...
2017-03-28 11:46:40:  0: INFO: SliderTime:27f
2017-03-28 11:46:40:  0: INFO: CurrentTime:0f
2017-03-28 11:46:40:  0: INFO: DU.CurrentFrame:27
2017-03-28 11:46:40:  0: INFO: Camera PhysCamera001 Transform without At Time context is (matrix3 [0.917478,0.240259,-0.317034] [-0.397787,0.554145,-0.731224] [0,0.796993,0.603988] [1.72493e-05,-3.05176e-05,-202.683])
2017-03-28 11:46:40:  0: INFO: Camera PhysCamera001 Transform At Time 27 is (matrix3 [0.917478,0.240259,-0.317034] [-0.397787,0.554145,-0.731224] [0,0.796993,0.603988] [1.72493e-05,-3.05176e-05,-202.683])
2017-03-28 11:46:40:  0: INFO: Finished MAXScript Job in 0.522 sec.
...
2017-03-28 11:46:45:  0: INFO: Starting MAXScript Job...
2017-03-28 11:46:45:  0: INFO: SliderTime:28f
2017-03-28 11:46:45:  0: INFO: CurrentTime:0f
2017-03-28 11:46:45:  0: INFO: DU.CurrentFrame:28
2017-03-28 11:46:45:  0: INFO: Camera PhysCamera001 Transform without At Time context is (matrix3 [0.924644,0.231219,-0.302607] [-0.380832,0.561389,-0.734717] [0,0.794594,0.607141] [1.32668e-05,-2.28882e-05,-201.473])
2017-03-28 11:46:45:  0: INFO: Camera PhysCamera001 Transform At Time 28 is (matrix3 [0.924644,0.231219,-0.302607] [-0.380832,0.561389,-0.734717] [0,0.794594,0.607141] [1.32668e-05,-2.28882e-05,-201.473])
2017-03-28 11:46:45:  0: INFO: Finished MAXScript Job in 0.525 sec.

As you can see, the transforms are changing as the time advances regardless of the way I access the transform.

So we will have to discuss the content of your script to figure out why it is insisting on using frame 0’s transforms. Is the camera keyframed? Are you setting any time contexts in your script? Can you post at least the snippet where you get the camera transforms?

Hi Bobo, thanks again!

The Camera is keyframed and path constrained to a circle objekct. it has an out of range controller on the percentage value as in a seperate Rig script the user should be able to select a frame based offset. In the rig script this looks like this:


CamPath = getnodebyname ((get_the_master()).name + "#CamPath") --circle object
cam_pc = path_constraint()
cam_pc.path = CamPath
new_cam.position.controller = cam_pc
setBeforeORT new_cam.position.controller #relativeRepeat
setAfterORT new_cam.position.controller #relativeRepeat

The camera Target is path constrained the same way but to a different path though.

in the render script the camera relevant code looks like this:

this_cam = getnodebyname this_cam
campos = this_cam.pos
target_pos = this_cam.target.pos
global_ray = ray campos (normalize (target_pos - campos))
camUp = ((this_cam.transform)).row2
camRight = ((this_cam.transform)).row1

To make this work on the farm using deadline and locally at the same time, the script with the actual renderfunction is defined as a start up script on every machine. once render is pressed in the “Rig” a little function call script will be written containing all the function call relevant variables including the camera name (this_cam). If the user decides to render locally, the same function will be called but from inside the rig. all works fine when rendering on the local machine.

to make a little bit more clear what the renderer is capable of and what it is doing:

youtube.com/watch?v=9CoUjQQ … e=youtu.be

The Path Constraint is a Position controller. I have the impression that it might behave differently.

So I recreated a scene where my camera and target were constrained to two circular paths.
I then printed the values you posted in my script to see what the Slave sees, and indeed, while the Transform property worked as expected, the position and vectors were wrong.

2017-03-28 14:53:30:  0: INFO: Starting MAXScript Job...
2017-03-28 14:53:30:  0: INFO: SliderTime:48f
2017-03-28 14:53:30:  0: INFO: CurrentTime:0f
2017-03-28 14:53:30:  0: INFO: DU.CurrentFrame:48
2017-03-28 14:53:30:  0: INFO: Camera PhysCamera001 Transform without At Time context is (matrix3 [-0.125329,0.365184,-0.92246] [-0.992115,-0.0461321,0.11653] [0,0.929791,0.368087] [1.90735e-05,21.4642,-353.062])
2017-03-28 14:53:30:  0: INFO: Camera PhysCamera001 Transform At Time 48 is (matrix3 [-0.125329,0.365184,-0.92246] [-0.992115,-0.0461321,0.11653] [0,0.929791,0.368087] [1.90735e-05,21.4642,-353.062])
2017-03-28 14:53:30:  0: INFO: campos:[336.155,-4.80825e-06,110]
2017-03-28 14:53:30:  0: INFO: target_pos:[58.3095,0,0]
2017-03-28 14:53:30:  0: INFO: global_ray:(ray [336.155,-4.80825e-06,110] [-0.929784,0,-0.368105])
2017-03-28 14:53:30:  0: INFO: camUp:[-0.368105,0,0.929784]
2017-03-28 14:53:30:  0: INFO: camRight:[0,1,0]
2017-03-28 14:53:30:  0: INFO: Finished MAXScript Job in 0.521 sec.

2017-03-28 14:53:36:  0: INFO: Starting MAXScript Job...
2017-03-28 14:53:36:  0: INFO: SliderTime:49f
2017-03-28 14:53:36:  0: INFO: CurrentTime:0f
2017-03-28 14:53:36:  0: INFO: DU.CurrentFrame:49
2017-03-28 14:53:36:  0: INFO: Camera PhysCamera001 Transform without At Time context is (matrix3 [-0.0627898,0.367376,-0.927951] [-0.998027,-0.0231131,0.0583811] [0,0.929785,0.368102] [2.05711e-05,21.4641,-353.046])
2017-03-28 14:53:36:  0: INFO: Camera PhysCamera001 Transform At Time 49 is (matrix3 [-0.0627898,0.367376,-0.927951] [-0.998027,-0.0231131,0.0583811] [0,0.929785,0.368102] [2.05711e-05,21.4641,-353.046])
2017-03-28 14:53:36:  0: INFO: campos:[336.155,-4.80825e-06,110]
2017-03-28 14:53:36:  0: INFO: target_pos:[58.3095,0,0]
2017-03-28 14:53:36:  0: INFO: global_ray:(ray [336.155,-4.80825e-06,110] [-0.929784,0,-0.368105])
2017-03-28 14:53:36:  0: INFO: camUp:[-0.368105,0,0.929784]
2017-03-28 14:53:36:  0: INFO: camRight:[0,1,0]
2017-03-28 14:53:36:  0: INFO: Finished MAXScript Job in 0.519 sec.

2017-03-28 14:53:41:  0: INFO: Starting MAXScript Job...
2017-03-28 14:53:41:  0: INFO: SliderTime:50f
2017-03-28 14:53:41:  0: INFO: CurrentTime:0f
2017-03-28 14:53:41:  0: INFO: DU.CurrentFrame:50
2017-03-28 14:53:41:  0: INFO: Camera PhysCamera001 Transform without At Time context is (matrix3 [1.6362e-07,0.368105,-0.929784] [-1,0,-1.52132e-07] [0,0.929784,0.368105] [2.08059e-05,21.464,-353.043])
2017-03-28 14:53:41:  0: INFO: Camera PhysCamera001 Transform At Time 50 is (matrix3 [1.6362e-07,0.368105,-0.929784] [-1,0,-1.52132e-07] [0,0.929784,0.368105] [2.08059e-05,21.464,-353.043])
2017-03-28 14:53:41:  0: INFO: campos:[336.155,-4.80825e-06,110]
2017-03-28 14:53:41:  0: INFO: target_pos:[58.3095,0,0]
2017-03-28 14:53:41:  0: INFO: global_ray:(ray [336.155,-4.80825e-06,110] [-0.929784,0,-0.368105])
2017-03-28 14:53:41:  0: INFO: camUp:[-0.368105,0,0.929784]
2017-03-28 14:53:41:  0: INFO: camRight:[0,1,0]
2017-03-28 14:53:41:  0: INFO: Finished MAXScript Job in 0.519 sec.

2017-03-28 14:53:46:  0: INFO: Starting MAXScript Job...
2017-03-28 14:53:46:  0: INFO: SliderTime:51f
2017-03-28 14:53:46:  0: INFO: CurrentTime:0f
2017-03-28 14:53:46:  0: INFO: DU.CurrentFrame:51
2017-03-28 14:53:46:  0: INFO: Camera PhysCamera001 Transform without At Time context is (matrix3 [0.0627903,0.367376,-0.927951] [-0.998027,0.0231132,-0.0583815] [0,0.929785,0.368102] [2.56151e-05,21.4641,-353.046])
2017-03-28 14:53:46:  0: INFO: Camera PhysCamera001 Transform At Time 51 is (matrix3 [0.0627903,0.367376,-0.927951] [-0.998027,0.0231132,-0.0583815] [0,0.929785,0.368102] [2.56151e-05,21.4641,-353.046])
2017-03-28 14:53:46:  0: INFO: campos:[336.155,-4.80825e-06,110]
2017-03-28 14:53:46:  0: INFO: target_pos:[58.3095,0,0]
2017-03-28 14:53:46:  0: INFO: global_ray:(ray [336.155,-4.80825e-06,110] [-0.929784,0,-0.368105])
2017-03-28 14:53:46:  0: INFO: camUp:[-0.368105,0,0.929784]
2017-03-28 14:53:46:  0: INFO: camRight:[0,1,0]
2017-03-28 14:53:46:  0: INFO: Finished MAXScript Job in 0.521 sec.

2017-03-28 14:53:51:  0: INFO: Starting MAXScript Job...
2017-03-28 14:53:51:  0: INFO: SliderTime:52f
2017-03-28 14:53:51:  0: INFO: CurrentTime:0f
2017-03-28 14:53:51:  0: INFO: DU.CurrentFrame:52
2017-03-28 14:53:51:  0: INFO: Camera PhysCamera001 Transform without At Time context is (matrix3 [0.12533,0.365184,-0.92246] [-0.992115,0.0461321,-0.11653] [0,0.929791,0.368087] [2.67029e-05,21.4642,-353.062])
2017-03-28 14:53:51:  0: INFO: Camera PhysCamera001 Transform At Time 52 is (matrix3 [0.12533,0.365184,-0.92246] [-0.992115,0.0461321,-0.11653] [0,0.929791,0.368087] [2.67029e-05,21.4642,-353.062])
2017-03-28 14:53:51:  0: INFO: campos:[336.155,-4.80825e-06,110]
2017-03-28 14:53:51:  0: INFO: target_pos:[58.3095,0,0]
2017-03-28 14:53:51:  0: INFO: global_ray:(ray [336.155,-4.80825e-06,110] [-0.929784,0,-0.368105])
2017-03-28 14:53:51:  0: INFO: camUp:[-0.368105,0,0.929784]
2017-03-28 14:53:51:  0: INFO: camRight:[0,1,0]
2017-03-28 14:53:51:  0: INFO: Finished MAXScript Job in 0.518 sec.

As you can see, the matrix3 values were changing as they should, but the campos, target_pos etc. just remained the same.

So I just added the AT TIME context around the code, and lo and behold, your variables started changing over time!

2017-03-28 15:03:46:  0: INFO: Starting MAXScript Job...
2017-03-28 15:03:46:  0: INFO: SliderTime:48f
2017-03-28 15:03:46:  0: INFO: CurrentTime:0f
2017-03-28 15:03:46:  0: INFO: DU.CurrentFrame:48
2017-03-28 15:03:46:  0: INFO: Camera PhysCamera001 Transform without At Time context is (matrix3 [-0.125329,0.365184,-0.92246] [-0.992115,-0.0461321,0.11653] [0,0.929791,0.368087] [1.90735e-05,21.4642,-353.062])
2017-03-28 15:03:46:  0: INFO: Camera PhysCamera001 Transform At Time 48 is (matrix3 [-0.125329,0.365184,-0.92246] [-0.992115,-0.0461321,0.11653] [0,0.929791,0.368087] [1.90735e-05,21.4642,-353.062])
2017-03-28 15:03:46:  0: INFO: campos:[-333.524,42.1325,110]
2017-03-28 15:03:46:  0: INFO: target_pos:[-57.8531,7.30834,0]
2017-03-28 15:03:46:  0: INFO: global_ray:(ray [-333.524,42.1325,110] [0.92246,-0.11653,-0.368087])
2017-03-28 15:03:46:  0: INFO: camUp:[0.365184,-0.0461321,0.929792]
2017-03-28 15:03:46:  0: INFO: camRight:[-0.125329,-0.992115,0]
2017-03-28 15:03:46:  0: INFO: Finished MAXScript Job in 0.521 sec.

2017-03-28 15:03:51:  0: Executing plugin command of type 'Render Task'
2017-03-28 15:03:51:  0: INFO: Render Tasks called
2017-03-28 15:03:51:  0: INFO: Executing script: C:\Users\Borislav\AppData\Local\Thinkbox\Deadline9\slave\GATEWAY\jobsData\58dadc1c440cde4938ed7c9b\MAXScriptJob__20038.ms
2017-03-28 15:03:51:  0: INFO: Starting MAXScript Job...
2017-03-28 15:03:51:  0: INFO: SliderTime:49f
2017-03-28 15:03:51:  0: INFO: CurrentTime:0f
2017-03-28 15:03:51:  0: INFO: DU.CurrentFrame:49
2017-03-28 15:03:51:  0: INFO: Camera PhysCamera001 Transform without At Time context is (matrix3 [-0.0627898,0.367376,-0.927951] [-0.998027,-0.0231131,0.0583811] [0,0.929785,0.368102] [2.05711e-05,21.4641,-353.046])
2017-03-28 15:03:51:  0: INFO: Camera PhysCamera001 Transform At Time 49 is (matrix3 [-0.0627898,0.367376,-0.927951] [-0.998027,-0.0231131,0.0583811] [0,0.929785,0.368102] [2.05711e-05,21.4641,-353.046])
2017-03-28 15:03:51:  0: INFO: campos:[-335.494,21.1073,110]
2017-03-28 15:03:51:  0: INFO: target_pos:[-58.195,3.6613,0]
2017-03-28 15:03:51:  0: INFO: global_ray:(ray [-335.494,21.1073,110] [0.927951,-0.0583811,-0.368102])
2017-03-28 15:03:51:  0: INFO: camUp:[0.367376,-0.0231131,0.929785]
2017-03-28 15:03:51:  0: INFO: camRight:[-0.0627898,-0.998027,0]
2017-03-28 15:03:51:  0: INFO: Finished MAXScript Job in 0.519 sec.

2017-03-28 15:03:57:  0: INFO: Starting MAXScript Job...
2017-03-28 15:03:57:  0: INFO: SliderTime:50f
2017-03-28 15:03:57:  0: INFO: CurrentTime:0f
2017-03-28 15:03:57:  0: INFO: DU.CurrentFrame:50
2017-03-28 15:03:57:  0: INFO: Camera PhysCamera001 Transform without At Time context is (matrix3 [1.6362e-07,0.368105,-0.929784] [-1,0,-1.52132e-07] [0,0.929784,0.368105] [2.08059e-05,21.464,-353.043])
2017-03-28 15:03:57:  0: INFO: Camera PhysCamera001 Transform At Time 50 is (matrix3 [1.6362e-07,0.368105,-0.929784] [-1,0,-1.52132e-07] [0,0.929784,0.368105] [2.08059e-05,21.464,-353.043])
2017-03-28 15:03:57:  0: INFO: campos:[-336.155,-3.41958e-05,110]
2017-03-28 15:03:57:  0: INFO: target_pos:[-58.3095,1.12653e-05,0]
2017-03-28 15:03:57:  0: INFO: global_ray:(ray [-336.155,-3.41958e-05,110] [0.929784,1.52132e-07,-0.368105])
2017-03-28 15:03:57:  0: INFO: camUp:[0.368105,0,0.929784]
2017-03-28 15:03:57:  0: INFO: camRight:[1.6362e-07,-1,0]
2017-03-28 15:03:57:  0: INFO: Finished MAXScript Job in 0.523 sec.

2017-03-28 15:04:01:  0: INFO: Starting MAXScript Job...
2017-03-28 15:04:01:  0: INFO: SliderTime:51f
2017-03-28 15:04:01:  0: INFO: CurrentTime:0f
2017-03-28 15:04:01:  0: INFO: DU.CurrentFrame:51
2017-03-28 15:04:01:  0: INFO: Camera PhysCamera001 Transform without At Time context is (matrix3 [0.0627903,0.367376,-0.927951] [-0.998027,0.0231132,-0.0583815] [0,0.929785,0.368102] [2.56151e-05,21.4641,-353.046])
2017-03-28 15:04:01:  0: INFO: Camera PhysCamera001 Transform At Time 51 is (matrix3 [0.0627903,0.367376,-0.927951] [-0.998027,0.0231132,-0.0583815] [0,0.929785,0.368102] [2.56151e-05,21.4641,-353.046])
2017-03-28 15:04:01:  0: INFO: campos:[-335.494,-21.1074,110]
2017-03-28 15:04:01:  0: INFO: target_pos:[-58.195,-3.66128,0]
2017-03-28 15:04:01:  0: INFO: global_ray:(ray [-335.494,-21.1074,110] [0.927951,0.0583815,-0.368102])
2017-03-28 15:04:01:  0: INFO: camUp:[0.367376,0.0231132,0.929785]
2017-03-28 15:04:01:  0: INFO: camRight:[0.0627903,-0.998027,0]

2017-03-28 15:04:06:  0: INFO: Starting MAXScript Job...
2017-03-28 15:04:06:  0: INFO: SliderTime:52f
2017-03-28 15:04:06:  0: INFO: CurrentTime:0f
2017-03-28 15:04:06:  0: INFO: DU.CurrentFrame:52
2017-03-28 15:04:06:  0: INFO: Camera PhysCamera001 Transform without At Time context is (matrix3 [0.12533,0.365184,-0.92246] [-0.992115,0.0461321,-0.11653] [0,0.929791,0.368087] [2.67029e-05,21.4642,-353.062])
2017-03-28 15:04:06:  0: INFO: Camera PhysCamera001 Transform At Time 52 is (matrix3 [0.12533,0.365184,-0.92246] [-0.992115,0.0461321,-0.11653] [0,0.929791,0.368087] [2.67029e-05,21.4642,-353.062])
2017-03-28 15:04:06:  0: INFO: campos:[-333.524,-42.1326,110]
2017-03-28 15:04:06:  0: INFO: target_pos:[-57.8531,-7.30831,0]
2017-03-28 15:04:06:  0: INFO: global_ray:(ray [-333.524,-42.1326,110] [0.92246,0.11653,-0.368087])
2017-03-28 15:04:06:  0: INFO: camUp:[0.365184,0.0461322,0.929792]
2017-03-28 15:04:06:  0: INFO: camRight:[0.12533,-0.992115,0]
2017-03-28 15:04:06:  0: INFO: Finished MAXScript Job in 0.516 sec.

Note that my matrix3 Transforms are the inverse of the camera matrix (which is equivalent to the viewport.getTM() value), so their values don’t match your values, but they are correct in their own right.

So as I suggested in my initial reply, you should enclose your script code in an AT TIME context using

at time DeadlineUtil.CurrentFrame (  )

to make sure any value queries inside the code are performed at the correct time, regardless of the controller used.

outstanding reply! thank you so much. first thing tomorrow: i will check if it works!

Now keep in mind that DeadlineUtil is only defined when the script is running on the Slave.
So you should do what the MAXScript Job template suggests, and define the DU struct where calling du.currentFrame will return the SliderTime if running outside of Deadline, and the Deadline’s Task frame if running inside and DeadlineUtil is actually a valid interface.

Simply copy the boilerplate code found in the template, it looks like this in the latest versions of Deadline:

	local du = DeadlineUtil  --this is the interface exposed by the Lightning Plug-in which provides communication between Deadline and 3ds Max
	if du == undefined do  --if the script is not being run on Deadline (for testing purposes),
	(
		struct DeadlineUtilStruct   --define a stand-in struct with the same methods as the Lightning plug-in
		(
			fn SetTitle title = ( format "Title: %\n" title ),
			fn SetProgress percent = (true),
			fn FailRender msg = ( throw msg ),
			fn GetSubmitInfoEntry key = ( undefined ),
			fn GetSubmitInfoEntryElementCount key = ( 0 ),
			fn GetSubmitInfoEntryElement index key = ( undefined ),
			fn GetJobInfoEntry key = ( undefined ),
			fn GetAuxFilename index = ( undefined ),
			fn GetOutputFilename index = ( undefined ),
			fn LogMessage msg = ( format "INFO: %\n" msg ),
			fn WarnMessage msg = ( format "WARNING: %\n" msg ),
			CurrentFrame = ((sliderTime as string) as integer),
			CurrentTask = ( -1 ),
			SceneFileName = ( maxFilePath + maxFileName ),
			SceneFilePath = ( maxFilePath ),
			JobsDataFolder = ( "" ),
			PluginsFolder = ( "" )
		)
		du = DeadlineUtilStruct() --create an instance of the stand-in struct
	)--end if

After you include this code in your script, using du.currentFrame will always work, locally and on Deadline.

Alternatively, you might get away with just using sliderTime, as in

at time sliderTime ( --your code here )
However, I cannot guarantee that sliderTime will always be correct.
I believe that it would not be updated if an actual renderer was being called. So if you have a script function that has to run as a pre-render script while Scanline or V-Ray or some other renderer is being run by Deadline, sliderTime will most likely be wrong.

Thank you so much for your help Bobo! It works now like it should. The only thing i had to do was to put the render function call inside the -at time- scope. Thanks for your awesome help!

Privacy | Site terms | Cookie preferences