Hi,
I’m currently working on a Simple Object2 C++ plugin. Without going into details it just generates some meshes.
The plugin will be commercial, but I also want to make a free demo, that’s why I want to draw the generated meshes using the GraphicsWindow::triangle() functions so that the user can see the mesh, but can’t render it and do anything with it except seeing it in the viewport.
Is it a safe solution? Is there no chance that someone using the demo can extract this mesh somehow?
[SDK] Is there any way to extract mesh drawn by RedrawViewsCallback?
You want to cheat … so leave the same chance for others to cheat too 
Well… let’s be serious. The SimpleObject2 is a geometry plugin and has to return a TriMesh at least. It’s up to you what to return. And it will be the only mesh that others can get.
If it’s a simple plugin, you can noodle with the legacy display functions…but in reality what you’ll really want to do is implement the various Nitrous display methods, which allow you to send any arbitrary mesh to the GPU without exposing that same mesh to SimpleObject2 methods, collapse functions, rendering, etc.
The benefit of the Nitrous methods is that you can also instance your geometry. So you could display 100,000 teapots in realtime, because you only need to send 1 teapot to the GPU and a list of transforms.
Examples of how to do these things are in the SDK. It’s a mildly complicated process but once you get the hang of it, it will all make good sense.
try
MyObject::IsRenderable() { return FALSE; }
and
MyObject::ConvertToType(TimeValue t, Class_ID objtype) { return NULL; }
oh and
MyObject::CanConvertToType ( Class_ID obtype ) { return FALSE; }
What about SnapshotAsMesh called on such object? Or export the object to .obj for example and reimport?
it can’t be snapshotted as it can’t be converted to mesh. Like wise with any exporter it would need to convert it to a trimesh first before it’s exported. You could provide your own trimesh to your class on the off chance theres an export out there that directly gets the mesh from SimpleObject2 without calling ConvertToType first. But that is so unlikely.
Will it become convertible if someone curious enough just patch a couple of plugin dll bytes to something like this?
MyObject::CanConvertToType ( Class_ID obtype ) { return TRUE; }
Couldn’t you just create a very basic plugin for testing and open a Challenge thread for those who may want to extract the mesh in question?
as I said above you have to override mesh property. all other methods are just ‘decoration’.
ConvertToType, GetRenderMesh… are all up to you what to return.
without your code it’s very unlikely that someone will be able to find your ‘real’ mesh. (but I don’t say it’s impossible
)
you have to understand that by ‘hiding’ your real mesh you make your object not convertable and not collapsable. Also it can’t be used in any mesh edit or deform modifier plugins.
In general, it will be a nasty object in terms of its presence in the scene. 
You could never hide it from anyone with a bit of knowledge and the determination to find it, I’m pretty sure I could find any mesh structure in max’s memory from say the vs debugger. I know what to look for and how to find it. A bit of Copy and paste and it wouldn’t take much to hard code it in the sdk or even via mxs. So just making it difficult for the average user should be as far as you should go.
Couldn’t you even hook the 3d surface and retrieve the mesh from there?
Also, if you make the mesh unavailable for rendering, modifiers, etc. what would the purpose of the demo be?
If the user would be limited to only change the parameters of the object, what would the difference with a fully featured video be?