tylermorganwall / rayrender

A pathtracer for R. Build and render complex scenes and 3D data visualizations directly from R
http://www.rayrender.net
622 stars 43 forks source link

fix debug channel use for render_preview #36

Closed brodieG closed 2 years ago

brodieG commented 2 years ago

Hey, was playing around with render_preview and found a small bug. Fix was simple so I just throw it together here (make sure debug_channel is numeric before testing against it). Here is the error from the unpatched version (from ?render_preview:

generate_ground(material=diffuse(color="darkgreen")) %>% 
  add_object(sphere(material=diffuse(checkercolor="red"))) %>% 
  render_preview(light_direction = c(-1,-1,0))
## Error in preview && interactive && has_gui_capability() && debug_channel ==  : 
##  'length(x) = 4 > 1' in coercion to 'logical(1)'
tylermorganwall commented 2 years ago

Looks good, thanks for the fix!