But there is a problem with other data structures.
Point3d type is loaded without problem, but Pointcloud data structure searches for other dll from c++.
In order for any of this to work, Rhino itself needs to be loaded into the Unity process (Rhino.Inside). Once Rhino is loaded, then the C++ DLLs that things like pointclouds are trying to access will be available.
That is what this code is attempting to do:
It sounds like that code is not properly executing and loading Rhino on your system.
Hi @stevebaer@fraguada , thanks for the amazing work with Rhino.Inside. I am running the 2 samples successfully. I am mostly trying to work in sample2, as I want to use grasshopper and visualize real time in Unity. I am trying to follow what you did with Unreal but I am having a hard time as I have absolutely no idea how Ureal works. Would it be possible for you to upload similar documentation (which is amazing) for Unity as the one you have here:
@stevebaer@fraguada the Sample files for Unity are great. In playing with it I am trying to write conversion functions that take the mesh vertices current colors and convert them to unityengine.color types. The code I wrote appears to be fine but I have the recurring issue of not being able to access System.Drawing.Color. Hoping you could provide some insight as to why.
I’m not sure if System.Drawing is supported on Unity. You may want to check with Unity on their forums.
As an alternative, I could add a function to give you the list of vertex colors as a list of integers that you could then convert into Unity Colors. Just let me know if this is something you need.
I took some Unity programming classes at my local library. It’s a nice engine, but unlike Id-family engines, it doesn’t support NURBS, which is a real killjoy for level design as an art.
With a few ladditional texture-maping methods for repeating textures, nowdraw materials, and a little material-preview work, Rhino could be the defacto computer game level design tool.
Unity use its own system.drawing. Rhino normally references this dll somewhere in pc, while unity wants to compile everything in one package. Just remove that reference and use the unity one.
I had the same issue. Just need to add the System.Drawing dll in your assets. You don’t need to download from external source, it is already in your system. In these folders (or similar of course)
static public Color ToHost(this System.Drawing.Color c) => new Color(c.R,c.G,c.B);
And for the mesh vertex colours add:
static public List<Color> ToHost(this MeshVertexColorList colors)
{
var result = new List<Color>();
foreach (var c in colors)
result.Add(c.ToHost());
return result;
}
@stevebaer FYI got around it by sending the colors as a text string that gets parsed and assigned to vertex colors in Unity . Then assigning a material that uses the ‘Particle/Standard Surface’ shader previews the mesh correctly. This may be a useful temporary solution for those faced with the same problem.