diff --git a/testsuite/test_0196/README b/testsuite/test_0196/README new file mode 100644 index 0000000000..52a10ea5d0 --- /dev/null +++ b/testsuite/test_0196/README @@ -0,0 +1,7 @@ +Nested point Instancer with primvars on parent instancer + +see #949 + +author: sebastien.ortega + +PARAMS: {'scene':'test.usda'} \ No newline at end of file diff --git a/testsuite/test_0196/data/test.usda b/testsuite/test_0196/data/test.usda new file mode 100644 index 0000000000..da1dd5cd0b --- /dev/null +++ b/testsuite/test_0196/data/test.usda @@ -0,0 +1,143 @@ +#usda 1.0 +( + endTimeCode = 1 + framesPerSecond = 24 + metersPerUnit = 1 + startTimeCode = 1 + timeCodesPerSecond = 24 + upAxis = "Y" +) + +def ArnoldOptions "options" +{ + int AA_samples = 3 + string camera = "/cameras/camera1" + float frame = 1 + int GI_diffuse_depth = 1 + int GI_specular_depth = 1 + int GI_transmission_depth = 8 + string[] outputs = ["RGBA RGBA /defaultArnoldFilter_gaussian_filter /defaultArnoldDriver_driver_tiff_RGBA"] + int threads = 40 + int xres = 160 + int yres = 120 +} + +def ArnoldGaussianFilter "defaultArnoldFilter_gaussian_filter" +{ +} + +def ArnoldDriverTiff "defaultArnoldDriver_driver_tiff_RGBA" +{ + string color_space = "" + string filename = "testrender.tif" +} +def Xform "cameras" +{ + def Camera "camera1" + { + float2 clippingRange = (1, 1000000) + float focalLength = 0.5 + float focusDistance = 5 + float fStop = 0 + float horizontalAperture = 0.3 + float horizontalApertureOffset = 0 + custom float houdini:guidescale = 1 + custom bool houdini:inviewermenu = 1 + token projection = "perspective" + double shutter:close = 0.25 + double shutter:open = -0.25 + float verticalAperture = 0.11787187 + float verticalApertureOffset = 0 + matrix4d xformOp:transform = ( (0.6663834321403478, 4.440892098500626e-16, 0.7456092283286537, 0), (0.42818029014729025, 0.8186666466607542, -0.3826833688241735, 0), (-0.6104054066751317, 0.5742690324623434, 0.5455458897806226, 0), (-26.06580347464057, 23.229411149472966, 22.473649562523576, 1) ) + uniform token[] xformOpOrder = ["xformOp:transform"] + } +} + +def PointInstancer "masterInstancer" +{ + point3f[] positions = [(0, -5, 0), (0, 5, 0), (0, 10, 0) ] + int[] protoIndices = [0, 0, 0] + rel prototypes = + color3f[] primvars:my_color = [(0.16164958, 0.82059467, 0.0883019), (0.20843911, 0.6383748, 0.9079925), (0.618428, 0.7032281, 0.5686729)] + color3f[] primvars:my_color ( + interpolation = "varying" + ) + + + def PointInstancer "childInstancer" + { + int64[] invisibleIds = [] + quath[] orientations = [(1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0), (1, 0, 0, 0)] + point3f[] positions = [(-5, 0, -5), (-3.8888888, 0, -5), (-2.7777777, 0, -5), (-1.6666665, 0, -5), (-0.55555534, 0, -5), (0.5555558, 0, -5), (1.666667, 0, -5), (2.7777781, 0, -5), (3.8888893, 0, -5), (5, 0, -5), (-5, 0, -3.8888888), (-3.8888888, 0, -3.8888888), (-2.7777777, 0, -3.8888888), (-1.6666665, 0, -3.8888888), (-0.55555534, 0, -3.8888888), (0.5555558, 0, -3.8888888), (1.666667, 0, -3.8888888), (2.7777781, 0, -3.8888888), (3.8888893, 0, -3.8888888), (5, 0, -3.8888888), (-5, 0, -2.7777777), (-3.8888888, 0, -2.7777777), (-2.7777777, 0, -2.7777777), (-1.6666665, 0, -2.7777777), (-0.55555534, 0, -2.7777777), (0.5555558, 0, -2.7777777), (1.666667, 0, -2.7777777), (2.7777781, 0, -2.7777777), (3.8888893, 0, -2.7777777), (5, 0, -2.7777777), (-5, 0, -1.6666665), (-3.8888888, 0, -1.6666665), (-2.7777777, 0, -1.6666665), (-1.6666665, 0, -1.6666665), (-0.55555534, 0, -1.6666665), (0.5555558, 0, -1.6666665), (1.666667, 0, -1.6666665), (2.7777781, 0, -1.6666665), (3.8888893, 0, -1.6666665), (5, 0, -1.6666665), (-5, 0, -0.55555534), (-3.8888888, 0, -0.55555534), (-2.7777777, 0, -0.55555534), (-1.6666665, 0, -0.55555534), (-0.55555534, 0, -0.55555534), (0.5555558, 0, -0.55555534), (1.666667, 0, -0.55555534), (2.7777781, 0, -0.55555534), (3.8888893, 0, -0.55555534), (5, 0, -0.55555534), (-5, 0, 0.5555558), (-3.8888888, 0, 0.5555558), (-2.7777777, 0, 0.5555558), (-1.6666665, 0, 0.5555558), (-0.55555534, 0, 0.5555558), (0.5555558, 0, 0.5555558), (1.666667, 0, 0.5555558), (2.7777781, 0, 0.5555558), (3.8888893, 0, 0.5555558), (5, 0, 0.5555558), (-5, 0, 1.666667), (-3.8888888, 0, 1.666667), (-2.7777777, 0, 1.666667), (-1.6666665, 0, 1.666667), (-0.55555534, 0, 1.666667), (0.5555558, 0, 1.666667), (1.666667, 0, 1.666667), (2.7777781, 0, 1.666667), (3.8888893, 0, 1.666667), (5, 0, 1.666667), (-5, 0, 2.7777781), (-3.8888888, 0, 2.7777781), (-2.7777777, 0, 2.7777781), (-1.6666665, 0, 2.7777781), (-0.55555534, 0, 2.7777781), (0.5555558, 0, 2.7777781), (1.666667, 0, 2.7777781), (2.7777781, 0, 2.7777781), (3.8888893, 0, 2.7777781), (5, 0, 2.7777781), (-5, 0, 3.8888893), (-3.8888888, 0, 3.8888893), (-2.7777777, 0, 3.8888893), (-1.6666665, 0, 3.8888893), (-0.55555534, 0, 3.8888893), (0.5555558, 0, 3.8888893), (1.666667, 0, 3.8888893), (2.7777781, 0, 3.8888893), (3.8888893, 0, 3.8888893), (5, 0, 3.8888893), (-5, 0, 5), (-3.8888888, 0, 5), (-2.7777777, 0, 5), (-1.6666665, 0, 5), (-0.55555534, 0, 5), (0.5555558, 0, 5), (1.666667, 0, 5), (2.7777781, 0, 5), (3.8888893, 0, 5), (5, 0, 5)] + + int[] protoIndices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + rel prototypes = + + def Scope "Prototypes" + { + def Xform "Root" + { + def Cube "cube1" + { + float3[] extent = [(-1, -1, -1), (1, 1, 1)] + rel material:binding = + + double size = 2 + matrix4d xformOp:transform = ( (0.2, 0, 0, 0), (0, 0.2, 0, 0), (0, 0, 0.2, 0), (0, 0, 0, 1) ) + uniform token[] xformOpOrder = ["xformOp:transform"] + } + + def Scope "materials" + { + def Material "arnold_materialbuilder1" + { + token outputs:arnold:surface.connect = + + def Shader "standard_surface1" + { + uniform token info:id = "arnold:standard_surface" + float inputs:base = 1 + color3f inputs:base_color = (0.8, 0.8, 0.8) + color3f inputs:base_color.connect = + token outputs:shader + } + + def Shader "user_data_rgb1" + { + uniform token info:id = "arnold:user_data_rgb" + string inputs:attribute = "my_color" + float inputs:b = 0 + color3f inputs:default = (0.1, 0.1, 0.1) + float inputs:g = 0 + float inputs:r = 0 + color3f inputs:rgb = (0, 0, 0) + color3f outputs:rgb + } + } + } + } + } + } +} + +def Xform "lights" +{ + def DomeLight "domelight1" + { + color3f color = (1, 1, 1) + float diffuse = 1 + bool enableColorTemperature = 0 + float exposure = 0 + rel filters = None + custom float houdini:guidescale = 1 + float intensity = 1 + bool normalize = 0 + rel portals = None + float specular = 1 + asset texture:file = @@ + token texture:format = "automatic" + matrix4d xformOp:transform = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) ) + uniform token[] xformOpOrder = ["xformOp:transform"] + } +} + diff --git a/testsuite/test_0196/ref/reference.log b/testsuite/test_0196/ref/reference.log new file mode 100644 index 0000000000..fdf78dc9d2 --- /dev/null +++ b/testsuite/test_0196/ref/reference.log @@ -0,0 +1,234 @@ +00:00:00 88MB | log started Thu Jan 20 01:18:05 2022 +00:00:00 88MB | Arnold 7.1.0.0 [31f5c728] windows clang-10.0.1 oiio-2.3.2 osl-1.12.0 vdb-7.1.1 clm-2.0.0.235 rlm-14.1.3 optix-6.6.0 2022/01/14 08:40:58 +00:00:00 88MB | running on REMS4QL1726, pid=147208 +00:00:00 88MB | 2 x Intel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz (32 cores, 64 logical) with 65154MB +00:00:00 91MB | NVIDIA driver version 442.50 (Optix 60600) +00:00:00 91MB | GPU 0: Quadro RTX 4000 @ 1545MHz (compute 7.5) with 8192MB (6684MB available) (NVLink:0) +00:00:00 91MB | Windows 10 (version 10.0, build 19044) +00:00:00 91MB | soft limit for open files is set at 2048 +00:00:00 91MB | +00:00:00 109MB | [color_manager_ocio] default ocio.config found in C:\arnold\sdk\latest\bin\..\ocio\configs\arnold\config.ocio +00:00:00 109MB | loading plugins from C:\arnold\arnold-usd\build\windows_x86_64\msvc_opt\usd-0.21.8_arnold-7.1.0.0\procedural ... +00:00:00 113MB | usd_proc.dll: usd uses Arnold 7.1.0.0 +00:00:00 113MB | loaded 1 plugins from 1 lib(s) in 0:00.10 +00:00:00 113MB | loading plugins from C:\arnold\sdk\latest\bin\..\plugins ... +00:00:00 113MB | alembic_proc.dll: alembic uses Arnold 7.1.0.0 +00:00:00 113MB | cryptomatte.dll: cryptomatte uses Arnold 7.1.0.0 +00:00:00 113MB | cryptomatte.dll: cryptomatte_filter uses Arnold 7.1.0.0 +00:00:00 113MB | cryptomatte.dll: cryptomatte_manifest_driver uses Arnold 7.1.0.0 +00:00:00 113MB | skipping already loaded plugin: C:\arnold\sdk\latest\bin\..\plugins\usd_proc.dll ... +00:00:00 113MB | loaded 4 plugins from 2 lib(s) in 0:00.01 +00:00:00 113MB | [color_manager_ocio] default ocio.config found in C:\arnold\sdk\latest\bin\..\ocio\configs\arnold\config.ocio +00:00:00 129MB | [kick] command: C:\arnold\sdk\latest\bin\kick test.usda -dw -r 160 120 -sm lambert -bs 16 -o testrender.tif -set driver_tiff.dither false -nocrashpopup -dp -v 6 +00:00:00 129MB | loading plugins from . ... +00:00:00 129MB | no plugins loaded +00:00:00 161MB WARNING | USD arnold attribute b not recognized in user_data_rgb +00:00:00 161MB WARNING | USD arnold attribute g not recognized in user_data_rgb +00:00:00 161MB WARNING | USD arnold attribute r not recognized in user_data_rgb +00:00:00 161MB WARNING | USD arnold attribute rgb not recognized in user_data_rgb +00:00:00 161MB | [kick] applying 2 attr value overrides +00:00:00 161MB | +00:00:00 161MB | authorizing with default license managers: rlm, network, user ... +00:00:07 170MB WARNING | rendering with watermarks because of failed authorization: +00:00:07 170MB | [rlm] error initializing license system: +00:00:07 170MB | [rlm] * Can't read license data (-102)No such file or directory (errno: 2) +00:00:07 170MB | [clm.v1] license server was not set (51) +00:00:07 170MB | [clm.v2] SERVICE (14): entitlement expired +00:00:07 170MB | environment variables: +00:00:07 170MB | ARNOLD_LICENSE_ORDER = (not set) +00:00:07 170MB | ARNOLD_LICENSE_MANAGER = (not set) +00:00:07 170MB | [rlm] solidangle_LICENSE = (not set) +00:00:07 170MB | [rlm] RLM_LICENSE = (not set) +00:00:07 170MB | [clm] ADSKFLEX_LICENSE_FILE = (not set) +00:00:07 170MB | [clm] LM_LICENSE_FILE = (not set) +00:00:07 170MB | +00:00:07 170MB | [color_manager] using color manager of type "color_manager_ocio" +00:00:07 171MB | [color_manager_ocio] using config file C:\arnold\sdk\latest\bin\..\ocio\configs\arnold\config.ocio +00:00:07 171MB | [color_manager] rendering color space is "ACEScg" +00:00:07 185MB | +00:00:07 185MB | there are 1 light and 4 objects: +00:00:07 185MB | 1 persp_camera +00:00:07 185MB | 1 skydome_light +00:00:07 185MB | 2 utility +00:00:07 185MB | 1 standard_surface +00:00:07 185MB | 1 user_data_rgb +00:00:07 185MB | 1 driver_tiff +00:00:07 185MB | 1 gaussian_filter +00:00:07 185MB | 1 box +00:00:07 185MB | 2 list_aggregate +00:00:07 185MB | 2 instancer +00:00:07 185MB | 2 color_manager_ocio +00:00:07 185MB | +00:00:07 185MB | rendering image at 160 x 120, 3 AA samples +00:00:07 185MB | AA samples max +00:00:07 185MB | AA sample clamp +00:00:07 185MB | diffuse samples 2 / depth 1 +00:00:07 185MB | specular samples 2 / depth 1 +00:00:07 185MB | transmission samples 2 / depth 8 +00:00:07 185MB | volume indirect +00:00:07 185MB | total depth 10 +00:00:07 185MB | bssrdf samples 2 +00:00:07 185MB | transparency depth 10 +00:00:07 185MB | initializing 13 nodes ... +00:00:07 185MB | [instancer] /masterInstancer/childInstancer: creating 100 instances +00:00:07 185MB | [proc] /masterInstancer/childInstancer: loaded 100 nodes (100 objects, 0 shaders) +00:00:07 185MB | [instancer] /masterInstancer: processing per instance parameter 'instance_my_color' +00:00:07 185MB | [instancer] /masterInstancer: creating 3 instances +00:00:07 185MB | [proc] /masterInstancer: loaded 3 nodes (3 objects, 0 shaders) +00:00:07 186MB | creating root object list ... +00:00:07 186MB | the following procedurals were initialized serially: +00:00:07 186MB | instancer (5 instances) +00:00:07 186MB | node initialization done in 0:00.00 (multithreaded) +00:00:07 186MB | updating 117 nodes ... +00:00:07 186MB | /lights/domelight1: skydome_light using 1 sample, 2 volume samples +00:00:07 186MB | scene bounds: (-5.19999981 -5.19999981 -5.19999981) -> (5.19999981 10.1999998 5.19999981) +00:00:07 186MB | node update done in 0:00.00 (multithreaded) +00:00:07 186MB | [aov] parsing 1 output statements ... +00:00:07 186MB | [aov] registered driver: "/defaultArnoldDriver_driver_tiff_RGBA" (driver_tiff) +00:00:07 186MB | [aov] * "RGBA" of type RGBA filtered by "/defaultArnoldFilter_gaussian_filter" (gaussian_filter) +00:00:07 186MB | [aov] done preparing 2 AOVs for 1 output to 1 driver (0 deep AOVs) +00:00:07 190MB | starting 40 bucket workers of size 16x16 ... +00:00:07 191MB | [accel] procedural bvh4_motion done - 0:00.00 - 3 prims, 2 keys +00:00:07 200MB | [accel] procedural bvh4 done - 0:00.00 (wall time) - 100 prims, 1 key +00:00:07 212MB | 0% done - 167 rays/pixel +00:00:07 231MB | 5% done - 166 rays/pixel +00:00:07 233MB | 10% done - 60 rays/pixel +00:00:07 234MB | 15% done - 22 rays/pixel +00:00:07 234MB | 20% done - 15 rays/pixel +00:00:07 236MB | 25% done - 33 rays/pixel +00:00:07 237MB | 30% done - 70 rays/pixel +00:00:07 237MB | 35% done - 23 rays/pixel +00:00:07 238MB | 40% done - 25 rays/pixel +00:00:07 238MB | 45% done - 26 rays/pixel +00:00:07 238MB | 50% done - 22 rays/pixel +00:00:07 239MB | 55% done - 33 rays/pixel +00:00:07 239MB | 60% done - 28 rays/pixel +00:00:07 240MB | 65% done - 12 rays/pixel +00:00:07 241MB | 70% done - 26 rays/pixel +00:00:07 241MB | 75% done - 6 rays/pixel +00:00:07 241MB | 80% done - 8 rays/pixel +00:00:07 241MB | 85% done - 16 rays/pixel +00:00:07 242MB | 90% done - 43 rays/pixel +00:00:07 244MB | 95% done - 29 rays/pixel +00:00:07 244MB | 100% done - 5 rays/pixel +00:00:07 244MB | render done in 0:00.054 +00:00:07 244MB | [driver_tiff] writing file `testrender.tif' +00:00:07 245MB | render done +00:00:07 245MB | +00:00:07 245MB | ----------------------------------------------------------------------------------- +00:00:07 245MB | scene creation time 0:00.23 machine utilization (1.33%) +00:00:07 245MB | unaccounted 0:00.23 +00:00:07 245MB | ----------------------------------------------------------------------------------- +00:00:07 245MB | frame time 0:07.30 machine utilization (0.59%) +00:00:07 245MB | rendering 0:00.05 +00:00:07 245MB | pixel rendering 0:00.05 +00:00:07 245MB | unaccounted 0:07.24 +00:00:07 245MB | ----------------------------------------------------------------------------------- +00:00:07 245MB | top session self-times by category +00:00:07 245MB | surface closure (/masterInstancer/childInstancer/Prototypes/Root/materials/arnold_materialbuilder1/standard_surface1) 0:00.00 (11.64%) +00:00:07 245MB | ray traversal+intersection 0:00.00 (10.27%) +00:00:07 245MB | TraceCameraRay 0:00.00 (10.27%) +00:00:07 245MB | sampleNextBatch 0:00.00 ( 9.58%) +00:00:07 245MB | RenderBucket 0:00.00 ( 6.19%) +00:00:07 245MB | BVH::intersect 0:00.00 ( 6.16%) +00:00:07 245MB | /masterInstancer_instance_1 0:00.00 ( 2.74%) +00:00:07 245MB | /masterInstancer_instance_3 0:00.00 ( 2.06%) +00:00:07 245MB | /masterInstancer_instance_2 0:00.00 ( 1.37%) +00:00:07 245MB | BVH_motion::intersect (/masterInstancer) 0:00.00 ( 6.16%) +00:00:07 245MB | standard_surface (/masterInstancer/childInstancer/Prototypes/Root/materials/arnold_materialbuilder1/standard_surface1) 0:00.00 ( 5.47%) +00:00:07 245MB | AiMalloc 0:00.00 ( 4.80%) +00:00:07 245MB | Plugin loader 0:00.00 ( 4.76%) +00:00:07 245MB | AiSceneLoad 0:00.00 ( 4.12%) +00:00:07 245MB | AiLightsTrace 0:00.00 ( 4.11%) +00:00:07 245MB | accumulateBucketSamples 0:00.00 ( 4.10%) +00:00:07 245MB | thread blocked 0:00.00 ( 3.44%) +00:00:07 245MB | TraceShadow 0:00.00 ( 2.05%) +00:00:07 245MB | ----------------------------------------------------------------------------------- +00:00:07 245MB | top session self-times by node +00:00:07 245MB | standard_surface:/masterInstancer/childInstancer/Prototypes/Root/materials/arnold_materialbuilder1/standard_surface1 0:00.01 (31.50%) +00:00:07 245MB | surface closure 0:00.00 (11.64%) +00:00:07 245MB | ray traversal+intersection 0:00.00 ( 6.17%) +00:00:07 245MB | AiLightsTrace 0:00.00 ( 4.11%) +00:00:07 245MB | TraceShadow 0:00.00 ( 2.05%) +00:00:07 245MB | AiMakeRay 0:00.00 ( 1.37%) +00:00:07 245MB | AiMalloc 0:00.00 ( 0.68%) +00:00:07 245MB | TraceCameraRay 0:00.00 (10.27%) +00:00:07 245MB | sampleNextBatch 0:00.00 ( 9.58%) +00:00:07 245MB | RenderBucket 0:00.00 ( 6.19%) +00:00:07 245MB | instancer:/masterInstancer (BVH_motion::intersect) 0:00.00 ( 6.16%) +00:00:07 245MB | instancer:/masterInstancer_instance_1 0:00.00 ( 4.81%) +00:00:07 245MB | BVH::intersect 0:00.00 ( 2.74%) +00:00:07 245MB | thread blocked 0:00.00 ( 1.38%) +00:00:07 245MB | BVH::build 0:00.00 ( 0.69%) +00:00:07 245MB | Plugin loader 0:00.00 ( 4.76%) +00:00:07 245MB | AiSceneLoad 0:00.00 ( 4.12%) +00:00:07 245MB | AiMalloc 0:00.00 ( 4.12%) +00:00:07 245MB | ray traversal+intersection 0:00.00 ( 4.10%) +00:00:07 245MB | accumulateBucketSamples 0:00.00 ( 4.10%) +00:00:07 245MB | instancer:/masterInstancer_instance_2 0:00.00 ( 2.75%) +00:00:07 245MB | thread blocked 0:00.00 ( 1.38%) +00:00:07 245MB | BVH::intersect 0:00.00 ( 1.37%) +00:00:07 245MB | instancer:/masterInstancer_instance_3 (BVH::intersect) 0:00.00 ( 2.06%) +00:00:07 245MB | ----------------------------------------------------------------------------------- +00:00:07 245MB | peak CPU memory used 245.51MB +00:00:07 245MB | at startup 91.72MB +00:00:07 245MB | plugins 0.07MB +00:00:07 245MB | AOV samples 1.91MB +00:00:07 245MB | output buffers 0.23MB +00:00:07 245MB | framebuffers 0.31MB +00:00:07 245MB | node overhead 0.05MB +00:00:07 245MB | instance overhead 0.06MB +00:00:07 245MB | message passing 0.08MB +00:00:07 245MB | memory pools 51.55MB +00:00:07 245MB | geometry 0.00MB +00:00:07 245MB | accel structs 0.02MB +00:00:07 245MB | strings 24.25MB +00:00:07 245MB | profiler 0.02MB +00:00:07 245MB | unaccounted 75.23MB +00:00:07 245MB | ----------------------------------------------------------------------------------- +00:00:07 245MB | ray counts ( /pixel, /sample) (% total) (avg. hits) (max hits) +00:00:07 245MB | camera 192800 ( 10.04, 1.00) ( 29.33%) ( 0.14) ( 1) +00:00:07 245MB | shadow 241568 ( 12.58, 1.25) ( 36.75%) ( 0.09) ( 1) +00:00:07 245MB | diffuse_reflect 112788 ( 5.87, 0.58) ( 17.16%) ( 0.14) ( 1) +00:00:07 245MB | specular_reflect 110188 ( 5.74, 0.57) ( 16.76%) ( 0.02) ( 1) +00:00:07 245MB | total 657344 ( 34.24, 3.41) (100.00%) ( 0.10) ( 1) +00:00:07 245MB | by ray depth: 0 1 2 +00:00:07 245MB | total 62.9% 36.7% 0.4% +00:00:07 245MB | ----------------------------------------------------------------------------------- +00:00:07 245MB | shader calls ( /pixel, /sample) (% total) +00:00:07 245MB | primary 91668 ( 4.77, 0.48) (100.00%) +00:00:07 245MB | total 91668 ( 4.77, 0.48) (100.00%) +00:00:07 245MB | by ray depth: 0 1 2 +00:00:07 245MB | total 60.2% 38.8% 0.9% +00:00:07 245MB | ----------------------------------------------------------------------------------- +00:00:07 245MB | geometry (% hit ) (instances) ( init mem, final mem) +00:00:07 245MB | lists 1 (100.0%) ( 0) ( 0.00, 0.00) +00:00:07 245MB | procs 2 (100.0%) ( 3) ( 0.00, 0.00) +00:00:07 245MB | simple 1 (100.0%) ( 100) ( 0.00, 0.00) +00:00:07 245MB | ----------------------------------------------------------------------------------- +00:00:07 245MB | geometric elements ( min) ( avg.) ( max) +00:00:07 245MB | objects (procs) 103 ( 3) ( 51.5) ( 100) +00:00:07 245MB | ----------------------------------------------------------------------------------- +00:00:07 245MB | acceleration structures: (% total) +00:00:07 245MB | list 1 ( 33.33%) +00:00:07 245MB | bvh 1 ( 33.33%) +00:00:07 245MB | bvh motion (2 keys) 1 ( 33.33%) +00:00:07 245MB | total 3 (100.00%) +00:00:07 245MB | ----------------------------------------------------------------------------------- +00:00:07 245MB | number of warnings, warning type: +00:00:07 245MB | 4: USD arnold attribute %s not recognized in %s +00:00:07 245MB | 1: rendering with watermarks because of failed authorization: +00:00:07 245MB | ----------------------------------------------------------------------------------- +00:00:07 245MB | performance warnings: +00:00:07 245MB WARNING | Rendering CPU utilization was only 1%. Your render may be bound by a single threaded process or I/O. +00:00:07 245MB | ----------------------------------------------------------------------------------- +00:00:07 245MB | +00:00:07 245MB | releasing resources +00:00:07 180MB | +00:00:07 180MB | releasing resources +00:00:07 160MB | unloading 3 plugins +00:00:07 160MB | closing usd_proc.dll ... +00:00:07 160MB | closing alembic_proc.dll ... +00:00:07 160MB | closing cryptomatte.dll ... +00:00:07 159MB | unloading plugins done +00:00:07 159MB | Arnold shutdown diff --git a/testsuite/test_0196/ref/reference.tif b/testsuite/test_0196/ref/reference.tif new file mode 100644 index 0000000000..1e8431d0a1 Binary files /dev/null and b/testsuite/test_0196/ref/reference.tif differ diff --git a/testsuite/test_0197/README b/testsuite/test_0197/README new file mode 100644 index 0000000000..f712a441ea --- /dev/null +++ b/testsuite/test_0197/README @@ -0,0 +1,6 @@ +Point instancer's child procedurals should ignore the prototype matrix + +see #956 + +author: sebastien ortega + diff --git a/testsuite/test_0197/data/scene.usda b/testsuite/test_0197/data/scene.usda new file mode 100644 index 0000000000..6104e93780 --- /dev/null +++ b/testsuite/test_0197/data/scene.usda @@ -0,0 +1,49 @@ +#usda 1.0 +( + defaultPrim = "point_instance_cubes" +) + +def Xform "point_instance_cubes" ( + kind = "assembly" +) +{ + def PointInstancer "instancer" + { + quath[] orientations = [] + point3f[] positions = [(0, 0, -20), (0, 0, -40)] ( + interpolation = "varying" + ) + int[] protoIndices = [0, 0] + prepend rel prototypes = + + def "Prototypes" + { + def "cube" ( + prepend references = + ) + { + } + } + } +} + +def Xform "cube" ( + kind = "component" +) +{ + double3 xformOp:translate = (0, 10, -20) + uniform token[] xformOpOrder = ["xformOp:translate"] + + def Mesh "cube_GEO" + { + uniform bool doubleSided = 1 + float3[] extent = [(-10, -10, -10), (10, 10, 10)] + int[] faceVertexCounts = [4, 4, 4, 4, 4, 4] + int[] faceVertexIndices = [0, 1, 3, 2, 2, 3, 5, 4, 4, 5, 7, 6, 6, 7, 1, 0, 1, 7, 5, 3, 6, 0, 2, 4] + point3f[] points = [(-10, -10, 10), (10, -10, 10), (-10, 10, 10), (10, 10, 10), (-10, 10, -10), (10, 10, -10), (-10, -10, -10), (10, -10, -10)] + texCoord2f[] primvars:st = [(0.375, 0), (0.625, 0), (0.375, 0.25), (0.625, 0.25), (0.375, 0.5), (0.625, 0.5), (0.375, 0.75), (0.625, 0.75), (0.375, 1), (0.625, 1), (0.875, 0), (0.875, 0.25), (0.125, 0), (0.125, 0.25)] ( + interpolation = "faceVarying" + ) + int[] primvars:st:indices = [0, 1, 3, 2, 2, 3, 5, 4, 4, 5, 7, 6, 6, 7, 9, 8, 1, 10, 11, 3, 12, 0, 2, 13] + } +} \ No newline at end of file diff --git a/testsuite/test_0197/data/test.ass b/testsuite/test_0197/data/test.ass new file mode 100644 index 0000000000..f57a870693 --- /dev/null +++ b/testsuite/test_0197/data/test.ass @@ -0,0 +1,109 @@ +### exported: Thu Jan 20 09:20:46 2022 +### from: Arnold 7.1.0.0 [31f5c728] windows clang-10.0.1 oiio-2.3.2 osl-1.12.0 vdb-7.1.1 clm-2.0.0.235 rlm-14.1.3 optix-6.6.0 2022/01/14 08:40:58 +### host app: MtoA 5.1.0 03362b6d (MTOA-66_b) Maya 2022 +### bounds: -10 -10 -10 10 10 10 +### user: blaines +### render_layer: defaultRenderLayer +### meters_per_unit: 0.010000 + + + +options +{ + AA_samples 3 + outputs "RGBA RGBA defaultArnoldFilter/gaussian_filter defaultArnoldDriver/driver_tiff.RGBA" + xres 160 + yres 120 + pixel_aspect_ratio 1.33333325 + texture_per_file_stats on + texture_automip off + camera "/persp/perspShape" + meters_per_unit 0.00999999978 + frame 1 + GI_diffuse_depth 1 + GI_specular_depth 1 + GI_transmission_depth 8 + declare render_layer constant STRING + render_layer "defaultRenderLayer" +} + +gaussian_filter +{ + name defaultArnoldFilter/gaussian_filter +} + +driver_tiff +{ + name defaultArnoldDriver/driver_tiff.RGBA + filename "testrender.tif" +} + +persp_camera +{ + name /persp/perspShape + matrix + -0.1010563 1.04083409e-17 -0.994880736 0 + -0.0475305021 0.998858094 0.0048279725 0 + 0.993744671 0.0477750786 -0.100940906 0 + 90.1317978 7.73206663 -44.9905052 1 + near_clip 0.100000001 + far_clip 10000 + shutter_start 0 + shutter_end 0 + shutter_type "box" + rolling_shutter "off" + rolling_shutter_duration 0 + motion_start 0 + motion_end 0 + exposure 0 + fov 54.4322243 + uv_remap 0 0 0 1 + declare dcc_name constant STRING + dcc_name "perspShape" +} + +skydome_light +{ + name /aiSkyDomeLight1/aiSkyDomeLightShape1 + exposure 0 + cast_shadows on + cast_volumetric_shadows on + shadow_density 1 + shadow_color 0 0 0 + samples 1 + normalize on + camera 0 + transmission 1 + diffuse 1 + specular 1 + sss 1 + indirect 1 + max_bounces 999 + volume_samples 2 + volume 1 + aov "default" + resolution 1000 + format "latlong" + portal_mode "interior_only" + aov_indirect off + declare dcc_name constant STRING + dcc_name "aiSkyDomeLightShape1" +} + +usd +{ + name /aiStandIn/aiStandInShape + visibility 255 + matrix + 1 0 0 0 + 0 1 0 0 + 0 0 1 0 + 0 0 0 1 + override_nodes off + filename "scene.usda" + object_path "" + frame 0 + declare dcc_name constant STRING + dcc_name "aiStandInShape" +} + diff --git a/testsuite/test_0197/ref/reference.log b/testsuite/test_0197/ref/reference.log new file mode 100644 index 0000000000..c5d9609095 --- /dev/null +++ b/testsuite/test_0197/ref/reference.log @@ -0,0 +1,230 @@ +00:00:00 89MB | log started Thu Jan 20 18:45:38 2022 +00:00:00 89MB | Arnold 7.1.0.0 [31f5c728] windows clang-10.0.1 oiio-2.3.2 osl-1.12.0 vdb-7.1.1 clm-2.0.0.235 rlm-14.1.3 optix-6.6.0 2022/01/14 08:40:58 +00:00:00 89MB | running on REMS4QL1726, pid=25216 +00:00:00 89MB | 2 x Intel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz (32 cores, 64 logical) with 65154MB +00:00:00 92MB | NVIDIA driver version 442.50 (Optix 60600) +00:00:00 92MB | GPU 0: Quadro RTX 4000 @ 1545MHz (compute 7.5) with 8192MB (6929MB available) (NVLink:0) +00:00:00 92MB | Windows 10 (version 10.0, build 19044) +00:00:00 92MB | soft limit for open files is set at 2048 +00:00:00 92MB | +00:00:00 110MB | [color_manager_ocio] default ocio.config found in C:\arnold\sdk\latest\bin\..\ocio\configs\arnold\config.ocio +00:00:00 110MB | loading plugins from C:\arnold\arnold-usd\build\windows_x86_64\msvc_opt\usd-0.21.8_arnold-7.1.0.0\procedural ... +00:00:00 114MB | usd_proc.dll: usd uses Arnold 7.1.0.0 +00:00:00 114MB | loaded 1 plugins from 1 lib(s) in 0:00.09 +00:00:00 114MB | loading plugins from C:\arnold\sdk\latest\bin\..\plugins ... +00:00:00 114MB | alembic_proc.dll: alembic uses Arnold 7.1.0.0 +00:00:00 114MB | cryptomatte.dll: cryptomatte uses Arnold 7.1.0.0 +00:00:00 114MB | cryptomatte.dll: cryptomatte_filter uses Arnold 7.1.0.0 +00:00:00 114MB | cryptomatte.dll: cryptomatte_manifest_driver uses Arnold 7.1.0.0 +00:00:00 114MB | skipping already loaded plugin: C:\arnold\sdk\latest\bin\..\plugins\usd_proc.dll ... +00:00:00 114MB | loaded 4 plugins from 2 lib(s) in 0:00.01 +00:00:00 114MB | [color_manager_ocio] default ocio.config found in C:\arnold\sdk\latest\bin\..\ocio\configs\arnold\config.ocio +00:00:00 130MB | [kick] command: C:\arnold\sdk\latest\bin\kick test.ass -dw -r 160 120 -sm lambert -bs 16 -o testrender.tif -set driver_tiff.dither false -nocrashpopup -dp -v 6 +00:00:00 130MB | loading plugins from . ... +00:00:00 130MB | no plugins loaded +00:00:00 131MB | [metadata] loading metadata file: test.ass +00:00:00 132MB | [ass] loading test.ass ... +00:00:00 132MB | [ass] read 2120 bytes, 6 nodes in 0:00.00 +00:00:00 132MB | [kick] applying 2 attr value overrides +00:00:00 132MB | +00:00:00 132MB | authorizing with default license managers: rlm, network, user ... +00:00:05 139MB WARNING | rendering with watermarks because of failed authorization: +00:00:05 139MB | [rlm] error initializing license system: +00:00:05 139MB | [rlm] * Can't read license data (-102)No such file or directory (errno: 2) +00:00:05 139MB | [clm.v1] license server was not set (51) +00:00:05 139MB | [clm.v2] SERVICE (14): entitlement expired +00:00:05 139MB | environment variables: +00:00:05 139MB | ARNOLD_LICENSE_ORDER = (not set) +00:00:05 139MB | ARNOLD_LICENSE_MANAGER = (not set) +00:00:05 139MB | [rlm] solidangle_LICENSE = (not set) +00:00:05 139MB | [rlm] RLM_LICENSE = (not set) +00:00:05 139MB | [clm] ADSKFLEX_LICENSE_FILE = (not set) +00:00:05 139MB | [clm] LM_LICENSE_FILE = (not set) +00:00:05 139MB | +00:00:05 140MB | [color_manager] using color manager of type "color_manager_ocio" +00:00:05 140MB | [color_manager_ocio] using config file C:\arnold\sdk\latest\bin\..\ocio\configs\arnold\config.ocio +00:00:05 141MB | [color_manager] rendering color space is "ACEScg" +00:00:05 155MB | +00:00:05 155MB | there are 1 light and 2 objects: +00:00:05 155MB | 1 persp_camera +00:00:05 155MB | 1 skydome_light +00:00:05 155MB | 2 utility +00:00:05 155MB | 1 driver_tiff +00:00:05 155MB | 1 gaussian_filter +00:00:05 155MB | 2 list_aggregate +00:00:05 155MB | 2 color_manager_ocio +00:00:05 155MB | 1 usd +00:00:05 155MB | +00:00:05 155MB | rendering image at 160 x 120, 3 AA samples +00:00:05 155MB | AA samples max +00:00:05 155MB | AA sample clamp +00:00:05 155MB | diffuse samples 2 / depth 1 +00:00:05 155MB | specular samples 2 / depth 1 +00:00:05 155MB | transmission samples 2 / depth 8 +00:00:05 155MB | volume indirect +00:00:05 155MB | total depth 10 +00:00:05 155MB | bssrdf samples 2 +00:00:05 155MB | transparency depth 10 +00:00:05 155MB | initializing 9 nodes ... +Warning (secondary thread): in UsdGeom_GetOrientationsAndAngularVelocities at line 338 of S:\tmp\arnold-kook\usd\build\usd-21.08_static_windows_vc-14.2_cxx14\pxr\usd\usdGeom\samplingUtils.cpp -- /point_instance_cubes/instancer -- found [0] orientations, but expected [2] +00:00:05 207MB WARNING | cannot declare indexed VECTOR2 uvlist on /cube/cube_GEO - name already in use +00:00:05 207MB WARNING | cannot declare indexed VECTOR2 uvlist on /point_instance_cubes/instancer/Prototypes/cube/cube_GEO - name already in use +00:00:05 207MB | [proc] /aiStandIn/aiStandInShape: loaded 6 nodes (4 objects, 2 shaders) +00:00:05 207MB | [instancer] /point_instance_cubes/instancer: creating 2 instances +00:00:05 207MB | [proc] /point_instance_cubes/instancer: loaded 2 nodes (2 objects, 0 shaders) +00:00:05 208MB WARNING | cannot declare indexed VECTOR2 uvlist on /point_instance_cubes/instancer/Prototypes/cube/cube_GEO - name already in use +00:00:05 208MB | [proc] /point_instance_cubes/instancer/Prototypes/cube: loaded 3 nodes (1 objects, 2 shaders) +00:00:05 209MB | creating root object list ... +00:00:05 209MB | node initialization done in 0:00.09 (multithreaded) +00:00:05 209MB | updating 21 nodes ... +00:00:05 209MB | /aiSkyDomeLight1/aiSkyDomeLightShape1: skydome_light using 1 sample, 2 volume samples +00:00:05 209MB | scene bounds: (-10 0 -70) -> (10 20 -10) +00:00:05 209MB | node update done in 0:00.00 (multithreaded) +00:00:05 209MB | [aov] parsing 1 output statements ... +00:00:05 209MB | [aov] registered driver: "defaultArnoldDriver/driver_tiff.RGBA" (driver_tiff) +00:00:05 209MB | [aov] * "RGBA" of type RGBA filtered by "defaultArnoldFilter/gaussian_filter" (gaussian_filter) +00:00:05 209MB | [aov] done preparing 2 AOVs for 1 output to 1 driver (0 deep AOVs) +00:00:05 210MB | starting 64 bucket workers of size 16x16 ... +00:00:05 222MB | [accel] procedural bvh4 done - 0:00.00 (wall time) - 4 prims, 1 key +00:00:05 225MB | [accel] procedural bvh4 done - 0:00.00 (wall time) - 2 prims, 1 key +00:00:05 230MB | 0% done - 97 rays/pixel +00:00:05 236MB | [accel] polymesh bvh4 done - 0:00.00 (wall time) - 6 prims, 1 key +00:00:05 236MB | [accel] polymesh bvh4 done - 0:00.00 (wall time) - 6 prims, 1 key +00:00:05 236MB | 5% done - 20 rays/pixel +00:00:05 247MB | 10% done - 38 rays/pixel +00:00:05 251MB | 15% done - 59 rays/pixel +00:00:05 253MB | 20% done - 35 rays/pixel +00:00:05 253MB | 25% done - 17 rays/pixel +00:00:05 255MB | 30% done - 3 rays/pixel +00:00:05 256MB | 35% done - 34 rays/pixel +00:00:05 257MB | 40% done - 3 rays/pixel +00:00:05 257MB | 45% done - 24 rays/pixel +00:00:05 262MB | 50% done - 104 rays/pixel +00:00:05 270MB | 55% done - 185 rays/pixel +00:00:05 271MB | 60% done - 30 rays/pixel +00:00:05 275MB | 65% done - 131 rays/pixel +00:00:05 278MB | 70% done - 102 rays/pixel +00:00:05 280MB | 75% done - 83 rays/pixel +00:00:05 281MB | 80% done - 38 rays/pixel +00:00:05 283MB | 85% done - 106 rays/pixel +00:00:05 283MB | 90% done - 56 rays/pixel +00:00:05 283MB | 95% done - 20 rays/pixel +00:00:05 283MB | 100% done - 21 rays/pixel +00:00:05 283MB | render done in 0:00.036 +00:00:05 283MB | [driver_tiff] writing file `testrender.tif' +00:00:05 285MB | render done +00:00:05 285MB | +00:00:05 285MB | ----------------------------------------------------------------------------------- +00:00:05 285MB | scene creation time 0:00.17 machine utilization (0.14%) +00:00:05 285MB | unaccounted 0:00.16 +00:00:05 285MB | ----------------------------------------------------------------------------------- +00:00:05 285MB | frame time 0:05.11 machine utilization (1.54%) +00:00:05 285MB | node init 0:00.09 +00:00:05 285MB | rendering 0:00.03 +00:00:05 285MB | pixel rendering 0:00.03 +00:00:05 285MB | unaccounted 0:04.98 +00:00:05 285MB | ----------------------------------------------------------------------------------- +00:00:05 285MB | top session self-times by category +00:00:05 285MB | InitializeNodes 0:00.06 (65.01%) +00:00:05 285MB | thread blocked 0:00.00 ( 6.14%) +00:00:05 285MB | TraceCameraRay 0:00.00 ( 4.17%) +00:00:05 285MB | surface closure (_default_arnold_shader) 0:00.00 ( 3.60%) +00:00:05 285MB | sampleNextBatch 0:00.00 ( 2.79%) +00:00:05 285MB | accumulateBucketSamples 0:00.00 ( 2.52%) +00:00:05 285MB | ray traversal+intersection 0:00.00 ( 2.39%) +00:00:05 285MB | ----------------------------------------------------------------------------------- +00:00:05 285MB | top session self-times by node +00:00:05 285MB | InitializeNodes 0:00.06 (65.01%) +00:00:05 285MB | standard_surface:_default_arnold_shader 0:00.00 ( 9.12%) +00:00:05 285MB | surface closure 0:00.00 ( 3.60%) +00:00:05 285MB | ray traversal+intersection 0:00.00 ( 1.92%) +00:00:05 285MB | AiLightsTrace 0:00.00 ( 1.68%) +00:00:05 285MB | TraceShadow 0:00.00 ( 0.72%) +00:00:05 285MB | TraceCameraRay 0:00.00 ( 4.17%) +00:00:05 285MB | polymesh:/cube/cube_GEO 0:00.00 ( 4.14%) +00:00:05 285MB | thread blocked 0:00.00 ( 2.96%) +00:00:05 285MB | polymesh::intersect 0:00.00 ( 0.72%) +00:00:05 285MB | polymesh:/point_instance_cubes/instancer/Prototypes/cube/cube_GEO 0:00.00 ( 4.13%) +00:00:05 285MB | thread blocked 0:00.00 ( 2.96%) +00:00:05 285MB | polymesh::intersect 0:00.00 ( 0.72%) +00:00:05 285MB | sampleNextBatch 0:00.00 ( 2.79%) +00:00:05 285MB | accumulateBucketSamples 0:00.00 ( 2.52%) +00:00:05 285MB | ----------------------------------------------------------------------------------- +00:00:05 285MB | peak CPU memory used 285.31MB +00:00:05 285MB | at startup 92.53MB +00:00:05 285MB | AOV samples 2.96MB +00:00:05 285MB | output buffers 0.33MB +00:00:05 285MB | framebuffers 0.31MB +00:00:05 285MB | node overhead 0.02MB +00:00:05 285MB | instance overhead 0.00MB +00:00:05 285MB | message passing 0.13MB +00:00:05 285MB | memory pools 74.05MB +00:00:05 285MB | geometry 0.00MB +00:00:05 285MB | polymesh 0.00MB +00:00:05 285MB | accel structs 0.02MB +00:00:05 285MB | strings 24.25MB +00:00:05 285MB | profiler 0.02MB +00:00:05 285MB | unaccounted 90.70MB +00:00:05 285MB | ----------------------------------------------------------------------------------- +00:00:05 285MB | ray counts ( /pixel, /sample) (% total) (avg. hits) (max hits) +00:00:05 285MB | camera 192800 ( 10.04, 1.00) ( 17.55%) ( 0.32) ( 1) +00:00:05 285MB | shadow 452954 ( 23.59, 2.35) ( 41.23%) ( 0.00) ( 1) +00:00:05 285MB | diffuse_reflect 218097 ( 11.36, 1.13) ( 19.85%) ( 0.00) ( 1) +00:00:05 285MB | specular_reflect 234855 ( 12.23, 1.22) ( 21.38%) ( 0.00) ( 0) +00:00:05 285MB | total 1098706 ( 57.22, 5.70) (100.00%) ( 0.06) ( 1) +00:00:05 285MB | by ray depth: 0 1 +00:00:05 285MB | total 58.8% 41.2% +00:00:05 285MB | ----------------------------------------------------------------------------------- +00:00:05 285MB | shader calls ( /pixel, /sample) (% total) +00:00:05 285MB | primary 121646 ( 6.34, 0.63) (100.00%) +00:00:05 285MB | total 121646 ( 6.34, 0.63) (100.00%) +00:00:05 285MB | by ray depth: 0 1 +00:00:05 285MB | total 100.0% 0.0% +00:00:05 285MB | ----------------------------------------------------------------------------------- +00:00:05 285MB | geometry (% hit ) (instances) ( init mem, final mem) +00:00:05 285MB | lists 1 (100.0%) ( 0) ( 0.00, 0.00) +00:00:05 285MB | procs 3 (100.0%) ( 2) ( 0.00, 0.00) +00:00:05 285MB | polymeshes 3 ( 66.7%) ( 0) ( 0.00, 0.00) +00:00:05 285MB | ----------------------------------------------------------------------------------- +00:00:05 285MB | geometric elements ( min) ( avg.) ( max) +00:00:05 285MB | objects (procs) 7 ( 1) ( 2.3) ( 4) +00:00:05 285MB | polygons 18 ( 6) ( 6.0) ( 6) +00:00:05 285MB | ----------------------------------------------------------------------------------- +00:00:05 285MB | triangle tessellation ( min) ( avg.) ( max) (/ element) (% total) +00:00:05 285MB | polymeshes 24 ( 12) ( 12.0) ( 12) ( 2.00) (100.00%) +00:00:05 285MB | unique triangles 24 +00:00:05 285MB | visible triangles 36 +00:00:05 285MB | CPU memory use 0.00MB +00:00:05 285MB | vertices 0.00MB +00:00:05 285MB | vertex indices 0.00MB +00:00:05 285MB | packed normals 0.00MB +00:00:05 285MB | normal indices 0.00MB +00:00:05 285MB | uv coords 0.00MB +00:00:05 285MB | uv coords idxs 0.00MB +00:00:05 285MB | uniform indices 0.00MB +00:00:05 285MB | largest polymeshes by triangle count +00:00:05 285MB | 12 tris -- /cube/cube_GEO +00:00:05 285MB | 12 tris -- /point_instance_cubes/instancer/Prototypes/cube/cube_GEO +00:00:05 285MB | ----------------------------------------------------------------------------------- +00:00:05 285MB | acceleration structures: (% total) +00:00:05 285MB | list 2 ( 33.33%) +00:00:05 285MB | bvh 4 ( 66.67%) +00:00:05 285MB | total 6 (100.00%) +00:00:05 285MB | ----------------------------------------------------------------------------------- +00:00:05 285MB | number of warnings, warning type: +00:00:05 285MB | 3: cannot declare %s %s on %s - name already in use +00:00:05 285MB | 1: rendering with watermarks because of failed authorization: +00:00:05 285MB | ----------------------------------------------------------------------------------- +00:00:05 285MB | performance warnings: +00:00:05 285MB WARNING | Rendering CPU utilization was only 2%. Your render may be bound by a single threaded process or I/O. +00:00:05 285MB | ----------------------------------------------------------------------------------- +00:00:05 285MB | +00:00:05 285MB | releasing resources +00:00:05 192MB | +00:00:05 192MB | releasing resources +00:00:05 172MB | unloading 3 plugins +00:00:05 172MB | closing usd_proc.dll ... +00:00:05 172MB | closing alembic_proc.dll ... +00:00:05 172MB | closing cryptomatte.dll ... +00:00:05 172MB | unloading plugins done +00:00:05 172MB | Arnold shutdown diff --git a/testsuite/test_0197/ref/reference.tif b/testsuite/test_0197/ref/reference.tif new file mode 100644 index 0000000000..6e210b6394 Binary files /dev/null and b/testsuite/test_0197/ref/reference.tif differ diff --git a/testsuite/test_0198/README b/testsuite/test_0198/README new file mode 100644 index 0000000000..43d4e9015d --- /dev/null +++ b/testsuite/test_0198/README @@ -0,0 +1,6 @@ +Usd procedural with object path should ignore ancestor primitives + +see #956 + +author: sebastien ortega + diff --git a/testsuite/test_0198/data/scene.usda b/testsuite/test_0198/data/scene.usda new file mode 100644 index 0000000000..c24826e3e3 --- /dev/null +++ b/testsuite/test_0198/data/scene.usda @@ -0,0 +1,48 @@ +#usda 1.0 +( + defaultPrim = "point_instance_cubes" +) + +def Xform "point_instance_cubes" ( + kind = "assembly" +) +{ + double3 xformOp:translate = (0, 0, -20) + uniform token[] xformOpOrder = ["xformOp:translate"] + def PointInstancer "instancer" + { + quath[] orientations = [] + point3f[] positions = [(0, 0, -20), (0, 0, 0)] ( + interpolation = "varying" + ) + int[] protoIndices = [0, 0] + prepend rel prototypes = + + def "Prototypes" + { + def "cube" ( + prepend references = + ) + { + } + } + } +} + +def Xform "cube" ( + kind = "component" +) +{ + def Mesh "cube_GEO" + { + uniform bool doubleSided = 1 + float3[] extent = [(-10, -10, -10), (10, 10, 10)] + int[] faceVertexCounts = [4, 4, 4, 4, 4, 4] + int[] faceVertexIndices = [0, 1, 3, 2, 2, 3, 5, 4, 4, 5, 7, 6, 6, 7, 1, 0, 1, 7, 5, 3, 6, 0, 2, 4] + point3f[] points = [(-10, -10, 10), (10, -10, 10), (-10, 10, 10), (10, 10, 10), (-10, 10, -10), (10, 10, -10), (-10, -10, -10), (10, -10, -10)] + texCoord2f[] primvars:st = [(0.375, 0), (0.625, 0), (0.375, 0.25), (0.625, 0.25), (0.375, 0.5), (0.625, 0.5), (0.375, 0.75), (0.625, 0.75), (0.375, 1), (0.625, 1), (0.875, 0), (0.875, 0.25), (0.125, 0), (0.125, 0.25)] ( + interpolation = "faceVarying" + ) + int[] primvars:st:indices = [0, 1, 3, 2, 2, 3, 5, 4, 4, 5, 7, 6, 6, 7, 9, 8, 1, 10, 11, 3, 12, 0, 2, 13] + } +} \ No newline at end of file diff --git a/testsuite/test_0198/data/test.ass b/testsuite/test_0198/data/test.ass new file mode 100644 index 0000000000..f57a870693 --- /dev/null +++ b/testsuite/test_0198/data/test.ass @@ -0,0 +1,109 @@ +### exported: Thu Jan 20 09:20:46 2022 +### from: Arnold 7.1.0.0 [31f5c728] windows clang-10.0.1 oiio-2.3.2 osl-1.12.0 vdb-7.1.1 clm-2.0.0.235 rlm-14.1.3 optix-6.6.0 2022/01/14 08:40:58 +### host app: MtoA 5.1.0 03362b6d (MTOA-66_b) Maya 2022 +### bounds: -10 -10 -10 10 10 10 +### user: blaines +### render_layer: defaultRenderLayer +### meters_per_unit: 0.010000 + + + +options +{ + AA_samples 3 + outputs "RGBA RGBA defaultArnoldFilter/gaussian_filter defaultArnoldDriver/driver_tiff.RGBA" + xres 160 + yres 120 + pixel_aspect_ratio 1.33333325 + texture_per_file_stats on + texture_automip off + camera "/persp/perspShape" + meters_per_unit 0.00999999978 + frame 1 + GI_diffuse_depth 1 + GI_specular_depth 1 + GI_transmission_depth 8 + declare render_layer constant STRING + render_layer "defaultRenderLayer" +} + +gaussian_filter +{ + name defaultArnoldFilter/gaussian_filter +} + +driver_tiff +{ + name defaultArnoldDriver/driver_tiff.RGBA + filename "testrender.tif" +} + +persp_camera +{ + name /persp/perspShape + matrix + -0.1010563 1.04083409e-17 -0.994880736 0 + -0.0475305021 0.998858094 0.0048279725 0 + 0.993744671 0.0477750786 -0.100940906 0 + 90.1317978 7.73206663 -44.9905052 1 + near_clip 0.100000001 + far_clip 10000 + shutter_start 0 + shutter_end 0 + shutter_type "box" + rolling_shutter "off" + rolling_shutter_duration 0 + motion_start 0 + motion_end 0 + exposure 0 + fov 54.4322243 + uv_remap 0 0 0 1 + declare dcc_name constant STRING + dcc_name "perspShape" +} + +skydome_light +{ + name /aiSkyDomeLight1/aiSkyDomeLightShape1 + exposure 0 + cast_shadows on + cast_volumetric_shadows on + shadow_density 1 + shadow_color 0 0 0 + samples 1 + normalize on + camera 0 + transmission 1 + diffuse 1 + specular 1 + sss 1 + indirect 1 + max_bounces 999 + volume_samples 2 + volume 1 + aov "default" + resolution 1000 + format "latlong" + portal_mode "interior_only" + aov_indirect off + declare dcc_name constant STRING + dcc_name "aiSkyDomeLightShape1" +} + +usd +{ + name /aiStandIn/aiStandInShape + visibility 255 + matrix + 1 0 0 0 + 0 1 0 0 + 0 0 1 0 + 0 0 0 1 + override_nodes off + filename "scene.usda" + object_path "" + frame 0 + declare dcc_name constant STRING + dcc_name "aiStandInShape" +} + diff --git a/testsuite/test_0198/ref/reference.log b/testsuite/test_0198/ref/reference.log new file mode 100644 index 0000000000..51b1ffe43f --- /dev/null +++ b/testsuite/test_0198/ref/reference.log @@ -0,0 +1,227 @@ +00:00:00 88MB | log started Thu Jan 20 18:38:29 2022 +00:00:00 88MB | Arnold 7.1.0.0 [31f5c728] windows clang-10.0.1 oiio-2.3.2 osl-1.12.0 vdb-7.1.1 clm-2.0.0.235 rlm-14.1.3 optix-6.6.0 2022/01/14 08:40:58 +00:00:00 88MB | running on REMS4QL1726, pid=13828 +00:00:00 88MB | 2 x Intel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz (32 cores, 64 logical) with 65154MB +00:00:00 91MB | NVIDIA driver version 442.50 (Optix 60600) +00:00:00 91MB | GPU 0: Quadro RTX 4000 @ 1545MHz (compute 7.5) with 8192MB (6905MB available) (NVLink:0) +00:00:00 91MB | Windows 10 (version 10.0, build 19044) +00:00:00 91MB | soft limit for open files is set at 2048 +00:00:00 91MB | +00:00:00 109MB | [color_manager_ocio] default ocio.config found in C:\arnold\sdk\latest\bin\..\ocio\configs\arnold\config.ocio +00:00:00 109MB | loading plugins from C:\arnold\arnold-usd\build\windows_x86_64\msvc_opt\usd-0.21.8_arnold-7.1.0.0\procedural ... +00:00:00 112MB | usd_proc.dll: usd uses Arnold 7.1.0.0 +00:00:00 112MB | loaded 1 plugins from 1 lib(s) in 0:00.08 +00:00:00 112MB | loading plugins from C:\arnold\sdk\latest\bin\..\plugins ... +00:00:00 112MB | alembic_proc.dll: alembic uses Arnold 7.1.0.0 +00:00:00 112MB | cryptomatte.dll: cryptomatte uses Arnold 7.1.0.0 +00:00:00 112MB | cryptomatte.dll: cryptomatte_filter uses Arnold 7.1.0.0 +00:00:00 112MB | cryptomatte.dll: cryptomatte_manifest_driver uses Arnold 7.1.0.0 +00:00:00 112MB | skipping already loaded plugin: C:\arnold\sdk\latest\bin\..\plugins\usd_proc.dll ... +00:00:00 112MB | loaded 4 plugins from 2 lib(s) in 0:00.01 +00:00:00 112MB | [color_manager_ocio] default ocio.config found in C:\arnold\sdk\latest\bin\..\ocio\configs\arnold\config.ocio +00:00:00 128MB | [kick] command: C:\arnold\sdk\latest\bin\kick test.ass -dw -r 160 120 -sm lambert -bs 16 -o testrender.tif -set driver_tiff.dither false -nocrashpopup -dp -v 6 +00:00:00 128MB | loading plugins from . ... +00:00:00 128MB | no plugins loaded +00:00:00 130MB | [metadata] loading metadata file: test.ass +00:00:00 131MB | [ass] loading test.ass ... +00:00:00 131MB | [ass] read 2347 bytes, 6 nodes in 0:00.00 +00:00:00 131MB | [kick] applying 2 attr value overrides +00:00:00 131MB | +00:00:00 131MB | authorizing with default license managers: rlm, network, user ... +00:00:05 139MB WARNING | rendering with watermarks because of failed authorization: +00:00:05 139MB | [rlm] error initializing license system: +00:00:05 139MB | [rlm] * Can't read license data (-102)No such file or directory (errno: 2) +00:00:05 139MB | [clm.v1] license server was not set (51) +00:00:05 139MB | [clm.v2] SERVICE (14): entitlement expired +00:00:05 139MB | environment variables: +00:00:05 139MB | ARNOLD_LICENSE_ORDER = (not set) +00:00:05 139MB | ARNOLD_LICENSE_MANAGER = (not set) +00:00:05 139MB | [rlm] solidangle_LICENSE = (not set) +00:00:05 139MB | [rlm] RLM_LICENSE = (not set) +00:00:05 139MB | [clm] ADSKFLEX_LICENSE_FILE = (not set) +00:00:05 139MB | [clm] LM_LICENSE_FILE = (not set) +00:00:05 139MB | +00:00:05 139MB | [color_manager] using color manager of type "color_manager_ocio" +00:00:05 140MB | [color_manager_ocio] using config file C:\arnold\sdk\latest\bin\..\ocio\configs\arnold\config.ocio +00:00:05 140MB | [color_manager] rendering color space is "ACEScg" +00:00:05 154MB | +00:00:05 154MB | there are 1 light and 2 objects: +00:00:05 154MB | 1 persp_camera +00:00:05 154MB | 1 skydome_light +00:00:05 154MB | 2 utility +00:00:05 154MB | 1 driver_tiff +00:00:05 154MB | 1 gaussian_filter +00:00:05 154MB | 2 list_aggregate +00:00:05 154MB | 2 color_manager_ocio +00:00:05 154MB | 1 usd +00:00:05 154MB | +00:00:05 154MB | rendering image at 160 x 120, 3 AA samples +00:00:05 154MB | AA samples max +00:00:05 154MB | AA sample clamp +00:00:05 154MB | diffuse samples 2 / depth 1 +00:00:05 154MB | specular samples 2 / depth 1 +00:00:05 154MB | transmission samples 2 / depth 8 +00:00:05 154MB | volume indirect +00:00:05 154MB | total depth 10 +00:00:05 154MB | bssrdf samples 2 +00:00:05 154MB | transparency depth 10 +00:00:05 154MB | initializing 9 nodes ... +Warning (secondary thread): in UsdGeom_GetOrientationsAndAngularVelocities at line 338 of S:\tmp\arnold-kook\usd\build\usd-21.08_static_windows_vc-14.2_cxx14\pxr\usd\usdGeom\samplingUtils.cpp -- /point_instance_cubes/instancer -- found [0] orientations, but expected [2] +00:00:05 207MB WARNING | cannot declare indexed VECTOR2 uvlist on /point_instance_cubes/instancer/Prototypes/cube/cube_GEO - name already in use +00:00:05 207MB WARNING | cannot declare indexed VECTOR2 uvlist on /cube/cube_GEO - name already in use +00:00:05 207MB | [proc] /aiStandIn/aiStandInShape: loaded 6 nodes (4 objects, 2 shaders) +00:00:05 207MB | [instancer] /point_instance_cubes/instancer: creating 2 instances +00:00:05 207MB | [proc] /point_instance_cubes/instancer: loaded 2 nodes (2 objects, 0 shaders) +00:00:05 208MB WARNING | cannot declare indexed VECTOR2 uvlist on /point_instance_cubes/instancer/Prototypes/cube/cube_GEO - name already in use +00:00:05 208MB | [proc] /point_instance_cubes/instancer/Prototypes/cube: loaded 3 nodes (1 objects, 2 shaders) +00:00:05 208MB | creating root object list ... +00:00:05 208MB | node initialization done in 0:00.08 (multithreaded) +00:00:05 208MB | updating 21 nodes ... +00:00:05 208MB | /aiSkyDomeLight1/aiSkyDomeLightShape1: skydome_light using 1 sample, 2 volume samples +00:00:05 209MB | scene bounds: (-10 -10 -50) -> (10 10 10) +00:00:05 209MB | node update done in 0:00.00 (multithreaded) +00:00:05 209MB | [aov] parsing 1 output statements ... +00:00:05 209MB | [aov] registered driver: "defaultArnoldDriver/driver_tiff.RGBA" (driver_tiff) +00:00:05 209MB | [aov] * "RGBA" of type RGBA filtered by "defaultArnoldFilter/gaussian_filter" (gaussian_filter) +00:00:05 209MB | [aov] done preparing 2 AOVs for 1 output to 1 driver (0 deep AOVs) +00:00:05 209MB | starting 64 bucket workers of size 16x16 ... +00:00:05 213MB | [accel] procedural bvh4 done - 0:00.00 (wall time) - 4 prims, 1 key +00:00:05 221MB | [accel] procedural bvh4 done - 0:00.00 (wall time) - 2 prims, 1 key +00:00:05 239MB | 0% done - 157 rays/pixel +00:00:05 242MB | [accel] polymesh bvh4 done - 0:00.00 (wall time) - 6 prims, 1 key +00:00:05 247MB | 5% done - 53 rays/pixel +00:00:05 247MB | [accel] polymesh bvh4 done - 0:00.00 (wall time) - 6 prims, 1 key +00:00:05 250MB | 10% done - 54 rays/pixel +00:00:05 251MB | 15% done - 38 rays/pixel +00:00:05 253MB | 20% done - 17 rays/pixel +00:00:05 254MB | 25% done - 17 rays/pixel +00:00:05 254MB | 30% done - 20 rays/pixel +00:00:05 256MB | 35% done - 3 rays/pixel +00:00:05 257MB | 40% done - 59 rays/pixel +00:00:05 259MB | 45% done - 28 rays/pixel +00:00:05 260MB | 50% done - 24 rays/pixel +00:00:05 261MB | 55% done - 21 rays/pixel +00:00:05 262MB | 60% done - 31 rays/pixel +00:00:05 269MB | 65% done - 124 rays/pixel +00:00:05 274MB | 70% done - 142 rays/pixel +00:00:05 277MB | 75% done - 125 rays/pixel +00:00:05 279MB | 80% done - 62 rays/pixel +00:00:05 279MB | 85% done - 29 rays/pixel +00:00:05 281MB | 90% done - 108 rays/pixel +00:00:05 281MB | 95% done - 29 rays/pixel +00:00:05 282MB | 100% done - 6 rays/pixel +00:00:05 282MB | render done in 0:00.032 +00:00:05 282MB | [driver_tiff] writing file `testrender.tif' +00:00:05 283MB | render done +00:00:05 283MB | +00:00:05 283MB | ----------------------------------------------------------------------------------- +00:00:05 283MB | scene creation time 0:00.17 machine utilization (0.28%) +00:00:05 283MB | unaccounted 0:00.17 +00:00:05 283MB | ----------------------------------------------------------------------------------- +00:00:05 283MB | frame time 0:05.12 machine utilization (1.28%) +00:00:05 283MB | node init 0:00.08 +00:00:05 283MB | rendering 0:00.03 +00:00:05 283MB | pixel rendering 0:00.03 +00:00:05 283MB | unaccounted 0:05.00 +00:00:05 283MB | ----------------------------------------------------------------------------------- +00:00:05 283MB | top session self-times by category +00:00:05 283MB | InitializeNodes 0:00.06 (63.94%) +00:00:05 283MB | AiMalloc 0:00.00 ( 6.23%) +00:00:05 283MB | RenderBucket 0:00.00 ( 4.18%) +00:00:05 283MB | TraceCameraRay 0:00.00 ( 3.94%) +00:00:05 283MB | surface closure (_default_arnold_shader) 0:00.00 ( 3.93%) +00:00:05 283MB | accumulateBucketSamples 0:00.00 ( 2.71%) +00:00:05 283MB | ----------------------------------------------------------------------------------- +00:00:05 283MB | top session self-times by node +00:00:05 283MB | InitializeNodes 0:00.06 (63.94%) +00:00:05 283MB | standard_surface:_default_arnold_shader 0:00.01 (14.51%) +00:00:05 283MB | AiMalloc 0:00.00 ( 4.68%) +00:00:05 283MB | surface closure 0:00.00 ( 3.93%) +00:00:05 283MB | AiLightsTrace 0:00.00 ( 1.72%) +00:00:05 283MB | ray traversal+intersection 0:00.00 ( 1.72%) +00:00:05 283MB | TraceShadow 0:00.00 ( 0.74%) +00:00:05 283MB | RenderBucket 0:00.00 ( 4.18%) +00:00:05 283MB | TraceCameraRay 0:00.00 ( 3.94%) +00:00:05 283MB | accumulateBucketSamples 0:00.00 ( 2.71%) +00:00:05 283MB | usd:/aiStandIn/aiStandInShape 0:00.00 ( 2.07%) +00:00:05 283MB | node_init 0:00.00 ( 1.08%) +00:00:05 283MB | BVH::intersect 0:00.00 ( 0.98%) +00:00:05 283MB | ----------------------------------------------------------------------------------- +00:00:05 283MB | peak CPU memory used 283.52MB +00:00:05 283MB | at startup 91.50MB +00:00:05 283MB | AOV samples 3.02MB +00:00:05 283MB | output buffers 0.33MB +00:00:05 283MB | framebuffers 0.31MB +00:00:05 283MB | node overhead 0.02MB +00:00:05 283MB | instance overhead 0.00MB +00:00:05 283MB | message passing 0.13MB +00:00:05 283MB | memory pools 74.55MB +00:00:05 283MB | geometry 0.00MB +00:00:05 283MB | polymesh 0.00MB +00:00:05 283MB | accel structs 0.02MB +00:00:05 283MB | strings 24.25MB +00:00:05 283MB | profiler 0.02MB +00:00:05 283MB | unaccounted 89.38MB +00:00:05 283MB | ----------------------------------------------------------------------------------- +00:00:05 283MB | ray counts ( /pixel, /sample) (% total) (avg. hits) (max hits) +00:00:05 283MB | camera 192800 ( 10.04, 1.00) ( 19.61%) ( 0.27) ( 1) +00:00:05 283MB | shadow 395127 ( 20.58, 2.05) ( 40.19%) ( 0.00) ( 0) +00:00:05 283MB | diffuse_reflect 190300 ( 9.91, 0.99) ( 19.36%) ( 0.00) ( 0) +00:00:05 283MB | specular_reflect 204827 ( 10.67, 1.06) ( 20.84%) ( 0.00) ( 0) +00:00:05 283MB | total 983054 ( 51.20, 5.10) (100.00%) ( 0.05) ( 1) +00:00:05 283MB | by ray depth: 0 1 +00:00:05 283MB | total 59.8% 40.2% +00:00:05 283MB | ----------------------------------------------------------------------------------- +00:00:05 283MB | shader calls ( /pixel, /sample) (% total) +00:00:05 283MB | primary 105942 ( 5.52, 0.55) (100.00%) +00:00:05 283MB | total 105942 ( 5.52, 0.55) (100.00%) +00:00:05 283MB | by ray depth: 0 1 +00:00:05 283MB | total 100.0% 0.0% +00:00:05 283MB | ----------------------------------------------------------------------------------- +00:00:05 283MB | geometry (% hit ) (instances) ( init mem, final mem) +00:00:05 283MB | lists 1 (100.0%) ( 0) ( 0.00, 0.00) +00:00:05 283MB | procs 3 (100.0%) ( 2) ( 0.00, 0.00) +00:00:05 283MB | polymeshes 3 ( 66.7%) ( 0) ( 0.00, 0.00) +00:00:05 283MB | ----------------------------------------------------------------------------------- +00:00:05 283MB | geometric elements ( min) ( avg.) ( max) +00:00:05 283MB | objects (procs) 7 ( 1) ( 2.3) ( 4) +00:00:05 283MB | polygons 18 ( 6) ( 6.0) ( 6) +00:00:05 283MB | ----------------------------------------------------------------------------------- +00:00:05 283MB | triangle tessellation ( min) ( avg.) ( max) (/ element) (% total) +00:00:05 283MB | polymeshes 24 ( 12) ( 12.0) ( 12) ( 2.00) (100.00%) +00:00:05 283MB | unique triangles 24 +00:00:05 283MB | visible triangles 36 +00:00:05 283MB | CPU memory use 0.00MB +00:00:05 283MB | vertices 0.00MB +00:00:05 283MB | vertex indices 0.00MB +00:00:05 283MB | packed normals 0.00MB +00:00:05 283MB | normal indices 0.00MB +00:00:05 283MB | uv coords 0.00MB +00:00:05 283MB | uv coords idxs 0.00MB +00:00:05 283MB | uniform indices 0.00MB +00:00:05 283MB | largest polymeshes by triangle count +00:00:05 283MB | 12 tris -- /cube/cube_GEO +00:00:05 283MB | 12 tris -- /point_instance_cubes/instancer/Prototypes/cube/cube_GEO +00:00:05 283MB | ----------------------------------------------------------------------------------- +00:00:05 283MB | acceleration structures: (% total) +00:00:05 283MB | list 2 ( 33.33%) +00:00:05 283MB | bvh 4 ( 66.67%) +00:00:05 283MB | total 6 (100.00%) +00:00:05 283MB | ----------------------------------------------------------------------------------- +00:00:05 283MB | number of warnings, warning type: +00:00:05 283MB | 3: cannot declare %s %s on %s - name already in use +00:00:05 283MB | 1: rendering with watermarks because of failed authorization: +00:00:05 283MB | ----------------------------------------------------------------------------------- +00:00:05 283MB | performance warnings: +00:00:05 283MB WARNING | Rendering CPU utilization was only 1%. Your render may be bound by a single threaded process or I/O. +00:00:05 283MB | ----------------------------------------------------------------------------------- +00:00:05 283MB | +00:00:05 283MB | releasing resources +00:00:05 192MB | +00:00:05 192MB | releasing resources +00:00:05 171MB | unloading 3 plugins +00:00:05 171MB | closing usd_proc.dll ... +00:00:05 171MB | closing alembic_proc.dll ... +00:00:05 171MB | closing cryptomatte.dll ... +00:00:05 171MB | unloading plugins done +00:00:05 171MB | Arnold shutdown diff --git a/testsuite/test_0198/ref/reference.tif b/testsuite/test_0198/ref/reference.tif new file mode 100644 index 0000000000..a6d641a544 Binary files /dev/null and b/testsuite/test_0198/ref/reference.tif differ diff --git a/translator/reader/prim_reader.cpp b/translator/reader/prim_reader.cpp index 4c1b30d926..a988470f09 100644 --- a/translator/reader/prim_reader.cpp +++ b/translator/reader/prim_reader.cpp @@ -495,6 +495,17 @@ void UsdArnoldPrimReader::ReadPrimvars( continue; TfToken interpolation = primvar.GetInterpolation(); + // Find the declaration based on the interpolation type + std::string declaration = + (interpolation == UsdGeomTokens->uniform) + ? "uniform" + : (interpolation == UsdGeomTokens->varying) + ? "varying" + : (interpolation == UsdGeomTokens->vertex) + ? "varying" + : (interpolation == UsdGeomTokens->faceVarying) ? "indexed" : "constant"; + + // We want to ignore the constant primvars returned by primvarsAPI.GetPrimvars(), // because they'll also appear in the second part of the list, coming from inheritedPrimvars if (i < primvarsSize && interpolation == UsdGeomTokens->constant) @@ -510,26 +521,17 @@ void UsdArnoldPrimReader::ReadPrimvars( // A remapper can eventually remap the interpolation (e.g. point instancer) if (primvarsRemapper) - primvarsRemapper->RemapPrimvar(name, interpolation); + primvarsRemapper->RemapPrimvar(name, declaration); SdfValueTypeName typeName = primvar.GetTypeName(); std::string arnoldIndexName = name.GetText() + std::string("idxs"); int primvarType = AI_TYPE_NONE; - // Find the declaration based on the interpolation type - std::string declaration = - (interpolation == UsdGeomTokens->uniform) - ? "uniform " - : (interpolation == UsdGeomTokens->varying) - ? "varying " - : (interpolation == UsdGeomTokens->vertex) - ? "varying " - : (interpolation == UsdGeomTokens->faceVarying) ? "indexed " : "constant "; // In Arnold, points with user-data per-point are considered as being "uniform" (one value per face). // We must ensure that we're not setting varying user data on the points or this will fail (see #228) - if (isPoints && declaration == "varying ") - declaration = "uniform "; + if (isPoints && declaration == "varying") + declaration = "uniform"; if (typeName == SdfValueTypeNames->Float2 || typeName == SdfValueTypeNames->Float2Array || typeName == SdfValueTypeNames->TexCoord2f || typeName == SdfValueTypeNames->TexCoord2fArray) { @@ -591,7 +593,7 @@ void UsdArnoldPrimReader::ReadPrimvars( if (primvarType == AI_TYPE_NONE) continue; - + declaration += " "; declaration += AiParamGetTypeName(primvarType); // Declare the user data diff --git a/translator/reader/read_geometry.cpp b/translator/reader/read_geometry.cpp index ffb78b3060..d796567b37 100644 --- a/translator/reader/read_geometry.cpp +++ b/translator/reader/read_geometry.cpp @@ -304,7 +304,7 @@ class CurvesPrimvarsRemapper : public PrimvarsRemapper virtual ~CurvesPrimvarsRemapper() {} bool RemapValues(const UsdGeomPrimvar &primvar, const TfToken &interpolation, VtValue &value) override; - void RemapPrimvar(TfToken &name, TfToken &interpolation) override; + void RemapPrimvar(TfToken &name, std::string &interpolation) override; private: bool _remapValues; ArnoldUsdCurvesData &_curvesData; @@ -323,7 +323,7 @@ bool CurvesPrimvarsRemapper::RemapValues(const UsdGeomPrimvar &primvar, const Tf GfVec3d, GfVec4f, GfVec4d, int, unsigned int, unsigned char, bool>(value); } -void CurvesPrimvarsRemapper::RemapPrimvar(TfToken &name, TfToken &interpolation) +void CurvesPrimvarsRemapper::RemapPrimvar(TfToken &name, std::string &interpolation) { // primvars:st should be converted to curves "uvs" #957 if (name == str::t_st) @@ -723,15 +723,9 @@ class InstancerPrimvarsRemapper : public PrimvarsRemapper public: InstancerPrimvarsRemapper() {} virtual ~InstancerPrimvarsRemapper() {} - bool RemapValues(const UsdGeomPrimvar &primvar, const TfToken &interpolation, - VtValue &value) override; - - void RemapPrimvar(TfToken &name, TfToken &interpolation) override; - void SetIndex(unsigned int index) {m_index = index;} + void RemapPrimvar(TfToken &name, std::string &interpolation) override; private: - TfToken m_interpolation; - unsigned int m_index = 0; }; template @@ -751,20 +745,13 @@ inline bool CopyArrayElement(VtValue &value, unsigned int index) { return CopyArrayElement(value, index) || CopyArrayElement(value, index); } -bool InstancerPrimvarsRemapper::RemapValues(const UsdGeomPrimvar &primvar, const TfToken &interpolation, - VtValue &value) -{ - // copy the value from a given array index to the output constant value - return CopyArrayElement(value, m_index); -} -void InstancerPrimvarsRemapper::RemapPrimvar(TfToken &name, TfToken &interpolation) + +void InstancerPrimvarsRemapper::RemapPrimvar(TfToken &name, std::string &interpolation) { - // Store the original interpolation, but force it to be constant - // on the ginstance nodes - m_interpolation = interpolation; - interpolation = TfToken("constant"); + std::string instancerName = "instance_"; + instancerName += name.GetText(); + name = TfToken(instancerName.c_str()); + interpolation = "constant ARRAY"; } /** @@ -789,9 +776,6 @@ void UsdArnoldReadPointInstancer::Read(const UsdPrim &prim, UsdArnoldReaderConte const TimeSettings &time = context.GetTimeSettings(); float frame = time.frame; - // If the USD primitive is hidden, we need to hide each of the nodes that are being created here - bool isVisible = context.GetPrimVisibility(prim, frame); - UsdGeomPointInstancer pointInstancer(prim); // this will be used later to contruct the name of the instances @@ -802,8 +786,7 @@ void UsdArnoldReadPointInstancer::Read(const UsdPrim &prim, UsdArnoldReaderConte pointInstancer.GetPrototypesRel().GetTargets(&protoPaths); // get the visibility of each prototype, so that we can apply its visibility to all of its instances - // If this point instancer primitive is hidden itself, then we want to hide everything - std::vector protoVisibility(protoPaths.size(), isVisible ? AI_RAY_ALL : 0); + std::vector protoVisibility(protoPaths.size(), AI_RAY_ALL); // get the usdFilePath from the reader, we will use this path later to apply when we create new usd procs std::string filename = reader->GetFilename(); @@ -819,6 +802,20 @@ void UsdArnoldReadPointInstancer::Read(const UsdPrim &prim, UsdArnoldReaderConte // the size of the protoIndices array gives us the amount of instances size_t numInstances = protoIndices.size(); + if (numInstances == 0 || protoPaths.empty()) + return; + + AtNode *node = context.CreateArnoldNode("instancer", prim.GetPath().GetText()); + + // initialize the nodes array to the proper size + std::vector nodesVec(protoPaths.size(), nullptr); + std::vector nodesRefs(protoPaths.size()); + + // We want to keep track of how which prototypes rely on a child usd procedural, + // as they need to treat instance matrices differently + std::vector nodesChildProcs(protoPaths.size(), false); + int numChildProc = 0; + for (size_t i = 0; i < protoPaths.size(); ++i) { const SdfPath &protoPath = protoPaths.at(i); // get the proto primitive, and ensure it's properly exported to arnold, @@ -836,12 +833,11 @@ void UsdArnoldReadPointInstancer::Read(const UsdPrim &prim, UsdArnoldReaderConte } // I need to create a new proto node in case this primitive isn't directly translated as an Arnold AtNode. - // As of now, this only happens for Xform and Point Instancer nodes, so I'm checking for these types, + // As of now, this only happens for Xform or non-typed prims, so I'm checking for these types, // and also I'm verifying if the registry is able to read nodes of this type. // In the future we might want to make this more robust, we could eventually add a function in // the primReader telling us if this primitive will generate an arnold node with the same name or not. - bool createProto = - (objType == "Xform" || objType == "PointInstancer" || objType == "" || + bool createProto = (objType == "Xform" || objType.empty() || (reader->GetRegistry()->GetPrimReader(objType) == nullptr)); if (createProto) { @@ -852,23 +848,39 @@ void UsdArnoldReadPointInstancer::Read(const UsdPrim &prim, UsdArnoldReaderConte if (parentProc) childUsdEntry = AiNodeEntryGetName(AiNodeGetNodeEntry(parentProc)); - AtNode *node = context.CreateArnoldNode(childUsdEntry.c_str(), protoPath.GetText()); + AtNode *proto = context.CreateArnoldNode(childUsdEntry.c_str(), protoPath.GetText()); - AiNodeSetStr(node, str::filename, filename.c_str()); - AiNodeSetInt(node, str::cache_id, cacheId); - AiNodeSetStr(node, str::object_path, protoPath.GetText()); - AiNodeSetFlt(node, str::frame, frame); // give it the desired frame - AiNodeSetFlt(node, str::motion_start, time.motionStart); - AiNodeSetFlt(node, str::motion_end, time.motionEnd); + AiNodeSetStr(proto, str::filename, filename.c_str()); + AiNodeSetInt(proto, str::cache_id, cacheId); + AiNodeSetStr(proto, str::object_path, protoPath.GetText()); + AiNodeSetFlt(proto, str::frame, frame); // give it the desired frame + AiNodeSetFlt(proto, str::motion_start, time.motionStart); + AiNodeSetFlt(proto, str::motion_end, time.motionEnd); if (overrides) - AiNodeSetArray(node, str::overrides, AiArrayCopy(overrides)); + AiNodeSetArray(proto, str::overrides, AiArrayCopy(overrides)); // This procedural is created in addition to the original hierarchy traversal // so we always want it to be hidden to avoid duplicated geometries. // We just want the instances to be visible eventually - AiNodeSetByte(node, str::visibility, 0); + AiNodeSetByte(proto, str::visibility, 0); + nodesVec[i] = proto; + + // we keep track that this prototype relies on a child usd procedural + nodesChildProcs[i] = true; + numChildProc++; + } else { + nodesRefs[i] = protoPath.GetText(); } } + AiNodeSetArray(node, str::nodes, AiArrayConvert(nodesVec.size(), 1, AI_TYPE_NODE, &nodesVec[0])); + for (size_t i = 0; i < nodesRefs.size(); ++i) { + if (nodesRefs[i].empty()) + continue; + std::string nodesAttrElem = TfStringPrintf("nodes[%d]", i); + context.AddConnection( + node, nodesAttrElem, nodesRefs[i], UsdArnoldReader::CONNECTION_PTR); + } + std::vector times; if (time.motionBlur) { times.push_back(time.start()); @@ -884,86 +896,73 @@ void UsdArnoldReadPointInstancer::Read(const UsdPrim &prim, UsdArnoldReaderConte pruneMaskValues.clear(); } + // Usually we'd get all the instance matrices, taking into account the prototype's transform (IncludeProtoXform), + // and the arnold instances will be created with inherit_xform = false. But when the prototype is a child usd proc + // then this doesn't work as inherit_xform will ignore the matrix of the child usd proc itself. The transform of the + // root primitive will still be applied, so we will get double transformations #956 + + // So, if all prototypes are child procs, we just need to call ComputeInstanceTransformsAtTimes + // with the ExcludeProtoXform flag std::vector > xformsArray; - pointInstancer.ComputeInstanceTransformsAtTimes(&xformsArray, times, frame); - - // Check the Point Instancer's world matrix, so that we apply - // it to all instances - AtArray *instancerMatrices = ReadMatrix(prim, time, context); - std::vector parentMatrices; - - if (instancerMatrices) { - // always add the first matrix key - parentMatrices.push_back(AiArrayGetMtx(instancerMatrices, 0)); - // if motion blur is enabled, also add the last matrix key so that it has - // the same size as "xformArray" - if (time.motionBlur) - parentMatrices.push_back(AiArrayGetMtx(instancerMatrices, - AiArrayGetNumKeys(instancerMatrices) - 1)); - - bool hasMatrix = false; - for (auto mtx : parentMatrices) { - if (!AiM4IsIdentity(mtx)) - hasMatrix = true; - } - // if all the matrices are identity, we can clear the vector - // so that we don't even try to apply it - if (!hasMatrix) - parentMatrices.clear(); + pointInstancer.ComputeInstanceTransformsAtTimes(&xformsArray, times, frame, (numChildProc == protoPaths.size()) ? + UsdGeomPointInstancer::ExcludeProtoXform : UsdGeomPointInstancer::IncludeProtoXform); + + // However, if some prototypes are child procs AND other prototypes are simple geometries, then we need + // to get both instance matrices with / without the prototype xform and use the appropriate one. + // Note that this can seem overkill, but the assumption is that in practice this use case shouldn't be + // the most frequent one + std::vector > excludedXformsArray; + bool mixedProtos = numChildProc > 0 && numChildProc < protoPaths.size(); + if (mixedProtos) { + pointInstancer.ComputeInstanceTransformsAtTimes(&excludedXformsArray, times, frame, + UsdGeomPointInstancer::ExcludeProtoXform); } - InstancerPrimvarsRemapper remapper; + unsigned int numKeys = xformsArray.size(); + std::vector instanceVisibilities(numInstances, AI_RAY_ALL); + std::vector instanceIdxs(numInstances, 0); + + // Create a big matrix array with all the instance matrices for the first key, + // then all matrices for the second key, etc.. + std::vector instance_matrices(numKeys * numInstances); for (size_t i = 0; i < numInstances; ++i) { // This instance has to be pruned, let's skip it - if (!pruneMaskValues.empty() && pruneMaskValues[i] == false) - continue; + if ((!pruneMaskValues.empty() && pruneMaskValues[i] == false) || + (protoIndices[i] >= protoVisibility.size())) + instanceVisibilities[i] = 0; + else + instanceVisibilities[i] = protoVisibility[protoIndices[i]]; - std::vector matrices(xformsArray.size()); // loop over all the motion steps and append the matrices as a big list of floats + for (size_t t = 0; t < numKeys; ++t) { - for (size_t t = 0; t < xformsArray.size(); ++t) { - const double *matrixArray = xformsArray[t][i].GetArray(); - AtMatrix &matrix = matrices[t]; + // use the proper matrix, that was computed either with/without the proto's xform. + // It depends on whether the prototype is a child usd proc or a simple geometry + const double *matrixArray = (mixedProtos && nodesChildProcs[protoIndices[i]]) ? + excludedXformsArray[t][i].GetArray() : xformsArray[t][i].GetArray(); + AtMatrix &matrix = instance_matrices[i + t * numInstances]; for (int i = 0; i < 4; ++i) for (int j = 0; j < 4; ++j, matrixArray++) matrix[i][j] = (float)*matrixArray; - - if (!parentMatrices.empty()) { - AtMatrix parentMtx = (t < parentMatrices.size()) ? - parentMatrices[t] : parentMatrices.back(); - - matrix = AiM4Mult(matrix, parentMtx); - } } + instanceIdxs[i] = protoIndices[i]; + } + AiNodeSetArray(node, str::instance_matrix, AiArrayConvert(numInstances, numKeys, AI_TYPE_MATRIX, &instance_matrices[0])); + AiNodeSetArray(node, str::instance_visibility, AiArrayConvert(numInstances, 1, AI_TYPE_BYTE, &instanceVisibilities[0])); + AiNodeSetArray(node, str::node_idxs, AiArrayConvert(numInstances, 1, AI_TYPE_UINT, &instanceIdxs[0])); - // construct the instance name, based on the point instancer name, - // suffixed by the instance number - std::string instanceName = TfStringPrintf("%s_%d", primName.c_str(), i); - - // create a ginstance pointing at this proto node - AtNode *arnoldInstance = context.CreateArnoldNode("ginstance", instanceName.c_str()); - - AiNodeSetBool(arnoldInstance, str::inherit_xform, false); - int protoId = protoIndices[i]; // which proto to instantiate - - if (protoId < protoPaths.size()) // safety out-of-bounds check, shouldn't happen - { - // Add a connection from ginstance.node to the desired proto. This connection will be applied - // after all nodes were exported to Arnold. - context.AddConnection( - arnoldInstance, "node", protoPaths.at(protoId).GetText(), UsdArnoldReader::CONNECTION_PTR); + ReadMatrix(prim, node, time, context); + InstancerPrimvarsRemapper primvarsRemapper; + ReadPrimvars(prim, node, time, context, &primvarsRemapper); + ReadMaterialBinding(prim, node, context, false); // don't assign the default shader - // Set the instance visibility as being the same as its prototype - AiNodeSetByte(arnoldInstance, str::visibility, protoVisibility[protoId]); - } - AiNodeSetFlt(arnoldInstance, str::motion_start, time.motionStart); - AiNodeSetFlt(arnoldInstance, str::motion_end, time.motionEnd); - // set the instance xform - AiNodeSetArray(arnoldInstance, str::matrix, AiArrayConvert(1, matrices.size(), AI_TYPE_MATRIX, &matrices[0])); - remapper.SetIndex(i); - ReadPrimvars(prim, arnoldInstance, time, context, &remapper); + _ReadArnoldParameters(prim, context, node, time, "primvars:arnold"); + // Check the prim visibility, set the AtNode visibility to 0 if it's hidden + if (!context.GetPrimVisibility(prim, time.frame)) + AiNodeSetByte(node, str::visibility, 0); - } + AiNodeSetFlt(node, str::motion_start, time.motionStart); + AiNodeSetFlt(node, str::motion_end, time.motionEnd); } void UsdArnoldReadVolume::Read(const UsdPrim &prim, UsdArnoldReaderContext &context) diff --git a/translator/reader/reader.cpp b/translator/reader/reader.cpp index 696a6feda5..8dea0f9092 100644 --- a/translator/reader/reader.cpp +++ b/translator/reader/reader.cpp @@ -343,25 +343,27 @@ void UsdArnoldReader::ReadStage(UsdStageRefPtr stage, const std::string &path) } else _registry->RegisterPrimitiveReaders(); - UsdPrim rootPrim; UsdPrim *rootPrimPtr = nullptr; if (!path.empty()) { SdfPath sdfPath(path); - rootPrim = _stage->GetPrimAtPath(sdfPath); - if (!rootPrim) { + _hasRootPrim = true; + _rootPrim = _stage->GetPrimAtPath(sdfPath); + if (!_rootPrim) { AiMsgError( "[usd] %s : Object Path %s is not valid", (_procParent) ? AiNodeGetName(_procParent) : "", path.c_str()); return; } - if (!rootPrim.IsActive()) { + if (!_rootPrim.IsActive()) { AiMsgWarning( "[usd] %s : Object Path primitive %s is not active", (_procParent) ? AiNodeGetName(_procParent) : "", path.c_str()); return; } - rootPrimPtr = &rootPrim; + rootPrimPtr = &_rootPrim; + } else { + _hasRootPrim = false; } // If there is not parent procedural, and we need to lookup the options, then we first need to find the @@ -1025,6 +1027,7 @@ bool UsdArnoldReaderThreadContext::ProcessConnection(const Connection &connectio target = CreateArnoldNode("usd", connection.target.c_str()); AiNodeSetStr(target, str::filename, _reader->GetFilename().c_str()); AiNodeSetStr(target, str::object_path, connection.target.c_str()); + AiNodeSetInt(target, str::cache_id, _reader->GetCacheId()); const TimeSettings &time = _reader->GetTimeSettings(); AiNodeSetFlt(target, str::frame, time.frame); // give it the desired frame AiNodeSetFlt(target, str::motion_start, time.motionStart); @@ -1041,8 +1044,21 @@ bool UsdArnoldReaderThreadContext::ProcessConnection(const Connection &connectio return false; // node is missing, we don't process the connection } } - if (connection.type == UsdArnoldReader::CONNECTION_PTR) - AiNodeSetPtr(connection.sourceNode, connection.sourceAttr.c_str(), (void *)target); + if (connection.type == UsdArnoldReader::CONNECTION_PTR) { + if (connection.sourceAttr.back() == ']' ) { + std::stringstream ss(connection.sourceAttr); + std::string arrayAttr, arrayIndexStr; + if (std::getline(ss, arrayAttr, '[') && std::getline(ss, arrayIndexStr, ']')) { + int arrayIndex = std::stoi(arrayIndexStr); + AtArray *array = AiNodeGetArray(connection.sourceNode, + AtString(arrayAttr.c_str())); + if (array && arrayIndex < AiArrayGetNumElements(array)) { + AiArraySetPtr(array, arrayIndex, (void *)target); + } + } + } else + AiNodeSetPtr(connection.sourceNode, connection.sourceAttr.c_str(), (void *)target); + } else if (connection.type == UsdArnoldReader::CONNECTION_LINK) { if (target == nullptr) { diff --git a/translator/reader/reader.h b/translator/reader/reader.h index 8aaa1dc8fe..7810e12f26 100644 --- a/translator/reader/reader.h +++ b/translator/reader/reader.h @@ -45,6 +45,7 @@ class UsdArnoldReader { _defaultShader(nullptr), _overrides(nullptr), _cacheId(0), + _hasRootPrim(false), _readerLock(nullptr), _readStep(READ_NOT_STARTED), _purpose(UsdGeomTokens->render), @@ -155,6 +156,39 @@ class UsdArnoldReader { void ReadLightLinks(); + // Get the world matrix of a given primitive, using the provided xform cache (each thread has its own) + void GetWorldMatrix(const UsdPrim &prim, UsdGeomXformCache *xformCache, GfMatrix4d &xform) { + if (xformCache == nullptr) + return; + + // If there's no root primitive set ("object_path" in the procedural) + // then we simply get the local to world matrix for this prim + if (!_hasRootPrim) { + xform = xformCache->GetLocalToWorldTransform(prim); + return; + } + // At this point we have a root primitive as we read the stage. We need to ensure that + // we don't take into account all transformations from the root's ancestor primitives + bool resetStack = false; // dummy attribute + + // if the primitive IS the root prim, then we just want its local xform + if (prim == _rootPrim) { + xform = xformCache->GetLocalTransformation(prim, &resetStack); + return; + } + UsdPrim parent = _rootPrim.GetParent(); + // Compute the prim's transform relatively to the root prim. However, the function + // ComputeRelativeTransform specifies that it ignores the "ancestor" trnsform, which + // is not what we want here. Therefore we must call it with the root's parent prim + // as the relative "ancestor" prim + if (parent) { + xform = xformCache->ComputeRelativeTransform(prim, parent, &resetStack); + } else { + // no parent was found for the root prim, let's just compute the world matrix + xform = xformCache->GetLocalToWorldTransform(prim); + } + } + private: const AtNode *_procParent; // the created nodes are children of a procedural parent AtUniverse *_universe; // only set if a specific universe is being used @@ -177,7 +211,9 @@ class UsdArnoldReader { AtNode *_defaultShader; std::string _filename; // usd filename that is currently being read AtArray *_overrides; // usd overrides that are currently being applied on top of the usd file - int _cacheId; + int _cacheId; // usdStage cacheID used with a StageCache + bool _hasRootPrim; // are we reading this stage based on a root primitive + UsdPrim _rootPrim; // eventual root primitive used to traverse the stage AtCritSec _readerLock; // arnold mutex for multi-threaded translator ReadStep _readStep; diff --git a/translator/reader/utils.cpp b/translator/reader/utils.cpp index 4a73bcaa4d..122881c246 100644 --- a/translator/reader/utils.cpp +++ b/translator/reader/utils.cpp @@ -54,10 +54,11 @@ static inline void getMatrix(const UsdPrim &prim, AtMatrix &matrix, float frame, // Special case for arnold schemas. They're not yet recognized as UsdGeomXformables, // so we can't get their local to world transform. In that case, we ask for its parent // and we manually apply the local matrix on top of it - if (isXformable) - xform = xformCache->GetLocalToWorldTransform(prim); + if (isXformable){ + context.GetReader()->GetWorldMatrix(prim, xformCache, xform); + } else { - xform = xformCache->GetLocalToWorldTransform(prim.GetParent()); + context.GetReader()->GetWorldMatrix(prim.GetParent(), xformCache, xform); UsdGeomXformable xformable(prim); GfMatrix4d localTransform; bool resetStack = true; @@ -368,6 +369,6 @@ bool PrimvarsRemapper::RemapIndexes(const UsdGeomPrimvar &primvar, const TfToken return false; } -void PrimvarsRemapper::RemapPrimvar(TfToken &name, TfToken &interpolation) +void PrimvarsRemapper::RemapPrimvar(TfToken &name, std::string &interpolation) { } \ No newline at end of file diff --git a/translator/reader/utils.h b/translator/reader/utils.h index 7fbe433f95..8d601b34ab 100644 --- a/translator/reader/utils.h +++ b/translator/reader/utils.h @@ -54,7 +54,7 @@ class PrimvarsRemapper VtValue &value); virtual bool RemapIndexes(const UsdGeomPrimvar &primvar, const TfToken &interpolation, std::vector &indexes); - virtual void RemapPrimvar(TfToken &name, TfToken &interpolation); + virtual void RemapPrimvar(TfToken &name, std::string &interpolation); }; struct InputAttribute {