Instance Tool

51 votes
Version: 
2.6
Date Updated: 
09/23/2020
Author Name: 
Matan Halberstadt

Instance tool analyze the geometry objects in the scene and finds groups of objects that could be represented as instances of one of them. Then the user can turn every group into actual instances and choose which object from the group will be preserved. The objects in the group are objects that have the same topology (could be morph targets of one another) and the difference between them could be described with transformation alone. After making a group into instances, all the objects in the group except the master object will become instances of the master and a new transformation value (position rotation and scale) will be applied to transform them back to their original shape and orientation.

 

The advantages of using instances over just copies of objects are:

  1. It saves storage space.
  2. It saves memory.
  3. It saves render time.
  4. It saves work time (modifying one instance effect all of them, like uv mapping).

 

Updates:

version 2.6

  • fix an error with corona scatter

version 2.5

  • fix for the "undefined to integer" error (tested and confirmed on 2019)
  • fix for issues with "preserve pivot"

version 2.4

  • Added Group by Material ID checkbox - if checked, only objects with the same material ID setup will be grouped as instances.
  • UI is now resizeable on the height axis.

version 2.3

  • Added Group by Scale checkbox - if checked, only objects with the same scale will be grouped as instances.
  • Added Group by Material checkbox - if checked, only objects with the same material will be grouped as instances.

 version 2.1

  • "-- Unknown property: "getName" in undefined" error message in early max versions is now fixed.

version 2.0

  • All mesh geomety is now supported including Editable mesh, Editable poly and primitives.

Installation:

 

  1. Drag and drop the mzp file into the viewport, the tool will pop up.
  2. Go to Customize -> Customize user interface.. -> Toolbars tab
  3. Under the category "Snowball VFX" you will find the InstanceTool, drag it into a toolbal.
  4. Enjoy.

 

 

UI description:

 

  • Get groups Button: analyze the scence and collect the potential groups. In no objects are selected, the whole scene will be analized, but if there are selected objects, only groups containing at list 1 selected object will be created (this will take less time).
  • Tolerance Spinner: set the maximum distance alowed for every vertex of an object to move from it's original location in order to become instanced to another object.
  • Ignore hidden objects CheckBox: If checked, it will ignor hidden objects.
  • Random wirecolor per group CheckBox: if checked, every group will recieve a unified  random wirecolor.
  • Instance selected group Button: Make the selected group in the Groups listbox into instances of the master object.
  • Instance all groups Button: Make all groups into instances.
  • Groups ListBox: Shows all the found groups after the analyze is done, and let the user select a group. Double clicking the group will select the objects of the group in the scene.
  • Remove selected group Button: Delete the selected group from the list.
  • Group Membets ListBox: Shows the objects in the selected group. Selecting an object from the list will select it in the scene. Double clicking an object in the list will set it to be the master (the master is the object that has the prefix ">>" in the list. This is the object that will not be changed at all when instancing the group, all the other objects will become instances of it).
  • Remove selected Object Button: Delete the selected object from the group.
  • Attach selected group Button: Attach all the members of the selected group into one mesh.
  • Attach all groups Button: Attach all the groups, every group will become one mesh.
  • Detach selected objects Button: this option is only available if you are running snowball pipeline for now.
  • Select instances: Select all the instances of the selected objects in the scene.

 

Instance tool UI

 

Links:

http://www.snowballvfx.com/

http://cargocollective.com/matan#1450373/Instance-tool

Version Requirement: 
Tested on 3ds Max 2019
Video URL: 
AttachmentSize
instancetool_dragdrop.mzp110.32 KB
instancetool_help.pdf88.78 KB

Comments

Comment viewing options

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

undefined type integer

Hello Matan, thanks a lot for your time saver script ! very usefull !
I also have the error "undefined type integer" using 3ds max 2019. I tried to download your last version 2.4.1 if that could fix this error but the script remains in version 2.4 from 2016. Could you help me with this ?
Cheers !

Thomas

Madgik51's picture

A strange Problem

Hi,
First i want to thank you for your amazing script.

I use your script like 'hypersapien', for game engine purpose. Im going to give you plz some steps to reproduce the problem.

1.Create a box and convert it to editable poly

2.Detach all faces and delete the original box that is empty.

3.Open your tool then "Get Groups" check "Reset Transform controller" and "Preserve Pivot" then "Instance Groups"

4.You will notice that the created instances are not perpendicular but like slightly rotated <= This is the problem

5.Click on "Hierarchy -> Pivot -> Affect Object only -> Center to Pivot"

This Result is what I get on the game engine, the instances are all rotated with some percentage (not the original one); so they are not 'snapped'

Plz see if there is some steps that maybe can solve the problem before using your script. I tried to do xform before your script, but it doesnt help

Thank you very much

xStatic's picture

Simply irreplaceable script!!!

Thank you very much, Mr. Halberstadt!)

arak's picture

Can't live without it

Can't live without it anymore!

Thanks!!!

mitchfx's picture

Ignore Hidden Objects checkbox triggers Get Groups

GREAT TOOL!!! One small bug I've found that if you uncheck the "Ingore Hidden Objects" option, the script will trigger the GET GROUPS action automatically even if you are not ready to do that yet. In large scenes this can take several minutes and makes it seem like the script is frozen.

Thanks for the awesome script!

alexish657's picture

Problem with conservation of UV.

Hi there,

your scripts is seems to work in most of the cases.

However, I presently have a situation where the UV's are not preserved when I transform the individuals meshes into instanced meshes.

I'm trying to optimise some planes that are used to created hair on a character head. So originally there is like 6 planes that are instanced many times (250+) on the head of the character.

I need to corrected the geometry of these planes. So you script is perfect for this situation. I proceed like this.

I detach all the planes from the original hair mesh. I got after that almost 250 individual planes with the same material on it. Then, I use your script to turn the meshes into instancied ones. However, the majority of the now instanced plane see their UV messed up.

Do you a way that I can secure or lock the UV as it is before I use your script ?

thank you

Matan's picture

Hi hypersapien, sorry for the

Hi hypersapien, sorry for the late answer.
I don't have Max 2017 so I can't test it out but I just updated the script with something that might just fix the issue. Please let me know if it now works

visit my portfolio at http://cargocollective.com/matan3D

hypersapien's picture

Me too

I also get the problem about "unidentified type: integer". Before I was using Max 2012 and had no problems, but recently I updated to Max 2017 and now this problem occurs.

The only work around I have found is to limit it to running the tool on smaller groups of objects at a time- rather than the entire scene all at once. It seems there is some object(s) in the scene that just break it, but I haven't been able to figure out which.

Medart123's picture

Love this!

This is a great tool. Thank you!

stevirt's picture

Saved my bacon!

Thanks a million! I had my son place a few thousand meshes in a scene. Had to be positioned just right so it was not a fast or easy task. At the end his file was over 350,000 mb. Ouch! I knew immediately that he had copied instead of instanced. There were only 4 different meshes, each with it's own material. I found this plugin and was very skeptical. It was fast and worked to perfection. New file size : 29,000 mb. Thanks again!!!

Comment viewing options

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