[Closed] [Beginner question] Edit an object's mesh
I have an Editable Mesh object with an Edit Mesh modifier and I want to use to modifier to edit the geometry of the object. The changes should only affect the modifier, so if I remove the modifier, the original geometry should be restored.
Which variable I’m supposed to use if I want to edit the Mesh of the object?
It seems that I can read the $.mesh variable but changes to it seem not to have any effect. If I use the $.baseobject.mesh it seems to change the objects geometry, not only the geometry provided by the Edit Mesh modifier, but it also crashes 3d max sometimes
I couldn’t find any useful information to that in the MaxScript help, so I would be glad if someone could point out the basic ideas of editing an object’s mesh.
Thanks,
Chris
There is no useful information to be found on this topic, you cannot script the Edit Mesh modifier. This has been a limitation since Max 2.0. Btw, in those days the Yost Group was considering removing the Edit_Mesh from Max 2 but it was left for backwards compatibility.
You can only edit a mesh at the base level, or partially using the Edit_Poly modifier.
Now I’m confused because ther eis no Edit_Poly modifier in Version 6. But the script has to be compatible with 3d max 6…
Basically I try to implement the ExtrudeEdgePro script ( http://www.xsi-blog.com/?p=93 ) with MaxScript. I have to edit the mesh of the object and I want to restore or modify the original geometry later, so I decided to implement it as an modifier. Or is it possible to use the SimpleObject instead?
Actually, it was intended to be an extension to R6 but for various reasons was delayed until R7 when it shipped officially.
Well, the only solution would to first convert to object to a Poly Object, I guess… That’s not very smart because all the construction history will be deleted. Maybe I find another solution using a Geometry object plugin instead of a Modifier plugin.
You can only edit a mesh at the base level, or partially using the Edit_Poly modifier.
This seems strange because most of the modifiers change the object’s geometry. The slice modifier, for example, cuts the object apart if enabled, and restores the original geometry if disabled. So it somehow keeps a copy of the original mesh and applies changes to it. How can I do something like that with my own modifiers?
You write your own modifier in C++ using the SDK, the way they are supposed to be created.
Most modifiers operate on the incoming geometry and output the result. Edit_Mesh also does this. It is just that it was never exposed to MAXScript, so you cannot do what you want using scripting.
Thank you, Bobo! This is not what I expected, but it helped me a lot. I have no experiences with C++ but I’m sure I will find a solution with MaxScript.