|
Hi,
A simple hack for this is to use the script editor to read the commands XSI churns out when you change values in the interface. In your case, the text>curves is created with the following command:
CreatePrim("Text", “NurbsCurve”, “myText”, null);
myText is the name of the Text prmitive, by default the first instance in XSI would be called ‘text’, 2nd ‘text1’ and so on.
When you change the default ‘text’ in the Text primitive, say set it to ‘hello world!, the script editor shows the following command:
SetValue("myText.text.text", “_RTF_{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl{\\f0\\fnil\\fprq5\\fcharset0 Arial;}}\r\n\\viewkind4\\uc1\\pard\\lang2057\\f0\\fs20 hello world!\\par\r\n}\r\n”, null);
All the stuff which goes in the second argument is how XSI describes the rich text formatting. The very last bit is where the display text actually goes (hello world!) in the above case.
As you noted, the value in the textbox isn’t animatable using the interace. Off the top of my head there are two approaches I can think of:
1. Fire off a timer in your script and at specific intervals use the SetProperty command to set new values.
2. Set off a loop which checks the current frame number and based on that value use the SetProperty command to set new text values.
I would go with the 2nd method as that offers more control and should be easier to set up. Also, I really don’t know how the first option would resolve at render time.
Hope this helps.
|