Attaching same named objects

How can I attach all the objects having same name in a scene??

Comments

Comment viewing options

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

try this.objs = for i in

try this.

objs = for i in objects collect i
 
for z in objs do
(
	for o in objs where z != o do 
	(
		if z.name == o.name then
		(
			z.attach o z
			nProv = finditem objs o
			if nProv != 0 then deleteitem objs nProv
		)
	)
)

kimarotta.com.br
3d Artist  

Goonda's picture

Thanks

Thanks Kimarotto....I checked the forum today...but before that I have written something like this...please check:

for o in geometry do
(
if classof o == editable_poly do
(
append newworking o
)
)

i = 1

while i <= newworking.count do
(
b = newworking[i]
j = i + 1
while j<= newworking.count do
(
if (newworking[j].name == b.name) then
(
b.attach (newworking[j]) b
deleteItem newworking j
select b
weldverts b
)
else
(
j = j +1
)
)

i = i + 1
)

miauu's picture

For Editable_Poly objects.

First select the object to hich will be attached other objects.

(
b = selection[1]
for o in geometry where (o != b and o.name == b.name) do b.attach o b
)
Goonda's picture

Thanks miauu.....But for this

Thanks miauu.....But for this to work I need to select a object manually....i need to do this for all the objects in the scene.....where I don't have to know which objects to select.

Comment viewing options

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