Replace object using array

Hi all, i try to make a script for replace object list in an array.

here is my code:

for obj in Cursel do
(
i = ReplacerObjectsSet.count
if i !=0 do
(
maxops.clonenodes Cursel newNodes:&objClones cloneType:#instance
objClone = objClones[1]
objClone.pos = ReplacerObjectsSet[(i)].pos
in coordsys local objClone.scale = ReplacerObjectsSet[(i)].scale
in coordsys local objClone.rotation = ReplacerObjectsSet[(i)].rotation
append ReplacedObjectsSet objClone
i+1
)
)

Probleme is with scale and rotation which are not apply but i don't understand why.

Help is welcome !

Comments

Comment viewing options

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

 

Assuming curSel contains the objects you want to distribute and replacerObjectsSet contains the objects you want to align to:

maxCount = amin curSel.count replacerObjectsSet.count
replacedObjectsSet = for i = 1 to maxCount collect instance curSel[i] transform:replacerObjectsSet[i].transform

Comment viewing options

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