Hi,
i need a script that create a box, teapot whatever on every face center with normal align from selected object.
regrads,
Ulrich
Forum topic · Scripts Wanted
By Ulrich Thümmler · 2025-01-28
Hi,
i need a script that create a box, teapot whatever on every face center with normal align from selected object.
regrads,
Ulrich
.
miauu · 2025-02-18
This can be achieved in different ways. This is one of them:
(
objToCreate = Teapot()
delSurfaceObj = false
surfaceObj = selection[1]
if classOf surfaceObj != Editable_Poly do
(
surfaceObj = convertToPoly (copy surfaceObj)
delSurfaceObj = true
)
facesCnt = polyop.getNumFaces surfaceObj
for f = 1 to facesCnt do
(
obj = instance objToCreate
obj.pos = polyop.getSafeFaceCenter surfaceObj f
obj.dir = polyop.getFaceNormal surfaceObj f
)
delete objToCreate
if delSurfaceObj == true do delete surfaceObj
)