Replace selected objects by instances according to prefix names.
Hi,
I know how to replace objects by instance of an object but I can't figure how to do this in one go :
I have a lot of copies of identical ( but can be scaled, rotated ) "cube" : "cube001","cube002",... of "sphere", "cylinder",....
I want to select all these objects and click, boom !
All "cubexxx" are replaced by an instance of one "cubexxx" idem for "spherexxx",...
Thanks.
Comments
.
Maybe this will help you.
Tools and Scripts for Autodesk 3dsMax
Hi, Miauu !! How is your
Hi, Miauu !!
How is your situation in Bulgaria ? Are you fine ?
Thank you very much for this script, it is exactly what I needed !!
I saw that you want me to work a little bit :-)
So I go further and I change :
-----------------------------------------------------------------------------
for mObj in masterObjsArr do
(
mObjM = trimright mObj.name "1234567890"
mObjName = (mObjM + "*")
for o in selObjsArr where (matchPattern o.name pattern:mObjName) == true do
(
--format ": % : % \n" mObj.name o.name
instanceReplace o mObj
)
)
-----------------------------------------------------------------------------
So I don't need to select the source object. Just one of each randomly.
I try to remove UI and then make the 2 array identical.
It works but when dealing with more than 200 objects it is very slow as it loops for each object all objects....
One thing very cool should be to remove UI, select all objects, and use as masters one of each different selected objects.
But I don't know how to... :-)
Take care.
.
Hi!
We have state of emergency, but I still go at work. :)
I did not know how exactly you replace your objects so I leaved this part to you. :)
Try this:
It works only when your master objects don't have any number as suffixes.
Tools and Scripts for Autodesk 3dsMax