. direct_layer_localPosition_x question
  • anomad
    master
    Posts: 412
    Joined: Sun Oct 21, 2007 10:07 pm
    Location: north cakalacky, usa
    Contact:

    . direct_layer_localPosition_x question

    by anomad » Wed Jul 02, 2008 2:49 am

    . 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. )
  • User avatar
    sigmasix
    master
    Posts: 1224
    Joined: Thu Dec 02, 2004 2:12 pm
    Location: gva | switzerland
    Contact:

    by sigmasix » Wed Jul 02, 2008 8:18 am

    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
  • anomad
    master
    Posts: 412
    Joined: Sun Oct 21, 2007 10:07 pm
    Location: north cakalacky, usa
    Contact:

    by anomad » Thu Jul 03, 2008 6:33 am

    . 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 !

Who is online

Users browsing this forum: No registered users and 20 guests