is there any chance to determining the “Casts shadows” and “Receives shadows” property like shown in the Properties?
It is not in the attributes nor on mesh of the objects. In the whole SDK is no hint for shadows. Even the Render API has nothing about shadows. Is there something else to get this information?
Dim ObjRef As Rhino.DocObjects.ObjRef
ObjRef = New Rhino.DocObjects.ObjRef(myID)
Dim myObjAtts As Rhino.DocObjects.ObjectAttributes = ObjRef.Object.Attributes
but in myObjAtts I can’t find rendering attributs. Or how can I get this render attributes.
Oops, what I said is about C++.
According to C++ a rendering_attributes object should be located in myObjAtts.
Maybe someone that uses this language can help.
I found an ugly trick, to get a selection of all Recieving and Casting Meshes:
(My level of suffering was high enough, to use this)
Dim myDoc As RhinoDoc = RhinoDoc.ActiveDoc
Dim myIdsCast As New Rhino.Collections.RhinoList(Of Guid)
Dim myIdsRec As New Rhino.Collections.RhinoList(Of Guid)
Dim settings As New Rhino.DocObjects.ObjectEnumeratorSettings()
settings.ObjectTypeFilter = Rhino.DocObjects.ObjectType.Mesh
For Each obj As Rhino.DocObjects.RhinoObject In myDoc.Objects.GetObjectList(settings)
Rhino.RhinoApp.ClearCommandHistoryWindow()
Rhino.RhinoApp.RunScript("SelID " & obj.Id.ToString, True)
Rhino.RhinoApp.RunScript("-Properties o ReceivesShadows _Enter CastsShadows _Enter _Enter _Enter", True)
Rhino.RhinoApp.RunScript("SelNone", True)
Dim myHistory As String = Rhino.RhinoApp.CommandHistoryWindowText
If myHistory.Contains("Receives shadows <Yes>") Then
myIdsRec.Add(obj.Id)
End If
If myHistory.Contains("Casts shadows <Yes>") Then
myIdsCast.Add(obj.Id)
End If
Next