Hey everyone,
I've been working on script which moves UVW map coordinates by specific Y offset. The goal is, that for each object matching criteria (e.g. $*a*) will move all faces of UV by -2 on Y axis.
This is what I tried :
_objs = $Sphere*
_yOffset = -2
for _o in _objs where superClassOf _o == GeometryClass do (
PolyOp.SetFaceSelection _o #none --deselect all faces
ConvertToPoly _o
_unwrap = Unwrap_UVW()
AddModifier _o _unwrap
_unwrap.SelectFaces #{1..(PolyOp.GetNumFaces _o)} --select all faces
_unwrap.MoveSelected [0, _yOffset, 0] --move by offset
CollapseStack _o
)
But there are some problems:
When executed, the script will only work if the object(s) is selected.
If the object(s) is(are) not selected the Unwrap modifier is added but the faces are either not selected or the UV coords are not moved.
Is there something I'm doing wrong?
Thanks.
Swordslayer · 2020-09-17