Trying to use a mesh light produces the following error:
Fails even in the most basic of test scenes.
Error Failed to save output to file "Traceback (most recent call last): File "[HOUDINI_INSTALL_DIRECTORY]plugins/houdini-17.0.459/htoa/htoa-3.2.2_rdc1beed_arnold-5.2.2.1/soho/arnold.py", line 78, in HaSession.getSession().run() File "[HOUDINI_INSTALL_DIRECTORY]plugins/houdini-17.0.459/htoa/htoa-3.2.2_rdc1beed_arnold-5.2.2.1/scripts/python/htoa/session.py", line 497, in run hook(arg_dict) File "[HOUDINI_INSTALL_DIRECTORY]plugins/houdini-17.0.459/htoa/htoa-3.2.2_rdc1beed_arnold-5.2.2.1/scripts/python/htoa/object/light.py", line 41, in linkMeshHook log.error('Expected exactly one mesh in %s for mesh light %s' % (obj_path, AiNodeGetName(arg_dict['mesh_light']))) NameError: global name 'obj_path' is not defined ".
Fails even in the most basic of test scenes.
Using Houdini 17.0.459 Arnold 5.2.2.1 htoa-3.2.2.
I can reproduce, but only if I put an non-mesh object as the mesh for the mesh light (Arnold Light node, Light tab, Mesh box)
The error is from the log.error line. The mesh light still won't work, even after we fix that script error (because you'll still be referencing a non-mesh object)
mesh-light-example.tar.gzHi Stephen,
Could you explain that again? My test scene is pretty barebones -- Just a torus (light geo), sphere, mesh light, shopnet, camera, and arnold rop. Nothing crazy with the torus mesh that's in the light geo. I'll try and include it here.
Hi Rachid,
Adding a wildcard in the candidate objects does indeed fix it, but that's not really ideal since really never use candidate objects, and don't want to make everything in a scene potentially renderable. You got me on the right track though, I got it working below. Thanks!!
There's a bug in the HtoA Python code.
The bug triggered only if an invalid object name is used as the mesh for the mesh light.
As Rachid pointed out, the torus was not being exported to Arnold, so the mesh light had no mesh.
Thanks for reporting the bug, I've opened a ticket for that.
Ok I got it working.
I guess you have to have the geometry object also forced on the Arnold ROP. Since this will render both the light, and the geometry source, it is necessary to go to the object's Arnold tab > visibility > and make sure the object is invisible to camera rays.
I looked over the docs again, and I think this could really be worth mentioning in the HtoA documentation on mesh lights, as with mantra this is handled by default without having to force the geo on.
Actually, this is fixed in HtoA 3.3 and you get the error message (and no Python error):
ERROR | [htoa.object.light] Expected exactly one mesh in /obj/torus1 for mesh light /obj/LGT_mesh
Thanks, I'll look into this. By the way the error when no mesh light is found should be fixes in HtoA 3.3.0.