Slider move

Slider move

Anonymous
Not applicable
509 Views
7 Replies
Message 1 of 8

Slider move

Anonymous
Not applicable
Hello,

I have made an array of all position controller keys of
main camera.
Now i try to slider move on each key and copy targetdistace
of main camera to free camera.But cant sucess to move slider.

How can i move slider in forloop on each keys ?

Thanx
0 Likes
510 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
you can either use the global variable sliderTime or currentTime, or simply us a context:
sliderTime=5
with animate on (your code here)

at time 5 do with animate on (your code here)
0 Likes
Message 3 of 8

Anonymous
Not applicable
Thank you its works

I have save all value of Camera002 in myTransform.
Assign this value to free camera which is made by script.

myTransform =$Camera002.Transform

In my script everything works fine.
No error.

When i add this script to (on came picked obj do(...))
Its give me error on line myTransform =$cam.Transform
"MAXScript Rollout Handler Exception: -- Unknown property: "transform" in undefined <<"

Find the script below...

Thanx



rollout pick_box_test "Pick Box Test"

(

--filter all objects of class Box:

fn box_filt obj = classof obj == Targetcamera

--Pickbutton to select a Box from the scene

pickbutton chooseit "Select Camera" width:140 filter:box_filt

--If the user picked an object, then

on chooseit picked obj do

(

--see if the user did not cancel the picking...

if obj != undefined do

(

--if he did not, make the box's wireframe red:

--obj.wirecolor = red

--and display the name of the object on the button:

chooseit.text = obj.name
cam = chooseit.text
print cam
---------------------------------*******************************
freecam = Freecamera ()---Create free camera

myTransform =$cam.Transform

freecam.transform = myTransform --align freecamera to main camera

select freecam

$.Target_Distance = $cam.targetDistance

$.parent =$cam --link free camera to main camera

posKey = $cam.pos.controller.keys --make an array of all keys
print posKey
--$Camera01.pos.controller.keys--returns array of position keys

animate on
(
for i = 0 to 500 do
(
select freecam
at time i $.Target_Distance = $cam.targetDistance
--m= posKey


)

)

)

)--end on

)--end rollout

createDialog pick_box_test
0 Likes
Message 4 of 8

Anonymous
Not applicable
$cam refers to an actual object in the scene named "cam".

You need to use the variable obj, which is the node returned by the pickbutton.
0 Likes
Message 5 of 8

Anonymous
Not applicable
Thank you very much
0 Likes
Message 6 of 8

Anonymous
Not applicable
Hi everyOne,

I have made script which copy all target distance of main camera
to free camera.Keys made on every frame.

But i try to make the key only made on main camere's key.
I make an array of all position key of main camera.
But cant success to move slider on that array's value.

animate on
(
for i = animationRange.start to animationRange.end do
(
select freeCam


at time i $.Target_Distance = $Camera002.targetDistance
$.fov = $Camera002.fov
)

)

How can i move slider at main camera's key and made free camera's key?


Thanx
0 Likes
Message 7 of 8

Anonymous
Not applicable
keys = $Camera002.fov.controller.keys
frames = for k in keys collect k.time
for t in frames do
at time t animate on
$.fov = $Camera002.fov
0 Likes
Message 8 of 8

Anonymous
Not applicable
Thank you so much
0 Likes