Rhino Wip Crash (edit: also Rhino 6)

Hi,
the next piece of code is systematically crashing my Rhino WIP

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
import Rhino.Geometry as rg
import System

for layer in Rhino.RhinoDoc.ActiveDoc.Layers:
    matIndex = layer.RenderMaterialIndex
    Rhino.RhinoDoc.ActiveDoc.RenderMaterials[matIndex] #this lookup seems to be the culprit

Rhino 7 SR0 2020-4-7 (Public Build, 7.0.20098.14255, Git hash:master @ 722815a2cc6d608c61fa901937505fe0bb80df0f)
License type: Commercial, build 2020-04-07
License details: Cloud Zoo
Expires on: 2020-05-22

Windows 10.0 SR0.0 or greater (Physical RAM: 32Gb)

Non-hybrid graphics.
Primary display and OpenGL: NVIDIA Quadro RTX 5000 (NVidia) Memory: 16GB, Driver date: 1-31-2020 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 442.23

OpenGL Settings
Safe mode: Off
Use accelerated hardware modes: On
Redraw scene when viewports are exposed: On

Anti-alias mode: 4x
Mip Map Filtering: Linear
Anisotropic Filtering Mode: Height

Vendor Name: NVIDIA Corporation
Render version: 4.6
Shading Language: 4.60 NVIDIA
Driver Date: 1-31-2020
Driver Version: 26.21.14.4223
Maximum Texture size: 32768 x 32768
Z-Buffer depth: 24 bits
Maximum Viewport size: 32768 x 32768
Total Video Memory: 16 GB

Rhino plugins that do not ship with Rhino
C:\Program Files\Chaos Group\V-Ray\V-Ray for Rhinoceros\V7\VRayForRhino.rhp “V-Ray for Rhino”

Rhino plugins that ship with Rhino
C:\Program Files\Rhino 7 WIP\Plug-ins\Commands.rhp “Commands” 7.0.20098.14255
C:\Program Files\Rhino 7 WIP\Plug-ins\rdk.rhp “Renderer Development Kit”
C:\Program Files\Rhino 7 WIP\Plug-ins\RhinoRenderCycles.rhp “Rhino Render” 7.0.20098.14255
C:\Program Files\Rhino 7 WIP\Plug-ins\rdk_etoui.rhp “RDK_EtoUI” 7.0.20098.14255
C:\Program Files\Rhino 7 WIP\Plug-ins\rdk_ui.rhp “Renderer Development Kit UI”
C:\Program Files\Rhino 7 WIP\Plug-ins\NamedSnapshots.rhp “Snapshots”
C:\Program Files\Rhino 7 WIP\Plug-ins\IronPython\RhinoDLR_Python.rhp “IronPython” 7.0.20098.14255
C:\Program Files\Rhino 7 WIP\Plug-ins\RhinoCycles.rhp “RhinoCycles” 7.0.20098.14255
C:\Program Files\Rhino 7 WIP\Plug-ins\Grasshopper\GrasshopperPlugin.rhp “Grasshopper” 7.0.20098.14255
C:\Program Files\Rhino 7 WIP\Plug-ins\Toolbars\Toolbars.rhp “Toolbars” 7.0.20098.14255
C:\Program Files\Rhino 7 WIP\Plug-ins\3dxrhino.rhp “3Dconnexion 3D Mouse”
C:\Program Files\Rhino 7 WIP\Plug-ins\Displacement.rhp “Displacement”

Have you tried disabling V-Ray and running the code?

thanks @Helvetosaur,
I tried disabling vray, uninstalling vray + OS restart, tried in Rhino 6, tried also filtering the matIndex this way:

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
import Rhino.Geometry as rg
import System

for layer in Rhino.RhinoDoc.ActiveDoc.Layers:
    matIndex = layer.RenderMaterialIndex
    if matIndex >=0:
        Rhino.RhinoDoc.ActiveDoc.RenderMaterials[matIndex]

this crashes Rhino6 & Rhino7 everytime. It chashes running it from both RhinoPython and GHPython
I see that other people is having issues with RenderMaterial table’s GetItem method

Hi @aitorleceta,

This seems to work:

import Rhino
import scriptcontext as sc

for layer in sc.doc.Layers:
    rmi = layer.RenderMaterialIndex
    print rmi
    if rmi >= 0 and rmi < sc.doc.RenderMaterials.Count:
        rm = sc.doc.RenderMaterials[rmi]
        print rm

I’ve logged the crash bug:

https://mcneel.myjetbrains.com/youtrack/issue/RH-57879

– Dale

1 Like