Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Softimage® / XSI SDK / how to program inside a model?
  RSS 2.0 ATOM  

how to program inside a model?
Rate this thread
 
30093
 
Permlink of this thread  
avatar
  • sfu_pelos
  • Posted: 08 September 2008 02:21 AM
  • Total Posts: 101
  • Joined: 21 February 2008 10:12 AM

how do you use, this.  and this_model
for script?
i want to create a circle and parent it to the head bone.
but i want to do a scrip, where i just select the model i want to use it and run it.

thanks guys.



Replies: 0
avatar

[B]Selection[/B] is the variable that gives you a collection of all the selected object. To get the first object of you selection, use S[B]election(0)[/B]. I t works fine if you only have one object selected.



Replies: 0
avatar
  • sfu_pelos
  • Posted: 09 September 2008 02:22 AM

Thanks Sebas, how could apply it in here?  is just a scripthat i got from the scrip editor as i did it by hand.  i saw some examples in XSI SDK guides that you can create geometry inside a Model, kinda rig guides.

i want to select the model and run the scrip.  (if not i will do it the old way, set it to be parented to a model “biped” run the scrip and then change the model.  clear the scene, and add another character and do the same for each.

(1 more thing do you know how to move objects relative to a space?

i want to move the shadow null of the neck half of the lengh of the neck bone, can i expression that? or how i could do it?)

Thanks for the help with scripting =)




Creat a circle so the Eyes look at it
CreatePrim “Circle”, “NurbsCurve”
SetValue “circle.Name”, “Eyes_Target”
SetValue “Eyes_Target.circle.radius”, 1
ApplyCns “Position”, “Eyes_Target”, “biped.Head"[FONT=&quot][DU1] [/FONT]
RemoveAllCns
‘SetMarking “pos.posy” + SetMarking “Biped.Head bone.length” /2



Replies: 0
avatar

Here is an easy way for your script:

‘Set the Model you want to use
set oModel = selection(0)
‘set the eye target object, the third argument is your objects name, the last is its parent
Set oEyes_Target = CreatePrim ("Circle", “NurbsCurve”,"Eyes_Target" ,oModel )
SetValue oEyes_Target&".circle.radius", 1
ApplyCns “Position”, oModel&".head" ,oEyes_Target

For your expression, you might have a probleme setting it, because, using a parameter to drive an other parameter on that object creates a cycle, and you would get unstable behavior. But to start with expression, search for “expression” in xsi’s help file, it should help you.



Replies: 0
avatar
  • sfu_pelos
  • Posted: 09 September 2008 04:00 AM

WOW,
and you didnt use this or this_model.....

i will try it later on=)
thanks Sebas



Replies: 0