ScriptSpot

Forum topic · General Scripting

Scale rotated object (only one axis)

By mjbg · 2011-08-23

Description

Hi.. i´m sorry to be asking so much dumb questions..

i am trying to do very simple scripts just for learning and for speed up my workflow using them for repetitive tasks..

but now again i am stucked with another simple script..

so.. how can i scale some rotated object in only one axis?

i tried something like this (as this way worked with move)


toolMode.coordsys #local
scale $ [2,1,1]
toolMode.coordsys #view

this way it still scale using the #view.. not the #local

note.. i cannot use $.scale because sometimes i want a negative scale (for mirror)
so if i do something like $.scale = [-1,1,1] i end with $.scale = [-1,-1,-1] i dont know why.

thankyou

Comments (1)

mjbg · 2011-08-23

for mirror i got something like this


objrot = $.rotation.z_rotation
$.pivot = $.center
$.rotation.z_rotation = 0
scale $ [-1,1,1]
rotate $ (eulerangles 0 0 objrot)
ResetPivot $

not pretty.. but works