PDA

View Full Version : Change Text via Expression?


virtualmic
09-14-2006, 08:40 AM
Hello,

Is it possible to change a text, via expression? For example, I want to show the value of a parameter in my final animation, so I was thinking of making a text object and changing its value via an expression.

I am unable to figure out how to do so, as it is not clear what parameter stores the text info.

TIA for your help.

Saurabh.

AnIm
09-14-2006, 02:20 PM
you cannot set xpression directly on the text, since it is not an animatable parameter
but you can set scripted operator

here is an example (JScript)


NewScene(null, null);
text = CreatePrim("Text", "NurbsCurve", null, null);
code = txt_Update.toString();
scop = AddScriptedOp("text.text", code, "text.text", "txt", "JScript", 0);
scop.alwaysevaluate = true
PlayForwardsFromStart();
function txt_Update(In_UpdateContext, Out , In)
{
Out.value.text.value = In_UpdateContext.CurrentFrame
}

virtualmic
09-16-2006, 06:52 AM
Thanks for the tip AnIm. That was great help. Just that I don't know much about XSI scripting. I'll use your script as it is, with the modifications. But now I am making a point to learn more about it..:)

kimaldis
09-18-2006, 09:52 PM
If you're using it to display information about your scene, this tool may be of use to you.

http://www.kim-aldis.co.uk/index.php?option=com_content&task=view&id=37&Itemid=59

CGTalk Moderation
09-18-2006, 09:52 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.