MoonRay plugin for Blender

There’s alot of output but here are a few of the error bits.

Coding Error: in _ParseVersionString at line 70 of /src/build_linux/deps/build/usd/src/external_usd/pxr/usd/ndr/declare.cpp -- Invalid version string '1.0.0'
Writing stack for blender to /var/tmp/st_blender.wSE1wY because of ERROR.
Coding Error: in _ParseVersionString at line 70 of /src/build_linux/deps/build/usd/src/external_usd/pxr/usd/ndr/declare.cpp -- Invalid version string '1.0.1'
Writing stack for blender to /var/tmp/st_blender.PjPDW9 because of ERROR.
INFO (hydra.scene): source/blender/io/usd/hydra/light.cc:138 get_data: /scene/World (): lightLink
Coding Error: in _FailGet at line 518 of /src/build_linux/deps/build/usd/src/external_usd/pxr/base/vt/value.cpp -- Attempted to get value of type 'TfToken' from empty VtValue.
Writing stack for blender to /var/tmp/st_blender.FaJpcK because of ERROR.
Coding Error: in _FailGet at line 518 of /src/build_linux/deps/build/usd/src/external_usd/pxr/base/vt/value.cpp -- Attempted to get value of type 'TfToken' from empty VtValue.
INFO (hydra.scene): source/blender/io/usd/hydra/hydra_scene_delegate.cc:93 GetLightParamValue: /scene/World, shadowLink
INFO (hydra.scene): source/blender/io/usd/hydra/light.cc:138 get_data: /scene/World (): shadowLink
Coding Error: in _FailGet at line 518 of /src/build_linux/deps/build/usd/src/external_usd/pxr/base/vt/value.cpp -- Attempted to get value of type 'TfToken' from empty VtValue.
Writing stack for blender to /var/tmp/st_blender.A2oR1i because of ERROR.
Coding Error: in _FailGet at line 518 of /src/build_linux/deps/build/usd/src/external_usd/pxr/base/vt/value.cpp -- Attempted to get value of type 'TfToken' from empty VtValue.
==============================================================
             HdEngine [Prepare Phase](Task::Prepare)          
--------------------------------------------------------------
Render setting not found for key [volumeRaymarchingStepSize]
Render setting not found for key [volumeRaymarchingStepSizeLighting]
==============================================================
             HdEngine [Execute Phase](Task::Execute)          
--------------------------------------------------------------
Render setting not found for key [houdini:interactive]
Render setting not found for key [sceneVariable:min_frame]
Render setting not found for key [sceneVariable_min_frame]
Render setting not found for key [sceneVariable:max_frame]
Render setting not found for key [sceneVariable_max_frame]
Render setting not found for key [sceneVariable:frame]
Render setting not found for key [sceneVariable_frame]
Render setting not found for key [sceneVariable:dicing_camera]
Render setting not found for key [sceneVariable_dicing_camera]
Render setting not found for key [sceneVariable:exr_header_attributes]
Render setting not found for key [sceneVariable_exr_header_attributes]
Render setting not found for key [sceneVariable:res]
Render setting not found for key [sceneVariable_res]
Render setting not found for key [sceneVariable:aperture_window]
Render setting not found for key [sceneVariable_aperture_window]
Render setting not found for key [sceneVariable:region_window]
Render setting not found for key [sceneVariable_region_window]
Render setting not found for key [sceneVariable:sub_viewport]
Render setting not found for key [sceneVariable_sub_viewport]
Render setting not found for key [sceneVariable:fps]
Render setting not found for key [sceneVariable_fps]
Render setting not found for key [sceneVariable:scene_scale]
Render setting not found for key [sceneVariable_scene_scale]
Render setting not found for key [sceneVariable:sampling_mode]
Render setting not found for key [sceneVariable_sampling_mode]
Render setting not found for key [sceneVariable:min_adaptive_samples]
Render setting not found for key [sceneVariable_min_adaptive_samples]
Render setting not found for key [sceneVariable:max_adaptive_samples]
Render setting not found for key [sceneVariable_max_adaptive_samples]
Render setting not found for key [sceneVariable:target_adaptive_error]
Render setting not found for key [sceneVariable_target_adaptive_error]
Render setting not found for key [sceneVariable:light_sampling_mode]
Render setting not found for key [sceneVariable_light_sampling_mode]
Render setting not found for key [sceneVariable:light_sampling_quality]
Render setting not found for key [sceneVariable_light_sampling_quality]
Render setting not found for key [sceneVariable:pixel_samples]
Render setting not found for key [sceneVariable_pixel_samples]
Render setting not found for key [sceneVariable:light_samples]
Render setting not found for key [sceneVariable_light_samples]
Render setting not found for key [sceneVariable:bsdf_samples]
Render setting not found for key [sceneVariable_bsdf_samples]
Render setting not found for key [sceneVariable:bssrdf_samples]
Render setting not found for key [sceneVariable_bssrdf_samples]
Render setting not found for key [sceneVariable:max_depth]
Render setting not found for key [sceneVariable_max_depth]
Render setting not found for key [sceneVariable:max_diffuse_depth]
Render setting not found for key [sceneVariable_max_diffuse_depth]
Render setting not found for key [sceneVariable:max_glossy_depth]
Render setting not found for key [sceneVariable_max_glossy_depth]
Render setting not found for key [sceneVariable:max_mirror_depth]
Render setting not found for key [sceneVariable_max_mirror_depth]
Render setting not found for key [sceneVariable:max_volume_depth]
Render setting not found for key [sceneVariable_max_volume_depth]
Render setting not found for key [sceneVariable:max_presence_depth]
Render setting not found for key [sceneVariable_max_presence_depth]
Render setting not found for key [sceneVariable:max_hair_depth]
Render setting not found for key [sceneVariable_max_hair_depth]
Render setting not found for key [sceneVariable:disable_optimized_hair_sampling]
Render setting not found for key [sceneVariable_disable_optimized_hair_sampling]
Render setting not found for key [sceneVariable:max_subsurface_per_path]
Render setting not found for key [sceneVariable_max_subsurface_per_path]
Render setting not found for key [sceneVariable:russian_roulette_threshold]
Render setting not found for key [sceneVariable_russian_roulette_threshold]
Render setting not found for key [sceneVariable:transparency_threshold]
Render setting not found for key [sceneVariable_transparency_threshold]
Render setting not found for key [sceneVariable:presence_threshold]
Render setting not found for key [sceneVariable_presence_threshold]
Render setting not found for key [sceneVariable:lock_frame_noise]
Render setting not found for key [sceneVariable_lock_frame_noise]
Render setting not found for key [sceneVariable:volume_quality]
Render setting not found for key [sceneVariable_volume_quality]
Render setting not found for key [sceneVariable:volume_shadow_quality]
Render setting not found for key [sceneVariable_volume_shadow_quality]
Render setting not found for key [sceneVariable:volume_illumination_samples]
Render setting not found for key [sceneVariable_volume_illumination_samples]
Render setting not found for key [sceneVariable:volume_opacity_threshold]
Render setting not found for key [sceneVariable_volume_opacity_threshold]
Render setting not found for key [sceneVariable:volume_overlap_mode]
Render setting not found for key [sceneVariable_volume_overlap_mode]
Render setting not found for key [sceneVariable:volume_attenuation_factor]
Render setting not found for key [sceneVariable_volume_attenuation_factor]
Render setting not found for key [sceneVariable:volume_contribution_factor]
Render setting not found for key [sceneVariable_volume_contribution_factor]
Render setting not found for key [sceneVariable:volume_phase_attenuation_factor]
Render setting not found for key [sceneVariable_volume_phase_attenuation_factor]
Render setting not found for key [sceneVariable:path_guide_enable]
Render setting not found for key [sceneVariable_path_guide_enable]
Render setting not found for key [sceneVariable:sample_clamping_value]
Render setting not found for key [sceneVariable_sample_clamping_value]
Render setting not found for key [sceneVariable:sample_clamping_depth]
Render setting not found for key [sceneVariable_sample_clamping_depth]
Render setting not found for key [sceneVariable:roughness_clamping_factor]
Render setting not found for key [sceneVariable_roughness_clamping_factor]
Render setting not found for key [sceneVariable:texture_blur]
Render setting not found for key [sceneVariable_texture_blur]
Render setting not found for key [sceneVariable:pixel_filter_width]
Render setting not found for key [sceneVariable_pixel_filter_width]
Render setting not found for key [sceneVariable:pixel_filter]
Render setting not found for key [sceneVariable_pixel_filter]
Render setting not found for key [sceneVariable:deep_format]
Render setting not found for key [sceneVariable_deep_format]
Render setting not found for key [sceneVariable:deep_curvature_tolerance]
Render setting not found for key [sceneVariable_deep_curvature_tolerance]
Render setting not found for key [sceneVariable:deep_z_tolerance]
Render setting not found for key [sceneVariable_deep_z_tolerance]
Render setting not found for key [sceneVariable:deep_vol_compression_res]
Render setting not found for key [sceneVariable_deep_vol_compression_res]
Render setting not found for key [sceneVariable:deep_id_attribute_names]
Render setting not found for key [sceneVariable_deep_id_attribute_names]
Render setting not found for key [sceneVariable:texture_cache_size]
Render setting not found for key [sceneVariable_texture_cache_size]
Render setting not found for key [sceneVariable:crypto_uv_attribute_name]
Render setting not found for key [sceneVariable_crypto_uv_attribute_name]
Render setting not found for key [sceneVariable:texture_file_handles]
Render setting not found for key [sceneVariable_texture_file_handles]
Render setting not found for key [sceneVariable:fast_geometry_update]
Render setting not found for key [sceneVariable_fast_geometry_update]
Render setting not found for key [sceneVariable:checkpoint_active]
Render setting not found for key [sceneVariable_checkpoint_active]
Render setting not found for key [sceneVariable:checkpoint_interval]
Render setting not found for key [sceneVariable_checkpoint_interval]
Render setting not found for key [sceneVariable:checkpoint_quality_steps]
Render setting not found for key [sceneVariable_checkpoint_quality_steps]
Render setting not found for key [sceneVariable:checkpoint_time_cap]
Render setting not found for key [sceneVariable_checkpoint_time_cap]
Render setting not found for key [sceneVariable:checkpoint_sample_cap]
Render setting not found for key [sceneVariable_checkpoint_sample_cap]
Render setting not found for key [sceneVariable:checkpoint_overwrite]
Render setting not found for key [sceneVariable_checkpoint_overwrite]
Render setting not found for key [sceneVariable:checkpoint_mode]
Render setting not found for key [sceneVariable_checkpoint_mode]
Render setting not found for key [sceneVariable:checkpoint_start_sample]
Render setting not found for key [sceneVariable_checkpoint_start_sample]
Render setting not found for key [sceneVariable:checkpoint_bg_write]
Render setting not found for key [sceneVariable_checkpoint_bg_write]
Render setting not found for key [sceneVariable:checkpoint_post_script]
Render setting not found for key [sceneVariable_checkpoint_post_script]
Render setting not found for key [sceneVariable:checkpoint_total_files]
Render setting not found for key [sceneVariable_checkpoint_total_files]
Render setting not found for key [sceneVariable:checkpoint_max_bgcache]
Render setting not found for key [sceneVariable_checkpoint_max_bgcache]
Render setting not found for key [sceneVariable:checkpoint_max_snapshot_overhead]
Render setting not found for key [sceneVariable_checkpoint_max_snapshot_overhead]
Render setting not found for key [sceneVariable:checkpoint_snapshot_interval]
Render setting not found for key [sceneVariable_checkpoint_snapshot_interval]
Render setting not found for key [sceneVariable:resumable_output]
Render setting not found for key [sceneVariable_resumable_output]
Render setting not found for key [sceneVariable:resume_render]
Render setting not found for key [sceneVariable_resume_render]
Render setting not found for key [sceneVariable:on_resume_script]
Render setting not found for key [sceneVariable_on_resume_script]
Render setting not found for key [sceneVariable:enable_dof]
Render setting not found for key [sceneVariable_enable_dof]
Render setting not found for key [sceneVariable:enable_max_geometry_resolution]
Render setting not found for key [sceneVariable_enable_max_geometry_resolution]
Render setting not found for key [sceneVariable:max_geometry_resolution]
Render setting not found for key [sceneVariable_max_geometry_resolution]
Render setting not found for key [sceneVariable:enable_displacement]
Render setting not found for key [sceneVariable_enable_displacement]
Render setting not found for key [sceneVariable:enable_subsurface_scattering]
Render setting not found for key [sceneVariable_enable_subsurface_scattering]
Render setting not found for key [sceneVariable:enable_shadowing]
Render setting not found for key [sceneVariable_enable_shadowing]
Render setting not found for key [sceneVariable:enable_presence_shadows]
Render setting not found for key [sceneVariable_enable_presence_shadows]
Render setting not found for key [sceneVariable:lights_visible_in_camera]
Render setting not found for key [sceneVariable_lights_visible_in_camera]
Render setting not found for key [sceneVariable:propagate_visibility_bounce_type]
Render setting not found for key [sceneVariable_propagate_visibility_bounce_type]
Render setting not found for key [sceneVariable:shadow_terminator_fix]
Render setting not found for key [sceneVariable_shadow_terminator_fix]
Render setting not found for key [sceneVariable:machine_id]
Render setting not found for key [sceneVariable_machine_id]
Render setting not found for key [sceneVariable:num_machines]
Render setting not found for key [sceneVariable_num_machines]
Render setting not found for key [sceneVariable:task_distribution_type]
Render setting not found for key [sceneVariable_task_distribution_type]
Render setting not found for key [sceneVariable:batch_tile_order]
Render setting not found for key [sceneVariable_batch_tile_order]
Render setting not found for key [sceneVariable:progressive_tile_order]
Render setting not found for key [sceneVariable_progressive_tile_order]
Render setting not found for key [sceneVariable:checkpoint_tile_order]
Render setting not found for key [sceneVariable_checkpoint_tile_order]
Render setting not found for key [sceneVariable:output_file]
Render setting not found for key [sceneVariable_output_file]
Render setting not found for key [sceneVariable:tmp_dir]
Render setting not found for key [sceneVariable_tmp_dir]
Render setting not found for key [sceneVariable:two_stage_output]
Render setting not found for key [sceneVariable_two_stage_output]
Render setting not found for key [sceneVariable:log_debug]
Render setting not found for key [sceneVariable_log_debug]
Render setting not found for key [sceneVariable:log_info]
Render setting not found for key [sceneVariable_log_info]
Render setting not found for key [sceneVariable:fatal_color]
Render setting not found for key [sceneVariable_fatal_color]
Render setting not found for key [sceneVariable:stats_file]
Render setting not found for key [sceneVariable_stats_file]
Render setting not found for key [sceneVariable:athena_debug]
Render setting not found for key [sceneVariable_athena_debug]
Render setting not found for key [sceneVariable:debug_pixel]
Render setting not found for key [sceneVariable_debug_pixel]
Render setting not found for key [sceneVariable:debug_rays_file]
Render setting not found for key [sceneVariable_debug_rays_file]
Render setting not found for key [sceneVariable:debug_rays_primary_range]
Render setting not found for key [sceneVariable_debug_rays_primary_range]
Render setting not found for key [sceneVariable:debug_rays_depth_range]
Render setting not found for key [sceneVariable_debug_rays_depth_range]
Render setting not found for key [sceneVariable:debug_console]
Render setting not found for key [sceneVariable_debug_console]
Render setting not found for key [sceneVariable:validate_geometry]
Render setting not found for key [sceneVariable_validate_geometry]
Render setting not found for key [sceneVariable:cryptomatte_multi_presence]
Render setting not found for key [sceneVariable_cryptomatte_multi_presence]

Looks like I’ll need to start setting some keys :slight_smile:

You can ignore those few ...ndr/declare.cpp -- Invalid version string '1.0.0' errors as USD has not resolved that upstream yet: Versioning Numerics Of Some Autodesk MaterialX bxdf Nodes Incompatable With USD 23.08 · Issue #2910 · PixarAnimationStudios/OpenUSD · GitHub

Focus on any other error you see though.

Fixed all the keys, I’ve still got the TfType error and Moonray is still not display anything in the viewport. How does Blender get the images back from hydra. Is there a speciifc thing I need to do?

Was there a stack trace inside the various files that are created for the errors? Similar to the file highlighted here inside your /var dir:
[Writing stack for blender to /var/tmp/st_blender.A2oR1i because of ERROR.]

It might provide hints as to where we are in the process.

I’m at the limit of my knowledge of what Hydra/OpenGL might be doing here and I won’t be able to help out much further. @sergey Do you happen to know how external hydra delegates are expected to write into the textures that blender sets up? It seems like Blender sets up the framebuffer with 2 texture attachments (1 for depth and 1 for color) and then expects the other side to use those attachment names when writing their outputs. This all assumes that they agree on the OpenGL context to use etc. etc. See GPURenderTaskDelegate::bind inside the render_task_delegate.cc file.

From the top of my head it was supposed to be similar to how Cycles updates viewport: it writes to a texture from one thread/context, and the viewport renders it from another thread/context. The textures are supposed to be shared across OpenGL contexts.

I didn’t follow this discussion very closely yet, and Hydra is not something i can claim 100% proficiency. Some initial question is: what is the fundamental difference between MoonRay and Storm w.r.t drawing to the texture?

had a look at the var files and these are the kind of issues I’m getting.

==============================================================
 A stack trace has been requested by blender because: ERROR
 #0   0x00007f2b726f000a in pxrInternal_v0_24__pxrReserved__::ArchGetStackFrames(unsigned long, unsigned long, unsigned long*)+0x2a
 #1   0x00007f2b726f129e in pxrInternal_v0_24__pxrReserved__::ArchGetStackFrames(unsigned long, unsigned long, vector<unsigned long, allocator<unsigned long> >*)+0x3e
 #2   0x00007f2b726f18d9 in pxrInternal_v0_24__pxrReserved__::ArchPrintStackTrace(ostream&, stringconst&, stringconst&)+0xd9
 #3   0x00007f2b726f2172 in pxrInternal_v0_24__pxrReserved__::ArchPrintStackTrace(ostream&, stringconst&)+0x72
 #4   0x00007f2b7274ca80 in pxrInternal_v0_24__pxrReserved__::TfPrintStackTrace(ostream&, stringconst&)+0x10
 #5   0x00007f2b7274ceae in pxrInternal_v0_24__pxrReserved__::TfPrintStackTrace(_IO_FILE*, stringconst&)+0x18e
 #6   0x00007f2b7274d156 in pxrInternal_v0_24__pxrReserved__::TfLogStackTrace(stringconst&, bool)+0x116
 #7   0x00007f2b7271c9d9 in pxrInternal_v0_24__pxrReserved__::TfDiagnosticMgr::PostError(pxrInternal_v0_24__pxrReserved__::TfEnum, char const*, pxrInternal_v0_24__pxrReserved__::TfCallContext const&, stringconst&, any, bool)+0x1f9
 #8   0x00007f2b7271ccac in pxrInternal_v0_24__pxrReserved__::TfDiagnosticMgr::ErrorHelper::Post(stringconst&) const+0x4c
 #9   0x00007f2b72717b27 in pxrInternal_v0_24__pxrReserved__::Tf_PostErrorHelper(pxrInternal_v0_24__pxrReserved__::TfCallContext const&, pxrInternal_v0_24__pxrReserved__::TfEnum const&, stringconst&)+0x67
 #10  0x00007f2b72717b7b in pxrInternal_v0_24__pxrReserved__::Tf_PostErrorHelper(pxrInternal_v0_24__pxrReserved__::TfCallContext const&, pxrInternal_v0_24__pxrReserved__::TfDiagnosticType, stringconst&)+0x1b
 #11  0x00007f2b727171ab in pxrInternal_v0_24__pxrReserved__::Tf_FailedVerifyHelper(pxrInternal_v0_24__pxrReserved__::TfCallContext const&, char const*, char const*)+0x26b
 #12  0x00007f2b0fb34851 in pxrInternal_v0_24__pxrReserved__::HdArnoldRenderPass::_Execute(shared_ptr<pxrInternal_v0_24__pxrReserved__::HdRenderPassState> const&, vector<pxrInternal_v0_24__pxrReserved__::TfToken, allocator<pxrInternal_v0_24__pxrReserved__::TfToken> > const&)+0x3971
 #13  0x00007f2b73990912 in pxrInternal_v0_24__pxrReserved__::HdxRenderTask::Execute(unordered_map<pxrInternal_v0_24__pxrReserved__::TfToken, pxrInternal_v0_24__pxrReserved__::VtValue, pxrInternal_v0_24__pxrReserved__::TfToken::HashFunctor, equal_to<pxrInternal_v0_24__pxrReserved__::TfToken>, allocator<pair<pxrInternal_v0_24__pxrReserved__::TfToken const, pxrInternal_v0_24__pxrReserved__::VtValue> > >*)+0x1c2
 #14  0x00007f2b73499baf in pxrInternal_v0_24__pxrReserved__::HdEngine::Execute(pxrInternal_v0_24__pxrReserved__::HdRenderIndex*, vector<shared_ptr<pxrInternal_v0_24__pxrReserved__::HdTask>, allocator<shared_ptr<pxrInternal_v0_24__pxrReserved__::HdTask> > >*)+0x35f
 #15  0x0000000001e5278c in <unknown>
 #16  0x0000000001e49cb2 in <unknown>
 #17  0x00000000007ba140 in <unknown>
 #18  0x00000000007937c5 in _PyObject_MakeTpCall+0x75
 #19  0x00000000007edc15 in _PyEval_EvalFrameDefault+0x665
 #20  0x00000000007eca57 in <unknown>
 #21  0x0000000001614efe in <unknown>
 #22  0x0000000001561d26 in <unknown>
 #23  0x0000000001202ff4 in <unknown>
 #24  0x00000000011407e2 in <unknown>
 #25  0x0000000001140c97 in <unknown>
 #26  0x00000000020da0b5 in <unknown>
 #27  0x0000000001633577 in <unknown>
 #28  0x0000000000f8a342 in <unknown>
 #29  0x0000000000f856f0 in <unknown>
 #30  0x000000000072f480 in <unknown>
 #31  0x00007f2b6d829590 in <unknown>
 #32  0x00007f2b6d829640 in __libc_start_main+0x80
 #33  0x000000000083ebfe in <unknown>
 #34  0x0000000000000000 in <unknown>
==============================================================
  File "/home/hoske/software/blender/blender-4.2.3-linux-x64/4.2/scripts/modules/bpy_types.py", line 1397, in view_draw
    _bpy_hydra.engine_view_draw(self.engine_ptr, context)
=============================================================

Honestly I’m very much stuck and unsure what I can do from here. Hopefully someone knows how to solve this?