Copying and pasting fcurve keys in a script


To copy and paste keys in a script, you have to also call SelectKeysInTimespan() to select the keys you want to copy.

If you copy and paste keys in the fcurve editor, SelectKeysInTimespan() is not logged, so it’s easy to get fooled into thinking you don’t need it (SelectKeysInTimespan is logged by the Dopesheet, however). hat tip luceric

SelectKeysInTimespan("null.kine.local.posx", siSetKeySelection, 65, 93, siInputParameters);
CopyKeys("null.kine.local.posx", 65, 93, null, true, siInputParameters);
PasteKeys("null1.kine.local.posx", 55, 83, false, null, siInputParameters, null, null, false, false);

Here’s some OM code that does about the same thing:

var x = Dictionary.GetObject("Model.null.kine.local");
var fcv = x.roty.Source;
LogMessage(ClassName(fcv));

var y = Dictionary.GetObject("null.kine.local");
var fcv1 = y.roty.AddFcurve();
fcv1.Set(fcv);
// Keep keys from 20-50
fcv1.RemoveKeys(1,19);
fcv1.RemoveKeys(51,null);
// Move to 0-30
fcv1.OffsetKeys(fcv1.Keys, -20);

Friday Flashback #38


Red Creates Cityscape for Kylie Minogue With Discreet Tools, Softimage XSI
(August 23, 2001)

“Can’t Get You Out of my Head,” the first single to be taken from Kylie’s forthcoming album, features the pop princess driving and strutting her stuff in a futuristic Manga-esque city. Pretty run of the mill stuff until you discover that the only things that were shot for real were Kylie, a handful of dancers and a static car. Black Dog tasked Soho-based visual communications facility Red, with creating the rest from scratch to designs developed by director Dawn Shadforth.

Red utilised the full gamut of its Discreet arsenal – 3ds max, fire, flame and inferno – to create and animate the backgrounds with some SoftImage XSI thrown in for good measure.

The video:

The full article from Digital Producer Magazine
Continue reading

Effets spéciaux: la banlieue québécoise d’Hollywood


Special effects: the quebecoise suburb of Hollywood

Montréal –Avec une cinquantaine de productions hollywoodiennes à son actif, dont Avatar, Sin City et 300, la boîte québécoise deffets spéciaux Hybride sest hissée aux plus hauts sommets. Au point où certains studios pensent que son code régional 450 à Piedmont est celui dune banlieue de Los Angeles. «Cest la boîte deffets spéciaux qui men donne le plus pour mon argent», dit le cinéaste Robert Rodriguez, qui a réalisé les effets spéciaux de 11 films avec Hybride. Pas mal pour une entreprise née des suites dune faillite il y a 20 ans.

via Effets spéciaux: la banlieue québécoise dHollywood | La Presse.

Activating the Paint tool in scripting


Easy. You do it like this:

# Python
Application.PaintTool()
# JScript
PaintTool();

The real question is “how would you know about this undocumented command?”.

There’s several ways.

  • Maybe you grepped through Application\DSScripts\*.vbs for “Paint” or “Tool” and found %XSI_HOME%\Application\DSScripts\tools.vbs
  • Maybe you searched Application.Commands for the regular expression /Tool/ig.
  • Maybe you searched the XSI mailing list (Paint Tool by script )

Grouping parameters on an ICE compound PPG


In 2012 AP, you can create groups for your ICE compound PPGs:

  • Edit compound
  • Right-click exposed port
  • Click Properties
  • Use the Group box to add the parameter to a group

Editing the .xsicompound XML may still be the fastest way to do the grouping for large number of parameters. Especially if you’re a markup geek.

The SDK includes a new GetICECompoundPortProperties command that I think makes it possible to write a plugin that pops up a “group editor”. I’m thinking a grid control where you can edit the groups for all parameters, and then call EditExposedParamInICECompoundNode to apply the changes.

Before I knew about this new GetICECompoundPortProperties, I had started writing such a plugin only to find myself blocked because I couldn’t get all the port properties. I had managed to get the groups by parsing through the PPGLayout items, but now that will be even easier with GetICECompoundPortProperties.