RenderToolbox / RenderToolbox4

Matlab toolbox for managing 3D scenes and physically-based rendering.
MIT License
48 stars 7 forks source link

mexximpImport returns empty for some test scenes #44

Closed ghost closed 4 years ago

ghost commented 4 years ago

I've just done a fresh install of RenderToolbox4 on 2 machines (one new MacBook, one older iMac, both running OSX Catalina with Matlab R2020a), following the installation instructions. When I run rtbTestInstallation(); I get 2 scenes succeed and 2 fail (on both machines). I've copied the output from rtbTestInstallation below.

The issue seems to be related to the fact that in mexximpCleanImport, at line 77 mexximpImport returns an empty array (just for 2 of the scenes). rtbMakeReadMultichannelEXR runs fine.

Any thoughts?

Here is the output of rtbTestInstallation()

Checking working folder:
  folder exists: /Users/ering/Documents/MATLAB/render_toolbox
  OK.
Trying to write: /Users/ering/Documents/MATLAB/render_toolbox/test.txt
  OK.
Checking for OpenEXR:
  brew list | grep openexr
  OK.
Checking for Docker:
  docker ps
  OK.

Testing rendering with 4 example scripts.
You should see several figures with rendered images.

MakeSceneFiles started at 18-May-2020 17:34:52.

Using strategy RtbAssimpStrategy

End of file or read limit was reached

MakeSceneFiles started at 18-May-2020 17:34:53.

Using strategy RtbAssimpStrategy

End of file or read limit was reached

MakeSceneFiles started at 18-May-2020 17:34:54.

Using strategy RtbAssimpStrategy

MakeSceneFiles started with isParallel=0 at 18-May-2020 17:34:54.

MakeSceneFiles finished at 18-May-2020 17:34:56 (1.7s elapsed).

Using strategy RtbAssimpStrategy

BatchRender started with isParallel=0 at 18-May-2020 17:34:57.

Starting scene 1 of 3 at 18-May-2020 17:34:57 (0.0s elapsed).

docker run -ti --rm --user="501":"501" --workdir="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps" --volume="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps":"/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps" --volume="/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4":"/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4" rendertoolbox/mitsuba-spectral mitsuba -o "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps/renderings/Mitsuba/materialSphereMatte.exr" "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps/scenes/Mitsuba/materialSphereMatte.xml"
Read "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps/renderings/Mitsuba/materialSphereMatte.exr": width=200 height=160 nSlices=31

Finished scene 1 of 3 at 18-May-2020 17:35:00 (3.0s elapsed).

Starting scene 2 of 3 at 18-May-2020 17:35:00 (3.0s elapsed).

docker run -ti --rm --user="501":"501" --workdir="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps" --volume="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps":"/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps" --volume="/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4":"/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4" rendertoolbox/mitsuba-spectral mitsuba -o "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps/renderings/Mitsuba/materialSphereWard.exr" "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps/scenes/Mitsuba/materialSphereWard.xml"
Read "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps/renderings/Mitsuba/materialSphereWard.exr": width=200 height=160 nSlices=31

Finished scene 2 of 3 at 18-May-2020 17:35:02 (5.1s elapsed).

Starting scene 3 of 3 at 18-May-2020 17:35:02 (5.1s elapsed).

docker run -ti --rm --user="501":"501" --workdir="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps" --volume="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps":"/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps" --volume="/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4":"/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4" rendertoolbox/mitsuba-spectral mitsuba -o "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps/renderings/Mitsuba/materialSphereMetal.exr" "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps/scenes/Mitsuba/materialSphereMetal.xml"
Read "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps/renderings/Mitsuba/materialSphereMetal.exr": width=200 height=160 nSlices=31

Finished scene 3 of 3 at 18-May-2020 17:35:05 (7.8s elapsed).

BatchRender finished at 18-May-2020 17:35:05 (7.8s elapsed).

MakeSceneFiles started at 18-May-2020 17:35:08.

Using strategy RtbAssimpStrategy

MakeSceneFiles started with isParallel=0 at 18-May-2020 17:35:09.

MakeSceneFiles finished at 18-May-2020 17:35:10 (1.5s elapsed).

Using strategy RtbAssimpStrategy

BatchRender started with isParallel=0 at 18-May-2020 17:35:11.

Starting scene 1 of 3 at 18-May-2020 17:35:11 (0.0s elapsed).

docker run -ti --rm --user="501":"501" --workdir="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps" --volume="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps":"/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps" --volume="/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4":"/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4" rendertoolbox/pbrt-v2-spectral pbrt --outfile /Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps/renderings/PBRT/materialSphereMatte.dat /Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps/materialSphereMatte.pbrt
Opening file "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps/renderings/PBRT/materialSphereMatte.dat".
  Reading image h=160 x w=200 x 32 spectral planes.
  Found lens data focalLength=0, fStop=7.147260e-38, fieldOfView=180.
  Read 1024000 pixel elements for image.
  Limiting 32 planes to maxPlanes = 31.
OK.

Finished scene 1 of 3 at 18-May-2020 17:35:16 (4.4s elapsed).

Starting scene 2 of 3 at 18-May-2020 17:35:16 (4.4s elapsed).

docker run -ti --rm --user="501":"501" --workdir="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps" --volume="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps":"/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps" --volume="/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4":"/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4" rendertoolbox/pbrt-v2-spectral pbrt --outfile /Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps/renderings/PBRT/materialSphereWard.dat /Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps/materialSphereWard.pbrt
Opening file "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps/renderings/PBRT/materialSphereWard.dat".
  Reading image h=160 x w=200 x 32 spectral planes.
  Found lens data focalLength=0, fStop=7.744680e-38, fieldOfView=180.
  Read 1024000 pixel elements for image.
  Limiting 32 planes to maxPlanes = 31.
OK.

Finished scene 2 of 3 at 18-May-2020 17:35:20 (8.2s elapsed).

Starting scene 3 of 3 at 18-May-2020 17:35:20 (8.2s elapsed).

docker run -ti --rm --user="501":"501" --workdir="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps" --volume="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps":"/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps" --volume="/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4":"/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4" rendertoolbox/pbrt-v2-spectral pbrt --outfile /Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps/renderings/PBRT/materialSphereMetal.dat /Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps/materialSphereMetal.pbrt
Opening file "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereBumps/renderings/PBRT/materialSphereMetal.dat".
  Reading image h=160 x w=200 x 32 spectral planes.
  Found lens data focalLength=0, fStop=1.614040e-38, fieldOfView=180.
  Read 1024000 pixel elements for image.
  Limiting 32 planes to maxPlanes = 31.
OK.

Finished scene 3 of 3 at 18-May-2020 17:35:23 (11.9s elapsed).

BatchRender finished at 18-May-2020 17:35:23 (11.9s elapsed).

MakeSceneFiles started at 18-May-2020 17:35:26.

Using strategy RtbAssimpStrategy

MakeSceneFiles started with isParallel=0 at 18-May-2020 17:35:27.

MakeSceneFiles finished at 18-May-2020 17:35:28 (1.6s elapsed).

Using strategy RtbAssimpStrategy

BatchRender started with isParallel=0 at 18-May-2020 17:35:29.

Starting scene 1 of 3 at 18-May-2020 17:35:29 (0.0s elapsed).

docker run -ti --rm --user="501":"501" --workdir="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled" --volume="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled":"/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled" --volume="/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4":"/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4" rendertoolbox/mitsuba-spectral mitsuba -o "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled/renderings/Mitsuba/materialSphereMatte.exr" "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled/scenes/Mitsuba/materialSphereMatte.xml"
Read "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled/renderings/Mitsuba/materialSphereMatte.exr": width=200 height=160 nSlices=31

Finished scene 1 of 3 at 18-May-2020 17:35:32 (2.4s elapsed).

Starting scene 2 of 3 at 18-May-2020 17:35:32 (2.4s elapsed).

docker run -ti --rm --user="501":"501" --workdir="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled" --volume="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled":"/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled" --volume="/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4":"/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4" rendertoolbox/mitsuba-spectral mitsuba -o "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled/renderings/Mitsuba/materialSphereWard.exr" "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled/scenes/Mitsuba/materialSphereWard.xml"
Read "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled/renderings/Mitsuba/materialSphereWard.exr": width=200 height=160 nSlices=31

Finished scene 2 of 3 at 18-May-2020 17:35:34 (4.1s elapsed).

Starting scene 3 of 3 at 18-May-2020 17:35:34 (4.1s elapsed).

docker run -ti --rm --user="501":"501" --workdir="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled" --volume="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled":"/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled" --volume="/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4":"/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4" rendertoolbox/mitsuba-spectral mitsuba -o "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled/renderings/Mitsuba/materialSphereMetal.exr" "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled/scenes/Mitsuba/materialSphereMetal.xml"
Read "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled/renderings/Mitsuba/materialSphereMetal.exr": width=200 height=160 nSlices=31

Finished scene 3 of 3 at 18-May-2020 17:35:36 (6.3s elapsed).

BatchRender finished at 18-May-2020 17:35:36 (6.3s elapsed).

MakeSceneFiles started at 18-May-2020 17:35:37.

Using strategy RtbAssimpStrategy

MakeSceneFiles started with isParallel=0 at 18-May-2020 17:35:37.

MakeSceneFiles finished at 18-May-2020 17:35:39 (1.5s elapsed).

Using strategy RtbAssimpStrategy

BatchRender started with isParallel=0 at 18-May-2020 17:35:40.

Starting scene 1 of 3 at 18-May-2020 17:35:40 (0.0s elapsed).

docker run -ti --rm --user="501":"501" --workdir="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled" --volume="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled":"/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled" --volume="/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4":"/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4" rendertoolbox/pbrt-v2-spectral pbrt --outfile /Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled/renderings/PBRT/materialSphereMatte.dat /Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled/materialSphereMatte.pbrt
Opening file "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled/renderings/PBRT/materialSphereMatte.dat".
  Reading image h=160 x w=200 x 32 spectral planes.
  Found lens data focalLength=0, fStop=1.401300e-45, fieldOfView=NaN.
  Read 1024000 pixel elements for image.
  Limiting 32 planes to maxPlanes = 31.
OK.

Finished scene 1 of 3 at 18-May-2020 17:35:44 (4.5s elapsed).

Starting scene 2 of 3 at 18-May-2020 17:35:44 (4.5s elapsed).

docker run -ti --rm --user="501":"501" --workdir="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled" --volume="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled":"/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled" --volume="/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4":"/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4" rendertoolbox/pbrt-v2-spectral pbrt --outfile /Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled/renderings/PBRT/materialSphereWard.dat /Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled/materialSphereWard.pbrt
Opening file "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled/renderings/PBRT/materialSphereWard.dat".
  Reading image h=160 x w=200 x 32 spectral planes.
  Found lens data focalLength=4.839710e-01, fStop=5.023020e-01, fieldOfView=7.347700e+01.
  Read 1024000 pixel elements for image.
  Limiting 32 planes to maxPlanes = 31.
OK.

Finished scene 2 of 3 at 18-May-2020 17:35:48 (8.1s elapsed).

Starting scene 3 of 3 at 18-May-2020 17:35:48 (8.1s elapsed).

docker run -ti --rm --user="501":"501" --workdir="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled" --volume="/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled":"/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled" --volume="/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4":"/Users/ering/Documents/MATLAB/toolboxes/RenderToolbox4" rendertoolbox/pbrt-v2-spectral pbrt --outfile /Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled/renderings/PBRT/materialSphereMetal.dat /Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled/materialSphereMetal.pbrt
Opening file "/Users/ering/Documents/MATLAB/render_toolbox/rtbMakeMaterialSphereRemodeled/renderings/PBRT/materialSphereMetal.dat".
  Reading image h=160 x w=200 x 32 spectral planes.
  Found lens data focalLength=0, fStop=1.827620e-37, fieldOfView=180.
  Read 1024000 pixel elements for image.
  Limiting 32 planes to maxPlanes = 31.
OK.

Finished scene 3 of 3 at 18-May-2020 17:35:52 (11.9s elapsed).

BatchRender finished at 18-May-2020 17:35:52 (11.9s elapsed).

2 scenes succeeded.

3 rtbMakeMaterialSphereBumps.m
4 rtbMakeMaterialSphereRemodeled.m

2 scenes failed.

----
1 rtbMakeCoordinatesTest.m
  MException with properties:

    identifier: 'MATLAB:nonExistentField'
       message: 'Reference to non-existent field 'children'.'
         cause: {}
         stack: [11×1 struct]
    Correction: []

Reference to non-existent field 'children'.

----
2 rtbMakeDragon.m
  MException with properties:

    identifier: 'MATLAB:nonExistentField'
       message: 'Reference to non-existent field 'children'.'
         cause: {}
         stack: [11×1 struct]
    Correction: []

Reference to non-existent field 'children'.
DavidBrainard commented 4 years ago

This turns out to be an issue with the newest version of assimp - it breaks the read of blender files for some of our blender files. The right fix is to figure out what went wrong in our mex files. The fix we've implemented is to figure out how to install assume version 4.1.0 (the one that works), at least on the Mac. See installation instructions which now include this information. I did this (on the Mac) after recreating the problem above, and it fixed it.