Re: IK FK switch with an On Selection Event

Date : Mon, 10 Dec 2007 18:40:22 +0100
To : XSI(at)Softimage.COM
From : André Adam <a_adam(at)49games.de>
Subject : Re: IK FK switch with an On Selection Event
Nope, that's pretty much it. The property holds a piece of script code as a string (most simple case possible: a single command), which gets executed using the eval method.

var oProp = ActiveSceneRoot.AddProperty("CustomProperty", false, "StringCommand");
oProp.AddParameter3("paramCommand", siString, "LogMessage(\"Hi!\")");
eval(oProp.Parameters("paramCommand").Value);




Frank Lenhard wrote:
hm no.
here is a copy&paste from Brad's reply:

"
1- Create a custom property node that can store some kind of text data. A
CustomProperty will work, or a user data blob, etc. This text data will be
the name of any XSI Command.
2- Name the node "LocalEvent" or something similar.
3- Write a custom event that looks for a property node named "LocalEvent" on
any X3DObject you select. If the "LocalEvent" property node exists, run the
command stored in the node.
"

the problem part seems the last 7 words :/

or do i understand the eval function wrong?

ciao
franky


Monday, December 10, 2007, 6:04:53 PM, you wrote:

GL> I mean :

GL> var Thanks = "LogMessage(\"Completely forget this function :-). Thanks
GL> Andre.\");"

GL> eval(Thanks)

GL> Better like this ;-)


GL> Guillaume Laforge a écrit :
var Thanks = LogMessage("Completely forget this function :-). Thanks Andre.");

eval(Thanks)

:)


André Adam a écrit :
how do you execute a script from within a script?
Evaluates JScript code and executes it.

*eval(*/codeString/*)*
The required /codeString/ argument is a string value that contains valid JScript code. This string is parsed by the JScript parser and executed.



Something like this? Cheers!

-André


Guillaume Laforge wrote:
Hi Franck,

Glad it helps you !

i was playing with your implementation. i wondered, is it mandantory
to put keys on the chains while manipulating it?
You can turn off "AutoKeys IK/FK rig on Selection" if you think it is not a good thing ;-). But as you should keep the IK and FK chains with same transformations on keyframes, you must key all the rig before moving in the timeline.

how do you execute a script from within a script?
I don't know how to tell a string to be a command so ask Brad or maybe take a look at xproc from Halim Negadi <http://halim.negadi.free.fr/> ?

If you want to give some feedback on this IK/FK setup, feel free to post on my blog ;-).
If this method looks valid I will send it as an article for XSI blog who is a great way to centralize xsi techniques.



Cheers

Guillaume


Frank Lenhard a écrit :
thanks gillaume!! thats a great help and starting point for me.
i didnt understand everything perfectly so far but it gets me started!

brad's idea is still in my head an i wonder how to implement it. he
basically suggested to create a onselection event handler that looks
for a certain property (like yours) but then, when it find one,
executes the code that is IN that property. so the code is not
prefixed to whats in the event handler.
how do you execute a script from within a script?

i was playing with your implementation. i wondered, is it mandantory
to put keys on the chains while manipulating it? i think of it more as
a perfect pose tool, where you can move or rotate everything in place.
IK/FK stays together always. if you set an ik key, and therefore lock
the hands in place, or an FK key and there get nice arcs, is up to the
type of key you set. not what you moved or rotated.
with setting keys while manipulating i see problems on the horizon.

beside my thoughts, i am very happy to have a example to study! thanks
so much.

ciao
franky


Monday, December 10, 2007, 11:16:27 AM, you wrote:

JKP> Thanks Guillaume for this.

JKP> JKP> We’ve setup our custom rig  EXACTLY the same way.

JKP> JKP> Cheers ;)

JKP> JKP> Jm

JKP> JKP> --- jm Khayat  / PINKA Studio ---

JKP> --- 04 50 08 41 12 / www.pinka-prod.com ---

JKP> JKP> JKP> JKP> From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of
JKP> guillaume laforge
JKP> Sent: dimanche 9 décembre 2007 20:32
JKP> To: xsi
JKP> Subject: IK FK switch with an On Selection Event


JKP> JKP> Hi,

JKP> I just wrote something about IK / FK and the On Selection Change event on my
JKP> blog <http://vol2blog.blogspot.com/> .


JKP> I put a project with plugins and scene demo.

JKP> Cheers




---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi
--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi

GL> --- GL> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: GL> unsubscribe xsi






--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi


--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.