vwb
(Victor)
13 June 2024 19:10
1
Hello!
The hack continues, and also the struggle. Our custom Rhino (Compute) converter is having issues converting the RhinoObjects directly, it converts to null, so far we have been passing the ro.Geometry and it works fine.
You can check the code here: ark/Ark.Rhino/MyRhinoPlugin1/Converter.cs at 19ef7bde19f9bcfc01ac23297047706ccd5d2e3f · vwnd/ark · GitHub
And I am using a simple rhino logo model with 6 meshes to test.
hello_mesh.3dm (913.8 KB)
Do you know what I am missing?
teocomi
(Matteo Cominetti)
14 June 2024 10:25
2
Are you able to debug or access the conversion log?
I think something unexpected might happen here, making the conversion fail, and so the result is null:
Base schema = null;
var notes = new List<string>();
// get preprocessing setting
var defaultPreprocess = PreprocessGeometry;
try
{
switch (@object)
{
case RhinoObject ro:
var roId = ro.Attributes.GetUserString(ApplicationIdKey) ?? ro.Id.ToString();
reportObj = new ApplicationObject(ro.Id.ToString(), ro.ObjectType.ToString()) { applicationId = roId };
material = RenderMaterialToSpeckle(ro.GetMaterial(true));
style = DisplayStyleToSpeckle(ro.Attributes);
userDictionary = ro.UserDictionary;
userStrings = ro.Attributes.GetUserStrings();
objName = ro.Attributes.Name;
// Fast way to get the displayMesh, try to get the mesh rhino shows on the viewport when available.
// This will only return a mesh if the object has been displayed in any mode other than Wireframe.
vwb
(Victor)
14 June 2024 11:46
3
I am able to debug, but not sure how I could access the conversion log? Do you have any tips?
teocomi
(Matteo Cominetti)
14 June 2024 14:43
5
This is the logger object; inspecting it might reveal something: speckle-sharp/Objects/Converters/ConverterRhinoGh/ConverterRhinoGhShared/ConverterRhinoGh.cs at e28f84e62b3582a135fbd292207ebdc6a9f4088e · specklesystems/speckle-sharp · GitHub
Otherwise, by putting breakpoints between L172-202.
Note that debugging converters is MUCH easier if you directly reference the csproj instead of using the nugets.
1 Like
vwb
(Victor)
14 June 2024 18:09
6
Thanks for the help Matteo! I was able to find the issue and resolve!
Before → After
I have added the changes to a tiny request here, hope it helps! It helped me a lot!
fix: if headless use original material by vwnd · Pull Request #3511 · specklesystems/speckle-sharp (github.com)