View Full Version : xsi expression / scripting operators
10-11-2006, 03:33 PM
i wrote an expression in maya and would like to rebuild the scene in xsi, but i'm new to xsi. i regognized, that expressions in xsi are very limited (no local var. etc.) and in scripting operators i can't define vector var..
i thought of writing a script in vbscript which syntax is similar to mel and expressions in maya, and execute it each frame (which should be possible by executing the vbscript from an expression).
do you have tips for me doing it better? or any advices?
thanks for all.
10-11-2006, 04:56 PM
i want to describe my problem more exact.
yes, i need a vector variable and i can delcare it in vbscript, but not in an expression. so i write an script and want to execute it each frame as is the "on frame change script". But here in the "on frame change script" in the playback options i have to write the whole script in the command line? How can i execute a script from the command line by only typing the data name of the script file (e.g. "hello.vbs") and where do i have to save the script?
For the test i just wrote a one line script like "LogMessage ("Hello")". It works in the script editor, but when i save it in a file named "hello.vbs" in the script directory of the actual project and then type "hello" or "hello.vbs" in the command line or the script editor, it doesn't execute. Why not? Is it possible?
Do i have to declare a function in the script file like
and then execute it? But it doesn't work as well. It's really difficult to find help on this topic.
What exactly is it that you intend to do? I wouldn't use per-frame scripts, that opens up a lot of pitfalls.
10-11-2006, 06:57 PM
To call a script, all you have to do is drag it to a toolbar. Then you get a pop-up asking you to save the script. Choose Script Command (external file) and type in the command name, for example hello.
Now if you type hello in the script editor, the command gets executed, whether it contains a function or not.
This is not what you want to do though. What you are looking for is called a Scripted Operator in XSI, which is a way of expanding expressions to use VBScripting, with variables, functions...
When you create your ScriptedOP you have the option to make it Always Evaluate. That will make it interactive on frame change.
The trick is to make it interactive without changing the frame, but I don't think you do need that now.
In any case, our upcoming Automatic Rigging DVD series will feature a volume dedicated to General Tool Scipting in XSI as well as creating advanced rigs through scripting.
I hope that was of help to you.
10-11-2006, 07:25 PM
i'm working on scripted operators now.
10-11-2006, 07:25 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2014, Jelsoft Enterprises Ltd.