Hey currently I'm trying to sort through this piece of code that I've edited from one of
@Ojah 's old posts.
fn F_moveUV movePos = (
if selection.count >= 1 do
(
SEL = selection as array
for i = 1 to SEL.count do
(
print SEL[i]
objMod = SEL[i].modifiers[#unwrap_uvw]
objMod.unwrap2.faceToVertSelect()
print objMod
vArray = objMod.getSelectedVertices()
print vArray
for vVar in vArray do
(
oldPos = objMod.getVertexPosition 0 vVar
objMod.setVertexPosition 0 vVar (oldPos + movePos)
)
)
)
)
I'm currently trying to have multiple objects selected with the Unwrap UVW modifier on it. With all of the UV islands/sets selected move them to a specific position within U1V1. The issue that I'm running into seems to be that the second object in the array "SEL" will not move even though the print SEL will show that the array is being processed with both objects.
I'm testing with two objects right now and haven't tried more than two yet. The function is executed later on in the script by a rollout button and I'm not getting any errors on that and the first item in the array does respond.
Also I don't particularly need an array if this can be done purely with a multiobject UV all selection and then moving that way. This is just what I could get semi-working with what I know.
Replies
When using a single unwrap mod on multiple objects you should use the ByNode commands available in the Unwrap6 interface. They are basically duplicates of the same commands with an extra parameter to specify the object to operate on.
For your first script to work you would just need to change these two lines (I didn't test)