Page 1 of 1

. direct_layer_localPosition_x question

Posted: Wed Jul 02, 2008 2:49 am
by anomad
. is it possible to 're-center' a layer after moving it around ?

. i'm working on a module that takes the layer and moves it around in a spirograph inspired patter

spX = (r1+r2) * cos(time) + p1 * cos((r1+r2) * time / r2)
spY = (r1+r2) * sin(time) + p1 *sin((r1+r2) * time / r1)
modul8.setValue('direct_layer_localPosition_x', spX, 0)
modul8.setValue('direct_layer_localPosition_y', spY, 0)
time+= (speed * .01)

. it works, with a little bit of tweaking ;) i have a button that toggles active/not active, but, i also want to be able to click a button and re-center the layer.

. currently, my code to do this is:

modul8.setValue('direct_layer_localPosition_x', 0, 0)
modul8.setValue('direct_layer_localPosition_y', 0, 0)

. and it doesn't work! is (0,0) the wrong coordinate? or am i missing something obvious? i tried ctrl_layer_position_x/y but that didn't seem to work either.

. thanks in advance!

-james
(a nomad. )

Posted: Wed Jul 02, 2008 8:18 am
by sigmasix
Hi, I don't use the same keyword you use...

There is a keyword for the media position in the 3d space (x, y, z the one you use), and one for the position in the output (x, y)

Code: Select all

modul8.setValue('ctrl_layer_position_x', 0.0, 0)
modul8.setValue('ctrl_layer_position_y', 0.0, 0)


this is working fine for me

Posted: Thu Jul 03, 2008 6:33 am
by anomad
. well, i don't know what i did to make ctrl_layer_position_? not work the first time around, but it works now!

. thank you so very much for your help !