My example is written in Jscript.  It appears you’re using Python.  You’ll need 
to make the necessary adjustments for difference in language.


Matt




From: softimage-boun...@listproc.autodesk.com 
[mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Francisco Criado
Sent: Tuesday, June 24, 2014 11:51 AM
To: softimage@listproc.autodesk.com
Subject: Re: simple script

Hi Emilio and Matt, thanks for your quick response!

Emilio, it seems that sel.name<http://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<http://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<mailto: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>
 
[mailto: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<mailto: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.


Reply via email to