Autodesk / sitoa

Arnold plugin for Softimage
Apache License 2.0
33 stars 16 forks source link

Camera screen_window_min/max is not exported #42

Closed JenusL closed 5 years ago

JenusL commented 5 years ago

Just before SItoA was open sourced I submitted a bug that the Rotoscope Subpixel Zoom wasn't working. This never made it to the trac so no ticket exist for it there. I decided to have a look and found the problem. Inspecting persp_camera with kick shows that the parameters are arrays:

VECTOR2[]     screen_window_min                 -1, -1
VECTOR2[]     screen_window_max                 1, 1

SItoA uses CNodeSetter which doesn't support setting arrays:

CNodeSetter::SetVector2(in_cameraNode, "screen_window_min", screenWindowMinX, screenWindowMinY);
CNodeSetter::SetVector2(in_cameraNode, "screen_window_max", screenWindowMaxX, screenWindowMaxY);

As we all know this fails silently in CNodeSetter::SetCommon.

screen_window_min/max is also used for Orthographic cameras and Optical Center Shift. I haven't tested those yet but looking at the code, they should be broken as well because they also use CNodeSetter.

I will fix this later today.

sjannuz commented 5 years ago

Correct, the common setter wrapper skips arrays. I think I had a good reason for that, but I can't remember anymore ;(

JenusL commented 5 years ago

I think I will add a LogMsg in SetCommon when it fails. That way we will see directly what parameters are arrays. Think that's a good idea? What I don't understand is why this parameter on the camera is an array. @sjannuz Could you check with the core team why this is an array? When could it possibly have more than one value?

JenusL commented 5 years ago

Hmm.. maybe it's just for motion blur / time sample purposes... I see a lot of other parameters are also arrays on cameras.

sjannuz commented 5 years ago

Yes, it's for motion blur, which is supported in the Sony branch. Core decided to adopt the array type to conform and exchange scenes, but motion blur remained unsupported.