View Full Version : Proper way for Mesh Collection?

07 July 2011, 02:26 AM
Hi, I'm a 3dsmax hobbyst, and I've been playing around with maxscript and exporting geometry ^_^

I kinda made stuff up as I went, so the coding is sloppy, but I was able to generate a wavefront OBJ file from my maxscript. I later altered the output code to a different format which deals with more specifics.. like materials, bones, vertex weights etc..

anyway I output my script for people to try and they're getting alot of weird problems. I believe the reason behind the problems is the way I am collecting the meshes vs the bones

here's the complete script

and here's my line for collection

getBone=for obj in $* where (isKindOf obj BoneGeometry) collect obj
getMesh=for obj in $* where (isKindOf obj Editable_Mesh) OR (isKindOf obj Editable_Poly) collect obj

oddlying enough a biped in 3dsmax isn't a bone class O_O and a box.. is well not an editable anything its just a box..

so if I use something like superclass almost anything is defined as a geometryobject, even my biped.

I was just wondering if anyone has any suggestions on better scene object collection.

right now to get around these I have to add "ORs"
getBone=for obj in $* where (isKindOf obj BoneGeometry) \
OR (isKindOf obj Biped_Object) \
OR (isKindOf obj Dummy) \
OR (isKindOf obj IK_Chain_Object) \
OR (isKindOf obj Point) collect obj

is there an easier way?

thanks for reading,


07 July 2011, 03:45 PM
I haven't looked at your script, but instead of all the ORs you could write

classesArr = #(box,sphere,torus,whatever)
for o in objects where findItem classesArr (classof o) > 0 collect o

CGTalk Moderation
07 July 2011, 03:45 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.