Scripted operator question

Discussions concerning programming of SOFTIMAGE©
User avatar
redmotion
Posts: 150
Joined: 09 Jun 2009, 16:38
Location: London

Scripted operator question

Post by redmotion » 29 Sep 2010, 11:12

Is it possible to dynamically set key frames via a scripted operator?

Say if I set animation playback to loop continuously (and press play) and the operator itself creates a series of keyframes on different objects and as you change sliders it updates them (live) so that the final animation being played back changes automatically.

Is something like that possible?

If so, can each keyframe be assigned a variable and the variables be updated by the sliders on the fly?

(Think I may have asked the same question twice!)

EDIT: Just checked the SDK under "scripted operators, restrictions on using"

Could it be done using : KinematicState.get_Transform and KinematicState.set_Transform?

EDIT2: Would a compiled operator be better for controlling multiple objects?

EDIT3(!): I've applied a scripted operator to the Local Transform.

I can get the contents of it by having this in the scripted operator:

Code: Select all

Input = Inlocal.value
I also have a variable called "OffsetZ" that will drive the offset position of the object in Z:

Code: Select all

OffsetZ = In_UpdateContext.OffsetZ.value
(Its max/min is 20/-20)

How do I apply the Offset to the posz of the objects Local Transform?

Code: Select all

Out.value = Input.pos.posz + OffsetZ
Gives an error. (Obviously!)

User avatar
xsisupport
Posts: 713
Joined: 09 Jun 2009, 09:02
Location: Montreal Canada

Re: Scripted operator question

Post by xsisupport » 29 Sep 2010, 13:00

I'm not sure I would use an operator to set key frames.


If you want to update the transfrom, take a look at

XSISDK\examples\workgroup\Addons\ConstraintOps\Application\Plugins\CenterOp_Simple.js

That examples updates the Transform.
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs: Arnold | Softimage