I am writing a Rhino Plugin using RhinoCommon .NET SDK. I am trying to get an event whenever the mesh or it’s material or texture is updated. Is it possible to do that ? ( I am very sorry if it’s already discussed or documented. ) If possible, can you point to the link or sample code ?
There are a bunch of static events that you can subscribe to on Rhino.RhinoDoc, including:
// Called if an object is about to be replaced. Rhino.RhinoDoc.ReplaceRhinoObject // Called when all object attributes are changed. Rhino.RhinoDoc.ModifyObjectAttributes // Called when any modification happens to a document's material table. Rhino.RhinoDoc.MaterialTableEvent // Called when any modification happens to a document's rendering content Rhino.RhinoDoc.RenderEnvironmentTableEvent Rhino.RhinoDoc.RenderMaterialsTableEvent Rhino.RhinoDoc.RenderTextureTableEvent Rhino.RhinoDoc.TextureMappingEvent
Does this help?
@dale - is there a way to get the Mesh Id of the mesh who’s UV’s changed in the Rhino.RhinoDoc.TextureMappingEvent pls? Or do you need to query the currently selected meshes?
I guess you could query the currently selected meshes. You might need to iterate the document looking for meshable objects that are using the texture mapping id.
Thanks - I tried that and it works well.