Notifications
Clear all

[Closed] Useful mxs sdk extension functions

ah, they must have optimized their method or used the surfwrap one, as in 2010 the times for native are considerably worse 5124ms compared to 1052ms you’re getting.

i did some experimenting with sdk built-in IntersectRay methods. as i remember the Mesh’s one works faster than GeomObject’s. so i take a mesh on mxs level and pass it to sdk intersect function. it makes everything much faster when you need to process the same mesh many times (for example project one mesh onto another).

after struggling to find “suitable” solutions for a tool I was working on (third party libraries too cryptic, dotnet not supporting tga and alpha being all over the place, calling photoshop to do it was too slow and clunky) I went back to using max bitmaps, which has the side effect of creating a set of rotate functions as renderMap doesn’t handle alpha either, here’s the 90 cw version…

will process 1024×1024 in about 700ms, not earth shattering but about 10x faster than a mxs function. I’ll leave out the ccw, 180 rotate, horizontal flip and vertical flip out as they are trivial alterations.

part of the same tool required to match how max matches multi materials to face matids. pretty easier to do in mxs but useful functions are easier to keep and maintain in a script extension.
seems to work i all the tests, though it will probably fall over somewhere…

it’s worth noting the display material if the resultant material has submats is always the first sub material

there is an interesting and useful utility class in the uvwxform.cpp in the modifier project of the samples TvMap. Thought I’d show it in operation in simple but effective function. Detaching mapfaces, ie adding all the correct verts and keeping the face topology correct when creating an new uvw face element. In my own projects I moved tvmap class into it’s own include. Most of the code is directly from uvwxform.cpp

the polyop variation is pretty simple implementation

returns the a single edges verts in the correct order as a point2

They should make this a sticky really good stuff here.

Here a lot of good functions. I want use some of this but have no experience with SDK to compile own extension Please point me how to create it, where to start?

Start with the example Maxscript extension project in the SDK documentation… and also read the relevant sections of the SDK.

Thank you.

Also, this thread have step by step solution http://forums.cgsociety.org/showthread.php?t=1240479

Page 12 / 18