ok, so heres the deal. I am trying to make a simple control object which is constrained in x and y to the values of +50 through -50.
So i start by making a rectangle 100x100 units big. Within this is a smaller rectangle, the smaller one is linked to the bigger one. Finally i make a circle which the largest rectangle is linked to.
The circle is just to move and position the controller
The large rectangle is just a visual boundary
The smaller rectangle is the control itself.
I applied a CA to the circle to hold the script which will define the limits of the small rectangles movement. I add the follwing script:
in coordsys parent (if $TestControl_Ctrl.controller.pos.x <= -50 then
$TestControl_Ctrl.controller.pos.x = -50)
now this all works except for on thing, the object isnt limited to -50, it only updates its position when i hit evaluate.
Now, whats more strange is that if i apply the script to the circles scale controller for instance the object is constrained in the viewport as i want.
I can only suspect that the script held in the custom attribute isnt being updated in the scene in realtime. Do i have to add a variable to the CA to make it work in the manner i expect.