xsi=Application sel = xsi.Selection(0)
xsi.CopyAllAnimation2(sel.Name, "siAnySource", "siAllParam", "", "", "") ------------------------------------------------------- Emilio Hernández VFX & 3D animation. 2014-06-24 13:54 GMT-05:00 Emilio Hernandez <emi...@e-roja.com>: > Hello Francisco. > > As Matt said you need to have a valid selection. > > The piece of script I wrote is in Python and Matt's is in Jscript. > > > > ------------------------------------------------------- > Emilio Hernández VFX & 3D animation. > > > 2014-06-24 13:51 GMT-05:00 Francisco Criado <malcriad...@gmail.com>: > > Hi Emilio and Matt, thanks for your quick response! >> >> Emilio, it seems that sel.name doen't work, here is the log: >> # ERROR : 2000 - Argument 0 (InputObjs) is invalid >> Application.CopyAllAnimation2("", "", "", "", "", "") >> # ERROR : Traceback (most recent call last): >> # File "<Script Block >", line 3, in <module> >> # Application.CopyAllAnimation2("sel.name", "siAnySource", >> "siTransformParam", "", "", "") >> # File "<COMObject Application>", line 2, in CopyAllAnimation2 >> # COM Error: The parameter is incorrect. (0x-7ff8ffa9) - [line 3] >> >> >> and Matt, it seems that on the first line when you set the variable there >> is also an error: >> # ERROR : invalid syntax - [line 1] >> >> tried already with "Application.Selection(0).Name" replacing "sarasa" but >> still didn't work :( >> >> F. >> >> >> >> 2014-06-24 15:12 GMT-03:00 Matt Lind <ml...@carbinestudios.com>: >> >> You need to filter the selection for eligible objects, then iterate >>> through that list and call CopyAllAnimation2() for each object in the list: >>> >>> >>> >>> var oSelectedItems = SIFilter( null, siObjectFilter, true, siQuickSearch >>> ); >>> >>> >>> >>> if ( !oSelectedItems || oSelectedItems.Count <= 0 ) { >>> >>> return; >>> } >>> >>> >>> >>> for ( var i = 0; i < oSelectedItems.Count; i++ ) { >>> >>> var oSelectedItem = oSelectedItems(i); >>> >>> CopyAllAnimation2( oSelectedItem, siAnySource, siAllParam ); >>> >>> } >>> >>> >>> >>> >>> >>> Matt >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> *From:* softimage-boun...@listproc.autodesk.com [mailto: >>> softimage-boun...@listproc.autodesk.com] *On Behalf Of *Francisco Criado >>> *Sent:* Tuesday, June 24, 2014 11:06 AM >>> *To:* softimage@listproc.autodesk.com >>> *Subject:* simple script >>> >>> >>> >>> Hi guys, just trying to do a quick access button, and getting stuck with >>> something very simple: >>> >>> >>> >>> Application.CopyAllAnimation2("sarasa", "siAnySource", "siAllParam", "", >>> "", "") and my intention is to replace "sarasa" with current selection... >>> >>> is there any command for current selection? >>> >>> >>> >>> Thanks in advance. >>> >>> >>> >>> F. >>> >>> >>> >> >> >