It was a year ago so memory is a bit foggy, but I think what happened
is it worked, but at_frame() on the subsequent bones didn't anymore
because when linking to a custom parameter in the custom parameter
with the oscil() expression, apparently XSI believes it is no longer
an "fcurve driven parameter" and at_frame() moans about it with a big
red error line.
I like your SCOP idea. Looks like it could work well. I'll give it a
go when I have more time.
I'm not fluent in scripting within XSI, so thanks for the helpful
example code. :)
Cheers,
-- Alan
On Jan 18, 2008 11:17 PM, Moloney, Ciaran <cmoloney(at)nybg.org> wrote:
>
>
> Hi Alan,
> I'm not too sure exactly why your expresion won't work with a custom param,
> but I think you could do this with better control using a scripted operator,
> which will work with sliders! Here's a very simple example that should have
> an output connection to each of your tail objects. In the SCOP, put this as
> your update code (Jscript):///Add 5 Output connections to kine.local.posy of
> 5 objects
> ///Name Output ports "Out1"..."Out5"
> ///Add custom parameters (sliders!) to SCOP object to control wave function
> /// Get values from sliders
> freq = In_UpdateContext.Parameters("frequency").Value;
> amp = In_UpdateContext.Parameters("Amplitude").Value;
> offset = In_UpdateContext.Parameters("timeOffset").Value;
> ///find current time (assumes 30 fps)
> frame = In_UpdateContext.CurrentFrame;
> time = frame/30;
> ///For each Output port, find point on wave at current time - offset value
> op = In_UpdateContext.Operator;
> outPorts = op.OutputPorts.Count;
> for(n=0;n<outPorts;n++)
> {
> if(Out.Name == ("Out"+(n+1)))
> {
> posY = (amp * Math.sin((time - (offset*n)) * freq));
> Out.Value = posY;
> }
>
> }
>
> If you want a more complicated oscillation, it should be straightforward
> enough to code in the function.
>
> Hope this helps.
>
> Ciaran
>
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi