First of all, select the object in your 3D Studio Max scene, right click and Choose object properties.
Change the value of G-Buffer [Object ID]
Apply it for your all objects which you want to separate in render image.
Press F10 for render properties window.
Select Files button in the Render Output section,
Select the place to save your render and Select “RPF Image File (.rpf)” your file type,
When you press enter, you will see a RPF Image File Format window to set rpf properties.
Select 16 as Bits per channel and Check Object ID, Press OK
Press RENDER button
Open After Effects, import your .rpf image file which you rendered.
Put it in a composition and apply “ID Matte” effect on your image.
In Effect settings, choose Object ID as Aux Channel and see what happen when you change ID Selection.
That’s all folks,
Keep in Fx,