3d forums home Resources for 3d artists

Softimage Xsi: Scripting (Parenting)

Posted: March 22, 2007
AmberPrince
Hi all


I want to do what I would consider a simple task and XSI is driving me crazy.


What I want to do is (in VB scripting I guess) parent one object to another.

Now these objects belong to a Model, (and I don't know the name of the model (because this will be aplied to a lot of different files and the Model name changes from file to file))


I wish I could do:

ParentObj "*.chest", "*.Cube"


but it doesn't let me..


In the end I got it working with:

SelectObj "*.chest"

Set oReturn = GetValue("SelectionList")

For Each r In oReturn

Set theChest = r

Next


SelectObj "*.Cube"

Set oReturn2 = GetValue("SelectionList")

For Each r2 In oReturn2

Set theCube = r2

Next


ParentObj theChest, theCube


But it seems crazy to do all that for such a simple thing.


What would be the right way to go about doing this?


I also would like to assign to a variable my selection. Like:

theChest = SelectObj "*.chest"

but ofcourse I can't do that... Sad Sad Sad

What would the right format to do this be?


Help!!


Thanks


Goosh