Group All And Set Node Name from File

Problem I’m solving

This is another one of the script that you can do it manually, but in case you’re looking to do some automation, consider this a snippet that can quickly help you.

Solution

This script group all objects in the scene and rename the ‘group node’ to be the file name.

Installation

  1. This is a snippet, you can’t install it, but you can use it as code.
  2. In case you download the script and decided to throw it into the viewport, it’ll proceed right away.

Code (Maxscript)

global MC_grp
MC_grp = for i in objects collect i
MC_selgroup = group MC_grp


MC_selgroup.name = ((getFilenameFile (maxFileName)) + "_" +  (random 1000000 9999999)as string)

select MC_selgroup

Images