bernieLomax
08-23-2006, 11:25 AM
hello, i´m trying to make a script to work with several objects apllying to them an uvwmap gizmo normal aligned to the objects face.
but it does not work it work for a single object but not a bunch of them can anyone help?
thankx bern.
script:
obj = selection as array
for i = 1 to obj.count do
(
faceArr = (polyop.getFaceSelection obj[i]) as array
faceNormal = in coordsys obj[i] (polyop.getFaceNormal obj[i] faceArr[1])
worldUpVector = [0,0,1]
rightVector = normalize (cross worldUpVector faceNormal)
upVector = normalize (cross rightVector faceNormal)
theMatrix = matrix3 rightVector upVector faceNormal [0,0,0]
--- UVWmap modifier
addModifier obj[i] (Uvwmap())
---obj[i].modifiers[#UVW_Mapping].gizmo.transform = theMatrix
obj[i].modifiers[#UVW_Mapping].length = 40
obj[i].modifiers[#UVW_Mapping].width = 40
obj[i].modifiers[#UVW_Mapping].realWorldMapSize = on
print faceArr
)
but it does not work it work for a single object but not a bunch of them can anyone help?
thankx bern.
script:
obj = selection as array
for i = 1 to obj.count do
(
faceArr = (polyop.getFaceSelection obj[i]) as array
faceNormal = in coordsys obj[i] (polyop.getFaceNormal obj[i] faceArr[1])
worldUpVector = [0,0,1]
rightVector = normalize (cross worldUpVector faceNormal)
upVector = normalize (cross rightVector faceNormal)
theMatrix = matrix3 rightVector upVector faceNormal [0,0,0]
--- UVWmap modifier
addModifier obj[i] (Uvwmap())
---obj[i].modifiers[#UVW_Mapping].gizmo.transform = theMatrix
obj[i].modifiers[#UVW_Mapping].length = 40
obj[i].modifiers[#UVW_Mapping].width = 40
obj[i].modifiers[#UVW_Mapping].realWorldMapSize = on
print faceArr
)
