tylermorganwall / rayshader

R Package for 2D and 3D mapping and data visualization

Home Page:https://www.rayshader.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

render_highquality error in Darwin Kernel

maniatisn opened this issue · comments

Hello there, I stumbled upon an unusual error that I can't seem to solve when trying to render_highquality().
This is on a Mac M1 (system info below).
I'd be grateful on any help here, thanks!!

Reproducible example

library(rayshader)

small <- resize_matrix(montereybay, .25)

# this shows the map
small %>%
  height_shade() %>%
  plot_3d(heightmap = small)

render_highquality(filename = "test.png")

This prints out:

Error in rayrender::obj_model(cache_filename, x = -bbox_center[1], y = -bbox_center[2], :
unused argument (texture = TRUE)

System info

> Sys.info()
                                                                                               sysname 
                                                                                              "Darwin" 
                                                                                               release 
                                                                                              "22.2.0" 
                                                                                               version 
"Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000" 
                                                                                              nodename 
                                                                                               machine 
                                                                                               "arm64" 
                                                                                                 login 
                                                                                                "root" 
                                                                                                  user 
                                                                                        effective_user 

Also having the same issue! Thank you for posting. I ran into this problem while following this tutorial from Spencer Schien.

I looked into the render_highquality() function itself and I believe the issue arises in the following code:

if (obj_material$type %in% c("diffuse", "oren-nayar")) {
scene = rayrender::obj_model(cache_filename, x = -bbox_center[1],
y = -bbox_center[2], z = -bbox_center[3], texture = TRUE,
material = obj_material)

the issue seems to be that rayrender::obj_model() has been updated so that it no longer takes the texture argument, but when it's called inside render_highquality() here it is given "texture = TRUE" which it doesn't know how to handle

not really sure how to get around this but thanks for posting, hopefully it can get fixed soon!

this error no longer appears with the newest versions. you may like to install the latest version of rayshader (==0.32.7) via devtools using devtools::install_github("tylermorganwall/rayshader")

Ah thanks! I had to remove the packages before reinstalling from GitHub in order for the new package to work, hadn’t realized that at first. Thanks!