Expression and Script controller tickoffset

Expression and Script controller tickoffset

Anonymous
Not applicable
644 Views
4 Replies
Message 1 of 5

Expression and Script controller tickoffset

Anonymous
Not applicable
Does anyone know how to use the "tick offset"?
If you create a variable and manually set the tick offset it works.
In the help file it doesn't really explain or show an example of how to script the "tick offset" value.

thanks
0 Likes
645 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
I think it's this:


<boolean>SetOffset <value>Which <time>Offset

Sets the time offset of the specified variable to the given value.
0 Likes
Message 3 of 5

Anonymous
Not applicable
Great, I did some digging to find it in the maxscript help file but they didn't have any good example of it in use.

So for example. If I have a variable called "MyZPos" which is assigned to the Z position of an object how do I add the tick offset.

Every combination I try doesn't seem to work. I clearly don't know the syntax. "Boolean" and "Value" should be true and the offset number.

So I've tried things like this:

MyZPos.SetOffset true 100

I don't know if I need to say true or false or whether or not to use a period or brackets.
I wish the help file had a basic example.

Thanks
0 Likes
Message 4 of 5

Anonymous
Not applicable
OK well now I figured it out via a simple maxscript.
Now that I have the basic code working I can make it a little more robust and useful.


Myctrl = float_script()
$.pos.controller.Zero_Pos_XYZ.controller.Z_Position.controller = Myctrl
Myctrl.addTarget "MyZ" $Sphere01.pos.controller.Zero_Pos_XYZ.controller.Z_Position.controller offset: -5
Myctrl.setExpression "MyZ"


Basically that works to connect two objects Z position with a simple offset.

Thanks
0 Likes
Message 5 of 5

Anonymous
Not applicable
This is the syntax:


<yourScriptController>.setOffset "<variableNameInController(string)>" <tickOffset(integer)>
<yourScriptController>.Update() --if you want to see the results
0 Likes