Detach by Material ID

36 votes
Version: 
2
Date Updated: 
12/09/2008

Detach Polygons based on its Material ID

Additional Info: 

Features

  • works on a selection of objects
  • options to automatically name detached objects
  • material propagation
    • this will assign a corresponding material by id to the detached object

Usage

  1. select any number of objects
  2. set the desired paramteters
  3. optional: if you know the maximun number of ids the object has, set the Max IDs to help speed up detachment.
  4. press detach

Internal Operations
Procedure:

  • object[s] is/are copied
  • then collapsed to an editable poly
  • faces are finally detached by material ID

Naming:

  • Numbered
    • will creae numbered names
    • e.g. 0,1,2,3
    • preferable to use with the Prefix option checked
  • Bitmap Name
    • if not diffuse bitmap found, it will use the material name
    • if no material applied, it will use the object's name
  • Material Name
    • if no material applied, it will use the object's name
  • Object Name
    • will create a unique name based on the object's name
Version Requirement: 
3ds Max 9
Video URL: 
AttachmentSize
detachbyID.ms5.08 KB

Comments

Comment viewing options

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

EditableMesh output would be great!

Could anyone adjust it to have EditableMesh as output objects?

psh19989's picture

Script Change

We want to change to mesh instead of poly when we run the script. How should I change it? We want the noodles to be mesh.

abdelhameadrasslan's picture

This script saves lifes

This script saves lifes thanks for the effort !

chew's picture

a lot of errors

-- Error occurred in i loop; filename: C:\Users\XXX\Desktop\SCRIPTS\DETACH_BY_MATERIAL_ID\detachbyID.ms; position: 4358; line: 159
-- Frame:
-- theDetachedObj: $rug020
-- the_faces: #{1..114}
-- i: 1
-- called in obj loop; filename: C:\Users\XXX\Desktop\SCRIPTS\DETACH_BY_MATERIAL_ID\detachbyID.ms; position: 4471; line: 163
-- Frame:
-- the_orig: $rug18
-- the_mat: rug3:Standard
-- id_count: 7
-- obj: $rug18
-- Error occurred in detach_bot.pressed(); filename: C:\Users\XXX\Desktop\SCRIPTS\DETACH_BY_MATERIAL_ID\detachbyID.ms; position: 4553; line: 166
-- Frame:
-- the_sel: #($wassily_chair05, $wassily_chair04, $wassily_chair03, $coffee cups15, $coffee_table03, $rug18, $coffee_table05, $magazine_face_down01)
>> MAXScript Rollout Handler Exception:
-- Unable to convert: ReferenceTarget:Texmaps to type: Material <<
-- Error occurred in i loop; filename: C:\Users\XXX\Desktop\SCRIPTS\DETACH_BY_MATERIAL_ID\detachbyID.ms; position: 4358; line: 159
-- Frame:
-- theDetachedObj: $Maps001
-- the_faces: #{1..17214}
-- i: 1
-- called in obj loop; filename: C:\Users\XXX\Desktop\SCRIPTS\DETACH_BY_MATERIAL_ID\detachbyID.ms; position: 4471; line: 163
-- Frame:
-- the_orig: $cushion22
-- the_mat: farbric:Standard
-- id_count: 7
-- obj: $cushion22
-- called in detach_bot.pressed(); filename: C:\Users\XXX\Desktop\SCRIPTS\DETACH_BY_MATERIAL_ID\detachbyID.ms; position: 4553; line: 166
-- Frame:
-- the_sel: #($cushion22, $cushion08, $ceramic_bowl1, $cushion20, $sofa_right, $cushion11, $sofa_long_right06, $sofa_long_right04, $cushion12, $cushion21, $cushion13, $sofa_right01, $cushion14, $coffee_table01, $apples02, $ceramic_bowl02, $wooden_bowl02, $coffee_table, $apples01, $wooden_bowl1, ...)
>> MAXScript Rollout Handler Exception:
-- Unable to convert: ReferenceTarget:Texmaps to type: Material <<

asymptote's picture
lipknik's picture

The best script ever to import "bad" clients sketchup models

This script is a life saver for that kind of models which comes all in one single layer. But the client toke the time to insert some materials definitions on it...

Really great man!, you save my morning!

harumscarum's picture

request

would be great to have an option to detach by material ID to EditablePoly elements (not new objects) - separate macros without UI

thank you in advance

backflipbedlem's picture

Random bitmap name

Great script dude,
But when tick the use bitmap name option, it saves it with a random bitmap name, not one that corresponds to the object!

Any ideas how to fix????

asymptote's picture

This is great, but freaks out

This is great, but freaks out and throws up an error when one of the selected objects has only a single id and cannot be detached.
Can this be easily fixed ?

mmaitland's picture

Very Cool, wish it had one thing though

Very Nice!! I wish it had an option to group the objects after it blows them apart, or at least have all of the objects selected that it tweaked. Thank you for the script!

Comment viewing options

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