TextureMapping in RhinoCommon Plugin: Performance Concerns in Rhino 8

Hello everyone,

I have developed a plugin in Rhino7 using RhinoCommon in C# and am currently working on creating a plugin version for Rhino8. One of the functionalities in this plugin involves assigning and modifying texture mapping. While the functionality works smoothly in Rhino7, I’ve encountered two specific efficiency issues in the Rhino8 version. I would like to seek assistance in understanding and resolving these problems.

  1. Texture Assignment Code Efficiency: In Rhino7, I use the following code to assign texture mapping:

csharpCopy code

resultInt = obj.SetTextureMapping(channel, tm);

Here, tm is a serialized mesh obtained using obj.GetMeshes and then deserialized and assigned back. The process is significantly slow in Rhino8, sometimes exceeding 10 seconds under certain mesh conditions. It’s important to note that this texture mapping axis is a custom object created by my plugin.

  1. Redraw Time After Texture Modification: I also perform modifications to the texture mapping axis within the plugin. After modification, I use the same code obj.SetTextureMapping(channel, tm); to assign it back. The assignment is fast, but when I invoke view.Redraw(), the redraw time becomes excessively long. I would appreciate insights into the reasons behind this delay and any suggested improvements.

Additionally, I’ve noticed that our plugin experiences slower performance under .NET 7.0 or .NET 4.8, but it performs normally in Rhino7.

Rhino8 Version:8.2

Your assistance in resolving these performance issues would be greatly appreciated. Thank you!

Closing this as there is a newer thread here: TextureMapping Performance in Rhino 8 Problem