Need Mesh Statistic Info for SL users.

I'm requesting a scripter to write a simple 3Ds Max's statistic info for selected object that provide selected mesh/object it's "weight".

We would like to see statistic weight of the creation before we have to upload them onto Second Life. It would make workflow much easier and quicker.

However, Linden Lab, maker of Second Life did not make it simple formula to find its weight, which is bound to ask for more information about Second Life in general. I can try my best to provide more information about their formula.

First of all, there 4 type of weight scoring for each object/mesh.

Streaming weight.
Server weight.
Physics weight.
and Rendering weight.

The most complex problems would be Streaming weight, due to LODs. Server Weight is not required since it complexity of the mesh does not affect it.

You can find more information about these weights here.

It may be impossible to get perfect weight data getting by SL's LOD generator, but at least wouldn't mind having some educated guessing range.

It doesn't have to be all complete set of objects/meshs in order to see its weight. An object could be reviewed as one weight for intended use or be optional choices between few LODs stage or as physic.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
LittleLordPotala's picture

SL Statistics

I finished the Physics part and I grouped all modules in one window.

On Wiki, it's written that some "values are subject to change".
These values are normaly considered as constant but, maybe, you can check
in your SL-application setting the following values :

max_distance = 512.0 --(maximum visibility distance)
MeshMetaDataDiscount = 384
MeshMinimumByteSize = 16
MeshBytesPerTriangle = 16
max_area = 102932.0 --area of circle that encompasses region

Any modification in these values gives a complete different result.


Corrected some bugs

About the physic weight, if you use some primitives (box, sphere and cylinder),
do not convert these to editable_poly or editable_mesh before launching the statistics, because a primitive has a lower physic cost than a custom mesh.
You can convert the primitives when your work is finished, just before uploading to the SL server.

Added a protection if you select more than 4 LODs

AttachmentSize 8.03 KB 8.07 KB 8.18 KB
Nacon's picture

Sorry for long delay

Took the time to do some testing and also tested with these new scripts you just provided.

Physic is way off the chart. I knew it won't be easy to deal with. Like you had said about convex hull with MassFX, might be best way to go, even if it's going to require latest version of Max. Maybe two versions of this script, one without physic for older versions.

As for Streaming Cost... few things.
Calculation doesn't match up, not sure where it went wrong.

I think we must have to have 4 LOD buttons for it because we don't have the options to choose less than 4. Which I believe using the same mesh for 2 or 3 LODs actually affect the weight.

And last thing is... LL (Linden Lab) has recently updated their beta viewer that seem to broke their streaming cost info in build mode. I can use older/stable viewers but I have a feeling that they're changing something. May have to wait till next Monday for their office meeting that they have in SL, where users can discuss with LL's developers. Will have to poke them about it.

Let me know if you have questions you want me ask them about. Thanks!

LittleLordPotala's picture

Yes, one question...

You can eventually ask the developpers to give the complete mathematic algorythm to calculate the different costs, and that, in a way that everybody can understand and use for programming in any language (like maxscript).
So, this includes the exact values of each constant variable and their meaning.
Then, calculation will really match up.

Best regards.

Nacon's picture


Forgot this Monday is Holiday. Will have to ask them next Monday. Maybe tomorrow from a different developer's office, that isn't quite related to mesh project.

LittleLordPotala's picture

I have one question :

About the physic weight, how do you create the physic shape ?
Do you make it manually in 3ds or do you use the automatic presets generated online by the server ?
In the script, I need a reference of the physic shape, because if I have to write an automatic physic shape generator with 4 presets, it's a lot more job !

Thanks for this precision.



If you use MassFX to generate the physic shape, it's easy to get the trimesh value and then use it to calculate the physic weight.
Or, I can use MassFX to automatically generate it.
It seems to use a similar generator as the SL server, it has primitives, composite and original mesh.
The downside is that it will only work on 3ds Max 2012.

LittleLordPotala's picture

One value corrected

I changed a value to calculate the wheight in bytes for the LODs.
This value was given on "", but it was difficult to find it.
Of course, it gives a different result...

AttachmentSize 5.51 KB 4.29 KB
Nacon's picture


Ahh, I'm glad you decided to pick this one up.

It's coming together pretty well, just as I've been looking for. Will have to do some test to see if the data cost matches up. I've realized that Rendering Weight may not be as importance for most builders when minding over prim count. Surely will help non-videogame developers understand little more about it.

Any luck with physic weight part yet?

Might save some screen space if we could merge both Rendering, Streaming and Physic into one window once Physic weighting's done. Maybe a checkbox for pairing all LODs to the High LOD pick?

Will do some testing for any type of polygon/triangle formation to see if they differ on SL. The info on wiki could be outdated as mesh prim are still in progress and refining, but I think it's actuate so far.

Thank you very much for your time. You're gonna make a lot of people on Second Life happy. :)

LittleLordPotala's picture

Hi !

I know that it can be better.
(Notice: It's not my priority neither my first job to write scripts...
So I do it when I have time.)

I'm not a magician and, on Wiki, there is a lot of beautiful phrases but I need more source codes. And if you tell that it's a bit outdated, where can I find more recent informations ?

Is there a place where they give clearly the exact value of each variable with the complete algorithm to calculate the weights ? I cannot invent it...

About "grouping all in one window" is a good idea for the a final version and it's not a big deal.

Concerning the "checkbox for pairing all LODs to the High LOD pick", actually, do you know that you don't need to pick every LODs to calculate the weight ? If you only pick the High LOD, the script will assume you have the same on each LOD...
The shema is :
You Pick LODs -> you get LODs
High -> High+High+High+High
High+Mid -> High+Mid+Mid+Mid
High+Mid+Low -> High+Mid+Low+Low
High+Mid+Low+Lowest -> High+Mid+Low+Lowest

Or, maybe, you would like one pickObject button to select the four LODs in same time...
Anyway, for now, this question of "User Interface" is not the main problem.

I didn't forget the physic weight part, it's just more complicated, so I need more time !

Now, I'm also waiting the results of your test with the SL server.

LittleLordPotala's picture

Script for Mesh/Rendering Cost

This script is quite similar to the one for "Streaming cost" but it has different
options and multipliers.

If I misunderstood some parameters, feel free to change the script (if you understand better than me).


corrected the reset button

AttachmentSize 5.42 KB 5.45 KB
LittleLordPotala's picture

Script for Streaming cost

I have translated for Maxscript the code given on "".
It gives a result of the "Streaming cost" in "Prim parcel cost" of an object composed of 4 LODs (High, Mid, Low, Lowest).

If you just give the high LOD, it will assume that you have 4 times the same.
If there is only the High and the Mid LODs, then the Low and the Mid LODs will be the same as the Mid LOD, and so on...

I'm not 100% sure if the result will be the same on the SL server...

I made it with a interface, so just run the script and click the buttons !

AttachmentSize 3.77 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.