|
|
|
Tell us what you think of the site.
|
Autodesk Media & Entertainment User Community
|
Autodesk® 3ds Max®
|
|
Autodesk® Maya®
|
|
Autodesk® Softimage®
|
|
Autodesk® MotionBuilder®
|
|
Autodesk® Mudbox™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Autodesk® Smoke on Mac®
|
| how to program inside a model?
|
|
|
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.
|
|
|
|
[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.
|
|
|
|
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="][DU1] [/FONT]
RemoveAllCns
‘SetMarking “pos.posy” + SetMarking “Biped.Head bone.length” /2
|
|
|
|
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.
|
|
|
|
WOW,
and you didnt use this or this_model.....
i will try it later on=)
thanks Sebas
|
|
|
|
|
|