Hi Nicolas,
kind of lame that I didn't see that at first :)
However, I'm still stuck, perhaps my method should be revamped.
Because the function siFCurveSource gives you a boolean number if a
animation curve exists or not. And it still would do a offset on all
of the keyframes from the function OffsetKeys
hmm... I might need to rethink it from the start I think.
regards
stefan
On 10/15/07, Nicolas Langlois <nicolasl(at)buzzimage.com> wrote:
> Stephan,
>
> It's not "siFCurveSource" that you need to check to see if it's pos or
> rot or else, it's "oObj".
>
> in your script do this:
>
> #--- start of python script
>
> import win32com.client
> from win32com.client import constants as c
>
> xsi = Application
>
> oIn = 1
> oOut = 100
> oTimeOffset = 2
>
> oSel = xsi.Selection.Count
>
> for i in range(oSel):
> oFCurveAnimatedParams =
> xsi.Selection(i).NodeAnimatedParameters(c.siFCurveSource)
> for oObj in oFCurveAnimatedParams:
> if "pos" in oObj.Name: # THIS IS WHAT YOUR LOOKING FOR I THINK
> oFCurve = oObj.Source
> oRange = oFCurve.GetKeysBetween(oIn, oOut)
> oFCurve.OffsetKeys(oRange, oTimeOffset * i)
>
> #--- end of python script
>
> Nicolas Langlois
> Senior/Lead Rigger/TD
> Buzz Image
>
>
>
> Stefan Andersson wrote:
> > Hi All,
> >
> > I'm working (again) on this offset plugin. Thanks to André I now have
> > a much faster plugin using the xsi model. Though, now I would like to
> > filter out what's being selected or offset. The working base code I
> > have now is:
> >
> > ( can also be downloaded at http://sanders3d.googlepages.com/ )
> >
> > #--- start of python script
> >
> > import win32com.client
> > from win32com.client import constants as c
> >
> > xsi = Application
> >
> > oIn = 1
> > oOut = 100
> > oTimeOffset = 2
> >
> > oSel = xsi.Selection.Count
> >
> > for i in range(oSel):
> > oFCurveAnimatedParams =
> > xsi.Selection(i).NodeAnimatedParameters(c.siFCurveSource)
> > for oObj in oFCurveAnimatedParams:
> > oFCurve = oObj.Source
> > oRange = oFCurve.GetKeysBetween(oIn, oOut)
> > oFCurve.OffsetKeys(oRange, oTimeOffset * i)
> >
> > #--- end of python script
> >
> > I would like to filter the "siFCurveSource" to only select
> > translation, rotation, etc. I've tried to look in the SDK docs if
> > something like "siFCurveSource.posx" or anything like that exists.
> > I don't know... learning as I go at least :) Anyone up for making any pointers?
> >
> > regards
> > stefan andersson
> >
> >
>
> ---
> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
> unsubscribe xsi
>
--
__________________________________________
Pixel Abuser (at) http://www.swiss.se/
Blog (at) http://sanders3d.blogspot.com/
Web (at) http://sanders3d.googlepages.com/
work e.mail: stefan [at] swiss.se
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi