ScriptSpot

Forum topic · General Scripting

uv move code error

By dussla · 2018-02-22

Description

UVObject = #()

if (selection as array).count != undefined then

UVObject = (selection as array)[1]

tst = #()
for h in UVObject.modifiers do (if classof h == uvwmap then (append tst h) )

if tst.count != 0 then

(
modPanel.setCurrentObject UVObject.modifiers[#UVW_Map]

subobjectLevel = 1

)

dear friends
i made this code for uv move
but that is still error
what problem ?

Comments (4)

code erro2

dussla · 2018-02-23

thank you for good reply

$.pivot = $.center
$.modifiers[#UVW_Map].gizmo.position = $.center

i add this code too
but error ?

postion is diffirenet

.

jahman · 2018-02-23

sure. cause it's a relative position

$.modifiers[1].gizmo.position = $.center - $.position

i test it

dussla · 2018-02-23

thank you for good reply
i test your code
but still , gizmo can;t move correct position ~~~

ps : i test again
if i reset xform object . postion is correct

thank you

.

jahman · 2018-02-22

check mxs reference

if selection[1] != undefined do (

uvwmaps = for m in selection[1].modifiers where isKindOf m uvwmap collect m

for uvw_map in uvwmaps do uvw_map.position += random [-1.0,-1.0,0.0] [1.0,1.0,0.0]

)