[Closed] Get mesh from shape in buildMesh?
Is it possible to get a TriMesh from a shape instance without creating a scene node?
I’d like to do something like
t = createInstance text
m = t.mesh
This does not work of course. But I cannot create a scene node for the text shape, since I am in an buildMesh event of a scripted plugin, which does not allow to change the scene.
Thanks!
– MartinB
No, check this discussion:
http://area.autodesk.com/forum/autodesk-3ds-max/maxscript/simpleobject—geometry-from-text-shape/
Thanks a lot for that link!
Interesting thread, and indeed quite similar to what I need.
But I am not sure I would like to go to that extreme of using dotNet to get outline vector data from truetype fonts and triangulate them myself…
Any other ideas or pointers still very welcome!
– MartinB
Does that help you out ?
on buildmesh do (
tmp = TriMesh()
meshop.attach tmp (box())
setmesh mesh tmp
)
Thanks, but I am afraid not, since box() creates a new scene node, which is not permitted in a buildMesh event. :\
From the 2012 MXS docs:
The createInstance() method is used to directly create the box base objects. This method creates the geometry associated with the specified object, but does not create a node. This method is used since SimpleObject plug-in must not perform any scene related actions such as creating scene nodes or building modifier stacks.
That’s why I try to find a way to get a mesh out of a text shape without actually creating a scene node.
– MartinB
I don’t think it is going to work Martin. There just isn’t a mesh to grab unless you were to build it your self. What I’m thinking is you would get the same result as applying an editMesh modifier to the top of the stack. How you do that effectively I don’t know,
Maybe the source code for the extrude modifier is available to have a look at and determine how it is building the cap of the extrude. You will get the same errors of course that we see now when doing either of those two operations.
I was hoping for some trick to have 3ds Max create the mesh for me (as if you’d add an EditableMesh modifier to a shape, that’s definitely good enough) without adding it to the scene, just like ‘createInstance box’, which then has a .mesh property I can use to get the mesh.
– MartinB