SyncOrSwim
02-08-2005, 09:47 PM
Hey,
I've just recently started exploring MAXscript, and i seem to have run into a bit of a problem with the "meshop.cloneVerts" method.
The script i'm trying to produce is a basic mesh exporter to put geometry into my own game rendering engine. I'd like to be able to preserve smoothing group detail through my export, which requires me to duplicate vertices wherever a hard edge between two differing smoothing groups appears.
Now i thought I had this cracked with a simple enough algorithim to identify such areas and manipulate the geometry as needed. All seemed to be going fine up untill the point I tried to clone a vertex using the above mentioned method.
I have the index of the vertex I wish to clone (i), and a variable that references my mesh object (obj). From what i can gather reading through the help, a simple call to (meshop.cloneVerts obj i) would appear to be what i want. Only that doesn't seem to be having any effect. The method returns success (OK), but the mesh information remains the same, backed up by calls to (meshop.getNumVerts obj) confirming that the vertex count hasn't changed.
My initial thoughts were that my variables were screwed up (afterall coming from a C/C++ background working without type checking can be a little problamatic!). However, i can make calls such as (meshop.deletVerts obj i) and (meshops.breakVerts obj i) fine, both of which effect the geometry as expected.
Now this seems a bit of a stupid problem to have been stumped by, and i really am stumped at the minute. Before i start looking into more elaborate ways of breaking the mesh by the vertex and rebuilding faces I thought i'd try you guys for some help.
The fact that a quick trawl of the web turned up no information on either this problem or the "cloneVerts" method itself is a little worrying, so apologies if i'm missing something incredibly obvious. At the minute i'm prepared to risk looking a bit stupid as i really haven't a clue why this isn't working.
Any help would be much appreciated,
Cheers
Ben
I've just recently started exploring MAXscript, and i seem to have run into a bit of a problem with the "meshop.cloneVerts" method.
The script i'm trying to produce is a basic mesh exporter to put geometry into my own game rendering engine. I'd like to be able to preserve smoothing group detail through my export, which requires me to duplicate vertices wherever a hard edge between two differing smoothing groups appears.
Now i thought I had this cracked with a simple enough algorithim to identify such areas and manipulate the geometry as needed. All seemed to be going fine up untill the point I tried to clone a vertex using the above mentioned method.
I have the index of the vertex I wish to clone (i), and a variable that references my mesh object (obj). From what i can gather reading through the help, a simple call to (meshop.cloneVerts obj i) would appear to be what i want. Only that doesn't seem to be having any effect. The method returns success (OK), but the mesh information remains the same, backed up by calls to (meshop.getNumVerts obj) confirming that the vertex count hasn't changed.
My initial thoughts were that my variables were screwed up (afterall coming from a C/C++ background working without type checking can be a little problamatic!). However, i can make calls such as (meshop.deletVerts obj i) and (meshops.breakVerts obj i) fine, both of which effect the geometry as expected.
Now this seems a bit of a stupid problem to have been stumped by, and i really am stumped at the minute. Before i start looking into more elaborate ways of breaking the mesh by the vertex and rebuilding faces I thought i'd try you guys for some help.
The fact that a quick trawl of the web turned up no information on either this problem or the "cloneVerts" method itself is a little worrying, so apologies if i'm missing something incredibly obvious. At the minute i'm prepared to risk looking a bit stupid as i really haven't a clue why this isn't working.
Any help would be much appreciated,
Cheers
Ben
