ScriptSpot home

Attach by Same Material

Downloads

3ds Max compatibility
Unknown
Community compatibilityNo compatibility reports yet

No reports yet for the available releases.

Community reviewsNo reviews yet.

Listing details

Version
v1.0
Author’s update date
Legacy votes
2
Listing created
How compatibility works

Compatibility comes from the author’s supported range or requirements in the original listing. A tested version records what the author tried.

“2020 unconfirmed” in the catalog means support for 3ds Max 2020 is still unknown.

Community reports record successful tests on specific releases.

Posted by

Smallpoly

Michael Vladimir Nicolayeff

More by this author

Description

Attached all geometry with the same material to the currently selected object. This collapses to editable poly first, so make sure you're cool with that before you click. :)

Created for merging objects in heavy architecture scenes recieved in Max format with large numbers of individual objects.

Comments (6)
Maxim

Thanks

Thank you for original script!
And thank you Qwertzus for the great update - very useful!

sirmontal

awesome

hey mate thanks for this - handy!
Would be awesome if you could select ALL geometry and it attaches them by maerial. The way it is now, you have to select 1 piece of geometry at a time

great work either way

Reply to sirmontal
Michael Vladimir Nicolayeff

Thanks for the feedback. The next time I do an update to this script that's one of the things I'd like to add in.

Reply to Michael Vladimir Nicolayeff
Nikolay Litvinov

Так будет лучше на все выделенные объекты


(
if selection.count >= 1 do for i in selection do
if (superclassof i == GeometryClass) do
	(
	if (classof i != Editable_Poly) do convertTopoly i
	mainobject=i
	mat = i.material
	for o in objects do	if o.material == mat then mainobject.EditablePoly.attach o mainobject
	)
)
Reply to sirmontal
Alex

attach with multiple materials

Hi awesome,
a bit late but here you go :D


mtl = #() ; tmp = #() ; final = #()
    sel = selection as array

    if sel.count != 0 then
    (
        for i in sel do
        (
            convertTo i Editable_Poly
            i.name = i.material.name
            --append all materials of selection to the mtl array:
            if findItem mtl i.material == 0 do
            append mtl i.material
        )
        for m in mtl do
        (
            tmp = for i in sel where i.material == m collect i -- tmp stores all objects with the same material
            append final tmp -- append tmp array to final array
        )
        for i in final do
        (
            if i.count >= 1 do
            (
                mainobject = i[1] --first index will be the mainobject to attach to
                for j in i do
                mainobject.EditablePoly.attach j mainobject
            )
        )
    )