MAXScript getting an overview of what's in a 3ds Max scene file

By - - 3ds Max
Duration
2 mins
Last modification: 4 Oct, 2017

The script: face_count_analysis.ms (Click here to download) will print three sections in the MAXScript Listener:

  1. a line with the number of objects and the total number of faces in the scene,
  2. a section which shows the objects with largest number of faces (prints a maximum of ten objects),
  3. a section which shows the groups of objects with the same number of faces (again limited to the ten largest groups). Notes 1. these groups are not 3ds Max groups! 2. it only checks for the number of triangles, so very different object with the same number of faces will be grouped together.

Using an example scene with 101 spheres, boxes and teapots you get the following output:

scene_stats()
number of objects = 303 , total number of faces 201596

top ten largest objects:
name = Teapot101, faces = 1024, percentage = 0.5
name = Teapot100, faces = 1024, percentage = 0.5
name = Teapot099, faces = 1024, percentage = 0.5
name = Teapot098, faces = 1024, percentage = 0.5
name = Teapot097, faces = 1024, percentage = 0.5
name = Teapot096, faces = 1024, percentage = 0.5
name = Teapot095, faces = 1024, percentage = 0.5
name = Teapot094, faces = 1024, percentage = 0.5
name = Teapot093, faces = 1024, percentage = 0.5
name = Teapot092, faces = 1024, percentage = 0.5

top ten largest groups:
faces = 1024, objects = 101, total = 103424, percentage = 51.3
faces = 960, objects = 101, total = 96960, percentage = 48.1
faces = 12, objects = 101, total = 1212, percentage = 0.6
OK

This can be helpful when you get a large scene file and need to optimize the scene (for rendering, for VR etc)..

First check if there are single objects with lots of triangles. In this case the largest objects use just 0.5% of the triangles of the scene, so nothing stands out that requires investigation. If there are objects that use more than 10% of the scene file they're worth investigating (can you optimize them, simplify them etc).

Secondly check the groups, similar like in the first step check any group that uses more than 10% of the scene's faces and see if you can optimize those. An option may be to replace complex geometry with a simpler version. As mentioned in the 2nd note: make sure you check that the objects are really the same and not just happen to have the same number of faces. In the above example that means looking at simplifying the teapots and spheres will have the biggest impact on the scene.

In a future post I'll go over how the script was written.

 

Posted By
Published In
Tags
  • 3ds Max
  • Film & VFX
  • Games
  • Design Visualization
0 Comments
To post a comment please login or register