better cameras

Issue #75 resolved
Alessandro Padovani created an issue

tested with daz studio 4.12.0.86, blender 2.82a, plugin commit 3d9209a

This is related to #99 in the old tracker. There we used a 64mm sensor in blender to match the 36mm sensor in daz. This is good but it only works fine with a 16:9 aspect ratio and only if the daz user doesn't change the default 36mm sensor size in daz studio. Below an example with a different aspect ratio that doesn't match.

https://bitbucket.org/Diffeomorphic/import-daz-archive/issues/99/camera-matching

Now I got that the reason behind this is because daz studio and blender use different sensor fits. That is, daz studio uses a vertical fit, while blender in "auto" mode uses a horizontal fit. Indeed 36/9*16 = 64 this is why the 64mm in blender matches the 36mm in daz.

Now luckily the solution is simple since blender allows for a vertical fit. We just need to change the sensor fit from auto to vertical and this way we can use the same sensor size as daz. This is also good because we always match the daz camera even if the user changes the sensor size. Below the new equations and the example with the different aspect ratio matching fine.

blender focal lenght = daz focal lenght
blender sensor fit = vertical
blender sensor height = daz frame width

Comments (7)

  1. Thomas Larsson repo owner

    Should work now. However, the plug-in only changes camera settings, but the aspect ratio of the final render is determined by the render settings in Blender. The plug-in could change that too, but it seems a bit intrusive. There will also be problems in scene with several cameras with different frame width.

    This change was messier than I thought. A while ago the code that handles channels was extracted in a separate class, in order to treat channels in a unified manner for all kinds of assets that use them. However, that code was never really tested for cameras and lights. I think that cameras are ok now, but there are still some problems with light materials.

  2. Alessandro Padovani reporter

    As for commit edea503 it seems to work fine hope doesn't break anything else. In daz multiple cameras may also have their own resolution while in blender this is not allowed since it's more "movie" oriented. So I agree about not importing the rendering resolution.

    Marking as resolved.

  3. Alessandro Padovani reporter

    I didn't test rendering since perspective can be checked in the viewport and I didn't expect the plugin to do more changes. So there are issues.

    For some reason the plugin activates depth of field in the blender camera. Even when it's not activated in daz. Plus the focal distance is wrong since it is expressed in cm in daz and in m in blender. So in the example below 96.54 in daz has to be 0.9654 in blender while the plugin makes it 0.09654 thus with depth of field activated it is everything out of focus.

  4. Thomas Larsson repo owner

    Should be fixed now. I was confused because the focal length is given in mm, I thought the same was true for the focal distance.

  5. Log in to comment